* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-dark: #050505;
    --bg-surface: rgba(15, 15, 15, 0.65);
    --bg-surface-solid: #0f0f0f;
    --border-light: rgba(255, 255, 255, 0.08);
    --border-medium: rgba(255, 255, 255, 0.12);
    --text-primary: #f5f5f5;
    --text-secondary: #a0a0a0;
    --text-muted: #5a5a5a;
    --accent: #6b6b6b;
    --accent-hover: #808080;
    --danger: #7a7a7a;
    --success: #6b6b6b;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --shadow-sm: 0 4px 20px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 8px 32px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.5);
    --transition: all 0.2s cubic-bezier(0.2, 0.9, 0.4, 1.1);
}

body {
    font-family: 'Inter', system-ui, sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    overflow: hidden;
    position: relative;
}

.bg-gradient {
    position: fixed;
    inset: 0;
    background: radial-gradient(circle at 20% 30%, rgba(30, 30, 30, 0.3) 0%, transparent 70%),
                radial-gradient(circle at 80% 70%, rgba(40, 40, 40, 0.2) 0%, transparent 60%);
    pointer-events: none;
}

.stars-layer {
    position: fixed;
    inset: 0;
    background-image: 
        radial-gradient(2px 2px at 10% 20%, #fff, transparent),
        radial-gradient(1px 1px at 30% 60%, #ccc, transparent),
        radial-gradient(1.5px 1.5px at 70% 40%, #ddd, transparent),
        radial-gradient(1px 1px at 85% 85%, #fff, transparent);
    background-size: 200px 200px, 300px 300px, 250px 250px, 400px 400px;
    background-repeat: repeat;
    opacity: 0.3;
    pointer-events: none;
    animation: starsMove 60s linear infinite;
}

.noise {
    position: fixed;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.03'/%3E%3C/svg%3E");
    pointer-events: none;
    opacity: 0.4;
}

.orb-1, .orb-2, .orb-3 {
    position: fixed;
    border-radius: 50%;
    filter: blur(80px);
    pointer-events: none;
    opacity: 0.3;
}

.orb-1 {
    width: 60vmax;
    height: 60vmax;
    background: radial-gradient(circle, rgba(80, 80, 80, 0.2) 0%, transparent 70%);
    top: -30vmax;
    right: -30vmax;
    animation: float 25s ease-in-out infinite;
}

.orb-2 {
    width: 50vmax;
    height: 50vmax;
    background: radial-gradient(circle, rgba(100, 100, 100, 0.15) 0%, transparent 70%);
    bottom: -25vmax;
    left: -25vmax;
    animation: float 20s ease-in-out infinite reverse;
}

.orb-3 {
    width: 40vmax;
    height: 40vmax;
    background: radial-gradient(circle, rgba(60, 60, 60, 0.2) 0%, transparent 70%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: pulse 15s ease-in-out infinite;
}

@keyframes starsMove {
    from { background-position: 0 0, 0 0, 0 0, 0 0; }
    to { background-position: 200px 200px, 300px 300px, 250px 250px, 400px 400px; }
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    33% { transform: translate(3%, 2%) rotate(5deg); }
    66% { transform: translate(-2%, 3%) rotate(-3deg); }
}

@keyframes pulse {
    0%, 100% { opacity: 0.2; transform: translate(-50%, -50%) scale(1); }
    50% { opacity: 0.4; transform: translate(-50%, -50%) scale(1.1); }
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.96); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(100px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes slideInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.spin {
    animation: spin 1s linear infinite;
}

.app-wrapper {
    position: relative;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    z-index: 1;
}

.login-container {
    width: 100%;
    max-width: 440px;
}

.login-card {
    position: relative;
    background: var(--bg-surface);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 40px 32px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    animation: fadeIn 0.5s ease;
}

.card-glow {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, transparent 0%, rgba(100, 100, 100, 0.05) 50%, transparent 100%);
    pointer-events: none;
}

.brand {
    text-align: center;
    margin-bottom: 36px;
}

.brand-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    color: var(--accent);
}

.brand-icon svg {
    width: 100%;
    height: 100%;
}

.brand h1 {
    font-size: 28px;
    font-weight: 500;
    letter-spacing: -0.5px;
    line-height: 1.2;
    margin-bottom: 8px;
}

.brand h1 span {
    font-weight: 300;
    color: var(--text-secondary);
}

.brand-badge {
    display: inline-block;
    font-size: 10px;
    letter-spacing: 1.5px;
    color: var(--text-muted);
    text-transform: uppercase;
    background: rgba(255, 255, 255, 0.05);
    padding: 4px 12px;
    border-radius: 20px;
}

.token-field {
    margin-bottom: 24px;
}

.field-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.field-label svg {
    width: 12px;
    height: 12px;
}

.field-input-wrapper {
    position: relative;
    margin-bottom: 10px;
}

.field-input-wrapper input {
    width: 100%;
    padding: 14px 42px 14px 16px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 14px;
    font-family: monospace;
    transition: var(--transition);
}

.field-input-wrapper input:focus {
    outline: none;
    border-color: var(--accent);
    background: rgba(0, 0, 0, 0.6);
}

.field-input-wrapper input::placeholder {
    color: var(--text-muted);
    font-family: 'Inter', monospace;
    font-size: 12px;
}

.toggle-visibility {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    padding: 4px;
    display: flex;
    transition: var(--transition);
}

.toggle-visibility:hover {
    color: var(--text-secondary);
}

.field-hint {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: var(--text-muted);
}

.field-hint svg {
    width: 12px;
    height: 12px;
}

.btn-login {
    width: 100%;
    padding: 14px;
    background: var(--accent);
    border: none;
    border-radius: var(--radius-sm);
    color: white;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: var(--transition);
}

.btn-login:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
}

.btn-login:active {
    transform: translateY(0);
}

.token-help {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 24px;
    font-size: 11px;
    color: var(--text-muted);
    flex-wrap: wrap;
}

.token-help svg {
    width: 12px;
    height: 12px;
}

.token-help small {
    width: 100%;
    text-align: center;
    margin-top: 6px;
    opacity: 0.7;
}

.dashboard {
    display: flex;
    width: 100%;
    height: 100%;
    gap: 20px;
    animation: fadeIn 0.4s ease;
}

.sidebar {
    width: 280px;
    background: var(--bg-surface);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    box-shadow: var(--shadow-sm);
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-light);
}

.logo {
    width: 36px;
    height: 36px;
    color: var(--accent);
}

.logo svg {
    width: 100%;
    height: 100%;
}

.logo-text {
    display: flex;
    flex-direction: column;
}

.logo-text strong {
    font-size: 16px;
    font-weight: 600;
    letter-spacing: -0.3px;
}

.logo-text span {
    font-size: 10px;
    color: var(--text-muted);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-light);
}

.avatar-wrapper {
    position: relative;
}

.avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border-medium);
}

