/* ============================================
   DSASync — Premium Dark Design System
   ============================================ */

:root {
    --bg-base: #080c14;
    --bg-surface: #0f172a;
    --bg-elevated: #151f34;
    --bg-card: rgba(21, 31, 52, 0.65);
    --bg-input: #0b1120;

    --border: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(255, 255, 255, 0.16);

    --accent: #6366f1;
    --accent-dim: rgba(99, 102, 241, 0.15);
    --accent-hover: #818cf8;

    --green: #10b981;
    --green-dim: rgba(16, 185, 129, 0.14);
    --amber: #f59e0b;
    --amber-dim: rgba(245, 158, 11, 0.14);
    --red: #f43f5e;
    --red-dim: rgba(244, 63, 94, 0.14);
    --blue: #38bdf8;
    --blue-dim: rgba(56, 189, 248, 0.14);
    --purple: #a855f7;
    --purple-dim: rgba(168, 85, 247, 0.14);
    --github: #24292e;

    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;

    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 16px;
    --radius-xl: 22px;

    --shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 12px 36px -4px rgba(0, 0, 0, 0.55);

    --sidebar-w: 236px;
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html, body {
    height: 100%;
}

body {
    font-family: 'Inter', system-ui, sans-serif;
    background: var(--bg-base);
    color: var(--text-primary);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }

/* ============================================
   AUTH WALL
   ============================================ */

.auth-wall {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    padding: 24px;
}

.auth-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}

.auth-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.35;
}

.blob-1 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, #6c63ff, transparent 70%);
    top: -150px;
    left: -100px;
    animation: blobFloat 8s ease-in-out infinite;
}

.blob-2 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, #a855f7, transparent 70%);
    bottom: -100px;
    right: -80px;
    animation: blobFloat 10s ease-in-out infinite reverse;
}

.blob-3 {
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, #3b82f6, transparent 70%);
    top: 50%;
    left: 60%;
    animation: blobFloat 12s ease-in-out infinite;
}

@keyframes blobFloat {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(20px, -30px) scale(1.05); }
    66% { transform: translate(-15px, 20px) scale(0.95); }
}

.auth-card {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 420px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 40px 36px;
    box-shadow: var(--shadow-lg), 0 0 0 1px rgba(108,99,255,0.08);
    backdrop-filter: blur(20px);
}

.auth-logo {
    text-align: center;
    margin-bottom: 32px;
}

.logo-icon {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 12px;
}

.brand-logo-img {
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.brand-logo-auth {
    width: 56px;
    height: 56px;
}

.brand-logo-sidebar {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: block;
}

.sidebar-logo-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-logo h1 {
    font-size: 24px;
    font-weight: 700;
    background: linear-gradient(135deg, #fff 30%, var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 4px;
}

.auth-logo p {
    color: var(--text-secondary);
    font-size: 13px;
}

.auth-tabs {
    display: flex;
    gap: 4px;
    background: var(--bg-input);
    padding: 4px;
    border-radius: var(--radius);
    margin-bottom: 28px;
}

.auth-tab {
    flex: 1;
    padding: 8px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 500;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
}

.auth-tab.active {
    background: var(--bg-elevated);
    color: var(--text-primary);
    box-shadow: 0 1px 6px rgba(0,0,0,0.3);
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

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

.field label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.field input {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: var(--transition);
}

.field input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-dim);
}

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

.form-error {
    color: var(--red);
    font-size: 12px;
    text-align: center;
    padding: 8px 12px;
    background: var(--red-dim);
    border-radius: var(--radius-sm);
}

/* ============================================
   BUTTONS
   ============================================ */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 18px;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    white-space: nowrap;
}

.btn-primary {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(108,99,255,0.4);
}

.btn-primary:active { transform: none; }

.btn-github {
    background: var(--github);
    color: #fff;
    border-color: rgba(255,255,255,0.1);
}

.btn-github:hover {
    background: #2f363d;
    transform: translateY(-1px);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border-color: var(--border);
}

.btn-ghost:hover {
    background: var(--bg-elevated);
    color: var(--text-primary);
    border-color: var(--border-hover);
}

