@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Noto+Sans+Oriya:wght@400;500;600;700&display=swap');

:root {
    --primary: #1e3a8a;          /* Deep Navy (UPSC Vibe) */
    --primary-dark: #172554;     /* Darker Navy */
    --primary-light: #2563eb;    /* Vibrant Blue */
    --primary-subtle: #eff6ff;   /* Soft Blue background */
    --secondary: #d97706;        /* Warm Gold Accent */
    --secondary-light: #f59e0b;
    --secondary-subtle: #fffbeb;
    --success: #059669;          /* Emerald Green */
    --success-light: #10b981;
    --success-subtle: #ecfdf5;
    --danger: #dc2626;           /* Crimson Red */
    --danger-light: #ef4444;
    --danger-subtle: #fef2f2;
    --background: #f8fafc;       /* Modern Slate-50 */
    --surface: #ffffff;
    --surface-alt: #f1f5f9;
    --text-main: #0f172a;        /* Deep Slate-900 (15:1 AAA contrast) */
    --text-muted: #334155;       /* Slate-700 (9.6:1 AAA contrast on white) */
    --text-subtle: #475569;      /* Slate-600 (5.8:1 AA contrast on white) */
    --border: #e2e8f0;          /* Slate-200 */
    --border-hover: #cbd5e1;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.06), 0 1px 2px -1px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 14px -2px rgba(0, 0, 0, 0.08), 0 2px 6px -1px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 10px 25px -3px rgba(0, 0, 0, 0.1), 0 4px 10px -2px rgba(0, 0, 0, 0.05);
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    background-color: var(--background);
    color: var(--text-main);
    font-family: 'Inter', 'Noto Sans Oriya', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.62;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* Universal text alignment & overflow protection */
h1, h2, h3, h4, h5, h6 {
    color: var(--text-main);
    font-weight: 700;
    line-height: 1.28;
    letter-spacing: -0.02em;
    overflow-wrap: break-word;
    word-break: break-word;
}

p, li, span, label, td, th {
    overflow-wrap: break-word;
    word-break: break-word;
}

/* Subtle modern scrollbar */
* {
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

:focus-visible {
    outline: 2px solid var(--primary-light);
    outline-offset: 2px;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.25rem;
}

.container-sm {
    max-width: 860px;
    margin: 0 auto;
    padding: 0 1.25rem;
}

/* Modern Clean White App Header (Option A) */
header, .app-header {
    background: #ffffff;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: var(--text-main);
    padding: 0.75rem 0;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05), 0 1px 2px -1px rgba(0, 0, 0, 0.03);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid #e2e8f0;
    transition: all 0.2s ease;
}

.header-inner, header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    max-width: 1360px;
}

.brand-section {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.brand-logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: inherit;
    flex-shrink: 0;
    white-space: nowrap;
    transition: opacity 0.15s ease;
}

.brand-logo:hover {
    opacity: 0.92;
}

.brand-badge {
    background: linear-gradient(135deg, #1e3a8a, #2563eb);
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    color: #ffffff;
    font-size: 1.15rem;
    font-weight: 800;
    box-shadow: 0 2px 8px rgba(30, 58, 138, 0.25);
    flex-shrink: 0;
}

.brand-title-wrap {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
    line-height: 1.1;
    flex-shrink: 0;
    min-width: max-content;
}

.brand-name-row {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    flex-shrink: 0;
}

.brand-name {
    font-size: 1.24rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: #0f172a;
    white-space: nowrap !important;
    word-break: normal !important;
    overflow-wrap: normal !important;
    flex-shrink: 0;
}

.brand-tag {
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #1e3a8a;
    margin-top: 1px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap !important;
    word-break: normal !important;
    overflow-wrap: normal !important;
    flex-shrink: 0;
}

.app-v-badge {
    background: #eff6ff;
    color: #2563eb;
    border: 1px solid #bfdbfe;
    font-size: 0.62rem;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 9999px;
    letter-spacing: normal;
    text-transform: none;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap !important;
    word-break: normal !important;
    overflow-wrap: normal !important;
    flex-shrink: 0;
}

html.dark .app-v-badge {
    background: rgba(37, 99, 235, 0.2);
    color: #93c5fd;
    border-color: rgba(59, 130, 246, 0.4);
}

.desktop-nav {
    display: flex;
    align-items: center;
    gap: 3px;
    flex-wrap: nowrap;
    min-width: 0;
}

.desktop-nav a, .desktop-nav .nav-link {
    color: #334155;
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 600;
    padding: 0.45rem 0.8rem;
    border-radius: 8px;
    transition: all 0.18s ease;
    white-space: nowrap;
    border: 1px solid transparent;
}

.desktop-nav a:hover, .desktop-nav .nav-link:hover {
    color: #1e3a8a;
    background: #f1f5f9;
}

.desktop-nav a.active, .desktop-nav .nav-link.active {
    color: #1e3a8a;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    font-weight: 700;
    box-shadow: 0 1px 3px rgba(30, 58, 138, 0.08);
}

/* Desktop Navigation Dropdown */
.nav-dropdown {
    position: relative;
    display: inline-flex;
    align-items: center;
    outline: none;
}

.nav-dropdown.nav-dropdown-end {
    margin-left: 0.25rem;
}

/* Nav-link style dropdown button (matches .nav-link 100% in height, font, padding) */
.nav-link-dropdown-btn {
    color: #334155;
    background: transparent;
    border: 1px solid transparent;
    font-size: 0.88rem;
    font-weight: 600;
    font-family: inherit;
    padding: 0.45rem 0.8rem;
    border-radius: 8px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    line-height: 1.4;
    transition: all 0.18s ease;
    white-space: nowrap;
}

.nav-dropdown:hover .nav-link-dropdown-btn,
.nav-dropdown:focus-within .nav-link-dropdown-btn {
    color: #1e3a8a;
    background: #f1f5f9;
}

.nav-link-dropdown-btn.active {
    color: #1e3a8a;
    background: #eff6ff;
    border-color: #bfdbfe;
    font-weight: 700;
    box-shadow: 0 1px 3px rgba(30, 58, 138, 0.08);
}

/* Classic button style dropdown for end links */
.nav-dropdown-btn {
    background: #f8fafc;
    color: #0f172a;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 0.45rem 0.8rem;
    font-size: 0.86rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
    white-space: nowrap;
    line-height: 1.4;
}

.nav-dropdown:hover .nav-dropdown-btn,
.nav-dropdown:focus-within .nav-dropdown-btn {
    background: #ffffff;
    border-color: #3b82f6;
    color: #1d4ed8;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.15);
}

.nav-dropdown-btn.active {
    background: #eff6ff;
    border-color: #3b82f6;
    color: #1d4ed8;
    box-shadow: 0 1px 4px rgba(37, 99, 235, 0.18);
    font-weight: 800;
}

.dropdown-chevron {
    transition: transform 0.2s ease;
    opacity: 0.75;
}

.nav-dropdown:hover .dropdown-chevron,
.nav-dropdown:focus-within .dropdown-chevron {
    transform: rotate(180deg);
    opacity: 1;
}

.nav-dropdown-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 280px;
    width: max-content;
    max-width: 320px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 16px 36px -4px rgba(0, 0, 0, 0.18), 0 6px 14px -2px rgba(0, 0, 0, 0.06);
    border: 1px solid #e2e8f0;
    padding: 0.45rem;
    display: none;
    flex-direction: column;
    gap: 3px;
    z-index: 10000;
    animation: navDropdownFade 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Invisible bridge so cursor never drops hover across gap */
.nav-dropdown-menu::before {
    content: '';
    position: absolute;
    top: -8px;
    left: 0;
    right: 0;
    height: 8px;
}

/* Align dropdown menu to the left for items located near the left of the navbar */
.nav-dropdown.nav-dropdown-left .nav-dropdown-menu {
    left: 0;
    right: auto;
}

.dropdown-divider {
    height: 1px;
    background: #e2e8f0;
    margin: 4px 6px;
}

.dropdown-badge {
    margin-left: auto;
    font-size: 0.65rem;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 5px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    flex-shrink: 0;
    white-space: nowrap;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0.55rem 0.75rem;
    border-radius: 8px;
    text-decoration: none;
    color: var(--text-main);
    transition: background 0.15s ease;
    white-space: nowrap;
    border: 1px solid transparent;
}

.dropdown-item:hover {
    background: #f1f5f9;
    color: #1e3a8a !important;
}

.dropdown-item.active {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #1d4ed8 !important;
}

.dropdown-icon {
    font-size: 1.05rem;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    flex-shrink: 0;
}

.dropdown-title {
    font-size: 0.86rem;
    font-weight: 700;
    color: var(--text-main);
    white-space: nowrap;
    line-height: 1.2;
}

.dropdown-item:hover .dropdown-title {
    color: #1e3a8a;
}

.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown:focus-within .nav-dropdown-menu {
    display: flex;
}

@keyframes navDropdownFade {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0.6rem 0.75rem;
    border-radius: 10px;
    text-decoration: none;
    color: #1e293b !important;
    margin-left: 0 !important;
    border: 1px solid transparent;
    transition: background 0.15s ease, transform 0.1s ease;
}

.dropdown-item:hover {
    background: #f8fafc;
    color: var(--primary) !important;
    transform: translateX(2px);
    border-color: #e2e8f0;
}

.dropdown-icon {
    font-size: 1.25rem;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f1f5f9;
    border-radius: 8px;
    flex-shrink: 0;
}

.dropdown-text {
    display: flex;
    flex-direction: column;
    flex: 1;
    text-align: left;
}

.dropdown-title {
    font-weight: 700;
    font-size: 0.85rem;
    line-height: 1.25;
    color: #0f172a;
}

.dropdown-item:hover .dropdown-title {
    color: var(--primary);
}

.dropdown-desc {
    font-size: 0.73rem;
    color: #475569;
    line-height: 1.25;
    margin-top: 2px;
}

.dropdown-ext {
    color: #94a3b8;
    flex-shrink: 0;
}

/* ═══════════════════════════════════════════════════════════════════════════
   RESPONSIVE HEADER & MOBILE NAVIGATION DRAWER
   ═══════════════════════════════════════════════════════════════════════════ */

/* Mobile header actions (Dark Mode + Hamburger) */
.mobile-header-actions {
    display: none;
    align-items: center;
    gap: 8px;
}

/* Hamburger button */
.mobile-menu-btn {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: 1.5px solid var(--border);
    background: var(--surface);
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    cursor: pointer;
    padding: 0;
    transition: all 0.2s ease;
    color: var(--text-main);
}
.mobile-menu-btn:hover {
    background: var(--surface-alt);
    border-color: var(--border-hover);
}
.mobile-menu-btn .bar {
    width: 20px;
    height: 2px;
    background-color: currentColor;
    border-radius: 2px;
    transition: transform 0.25s ease, opacity 0.2s ease;
    transform-origin: center;
}
.mobile-menu-btn.active .bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}
.mobile-menu-btn.active .bar:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}
.mobile-menu-btn.active .bar:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* Mobile Navigation Drawer */
.mobile-nav-drawer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 10001;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.25s;
}
.mobile-nav-drawer-overlay.active {
    opacity: 1;
    visibility: visible;
}

.mobile-nav-drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(85vw, 360px);
    background: var(--surface);
    box-shadow: -8px 0 32px rgba(0, 0, 0, 0.2);
    z-index: 10002;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
    border-left: 1px solid var(--border);
}
.mobile-nav-drawer-overlay.active .mobile-nav-drawer {
    transform: translateX(0);
}

.drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.1rem 1.25rem;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
}
.drawer-title {
    font-size: 1rem;
    font-weight: 800;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 8px;
}
.drawer-close-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--surface-alt);
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.1rem;
    transition: all 0.15s ease;
}
.drawer-close-btn:hover {
    background: var(--border);
    color: var(--text-main);
}

.drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Quick Action Tiles in Drawer */
.drawer-quick-tiles {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.65rem;
}
.drawer-tile {
    padding: 0.85rem;
    border-radius: 12px;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    gap: 4px;
    border: 1.5px solid;
    transition: transform 0.15s ease;
}
.drawer-tile:hover { transform: translateY(-2px); }
.drawer-tile.mock {
    background: #ecfdf5;
    border-color: #a7f3d0;
    color: #065f46;
}
html.dark .drawer-tile.mock { background: #064e3b33; border-color: #047857; color: #34d399; }
.drawer-tile.scores {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #1e40af;
}
html.dark .drawer-tile.scores { background: #1e3a8a33; border-color: #1d4ed8; color: #93c5fd; }
.drawer-tile.analytics {
    background: #f5f3ff;
    border-color: #ddd6fe;
    color: #5b21b6;
}
html.dark .drawer-tile.analytics { background: #4c1d9533; border-color: #6d28d9; color: #a78bfa; }
.drawer-tile.drill {
    background: #fffbeb;
    border-color: #fde68a;
    color: #92400e;
}
html.dark .drawer-tile.drill { background: #78350f33; border-color: #b45309; color: #fcd34d; }
.drawer-tile-icon { font-size: 1.4rem; line-height: 1; }
.drawer-tile-title { font-size: 0.85rem; font-weight: 800; }
.drawer-tile-sub { font-size: 0.7rem; opacity: 0.85; }

/* Navigation links inside drawer */
.drawer-nav-section-title {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin-bottom: 0.4rem;
    padding-left: 0.25rem;
}
.drawer-nav-list {
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.drawer-nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0.65rem 0.85rem;
    border-radius: 10px;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-main);
    transition: all 0.15s ease;
}
.drawer-nav-link:hover {
    background: var(--surface-alt);
    color: var(--primary);
    transform: translateX(3px);
}
.drawer-nav-link.active {
    background: var(--primary-subtle);
    color: var(--primary);
    font-weight: 700;
    border: 1px solid #bfdbfe;
}
html.dark .drawer-nav-link.active {
    background: #1e3a8a44;
    border-color: #1e3a8a;
    color: #93c5fd;
}

/* Footer / Theme toggle in drawer */
.drawer-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--surface-alt);
}
.drawer-theme-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0.5rem 0.85rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-main);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
}

/* ── Breakpoints for Header Responsiveness ─────────────────────────────── */

/* Large desktop (>= 1240px) */
@media (min-width: 1240px) {
    .desktop-nav {
        gap: 4px;
    }
    .desktop-nav a, .desktop-nav .nav-link {
        font-size: 0.85rem;
        padding: 0.4rem 0.65rem;
    }
}

/* Medium desktop / compact laptop (1025px - 1239px) - keep single-row fit without squeezing brand */
@media (min-width: 1025px) and (max-width: 1239px) {
    .header-inner, header .container {
        padding-left: 0.9rem;
        padding-right: 0.9rem;
        gap: 0.5rem;
    }
    .desktop-nav {
        gap: 2px;
    }
    .desktop-nav a, .desktop-nav .nav-link, .nav-link-dropdown-btn {
        font-size: 0.76rem;
        padding: 0.34rem 0.44rem;
    }
    .brand-name {
        font-size: 1.1rem;
    }
    .brand-tag {
        font-size: 0.57rem;
        letter-spacing: 0.04em;
    }
    .brand-badge {
        width: 32px;
        height: 32px;
        font-size: 1rem;
    }
    .nav-dropdown-btn {
        padding: 0.34rem 0.54rem;
        font-size: 0.76rem;
    }
    .nav-dropdown.nav-dropdown-end {
        margin-left: 0.1rem;
    }
}

/* Tablet & Mobile (< 1025px) - Switch completely to responsive mobile drawer */
@media (max-width: 1024px) {
    .desktop-nav {
        display: none !important;
    }
    .mobile-header-actions {
        display: flex !important;
    }
    .header-inner, header .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    .brand-name {
        font-size: 1.15rem;
    }
    .brand-tag {
        font-size: 0.6rem;
    }
    .brand-badge {
        width: 32px;
        height: 32px;
        font-size: 1rem;
    }
}

/* Extra small mobile (< 400px) */
@media (max-width: 400px) {
    .brand-title-wrap {
        max-width: 130px;
    }
    .brand-name {
        font-size: 1.05rem;
    }
    .brand-tag {
        display: none;
    }
    .header-inner, header .container {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }
}

/* Cards */
.card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 1.6rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    margin-bottom: 1.5rem;
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease, border-color 0.2s ease;
}

.card:hover {
    box-shadow: var(--shadow-md);
}

/* Forms */
.form-group {
    margin-bottom: 1.25rem;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 0.45rem;
    font-size: 0.86rem;
    font-weight: 600;
    color: #334155;
    text-align: left;
}

.form-control {
    width: 100%;
    padding: 0.65rem 0.95rem;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    font-size: 0.95rem;
    font-family: inherit;
    color: var(--text-main);
    background-color: #ffffff;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
    background-color: #ffffff;
}

textarea.form-control {
    min-height: 120px;
    resize: vertical;
    line-height: 1.55;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 0.65rem 1.25rem;
    font-size: 0.9rem;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    border-radius: 10px;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
    white-space: nowrap;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.btn:active {
    transform: translateY(1px) scale(0.98);
}

.btn-primary {
    background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(30, 58, 138, 0.25);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #1e40af 0%, #1d4ed8 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(30, 58, 138, 0.35);
    transform: translateY(-1px);
}

.btn-secondary {
    background-color: #ffffff;
    color: #334155;
    border-color: #cbd5e1;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.btn-secondary:hover {
    background-color: #f8fafc;
    border-color: #94a3b8;
    color: #0f172a;
    transform: translateY(-1px);
}

.btn-success {
    background: linear-gradient(135deg, #059669 0%, #10b981 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.25);
}

.btn-success:hover {
    background: linear-gradient(135deg, #047857 0%, #059669 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.35);
    transform: translateY(-1px);
}

/* Utilities */
.admin-flex { display: flex; gap: 1.75rem; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.25rem; }
.mt-4 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.25rem; }
.mb-4 { margin-bottom: 1.5rem; }
.text-left { text-align: left; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.font-bold { font-weight: 700; }
.text-muted { color: var(--text-muted); }
.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.flex-wrap { flex-wrap: wrap; }
.w-full { width: 100%; }

/* Alerts */
.alert {
    padding: 0.85rem 1.15rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    font-weight: 500;
    line-height: 1.5;
    display: flex;
    align-items: center;
    gap: 8px;
    text-align: left;
}

.alert-success {
    background-color: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.alert-danger {
    background-color: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.alert-info {
    background-color: #eff6ff;
    color: #1e40af;
    border: 1px solid #bfdbfe;
}

/* Tables */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid var(--border);
    border-radius: 12px;
    margin: 1rem 0;
    background: #ffffff;
    box-shadow: var(--shadow-xs);
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-top: 0.5rem;
}

th, td {
    padding: 0.85rem 1.1rem;
    text-align: left;
    border-bottom: 1px solid #f1f5f9;
}

th {
    background-color: #f8fafc;
    color: #475569;
    font-size: 0.76rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 2px solid var(--border);
    white-space: nowrap;
}

tr:hover td {
    background-color: #f8fafc;
}

tr:last-child td {
    border-bottom: none;
}

/* Mobile Bottom Bar */
.mobile-bottom-bar {
    display: none;
}

@media (max-width: 768px) {
    .mobile-bottom-bar {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background-color: rgba(255, 255, 255, 0.96);
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
        box-shadow: 0 -2px 16px rgba(0, 0, 0, 0.06);
        padding: 0.4rem 0.5rem;
        padding-bottom: calc(0.4rem + env(safe-area-inset-bottom, 0px));
        justify-content: space-around;
        align-items: center;
        z-index: 9999;
        border-top: 1px solid #e2e8f0;
        gap: 0;
    }

    /* Each nav item */
    .mob-nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 3px;
        flex: 1;
        padding: 0.35rem 0.2rem;
        color: #334155;
        text-decoration: none;
        font-size: 0.7rem;
        font-weight: 600;
        letter-spacing: 0.01em;
        border-radius: 10px;
        transition: color 0.18s ease, background 0.18s ease, transform 0.15s ease;
        -webkit-tap-highlight-color: transparent;
        position: relative;
    }

    .mob-nav-item span {
        white-space: nowrap;
        font-size: 0.67rem;
        line-height: 1;
    }

    .mob-nav-item svg {
        transition: transform 0.18s ease;
        flex-shrink: 0;
        width: 20px;
        height: 20px;
        stroke: currentColor;
    }

    .mob-nav-item:active {
        transform: scale(0.92);
    }

    /* Active / current page */
    .mob-nav-item.mob-nav-active {
        color: #1e3a8a;
        font-weight: 800;
    }

    .mob-nav-item.mob-nav-active svg {
        stroke: #1e3a8a;
        stroke-width: 2.5;
        transform: translateY(-2px);
    }

    /* Active indicator dot */
    .mob-nav-item.mob-nav-active::after {
        content: '';
        position: absolute;
        bottom: 2px;
        left: 50%;
        transform: translateX(-50%);
        width: 5px;
        height: 5px;
        border-radius: 50%;
        background: #1e3a8a;
    }

    /* Safe area padding to body so content doesn't hide behind the bar */
    body {
        padding-bottom: calc(5.5rem + env(safe-area-inset-bottom, 0px)) !important;
    }

    .desktop-nav {
        display: none !important;
    }

    .admin-flex {
        flex-direction: column;
        gap: 1.25rem;
    }
    
    .card {
        padding: 1.15rem;
        border-radius: 14px;
    }

    .container, .container-sm {
        padding: 0 0.85rem;
    }

    table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        white-space: nowrap;
    }

    header {
        padding: 0.75rem 0;
    }

    header .container, .header-inner {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        gap: 0.5rem;
        flex-wrap: nowrap !important;
    }

    .form-control, input, select, textarea {
        font-size: 16px !important; /* Prevents auto-zoom on iOS */
    }
}

/* Mobile Button Reset */
button.mob-nav-btn {
    background: none;
    border: none;
    font-family: inherit;
    cursor: pointer;
}

/* Important Links Modal (Bottom Sheet on Mobile) */
.important-links-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 100000;
    opacity: 0;
    transition: opacity 0.25s ease;
    align-items: flex-end;
    justify-content: center;
}

.important-links-modal-overlay.active {
    display: flex;
    opacity: 1;
}

.important-links-sheet {
    background: #ffffff;
    width: 100%;
    max-width: 520px;
    border-radius: 22px 22px 0 0;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.25);
    padding: 1rem 1.25rem 2rem;
    padding-bottom: calc(1.5rem + env(safe-area-inset-bottom, 0px));
    transform: translateY(100%);
    transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
    max-height: 85vh;
    overflow-y: auto;
}

.important-links-modal-overlay.active .important-links-sheet {
    transform: translateY(0);
}

.sheet-handle {
    width: 40px;
    height: 4px;
    background: #cbd5e1;
    border-radius: 99px;
    margin: 0 auto 0.75rem;
}

.important-links-header {
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #f1f5f9;
}

.important-links-close {
    background: #f1f5f9;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #475569;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.important-links-close:hover {
    background: #e2e8f0;
    color: #0f172a;
}

.important-links-grid {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.important-link-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0.85rem 1rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    text-decoration: none;
    color: inherit;
    transition: all 0.18s ease;
    -webkit-tap-highlight-color: transparent;
}