.avatar-status {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 10px;
    height: 10px;
    background: var(--success);
    border-radius: 50%;
    border: 2px solid var(--bg-surface-solid);
}

.user-info {
    flex: 1;
}

.user-name {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 2px;
}

.user-tag {
    font-size: 11px;
    color: var(--text-muted);
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.nav-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    font-size: 13px;
    font-weight: 500;
}

.nav-btn svg {
    width: 18px;
    height: 18px;
}

.nav-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.nav-btn.active {
    background: rgba(100, 100, 100, 0.15);
    color: var(--text-primary);
    border-left: 2px solid var(--accent);
}

.logout-btn {
    margin-top: auto;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: transparent;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
    font-size: 13px;
}

.logout-btn:hover {
    border-color: var(--danger);
    color: var(--text-primary);
    background: rgba(100, 100, 100, 0.1);
}

.main-content {
    flex: 1;
    background: var(--bg-surface);
    backdrop-filter: blur(20px);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.content-header {
    padding: 20px 28px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.content-header h2 {
    font-size: 22px;
    font-weight: 500;
    letter-spacing: -0.3px;
}

.search-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(0, 0, 0, 0.3);
    padding: 8px 16px;
    border-radius: 40px;
    border: 1px solid var(--border-light);
    transition: var(--transition);
}

.search-wrapper:focus-within {
    border-color: var(--accent);
    background: rgba(0, 0, 0, 0.5);
}

.search-wrapper svg {
    width: 16px;
    height: 16px;
    color: var(--text-muted);
}

.search-wrapper input {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 13px;
    outline: none;
    min-width: 200px;
}

.search-wrapper input::placeholder {
    color: var(--text-muted);
}

.content-area {
    flex: 1;
    overflow-y: auto;
    padding: 20px 28px;
}

.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 60px;
    color: var(--text-muted);
}