.btn-danger-ghost {
    background: transparent;
    color: var(--red);
    border-color: rgba(239,68,68,0.25);
    font-size: 12px;
}

.btn-danger-ghost:hover {
    background: var(--red-dim);
}

.btn-full { width: 100%; justify-content: center; }
.btn-sm { padding: 6px 14px; font-size: 12px; }
.btn-xs { padding: 4px 10px; font-size: 11px; }

/* ============================================
   APP LAYOUT
   ============================================ */

#app {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-w);
    min-width: var(--sidebar-w);
    background: linear-gradient(180deg, #0f172a 0%, #090e1a 100%);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 18px 0;
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 18px 18px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 12px;
    font-size: 22px;
}

.sidebar-title {
    font-size: 15px;
    font-weight: 800;
    letter-spacing: -0.01em;
    background: linear-gradient(135deg, #ffffff 0%, #cbd5e1 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.sidebar-nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 0 10px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: var(--transition);
    position: relative;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-primary);
    transform: translateX(2px);
}

.nav-item.active {
    background: linear-gradient(90deg, rgba(99, 102, 241, 0.16) 0%, rgba(99, 102, 241, 0.03) 100%);
    color: #818cf8;
    font-weight: 600;
    border-left: 3px solid #6366f1;
    padding-left: 9px;
}

.nav-icon {
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
}

.sidebar-footer {
    padding: 14px 12px;
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: rgba(15, 23, 42, 0.5);
}

.user-pill {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.04);
}

.avatar-sm {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 1.5px solid rgba(99, 102, 241, 0.4);
}

.avatar-placeholder {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.25), rgba(168, 85, 247, 0.25));
    border: 1.5px solid rgba(99, 102, 241, 0.4);
    color: #a5b4fc;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    flex-shrink: 0;
}

.user-info {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.user-name {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-email {
    font-size: 10px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Main content */
.main-content {
    flex: 1;
    overflow-y: auto;
    padding: 28px 36px;
    background: radial-gradient(circle at 10% 10%, rgba(99, 102, 241, 0.05) 0%, transparent 45%),
                radial-gradient(circle at 90% 90%, rgba(16, 185, 129, 0.04) 0%, transparent 45%),
                var(--bg-base);
}

.section { display: none; }
.section.active { display: block; }

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 28px;
}

.page-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
}

.page-subtitle {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* ============================================
   STATS GRID
   ============================================ */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: linear-gradient(145deg, rgba(22, 32, 54, 0.65) 0%, rgba(15, 23, 42, 0.8) 100%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-lg);
    padding: 18px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    backdrop-filter: blur(12px);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 18px -2px rgba(0, 0, 0, 0.35);
}

.stat-card:hover {
    border-color: rgba(99, 102, 241, 0.35);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px -2px rgba(0, 0, 0, 0.5);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.12) 50%, transparent 100%);
}

.stat-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.stat-body {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.stat-value {
    font-size: 26px;
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.02em;
    color: #fff;
    display: block;
}

.stat-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-secondary);
    display: block;
    margin-top: 4px;
}

