* { 
    font-family: 'Inter', -apple-system, sans-serif; 
}

body { 
    background: #0A0F1F; 
    overflow-x: hidden; 
}

::-webkit-scrollbar { 
    width: 4px; 
    height: 4px; 
}
::-webkit-scrollbar-track { 
    background: #0A0F1F; 
}
::-webkit-scrollbar-thumb { 
    background: #2A2F3F; 
    border-radius: 2px; 
}
::-webkit-scrollbar-thumb:hover { 
    background: #6B7280; 
}

.bg-main {
    background: radial-gradient(ellipse at 20% 50%, #1A1F2F 0%, transparent 50%),
                radial-gradient(ellipse at 80% 20%, #1A1F2F 0%, transparent 50%),
                radial-gradient(ellipse at 50% 80%, #151A2A 0%, transparent 50%),
                #0A0F1F;
    min-height: 100vh;
}

.glass {
    background: rgba(10, 15, 31, 0.7);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.glass-dark {
    background: rgba(10, 15, 31, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.neon-glow {
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.1), 0 0 20px rgba(255, 255, 255, 0.05);
}
.neon-text { 
    color: #FFFFFF; 
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.4); 
}

.snowflake {
    position: fixed;
    color: white;
    opacity: 0.5;
    pointer-events: none;
    z-index: 0;
    animation: snowfall linear infinite, sway ease-in-out infinite;
    filter: drop-shadow(0 0 3px rgba(200, 210, 230, 0.4));
}

@keyframes snowfall {
    0% { transform: translateY(-10vh); }
    100% { transform: translateY(110vh); }
}

@keyframes sway {
    0%, 100% { margin-left: 0px; }
    25% { margin-left: 10px; }
    50% { margin-left: -5px; }
    75% { margin-left: 12px; }
}

.particle {
    position: fixed;
    width: 2px;
    height: 2px;
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
    animation: particleRise linear infinite, particleGlow ease-in-out infinite;
}

@keyframes particleRise {
    0% { transform: translateY(100vh); opacity: 0; }
    10% { opacity: 0.8; }
    90% { opacity: 0.8; }
    100% { transform: translateY(-10vh); opacity: 0; }
}

.fade-in { 
    animation: fadeIn 0.4s ease forwards; 
    opacity: 0; 
}
@keyframes fadeIn {
    to { opacity: 1; transform: translateY(0); }
    from { opacity: 0; transform: translateY(8px); }
}

.frost-input {
    background: rgba(10, 15, 31, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: white;
    transition: all 0.3s ease;
    font-size: 15px !important;
}
.frost-input:focus {
    border-color: rgba(255, 255, 255, 0.4);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.1);
    outline: none;
}
.frost-input::placeholder {
    color: #6B7280;
}

.btn-gradient {
    background: linear-gradient(135deg, #D1D5DB, #9CA3AF);
    color: #0A0F1F;
    transition: all 0.3s ease;
    font-weight: 600;
}
.btn-gradient:hover {
    background: linear-gradient(135deg, #E5E7EB, #B0B7C3);
    box-shadow: 0 4px 15px rgba(255, 255, 255, 0.1);
}

.sidebar-item {
    transition: all 0.3s ease;
    position: relative;
    color: #9CA3AF;
}
.sidebar-item:hover, .sidebar-item.active {
    background: rgba(255, 255, 255, 0.08);
    color: #FFFFFF;
}
.sidebar-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: #FFFFFF;
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.5);
    border-radius: 0 2px 2px 0;
}


.select-frost {
    background: rgba(10, 15, 31, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: white;
    transition: all 0.3s ease;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' fill='%23FFFFFF' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    font-size: 14px;
}
.select-frost:focus {
    border-color: rgba(255, 255, 255, 0.4);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.1);
    outline: none;
}

.badge-active { background: rgba(0, 255, 163, 0.15); color: #00FFA3; }
.badge-inactive { background: rgba(239, 68, 68, 0.15); color: #F87171; }
.badge-warning { background: rgba(234, 179, 8, 0.15); color: #FACC15; }
.badge-admin { background: rgba(165, 180, 252, 0.15); color: #A5B4FC; }
.badge-user { background: rgba(147, 197, 253, 0.15); color: #93C5FD; }
.badge-owner { background: rgba(253, 186, 116, 0.15); color: #FDBA74; }
.badge-expired { background: rgba(165, 243, 252, 0.12); color: #A5F3FC; }

.modal-overlay {
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(3px);
}

.tab-active {
    color: #FFFFFF;
    border-bottom: 2px solid #FFFFFF;
}

.top-bar-action-btn {
    background: linear-gradient(135deg, #D1D5DB, #9CA3AF);
    color: #0A0F1F;
    border-radius: 10px;
    padding: 5px 12px;
    font-size: 11px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    min-height: 32px;
}
.top-bar-action-btn i {
    font-size: 10px;
}

#activation-error {
    transition: opacity 0.3s ease;
}
#activation-error.hidden {
    display: none;
}

.mobile-menu {
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    width: 260px !important;
}
.mobile-menu.open {
    transform: translateX(0);
}

@media (max-width: 768px) {
    .sidebar-overlay {
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.5);
        z-index: 40;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s ease;
    }
    .sidebar-overlay.open {
        opacity: 1;
        pointer-events: auto;
    }
    
    #sidebar {
        transform: translateX(-100%) !important;
        width: 260px !important;
    }
    #sidebar.open {
        transform: translateX(0) !important;
    }
    
    .page-content > div:first-child {
        margin-top: 60px;
    }
    
    button, .sidebar-item, input, select {
        min-height: 40px;
    }
    
    .modal-overlay + div {
        max-height: 85vh;
        overflow-y: auto;
    }
    
    .page-content { 
        padding-top: 0px !important; 
    }
    input, select, textarea { 
        font-size: 15px !important; 
    }
    .max-w-md { 
        max-width: 90% !important; 
    }
    
    .page-content > div:first-child .btn-gradient {
        display: none !important;
    }
}

@media (max-width: 640px) {
    .users-mobile-grid {
        display: flex;
        flex-direction: column;
        gap: 12px;
    }
    
    .user-card {
        background: rgba(10, 15, 31, 0.6);
        backdrop-filter: blur(10px);
        border: 1px solid rgba(255, 255, 255, 0.1);
        border-radius: 16px;
        padding: 14px;
        position: relative;
    }
    
    .user-card-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 12px;
        padding-bottom: 8px;
        border-bottom: 1px solid rgba(255,255,255,0.05);
    }
    
    .user-id {
        font-size: 11px;
        color: #6B7280;
        background: rgba(0,0,0,0.3);
        padding: 2px 8px;
        border-radius: 20px;
    }
    
    .user-role-badge {
        font-size: 10px;
        padding: 3px 10px;
        border-radius: 20px;
        font-weight: 600;
    }
    
    .user-info-row {
        display: flex;
        margin-bottom: 8px;
        align-items: center;
    }
    
    .user-info-label {
        width: 70px;
        font-size: 11px;
        color: #9CA3AF;
    }
    
    .user-info-value {
        flex: 1;
        font-size: 13px;
        font-weight: 500;
        color: white;
        word-break: break-word;
    }
    
    .user-status-row {
        display: flex;
        align-items: center;
        margin-bottom: 16px;
    }
    
    .user-status-badge {
        display: inline-flex;
        align-items: center;
        gap: 4px;
        padding: 4px 12px;
        border-radius: 20px;
        font-size: 11px;
        font-weight: 600;
    }
    
    .user-actions {
        display: flex;
        justify-content: flex-end;
        gap: 6px;
        margin-top: 8px;
        padding-top: 8px;
        border-top: 1px solid rgba(255,255,255,0.05);
    }
    
    .user-action-btn {
        background: rgba(255,255,255,0.03);
        border: 1px solid rgba(255,255,255,0.05);
        border-radius: 12px;
        padding: 8px 14px;
        font-size: 11px;
        color: #9CA3AF;
        transition: all 0.2s;
        display: inline-flex;
        align-items: center;
        gap: 4px;
    }
    
    .user-action-btn:hover {
        background: rgba(255, 255, 255, 0.08);
        color: #FFFFFF;
        border-color: rgba(255, 255, 255, 0.2);
    }
    
    .keys-mobile-grid {
        display: flex;
        flex-direction: column;
        gap: 12px;
    }
    
    .key-card {
        background: rgba(10, 15, 31, 0.6);
        backdrop-filter: blur(10px);
        border: 1px solid rgba(255, 255, 255, 0.1);
        border-radius: 16px;
        padding: 16px;
    }
    
    .key-card-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 16px;
        padding-bottom: 12px;
        border-bottom: 1px solid rgba(255,255,255,0.05);
    }
    
    .key-code {
        font-family: monospace;
        font-size: 13px;
        font-weight: 600;
        color: #FFFFFF;
        word-break: break-all;
        max-width: 70%;
    }
    
    .key-status-badge {
        font-size: 9px;
        padding: 3px 8px;
        border-radius: 20px;
        font-weight: 600;
        white-space: nowrap;
    }
    
    .key-info-row {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 12px;
        padding-bottom: 8px;
        border-bottom: 1px solid rgba(255,255,255,0.03);
    }
    
    .key-info-label {
        font-size: 11px;
        color: #9CA3AF;
        font-weight: 500;
    }
    
    .key-info-value {
        font-size: 12px;
        font-weight: 600;
        color: white;
        text-align: right;
    }
    
    .key-user-row {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-top: 8px;
        padding: 10px 12px;
        background: rgba(255, 255, 255, 0.03);
        border-radius: 10px;
    }
    
    .key-user-name {
        font-size: 12px;
        color: white;
        display: flex;
        align-items: center;
        gap: 4px;
    }
    
    .key-user-name i {
        color: #FFFFFF;
        font-size: 11px;
    }
    
    .key-action-icons {
        display: flex;
        gap: 8px;
    }
    
    .key-icon-btn {
        background: rgba(255,255,255,0.05);
        border: 1px solid rgba(255,255,255,0.05);
        border-radius: 8px;
        padding: 8px;
        color: #9CA3AF;
        transition: all 0.2s;
        display: flex;
        align-items: center;
        justify-content: center;
        min-width: 36px;
    }
    
    .key-icon-btn:hover {
        background: rgba(255, 255, 255, 0.08);
        color: #FFFFFF;
        border-color: rgba(255, 255, 255, 0.2);
    }
    
    .key-icon-btn i {
        font-size: 14px;
    }
    
    .desktop-table {
        display: none !important;
    }
}

@media (min-width: 641px) {
    .mobile-grid-view {
        display: none !important;
    }
    .desktop-table {
        display: table !important;
    }
}

@media (min-width: 769px) {
    .page-content > div:first-child .btn-gradient {
        display: flex !important;
    }
    
    .frost-table th {
        padding: 12px 16px !important;
        font-size: 12px !important;
        color: #9CA3AF;
    }
    
    .frost-table td {
        padding: 12px 16px !important;
        font-size: 13px !important;
        color: white;
    }
    
    .frost-table td .badge-owner,
    .frost-table td .badge-admin,
    .frost-table td .badge-user,
    .frost-table td .badge-active,
    .frost-table td .badge-inactive,
    .frost-table td .badge-warning,
    .frost-table td .badge-expired {
        padding: 4px 12px !important;
        font-size: 11px !important;
    }
    
    .frost-table td button {
        padding: 6px 10px !important;
    }
    
    .frost-table td button i {
        font-size: 12px !important;
    }
    
    #page-users h1,
    #page-keys h1 {
        font-size: 24px !important;
        color: white;
    }
    
    #page-users p,
    #page-keys p {
        font-size: 14px !important;
        color: #9CA3AF;
    }
    
    .page-content .btn-gradient {
        font-size: 13px !important;
        padding: 10px 20px !important;
    }
    
    .frost-input {
        font-size: 14px !important;
        padding: 10px 16px !important;
    }
    
    .select-frost {
        font-size: 14px !important;
        padding: 10px 32px 10px 16px !important;
    }

    .frost-input.pl-8 {
        padding-left: 36px !important;
    }
    
    .frost-input.pl-9 {
        padding-left: 40px !important;
    }
    
    .frost-input.pl-11 {
        padding-left: 44px !important;
    }
    
    .frost-input.pr-10 {
        padding-right: 40px !important;
    }
    
    .relative i.absolute {
        font-size: 16px !important;
        color: #9CA3AF;
    }
    
    .relative .fa-search {
        left: 14px !important;
    }
    
    .modal-content .frost-input.pl-7 {
        padding-left: 32px !important;
    }
    
    .modal-content .relative i.absolute {
        font-size: 14px !important;
        left: 12px !important;
    }
    
    .modal-overlay + div .frost-input {
        padding-top: 12px !important;
        padding-bottom: 12px !important;
    }
    
    .modal-overlay + div .relative i.absolute {
        font-size: 15px !important;
    }
    
    .modal-overlay + div .pl-7 {
        padding-left: 34px !important;
    }
    
    .modal-overlay + div .pl-8 {
        padding-left: 38px !important;
    }
    
    .modal-overlay + div .pl-9 {
        padding-left: 42px !important;
    }
    
    .select-frost {
        background-position: right 16px center !important;
        padding-right: 40px !important;
    }
    
    .desktop-table {
        display: table !important;
        width: 100%;
    }
    
    .desktop-table .frost-table {
        min-width: 100%;
    }
}

@media (max-width: 768px) {
    .top-bar-action-btn {
    }
}

.duration-btn.active-duration {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.4) !important;
    color: #FFFFFF;
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.1);
}

.activation-btn.active-activation {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.4) !important;
    color: #FFFFFF;
}

.badge-active { background: rgba(0, 255, 163, 0.15); color: #00FFA3; }
.badge-inactive { background: rgba(239, 68, 68, 0.15); color: #F87171; }
.badge-warning { background: rgba(234, 179, 8, 0.15); color: #FACC15; }
.badge-expired { background: rgba(165, 243, 252, 0.12); color: #A5F3FC; }
.badge-admin { background: rgba(165, 180, 252, 0.15); color: #A5B4FC; }
.badge-user { background: rgba(147, 197, 253, 0.15); color: #93C5FD; }
.badge-owner { background: rgba(253, 186, 116, 0.15); color: #FDBA74; }
.badge-test { background: rgba(83, 255, 255, 0.15); color: #53FFFF; }

.key-status-badge.badge-expired {
    background: rgba(165, 243, 252, 0.12);
    color: #A5F3FC;
}

input[type="checkbox"].test-key-check,
input[type="checkbox"].test-key-check-all {
    accent-color: #00FFA3;
    width: 14px;
    height: 14px;
    cursor: pointer;
    vertical-align: middle;
}