.loading-state svg {
    width: 32px;
    height: 32px;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 60px;
    color: var(--text-muted);
    text-align: center;
}

.empty-state svg {
    width: 48px;
    height: 48px;
    opacity: 0.5;
}

.items-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.item-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.item-card:hover {
    background: rgba(255, 255, 255, 0.03);
    border-color: var(--border-medium);
    transform: translateX(2px);
}

.item-card.selected {
    background: rgba(100, 100, 100, 0.1);
    border-color: var(--accent);
}

.item-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--accent);
}

.item-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
}

.item-avatar.server {
    border-radius: 12px;
}

.item-info {
    flex: 1;
}

.item-name {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 2px;
}

.item-meta {
    font-size: 11px;
    color: var(--text-muted);
}

.item-actions {
    display: flex;
    gap: 8px;
}

.action-btn-sm {
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-light);
}

.action-btn-sm:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--accent);
}

.action-btn-sm.danger:hover {
    border-color: var(--danger);
    color: var(--danger);
}

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.2s ease;
}

.modal-container {
    background: var(--bg-surface-solid);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-md);
    width: 90%;
    max-width: 420px;
    overflow: hidden;
    animation: slideInUp 0.3s ease;
}

.modal-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-light);
}

.modal-header svg {
    width: 20px;
    height: 20px;
    color: var(--accent);
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 500;
}

.modal-body {
    padding: 24px;
}

.modal-body p {
    color: var(--text-secondary);
    line-height: 1.5;
}

.modal-footer {
    display: flex;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid var(--border-light);
}

.modal-footer button {
    flex: 1;
    padding: 10px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.btn-primary {
    background: var(--accent);
    border: none;
    color: white;
}

.btn-primary:hover {
    background: var(--accent-hover);
}

.btn-secondary {
    background: transparent;
    border: 1px solid var(--border-light);
    color: var(--text-secondary);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--accent);
}

.progress-modal .modal-body {
    text-align: center;
}

.progress-text {
    margin-bottom: 16px;
    font-size: 14px;
    color: var(--text-secondary);
}

.progress-track {
    height: 4px;
    background: var(--border-light);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: var(--accent);
    transition: width 0.3s ease;
}

.notifications-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 1100;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.notification {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-surface-solid);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    min-width: 280px;
    max-width: 360px;
    animation: slideIn 0.3s ease;
    box-shadow: var(--shadow-md);
}

.notification svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.notification.success svg { color: var(--success); }
.notification.error svg { color: var(--danger); }
.notification.info svg { color: var(--accent); }

.notification-content {
    flex: 1;
    font-size: 13px;
    line-height: 1.4;
}

.hidden {
    display: none !important;
}

::-webkit-scrollbar {
    width: 5px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border-medium);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
}

@media (max-width: 768px) {
    .app-wrapper {
        padding: 16px;
    }
    
    .dashboard {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        flex-direction: row;
        flex-wrap: wrap;
        padding: 16px;
        gap: 16px;
    }
    
    .sidebar-header {
        flex: 1;
        border-bottom: none;
        padding-bottom: 0;
    }
    
    .user-profile {
        order: 2;
        width: 100%;
    }
    
    .sidebar-nav {
        order: 3;
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .logout-btn {
        order: 4;
        margin-top: 0;
    }
    
    .content-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-wrapper {
        width: 100%;
    }
    
    .search-wrapper input {
        width: 100%;
    }
    
    .content-area {
        padding: 16px;
    }
    
    .item-card {
        flex-wrap: wrap;
    }
    
    .item-actions {
        width: 100%;
        justify-content: flex-end;
    }
}