.important-link-card:active,
.important-link-card:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
    transform: scale(0.99);
}

.card-icon {
    font-size: 1.4rem;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.card-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.card-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.25;
}

.card-sub {
    font-size: 0.75rem;
    color: #64748b;
    margin-top: 2px;
    line-height: 1.25;
}

.card-arrow {
    color: #94a3b8;
    flex-shrink: 0;
}

/* ── Polity GS-2 Live Tracker & Chapter Categorization ─── */
.polity-tracker-card {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #1e3a8a 100%);
    border-radius: 18px;
    padding: 1.5rem;
    color: #ffffff;
    margin-bottom: 1.5rem;
    box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.25), 0 8px 10px -6px rgba(15, 23, 42, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.12);
    position: relative;
    overflow: hidden;
}
.polity-tracker-card::before {
    content: '';
    position: absolute;
    top: -60px;
    right: -60px;
    width: 180px;
    height: 180px;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.25) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}
.tracker-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.25rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}
.tracker-title-wrap {
    flex: 1;
    min-width: 260px;
}
.tracker-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: rgba(59, 130, 246, 0.25);
    border: 1px solid rgba(147, 197, 253, 0.4);
    color: #93c5fd;
    padding: 3px 10px;
    border-radius: 9999px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin-bottom: 0.4rem;
}
.tracker-title {
    font-size: 1.25rem;
    font-weight: 800;
    line-height: 1.3;
    margin: 0 0 0.35rem 0;
    color: #ffffff;
    letter-spacing: -0.01em;
}
.tracker-subtitle {
    font-size: 0.82rem;
    color: #94a3b8;
    margin: 0;
    line-height: 1.4;
}
.tracker-pct-circle {
    background: rgba(255, 255, 255, 0.08);
    border: 2px solid rgba(59, 130, 246, 0.5);
    border-radius: 16px;
    padding: 0.6rem 1rem;
    text-align: center;
    min-width: 80px;
    backdrop-filter: blur(8px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}
.tracker-pct-circle .pct-num {
    font-size: 1.5rem;
    font-weight: 800;
    color: #38bdf8;
    line-height: 1;
}
.tracker-pct-circle .pct-label {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #94a3b8;
    font-weight: 600;
    margin-top: 3px;
}
.tracker-status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 0.85rem;
    margin-bottom: 1.25rem;
}
.tracker-status-box {
    background: rgba(255, 255, 255, 0.06);
    border-radius: 14px;
    padding: 0.9rem 1.1rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(6px);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.18s ease, border-color 0.18s ease;
}
.tracker-status-box:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.22);
}
.tracker-status-box.completed-box {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.12), rgba(5, 150, 105, 0.05));
    border-color: rgba(52, 211, 153, 0.35);
}
.tracker-status-box.resume-box {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.18), rgba(37, 99, 235, 0.08));
    border-color: rgba(96, 165, 250, 0.5);
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.15);
}
.tracker-status-box.stats-box {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.12);
}
.status-box-header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 0.45rem;
}
.status-icon {
    font-size: 1rem;
}
.status-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: #94a3b8;
}
.completed-box .status-label { color: #6ee7b7; }
.resume-box .status-label { color: #93c5fd; }
.status-box-title {
    font-size: 0.96rem;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.35;
    margin-bottom: 0.65rem;
}
.status-box-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}
.meta-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 6px;
}
.meta-pill.done {
    background: rgba(16, 185, 129, 0.25);
    color: #6ee7b7;
    border: 1px solid rgba(52, 211, 153, 0.4);
}
.meta-pill.score {
    background: rgba(251, 191, 36, 0.2);
    color: #fde68a;
    border: 1px solid rgba(245, 158, 11, 0.35);
}
.meta-pill.next {
    background: rgba(59, 130, 246, 0.25);
    color: #bfdbfe;
    border: 1px solid rgba(96, 165, 250, 0.4);
}
.meta-pill.info {
    background: rgba(148, 163, 184, 0.2);
    color: #cbd5e1;
}
.meta-pill.pending {
    background: rgba(244, 63, 94, 0.2);
    color: #fca5a5;
}
.resume-btn-sm {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #2563eb;
    color: #ffffff;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.74rem;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.18s ease;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.35);
    margin-left: auto;
}
.resume-btn-sm:hover {
    background: #1d4ed8;
    transform: scale(1.03);
    color: #ffffff;
}
.tracker-bar-wrap {
    background: rgba(0, 0, 0, 0.25);
    padding: 0.85rem 1rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    margin-bottom: 1.25rem;
}
.tracker-bar-track {
    height: 10px;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 9999px;
    overflow: hidden;
    position: relative;
}
.tracker-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #10b981 0%, #06b6d4 50%, #3b82f6 100%);
    border-radius: 9999px;
    transition: width 0.4s ease;
}
.tracker-bar-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.72rem;
    color: #94a3b8;
    margin-top: 6px;
    flex-wrap: wrap;
    gap: 4px;
}
.topic-pills-section {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 1rem;
}
.topic-pills-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    font-weight: 700;
    color: #cbd5e1;
    margin-bottom: 0.65rem;
}
.clear-topic-link {
    color: #60a5fa;
    text-decoration: none;
    font-size: 0.75rem;
    font-weight: 600;
}
.clear-topic-link:hover {
    text-decoration: underline;
}
.topic-pills-strip {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 8px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}
.topic-pills-strip::-webkit-scrollbar {
    height: 5px;
}
.topic-pills-strip::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 99px;
}
.topic-pill {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 5px 12px;
    border-radius: 9999px;
    font-size: 0.76rem;
    color: #e2e8f0;
    text-decoration: none;
    transition: all 0.18s ease;
    white-space: nowrap;
}
.topic-pill:hover {
    background: rgba(255, 255, 255, 0.18);
    border-color: rgba(255, 255, 255, 0.3);
    color: #ffffff;
    transform: translateY(-1px);
}
.topic-pill.active {
    background: #2563eb;
    color: #ffffff;
    border-color: #60a5fa;
    box-shadow: 0 2px 10px rgba(37, 99, 235, 0.45);
    font-weight: 700;
}
.topic-pill.is-next-topic {
    border-color: #60a5fa;
    background: rgba(37, 99, 235, 0.2);
}
.topic-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}
.dot-completed { background: #10b981; box-shadow: 0 0 6px #10b981; }
.dot-progress { background: #f59e0b; box-shadow: 0 0 6px #f59e0b; }
.dot-next { background: #38bdf8; box-shadow: 0 0 6px #38bdf8; }
.dot-pending { background: #64748b; }
.pill-day { font-weight: 700; }
.pill-title { opacity: 0.85; font-size: 0.72rem; }
.pill-cnt {
    background: rgba(255, 255, 255, 0.2);
    padding: 1px 6px;
    border-radius: 9999px;
    font-size: 0.68rem;
    font-weight: 700;
}

/* ── Chapter Group Headers in Mains Question List ─── */
.chapter-group-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-left: 4px solid var(--primary, #4f46e5);
    border-radius: 12px;
    padding: 0.85rem 1.15rem;
    margin: 2rem 0 1rem 0;
}
.chapter-group-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.chapter-day-badge {
    background: var(--primary, #4f46e5);
    color: #ffffff;
    font-size: 0.78rem;
    font-weight: 800;
    padding: 4px 10px;
    border-radius: 8px;
    letter-spacing: 0.02em;
    white-space: nowrap;
}
.chapter-group-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.chapter-group-title {
    font-size: 0.98rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
    line-height: 1.25;
}
.chapter-group-reading {
    font-size: 0.76rem;
    color: #64748b;
    font-weight: 500;
}
.chap-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.74rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 9999px;
}
.chap-badge.completed { background: #dcfce7; color: #15803d; border: 1px solid #bbf7d0; }
.chap-badge.in-progress { background: #fef9c3; color: #854d0e; border: 1px solid #fef08a; }
.chap-badge.next-up { background: #dbeafe; color: #1e40af; border: 1px solid #bfdbfe; }
.chap-badge.pending { background: #f1f5f9; color: #64748b; border: 1px solid #e2e8f0; }

/* ── Chapter Badges & Status Chips in Cards ─── */
.q-tag.chapter-tag { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; font-weight: 700; }
.q-tag.score-evaluated { background: #dcfce7; color: #15803d; border: 1px solid #bbf7d0; font-weight: 700; }
.q-tag.score-submitted { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; font-weight: 700; }
.q-tag.score-unwritten { background: #f8fafc; color: #475569; border: 1px solid #cbd5e1; font-weight: 600; }

/* ── Modern Dashboard: Today & Archive Segmented Switcher ─── */
.view-segmented-wrap {
    display: inline-flex;
    background: rgba(15, 23, 42, 0.6);
    border: 1.5px solid rgba(255, 255, 255, 0.28);
    backdrop-filter: blur(10px);
    border-radius: 9999px;
    padding: 4px;
    gap: 4px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
    margin: 1.25rem auto 0;
}

.view-segmented-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 0.5rem 1.25rem;
    border-radius: 9999px;
    font-size: 0.86rem;
    font-weight: 700;
    color: #ffffff;
    text-decoration: none;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    border: 1px solid transparent;
    cursor: pointer;
}

.view-segmented-btn:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.16);
}

.view-segmented-btn.active {
    background: #ffffff;
    color: #0f172a;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
}

.view-segmented-btn .badge-pill {
    font-size: 0.68rem;
    padding: 2px 7px;
    border-radius: 9999px;
    font-weight: 800;
}

.view-segmented-btn.active .badge-pill {
    background: #1e3a8a;
    color: #ffffff;
}

.view-segmented-btn:not(.active) .badge-pill {
    background: rgba(255, 255, 255, 0.28);
    color: #ffffff;
}

/* ── Archive Notice Banner ─── */
.archive-notice-banner {
    background: linear-gradient(135deg, #fffbeb, #fef3c7);
    border: 1.5px solid #f59e0b;
    border-radius: 14px;
    padding: 1rem 1.25rem;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.15);
}

.archive-notice-content {
    display: flex;
    align-items: center;
    gap: 10px;
}

.archive-notice-icon {
    font-size: 1.6rem;
    line-height: 1;
}

.archive-notice-title {
    font-size: 0.95rem;
    font-weight: 800;
    color: #78350f;
    margin: 0;
}

.archive-notice-sub {
    font-size: 0.82rem;
    color: #92400e;
    margin: 2px 0 0;
}

/* ── Archive Date Navigator Card ─── */
.archive-nav-card {
    background: #ffffff;
    border-radius: 16px;
    border: 1px solid var(--border);
    box-shadow: 0 4px 14px -2px rgba(0, 0, 0, 0.05);
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
}

.archive-nav-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 0.85rem;
    padding-bottom: 0.65rem;
    border-bottom: 1px solid #f1f5f9;
}

.archive-nav-header h4 {
    font-size: 0.92rem;
    font-weight: 700;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0;
}

.archive-date-input {
    padding: 0.35rem 0.65rem;
    border: 1.5px solid #cbd5e1;
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 600;
    color: #0f172a;
    background: #f8fafc;
    cursor: pointer;
}

.archive-date-input:focus {
    outline: none;
    border-color: #2563eb;
    background: #ffffff;
}

.archive-pills-row {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 6px;
    -webkit-overflow-scrolling: touch;
}

.archive-pill-btn {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.45rem 0.85rem;
    border-radius: 10px;
    border: 1.5px solid #e2e8f0;
    background: #f8fafc;
    color: #334155;
    text-decoration: none;
    transition: all 0.18s ease;
    min-width: 72px;
}

.archive-pill-btn:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
    color: #0f172a;
}

.archive-pill-btn.active {
    background: #1e3a8a;
    border-color: #1e3a8a;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(30, 58, 138, 0.25);
}

.archive-pill-day {
    font-size: 0.76rem;
    font-weight: 700;
}

.archive-pill-date {
    font-size: 0.66rem;
    opacity: 0.82;
    margin-top: 1px;
}

/* ── Compact Routine Strip ─── */
.compact-routine-bar {
    background: #ffffff;
    border-radius: 16px;
    border: 1px solid var(--border);
    box-shadow: 0 4px 16px -2px rgba(0, 0, 0, 0.06);
    padding: 0.85rem 1.15rem;
    margin-top: 0;
    margin-bottom: 1.25rem;
    position: relative;
    z-index: 10;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
}

@media (max-width: 640px) {
    .compact-routine-bar {
        grid-template-columns: 1fr;
        gap: 0.5rem;
        margin-top: 0;
        padding: 0.75rem;
    }
}

.routine-col {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0.45rem 0.65rem;
    border-radius: 10px;
    background: #f8fafc;
    border: 1px solid #f1f5f9;
}

.routine-col-icon {
    font-size: 1.4rem;
    line-height: 1;
    flex-shrink: 0;
}

.routine-col-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.routine-col-time {
    font-size: 0.68rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #1d4ed8;
}

.routine-col-title {
    font-size: 0.82rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.25;
}

.routine-col-desc {
    font-size: 0.72rem;
    color: #475569;
    line-height: 1.2;
}

/* ── Modern Collapsible Syllabus Accordion ─── */
.syllabus-accordion {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
    margin-top: 2rem;
    box-shadow: var(--shadow-sm);
}

.syllabus-accordion-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.35rem;
    background: #fafbff;
    cursor: pointer;
    user-select: none;
    font-weight: 800;
    font-size: 1.05rem;
    color: #0f172a;
    transition: background 0.15s ease;
}

.syllabus-accordion-summary:hover {
    background: #f1f5f9;
}

.syllabus-accordion-summary::-webkit-details-marker {
    display: none;
}

.syllabus-accordion-body {
    padding: 1.25rem;
    border-top: 1px solid #e2e8f0;
}

/* ── Executive Stats Grid & Cards ────────────────────────────── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.85rem;
    margin-bottom: 1.25rem;
}

.stat-card {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 1rem 1.15rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px -3px rgba(0, 0, 0, 0.08);
    border-color: #cbd5e1;
    color: inherit;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--stat-accent, #1e3a8a);
}

.stat-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.45rem;
}

.stat-card-label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.stat-card-icon {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    background: var(--stat-icon-bg, #eff6ff);
    flex-shrink: 0;
}

.stat-card-value {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--text-main);
    line-height: 1.2;
    margin-bottom: 0.25rem;
}

.stat-card-sub {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
    line-height: 1.3;
}

.stat-card-progress {
    width: 100%;
    height: 5px;
    background: #f1f5f9;
    border-radius: 999px;
    overflow: hidden;
    margin-top: 0.5rem;
}

.stat-progress-bar {
    height: 100%;
    border-radius: 999px;
    background: var(--stat-accent, #1e3a8a);
    transition: width 0.3s ease;
}

/* ── Sticky Sub-Navigation Hub Bar ───────────────────────────── */
.quick-nav-bar {
    position: sticky;
    top: 66px;
    z-index: 100;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 0.4rem;
    display: flex;
    gap: 6px;
    overflow-x: auto;
    box-shadow: 0 4px 16px -2px rgba(15, 23, 42, 0.06);
    margin-bottom: 1.25rem;
    scrollbar-width: none;
}

.quick-nav-bar::-webkit-scrollbar {
    display: none;
}

.quick-nav-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0.45rem 0.9rem;
    border-radius: 9999px;
    font-size: 0.8rem;
    font-weight: 700;
    color: #334155;
    text-decoration: none;
    border: 1.5px solid transparent;
    background: transparent;
    transition: all 0.18s ease;
    white-space: nowrap;
    cursor: pointer;
    font-family: inherit;
}

.quick-nav-tab:hover {
    background: #f1f5f9;
    color: var(--primary);
}

.quick-nav-tab.active {
    background: #1e3a8a;
    color: #ffffff;
    border-color: #1e3a8a;
    box-shadow: 0 2px 8px rgba(30, 58, 138, 0.25);
}

.quick-nav-badge {
    font-size: 0.68rem;
    font-weight: 800;
    padding: 1px 7px;
    border-radius: 999px;
    background: #e2e8f0;
    color: #1e293b;
    transition: all 0.18s ease;
}

.quick-nav-tab.active .quick-nav-badge {
    background: rgba(255, 255, 255, 0.25);
    color: #ffffff;
}

/* ── Lengthy Mains Question Clamping & Compact Layout ───────── */
.mains-q {
    font-weight: 600;
    font-size: 0.92rem;
    line-height: 1.5;
    margin-bottom: 0.5rem;
    color: #1e293b;
    word-break: break-word;
}

.mains-q.clamped {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.mains-q-toggle {
    font-size: 0.75rem;
    font-weight: 700;
    color: #2563eb;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    margin-top: -0.25rem;
    margin-bottom: 0.5rem;
    display: inline-block;
    font-family: inherit;
}

.mains-q-toggle:hover {
    text-decoration: underline;
    color: #1d4ed8;
}

/* ── Mains Backlog & Optional Drawers ────────────────────────── */
.backlog-drawer {
    border: 1px dashed #cbd5e1;
    border-radius: 12px;
    margin-top: 0.85rem;
    background: #f8fafc;
    overflow: hidden;
}

.backlog-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    cursor: pointer;
    font-weight: 700;
    font-size: 0.82rem;
    color: #334155;
    user-select: none;
    transition: background 0.15s ease;
}

.backlog-summary:hover {
    background: #f1f5f9;
    color: #0f172a;
}

.backlog-summary::-webkit-details-marker {
    display: none;
}

.backlog-body {
    padding: 0.75rem 1rem 1rem;
    border-top: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.zoo-drawer {
    border: 1px dashed #86efac;
    background: #f0fdf4;
}

.zoo-drawer .backlog-summary {
    color: #166534;
}

.zoo-drawer .backlog-summary:hover {
    background: #dcfce7;
}

.zoo-drawer .backlog-body {
    border-top: 1px solid #bbf7d0;
}

/* ── Modern Compact Submissions Page Elements ───────────────── */
.sub-filter-row {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 1rem;
}

.sub-search-box {
    position: relative;
    flex: 1;
    min-width: 220px;
}

.sub-search-input {
    width: 100%;
    padding: 0.45rem 0.85rem 0.45rem 2.2rem;
    font-size: 0.84rem;
    border-radius: 9999px;
    border: 1.5px solid var(--border);
    background: #ffffff;
    font-family: inherit;
    color: #0f172a;
    transition: all 0.2s ease;
}

.sub-search-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.sub-search-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.85rem;
    color: #94a3b8;
    pointer-events: none;
}

.sub-card-compact {
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid var(--border);
    padding: 1rem 1.25rem;
    margin-bottom: 0.85rem;
    transition: all 0.18s ease;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.03);
}

.sub-card-compact:hover {
    border-color: #cbd5e1;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.sub-drawer-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    background: none;
    border: none;
    padding: 0.35rem 0;
    margin-top: 0.5rem;
    font-size: 0.78rem;
    font-weight: 700;
    color: #2563eb;
    cursor: pointer;
    font-family: inherit;
}

.sub-drawer-toggle:hover {
    color: #1d4ed8;
}

/* Hide intrusive floating progress pill */
.sticky-progress-pill {
    display: none !important;
}

/* Responsive adjustments for stats */
@media (max-width: 860px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 520px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    .stat-card-value {
        font-size: 1.25rem;
    }
}




/* ═══════════════════════════════════════════════════════════════════════════
   COMPETITIVE EXAM REVAMP — New Component Styles & Dark Mode
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Dark Mode Theme ─────────────────────────────────────────────────────── */
html.dark {
    --primary: #3b82f6;
    --primary-dark: #2563eb;
    --primary-light: #60a5fa;
    --primary-subtle: #1e3a8a22;
    --secondary: #f59e0b;
    --secondary-light: #fbbf24;
    --secondary-subtle: #78350f22;
    --success: #10b981;
    --success-light: #34d399;
    --success-subtle: #064e3b22;
    --danger: #ef4444;
    --danger-light: #f87171;
    --danger-subtle: #7f1d1d22;
    --background: #0f172a;
    --surface: #1e293b;
    --surface-alt: #0f172a;
    --text-main: #f1f5f9;
    --text-muted: #cbd5e1;
    --text-subtle: #94a3b8;
    --border: #334155;
    --border-hover: #475569;
}

html.dark body { background-color: #0f172a; color: #f1f5f9; }
html.dark header, html.dark .app-header {
    background: #1e293b;
    border-bottom-color: #334155;
}
html.dark .brand-name { color: #f1f5f9; }
html.dark .desktop-nav a, html.dark .desktop-nav .nav-link { color: #cbd5e1; }
html.dark .desktop-nav a:hover, html.dark .desktop-nav .nav-link:hover { background: #334155; color: #f1f5f9; }
html.dark .desktop-nav a.active, html.dark .desktop-nav .nav-link.active { background: #1e3a8a; border-color: #3b82f6; color: #93c5fd; }
html.dark .nav-link-dropdown-btn { color: #cbd5e1; }
html.dark .nav-dropdown:hover .nav-link-dropdown-btn,
html.dark .nav-dropdown:focus-within .nav-link-dropdown-btn { background: #334155; color: #f1f5f9; }
html.dark .nav-link-dropdown-btn.active { background: #1e3a8a; border-color: #3b82f6; color: #93c5fd; }
html.dark .nav-dropdown-btn { background: #334155; border-color: #475569; color: #f1f5f9; }
html.dark .nav-dropdown-btn:hover { background: #1e293b; border-color: #3b82f6; color: #93c5fd; }
html.dark .nav-dropdown-btn.active { background: #1e3a8a; border-color: #3b82f6; color: #93c5fd; box-shadow: 0 1px 4px rgba(59, 130, 246, 0.25); }
html.dark .nav-dropdown-menu { background: #1e293b; border-color: #334155; }
html.dark .dropdown-item { color: #f1f5f9 !important; }
html.dark .dropdown-item:hover { background: #334155; }
html.dark .dropdown-item.active { background: #1e3a8a44; border-color: #3b82f6; }
html.dark .dropdown-divider { background: #334155; }
html.dark .card, html.dark .quiz-card, html.dark .score-card-row,
html.dark .archive-card, html.dark .quiz-container { background: #1e293b; border-color: #334155; }

html.dark .mobile-bottom-bar { background: #1e293b; border-top-color: #334155; }
html.dark .mob-nav-item { color: #94a3b8; }
html.dark .mob-nav-active { color: #3b82f6; }

html.dark input, html.dark textarea, html.dark select {
    background: #334155; border-color: #475569; color: #f1f5f9;
}
html.dark .btn { border-color: #475569; }
html.dark .btn-primary { background: #1d4ed8; border-color: #3b82f6; }
html.dark .btn-secondary { background: #334155; color: #f1f5f9; }

/* ── Dark Mode Toggle Button ─────────────────────────────────────────────── */
.dark-mode-toggle {
    background: none;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 1rem;
    transition: all 0.2s ease;
    flex-shrink: 0;
}
.dark-mode-toggle:hover { background: var(--surface-alt); border-color: var(--border-hover); color: var(--text-main); }

/* ── Progress Ring (SVG) ─────────────────────────────────────────────────── */
.progress-ring-wrap {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.progress-ring {
    width: 44px;
    height: 44px;
    transform: rotate(-90deg);
}
.progress-ring .ring-bg { fill: none; stroke: var(--border); stroke-width: 3; }
.progress-ring .ring-fill {
    fill: none;
    stroke: #10b981;
    stroke-width: 3;
    stroke-linecap: round;
    stroke-dasharray: 0 100;
    transition: stroke-dasharray 0.4s ease;
}
.ring-label { font-size: 0.75rem; font-weight: 700; color: var(--text-muted); min-width: 30px; }

/* ── Confidence Level Buttons ────────────────────────────────────────────── */
.confidence-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px dashed var(--border);
    flex-wrap: wrap;
}
.conf-label { font-size: 0.75rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }
.conf-btn {
    font-size: 0.78rem;
    font-weight: 600;
    padding: 0.3rem 0.85rem;
    border-radius: 9999px;
    border: 1.5px solid var(--border);
    background: var(--surface);
    cursor: pointer;
    transition: all 0.18s ease;
    color: var(--text-muted);
    font-family: inherit;
}
.conf-btn:hover { transform: translateY(-1px); }
.conf-btn.sure { border-color: #10b981; color: #059669; }
.conf-btn.sure.active { background: #10b981; color: white; border-color: #10b981; }
.conf-btn.unsure { border-color: #f59e0b; color: #d97706; }
.conf-btn.unsure.active { background: #f59e0b; color: white; border-color: #f59e0b; }
.conf-btn.skip { border-color: #94a3b8; color: #64748b; }
.conf-btn.skip.active { background: #94a3b8; color: white; border-color: #94a3b8; }

/* ── Question Metadata Badges ────────────────────────────────────────────── */
.q-meta-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.85rem;
    flex-wrap: wrap;
}
.pyq-badge {
    font-size: 0.72rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 6px;
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
}
html.dark .pyq-badge { background: #1e3a8a44; color: #93c5fd; border-color: #1d4ed8; }
.diff-badge {
    font-size: 0.72rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 6px;
}
.diff-badge.easy { background: #d1fae5; color: #065f46; border: 1px solid #34d399; }
.diff-badge.medium { background: #fef3c7; color: #92400e; border: 1px solid #fcd34d; }
.diff-badge.hard { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
html.dark .diff-badge.easy { background: #064e3b44; color: #34d399; }
html.dark .diff-badge.medium { background: #78350f44; color: #fbbf24; }
html.dark .diff-badge.hard { background: #7f1d1d44; color: #f87171; }
.topic-badge {
    font-size: 0.72rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 6px;
    background: #f8fafc;
    color: var(--text-muted);
    border: 1px solid var(--border);
}

/* ── Submit Confirmation Modal ───────────────────────────────────────────── */
.submit-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    z-index: 9000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}
.submit-modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}
.submit-modal {
    background: var(--surface);
    border-radius: 20px;
    padding: 2rem;
    max-width: 420px;
    width: 100%;
    box-shadow: 0 20px 50px rgba(0,0,0,0.3);
    border: 1px solid var(--border);
    transform: translateY(20px);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.submit-modal-overlay.active .submit-modal { transform: translateY(0); }
.submit-modal h3 { font-size: 1.25rem; margin-bottom: 1.25rem; }
.modal-stat-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}
.modal-stat {
    text-align: center;
    padding: 0.75rem;
    border-radius: 12px;
    border: 1px solid var(--border);
}
.modal-stat .num { font-size: 1.5rem; font-weight: 800; }
.modal-stat .lbl { font-size: 0.72rem; color: var(--text-muted); font-weight: 600; }
.modal-actions { display: flex; gap: 0.75rem; }
.modal-actions button { flex: 1; }

/* ── Bookmark Button ─────────────────────────────────────────────────────── */
.btn-bookmark {
    background: none;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    padding: 0.4rem 0.75rem;
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-muted);
    transition: all 0.18s;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.btn-bookmark:hover { border-color: #f59e0b; color: #d97706; }
.btn-bookmark.bookmarked { background: #fffbeb; border-color: #f59e0b; color: #d97706; }
html.dark .btn-bookmark.bookmarked { background: #78350f33; }

/* ── Auto-save indicator ─────────────────────────────────────────────────── */
.save-indicator {
    font-size: 0.72rem;
    font-weight: 600;
    color: #10b981;
    opacity: 0;
    transition: opacity 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 3px;
}
.save-indicator.show { opacity: 1; }

/* ── Score Reveal Animation ──────────────────────────────────────────────── */
@keyframes scoreReveal {
    from { transform: scale(0.5); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}
.score-reveal { animation: scoreReveal 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards; }

@keyframes countUp { from { opacity: 0.3; } to { opacity: 1; } }

/* ── Accuracy Gauge (SVG semicircle) ─────────────────────────────────────── */
.gauge-wrap {
    text-align: center;
    display: inline-block;
    position: relative;
}
.gauge-svg { overflow: visible; }
.gauge-bg-path { fill: none; stroke: var(--border); stroke-width: 10; stroke-linecap: round; }
.gauge-fill-path {
    fill: none;
    stroke: #10b981;
    stroke-width: 10;
    stroke-linecap: round;
    transition: stroke-dasharray 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.gauge-center-val {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
}
.gauge-pct { font-size: 1.75rem; font-weight: 800; color: var(--text-main); display: block; line-height: 1; }
.gauge-lbl { font-size: 0.72rem; color: var(--text-muted); font-weight: 600; text-transform: uppercase; }

/* ── PYQ Year Chart (pure CSS) ───────────────────────────────────────────── */
.pyq-chart { margin: 1rem 0; }
.pyq-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
    font-size: 0.82rem;
}
.pyq-year-lbl { width: 42px; font-weight: 700; color: var(--text-muted); flex-shrink: 0; font-size: 0.75rem; }
.pyq-bar-wrap { flex: 1; height: 20px; background: var(--surface-alt); border-radius: 6px; overflow: hidden; position: relative; }
.pyq-bar-fill {
    height: 100%;
    border-radius: 6px;
    transition: width 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    align-items: center;
    padding-left: 6px;
    font-size: 0.65rem;
    font-weight: 700;
    color: white;
    min-width: 4px;
}
.pyq-bar-fill.good { background: linear-gradient(90deg, #10b981, #34d399); }
.pyq-bar-fill.ok { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.pyq-bar-fill.poor { background: linear-gradient(90deg, #ef4444, #f87171); }
.pyq-count { font-size: 0.72rem; color: var(--text-muted); font-weight: 600; white-space: nowrap; }

/* ── Topic Weakness Heatmap ──────────────────────────────────────────────── */
.topic-weakness-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.65rem;
    margin-top: 0.75rem;
}
.topic-weakness-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.75rem;
    position: relative;
    overflow: hidden;
}
.topic-weakness-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; bottom: 0;
    width: 4px;
    border-radius: 10px 0 0 10px;
}
.topic-weakness-card.poor::before { background: #ef4444; }
.topic-weakness-card.ok::before { background: #f59e0b; }
.topic-weakness-card.good::before { background: #10b981; }
.topic-weakness-name { font-size: 0.82rem; font-weight: 700; margin-bottom: 4px; color: var(--text-main); }
.topic-weakness-stat { font-size: 0.72rem; color: var(--text-muted); }

/* ── Time Analysis Section ───────────────────────────────────────────────── */
.time-analysis-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.65rem;
    margin-top: 0.75rem;
}
.time-analysis-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.75rem 1rem;
    text-align: center;
}
.time-analysis-val { font-size: 1.25rem; font-weight: 800; color: var(--primary-light); }
.time-analysis-lbl { font-size: 0.72rem; color: var(--text-muted); font-weight: 600; margin-top: 2px; }

/* ── Cutoff Comparison Bar ───────────────────────────────────────────────── */
.cutoff-bar-wrap {
    position: relative;
    height: 36px;
    background: var(--surface-alt);
    border-radius: 10px;
    overflow: visible;
    margin: 0.75rem 0;
}
.cutoff-bar-fill {
    height: 100%;
    border-radius: 10px;
    background: linear-gradient(90deg, #3b82f6, #60a5fa);
    display: flex;
    align-items: center;
    padding-left: 10px;
    font-size: 0.8rem;
    font-weight: 700;
    color: white;
    transition: width 1s ease;
    min-width: 40px;
}
.cutoff-mark {
    position: absolute;
    top: -4px;
    bottom: -4px;
    width: 3px;
    background: #ef4444;
    border-radius: 3px;
}
.cutoff-label {
    position: absolute;
    top: -22px;
    transform: translateX(-50%);
    font-size: 0.65rem;
    font-weight: 700;
    color: #ef4444;
    white-space: nowrap;
}

/* ── Streak Widget ───────────────────────────────────────────────────────── */
.streak-widget {
    background: linear-gradient(135deg, #f97316, #ef4444);
    color: white;
    border-radius: 14px;
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.streak-fire { font-size: 2.5rem; line-height: 1; }
.streak-num { font-size: 2rem; font-weight: 800; line-height: 1; }
.streak-label { font-size: 0.75rem; opacity: 0.9; font-weight: 600; }
.streak-best { margin-left: auto; text-align: right; }
.streak-best .num { font-size: 1.25rem; font-weight: 700; }
.streak-best .lbl { font-size: 0.65rem; opacity: 0.85; }

/* ── Badge Showcase ──────────────────────────────────────────────────────── */
.badges-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin-top: 0.75rem;
}
.badge-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0.4rem 0.85rem;
    border-radius: 9999px;
    font-size: 0.78rem;
    font-weight: 700;
    border: 1.5px solid;
}
.badge-item.earned { background: #fffbeb; border-color: #f59e0b; color: #92400e; }
.badge-item.locked { background: var(--surface-alt); border-color: var(--border); color: var(--text-muted); filter: grayscale(1); opacity: 0.6; }
html.dark .badge-item.earned { background: #78350f33; color: #fbbf24; }

/* ── Score Trend Mini Chart ──────────────────────────────────────────────── */
.score-trend-wrap { overflow-x: auto; padding-bottom: 4px; }
.score-trend {
    display: flex;
    align-items: flex-end;
    gap: 4px;
    height: 60px;
    min-width: max-content;
}
.trend-bar {
    width: 24px;
    border-radius: 4px 4px 0 0;
    background: var(--primary-light);
    opacity: 0.75;
    transition: opacity 0.2s;
    position: relative;
    cursor: pointer;
    flex-shrink: 0;
}
.trend-bar:hover { opacity: 1; }
.trend-bar::after {
    content: attr(data-score);
    position: absolute;
    top: -18px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.6rem;
    font-weight: 700;
    color: var(--text-muted);
    white-space: nowrap;
    display: none;
}
.trend-bar:hover::after { display: block; }

/* ── Analytics Dashboard Styles ──────────────────────────────────────────── */
.analytics-hero {
    background: linear-gradient(135deg, #1e3a8a, #7c3aed);
    color: white;
    padding: 2.5rem 1rem 5rem;
    text-align: center;
    border-radius: 0 0 2rem 2rem;
}
.analytics-cards-wrap {
    margin-top: -3.5rem;
    position: relative;
    z-index: 10;
    padding: 0 1rem;
}
.analytics-stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.75rem;
    max-width: 900px;
    margin: 0 auto;
}
.analytics-stat-card {
    background: var(--surface);
    border-radius: 14px;
    padding: 1rem;
    text-align: center;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-md);
}
.analytics-stat-card .big-num { font-size: 1.75rem; font-weight: 800; color: var(--primary-light); line-height: 1; }
.analytics-stat-card .label { font-size: 0.72rem; color: var(--text-muted); font-weight: 600; margin-top: 4px; text-transform: uppercase; }

/* Subject Radar - pure CSS approximation with bars */
.subject-bars-wrap { margin-top: 0.75rem; }
.subject-bar-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.6rem;
    font-size: 0.82rem;
}
.subject-bar-label { width: 120px; font-weight: 600; color: var(--text-main); flex-shrink: 0; font-size: 0.78rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.subject-bar-bg { flex: 1; height: 22px; background: var(--surface-alt); border-radius: 6px; overflow: hidden; }
.subject-bar-fill {
    height: 100%;
    border-radius: 6px;
    display: flex;
    align-items: center;
    padding-left: 8px;
    font-size: 0.68rem;
    font-weight: 700;
    color: white;
    transition: width 1s ease;
    min-width: 4px;
}
.subject-bar-pct { width: 36px; text-align: right; font-weight: 700; font-size: 0.78rem; color: var(--text-muted); }

/* ── Heatmap Calendar (streak/activity) ─────────────────────────────────── */
.heatmap-wrap { overflow-x: auto; padding-bottom: 8px; }
.heatmap-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, 14px);
    gap: 3px;
    min-width: max-content;
}
.heatmap-cell {
    width: 14px;
    height: 14px;
    border-radius: 3px;
    background: var(--surface-alt);
    border: 1px solid var(--border);
    cursor: pointer;
    transition: transform 0.1s;
}
.heatmap-cell:hover { transform: scale(1.3); }
.heatmap-cell.level-1 { background: #d1fae5; border-color: #6ee7b7; }
.heatmap-cell.level-2 { background: #6ee7b7; border-color: #34d399; }
.heatmap-cell.level-3 { background: #10b981; border-color: #059669; }
html.dark .heatmap-cell { background: #1e293b; }
html.dark .heatmap-cell.level-1 { background: #064e3b; border-color: #065f46; }
html.dark .heatmap-cell.level-2 { background: #065f46; border-color: #047857; }
html.dark .heatmap-cell.level-3 { background: #047857; border-color: #10b981; }

/* ── Mock Test Specific ──────────────────────────────────────────────────── */
.mock-select-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 0.75rem;
    margin-top: 1rem;
}
.mock-subject-card {
    border: 2px solid var(--border);
    border-radius: 12px;
    padding: 0.85rem 1rem;
    cursor: pointer;
    transition: all 0.18s;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--surface);
    user-select: none;
}
.mock-subject-card:hover { border-color: var(--primary-light); background: var(--primary-subtle); }
.mock-subject-card.selected { border-color: var(--primary); background: var(--primary-subtle); box-shadow: 0 0 0 3px var(--primary-subtle); }
.mock-subject-card input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--primary); }
.mock-card-info { flex: 1; }
.mock-card-name { font-size: 0.88rem; font-weight: 700; color: var(--text-main); }
.mock-card-meta { font-size: 0.72rem; color: var(--text-muted); }

/* ── Keyboard Help Modal ─────────────────────────────────────────────────── */
.kbd-help-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    z-index: 9500;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
}
.kbd-help-overlay.active { opacity: 1; pointer-events: all; }
.kbd-help-box {
    background: var(--surface);
    border-radius: 16px;
    padding: 1.5rem;
    max-width: 400px;
    width: 100%;
    border: 1px solid var(--border);
    box-shadow: 0 20px 40px rgba(0,0,0,0.25);
}
.kbd-row { display: flex; align-items: center; gap: 1rem; padding: 0.4rem 0; border-bottom: 1px solid var(--border); font-size: 0.85rem; }
.kbd-row:last-child { border-bottom: none; }
.kbd { background: var(--surface-alt); border: 1px solid var(--border); border-radius: 6px; padding: 2px 8px; font-size: 0.75rem; font-weight: 700; font-family: monospace; color: var(--text-main); }

/* ── Recommendation Card ─────────────────────────────────────────────────── */
.recommendation-card {
    background: linear-gradient(135deg, #1e3a8a 0%, #312e81 100%);
    color: white;
    border-radius: 16px;
    padding: 1.25rem;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}
.recommendation-card .icon { font-size: 2rem; }
.recommendation-card .title { font-weight: 700; font-size: 1rem; }
.recommendation-card .sub { font-size: 0.8rem; opacity: 0.85; margin-top: 2px; }
.recommendation-card .action { margin-left: auto; flex-shrink: 0; }
.recommendation-card .btn { background: white; color: #1e3a8a; border: none; font-weight: 700; }
.recommendation-card .btn:hover { background: #eff6ff; }

/* ── Filter Tabs (scores.php) ────────────────────────────────────────────── */
.filter-tabs {
    display: flex;
    gap: 0.4rem;
    overflow-x: auto;
    padding-bottom: 4px;
    margin-bottom: 1rem;
    scrollbar-width: none;
}
.filter-tabs::-webkit-scrollbar { display: none; }
.filter-tab {
    padding: 0.4rem 1rem;
    border-radius: 9999px;
    border: 1.5px solid var(--border);
    background: var(--surface);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.18s;
    color: var(--text-muted);
    font-family: inherit;
}
.filter-tab:hover { border-color: var(--primary-light); color: var(--primary-light); }
.filter-tab.active { background: var(--primary); color: white; border-color: var(--primary); }

/* ── Responsive fixes for new components ─────────────────────────────────── */
@media (max-width: 640px) {
    .analytics-stat-grid { grid-template-columns: repeat(2, 1fr); }
    .modal-stat-row { grid-template-columns: repeat(3, 1fr); }
    .time-analysis-grid { grid-template-columns: repeat(2, 1fr); }
    .streak-widget { flex-wrap: wrap; gap: 0.5rem; }
    .recommendation-card { flex-wrap: wrap; }
    .recommendation-card .action { width: 100%; }
    .recommendation-card .btn { width: 100%; text-align: center; }
}



/* ═══════════════════════════════════════════════════════════════════════════
   UNIVERSAL MOBILE RESPONSIVENESS & TOUCH OPTIMIZATION ENGINE
   Covers viewports from 320px (iPhone SE) up to 768px (Tablets)
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── 1. Solutions Review Component (result.php, mock_result.php, etc.) ──── */
.solution-filters {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding: 0.35rem 0.15rem;
    margin-bottom: 1rem;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    max-width: 100%;
}
.solution-filters::-webkit-scrollbar {
    display: none;
}
.filter-chip {
    padding: 0.45rem 1rem;
    border-radius: 9999px;
    border: 1.5px solid var(--border);
    background: var(--surface);
    color: var(--text-muted);
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.18s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    font-family: inherit;
    -webkit-tap-highlight-color: transparent;
}
.filter-chip:hover {
    border-color: var(--primary);
    color: var(--primary);
}
.filter-chip.active {
    background: var(--primary) !important;
    border-color: var(--primary) !important;
    color: #ffffff !important;
    box-shadow: 0 2px 8px rgba(30, 58, 138, 0.28);
}
html.dark .filter-chip {
    background: var(--surface);
    border-color: var(--border);
    color: var(--text-muted);
}
html.dark .filter-chip.active {
    background: var(--primary-light) !important;
    border-color: var(--primary-light) !important;
    color: #ffffff !important;
}

.q-breakdown {
    border: 1px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    margin-bottom: 1.25rem;
    transition: transform 0.15s ease;
}
.q-header {
    padding: 1.15rem 1.35rem;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}
.q-text {
    font-size: 1.02rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    line-height: 1.6;
    color: var(--text-main);
}
.opt-list {
    padding: 1rem 1.25rem;
    background: var(--surface-alt);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.opt-item {
    padding: 0.75rem 1rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--surface);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9rem;
    color: var(--text-main);
}
.opt-item.is-correct {
    background: #d1fae5;
    border-color: #34d399;
    color: #065f46;
    font-weight: 600;
}
html.dark .opt-item.is-correct {
    background: #064e3b55;
    color: #34d399;
    border-color: #059669;
}
.opt-item.is-wrong-selected {
    background: #fee2e2;
    border-color: #f87171;
    color: #991b1b;
    font-weight: 600;
}
html.dark .opt-item.is-wrong-selected {
    background: #7f1d1d55;
    color: #f87171;
    border-color: #dc2626;
}
.explanation {
    padding: 1.15rem 1.35rem;
    background: #fffbeb;
    border-top: 1px solid #fde68a;
    color: #92400e;
    font-size: 0.9rem;
    line-height: 1.6;
}
html.dark .explanation {
    background: #78350f22;
    border-top-color: #78350f55;
    color: #fde68a;
}
.action-bar {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
    margin: 2.5rem 0 4rem 0;
}

/* ── 2. iOS Safari Auto-Zoom Prevention (<= 768px) ───────────────────────── */
@media (max-width: 768px) {
    /* Font size < 16px causes iOS Safari to force-zoom input on focus */
    input[type="text"],
    input[type="password"],
    input[type="email"],
    input[type="number"],
    input[type="search"],
    input[type="tel"],
    input[type="url"],
    input[type="date"],
    select,
    textarea,
    .form-control {
        font-size: 16px !important;
    }

    /* Interactive touch target sizing */
    .btn,
    .filter-chip,
    .filter-tab,
    .hub-tab,
    .tab-btn,
    .q-btn {
        touch-action: manipulation;
    }

    /* Smooth touch scrolling for all scroll containers */
    .table-responsive,
    .day-strip,
    .tab-strip,
    .archive-pills-row,
    .hub-tabs-container,
    .solution-filters,
    .filter-tabs,
    .mobile-nav-pills,
    .chart-container {
        -webkit-overflow-scrolling: touch;
        overscroll-behavior-x: contain;
    }

    /* Modal & Dialog mobile containment */
    .modal-box,
    .submit-modal,
    .important-links-sheet,
    .kbd-help-box {
        max-width: calc(100vw - 1.5rem) !important;
        max-height: 88vh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Pre & Code wrap inside tables and explanation cards */
    pre, code {
        white-space: pre-wrap !important;
        word-break: break-word !important;
        overflow-wrap: break-word !important;
    }

    /* Question and option cards on touch */
    .q-header { padding: 1rem 1.15rem; }
    .opt-list { padding: 0.85rem 1rem; }
    .opt-item { padding: 0.65rem 0.85rem; font-size: 0.88rem; }
    .explanation { padding: 1rem 1.15rem; font-size: 0.86rem; }
}

/* ── 3. Phones & Small Devices (<= 480px) ────────────────────────────────── */
@media (max-width: 480px) {
    /* Fluid container spacing */
    .container,
    .container-sm,
    .wall-container,
    .sub-container {
        padding-left: 0.75rem !important;
        padding-right: 0.75rem !important;
    }

    /* Heading scale down for narrow viewports */
    h1, .hero h1, .csat-hero h1, .analytics-hero h1, .support-hero h1 {
        font-size: 1.45rem !important;
        line-height: 1.3 !important;
    }
    h2 {
        font-size: 1.2rem !important;
        line-height: 1.35 !important;
    }
    h3 {
        font-size: 1.05rem !important;
    }

    /* Card padding optimization */
    .card,
    .analytics-section,
    .section-card,
    .reading-card,
    .sub-controls-panel {
        padding: 1rem 0.85rem !important;
        border-radius: 14px !important;
    }

    /* Action buttons full-width for easy thumb tapping */
    .action-bar,
    .action-btns {
        flex-direction: column !important;
        width: 100% !important;
        gap: 0.6rem !important;
    }
    .action-bar a,
    .action-bar button,
    .action-btns a,
    .action-btns button {
        width: 100% !important;
        text-align: center !important;
        justify-content: center !important;
    }

    /* Metric grids on small screens */
    .score-metrics-grid,
    .sub-stats-grid,
    .stats-grid,
    .analytics-stat-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.5rem !important;
    }
    .mock-select-grid {
        grid-template-columns: 1fr !important;
    }
    .sec-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.5rem !important;
    }
    .sec-card {
        padding: 0.75rem !important;
    }
    .mock-hero {
        padding: 1.5rem 1rem !important;
        border-radius: 16px !important;
    }
    .mock-score-num {
        font-size: 2.6rem !important;
    }
    .metric-card,
    .sub-stat-card,
    .stat-card,
    .analytics-stat-card {
        padding: 0.75rem 0.85rem !important;
    }
    .metric-num,
    .sub-stat-num,
    .stat-number,
    .big-num {
        font-size: 1.4rem !important;
    }

    /* Header brand and actions */
    .brand-name { font-size: 1.08rem !important; }
    .brand-tag { display: none !important; }
    .header-inner { padding: 0.65rem 0.75rem !important; }
}

/* ── 4. Extra-Narrow Devices (<= 360px, e.g. iPhone SE, Galaxy S8) ───────── */
@media (max-width: 360px) {
    .container,
    .container-sm,
    .wall-container,
    .sub-container {
        padding-left: 0.5rem !important;
        padding-right: 0.5rem !important;
    }

    /* Single-column metrics on extra small viewports */
    .score-metrics-grid,
    .sub-stats-grid,
    .stats-grid,
    .analytics-stat-grid,
    .sec-grid {
        grid-template-columns: 1fr !important;
    }
    .mock-score-num {
        font-size: 2.15rem !important;
    }
    .mock-timer {
        font-size: 0.95rem !important;
        padding: 0.25rem 0.5rem !important;
    }

    /* Compact badges */
    .hero-badge,
    .today-badge {
        font-size: 0.72rem !important;
        padding: 3px 10px !important;
    }

    /* Bottom nav labels compact */
    .mob-nav-item span {
        font-size: 0.62rem !important;
    }
    .mob-nav-item svg {
        width: 18px !important;
        height: 18px !important;
    }
}


/* ═══════════════════════════════════════════════════════════════════════════
   UNIFIED COMMAND DASHBOARD, PORTAL INSIGHTS & NEXTNOTE UPSC CATALOG STYLES
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── 1. Desktop NextNote Mega-Dropdown ───────────────────────────────────── */
.nav-dropdown-menu.nav-dropdown-mega {
    min-width: 540px;
    max-width: min(600px, calc(100vw - 2rem));
    width: max-content;
    padding: 0.75rem;
    max-height: 82vh;
    overflow-y: auto;
}
.mega-banner-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    margin-bottom: 0.65rem;
    padding-bottom: 0.65rem;
    border-bottom: 1px solid var(--border);
}
.mega-banner-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0.5rem 0.65rem;
    border-radius: 9px;
    text-decoration: none;
    background: var(--surface-alt);
    border: 1px solid var(--border);
    color: var(--text-main);
    transition: all 0.15s ease;
}
.mega-banner-link:hover {
    border-color: var(--primary);
    background: #eff6ff;
    transform: translateY(-1px);
}
html.dark .mega-banner-link:hover { background: #1e3a8a44; }
.mega-banner-title { font-size: 0.79rem; font-weight: 800; color: var(--text-main); display: block; line-height: 1.2; }
.mega-banner-sub { font-size: 0.68rem; color: var(--text-muted); display: block; margin-top: 1px; }

.mega-groups-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.65rem 0.85rem;
}
.mega-group-title {
    font-size: 0.66rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 0.3rem;
    padding-left: 0.25rem;
}
.mega-links-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.mega-link-item {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 0.35rem 0.5rem;
    border-radius: 7px;
    text-decoration: none;
    color: var(--text-main);
    font-size: 0.8rem;
    font-weight: 600;
    transition: background 0.15s ease, transform 0.12s ease;
}
.mega-link-item:hover {
    background: var(--surface-alt);
    color: var(--primary);
    transform: translateX(2px);
}
.mega-link-tag {
    margin-left: auto;
    font-size: 0.62rem;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 4px;
    background: var(--surface-alt);
    color: var(--text-muted);
    border: 1px solid var(--border);
}

/* ── 2. Mobile Navigation Drawer: NextNote Accordions ────────────────────── */
.drawer-nn-hub-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0.65rem 0.85rem;
    border-radius: 10px;
    text-decoration: none;
    background: linear-gradient(135deg, #1e3a8a, #2563eb);
    color: #ffffff;
    margin-bottom: 0.55rem;
    box-shadow: 0 4px 12px rgba(30, 58, 138, 0.25);
}
.drawer-nn-hub-title { font-size: 0.86rem; font-weight: 800; display: block; line-height: 1.2; }
.drawer-nn-hub-sub { font-size: 0.69rem; opacity: 0.88; display: block; margin-top: 2px; }

.drawer-nn-group {
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface-alt);
    margin-bottom: 0.45rem;
    overflow: hidden;
}
.drawer-nn-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.55rem 0.75rem;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-main);
    cursor: pointer;
    user-select: none;
    list-style: none;
}
.drawer-nn-summary::-webkit-details-marker { display: none; }
.drawer-nn-badge {
    font-size: 0.65rem;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 999px;
    background: var(--surface);
    color: var(--primary);
    border: 1px solid var(--border);
}
.drawer-nn-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
    padding: 0 0.6rem 0.6rem;
}
.drawer-nn-pill {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0.5rem 0.55rem;
    min-height: 42px;
    border-radius: 8px;
    background: var(--surface);
    border: 1px solid var(--border);
    text-decoration: none;
    color: var(--text-main);
    font-size: 0.76rem;
    font-weight: 700;
    line-height: 1.2;
    transition: border-color 0.15s ease, transform 0.12s ease;
}
.drawer-nn-pill:hover, .drawer-nn-pill:active {
    border-color: var(--primary);
    transform: translateY(-1px);
}
.drawer-nn-pill .nn-ext {
    margin-left: auto;
    font-size: 0.68rem;
    color: var(--text-muted);
    flex-shrink: 0;
}

/* ── 3. Mobile Bottom Sheet ("More"): NextNote Directory ─────────────────── */
.sheet-section-divider {
    margin: 0.9rem 0 0.6rem;
    padding-top: 0.85rem;
    border-top: 1px dashed var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.sheet-section-title {
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 6px;
}
.sheet-nn-tabs {
    display: flex;
    gap: 5px;
    overflow-x: auto;
    padding-bottom: 0.45rem;
    margin-bottom: 0.55rem;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}
.sheet-nn-tabs::-webkit-scrollbar { display: none; }
.sheet-nn-tab {
    flex-shrink: 0;
    padding: 4px 11px;
    border-radius: 9999px;
    border: 1px solid var(--border);
    background: var(--surface-alt);
    color: var(--text-muted);
    font-size: 0.74rem;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.15s ease;
}
.sheet-nn-tab.active {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
}
.sheet-nn-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
    padding-bottom: 0.75rem;
}
.sheet-nn-card {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0.55rem 0.65rem;
    min-height: 48px;
    border-radius: 10px;
    background: var(--surface-alt);
    border: 1px solid var(--border);
    text-decoration: none;
    color: var(--text-main);
    transition: all 0.15s ease;
}
.sheet-nn-card:hover { border-color: var(--primary); }
.sheet-nn-icon { font-size: 1.15rem; flex-shrink: 0; line-height: 1; }
.sheet-nn-info { min-width: 0; flex: 1; }
.sheet-nn-name {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-main);
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sheet-nn-badge {
    font-size: 0.64rem;
    font-weight: 700;
    color: var(--text-muted);
    display: block;
}

/* ── 4. Unified Study Command Bar & Focus Timer ──────────────────────────── */
.unified-plan-bar {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 0.9rem 1.1rem;
    margin-bottom: 1.15rem;
    box-shadow: 0 4px 16px -2px rgba(15, 23, 42, 0.06);
}
.unified-plan-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin-bottom: 0.75rem;
}
.unified-day-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.unified-day-pill {
    background: var(--primary);
    color: #ffffff;
    font-size: 0.76rem;
    font-weight: 800;
    padding: 4px 11px;
    border-radius: 9999px;
}
.unified-date-text {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-main);
}
.unified-nav-controls {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    flex: 1;
}
.unified-nav-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.4rem 0.75rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--surface-alt);
    color: var(--text-main);
    font-size: 0.78rem;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.15s ease;
    white-space: nowrap;
}
.unified-nav-btn:hover { border-color: var(--primary); color: var(--primary); }
.unified-day-select {
    flex: 1;
    min-width: 190px;
    padding: 0.42rem 0.7rem;
    border-radius: 8px;
    border: 1.5px solid var(--border);
    background: var(--surface-alt);
    color: var(--text-main);
    font-size: 0.82rem;
    font-weight: 600;
    font-family: inherit;
}
.unified-date-input {
    padding: 0.38rem 0.6rem;
    border-radius: 8px;
    border: 1.5px solid var(--border);
    background: var(--surface-alt);
    color: var(--text-main);
    font-size: 0.8rem;
    font-weight: 600;
    font-family: inherit;
}

/* Pomodoro Study Focus Pill */
.pomodoro-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0.32rem 0.65rem;
    border-radius: 9999px;
    background: var(--surface-alt);
    border: 1.5px solid var(--border);
    font-size: 0.76rem;
    font-weight: 700;
    color: var(--text-main);
}
.pomodoro-pill.running {
    border-color: #10b981;
    background: #ecfdf5;
    color: #065f46;
}
html.dark .pomodoro-pill.running {
    background: #064e3b66;
    color: #6ee7b7;
}
.pomodoro-time {
    font-variant-numeric: tabular-nums;
    font-weight: 800;
    min-width: 42px;
    text-align: center;
}
.pomodoro-btn {
    border: none;
    background: var(--primary);
    color: #ffffff;
    border-radius: 999px;
    padding: 2px 9px;
    font-size: 0.7rem;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
}
.pomodoro-btn.reset {
    background: transparent;
    color: var(--text-muted);
    padding: 2px 5px;
}

/* ── 5. Portal Modules & Live Insights Grid ──────────────────────────────── */
.portal-insights-wrap {
    margin-bottom: 1.35rem;
}
.portal-insights-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}
.portal-insights-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 800;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 7px;
}
.portal-insights-sub {
    font-size: 0.76rem;
    color: var(--text-muted);
    font-weight: 600;
}
.portal-insights-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
}
.insight-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 0.95rem 1rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 0.55rem;
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.insight-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: var(--ic-accent, var(--primary));
}
.insight-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px -4px rgba(15, 23, 42, 0.1);
    border-color: var(--border-hover);
}
.insight-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
}
.insight-title-group {
    display: flex;
    align-items: center;
    gap: 7px;
    min-width: 0;
}
.insight-icon {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    background: var(--ic-bg, #eff6ff);
    flex-shrink: 0;
}
.insight-name {
    font-size: 0.85rem;
    font-weight: 800;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.insight-pill {
    font-size: 0.67rem;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 999px;
    background: var(--ic-bg, #eff6ff);
    color: var(--ic-accent, var(--primary));
    white-space: nowrap;
    flex-shrink: 0;
}
.insight-metric-row {
    font-size: 0.78rem;
    color: var(--text-muted);
    line-height: 1.4;
    font-weight: 500;
}
.insight-metric-row strong {
    color: var(--text-main);
    font-weight: 700;
}
.insight-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    padding-top: 0.45rem;
    border-top: 1px dashed var(--border);
}
.insight-link {
    font-size: 0.74rem;
    font-weight: 700;
    color: var(--ic-accent, var(--primary));
    text-decoration: none;
    padding: 2px 8px;
    border-radius: 6px;
    background: var(--surface-alt);
    border: 1px solid var(--border);
    transition: all 0.15s ease;
}
.insight-link:hover {
    background: var(--ic-bg, #eff6ff);
    border-color: var(--ic-accent, var(--primary));
}

/* ── 6. Dashboard Interactive NextNote UPSC Explorer Card ────────────────── */
.nn-explorer-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 1.35rem;
    box-shadow: 0 4px 16px -4px rgba(15, 23, 42, 0.08);
}
.nn-explorer-head {
    background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 65%, #1d4ed8 100%);
    color: #ffffff;
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
}
.nn-head-title {
    display: flex;
    align-items: center;
    gap: 10px;
}
.nn-head-title h3 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 800;
    color: #ffffff;
}
.nn-head-sub {
    font-size: 0.76rem;
    color: #cbd5e1;
    margin: 2px 0 0;
}
.nn-hub-cta {
    background: rgba(255, 255, 255, 0.16);
    border: 1px solid rgba(255, 255, 255, 0.35);
    color: #ffffff;
    padding: 0.42rem 0.9rem;
    border-radius: 9999px;
    font-size: 0.78rem;
    font-weight: 800;
    text-decoration: none;
    white-space: nowrap;
    backdrop-filter: blur(6px);
    transition: background 0.15s ease;
}
.nn-hub-cta:hover { background: rgba(255, 255, 255, 0.28); color: #ffffff; }

.nn-explorer-body {
    padding: 1rem 1.25rem 1.25rem;
}
.nn-controls-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin-bottom: 0.95rem;
}
.nn-filter-pills {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
}
.nn-filter-pills::-webkit-scrollbar { display: none; }
.nn-filter-pill {
    flex-shrink: 0;
    padding: 0.38rem 0.85rem;
    border-radius: 9999px;
    border: 1.5px solid var(--border);
    background: var(--surface-alt);
    color: var(--text-muted);
    font-size: 0.76rem;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.15s ease;
}
.nn-filter-pill.active {
    background: #1e3a8a;
    color: #ffffff;
    border-color: #1e3a8a;
}
html.dark .nn-filter-pill.active {
    background: #2563eb;
    border-color: #3b82f6;
}
.nn-search-wrap {
    position: relative;
    min-width: 190px;
    flex: 1;
    max-width: 260px;
}
.nn-search-input {
    width: 100%;
    padding: 0.4rem 0.75rem 0.4rem 2rem;
    border-radius: 9999px;
    border: 1.5px solid var(--border);
    background: var(--surface-alt);
    color: var(--text-main);
    font-size: 0.8rem;
    font-family: inherit;
}
.nn-search-icon {
    position: absolute;
    left: 0.7rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.78rem;
    color: var(--text-muted);
    pointer-events: none;
}

.nn-subject-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.65rem;
}
.nn-subject-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 0.45rem;
    padding: 0.85rem;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--surface-alt);
    text-decoration: none;
    color: var(--text-main);
    transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}
.nn-subject-card:hover {
    transform: translateY(-2px);
    border-color: var(--nn-color, var(--primary));
    box-shadow: 0 6px 16px -4px rgba(15, 23, 42, 0.1);
}
.nn-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
}
.nn-card-icon {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    background: var(--nn-bg, #eff6ff);
}
.nn-paper-badge {
    font-size: 0.64rem;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 6px;
    background: var(--nn-bg, #eff6ff);
    color: var(--nn-color, var(--primary));
    text-transform: uppercase;
}
.nn-card-title {
    font-size: 0.86rem;
    font-weight: 800;
    color: var(--text-main);
    line-height: 1.25;
}
.nn-card-meta {
    font-size: 0.72rem;
    color: var(--text-muted);
    line-height: 1.35;
}
.nn-card-cta {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--nn-color, var(--primary));
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 2px;
}

/* ── 7. Dark Mode Parity for Dashboard Cards ─────────────────────────────── */
html.dark .section-card,
html.dark .phase-banner,
html.dark .reading-body,
html.dark .syllabus-accordion,
html.dark .portal-card,
html.dark .compact-routine-bar,
html.dark .quick-nav-bar,
html.dark .stat-card,
html.dark .modal-box {
    background: #1e293b !important;
    border-color: #334155 !important;
    color: #f1f5f9 !important;
}
html.dark .section-card-header,
html.dark .syllabus-accordion-summary,
html.dark .routine-col,
html.dark .mains-item,
html.dark .current-events,
html.dark .backlog-drawer {
    background: #0f172a !important;
    border-color: #334155 !important;
}
html.dark .mains-q,
html.dark .quiz-name,
html.dark .section-card-header h3,
html.dark .routine-col-title,
html.dark .portal-card h4,
html.dark .idx-row label {
    color: #f1f5f9 !important;
}
html.dark .current-events li,
html.dark .routine-col-desc {
    color: #cbd5e1 !important;
}
html.dark .quick-nav-tab { color: #cbd5e1; }
html.dark .quick-nav-tab:hover { background: #334155; color: #f1f5f9; }
html.dark .quick-nav-tab.active { background: #2563eb; border-color: #3b82f6; color: #ffffff; }
html.dark .quick-nav-badge { background: #334155; color: #e2e8f0; }

/* ── 8. Responsive Breakpoints ───────────────────────────────────────────── */
@media (max-width: 900px) {
    .portal-insights-grid { grid-template-columns: repeat(2, 1fr); }
    .nn-subject-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
    .unified-plan-bar { padding: 0.75rem 0.85rem; }
    .unified-nav-controls { width: 100%; }
    .unified-day-select { width: 100%; min-width: 100%; order: 3; }
    .portal-insights-grid { grid-template-columns: 1fr; gap: 0.65rem; }
    .nn-explorer-head, .nn-explorer-body { padding: 0.85rem; }
    .nn-search-wrap { max-width: 100%; width: 100%; }
    .nn-subject-grid { grid-template-columns: repeat(2, 1fr); gap: 0.5rem; }
    .nn-subject-card { padding: 0.7rem; }
    .nn-card-title { font-size: 0.8rem; }
    .nn-card-meta { font-size: 0.68rem; }
}

@media (max-width: 380px) {
    .drawer-nn-grid,
    .sheet-nn-grid,
    .nn-subject-grid {
        grid-template-columns: 1fr;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════
   GLOBAL MOBILE POLISH & RESPONSIVENESS v3.0
   ═══════════════════════════════════════════════════════════════════════════ */
body {
    overflow-x: hidden !important;
}

*, *::before, *::after {
    box-sizing: border-box;
}

img, video {
    max-width: 100%;
    height: auto;
}

/* Responsive Table Wrapper */
.table-responsive-auto {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 1rem;
    border-radius: var(--radius-sm, 8px);
}
.table-responsive-auto::-webkit-scrollbar {
    height: 6px;
}
.table-responsive-auto::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.4);
    border-radius: 3px;
}

/* Universal Horizontal Scrollable Tabs */
.tab-row-scroll, .filter-tabs-scroll {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 6px;
    padding-bottom: 4px;
}
.tab-row-scroll::-webkit-scrollbar, .filter-tabs-scroll::-webkit-scrollbar {
    display: none;
}

/* Mobile Polish Breakpoint */
@media (max-width: 768px) {
    .container {
        padding-left: 0.85rem !important;
        padding-right: 0.85rem !important;
    }

    /* Full width inputs on mobile */
    .form-group input:not([type="checkbox"]):not([type="radio"]),
    .form-group select,
    .form-group textarea {
        width: 100%;
        max-width: 100%;
    }

    /* Touch target comfort */
    .btn, button.btn, a.btn {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    /* Prevent text cutoff in cards */
    .card {
        padding: 0.9rem;
    }
}

/* ── Portal Announcement Banner (v3.0) ─────────────────────────────────── */
.portal-announcement-banner {
    background: linear-gradient(90deg, #312e81, #4338ca, #3b82f6);
    color: #ffffff;
    padding: 0.55rem 1rem;
    font-size: 0.86rem;
    font-weight: 700;
    box-shadow: 0 2px 10px rgba(49, 46, 129, 0.25);
    position: relative;
    z-index: 100;
}
.portal-announcement-banner .announcement-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-align: center;
}
.portal-announcement-banner .announcement-icon {
    font-size: 1.1rem;
    animation: pulse 1.8s infinite;
}

/* ── Portal Holiday & Rest Day Banner (v3.0) ────────────────────────────── */
.portal-holiday-banner {
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 50%, #f0fdf4 100%);
    border-bottom: 2px solid #6ee7b7;
    color: #065f46;
    padding: 0.85rem 1rem;
    box-shadow: 0 4px 14px rgba(5, 150, 105, 0.08);
    position: relative;
    z-index: 99;
}
.portal-holiday-banner .holiday-inner {
    display: flex;
    align-items: center;
    gap: 12px;
    max-width: 920px;
    margin: 0 auto;
}
.portal-holiday-banner .holiday-icon {
    font-size: 2rem;
    line-height: 1;
    flex-shrink: 0;
}
.portal-holiday-banner .holiday-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.portal-holiday-banner .holiday-title {
    font-size: 0.84rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    color: #047857;
    text-transform: uppercase;
}
.portal-holiday-banner .holiday-text {
    font-size: 0.86rem;
    color: #064e3b;
    font-weight: 600;
    line-height: 1.35;
}
@media (max-width: 600px) {
    .portal-holiday-banner .holiday-icon { font-size: 1.5rem; }
    .portal-holiday-banner .holiday-title { font-size: 0.78rem; }
    .portal-holiday-banner .holiday-text { font-size: 0.8rem; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   ADMIN & PORTAL UNIVERSAL MOBILE RESPONSIVENESS OVERHAUL (v3.0.1)
   ═══════════════════════════════════════════════════════════════════════════ */
html, body {
    max-width: 100vw;
    overflow-x: hidden !important;
}
.container, .container-sm, .card {
    box-sizing: border-box !important;
}

@media (max-width: 992px) {
    .admin-flex {
        flex-direction: column !important;
        gap: 1.25rem !important;
    }
}

@media (max-width: 768px) {
    /* Prevent iOS auto-zoom on input focus by setting 16px font-size */
    input[type="text"]:not([type="checkbox"]):not([type="radio"]),
    input[type="number"],
    input[type="date"],
    input[type="search"],
    input[type="email"],
    input[type="password"],
    select,
    textarea {
        font-size: 16px !important;
        max-width: 100% !important;
    }

    /* Universal touch-friendly button targets */
    .btn, button.btn, a.btn {
        min-height: 44px;
        touch-action: manipulation;
    }

    /* Action button grid rows on mobile */
    .action-btns {
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 6px !important;
        width: 100% !important;
    }
    .action-btns .btn {
        flex: 1 1 calc(50% - 6px) !important;
        min-height: 42px !important;
        text-align: center !important;
        justify-content: center !important;
        font-size: 0.8rem !important;
        padding: 6px 8px !important;
        box-sizing: border-box !important;
    }

    /* Universal responsive table container */
    .table-responsive {
        width: 100% !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        scrollbar-width: thin !important;
    }

    /* Card padding optimization */
    .card {
        padding: 1rem 0.9rem !important;
        border-radius: 14px !important;
    }
}

@media (max-width: 480px) {
    .metrics-ribbon {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.5rem !important;
    }
    .metric-tile {
        padding: 0.75rem 0.65rem !important;
    }
    .metric-tile-val {
        font-size: 1.35rem !important;
    }
    .metric-tile-lbl {
        font-size: 0.7rem !important;
    }
    .quick-matrix-grid {
        grid-template-columns: 1fr !important;
        gap: 0.5rem !important;
    }
    .matrix-btn {
        padding: 0.75rem 0.85rem !important;
    }
    .toggles-grid {
        grid-template-columns: 1fr !important;
    }
    .toggle-card {
        padding: 0.9rem !important;
    }
    .toggle-icon {
        font-size: 1.6rem !important;
    }
    .action-btns .btn {
        flex: 1 1 100% !important;
    }
}