.stat-total .stat-icon {
    background: radial-gradient(circle at top left, rgba(16, 185, 129, 0.25), rgba(16, 185, 129, 0.06));
    border-color: rgba(16, 185, 129, 0.35);
}
.stat-total .stat-value { color: #34d399; }

.stat-pending .stat-icon {
    background: radial-gradient(circle at top left, rgba(245, 158, 11, 0.25), rgba(245, 158, 11, 0.06));
    border-color: rgba(245, 158, 11, 0.35);
}
.stat-pending .stat-value { color: #fbbf24; }

.stat-processing .stat-icon {
    background: radial-gradient(circle at top left, rgba(56, 189, 248, 0.25), rgba(56, 189, 248, 0.06));
    border-color: rgba(56, 189, 248, 0.35);
}
.stat-processing .stat-value { color: #38bdf8; }

.stat-failed .stat-icon {
    background: radial-gradient(circle at top left, rgba(244, 63, 94, 0.25), rgba(244, 63, 94, 0.06));
    border-color: rgba(244, 63, 94, 0.35);
}
.stat-failed .stat-value { color: #f43f5e; }

/* ============================================
   SOLUTIONS PANEL
   ============================================ */

.solutions-panel {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

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

.panel-header h3 {
    font-size: 15px;
    font-weight: 600;
}

.filter-group {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.filter-input,
.filter-select {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 6px 12px;
    color: var(--text-primary);
    font-size: 12px;
    font-family: inherit;
    outline: none;
    transition: var(--transition);
}

.filter-input { min-width: 140px; }

.filter-input:focus,
.filter-select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-dim);
}

.filter-select option { background: var(--bg-elevated); }

.solutions-list {
    max-height: 60vh;
    overflow-y: auto;
}

.solution-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 24px;
    border-bottom: 1px solid var(--border);
    transition: var(--transition);
}

.solution-item:last-child { border-bottom: none; }

.solution-item:hover {
    background: var(--bg-elevated);
}

.solution-num {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    color: var(--text-muted);
    width: 40px;
    flex-shrink: 0;
}

.solution-body { flex: 1; min-width: 0; }

.solution-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.solution-meta {
    display: flex;
    gap: 8px;
    margin-top: 4px;
    flex-wrap: wrap;
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 100px;
    font-size: 11px;
    font-weight: 500;
}

.badge-platform { background: var(--accent-dim); color: var(--accent); }
.badge-lang { background: var(--bg-elevated); color: var(--text-secondary); border: 1px solid var(--border); }
.badge-easy { background: var(--green-dim); color: var(--green); }
.badge-medium { background: var(--amber-dim); color: var(--amber); }
.badge-hard { background: var(--red-dim); color: var(--red); }
.badge-status-completed { background: var(--green-dim); color: var(--green); }
.badge-status-pending { background: var(--amber-dim); color: var(--amber); }
.badge-status-processing { background: var(--blue-dim); color: var(--blue); }
.badge-status-failed { background: var(--red-dim); color: var(--red); }
.badge-green { background: var(--green-dim); color: var(--green); }

.solution-status { margin-left: auto; flex-shrink: 0; }

.empty-state {
    padding: 60px 24px;
    text-align: center;
    color: var(--text-muted);
}

.loading-text {
    color: var(--text-muted);
    font-size: 13px;
    padding: 20px;
    text-align: center;
}

/* ============================================
   PROFILE
   ============================================ */

.profile-grid {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 20px;
    align-items: start;
}

.profile-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
}

.card-header {
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.card-header h3 {
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.github-icon { color: var(--text-secondary); }

.profile-info {
    display: flex;
    align-items: center;
    gap: 16px;
}

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

.avatar-lg-fallback {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--accent-dim);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 700;
    flex-shrink: 0;
    border: 2px solid var(--border);
}

.profile-name {
    font-size: 16px;
    font-weight: 700;
}

.profile-email {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.profile-since {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 6px;
}

/* GitHub card */
.github-state { display: flex; flex-direction: column; gap: 16px; }

.github-unlinked-icon {
    font-size: 40px;
    text-align: center;
}

.github-desc {
    font-size: 13px;
    color: var(--text-secondary);
    text-align: center;
    line-height: 1.6;
}

.github-linked-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.github-user-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 100px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.repo-selector {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.repo-selector label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.repo-current {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    font-size: 13px;
}

#repo-name-display {
    color: var(--text-primary);
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
}

.repo-picker {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.repo-picker-header {
    padding: 10px;
    border-bottom: 1px solid var(--border);
}

.repo-picker-header .filter-input { width: 100%; }

.repo-list {
    max-height: 200px;
    overflow-y: auto;
}

.repo-list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    cursor: pointer;
    border-bottom: 1px solid var(--border);
    transition: var(--transition);
}

.repo-list-item:last-child { border-bottom: none; }

.repo-list-item:hover { background: var(--bg-elevated); }

.repo-list-item.selected { background: var(--accent-dim); }

.repo-item-name {
    font-size: 12px;
    font-family: 'JetBrains Mono', monospace;
    color: var(--text-primary);
}

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

/* ============================================
   TOAST
   ============================================ */

.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    padding: 12px 20px;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 500;
    z-index: 9999;
    animation: toastIn 0.25s ease;
    max-width: 320px;
    box-shadow: var(--shadow-lg);
}

.toast-success { background: var(--green); color: #fff; }
.toast-error { background: var(--red); color: #fff; }
.toast-info { background: var(--accent); color: #fff; }

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

/* ============================================
   SCROLLBAR
   ============================================ */

::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bg-elevated); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-hover); }

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 900px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .profile-grid { grid-template-columns: 1fr; }
}

@media (max-width: 650px) {
    .sidebar { display: none; }
    .main-content { padding: 20px; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
}

/* ============================================
   ADMIN CONSOLE STYLES
   ============================================ */

.admin-gold { color: #f59e0b; }
.admin-gold-bg { background: rgba(245, 158, 11, 0.15); color: #f59e0b; border: 1px solid rgba(245, 158, 11, 0.3); }

.admin-subnav {
    display: flex;
    gap: 8px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.admin-subnav-btn {
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.admin-subnav-btn:hover {
    color: var(--text-primary);
    background: var(--bg-elevated);
}

.admin-subnav-btn.active {
    background: var(--bg-card);
    border-color: var(--border);
    color: var(--text-primary);
}

.admin-table-container {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

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

.admin-search-input {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 8px 14px;
    color: var(--text-primary);
    font-size: 13px;
    min-width: 240px;
    outline: none;
    transition: var(--transition);
}

.admin-search-input:focus {
    border-color: var(--accent);
}

.admin-select {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    color: var(--text-primary);
    font-size: 13px;
    outline: none;
    cursor: pointer;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    text-align: left;
}

.admin-table th {
    background: var(--bg-elevated);
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 12px 18px;
    border-bottom: 1px solid var(--border);
}

.admin-table td {
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
    color: var(--text-primary);
    vertical-align: middle;
}

.admin-table tr:last-child td {
    border-bottom: none;
}

.admin-table tr:hover td {
    background: rgba(255, 255, 255, 0.015);
}

.btn-action-sm {
    padding: 5px 10px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    border: 1px solid var(--border);
    background: var(--bg-elevated);
    color: var(--text-primary);
    transition: var(--transition);
}

.btn-action-sm:hover {
    background: var(--bg-card);
    border-color: var(--border-hover);
}

.btn-danger-sm {
    padding: 5px 10px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    border: 1px solid rgba(239, 68, 68, 0.3);
    background: var(--red-dim);
    color: var(--red);
    transition: var(--transition);
}

.btn-danger-sm:hover {
    background: rgba(239, 68, 68, 0.25);
}

.badge-pill {
    display: inline-flex;
    align-items: center;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 6px;
}

.badge-success { background: var(--green-dim); color: var(--green); }
.badge-warning { background: var(--amber-dim); color: var(--amber); }
.badge-danger { background: var(--red-dim); color: var(--red); }
.badge-neutral { background: rgba(255,255,255,0.06); color: var(--text-secondary); }

/* ============================================
   HEATMAP & COMMAND PALETTE
   ============================================ */

.heatmap-grid {
    display: grid;
    grid-template-rows: repeat(7, 11px);
    grid-auto-flow: column;
    grid-auto-columns: 11px;
    gap: 3px;
    padding: 8px 0;
}

.heatmap-cell {
    width: 11px;
    height: 11px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.04);
    transition: transform 0.15s ease, outline 0.15s ease;
    cursor: pointer;
    position: relative;
}

.heatmap-cell:hover {
    transform: scale(1.35);
    z-index: 10;
    outline: 1px solid #fff;
}

.heatmap-cell.lvl-0 { background: rgba(255, 255, 255, 0.04); }
.heatmap-cell.lvl-1 { background: #064e3b; }
.heatmap-cell.lvl-2 { background: #047857; }
.heatmap-cell.lvl-3 { background: #10b981; }
.heatmap-cell.lvl-4 { background: #34d399; }

.palette-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s ease;
    text-decoration: none;
    color: var(--text-primary);
}

.palette-item:hover,
.palette-item.active {
    background: rgba(99, 102, 241, 0.15);
    border: 1px solid rgba(99, 102, 241, 0.3);
}

.palette-item-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.palette-item-icon {
    font-size: 16px;
    width: 24px;
    text-align: center;
}

.palette-item-title {
    font-size: 13px;
    font-weight: 500;
}

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

/* ============================================
   COHESIVE PRODUCT UX & POLISH
   ============================================ */

/* Custom subtle scrollbars */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.12);
    border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.22);
}

/* Enhanced active sidebar items with subtle glow */
.nav-item {
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.nav-item.active {
    background: linear-gradient(90deg, rgba(99, 102, 241, 0.18), rgba(99, 102, 241, 0.05));
    border-left: 3px solid var(--accent);
    color: #fff;
    box-shadow: inset 0 0 12px rgba(99, 102, 241, 0.1);
}

/* Card hover micro-interactions */
.card, .stat-card, .widget-card {
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.card:hover, .stat-card:hover {
    border-color: rgba(255, 255, 255, 0.12);
}

/* Modal overlay animation */
.admin-modal-overlay {
    backdrop-filter: blur(8px);
    transition: opacity 0.2s ease;
}

.admin-modal {
    animation: modalSlideIn 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.97) translateY(8px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Side-by-side comparison responsiveness */
@media (max-width: 768px) {
    #intel-compare-container {
        grid-template-columns: 1fr !important;
    }
}

/* Heatmap week & month styling */
.heatmap-months-row {
    display: flex;
    font-size: 10px;
    color: var(--text-muted);
    margin-bottom: 6px;
    padding-left: 28px;
    height: 14px;
    position: relative;
    user-select: none;
}

.heatmap-weekdays-col {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    font-size: 9px;
    color: var(--text-muted);
    width: 22px;
    height: 95px;
    padding-top: 1px;
    padding-bottom: 2px;
    user-select: none;
}

.stats-group-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.heatmap-card {
    background: linear-gradient(145deg, rgba(22, 32, 54, 0.6) 0%, rgba(15, 23, 42, 0.75) 100%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-lg);
    padding: 22px 24px;
    box-shadow: 0 4px 18px -2px rgba(0, 0, 0, 0.35);
    margin-bottom: 24px;
}

.heatmap-cell {
    width: 12px;
    height: 12px;
    border-radius: 2.5px;
    background: rgba(255, 255, 255, 0.04);
    transition: all 0.15s ease;
}

.heatmap-cell:hover {
    outline: 2px solid #818cf8;
    transform: scale(1.25);
    z-index: 5;
}

.heatmap-cell[data-level="1"] { background: #0e4429; }
.heatmap-cell[data-level="2"] { background: #006d32; }
.heatmap-cell[data-level="3"] { background: #26a641; }
.heatmap-cell[data-level="4"] { background: #39d353; box-shadow: 0 0 8px rgba(57, 211, 83, 0.5); }

.intel-mastery-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 14px;
    cursor: pointer;
    transition: border-color 0.2s ease, transform 0.2s ease;
}

.intel-mastery-card:hover {
    border-color: rgba(99, 102, 241, 0.4);
    transform: translateY(-2px);
}

/* ============================================
   EXPANDED DSASYNC 3.0 MODULES & UI POLISH
   ============================================ */

.sidebar-category-header {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    padding: 14px 12px 4px 12px;
}

/* Flashcard 3D Interactive Flip */
.flashcard-scene {
    perspective: 1000px;
    height: 220px;
}

.flashcard {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    cursor: pointer;
}

.flashcard.is-flipped {
    transform: rotateY(180deg);
}

.flashcard-face {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: var(--radius);
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    border: 1px solid var(--border);
    background: var(--bg-surface);
}

.flashcard-back {
    transform: rotateY(180deg);
    background: linear-gradient(145deg, #131b2e, #0f172a);
    border-color: rgba(99, 102, 241, 0.3);
}

/* Flashcard SM-2 Rating Controls */
.fc-rating-btn {
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    padding: 4px 8px;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.15s ease;
}
.fc-rating-again { background: rgba(239, 68, 68, 0.15); color: #f87171; border-color: rgba(239, 68, 68, 0.3); }
.fc-rating-again:hover { background: rgba(239, 68, 68, 0.3); }
.fc-rating-hard { background: rgba(245, 158, 11, 0.15); color: #fbbf24; border-color: rgba(245, 158, 11, 0.3); }
.fc-rating-hard:hover { background: rgba(245, 158, 11, 0.3); }
.fc-rating-good { background: rgba(16, 185, 129, 0.15); color: #34d399; border-color: rgba(16, 185, 129, 0.3); }
.fc-rating-good:hover { background: rgba(16, 185, 129, 0.3); }
.fc-rating-easy { background: rgba(99, 102, 241, 0.15); color: #818cf8; border-color: rgba(99, 102, 241, 0.3); }
.fc-rating-easy:hover { background: rgba(99, 102, 241, 0.3); }

/* Knowledge Quiz Option Styling */
.quiz-option {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
    text-align: left;
    transition: border-color 0.2s, background 0.2s, color 0.2s;
    width: 100%;
}

.quiz-option:hover {
    border-color: var(--accent);
    color: #fff;
    background: rgba(99, 102, 241, 0.08);
}

.quiz-option.correct {
    background: rgba(16, 185, 129, 0.15) !important;
    border-color: #10b981 !important;
    color: #10b981 !important;
    font-weight: 600;
}

.quiz-option.incorrect {
    background: rgba(239, 68, 68, 0.15) !important;
    border-color: #ef4444 !important;
    color: #ef4444 !important;
    font-weight: 600;
}

/* Interview Simulation Live Timer */
.interview-timer-display {
    font-family: 'JetBrains Mono', monospace;
    font-size: 38px;
    font-weight: 800;
    letter-spacing: 0.04em;
    color: #fff;
    text-shadow: 0 0 20px rgba(99, 102, 241, 0.4);
}

/* Company Track Card */
.company-track-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px;
    transition: transform 0.2s, border-color 0.2s;
}

.company-track-card:hover {
    transform: translateY(-2px);
    border-color: rgba(99, 102, 241, 0.3);
}

/* Approach Progression Tabs */
.approach-progression-btn {
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 20px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.approach-progression-btn.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
    box-shadow: 0 0 12px rgba(99, 102, 241, 0.4);
}

/* ============================================
   CURATED SHEETS (Codolio-style)
   ============================================ */

.sheet-card {
    background: linear-gradient(145deg, rgba(22, 32, 54, 0.65) 0%, rgba(15, 23, 42, 0.8) 100%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-lg);
    padding: 22px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: 0 4px 18px -2px rgba(0, 0, 0, 0.35);
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.2s ease;
    cursor: pointer;
    min-height: 200px;
}

.sheet-card:hover {
    transform: translateY(-2px);
    border-color: rgba(99, 102, 241, 0.4);
}

.sheet-step-accordion {
    background: rgba(15, 23, 42, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: var(--radius-sm);
    overflow: hidden;
    transition: border-color 0.15s ease;
}

.sheet-step-accordion:hover {
    border-color: rgba(255, 255, 255, 0.12);
}

.sheet-step-header {
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
    font-size: 14px;
    font-weight: 600;
    color: #f1f5f9;
    background: rgba(255, 255, 255, 0.015);
    transition: background 0.15s ease;
}

.sheet-step-header:hover {
    background: rgba(255, 255, 255, 0.04);
}

.sheet-step-body {
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: rgba(11, 17, 32, 0.4);
}

.sheet-problem-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 8px;
    gap: 12px;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.sheet-problem-row:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.08);
}

.sheet-problem-row.is-completed {
    border-color: rgba(16, 185, 129, 0.25);
    background: rgba(16, 185, 129, 0.03);
}

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



