/* ============================================
   ROOT VARIABLES & DESIGN SYSTEM
   ============================================ */
:root {
    --bg-color: #F7F9FC;
    --sidebar-bg: #FFFFFF;
    --card-bg: #FFFFFF;
    --text-primary: #14295B;
    --text-secondary: #64748B;
    --accent-primary: #2563EB;
    --accent-secondary: #3B82F6;
    --border-color: #E7EDF7;
    --glass-shadow: 0 2px 16px rgba(20,41,91,0.03);
    --success-color: #10B981;
    --warning-color: #F59E0B;
    --danger-color: #EF4444;
}

[data-theme="dark"] {
    --bg-color: #0F172A;
    --sidebar-bg: #1E293B;
    --card-bg: #1E293B;
    --text-primary: #F8FAFC;
    --text-secondary: #94A3B8;
    --accent-primary: #3B82F6;
    --accent-secondary: #60A5FA;
    --border-color: #334155;
    --glass-shadow: 0 8px 32px 0 rgba(0,0,0,0.4);
}

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

::selection {
    background: #2563EB !important;
    color: #FFFFFF !important;
}

::-moz-selection {
    background: #2563EB !important;
    color: #FFFFFF !important;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    width: 100% !important;
    max-width: 100vw !important;
    overflow-x: hidden !important;
    box-sizing: border-box;
}

*, *::before, *::after {
    box-sizing: border-box !important;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: 'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14.5px;
    line-height: 1.6;
    letter-spacing: -0.01em;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    font-feature-settings: 'cv02', 'cv03', 'cv04', 'cv11';
    width: 100% !important;
    max-width: 100vw !important;
    overflow-x: hidden !important;
    position: relative;
    margin: 0;
    padding: 0;
}

/* Global Typography Hierarchy */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--text-primary);
    font-weight: 800;
    line-height: 1.25;
    letter-spacing: -0.025em;
}

h1 { font-size: 32px; font-weight: 850; letter-spacing: -0.03em; line-height: 1.18; }
h2 { font-size: 24px; font-weight: 800; letter-spacing: -0.025em; line-height: 1.25; }
h3 { font-size: 18.5px; font-weight: 750; letter-spacing: -0.02em; line-height: 1.3; }
h4 { font-size: 16px; font-weight: 700; letter-spacing: -0.015em; line-height: 1.4; }

p {
    font-size: 14.5px;
    line-height: 1.6;
    color: var(--text-secondary);
    letter-spacing: -0.008em;
}

[data-theme="dark"] h1, 
[data-theme="dark"] h2, 
[data-theme="dark"] h3, 
[data-theme="dark"] h4 {
    color: #F8FAFC;
}

[data-theme="dark"] p {
    color: #94A3B8;
}

input, button, select, textarea {
    font-family: inherit;
    font-size: 14px;
}

/* Particle canvas */
#particle-canvas {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    pointer-events: none;
    z-index: 0;
    opacity: 0;
    transition: opacity 0.8s;
}
#landing-page.visible ~ #particle-canvas,
body.landing-visible #particle-canvas { opacity: 1; }

/* Glassmorphism utility */
.glass {
    background: var(--card-bg);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid var(--border-color);
    box-shadow: var(--glass-shadow);
    border-radius: 16px;
}

/* ============================================
   AUTH MODAL
   ============================================ */
.auth-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    backdrop-filter: blur(12px);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeInOverlay 0.25s ease;
}

@keyframes fadeInOverlay {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.auth-container {
    width: 100%;
    max-width: 420px;
    padding: 44px 40px 36px;
    text-align: center;
    animation: scaleIn 0.3s cubic-bezier(0.34,1.56,0.64,1);
    position: relative;
}

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

.auth-close-btn {
    position: absolute;
    top: 16px; right: 16px;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    width: 34px; height: 34px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.2s;
}
.auth-close-btn:hover { background: var(--danger-color); color: white; border-color: var(--danger-color); }

.auth-logo-mini {
    width: 54px; height: 54px;
    background: linear-gradient(135deg, #2563EB, #4F46E5);
    border-radius: 16px;
    display: flex; align-items: center; justify-content: center;
    color: white;
    font-size: 24px;
    margin: 0 auto 14px;
    box-shadow: 0 8px 24px rgba(37,99,235,0.3);
}

.auth-role-tabs {
    display: flex;
    gap: 8px;
    background: var(--surface-inset);
    padding: 4px;
    border-radius: 12px;
    margin-bottom: 20px;
}
[data-theme="dark"] .auth-role-tabs { background: #0F172A; }
.auth-role-tab {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 12px;
    border-radius: 9px;
    border: none;
    background: transparent;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.18s ease;
}
.auth-role-tab.active {
    background: #2563EB !important;
    color: #FFFFFF !important;
    box-shadow: 0 2px 10px rgba(37,99,235,0.25);
}
.auth-role-tab.active i,
.auth-role-tab.active span {
    color: #FFFFFF !important;
}

.auth-container h2 {
    font-size: 24px;
    font-weight: 800;
    margin-bottom: 6px;
    color: var(--text-primary);
}
[data-theme="dark"] .auth-container h2 { color: #F8FAFC; }

.auth-container p {
    color: var(--text-secondary);
    margin-bottom: 24px;
    font-size: 14px;
}

.form-group {
    margin-bottom: 18px;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 7px;
    font-weight: 600;
    font-size: 13px;
    color: var(--text-primary);
}

.form-group input, .form-group select, .form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border-radius: 10px;
    border: 1.5px solid var(--border-color);
    background: var(--bg-color);
    color: var(--text-primary);
    outline: none;
    font-size: 15px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(79,70,229,0.12);
}

.password-wrapper { position: relative; }
.password-wrapper input { padding-right: 46px; }
.toggle-pw {
    position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
    background: none; border: none; cursor: pointer;
    color: var(--text-secondary); font-size: 15px;
}
.toggle-pw:hover { color: var(--accent-primary); }

.error-msg {
    color: var(--danger-color);
    margin-bottom: 12px;
    font-size: 13px;
    min-height: 18px;
    text-align: center;
}

.btn {
    padding: 12px 24px;
    border-radius: 12px;
    border: none;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: white;
    font-weight: 700;
    font-size: 15px;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.2s, opacity 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(79,70,229,0.35); }
.btn:active { transform: translateY(0); }

.btn-full { width: 100%; padding: 14px; }

.btn-glow {
    box-shadow: 0 4px 16px rgba(79,70,229,0.3);
    position: relative;
    overflow: hidden;
}
.btn-glow::after {
    content: '';
    position: absolute;
    top: -50%; left: -50%;
    width: 200%; height: 200%;
    background: linear-gradient(45deg, transparent 30%, rgba(255,255,255,0.15) 50%, transparent 70%);
    transform: translateX(-100%);
    transition: transform 0.5s;
}
.btn-glow:hover::after { transform: translateX(50%); }

.btn-secondary {
    background: var(--text-secondary);
}
.btn-secondary:hover { background: var(--text-primary); box-shadow: none; }

.btn-primary { background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary)); }

.auth-toggle {
    margin-top: 20px;
    font-size: 13px;
    color: var(--text-secondary);
}
.auth-toggle a {
    color: var(--accent-primary);
    text-decoration: none;
    font-weight: 700;
    margin-left: 4px;
}
.auth-toggle a:hover { text-decoration: underline; }

/* ============================================
   LANDING PAGE
   ============================================ */
#landing-page {
    position: relative;
    min-height: 100vh;
    min-height: 100dvh;
    overflow-x: hidden;
    background-color: var(--surface-inset);
    color: var(--text-primary);
}

/* Blobs */
.land-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    pointer-events: none;
    z-index: 0;
}
.land-blob-1 {
    width: 650px; height: 650px;
    background: radial-gradient(circle, rgba(37,99,235,0.08), transparent 70%);
    top: -200px; left: -200px;
    animation: blobFloat 12s ease-in-out infinite;
}
.land-blob-2 {
    width: 550px; height: 550px;
    background: radial-gradient(circle, rgba(59,130,246,0.06), transparent 70%);
    top: 300px; right: -150px;
    animation: blobFloat 16s ease-in-out infinite reverse;
}
.land-blob-3 {
    width: 450px; height: 450px;
    background: radial-gradient(circle, rgba(16,185,129,0.05), transparent 70%);
    bottom: 100px; left: 30%;
    animation: blobFloat 20s ease-in-out infinite;
}

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

/* Glassmorphism for landing */
.glass-land {
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(226, 232, 240, 0.85);
    box-shadow: 0 10px 30px rgba(37, 99, 235, 0.04);
    border-radius: 20px;
}

.land-sub-brand {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 600;
    margin-left: 4px;
}

/* ---- NAVBAR ---- */
.land-nav {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 100;
    padding: 0 20px;
    transition: background 0.3s, box-shadow 0.3s;
}
.land-nav.scrolled {
    background: rgba(255,255,255,0.94);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 2px 24px rgba(0,0,0,0.06);
}

.land-nav-inner {
    max-width: 1440px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 72px;
    gap: 16px;
}

.land-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    font-size: 21px;
    font-weight: 800;
    color: var(--text-primary);
    white-space: nowrap;
    flex-shrink: 0;
}
.land-logo-icon {
    width: 38px; height: 38px;
    background: linear-gradient(135deg, #2563eb, #3b82f6);
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    color: white;
    font-size: 17px;
    box-shadow: 0 4px 12px rgba(37,99,235,0.35);
}
.land-logo-accent { color: #2563eb; }

.land-nav-links {
    display: flex;
    align-items: center;
    list-style: none;
    gap: 4px;
    margin: 0;
    padding: 0;
    flex: 1;
    justify-content: center;
}
.land-nav-links a {
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 13.5px;
    padding: 7px 11px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    transition: color 0.2s, background 0.2s;
}
.land-nav-links a:hover { color: #2563eb; background: rgba(37,99,235,0.07); }

.land-nav-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.btn-land-outline {
    padding: 8px 14px;
    border-radius: 10px;
    border: 1.5px solid #CBD5E1;
    background: transparent;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.btn-land-outline:hover {
    border-color: #94A3B8;
    background: var(--surface-inset);
    transform: translateY(-1px);
}

.btn-land-teacher {
    border: 1.5px solid #10B981;
    color: #059669;
    background: rgba(16,185,129,0.05);
    font-weight: 700;
}
.btn-land-teacher:hover {
    background: #10B981;
    color: #FFFFFF;
    border-color: #10B981;
    box-shadow: 0 4px 12px rgba(16,185,129,0.25);
}

.btn-land-dev {
    border: 1.5px solid #2563EB;
    color: #2563EB;
    background: rgba(37,99,235,0.05);
    font-weight: 700;
}
.btn-land-dev:hover {
    background: #2563EB;
    color: #FFFFFF;
    border-color: #2563EB;
    box-shadow: 0 4px 12px rgba(37,99,235,0.25);
}

.btn-land-primary {
    padding: 8.5px 18px;
    border-radius: 10px;
    border: none;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: white;
    font-weight: 700;
    font-size: 13.5px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    white-space: nowrap;
    box-shadow: 0 4px 14px rgba(37,99,235,0.28);
}
.btn-land-primary:hover { transform: translateY(-1px); box-shadow: 0 8px 24px rgba(37,99,235,0.38); }
.btn-land-primary:active { transform: translateY(0); }

.btn-land-large {
    padding: 16px 32px;
    font-size: 16px;
    border-radius: 14px;
}

.btn-land-ghost {
    padding: 16px 28px;
    border-radius: 14px;
    border: 1.5px solid rgba(37,99,235,0.25);
    background: rgba(255,255,255,0.6);
    color: var(--text-primary);
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    backdrop-filter: blur(8px);
}
.btn-land-ghost:hover { background: rgba(255,255,255,0.9); transform: translateY(-1px); }

.land-hamburger {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 22px;
    color: var(--text-primary);
}

.land-mobile-menu {
    display: none;
    flex-direction: column;
    gap: 10px;
    background: rgba(255,255,255,0.97);
    backdrop-filter: blur(20px);
    border-top: 1px solid rgba(0,0,0,0.06);
    padding: 20px 24px;
}
.land-mobile-menu.open { display: flex; }
.land-mobile-link {
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 500;
    padding: 10px 0;
    border-bottom: 1px solid rgba(0,0,0,0.04);
    font-size: 15px;
}
.land-mobile-link:hover { color: #2563eb; }

/* ---- HERO ---- */
.land-hero {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    gap: 60px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 120px 32px 80px;
    position: relative;
    z-index: 1;
}

.land-hero-content {
    flex: 1;
    min-width: 0;
}

.land-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(37,99,235,0.1);
    border: 1px solid rgba(37,99,235,0.25);
    color: #2563eb;
    font-size: 13px;
    font-weight: 700;
    padding: 6px 16px;
    border-radius: 100px;
    margin-bottom: 24px;
    letter-spacing: 0.02em;
    animation: fadeInUp 0.6s ease both;
}
.land-badge-dot {
    width: 8px; height: 8px;
    background: #2563eb;
    border-radius: 50%;
    animation: pulseDot 2s infinite;
}
@keyframes pulseDot {
    0%,100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.4); }
}

.land-hero-title {
    font-size: clamp(36px, 5vw, 64px);
    font-weight: 900;
    line-height: 1.1;
    color: var(--text-primary);
    margin-bottom: 20px;
    animation: fadeInUp 0.6s 0.1s ease both;
    letter-spacing: -0.02em;
}

.land-gradient-text {
    background: linear-gradient(135deg, #2563eb, #3b82f6, #60a5fa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.land-hero-sub {
    font-size: 18px;
    color: var(--text-secondary);
    line-height: 1.65;
    max-width: 520px;
    margin-bottom: 36px;
    animation: fadeInUp 0.6s 0.2s ease both;
}

.land-hero-btns {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 48px;
    animation: fadeInUp 0.6s 0.3s ease both;
}

.land-hero-stats {
    display: flex;
    align-items: center;
    gap: 0;
    animation: fadeInUp 0.6s 0.4s ease both;
}
.land-hero-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0 28px;
}
.land-hero-stat:first-child { padding-left: 0; }
.stat-num {
    font-size: 32px;
    font-weight: 900;
    color: #2563eb;
    line-height: 1;
}
.stat-num + span { font-size: 22px; font-weight: 900; color: #2563eb; }
.stat-label {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
    margin-top: 4px;
    white-space: nowrap;
}
.land-stat-divider {
    width: 1px;
    height: 40px;
    background: rgba(0,0,0,0.1);
}

/* Hero Visual */
.land-hero-visual {
    flex: 1;
    min-width: 0;
    position: relative;
    height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeInUp 0.7s 0.2s ease both;
}

.hero-card-stack { position: relative; width: 100%; height: 100%; }

.hero-device {
    position: absolute;
    left: 50%; top: 50%;
    transform: translate(-50%, -50%);
    width: 280px;
    padding: 0;
    overflow: hidden;
    box-shadow: 0 24px 60px rgba(37,99,235,0.18), 0 0 0 1px rgba(37,99,235,0.1);
    border-radius: 24px;
}
.device-bar {
    height: 32px;
    background: linear-gradient(135deg, #2563EB 0%, #1D4ED8 100%);
    display: flex;
    align-items: center;
    padding: 0 14px;
    gap: 6px;
}
.device-bar::before, .device-bar::after {
    content: '';
    width: 8px; height: 8px;
    border-radius: 50%;
    background: rgba(255,255,255,0.5);
}
.device-screen {
    background: #FFFFFF;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 230px;
}
.device-msg {
    padding: 12px 16px;
    border-radius: 14px;
    font-size: 13px;
    line-height: 1.45;
}
.device-msg-ai {
    background: #EFF6FF;
    color: #2563EB;
    border: 1px solid #DBEAFE;
    border-radius: 14px 14px 14px 4px;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-weight: 500;
}
.device-msg-ai i { flex-shrink: 0; margin-top: 2px; }
.device-msg-resp {
    background: linear-gradient(135deg, #2563EB 0%, #1D4ED8 100%);
    color: white;
    margin-left: auto;
    max-width: 85%;
    border-radius: 14px 14px 4px 14px;
    box-shadow: 0 4px 12px rgba(37,99,235,0.2);
}
.device-typing {
    display: flex;
    gap: 6px;
    padding: 10px 16px;
    background: #F1F5F9;
    border-radius: 14px 14px 14px 4px;
    width: fit-content;
}
.device-typing span {
    width: 7px; height: 7px;
    border-radius: 50%;
    background: #3B82F6;
    animation: typingDot 1.2s infinite;
}
.device-typing span:nth-child(2) { animation-delay: 0.2s; }
.device-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typingDot {
    0%,60%,100% { transform: translateY(0); opacity: 0.4; }
    30% { transform: translateY(-6px); opacity: 1; }
}

/* Floating cards */
.hero-float-card {
    position: absolute;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    white-space: nowrap;
    box-shadow: 0 10px 30px rgba(20,41,91,0.08);
    background: rgba(255,255,255,0.96);
    border: 1px solid rgba(226,232,240,0.9);
    border-radius: 16px;
    backdrop-filter: blur(12px);
}
.hfc-icon {
    width: 42px; height: 42px;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    color: white;
    font-size: 17px;
    flex-shrink: 0;
}
.hfc-title { font-size: 13px; font-weight: 800; color: var(--text-primary); }
.hfc-sub { font-size: 11px; color: var(--text-secondary); font-weight: 500; }

.card-a { top: 5%; left: -10%; animation: floatA 6s ease-in-out infinite; }
.card-b { top: 5%; right: -5%; animation: floatB 7s ease-in-out infinite; }
.card-c { bottom: 10%; left: -8%; animation: floatC 8s ease-in-out infinite; }
.card-d { bottom: 8%; right: -5%; animation: floatD 5s ease-in-out infinite; }

@keyframes floatA { 0%,100%{transform:translateY(0) rotate(-2deg)} 50%{transform:translateY(-12px) rotate(1deg)} }
@keyframes floatB { 0%,100%{transform:translateY(0) rotate(2deg)} 50%{transform:translateY(-16px) rotate(-1deg)} }
@keyframes floatC { 0%,100%{transform:translateY(0) rotate(1deg)} 50%{transform:translateY(-10px) rotate(-2deg)} }
@keyframes floatD { 0%,100%{transform:translateY(0) rotate(-1deg)} 50%{transform:translateY(-14px) rotate(2deg)} }

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

/* ---- SECTIONS ---- */
.land-section {
    padding: 100px 32px;
    position: relative;
    z-index: 1;
    background: #F8FAFD;
}

.land-section-dark {
    background: linear-gradient(180deg, #0B1120 0%, #0F172A 100%);
    color: white;
}

.land-section-inner {
    max-width: 1200px;
    margin: 0 auto;
}

.land-section-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #EFF6FF;
    color: #2563EB;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 6px 14px;
    border-radius: 100px;
    border: 1px solid #DBEAFE;
    margin-bottom: 16px;
}

.land-section-dark .land-section-label {
    background: rgba(37,99,235,0.2);
    color: #93C5FD;
    border-color: rgba(37,99,235,0.4);
}

.land-section-title {
    font-size: clamp(28px, 4vw, 44px);
    font-weight: 900;
    color: var(--text-primary);
    margin-bottom: 12px;
    letter-spacing: -0.03em;
    line-height: 1.15;
}
.land-section-dark .land-section-title { color: white; }

.land-section-sub {
    font-size: 16px;
    color: var(--text-secondary);
    max-width: 600px;
    margin-bottom: 52px;
    line-height: 1.65;
}
.land-section-dark .land-section-sub { color: var(--text-secondary); }

/* Features grid */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
}

.feature-card {
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: 22px;
    padding: 34px 30px;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    cursor: default;
    box-shadow: 0 4px 20px -2px rgba(20,41,91,0.03), 0 1px 3px rgba(0,0,0,0.02);
    position: relative;
    overflow: hidden;
}
.feature-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 40px -10px rgba(37,99,235,0.12);
    border-color: #93C5FD;
}

.feature-icon {
    width: 54px; height: 54px;
    border-radius: 16px;
    display: flex; align-items: center; justify-content: center;
    color: white;
    font-size: 22px;
    margin-bottom: 22px;
    background: linear-gradient(135deg, #2563EB 0%, #1D4ED8 100%);
    box-shadow: 0 8px 24px rgba(37,99,235,0.25);
}

.feature-card h3 {
    font-size: 19px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 10px;
    letter-spacing: -0.02em;
}

.feature-card p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Tools Marquee */
.tools-marquee-wrap { overflow: hidden; margin: 0 -32px; }
.tools-marquee {
    display: flex;
    overflow: hidden;
    margin-bottom: 16px;
    mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
    -webkit-mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
}
.tools-marquee-reverse .marquee-track { animation-direction: reverse; }

.marquee-track {
    display: flex;
    gap: 12px;
    padding: 0 6px;
    flex-shrink: 0;
    animation: marqueeSlide 30s linear infinite;
}

@keyframes marqueeSlide {
    from { transform: translateX(0); }
    to   { transform: translateX(-100%); }
}

.mtag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 100px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.12);
    color: white;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
    transition: all 0.2s ease;
}
.mtag:hover {
    background: rgba(37,99,235,0.25);
    border-color: rgba(96,165,250,0.4);
    transform: translateY(-2px);
}
.mtag i { color: #60A5FA; font-size: 13px; }

.mtag-purple {
    background: rgba(37,99,235,0.12);
    border-color: rgba(37,99,235,0.25);
}
.mtag-purple i { color: #93C5FD; }

/* Steps grid (Ultra-Premium SaaS Process Cards) */
.steps-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px;
    position: relative;
}

.step-card {
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: 22px;
    padding: 34px 26px;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    box-shadow: 0 4px 20px -2px rgba(20,41,91,0.03), 0 1px 3px rgba(0,0,0,0.02);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.step-card:hover {
    transform: translateY(-6px);
    border-color: #93C5FD;
    box-shadow: 0 20px 40px -10px rgba(37,99,235,0.14);
}

.step-num {
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.08em;
    color: #2563EB;
    background: #EFF6FF;
    border: 1px solid #DBEAFE;
    padding: 4px 12px;
    border-radius: 100px;
    margin-bottom: 20px;
    display: inline-flex;
    align-items: center;
}

.step-icon {
    width: 54px; height: 54px;
    background: linear-gradient(135deg, #2563EB 0%, #1D4ED8 100%);
    border-radius: 16px;
    display: flex; align-items: center; justify-content: center;
    color: white;
    font-size: 22px;
    margin-bottom: 20px;
    box-shadow: 0 8px 24px rgba(37,99,235,0.25);
    transition: transform 0.3s ease;
}
.step-card:hover .step-icon {
    transform: scale(1.06) rotate(3deg);
}

.step-card h3 {
    font-size: 18px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 10px;
    letter-spacing: -0.02em;
}

.step-card p {
    font-size: 13.5px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.step-line {
    display: none;
}

/* CTA (Ultra-Premium SaaS Deep-Blue Mesh Gradient) */
.land-cta {
    background: linear-gradient(135deg, #0F172A 0%, #1E3A8A 55%, #2563EB 100%);
    padding: 100px 32px;
    text-align: center;
    position: relative;
    overflow: hidden;
    z-index: 1;
    border-top: 1px solid rgba(255,255,255,0.1);
}
.land-cta-inner {
    max-width: 760px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
}
.land-cta-blob {
    position: absolute;
    width: 700px; height: 700px;
    background: radial-gradient(circle, rgba(59,130,246,0.25) 0%, transparent 65%);
    border-radius: 50%;
    top: -250px; right: -150px;
    pointer-events: none;
}
.land-cta h2 {
    font-size: clamp(32px, 4.5vw, 52px);
    font-weight: 900;
    color: #FFFFFF;
    line-height: 1.15;
    margin-bottom: 18px;
    letter-spacing: -0.03em;
}
.land-cta p {
    font-size: 17px;
    color: rgba(255,255,255,0.85);
    margin-bottom: 38px;
    line-height: 1.6;
}
.land-cta .btn-land-primary {
    background: #FFFFFF;
    color: #1D4ED8;
    font-weight: 800;
    font-size: 15px;
    padding: 16px 36px;
    border-radius: 100px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.25);
    transition: all 0.25s ease;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}
.land-cta .btn-land-primary:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 16px 40px rgba(0,0,0,0.35);
    background: #F8FAFD;
}

/* Footer */
.land-footer {
    background: #0B1120;
    padding: 56px 32px 48px;
    text-align: center;
    border-top: 1px solid #1E293B;
}
.land-footer-inner { max-width: 600px; margin: 0 auto; }
.land-footer .land-logo {
    justify-content: center;
    color: white;
    margin-bottom: 12px;
    font-size: 21px;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}
.land-footer-tagline { color: var(--text-secondary); font-size: 14px; margin-bottom: 12px; }
.land-footer-copy { color: var(--text-secondary); font-size: 13px; }

/* ============================================
   APP (post-login)
   ============================================ */
.app-wrapper {
    width: 100%;
    height: 100vh;
    height: 100dvh;
    display: flex;
    position: relative;
    overflow: hidden;
}

.app-bg-orb {
    position: fixed;
    border-radius: 50%;
    filter: blur(100px);
    z-index: 0;
    pointer-events: none;
    opacity: 0.4;
}
.orb-1 {
    width: 500px; height: 500px;
    background: var(--accent-primary);
    top: -200px; left: -150px;
}
.orb-2 {
    width: 350px; height: 350px;
    background: var(--accent-secondary);
    bottom: -100px; right: -80px;
}

/* Sidebar */
.sidebar {
    width: 260px;
    min-width: 260px;
    height: 100vh;
    height: 100dvh;
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    z-index: 10;
    border-right: 1px solid var(--border-color);
    background: var(--sidebar-bg);
    overflow-y: auto;
    position: relative;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 22px;
    font-weight: 800;
    margin-bottom: 36px;
    color: var(--accent-primary);
    padding: 0 8px;
}

.nav-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-section-label {
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-secondary);
    padding: 14px 16px 4px;
    opacity: 0.5;
}

.nav-quick-tools { flex-grow: 0; margin-bottom: 8px; }
.quick-tool-item { font-size: 13px; padding: 9px 16px; }

.nav-item {
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 11px 16px;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 500;
    font-size: 14px;
    color: var(--text-secondary);
    transition: all 0.2s ease;
    list-style: none;
    position: relative;
    overflow: hidden;
}
.nav-item::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    opacity: 0;
    transition: opacity 0.2s;
    border-radius: 12px;
    z-index: -1;
}
.nav-item:hover::after, .nav-item.active::after { opacity: 1; }
.nav-item:hover, .nav-item.active {
    color: white;
    transform: translateX(4px);
    box-shadow: 0 4px 14px rgba(79,70,229,0.25);
}
.nav-item i { width: 18px; text-align: center; font-size: 15px; }

.nav-bottom {
    margin-top: auto;
    list-style: none;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* Main Content Area */
.main-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
    overflow-y: auto;
    position: relative;
    z-index: 5;
    background:
        radial-gradient(circle at top left, rgba(99,102,241,0.10), transparent 32%),
        radial-gradient(circle at top right, rgba(168,85,247,0.10), transparent 28%),
        linear-gradient(180deg, rgba(255,255,255,0.08), transparent 18%);
}

/* Topbar */
.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 36px;
    position: sticky;
    top: 0;
    z-index: 20;
    background: linear-gradient(135deg, rgba(255,255,255,0.78), rgba(255,255,255,0.62));
    border-bottom: 1px solid var(--border-color);
}

.search-bar {
    display: flex;
    align-items: center;
    background: var(--bg-color);
    border: 1.5px solid var(--border-color);
    padding: 10px 16px;
    border-radius: 20px;
    width: 280px;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.search-bar:focus-within {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(79,70,229,0.1);
}
.search-bar i { color: var(--text-secondary); margin-right: 10px; }
.search-bar input { background: transparent; border: none; outline: none; color: var(--text-primary); width: 100%; }

.topbar-actions { display: flex; align-items: center; gap: 16px; }

.icon-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 18px;
    cursor: pointer;
    transition: color 0.2s;
    width: 38px; height: 38px;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
}
.icon-btn:hover { color: var(--accent-primary); background: rgba(79,70,229,0.07); }

/* Sidebar hamburger toggle is a mobile-only control — hidden by default,
   shown again inside the max-width:768px media query below. */
.hamburger-btn, #hamburger-btn {
    display: none;
}

.user-mini-wrap {
    position: relative;
}
.user-mini {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 6px 12px;
    border-radius: 12px;
    transition: background 0.2s;
}
.user-mini:hover { background: rgba(79,70,229,0.07); }
.user-mini img {
    width: 38px; height: 38px;
    border-radius: 50%;
    border: 2.5px solid var(--accent-primary);
    object-fit: cover;
}
.user-mini-info h4 { font-size: 13px; font-weight: 700; }
.user-mini-info p { font-size: 11px; color: var(--text-secondary); }
.mini-chevron {
    font-size: 11px;
    color: var(--text-secondary);
    transition: transform 0.25s ease;
    margin-left: 2px;
}
.user-mini-wrap.open .mini-chevron { transform: rotate(180deg); }

/* Topbar mini dropdown */
.mini-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 190px;
    background: var(--bg-secondary, var(--surface));
    border: 1px solid var(--border-color, rgba(0,0,0,0.08));
    border-radius: 14px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.14);
    padding: 8px;
    z-index: 9999;
    animation: dropFadeIn 0.18s ease forwards;
}
.mini-dropdown.open { display: block; }
@keyframes dropFadeIn {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}
.mini-drop-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    transition: background 0.15s;
}
.mini-drop-item:hover { background: rgba(79,70,229,0.08); }
.mini-drop-item i { width: 16px; text-align: center; color: var(--text-secondary); }
.mini-drop-logout { color: #ef4444 !important; }
.mini-drop-logout i { color: #ef4444 !important; }
.mini-drop-logout:hover { background: rgba(239,68,68,0.08) !important; }
.mini-drop-divider {
    height: 1px;
    background: var(--border-color, rgba(0,0,0,0.08));
    margin: 6px 0;
}

/* Sections */
.section-container {
    padding: 0;
    display: none;
    animation: sectionFadeIn 0.3s ease forwards;
}
.section-container.active {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 28px 36px 60px;
    flex: 1;
}

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

.section-header { margin-bottom: 4px; }
.section-header h2 { font-size: 26px; font-weight: 800; color: var(--text-primary); margin-bottom: 4px; }
.section-header p { color: var(--text-secondary); font-size: 14px; }

/* XP Progress Bar */
.xp-progress-container {
    padding: 16px 24px;
    margin-bottom: 24px;
}
.xp-prog-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-size: 14px;
    font-weight: 600;
}
.xp-prog-info span { color: var(--text-secondary); }
.xp-prog-info span i { color: var(--warning-color); margin-right: 4px; }
.xp-track {
    height: 10px;
    background: var(--bg-color);
    border-radius: 100px;
    overflow: hidden;
    position: relative;
    border: 1px solid var(--border-color);
}
.xp-fill {
    height: 100%;
    background: linear-gradient(90deg, #4f46e5, #8b5cf6, #ec4899);
    border-radius: 100px;
    transition: width 1s cubic-bezier(0.34,1.56,0.64,1);
    position: absolute; top: 0; left: 0;
}
.xp-glow {
    height: 100%;
    background: linear-gradient(90deg, rgba(79,70,229,0.3), rgba(139,92,246,0.3));
    border-radius: 100px;
    filter: blur(6px);
    position: absolute; top: 0; left: 0;
    transition: width 1s cubic-bezier(0.34,1.56,0.64,1);
}

/* ============================================
   DASHBOARD — PREMIUM REDESIGN
   ============================================ */

/* Hero greeting card */
.dash-hero {
    position: relative;
    overflow: hidden;
    border-radius: 28px;
    padding: 38px 44px;
    margin-bottom: 26px;
    background:
        radial-gradient(circle at 10% 0%, rgba(168,85,247,0.30), transparent 38%),
        radial-gradient(circle at 90% 100%, rgba(14,165,233,0.25), transparent 40%),
        linear-gradient(135deg, #4f46e5 0%, #7c3aed 50%, #a855f7 100%);
    color: #fff;
    box-shadow:
        0 24px 60px -18px rgba(79,70,229,0.55),
        0 1px 0 rgba(255,255,255,0.12) inset;
    isolation: isolate;
}
.dash-hero-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.55;
    pointer-events: none;
    z-index: 0;
}
.blob-1 {
    width: 320px; height: 320px;
    background: #ec4899;
    top: -120px; right: -80px;
    animation: heroBlob 16s ease-in-out infinite;
}
.blob-2 {
    width: 260px; height: 260px;
    background: #06b6d4;
    bottom: -100px; left: -60px;
    animation: heroBlob 18s ease-in-out infinite reverse;
}
.blob-3 {
    width: 180px; height: 180px;
    background: #fbbf24;
    top: 30%; right: 25%;
    opacity: 0.35;
    animation: heroBlob 22s ease-in-out infinite;
}
@keyframes heroBlob {
    0%, 100% { transform: translate(0,0) scale(1); }
    33% { transform: translate(30px, -20px) scale(1.08); }
    66% { transform: translate(-20px, 30px) scale(0.95); }
}
.dash-hero-grain {
    position: absolute; inset: 0;
    background-image:
        radial-gradient(rgba(255,255,255,0.06) 1px, transparent 1px),
        radial-gradient(rgba(255,255,255,0.04) 1px, transparent 1px);
    background-size: 32px 32px, 16px 16px;
    background-position: 0 0, 8px 8px;
    opacity: 0.5;
    pointer-events: none;
    z-index: 1;
}
.dash-hero-content {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
}
.dash-hero-info { flex: 1; min-width: 0; }
.dash-hero-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border-radius: 100px;
    background: rgba(255,255,255,0.16);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,0.22);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.95);
}
.dash-hero-eyebrow i { color: #fde047; }
.dash-hero-title {
    font-size: clamp(30px, 4.2vw, 46px);
    font-weight: 900;
    line-height: 1.05;
    letter-spacing: -0.03em;
    margin: 14px 0 10px;
    color: #fff;
    text-shadow: 0 2px 16px rgba(0,0,0,0.18);
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.hero-wave {
    display: inline-block;
    transform-origin: 70% 70%;
    animation: heroWave 2.6s ease-in-out infinite;
}
@keyframes heroWave {
    0%, 60%, 100% { transform: rotate(0deg); }
    10% { transform: rotate(14deg); }
    20% { transform: rotate(-8deg); }
    30% { transform: rotate(14deg); }
    40% { transform: rotate(-4deg); }
    50% { transform: rotate(10deg); }
}
.dash-hero-quote {
    font-size: 16px;
    color: rgba(255,255,255,0.88);
    margin-bottom: 26px;
    max-width: 540px;
    line-height: 1.5;
}
.dash-hero-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}
.hero-btn {
    border: none;
    cursor: pointer;
    padding: 12px 22px;
    border-radius: 14px;
    font-size: 14px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s;
}
.hero-btn-primary {
    background: #fff;
    color: #4f46e5;
    box-shadow: 0 12px 28px rgba(0,0,0,0.18);
}
.hero-btn-primary:hover { transform: translateY(-2px); box-shadow: 0 16px 36px rgba(0,0,0,0.24); }
.hero-btn-ghost {
    background: rgba(255,255,255,0.14);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.28);
    backdrop-filter: blur(8px);
}
.hero-btn-ghost:hover { background: rgba(255,255,255,0.22); transform: translateY(-2px); }

/* XP Ring on hero right side */
.dash-hero-ring {
    position: relative;
    width: 150px;
    height: 150px;
    flex-shrink: 0;
}
.dash-hero-ring svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}
.dash-hero-ring .ring-bg {
    fill: none;
    stroke: rgba(255,255,255,0.18);
    stroke-width: 8;
}
.dash-hero-ring .ring-fill {
    fill: none;
    stroke: #fff;
    stroke-width: 8;
    stroke-linecap: round;
    stroke-dasharray: 326.7;
    stroke-dashoffset: 326.7;
    transition: stroke-dashoffset 1.2s cubic-bezier(0.34,1.56,0.64,1);
    filter: drop-shadow(0 0 10px rgba(255,255,255,0.7));
}
.ring-center {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #fff;
    text-align: center;
    pointer-events: none;
}
.ring-center .ring-level {
    font-size: 22px;
    font-weight: 900;
    letter-spacing: -0.02em;
    line-height: 1;
}
.ring-center .ring-xp {
    font-size: 12px;
    color: rgba(255,255,255,0.85);
    margin-top: 4px;
    font-weight: 600;
}

/* Stat tiles (4-up) */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 26px;
}
.stat-tile {
    position: relative;
    overflow: hidden;
    padding: 22px 22px 18px;
    border-radius: 22px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    box-shadow: 0 10px 28px rgba(15,23,42,0.06);
    transition: transform 0.22s ease, box-shadow 0.22s ease;
    backdrop-filter: blur(14px);
}
.stat-tile::before {
    content: '';
    position: absolute;
    inset: -40% -40% auto auto;
    width: 140px;
    height: 140px;
    border-radius: 50%;
    opacity: 0.35;
    filter: blur(8px);
    pointer-events: none;
}
.stat-tile:hover {
    transform: translateY(-5px);
    box-shadow: 0 22px 42px rgba(79,70,229,0.18);
}
.stat-tile-icon {
    width: 46px; height: 46px;
    border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    color: #fff;
    font-size: 18px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.12);
    margin-bottom: 14px;
    position: relative;
    z-index: 1;
}
.stat-tile-info h3 {
    font-size: 30px;
    font-weight: 900;
    line-height: 1;
    letter-spacing: -0.02em;
    color: var(--text-primary);
    position: relative;
    z-index: 1;
}
.stat-tile-info p {
    margin-top: 6px;
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}
.stat-tile-trend {
    margin-top: 14px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 100px;
    background: rgba(15,23,42,0.05);
}
[data-theme="dark"] .stat-tile-trend { background: rgba(255,255,255,0.06); }

.stat-purple .stat-tile-icon { background: linear-gradient(135deg, #6366f1, #8b5cf6); }
.stat-purple::before { background: radial-gradient(circle, #a855f7, transparent 65%); }
.stat-green .stat-tile-icon { background: linear-gradient(135deg, #10b981, #059669); }
.stat-green::before { background: radial-gradient(circle, #34d399, transparent 65%); }
.stat-orange .stat-tile-icon { background: linear-gradient(135deg, #f59e0b, #ef4444); }
.stat-orange::before { background: radial-gradient(circle, #fb923c, transparent 65%); }
.stat-blue .stat-tile-icon { background: linear-gradient(135deg, #0ea5e9, #3b82f6); }
.stat-blue::before { background: radial-gradient(circle, #60a5fa, transparent 65%); }

/* Quick launch shortcuts */
.quick-launch {
    margin-bottom: 26px;
}
.ql-header {
    display: flex;
    justify-content: space-between;
    align-items: end;
    margin-bottom: 16px;
}
.ql-header h3 {
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text-primary);
    display: inline-flex;
    align-items: center;
    gap: 10px;
}
.ql-header h3 i { color: var(--accent-primary); }
.ql-header p {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 4px;
}
.ql-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}
.ql-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 18px;
    border-radius: 18px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(14px);
}
.ql-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 18px 38px rgba(79,70,229,0.16);
    border-color: rgba(124,58,237,0.35);
}
.ql-card:hover .ql-arrow { transform: translateX(4px); opacity: 1; }
.ql-icon {
    width: 44px; height: 44px;
    border-radius: 13px;
    display: flex; align-items: center; justify-content: center;
    color: #fff;
    font-size: 17px;
    flex-shrink: 0;
    box-shadow: 0 8px 16px rgba(0,0,0,0.12);
}
.ql-text { flex: 1; min-width: 0; }
.ql-text h4 {
    font-size: 14px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 3px;
}
.ql-text p {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.35;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
.ql-arrow {
    color: var(--accent-primary);
    font-size: 14px;
    opacity: 0.4;
    transition: transform 0.2s, opacity 0.2s;
    flex-shrink: 0;
}

/* Two-column row */
.dash-columns {
    display: grid;
    grid-template-columns: 1.6fr 1fr;
    gap: 18px;
    margin-top: 8px;
}
.recent-tools {
    padding: 22px 22px 24px;
    border-radius: 22px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    box-shadow: 0 10px 28px rgba(15,23,42,0.06);
    backdrop-filter: blur(14px);
}
.rt-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}
.rt-header h3 {
    font-size: 17px;
    font-weight: 800;
    color: var(--text-primary);
    display: inline-flex;
    align-items: center;
    gap: 9px;
    letter-spacing: -0.01em;
}
.rt-header h3 i { color: var(--accent-secondary); }
.rt-link {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--accent-primary);
    font-size: 12px;
    font-weight: 700;
    padding: 7px 14px;
    border-radius: 100px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.18s;
}
.rt-link:hover {
    background: rgba(79,70,229,0.08);
    border-color: rgba(79,70,229,0.35);
    transform: translateX(2px);
}

/* Activity feed */
.activity-feed {
    padding: 22px;
    border-radius: 22px;
    display: flex;
    flex-direction: column;
}
.activity-feed > .rt-header { margin-bottom: 14px; }
#activity-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
}
.activity-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 14px;
    background: rgba(79,70,229,0.04);
    border: 1px solid rgba(79,70,229,0.08);
    transition: transform 0.18s, background 0.18s;
}
.activity-item:hover { transform: translateX(3px); background: rgba(79,70,229,0.08); }
.activity-item-icon {
    width: 36px; height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 13px;
    flex-shrink: 0;
}
.activity-item-text { flex: 1; min-width: 0; }
.activity-item-text h5 {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.activity-item-text span {
    font-size: 11px;
    color: var(--text-secondary);
    font-weight: 500;
}
.activity-item-xp {
    font-size: 11px;
    font-weight: 800;
    color: #f59e0b;
    background: rgba(245,158,11,0.12);
    padding: 4px 9px;
    border-radius: 100px;
    flex-shrink: 0;
}
.activity-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px 16px;
    text-align: center;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(79,70,229,0.04), rgba(168,85,247,0.04));
    border: 1px dashed var(--border-color);
}
.activity-empty i {
    font-size: 30px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 10px;
}
.activity-empty p {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}
.activity-empty span {
    font-size: 12px;
    color: var(--text-secondary);
}

/* Responsive */
@media (max-width: 1100px) {
    .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .ql-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .dash-columns { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 720px) {
    .dash-hero { padding: 28px 22px; border-radius: 22px; }
    .dash-hero-content { flex-direction: column; align-items: flex-start; }
    .dash-hero-ring { width: 110px; height: 110px; align-self: flex-end; margin-top: -120px; }
    .dash-hero-title { font-size: 28px; }
    .stat-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
    .ql-grid { grid-template-columns: minmax(0, 1fr); }
}

//* Tools Marketplace */
.tools-category { margin-bottom: 36px; }
.tools-category h3 {
    font-size: 18px;
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-primary);
    font-weight: 700;
}
[data-theme="dark"] .tools-category h3 {
    color: #F8FAFC;
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
}

.tool-card {
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 24px;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    display: flex;
    flex-direction: column;
    gap: 12px;
    position: relative;
    box-shadow: 0 2px 10px rgba(20,41,91,0.02);
}
[data-theme="dark"] .tool-card {
    background: #1E293B;
    border-color: #334155;
}
.tool-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 28px rgba(37,99,235,0.08);
    border-color: #BFDBFE;
}
.tool-card:hover .tool-icon {
    transform: scale(1.05);
}

.tool-icon {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    background: #EDF4FF;
    color: #2563EB;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 19px;
    transition: transform 0.2s;
}
[data-theme="dark"] .tool-icon {
    background: rgba(37,99,235,0.2);
    color: #60A5FA;
}

.tool-card h4 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
}
[data-theme="dark"] .tool-card h4 {
    color: #F8FAFC;
}
.tool-card p {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.45;
}
[data-theme="dark"] .tool-card p {
    color: #94A3B8;
}

/* Active Tool UI */
.active-tool-workspace {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
}

.tool-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}
[data-theme="dark"] .tool-header {
    border-bottom-color: #334155;
}
.tool-header i { font-size: 22px; color: #2563EB; }
.tool-header h2 { font-size: 22px; font-weight: 800; color: var(--text-primary); }
[data-theme="dark"] .tool-header h2 { color: #F8FAFC; }

.tool-input-area {
    display: flex;
    flex-direction: column;
    gap: 14px;
    flex-shrink: 0;
}

textarea {
    width: 100%;
    padding: 14px 18px;
    border-radius: 14px;
    border: 1px solid var(--border-color);
    background: var(--surface);
    color: var(--text-primary);
    resize: vertical;
    min-height: 100px;
    outline: none;
    font-size: 14px;
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s;
}
[data-theme="dark"] textarea {
    background: #1E293B;
    border-color: #334155;
    color: #F8FAFC;
}
textarea:focus {
    border-color: #2563EB;
    box-shadow: 0 0 0 3px rgba(37,99,235,0.12);
}

.tool-output-area {
    flex-grow: 1;
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
    overflow-y: auto;
    font-size: 14px;
    line-height: 1.7;
    color: var(--text-primary);
    white-space: pre-wrap;
    box-shadow: 0 2px 10px rgba(20,41,91,0.02);
}
[data-theme="dark"] .tool-output-area {
    background: #1E293B;
    border-color: #334155;
    color: #F8FAFC;
}

/* Note Taker */
.note-container {
    display: flex;
    gap: 20px;
    height: calc(100vh - 180px);
    height: calc(100dvh - 180px);
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 16px;
    box-shadow: 0 2px 14px rgba(20,41,91,0.02);
}
[data-theme="dark"] .note-container {
    background: #1E293B;
    border-color: #334155;
}
.notes-sidebar {
    width: 280px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow-y: auto;
    padding-right: 12px;
    border-right: 1px solid var(--border-color);
}
[data-theme="dark"] .notes-sidebar {
    border-right-color: #334155;
}
.note-item {
    padding: 14px;
    cursor: pointer;
    border-left: 3px solid transparent;
    border-radius: 10px;
    background: var(--surface-inset);
    border: 1px solid var(--border-color);
    transition: all 0.2s;
}
[data-theme="dark"] .note-item {
    background: #0F172A;
    border-color: #334155;
}
.note-item:hover {
    border-left-color: #2563EB;
    background: #EDF4FF;
    border-color: #BFDBFE;
}
.note-item.active {
    border-left-color: #2563EB !important;
    background: #2563EB !important;
    border-color: #2563EB !important;
    box-shadow: 0 4px 12px rgba(37,99,235,0.2) !important;
}
.note-item.active h4,
.note-item.active p,
.note-item.active span {
    color: #FFFFFF !important;
}
[data-theme="dark"] .note-item:hover {
    background: rgba(37,99,235,0.2);
    border-color: #60A5FA;
}
.note-item h4 { margin-bottom: 4px; font-size: 14px; font-weight: 700; color: var(--text-primary); transition: color 0.15s ease; }
[data-theme="dark"] .note-item h4 { color: #F8FAFC; }
.note-item p { font-size: 12px; color: var(--text-secondary); transition: color 0.15s ease; }
.note-editor {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    padding: 12px 16px;
}
.note-title-input {
    font-size: 22px;
    font-weight: 700;
    border: none;
    background: transparent;
    color: var(--text-primary);
    margin-bottom: 14px;
    outline: none;
    width: 100%;
}
[data-theme="dark"] .note-title-input {
    color: #F8FAFC;
}
.note-body {
    flex-grow: 1;
    resize: none;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
    background: var(--surface-inset);
    color: var(--text-primary);
    font-size: 14px;
    line-height: 1.6;
    outline: none;
    margin-bottom: 16px;
}
[data-theme="dark"] .note-body {
    background: #0F172A;
    border-color: #334155;
    color: #F8FAFC;
}
.note-body:focus {
    border-color: #2563EB;
    background: var(--surface);
}
.note-actions { display: flex; gap: 12px; }

/* Focus Timer */
.focus-timer-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 36px;
    padding: 60px 40px;
    max-width: 420px;
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    box-shadow: 0 2px 16px rgba(20,41,91,0.02);
}
[data-theme="dark"] .focus-timer-card {
    background: #1E293B;
    border-color: #334155;
}
.timer-ring-wrap {
    position: relative;
    width: 200px; height: 200px;
}
.timer-ring {
    width: 100%; height: 100%;
    transform: rotate(-90deg);
}
.timer-ring-bg {
    fill: none;
    stroke: #E8EEF8;
    stroke-width: 10;
}
.timer-ring-fill {
    fill: none;
    stroke: #2563EB;
    stroke-width: 10;
    stroke-linecap: round;
    stroke-dasharray: 553;
    stroke-dashoffset: 0;
    transition: stroke-dashoffset 1s linear;
}
.timer-inner {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.timer-display {
    font-size: 44px;
    font-weight: 900;
    color: var(--accent-primary);
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.02em;
}
.timer-label {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 600;
    margin-top: 4px;
}
.timer-btns { display: flex; gap: 16px; }

/* Leaderboard */
.leaderboard-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 16px;
}
.leaderboard-item {
    display: flex;
    align-items: center;
    padding: 14px 16px;
    border-radius: 12px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    transition: transform 0.2s, box-shadow 0.2s;
}
.leaderboard-item:hover { transform: translateX(4px); box-shadow: 0 4px 16px rgba(79,70,229,0.08); }
.rank { font-size: 20px; font-weight: 800; width: 44px; flex-shrink: 0; color: var(--text-secondary); }
.top-3 .rank { color: var(--warning-color); }
.lb-user { display: flex; align-items: center; gap: 14px; flex-grow: 1; min-width: 0; }
.lb-user img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; border: 2px solid var(--accent-primary); flex-shrink: 0; }
/* Name/bio wrapper: allow it to shrink and ellipsis instead of pushing into the stats */
.lb-user > div:last-child { min-width: 0; overflow: hidden; }
.lb-user > div:last-child > div:first-child {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.lb-user > div:last-child > div[style*="font-size: 12px"] {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.lb-stats { display: flex; gap: 20px; align-items: center; flex-shrink: 0; }
.lb-level {
    background: rgba(139,92,246,0.1);
    color: var(--accent-secondary);
    padding: 4px 12px;
    border-radius: 100px;
    font-weight: 700;
    font-size: 13px;
}
.lb-xp { font-weight: 700; color: var(--text-primary); font-size: 15px; }
.leaderboard-me {
    border-color: rgba(168,85,247,0.5) !important;
    background: linear-gradient(135deg, rgba(168,85,247,0.07), rgba(99,102,241,0.05)) !important;
}

/* Sidebar overlay */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 40;
    backdrop-filter: blur(2px);
}
.sidebar-overlay.active { display: block; }

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
    .land-hero { flex-direction: column; padding-top: 100px; gap: 40px; }
    .land-hero-visual { width: 100%; height: 350px; }
    .card-a, .card-d { display: none; }
    .land-nav-links { display: none; }
}

@media (max-width: 768px) {
    .land-hamburger { display: block; }
    .land-nav-actions { display: none; }
    .land-hero-title { font-size: 32px; }
    .land-hero-sub { font-size: 16px; }
    .land-hero-visual { display: none; }
    .land-hero-stats { flex-wrap: wrap; gap: 20px; justify-content: center; }
    .land-stat-divider { display: none; }
    .land-hero-stat { padding: 0; }
    .features-grid { grid-template-columns: minmax(0, 1fr); }
    .steps-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
    .step-line { display: none; }

    .hamburger-btn { display: block !important; }
    .sidebar {
        position: absolute;
        top: 0; left: 0;
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.4,0,0.2,1);
        z-index: 50;
        height: 100%;
    }
    .sidebar.open { transform: translateX(0); }
    .search-bar { width: 150px; }
    .user-mini-info { display: none; }
    .topbar { padding: 14px 18px; }
    .section-container { padding: 20px 18px; }
    .note-container { flex-direction: column; }
    .notes-sidebar { width: 100%; height: 180px; }
    .focus-timer-card { padding: 40px 24px; }
}

@media (max-width: 480px) {
    .steps-grid { grid-template-columns: minmax(0, 1fr); }
    .land-hero-btns { flex-direction: column; }
    .btn-land-ghost { display: none; }
    .land-cta h2 { font-size: 26px; }
}

/* ============================================================ */
/* WELCOME SPLASH                                               */
/* ============================================================ */
#welcome-splash {
    display: none !important;
    position: fixed;
    inset: 0;
    z-index: -1;
}
#confetti-canvas {
    display: none !important;
}
.splash-content {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 40px 24px;
    max-width: 480px;
    width: 100%;
    animation: splashFadeIn 0.7s ease both;
}
@keyframes splashFadeIn {
    from { opacity: 0; transform: translateY(30px); }
    to   { opacity: 1; transform: translateY(0); }
}
.splash-avatar-ring {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    margin: 0 auto 16px;
    padding: 4px;
    background: linear-gradient(135deg, #4f46e5, #8b5cf6, #ec4899);
    box-shadow: 0 0 40px rgba(139,92,246,0.6);
    animation: splashPulse 2s ease-in-out infinite;
}
@keyframes splashPulse {
    0%,100% { box-shadow: 0 0 40px rgba(139,92,246,0.6); }
    50%      { box-shadow: 0 0 70px rgba(236,72,153,0.8); }
}
.splash-avatar-ring img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; background: #1a1a2e; }
.splash-level-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(245,158,11,0.2);
    border: 1px solid rgba(245,158,11,0.5);
    color: #f59e0b;
    border-radius: 50px;
    padding: 4px 16px;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 16px;
}
.splash-title { font-size: clamp(26px, 5vw, 38px); font-weight: 800; color: #fff; line-height: 1.2; margin-bottom: 10px; }
.splash-name { color: #a78bfa; }
.splash-tagline { color: rgba(255,255,255,0.6); font-size: 15px; margin-bottom: 28px; }
.splash-stats { display: flex; justify-content: center; gap: 32px; margin-bottom: 32px; }
.splash-stat { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.splash-stat-val { font-size: 28px; font-weight: 800; color: #fff; line-height: 1; }
.splash-stat-lbl { font-size: 11px; color: rgba(255,255,255,0.5); text-transform: uppercase; letter-spacing: 0.06em; }
.splash-go-btn {
    font-size: 16px; padding: 14px 40px; border-radius: 50px;
    background: linear-gradient(135deg, #4f46e5, #8b5cf6);
    border: none; color: #fff; font-weight: 700; cursor: pointer;
    box-shadow: 0 8px 30px rgba(79,70,229,0.5);
    transition: transform 0.2s, box-shadow 0.2s;
}
.splash-go-btn:hover { transform: translateY(-2px); box-shadow: 0 12px 40px rgba(79,70,229,0.7); }

/* ============================================================ */
/* MODAL OVERLAY BASE                                           */
/* ============================================================ */
.modal-overlay {
    position: fixed; inset: 0; z-index: 9999;
    background: rgba(0,0,0,0.75);
    backdrop-filter: blur(8px);
    display: flex; align-items: center; justify-content: center;
    padding: 20px;
}

/* Shared dialog layout */
.dialog-inner {
    background: var(--sidebar-bg, #1a1a2e);
    border: 1px solid var(--border-color, rgba(255,255,255,0.1));
    border-radius: 24px; padding: 40px 32px;
    max-width: 400px; width: 100%; text-align: center;
    box-shadow: 0 25px 80px rgba(0,0,0,0.5);
    display: flex; flex-direction: column; gap: 0;
}
.dialog-inner h3 { font-size: 22px; font-weight: 700; margin-bottom: 20px; }
.dialog-inner .btn { width: 100%; margin-bottom: 10px; }
.dialog-inner .btn:last-child { margin-bottom: 0; }

/* ============================================================ */
/* MODERN PORTAL & WORKSHEETS DESIGN SYSTEM                     */
/* ============================================================ */

/* Active Tool Toolbar & Workspace */
.tool-top-bar {
    padding: 16px 24px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-radius: 16px;
}
.tool-header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}
.tool-icon-wrap {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(99,102,241,0.15), rgba(168,85,247,0.15));
    border: 1px solid rgba(99,102,241,0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-primary);
    font-size: 20px;
}
.tool-model-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 100px;
    background: linear-gradient(135deg, rgba(99,102,241,0.15), rgba(168,85,247,0.15));
    border: 1px solid rgba(99,102,241,0.3);
    color: var(--accent-primary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.active-tool-workspace {
    display: flex;
    flex-direction: column;
    gap: 24px;
    width: 100%;
    max-width: 100%;
    margin-top: 16px;
    box-sizing: border-box;
}

.tool-input-area {
    width: 100%;
    min-width: 0;
    padding: 24px 28px;
    border-radius: 18px;
    background: var(--surface);
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
    display: flex;
    flex-direction: column;
    gap: 16px;
    box-sizing: border-box;
}
[data-theme="dark"] .tool-input-area {
    background: #1E293B;
    border-color: #334155;
}

.tool-output-wrapper {
    width: 100%;
    min-width: 0;
    border-radius: 18px;
    background: var(--surface);
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 380px;
    box-sizing: border-box;
}
[data-theme="dark"] .tool-output-wrapper {
    background: #1E293B;
    border-color: #334155;
}

.tool-output-header {
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color);
    background: var(--surface-inset);
    flex-wrap: wrap;
    gap: 12px;
}
[data-theme="dark"] .tool-output-header {
    background: #0F172A;
    border-bottom-color: #334155;
}

.tool-output-label {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}
[data-theme="dark"] .tool-output-label {
    color: #F1F5F9;
}
.tool-output-label i {
    color: #2563EB;
}
[data-theme="dark"] .tool-output-label i {
    color: #60A5FA;
}

.tool-output-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.tool-act-btn {
    padding: 7px 14px;
    font-size: 12.5px;
    font-weight: 600;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background: var(--surface);
    color: var(--text-primary);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.tool-act-btn i {
    font-size: 13px;
    color: #2563EB;
    transition: transform 0.2s ease;
}
.tool-act-btn:hover {
    background: #2563EB !important;
    color: #FFFFFF !important;
    border-color: #2563EB !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}
.tool-act-btn:hover i {
    color: #FFFFFF !important;
    transform: scale(1.1);
}
[data-theme="dark"] .tool-act-btn {
    background: #1E293B;
    border-color: #334155;
    color: #F1F5F9;
}
[data-theme="dark"] .tool-act-btn i {
    color: #60A5FA;
}
[data-theme="dark"] .tool-act-btn:hover {
    background: #2563EB !important;
    color: #FFFFFF !important;
    border-color: #2563EB !important;
}

.tool-output-area {
    padding: 28px 32px;
    flex: 1;
    overflow-y: auto;
    font-size: 15.5px;
    line-height: 1.8;
    color: var(--text-primary);
    word-break: break-word;
    overflow-wrap: break-word;
}
[data-theme="dark"] .tool-output-area {
    color: #F1F5F9;
}

.tool-fav-btn {
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 600;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background: var(--surface);
    color: var(--text-secondary);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    transition: all 0.2s ease;
}
.tool-fav-btn:hover {
    border-color: #F59E0B;
    color: #D97706;
    background: #FFFBEB;
}
.tool-fav-btn.active {
    background: #FEF3C7;
    border-color: #F59E0B;
    color: #B45309;
}
.tool-fav-btn.active i {
    color: #F59E0B;
}
[data-theme="dark"] .tool-fav-btn {
    background: #1E293B;
    border-color: #334155;
    color: #CBD5E1;
}

#run-tool-btn {
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 700;
    border-radius: 12px;
    background: linear-gradient(135deg, #2563EB 0%, #1D4ED8 100%) !important;
    color: #FFFFFF !important;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
#run-tool-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.45);
    background: linear-gradient(135deg, #1D4ED8 0%, #1E40AF 100%) !important;
}
#run-tool-btn:active {
    transform: translateY(0);
}

/* ============================================================ */
/* AI WORKSHEET GENERATOR & ACTIVE TOOLS (WHITE/LIGHT BLUE)    */
/* ============================================================ */

/* Section Headers */
.section-header {
    margin-bottom: 24px;
}
.section-header h2 {
    font-size: 26px;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}
[data-theme="dark"] .section-header h2 {
    color: #F8FAFC;
}
.section-header p {
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 4px;
}
[data-theme="dark"] .section-header p {
    color: #94A3B8;
}

/* Worksheet Generator Form Card */
.worksheet-builder-card {
    padding: 32px;
    border-radius: 20px;
    margin-bottom: 24px;
    border: 1px solid var(--border-color);
    background: var(--surface);
    box-shadow: 0 2px 14px rgba(20,41,91,0.02);
}
[data-theme="dark"] .worksheet-builder-card {
    background: #1E293B;
    border-color: #334155;
}
.ws-builder-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}
.ws-builder-grid .form-group label {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}
[data-theme="dark"] .ws-builder-grid .form-group label {
    color: #F8FAFC;
}
.ws-builder-grid .form-group input,
.ws-builder-grid .form-group select {
    width: 100%;
    padding: 12px 16px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background: var(--surface-inset);
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s, background-color 0.2s;
}
[data-theme="dark"] .ws-builder-grid .form-group input,
[data-theme="dark"] .ws-builder-grid .form-group select {
    background: #0F172A;
    border-color: #334155;
    color: #F8FAFC;
}
.ws-builder-grid .form-group input:focus,
.ws-builder-grid .form-group select:focus {
    border-color: #2563EB;
    background: var(--surface);
    box-shadow: 0 0 0 3px rgba(37,99,235,0.12);
}
.ws-gen-btn {
    width: 100%;
    padding: 14px;
    font-size: 15px;
    font-weight: 700;
    border-radius: 12px;
    background: #2563EB;
    color: #FFFFFF;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(37,99,235,0.25);
    transition: transform 0.18s, box-shadow 0.18s;
}
.ws-gen-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(37,99,235,0.35);
}
.ws-gen-status {
    text-align: center;
    margin-top: 14px;
    font-size: 14px;
    font-weight: 600;
    color: #2563EB;
}

/* Worksheet Test Paper Card */
.ws-paper-card {
    padding: 36px;
    border-radius: 20px;
    border: 1px solid #E7EDF7;
    background: #FFFFFF;
    box-shadow: 0 2px 16px rgba(20,41,91,0.02);
}
[data-theme="dark"] .ws-paper-card {
    background: #1E293B;
    border-color: #334155;
}
.ws-paper-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 28px;
    padding-bottom: 18px;
    border-bottom: 1px solid #E7EDF7;
    gap: 16px;
    flex-wrap: wrap;
}
[data-theme="dark"] .ws-paper-header {
    border-bottom-color: #334155;
}
.ws-paper-badge {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #2563EB;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
}
.ws-paper-title {
    font-size: 24px;
    font-weight: 800;
    color: #14295B;
    letter-spacing: -0.02em;
}
[data-theme="dark"] .ws-paper-title {
    color: #F8FAFC;
}
.ws-model-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 100px;
    font-size: 12px;
    font-weight: 700;
    background: #EDF4FF;
    color: #2563EB;
    border: 1px solid #BFDBFE;
}
[data-theme="dark"] .ws-model-pill {
    background: rgba(37,99,235,0.2);
    color: #60A5FA;
    border-color: rgba(37,99,235,0.4);
}
.ws-timer-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 100px;
    background: #FEF3C7;
    color: #B45309;
    font-size: 13px;
    font-weight: 800;
    border: 1px solid #FDE68A;
    animation: pulseTimer 2s infinite ease-in-out;
}
@keyframes pulseTimer {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.85; transform: scale(1.02); }
}

.ws-test-nav-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #F8FBFF;
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 12px 18px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 14px;
}
[data-theme="dark"] .ws-test-nav-bar {
    background: #0F172A;
    border-color: #334155;
}
.ws-progress-info {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 160px;
}
.ws-progress-info span {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-primary);
}
[data-theme="dark"] .ws-progress-info span { color: #F8FAFC; }
.ws-progress-track {
    width: 100%;
    height: 8px;
    background: #E2E8F0;
    border-radius: 100px;
    overflow: hidden;
}
[data-theme="dark"] .ws-progress-track { background: #334155; }
.ws-progress-fill {
    height: 100%;
    background: #2563EB;
    border-radius: 100px;
    transition: width 0.3s ease;
}
.ws-q-nav-pills {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.ws-q-nav-pill {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: var(--surface);
    border: 1.5px solid var(--border-color);
    color: var(--text-primary);
    font-weight: 800;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
    user-select: none;
}
[data-theme="dark"] .ws-q-nav-pill {
    background: #1E293B;
    border-color: #334155;
    color: #F8FAFC;
}
.ws-q-nav-pill:hover {
    border-color: #2563EB;
    color: #2563EB;
    transform: translateY(-2px);
}
.ws-q-nav-pill.answered {
    background: #10B981 !important;
    border-color: #10B981 !important;
    color: #FFFFFF !important;
}
.ws-q-nav-pill.current {
    border-color: #2563EB !important;
    box-shadow: 0 0 0 2px rgba(37,99,235,0.25);
}

.ws-questions-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.ws-question-card {
    padding: 24px;
    border-radius: 18px;
    border: 1px solid var(--border-color);
    background: #F8FBFF;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
[data-theme="dark"] .ws-question-card {
    background: #0F172A;
    border-color: #334155;
}
.ws-question-card:hover {
    border-color: #BFDBFE;
    box-shadow: 0 4px 16px rgba(37,99,235,0.06);
}
.ws-q-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 16px;
}
.ws-q-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 10px;
    background: #2563EB;
    color: #FFFFFF;
    font-weight: 700;
    font-size: 13px;
    border-radius: 8px;
    flex-shrink: 0;
}
.ws-q-text {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.5;
}
[data-theme="dark"] .ws-q-text {
    color: #F8FAFC;
}

.ws-code-block {
    background: #0F172A;
    color: #38BDF8;
    padding: 14px 18px;
    border-radius: 12px;
    font-family: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.6;
    margin: 12px 0;
    overflow-x: auto;
    border: 1px solid #1E293B;
    box-shadow: inset 0 2px 6px rgba(0,0,0,0.3);
}

.dev-guide-body h2, .dev-guide-body h3 {
    font-size: 18px;
    font-weight: 800;
    color: var(--text-primary);
    margin: 24px 0 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}
[data-theme="dark"] .dev-guide-body h2,
[data-theme="dark"] .dev-guide-body h3 { color: #F8FAFC; }
.dev-guide-body p {
    margin-bottom: 12px;
}
.dev-guide-body pre {
    background: #0F172A;
    color: #F8FAFC;
    padding: 16px 20px;
    border-radius: 14px;
    font-size: 13px;
    overflow-x: auto;
    margin: 14px 0;
    border: 1px solid #334155;
}
.dev-guide-body ul, .dev-guide-body ol {
    margin: 10px 0 16px 24px;
}

.ws-options-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
    margin-top: 14px;
}
.ws-option-pill {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    border-radius: 12px;
    border: 1.5px solid var(--border-color);
    background: var(--surface);
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
    position: relative;
}
[data-theme="dark"] .ws-option-pill {
    background: #1E293B;
    border-color: #334155;
}
.ws-option-pill:hover {
    border-color: #BFDBFE;
    background: #F8FBFF;
    transform: translateX(3px);
}
.ws-option-pill:has(.ws-radio-input:checked),
.ws-option-pill.active-selected {
    border-color: #2563EB !important;
    background: #2563EB !important;
    color: #FFFFFF !important;
    box-shadow: 0 4px 16px rgba(37,99,235,0.25) !important;
}
.ws-option-pill:has(.ws-radio-input:checked) .ws-opt-badge,
.ws-option-pill.active-selected .ws-opt-badge,
.ws-option-pill:has(.ws-radio-input:checked) .ws-opt-text,
.ws-option-pill.active-selected .ws-opt-text {
    color: #FFFFFF !important;
}
.ws-radio-input {
    width: 18px;
    height: 18px;
    accent-color: #2563EB;
    cursor: pointer;
}
.ws-option-pill:has(.ws-radio-input:checked) .ws-radio-input {
    accent-color: #FFFFFF;
}
.ws-opt-badge {
    font-weight: 800;
    font-size: 14px;
    color: #2563EB;
    min-width: 20px;
    transition: color 0.15s ease;
}
.ws-opt-text {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-primary);
    flex: 1;
    word-break: break-word;
    transition: color 0.15s ease;
}
[data-theme="dark"] .ws-opt-text {
    color: #F8FAFC;
}
.ws-text-answer {
    width: 100%;
    padding: 14px 18px;
    border-radius: 12px;
    border: 1.5px solid var(--border-color);
    background: var(--surface);
    color: var(--text-primary);
    font-size: 15px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    margin-top: 12px;
    box-sizing: border-box;
}
[data-theme="dark"] .ws-text-answer {
    background: #1E293B;
    border-color: #334155;
    color: #F8FAFC;
}
.ws-text-answer:focus {
    border-color: #2563EB;
    box-shadow: 0 0 0 3px rgba(37,99,235,0.12);
}
.ws-submit-btn {
    width: 100%;
    margin-top: 28px;
    padding: 16px;
    font-size: 16px;
    font-weight: 700;
    border-radius: 14px;
    background: #2563EB;
    color: #FFFFFF;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(37,99,235,0.25);
    transition: all 0.2s ease;
}
.ws-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(37,99,235,0.35);
}

/* Grading Results UI */
.ws-result-card {
    padding: 36px;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    background: var(--surface);
    box-shadow: 0 2px 16px rgba(20,41,91,0.02);
}
[data-theme="dark"] .ws-result-card {
    background: #1E293B;
    border-color: #334155;
}
.ws-result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 28px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
    flex-wrap: wrap;
    gap: 16px;
}
[data-theme="dark"] .ws-result-header {
    border-bottom-color: #334155;
}
.ws-result-title {
    font-size: 24px;
    font-weight: 800;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}
[data-theme="dark"] .ws-result-title {
    color: #F8FAFC;
}
.ws-result-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 4px;
}
.ws-score-badge {
    text-align: right;
    padding: 12px 24px;
    border-radius: 16px;
    background: #EDF4FF;
    border: 1.5px solid #BFDBFE;
}
.ws-score-label {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
}
.ws-score-val {
    font-size: 36px;
    font-weight: 900;
    color: #16A34A;
    line-height: 1;
    margin-top: 4px;
}
.ws-feedback-list {
    display: flex;
    flex-direction: column;
    gap: 18px;
}
.ws-feedback-card {
    padding: 22px;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    border-left: 5px solid;
    transition: transform 0.2s ease;
}
.ws-feedback-card:hover {
    transform: translateY(-2px);
}
.ws-fb-correct {
    border-left-color: #16A34A;
    background: #F0FDF4;
    border: 1.5px solid #BBF7D0;
}
[data-theme="dark"] .ws-fb-correct {
    background: rgba(22,163,74,0.1);
    border-color: rgba(22,163,74,0.3);
}
.ws-fb-incorrect {
    border-left-color: #EF4444;
    background: #FEF2F2;
    border: 1.5px solid #FECACA;
}
[data-theme="dark"] .ws-fb-incorrect {
    background: rgba(239,68,68,0.1);
    border-color: rgba(239,68,68,0.3);
}
.ws-fb-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 14px;
}
.ws-fb-q-info {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}
.ws-fb-q-num {
    font-weight: 800;
    font-size: 13px;
    padding: 3px 8px;
    border-radius: 6px;
    background: rgba(0,0,0,0.06);
    color: var(--text-primary);
}
[data-theme="dark"] .ws-fb-q-num {
    background: rgba(255,255,255,0.1);
    color: #F8FAFC;
}
.ws-fb-q-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.4;
}
[data-theme="dark"] .ws-fb-q-title {
    color: #F8FAFC;
}
.ws-fb-status-pill {
    font-size: 13px;
    font-weight: 800;
    padding: 4px 12px;
    border-radius: 100px;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.status-correct {
    background: #DCFCE7;
    color: #16A34A;
    border: 1px solid #86EFAC;
}
.status-incorrect {
    background: #FEE2E2;
    color: #DC2626;
    border: 1px solid #FCA5A5;
}
.ws-fb-answers {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px 16px;
    border-radius: 10px;
    background: rgba(0,0,0,0.02);
}
[data-theme="dark"] .ws-fb-answers {
    background: rgba(255,255,255,0.03);
}
.ws-fb-ans-row {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    flex-wrap: wrap;
}
.ws-fb-ans-label {
    color: var(--text-secondary);
    font-weight: 600;
    min-width: 170px;
}
.ws-fb-ans-val {
    font-weight: 700;
}
.ans-correct {
    color: #16A34A;
}
.ans-wrong {
    color: #DC2626;
}
.ws-fb-explanation {
    font-size: 13px;
    line-height: 1.6;
    color: var(--text-secondary);
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border-color);
}
[data-theme="dark"] .ws-fb-explanation {
    border-top-color: #334155;
    color: #94A3B8;
}
.ws-fb-explanation i {
    color: #F59E0B;
    margin-top: 3px;
    flex-shrink: 0;
}

/* Toast Container */
.toast-container {
    position: fixed;
    bottom: 28px;
    right: 28px;
    z-index: 999999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}
.toast-item {
    pointer-events: auto;
    padding: 14px 22px;
    border-radius: 12px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    box-shadow: 0 14px 36px rgba(0,0,0,0.25);
    backdrop-filter: blur(16px);
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    animation: toastSlideIn 0.3s cubic-bezier(0.34,1.56,0.64,1);
    transition: opacity 0.3s ease, transform 0.3s ease;
}
.toast-item.toast-fadeout {
    opacity: 0;
    transform: translateY(10px);
}
.toast-item.toast-success i { color: var(--success-color); }
.toast-item.toast-error i { color: var(--danger-color); }
.toast-item.toast-info i { color: var(--accent-primary); }
@keyframes toastSlideIn {
    from { opacity: 0; transform: translateY(20px) scale(0.9); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ============================================================ */
/* EXACT DASHBOARD STYLING (FUTURISTIC & ULTRA-CLEAN SPEC)     */
/* ============================================================ */

/* Dashboard Layout (Full Covering Edge-to-Edge, No Outer Box/Gaps) */
.app-wrapper {
    width: 100%;
    height: 100vh;
    height: 100dvh;
    min-height: 100vh;
    min-height: 100dvh;
    max-height: 100vh;
    max-height: 100dvh;
    display: grid;
    grid-template-columns: var(--sidebar-w, 260px) minmax(0, 1fr);
    gap: 0;
    padding: 0;
    margin: 0;
    background: var(--bg-color);
    box-sizing: border-box;
    position: relative;
    overflow: hidden;
}
[data-theme="dark"] .app-wrapper {
    background: #0B1120;
}

/* Sidebar (Edge-to-Edge) */
.sidebar {
    width: 260px;
    min-width: 260px;
    max-width: 260px;
    flex-shrink: 0;
    height: 100vh;
    height: 100dvh;
    background: var(--surface);
    border-radius: 0;
    padding: 20px 14px;
    border-right: 1px solid var(--border-color);
    border-top: none;
    border-bottom: none;
    border-left: none;
    box-shadow: none;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    box-sizing: border-box;
    position: relative;
    top: 0;
    z-index: 50;
}
[data-theme="dark"] .sidebar {
    background: #1E293B;
    border-color: #334155;
    box-shadow: none;
}

/* Sidebar Brand */
.sidebar .logo {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    margin-bottom: 20px;
}
.sidebar .logo .logo-icon-wrap {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: linear-gradient(135deg, #2563EB 0%, #3B82F6 100%);
    color: #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 19px;
    box-shadow: 0 4px 14px rgba(37,99,235,0.3);
}
.sidebar .logo span {
    font-size: 21px;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.03em;
}
[data-theme="dark"] .sidebar .logo span {
    color: #F8FAFC;
}

/* Sidebar Nav Items */
.sidebar .nav-links .nav-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    border-radius: 14px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 4px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
}
.sidebar .nav-links .nav-item i {
    font-size: 16px;
    width: 20px;
    text-align: center;
    color: var(--text-secondary);
    transition: color 0.18s ease;
}
.sidebar .nav-links .nav-item:hover {
    background: var(--surface-inset);
    color: var(--text-primary);
    transform: translateX(3px);
}
[data-theme="dark"] .sidebar .nav-links .nav-item:hover {
    background: rgba(255,255,255,0.06);
    color: #F1F5F9;
}
.sidebar .nav-links .nav-item.active,
.sidebar .nav-links .nav-item:active {
    background: linear-gradient(135deg, #2563EB 0%, #1D4ED8 100%) !important;
    color: #FFFFFF !important;
    font-weight: 700;
    box-shadow: 0 6px 18px rgba(37,99,235,0.28);
    transform: translateX(0);
}
.sidebar .nav-links .nav-item.active span,
.sidebar .nav-links .nav-item.active i,
.sidebar .nav-links .nav-item.active svg,
.sidebar .nav-links .nav-item:active i,
.sidebar .nav-links .nav-item:active svg,
.sidebar .nav-links .nav-item:hover i,
.sidebar .nav-links .nav-item:hover svg,
.nav-item.active i,
.nav-item.active svg,
.nav-item:active i,
.nav-item:active svg,
.nav-item:hover i,
.nav-item:hover svg,
.quick-tool-item.active i,
.quick-tool-item:hover i {
    color: #FFFFFF !important;
    fill: #FFFFFF !important;
}
.sidebar .nav-links .nav-item.active .nav-badge-pill {
    background: rgba(255,255,255,0.25) !important;
    color: #FFFFFF !important;
}
[data-theme="dark"] .sidebar .nav-links .nav-item.active {
    background: linear-gradient(135deg, #2563EB 0%, #1D4ED8 100%) !important;
    color: #FFFFFF !important;
}
[data-theme="dark"] .sidebar .nav-links .nav-item.active i,
[data-theme="dark"] .sidebar .nav-links .nav-item.active svg,
[data-theme="dark"] .sidebar .nav-links .nav-item:active i,
[data-theme="dark"] .sidebar .nav-links .nav-item:hover i {
    color: #FFFFFF !important;
    fill: #FFFFFF !important;
}

.nav-badge-pill {
    margin-left: auto;
    background: var(--surface-inset);
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: 12px;
    transition: all 0.2s ease;
}
[data-theme="dark"] .nav-badge-pill {
    background: rgba(255,255,255,0.1);
    color: #CBD5E1;
}

.nav-section-label {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;
    color: var(--text-secondary);
    padding: 16px 16px 6px;
    text-transform: uppercase;
}

/* Sidebar Upgrade Button */

/* Main Content Area (Full Covering & Edge-to-Edge) */
.main-content {
    min-width: 0;
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
    max-height: 100vh;
    max-height: 100dvh;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0;
    margin: 0;
    gap: 0;
    background: #F8FAFD;
}
[data-theme="dark"] .main-content {
    background: #0B1120;
}

/* Topbar Header (Edge-to-Edge Full Width, No Floating Margin) */
.topbar {
    height: 76px;
    min-height: 76px;
    border-radius: 0;
    padding: 0 36px;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--surface);
    border-bottom: 1px solid var(--border-color);
    border-top: none;
    border-left: none;
    border-right: none;
    box-shadow: none;
    gap: 20px;
    box-sizing: border-box;
    position: sticky;
    top: 0;
    z-index: 100;
}
[data-theme="dark"] .topbar {
    background: #1E293B;
    border-color: #334155;
    box-shadow: none;
}

.search-bar {
    flex: 1;
    max-width: 440px;
    height: 46px;
    display: flex;
    align-items: center;
    gap: 12px;
    background: #F8FBFF;
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 0 18px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.02);
    box-sizing: border-box;
    transition: all 0.2s ease;
}
.search-bar:focus-within {
    border-color: #2563EB;
    background: var(--surface);
    box-shadow: 0 0 0 3px rgba(37,99,235,0.12);
}
[data-theme="dark"] .search-bar {
    background: #0F172A;
    border-color: #334155;
}
.search-bar i {
    color: var(--text-secondary);
    font-size: 15px;
}
.search-bar input {
    border: none;
    background: transparent;
    outline: none;
    font-size: 14px;
    color: var(--text-primary);
    width: 100%;
}
[data-theme="dark"] .search-bar input {
    color: #F8FAFC;
}





.theme-toggle-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: var(--surface);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}
.theme-toggle-btn:hover {
    background: var(--surface-inset);
    color: #2563EB;
    transform: rotate(15deg);
}
[data-theme="dark"] .theme-toggle-btn {
    background: #0F172A;
    border-color: #334155;
    color: #F8FAFC;
}

.user-mini {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 14px;
    border-radius: 100px;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
    border: 1px solid transparent;
}
.user-mini:hover {
    background: var(--surface-inset);
    border-color: var(--border-color);
    transform: translateY(-1px);
}
[data-theme="dark"] .user-mini:hover {
    background: rgba(255,255,255,0.06);
    border-color: #334155;
}
.user-avatar-circle {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2563EB 0%, #4F46E5 100%);
    color: #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 16px;
    text-transform: uppercase;
    box-shadow: 0 3px 10px rgba(37,99,235,0.25);
}
.user-mini-info h4 {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    max-width: 190px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
[data-theme="dark"] .user-mini-info h4 {
    color: #F8FAFC;
}
.user-mini-info p {
    font-size: 12px;
    color: var(--text-secondary);
}
.mini-chevron {
    font-size: 12px;
    color: var(--text-secondary);
}

/* Dashboard Hero Banner */
.dash-hero-banner {
    min-height: 290px;
    border-radius: 24px;
    background: linear-gradient(135deg, #FFFFFF 0%, #F8FBFF 55%, #EDF4FF 100%);
    border: 1px solid rgba(227, 235, 247, 0.9);
    overflow: hidden;
    position: relative;
    padding: 40px 48px;
    margin-bottom: 20px;
    display: grid;
    grid-template-columns: 1.25fr 0.75fr;
    align-items: center;
    box-shadow: 0 4px 24px -2px rgba(37,99,235,0.05), 0 1px 3px rgba(0,0,0,0.02);
}
[data-theme="dark"] .dash-hero-banner {
    background: linear-gradient(135deg, #0F1E36 0%, #172554 100%);
    border-color: rgba(37,99,235,0.3);
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}

.dash-greeting-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border-radius: 100px;
    background: #FFFFFF;
    color: #2563EB;
    font-weight: 800;
    font-size: 11px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    box-shadow: 0 2px 8px rgba(37,99,235,0.08);
    border: 1px solid #E0EDFF;
    margin-bottom: 12px;
}
[data-theme="dark"] .dash-greeting-pill {
    background: rgba(37,99,235,0.25);
    color: #93C5FD;
    border-color: rgba(37,99,235,0.4);
}

.dash-hero-heading {
    font-size: 40px;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: #14295B;
    line-height: 1.18;
    margin: 10px 0 8px;
}
[data-theme="dark"] .dash-hero-heading {
    color: #F8FAFC;
}

.dash-hero-subtext {
    font-size: 15px;
    color: #64748B;
    margin-bottom: 26px;
    line-height: 1.5;
}
[data-theme="dark"] .dash-hero-subtext {
    color: #94A3B8;
}

.dash-hero-btn-group {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}
.dash-btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 13px 26px;
    border-radius: 14px;
    background: linear-gradient(135deg, #2563EB 0%, #1D4ED8 100%);
    color: #FFFFFF;
    font-weight: 700;
    font-size: 14px;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(37,99,235,0.28);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.dash-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(37,99,235,0.38);
}
.dash-btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 13px 26px;
    border-radius: 14px;
    background: #FFFFFF;
    color: #2563EB;
    font-weight: 700;
    font-size: 14px;
    border: 1.5px solid #BFDBFE;
    cursor: pointer;
    transition: all 0.18s ease;
}
.dash-btn-secondary:hover {
    background: #EDF4FF;
    border-color: #2563EB;
    transform: translateY(-2px);
}
[data-theme="dark"] .dash-btn-secondary {
    background: rgba(15,23,42,0.6);
    color: #60A5FA;
    border-color: rgba(37,99,235,0.4);
}
.dash-btn-secondary:hover {
    background: #EDF4FF;
    border-color: #2563EB;
    transform: translateY(-2px);
}

.dash-hero-illustration {
    display: flex;
    justify-content: flex-end;
    align-items: center;
}
.hero-3d-scene {
    width: 100%;
    max-width: 360px;
    height: auto;
    filter: drop-shadow(0 12px 24px rgba(37,99,235,0.06));
}

/* 4 Exact Stat Cards */
.stat-grid-exact {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}
@media (max-width: 1100px) {
    .stat-grid-exact { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .dash-hero-banner { grid-template-columns: minmax(0, 1fr); padding: 28px 24px; }
}
@media (max-width: 600px) {
    .stat-grid-exact { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
}
@media (max-width: 440px) {
    .stat-grid-exact { grid-template-columns: minmax(0, 1fr); gap: 10px; }
}

.stat-card-exact {
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 24px;
    min-height: 175px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: 0 2px 12px rgba(20,41,91,0.02);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
[data-theme="dark"] .stat-card-exact {
    background: #1E293B;
    border-color: #334155;
}
.stat-card-exact:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(20,41,91,0.06);
}

.stat-icon-square {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}
.icon-blue { background: #EDF4FF; color: #2563EB; }
.icon-green { background: #F0FDF4; color: #16A34A; }
.icon-orange { background: #FFF7ED; color: #EA580C; }
.icon-purple { background: #FAF5FF; color: #9333EA; }
[data-theme="dark"] .icon-blue { background: rgba(37,99,235,0.2); color: #60A5FA; }
[data-theme="dark"] .icon-green { background: rgba(22,163,74,0.2); color: #4ADE80; }
[data-theme="dark"] .icon-orange { background: rgba(234,88,12,0.2); color: #FB923C; }
[data-theme="dark"] .icon-purple { background: rgba(147,51,234,0.2); color: #C084FC; }

.stat-card-val {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 12px 0 2px;
    letter-spacing: -0.02em;
}
[data-theme="dark"] .stat-card-val { color: #F8FAFC; }

.stat-card-label {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: 12px;
}
[data-theme="dark"] .stat-card-label { color: #94A3B8; }

.stat-card-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    align-self: flex-start;
}
.pill-blue { background: #EDF4FF; color: #2563EB; }
.pill-green { background: #F0FDF4; color: #16A34A; }
.pill-orange { background: #FFF7ED; color: #EA580C; }
.pill-purple { background: #FAF5FF; color: #9333EA; }
[data-theme="dark"] .pill-blue { background: rgba(37,99,235,0.15); color: #93C5FD; }
[data-theme="dark"] .pill-green { background: rgba(22,163,74,0.15); color: #86EFAC; }
[data-theme="dark"] .pill-orange { background: rgba(234,88,12,0.15); color: #FDBA74; }
[data-theme="dark"] .pill-purple { background: rgba(147,51,234,0.15); color: #D8B4FE; }

/* Level Progress Card */
.level-progress-card {
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 22px 28px;
    box-shadow: 0 2px 12px rgba(20,41,91,0.02);
    margin-bottom: 24px;
}
[data-theme="dark"] .level-progress-card {
    background: #1E293B;
    border-color: #334155;
}
.level-prog-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}
.level-prog-title {
    font-size: 15px;
    font-weight: 700;
    color: #2563EB;
    display: flex;
    align-items: center;
    gap: 8px;
}
[data-theme="dark"] .level-prog-title { color: #60A5FA; }
.level-prog-val {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
}
[data-theme="dark"] .level-prog-val { color: #94A3B8; }
.level-track {
    height: 8px;
    background: #E8EEF8;
    border-radius: 999px;
    overflow: hidden;
    margin-top: 12px;
}
[data-theme="dark"] .level-track { background: #334155; }
.level-fill {
    height: 100%;
    width: 60%;
    background: #3478F6;
    border-radius: 999px;
    transition: width 0.6s cubic-bezier(0.34,1.56,0.64,1);
}

/* Jump Back In Section */
.jump-back-section {
    margin-bottom: 24px;
}
.jump-back-header {
    margin-bottom: 16px;
}
.jump-back-header h3 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}
[data-theme="dark"] .jump-back-header h3 { color: #F8FAFC; }
.jump-back-header p {
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 2px;
}
.jump-back-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px;
}
@media (max-width: 1100px) {
    .jump-back-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
    .jump-back-grid { grid-template-columns: minmax(0, 1fr); }
}

.jump-card {
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 2px 12px rgba(20,41,91,0.02);
    display: flex;
    align-items: center;
    gap: 16px;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
[data-theme="dark"] .jump-card {
    background: #1E293B;
    border-color: #334155;
}
.jump-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(37, 99, 235, .08);
    border-color: #BFDBFE;
}
.jump-card-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}
.jump-card-info {
    flex: 1;
    min-width: 0;
}
.jump-card-info h4 {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 2px;
}
[data-theme="dark"] .jump-card-info h4 { color: #F8FAFC; }
.jump-card-info p {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.35;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.jump-card-arrow {
    color: #2563EB;
    font-size: 14px;
    transition: transform 0.2s ease;
}
.jump-card:hover .jump-card-arrow {
    transform: translateX(4px);
}

/* ============================================================ */
/* CERTIFICATE OF ACHIEVEMENT MODAL & PRINT STYLES              */
/* ============================================================ */

.ws-cert-btn {
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 700;
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    color: #ffffff;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(37,99,235,0.25);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}
.ws-cert-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(37,99,235,0.35);
}

.cert-modal-dialog {
    width: min(900px, 94vw);
    max-height: 94vh;
    max-height: 94dvh;
    overflow-y: auto;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(16px);
    border-radius: 20px;
    padding: 24px;
    box-shadow: 0 30px 80px rgba(0,0,0,0.6);
    border: 1px solid rgba(255,255,255,0.1);
}

.cert-modal-top-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    margin-bottom: 20px;
}
.cert-action-btn {
    padding: 8px 18px;
    font-size: 13px;
    font-weight: 600;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.certificate-frame-wrapper {
    display: flex;
    justify-content: center;
}

.certificate-frame {
    background: #ffffff;
    color: #0f172a;
    width: 100%;
    max-width: 820px;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.25);
    position: relative;
    user-select: none;
}

.cert-border-outer {
    border: 8px double #1e3a8a;
    padding: 12px;
    border-radius: 8px;
    background: #ffffff;
}

.cert-border-inner {
    border: 2px solid #3b82f6;
    padding: 36px 40px 28px;
    position: relative;
    text-align: center;
    background: radial-gradient(circle at center, #ffffff 60%, #f8fafc 100%);
    overflow: hidden;
}

.cert-corner {
    position: absolute;
    width: 28px;
    height: 28px;
    border: 3px solid #2563eb;
}
.corner-tl { top: 6px; left: 6px; border-right: none; border-bottom: none; }
.corner-tr { top: 6px; right: 6px; border-left: none; border-bottom: none; }
.corner-bl { bottom: 6px; left: 6px; border-right: none; border-top: none; }
.corner-br { bottom: 6px; right: 6px; border-left: none; border-top: none; }

.cert-watermark {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 260px;
    color: rgba(37,99,235,0.03);
    pointer-events: none;
    z-index: 0;
}

.cert-header {
    position: relative;
    z-index: 1;
    margin-bottom: 20px;
}
.cert-brand {
    font-size: 15px;
    font-weight: 800;
    color: #2563eb;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin-bottom: 12px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.cert-main-title {
    font-family: 'Times New Roman', Times, serif, 'Inter';
    font-size: 32px;
    font-weight: 900;
    color: #1e3a8a;
    letter-spacing: 0.08em;
    margin-bottom: 10px;
}
.cert-subtitle {
    font-size: 14px;
    font-style: italic;
    color: #64748b;
}

.cert-recipient {
    position: relative;
    z-index: 1;
    font-family: 'Times New Roman', Times, serif, 'Inter';
    font-size: 34px;
    font-weight: 700;
    color: #0f172a;
    padding: 10px 0;
    margin: 8px auto 16px;
    border-bottom: 2px solid #e2e8f0;
    max-width: 480px;
}

.cert-body {
    position: relative;
    z-index: 1;
    font-size: 14px;
    color: #475569;
    line-height: 1.6;
    margin-bottom: 30px;
}
.cert-topic {
    font-size: 20px;
    font-weight: 800;
    color: #1e40af;
    margin: 6px 0;
}
.cert-score-text {
    font-size: 15px;
    color: #0f172a;
}
.cert-score-text strong {
    color: #16a34a;
    font-size: 17px;
}

.cert-footer {
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    padding: 0 20px;
    margin-bottom: 20px;
}
.cert-sig-block {
    text-align: center;
    width: 170px;
}
.cert-signature {
    font-family: 'Brush Script MT', cursive, 'Times New Roman', serif;
    font-size: 24px;
    color: #1e3a8a;
    margin-bottom: 4px;
}
.cert-date {
    font-size: 14px;
    font-weight: 600;
    color: #1e3a8a;
    margin-bottom: 6px;
}
.cert-sig-line {
    height: 1.5px;
    background: #94a3b8;
    margin-bottom: 6px;
}
.cert-sig-label {
    font-size: 11px;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.cert-seal {
    text-align: center;
}
.cert-seal-badge {
    width: 76px;
    height: 76px;
    border-radius: 50%;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #ffffff;
    border: 4px double #ffffff;
    box-shadow: 0 4px 14px rgba(245,158,11,0.4);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}
.cert-seal-badge span {
    font-size: 8px;
    font-weight: 900;
    letter-spacing: 0.08em;
    margin-top: 2px;
}

.cert-id-tag {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 11px;
    color: #94a3b8;
    padding-top: 12px;
    border-top: 1px solid #f1f5f9;
}

/* Print CSS for Certificate */
@media print {
    body * {
        visibility: hidden;
    }
    #certificate-frame, #certificate-frame * {
        visibility: visible;
    }
    #certificate-frame {
        position: fixed;
        left: 0;
        top: 0;
        width: 100vw;
        height: 100vh;
        height: 100dvh;
        max-width: none;
        padding: 0;
        box-shadow: none;
    }
}

/* ============================================================ */
/* ADVANCED UI CAPABILITIES & ENHANCEMENTS                      */
/* ============================================================ */

/* Section Header Row with Search */
.section-header-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 20px;
}
.tools-search-wrap {
    position: relative;
    width: 320px;
}
.tools-search-wrap i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    font-size: 14px;
}
.tools-search-wrap input {
    width: 100%;
    padding: 10px 14px 10px 38px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background: var(--surface);
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 500;
    outline: none;
    transition: all 0.2s ease;
    box-sizing: border-box;
}
[data-theme="dark"] .tools-search-wrap input {
    background: #1E293B;
    border-color: #334155;
    color: #F8FAFC;
}
.tools-search-wrap input:focus {
    border-color: #2563EB;
    box-shadow: 0 0 0 3px rgba(37,99,235,0.12);
}

/* Tools Filter Bar */
.tools-filter-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 12px;
    margin-bottom: 20px;
    scrollbar-width: none;
}
.tools-filter-bar::-webkit-scrollbar { display: none; }
.filter-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 100px;
    background: var(--surface);
    border: 1px solid var(--border-color);
    color: #405579;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.18s ease;
}
[data-theme="dark"] .filter-pill {
    background: #1E293B;
    border-color: #334155;
    color: #94A3B8;
}
.filter-pill:hover {
    background: #EDF4FF;
    color: #2563EB;
    border-color: #BFDBFE;
}
.filter-pill.active {
    background: #2563EB !important;
    color: #FFFFFF !important;
    border-color: #2563EB !important;
    box-shadow: 0 2px 10px rgba(37,99,235,0.25);
}
.filter-pill.active .filter-count {
    background: rgba(255,255,255,0.25);
    color: #FFFFFF;
}
.filter-count {
    padding: 2px 7px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 700;
    background: #EDF4FF;
    color: #2563EB;
    transition: all 0.18s ease;
}
[data-theme="dark"] .filter-count {
    background: rgba(37,99,235,0.2);
    color: #60A5FA;
}

/* Preset Prompt Chips */
.tool-presets-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    overflow-x: auto;
    padding-bottom: 4px;
}
.tool-presets-label {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}
.tool-presets-pills {
    display: flex;
    align-items: center;
    gap: 8px;
}
.tool-preset-chip {
    padding: 5px 12px;
    border-radius: 100px;
    background: #EDF4FF;
    border: 1px solid #BFDBFE;
    color: #2563EB;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s ease;
}
.tool-preset-chip:hover,
.tool-preset-chip:active,
.tool-preset-chip.active {
    background: #2563EB !important;
    color: #FFFFFF !important;
    border-color: #2563EB !important;
    transform: translateY(-1px);
}
.tool-input-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
    flex-wrap: wrap;
    gap: 10px;
}
.tool-word-count {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 600;
}
.tool-time-badge {
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 8px;
    background: var(--surface-inset);
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.output-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    text-align: center;
    gap: 8px;
    color: var(--text-secondary);
}
.output-placeholder i {
    font-size: 32px;
    color: #BFDBFE;
    margin-bottom: 4px;
}
.output-placeholder p {
    font-size: 15px;
    font-weight: 700;
    color: #405579;
}
.output-placeholder span {
    font-size: 13px;
    color: var(--text-secondary);
}

/* Inspiration Chips (Worksheets & Diagrams) */
.ws-inspiration-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 18px;
    overflow-x: auto;
    padding-bottom: 6px;
}
.ws-insp-label {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}
.insp-chip {
    padding: 6px 14px;
    border-radius: 100px;
    background: var(--surface);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.18s ease;
}
[data-theme="dark"] .insp-chip {
    background: #1E293B;
    border-color: #334155;
    color: #F8FAFC;
}
.insp-chip:hover,
.insp-chip:active,
.insp-chip.active {
    background: #2563EB !important;
    border-color: #2563EB !important;
    color: #FFFFFF !important;
    transform: translateY(-1px);
}

/* AI Summarizer Tabs Card */
.summarizer-tabs-card {
    padding: 28px;
    border-radius: 20px;
    background: var(--surface);
    border: 1px solid var(--border-color);
    margin-bottom: 20px;
    box-shadow: 0 2px 14px rgba(20,41,91,0.02);
}
[data-theme="dark"] .summarizer-tabs-card {
    background: #1E293B;
    border-color: #334155;
}
.sum-tabs-header {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 12px;
    overflow-x: auto;
}
[data-theme="dark"] .sum-tabs-header {
    border-bottom-color: #334155;
}
.sum-tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 10px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.18s ease;
}
.sum-tab:hover {
    color: #2563EB;
    background: #EDF4FF;
}
.sum-tab.active {
    background: #2563EB !important;
    color: #FFFFFF !important;
}
.sum-tab.active i {
    color: #FFFFFF !important;
}
.file-dropzone {
    border: 2px dashed #BFDBFE;
    border-radius: 16px;
    padding: 36px 20px;
    text-align: center;
    background: #F8FBFF;
    cursor: pointer;
    transition: all 0.2s ease;
}
[data-theme="dark"] .file-dropzone {
    background: #0F172A;
    border-color: #334155;
}
.file-dropzone:hover {
    border-color: #2563EB;
    background: #EDF4FF;
}
.file-dropzone i {
    font-size: 36px;
    color: #2563EB;
    margin-bottom: 12px;
}
.file-dropzone h4 {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}
[data-theme="dark"] .file-dropzone h4 { color: #F8FAFC; }
.file-dropzone p {
    font-size: 13px;
    color: var(--text-secondary);
}
.browse-link {
    color: #2563EB;
    text-decoration: underline;
}
.sum-controls-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 18px;
    flex-wrap: wrap;
    gap: 14px;
}
.sum-format-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
}
.sum-format-wrap label {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
}
[data-theme="dark"] .sum-format-wrap label { color: #F8FAFC; }
.sum-format-wrap select {
    padding: 8px 14px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background: var(--surface-inset);
    color: var(--text-primary);
    font-weight: 600;
    font-size: 13px;
}
.summarizer-output-card {
    padding: 28px;
    border-radius: 20px;
    background: var(--surface);
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 14px rgba(20,41,91,0.02);
}
[data-theme="dark"] .summarizer-output-card {
    background: #1E293B;
    border-color: #334155;
}
.sum-out-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}
.sum-out-header h3 {
    font-size: 18px;
    font-weight: 800;
    color: var(--text-primary);
}
[data-theme="dark"] .sum-out-header h3 { color: #F8FAFC; }
.sum-out-body {
    font-size: 14px;
    line-height: 1.7;
    color: var(--text-primary);
    white-space: pre-wrap;
}
[data-theme="dark"] .sum-out-body { color: #F8FAFC; }

/* Focus Hub Layout & Ambient Audio */
.focus-layout-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 20px;
}
@media (max-width: 900px) {
    .focus-layout-grid { grid-template-columns: minmax(0, 1fr); }
}
.timer-modes-bar {
    display: flex;
    gap: 6px;
    padding: 4px;
    background: var(--surface-inset);
    border-radius: 12px;
    margin-bottom: 10px;
}
[data-theme="dark"] .timer-modes-bar { background: #0F172A; }
.timer-mode-btn {
    flex: 1;
    padding: 8px 10px;
    border-radius: 8px;
    border: none;
    background: transparent;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.18s ease;
}
.timer-mode-btn.active {
    background: #2563EB !important;
    color: #FFFFFF !important;
    box-shadow: 0 2px 10px rgba(37,99,235,0.25) !important;
}
.ambient-sound-card {
    padding: 32px;
    border-radius: 24px;
    background: var(--surface);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 20px;
    box-shadow: 0 2px 16px rgba(20,41,91,0.02);
}
[data-theme="dark"] .ambient-sound-card {
    background: #1E293B;
    border-color: #334155;
}
.ambient-header h3 {
    font-size: 18px;
    font-weight: 800;
    color: var(--text-primary);
}
[data-theme="dark"] .ambient-header h3 { color: #F8FAFC; }
.ambient-header p {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 4px;
}
.ambient-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 12px;
}
.ambient-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-radius: 14px;
    background: var(--surface-inset);
    border: 1px solid var(--border-color);
    transition: all 0.18s ease;
}
[data-theme="dark"] .ambient-item {
    background: #0F172A;
    border-color: #334155;
}
.ambient-item.playing {
    background: #EDF4FF;
    border-color: #BFDBFE;
}
.ambient-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: #EDF4FF;
    color: #2563EB;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
}
.ambient-item span {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
}
[data-theme="dark"] .ambient-item span { color: #F8FAFC; }
.ambient-play-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: #2563EB;
    color: #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    cursor: pointer;
    transition: transform 0.15s;
}
.ambient-play-btn:hover { transform: scale(1.1); }

/* User Rank Banner */
.user-rank-banner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-radius: 20px;
    background: var(--surface);
    border: 1px solid var(--border-color);
    margin-bottom: 20px;
    box-shadow: 0 2px 12px rgba(20,41,91,0.02);
}
[data-theme="dark"] .user-rank-banner {
    background: #1E293B;
    border-color: #334155;
}
.user-rank-left {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
    flex: 1 1 auto;
}
.user-rank-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #2563EB;
    color: #FFFFFF;
    font-weight: 800;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #BFDBFE;
    flex-shrink: 0;
}
.user-rank-left > div { min-width: 0; }
.user-rank-left h4 {
    font-size: 16px;
    font-weight: 800;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
[data-theme="dark"] .user-rank-left h4 { color: #F8FAFC; }
.user-rank-left p {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.user-rank-stats {
    display: flex;
    gap: 20px;
    flex-shrink: 0;
}
@media (max-width: 480px) {
    .user-rank-banner { flex-wrap: wrap; gap: 14px; }
    .user-rank-left { flex-basis: 100%; }
    .user-rank-stats { flex-basis: 100%; justify-content: space-between; }
}
.rank-stat-box {
    text-align: right;
}
.rank-stat-box span {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-secondary);
    display: block;
}
.rank-stat-box strong {
    font-size: 20px;
    font-weight: 900;
    color: #2563EB;
}

/* Note Taker enhancements */
.notes-search-wrap {
    position: relative;
    margin-bottom: 12px;
}
.notes-search-wrap i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    font-size: 13px;
}
.notes-search-wrap input {
    width: 100%;
    padding: 8px 12px 8px 34px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background: var(--surface);
    color: var(--text-primary);
    font-size: 12px;
    outline: none;
    box-sizing: border-box;
}
[data-theme="dark"] .notes-search-wrap input {
    background: #0F172A;
    border-color: #334155;
    color: #F8FAFC;
}
.notes-items-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.note-editor-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}
.note-stats-tag {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-secondary);
    white-space: nowrap;
}
.note-actions-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.note-ai-btn {
    font-size: 13px;
    font-weight: 600;
}
.creative-diagram-canvas {
    background: #FFFFFF;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
    overflow-x: auto;
    text-align: center;
    min-height: 250px;
    display: flex;
    align-items: center;
    justify-content: center;
}
[data-theme="dark"] .creative-diagram-canvas {
    background: #0F172A;
    border-color: #334155;
}

/* ================================================================
   DEDICATED DEVELOPER HUB PORTAL (SMOOTH SCROLLING & STUDYHUB SCALE)
   ================================================================ */
.devhub-portal-wrapper {
    height: 100vh;
    height: 100dvh;
    max-height: 100vh;
    max-height: 100dvh;
    overflow: hidden;
    background-color: #F8FAFD;
    color: var(--text-primary);
    display: flex;
    flex-direction: column;
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Header */
.devhub-header {
    height: 78px;
    background: var(--surface);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 36px;
    position: sticky;
    top: 0;
    z-index: 100;
    gap: 28px;
    flex-shrink: 0;
}

.devhub-header-left {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-shrink: 0;
}

.devhub-mobile-menu-btn {
    display: none;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background: var(--surface);
    color: var(--text-primary);
    font-size: 16px;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}
.devhub-mobile-menu-btn:hover {
    background: var(--surface-inset);
    color: #2563EB;
}

.devhub-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 18px;
    font-weight: 800;
    color: var(--text-primary);
    cursor: pointer;
    user-select: none;
    flex-shrink: 0;
}
.devhub-logo-box {
    width: 38px;
    height: 38px;
    background: #2563EB;
    color: #FFFFFF;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: 900;
    box-shadow: 0 3px 12px rgba(37,99,235,0.28);
}

.devhub-search-bar {
    position: relative;
    width: 100%;
    max-width: 620px;
    margin: 0 auto;
}
.devhub-search-bar input {
    width: 100%;
    height: 44px;
    background: var(--surface);
    border: 1.5px solid var(--border-color);
    border-radius: 100px;
    padding: 0 46px 0 22px;
    font-size: 14px;
    color: var(--text-primary);
    transition: all 0.2s ease;
}
.devhub-search-bar input:focus {
    border-color: #2563EB;
    outline: none;
    box-shadow: 0 0 0 3.5px rgba(37,99,235,0.12);
}
.devhub-search-bar i {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    font-size: 15px;
    pointer-events: none;
}

.devhub-header-right {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-shrink: 0;
}
.devhub-icon-btn {
    position: relative;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: var(--surface);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16.5px;
    cursor: pointer;
    transition: all 0.15s ease;
}
.devhub-icon-btn:hover { background: var(--surface-inset); color: #2563EB; }
.devhub-badge-dot {
    position: absolute;
    top: -2px;
    right: -2px;
    background: #2563EB;
    color: #FFFFFF;
    font-size: 10px;
    font-weight: 800;
    min-width: 17px;
    height: 17px;
    border-radius: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #FFFFFF;
}

.devhub-user-pill {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 14px 4px 5px;
    border-radius: 100px;
    border: 1px solid var(--border-color);
    background: var(--surface);
    cursor: pointer;
    transition: all 0.15s ease;
}
.devhub-user-pill:hover { border-color: #CBD5E1; }
.devhub-avatar-initial {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2563EB 0%, #1D4ED8 100%);
    color: #FFFFFF;
    font-weight: 800;
    font-size: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(37,99,235,0.25);
    text-transform: uppercase;
    flex-shrink: 0;
    user-select: none;
}
.devhub-user-meta {
    display: flex;
    flex-direction: column;
    text-align: left;
}
.devhub-user-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}
.devhub-user-lvl {
    font-size: 11.5px;
    color: var(--text-secondary);
    font-weight: 600;
}
.devhub-chevron {
    font-size: 11px;
    color: var(--text-secondary);
    margin-left: 2px;
}

/* Sidebar & Body Layout (Fully Scrollable) */
.devhub-layout-body {
    display: flex;
    flex: 1;
    height: calc(100vh - 78px);
    height: calc(100dvh - 78px);
    overflow: hidden;
}

.devhub-sidebar {
    width: 260px;
    background: var(--surface);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 20px 0;
    flex-shrink: 0;
    overflow-y: auto;
}
.devhub-sidebar::-webkit-scrollbar {
    width: 5px;
}
.devhub-sidebar::-webkit-scrollbar-thumb {
    background: #E2E8F0;
    border-radius: 10px;
}

.devhub-nav-list {
    list-style: none;
    padding: 0 14px;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.devhub-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    height: 44px;
    padding: 0 16px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s ease;
}
.devhub-nav-item i {
    font-size: 16px;
    width: 20px;
    text-align: center;
}
.devhub-nav-item:hover {
    background: #F8FAFD;
    color: #2563EB;
}
.devhub-nav-item.active {
    background: #EFF6FF !important;
    color: #2563EB !important;
    font-weight: 700;
}
.devhub-nav-item.active i {
    color: #2563EB !important;
}

.devhub-sidebar-bottom {
    padding: 12px 14px 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.devhub-goal-card {
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 14px 16px;
}
.devhub-goal-title {
    font-size: 13px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 3px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.devhub-goal-title i { color: #EF4444; }
.devhub-goal-sub {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 9px;
}
.devhub-goal-track {
    width: 100%;
    height: 7px;
    background: #E2E8F0;
    border-radius: 100px;
    overflow: hidden;
}
.devhub-goal-fill {
    height: 100%;
    background: #2563EB;
    border-radius: 100px;
    transition: width 0.3s ease;
}

.devhub-switch-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 8px 0;
    transition: color 0.15s ease;
}
.devhub-switch-link:hover { color: #EF4444; }

/* Main Content Area (Smooth Scrolling & Generous Sizing like StudyHub) */
.devhub-main-content {
    flex: 1;
    height: 100%;
    padding: 30px 40px 60px;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    scroll-behavior: smooth;
}
.devhub-main-content::-webkit-scrollbar {
    width: 8px;
}
.devhub-main-content::-webkit-scrollbar-track {
    background: transparent;
}
.devhub-main-content::-webkit-scrollbar-thumb {
    background: #CBD5E1;
    border-radius: 10px;
}
.devhub-main-content::-webkit-scrollbar-thumb:hover {
    background: #94A3B8;
}

.devhub-tab-pane {
    display: flex;
    flex-direction: column;
    gap: 22px;
}

/* ================================================================
   DASHBOARD TAB (EXACT DeveloperHubDashboard.jsx TAILWIND MATCH)
   ================================================================ */
/* 1. Welcome Hero Banner */
.devhub-hero-banner-jsx {
    position: relative;
    overflow: hidden;
    border-radius: 16px;
    background: linear-gradient(to right, #EFF6FF 0%, #EEF2FF 50%, #FFFFFF 100%);
    border: 1px solid #DBEAFE;
    padding: 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.devhub-hero-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 4px 0;
    letter-spacing: -0.3px;
}
.devhub-hero-sub {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0;
}
.devhub-hero-svg-wrap {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(219, 234, 254, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: 1px solid #DBEAFE;
}

/* 2. Stats Row */
.devhub-stats-row-jsx {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}
.devhub-stat-card-jsx {
    background: var(--surface);
    border-radius: 16px;
    border: 1px solid #F3F4F6;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.devhub-stat-icon-jsx {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    margin-bottom: 16px;
}
.devhub-stat-label-jsx {
    font-size: 12px;
    font-weight: 500;
    color: #9CA3AF;
    margin: 0 0 4px 0;
}
.devhub-stat-val-jsx {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
    margin: 0;
}
.devhub-stat-denom-jsx {
    font-size: 14px;
    font-weight: 500;
    color: #9CA3AF;
}
.devhub-stat-delta-jsx {
    font-size: 12px;
    font-weight: 500;
    color: #10B981;
    display: flex;
    align-items: center;
    gap: 4px;
    margin: 4px 0 0 0;
}
.devhub-stat-note-jsx {
    font-size: 12px;
    font-weight: 500;
    color: #10B981;
    margin: 4px 0 0 0;
}

/* 3. Middle Grid (Continue Learning + Skills + Activity) */
.devhub-middle-grid-jsx {
    display: grid;
    grid-template-columns: 2fr 1fr 1.1fr;
    gap: 16px;
    align-items: start;
}
.devhub-card-box-jsx {
    background: var(--surface);
    border-radius: 16px;
    border: 1px solid #F3F4F6;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    display: flex;
    flex-direction: column;
}
.devhub-box-head-jsx {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}
.devhub-box-head-jsx h2,
.devhub-box-title-only-jsx {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}
.devhub-box-title-only-jsx {
    margin-bottom: 16px;
}
.devhub-link-btn-jsx {
    font-size: 12px;
    font-weight: 600;
    color: #2563EB;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}
.devhub-link-btn-jsx:hover {
    text-decoration: underline;
}

/* Continue Learning (2x2 Grid) */
.devhub-learn-grid-2x2 {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 16px;
}
.devhub-learn-tile-jsx {
    border-radius: 12px;
    border: 1px solid #F3F4F6;
    padding: 16px;
    display: flex;
    flex-direction: column;
    min-height: 190px;
}
.devhub-learn-icon-jsx {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    margin-bottom: 12px;
    flex-shrink: 0;
}
.devhub-learn-title-jsx {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 4px 0;
}
.devhub-learn-desc-jsx {
    font-size: 12px;
    color: #9CA3AF;
    line-height: 1.4;
    margin: 0 0 16px 0;
    flex: 1;
}
.devhub-cta-blue-jsx {
    font-size: 12px;
    font-weight: 600;
    border-radius: 8px;
    padding: 8px 12px;
    background: #2563EB;
    color: #FFFFFF;
    border: none;
    cursor: pointer;
    transition: background 0.15s ease;
}
.devhub-cta-blue-jsx:hover {
    background: #1D4ED8;
}
.devhub-cta-light-jsx {
    font-size: 12px;
    font-weight: 600;
    border-radius: 8px;
    padding: 8px 12px;
    background: #EFF6FF;
    color: #1D4ED8;
    border: none;
    cursor: pointer;
    transition: background 0.15s ease;
}
.devhub-cta-light-jsx:hover {
    background: #DBEAFE;
}

/* Your Skills (2-Column Grid) */
.devhub-skills-grid-jsx {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 12px;
}
.devhub-skill-box-jsx {
    border-radius: 12px;
    background: rgba(239, 246, 255, 0.6);
    border: 1px solid #EFF6FF;
    padding: 12px;
    position: relative;
    transition: all 0.15s ease;
}
.devhub-skill-box-jsx:hover {
    background: #EFF6FF;
    border-color: #DBEAFE;
}
.devhub-skill-top-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.devhub-skill-name-jsx {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 2px 0;
}
.devhub-skill-delete-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 11px;
    padding: 2px 5px;
    border-radius: 4px;
    opacity: 0.6;
    transition: all 0.15s ease;
}
.devhub-skill-delete-btn:hover {
    opacity: 1;
    color: #EF4444;
    background: #FEE2E2;
}
.devhub-skill-lvl-jsx {
    font-size: 12px;
    color: #3B82F6;
    font-weight: 500;
    margin: 0;
}
.devhub-add-skill-btn-jsx {
    border-radius: 12px;
    border: 1.5px dashed var(--border-color);
    padding: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 600;
    color: #9CA3AF;
    background: var(--surface);
    cursor: pointer;
    transition: all 0.15s ease;
}
.devhub-add-skill-btn-jsx:hover {
    border-color: #93C5FD;
    color: #2563EB;
}

/* Recent Activity */
.devhub-activity-space-jsx {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.devhub-act-row-jsx {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}
.devhub-act-icon-wrap-jsx {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}
.devhub-act-content-jsx {
    flex: 1;
    min-width: 0;
}
.devhub-act-main-jsx {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    line-height: 1.35;
    margin: 0;
}
.devhub-act-sub-jsx {
    font-size: 12px;
    color: #9CA3AF;
    margin: 2px 0 0 0;
}
.devhub-act-action-jsx {
    font-size: 12px;
    font-weight: 600;
    color: #2563EB;
    background: none;
    border: none;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    padding: 0;
}
.devhub-act-action-jsx:hover {
    text-decoration: underline;
}
.devhub-badge-square-jsx {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: #FFFBEB;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #F59E0B;
    font-size: 14px;
}

/* 4. Your Projects Grid */
.devhub-proj-grid-jsx {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}
.devhub-proj-card-jsx {
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #F3F4F6;
    display: flex;
    flex-direction: column;
}
.devhub-proj-dark {
    background: #0B1220;
    color: #FFFFFF;
}
.devhub-proj-light {
    background: #F3F6FF;
    color: var(--text-primary);
}
.devhub-proj-top-banner {
    height: 96px;
    display: flex;
    align-items: center;
    padding: 0 16px;
}
.devhub-banner-dark {
    background: linear-gradient(to bottom right, #101A2E, #0B1220);
}
.devhub-banner-light {
    background: linear-gradient(to bottom right, #DBEAFE, #EEF2FF);
}
.devhub-proj-banner-title {
    font-size: 14px;
    font-weight: 700;
}
.devhub-proj-body-jsx {
    padding: 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
}
.devhub-proj-title-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 4px;
}
.devhub-proj-title-jsx {
    font-size: 14px;
    font-weight: 600;
    margin: 0;
}
.devhub-proj-desc-jsx {
    font-size: 12px;
    margin: 0 0 16px 0;
}
.devhub-proj-score-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
    margin-bottom: 12px;
}
.devhub-proj-score-label {
    font-size: 11px;
    margin: 0 0 1px 0;
}
.devhub-proj-score-val {
    font-size: 18px;
    font-weight: 700;
    margin: 0;
}
.devhub-proj-score-denom {
    font-size: 12px;
    font-weight: 400;
}
.devhub-score-ring-svg {
    position: relative;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.devhub-ring-rot {
    transform: rotate(-90deg);
}
.devhub-ring-text {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
}
.devhub-proj-tags-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.devhub-tag-pill-dark {
    font-size: 10px;
    font-weight: 500;
    padding: 3px 8px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.1);
    color: #D1D5DB;
}
.devhub-tag-pill-light {
    font-size: 10px;
    font-weight: 500;
    padding: 3px 8px;
    border-radius: 6px;
    background: #FFFFFF;
    color: #6B7280;
    border: 1px solid #F3F4F6;
}
.devhub-proj-upload-box-jsx {
    border-radius: 12px;
    border: 2px dashed var(--border-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 40px 16px;
    color: #9CA3AF;
    background: var(--surface);
    cursor: pointer;
    transition: all 0.15s ease;
}
.devhub-proj-upload-box-jsx:hover {
    border-color: #93C5FD;
    color: #2563EB;
}
.devhub-upload-circle-jsx {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #EFF6FF;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #3B82F6;
    font-size: 20px;
}
.devhub-upload-main-text {
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    margin: 0 0 2px 0;
}
.devhub-upload-sub-text {
    font-size: 12px;
    color: #9CA3AF;
    margin: 0;
}
.devhub-upload-btn-pill {
    margin-top: 4px;
    background: #2563EB;
    color: #FFFFFF;
    font-size: 12px;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: 8px;
}

/* Quick Skill Chips in Modal */
.devhub-quick-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.devhub-chip-btn {
    padding: 6px 12px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--surface-inset);
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}
.devhub-chip-btn:hover,
.devhub-chip-btn.selected {
    background: #EFF6FF;
    border-color: #2563EB;
    color: #2563EB;
    font-weight: 700;
    transform: translateY(-1px);
}

/* Sub-Pane Details (Mock tests, Notes, Review) */
.devhub-pane-header h2 {
    font-size: 20px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 3px;
}
.devhub-pane-header p {
    font-size: 13px;
    color: var(--text-secondary);
}

.devhub-test-config-card {
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.02);
}
.devhub-form-row {
    display: flex;
    gap: 14px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.devhub-field {
    flex: 1;
    min-width: 170px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.devhub-field label {
    font-size: 12.5px;
    font-weight: 700;
    color: var(--text-primary);
}
.devhub-field select, .devhub-field input {
    height: 38px;
    padding: 0 12px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    font-size: 12.5px;
    font-weight: 600;
    background: #F8FAFD;
}
.devhub-btn-lg {
    padding: 10px 20px;
    font-size: 13px;
    border-radius: 8px;
}
.devhub-loading-status {
    margin-top: 10px;
    color: #2563EB;
    font-weight: 700;
    font-size: 12.5px;
    text-align: center;
}

.devhub-exam-paper-card {
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 2px 12px rgba(37,99,235,0.03);
}
.devhub-exam-paper-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}
.devhub-paper-badge {
    background: #EFF6FF;
    color: #2563EB;
    border: 1px solid #BFDBFE;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11.5px;
    font-weight: 700;
}
.devhub-exam-timer-pill {
    background: #FEF2F2;
    color: #EF4444;
    border: 1px solid #FECACA;
    padding: 5px 12px;
    border-radius: 100px;
    font-weight: 800;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 5px;
}
.devhub-exam-nav-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #F8FAFD;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 10px 14px;
    margin-bottom: 16px;
}
.devhub-exam-progress-info {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12.5px;
    font-weight: 700;
    color: var(--text-primary);
}
.devhub-exam-progress-track {
    width: 120px;
    height: 6px;
    background: #E2E8F0;
    border-radius: 100px;
    overflow: hidden;
}
.devhub-exam-progress-fill {
    height: 100%;
    background: #2563EB;
    border-radius: 100px;
    transition: width 0.3s ease;
}
.devhub-exam-nav-pills {
    display: flex;
    gap: 6px;
}
.devhub-exam-q-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.devhub-score-badge-large {
    background: #EFF6FF;
    border: 1px solid #BFDBFE;
    border-radius: 12px;
    padding: 8px 16px;
    text-align: center;
}
.devhub-score-badge-large span {
    font-size: 10.5px;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
}
.devhub-score-badge-large h2 {
    font-size: 20px;
    font-weight: 900;
    color: #2563EB;
    margin: 0;
}

/* ================================================================
   ULTRA-RESPONSIVE MEDIA QUERIES (MOBILE, TABLET & DESKTOP)
   ================================================================ */
/* Sidebar Backdrop for Mobile Drawer */
.devhub-sidebar-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(3px);
    z-index: 998;
    opacity: 0;
    transition: opacity 0.25s ease;
    pointer-events: none;
}
.devhub-sidebar-backdrop.active {
    display: block;
    opacity: 1;
    pointer-events: auto;
}

/* Breakpoint: Laptop / Medium Desktop (<= 1200px) */
@media (max-width: 1200px) {
    .devhub-middle-grid-jsx {
        grid-template-columns: minmax(0, 1fr);
        gap: 18px;
    }
    .devhub-stats-row-jsx {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .devhub-proj-grid-jsx {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Breakpoint: Tablet (<= 1024px) */
@media (max-width: 1024px) {
    .devhub-header {
        padding: 0 20px;
        gap: 16px;
        height: 68px;
    }
    .devhub-layout-body {
        height: calc(100vh - 68px);
        height: calc(100dvh - 68px);
    }
    .devhub-mobile-menu-btn {
        display: flex;
    }
    .devhub-sidebar {
        position: fixed;
        top: 0;
        left: -290px;
        bottom: 0;
        width: 275px;
        height: 100vh;
        height: 100dvh;
        z-index: 999;
        box-shadow: 4px 0 30px rgba(0, 0, 0, 0.18);
        transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }
    .devhub-sidebar.open {
        left: 0;
    }
    .devhub-main-content {
        padding: 22px 20px 50px;
    }
}

/* Breakpoint: Small Tablet & Large Mobile (<= 768px) */
@media (max-width: 768px) {
    .devhub-header-right .devhub-user-meta {
        display: none;
    }
    .devhub-header-right .devhub-chevron {
        display: none;
    }
    .devhub-user-pill {
        padding: 4px;
        border-radius: 50%;
        border: none;
    }
    .devhub-search-bar {
        max-width: 260px;
    }
    .devhub-stats-row-jsx {
        grid-template-columns: minmax(0, 1fr);
    }
    .devhub-hero-banner-jsx {
        padding: 22px 20px;
        gap: 16px;
    }
    .devhub-hero-title {
        font-size: 20px;
    }
    .devhub-hero-svg-wrap {
        width: 60px;
        height: 60px;
    }
    .devhub-hero-svg-wrap svg {
        width: 32px;
        height: 32px;
    }
    .devhub-learn-grid-2x2 {
        grid-template-columns: minmax(0, 1fr);
    }
    .devhub-form-row {
        flex-direction: column;
        gap: 12px;
    }
}

/* Breakpoint: Small Mobile Phones (<= 640px) */
@media (max-width: 640px) {
    .devhub-header {
        padding: 0 12px;
        gap: 8px;
    }
    .devhub-logo span {
        display: none;
    }
    .devhub-search-bar {
        flex: 1;
        max-width: 100%;
    }
    .devhub-search-bar input {
        height: 38px;
        font-size: 12.5px;
        padding-left: 14px;
        padding-right: 36px;
    }
    .devhub-search-bar i {
        right: 12px;
        font-size: 13px;
    }
    .devhub-main-content {
        padding: 16px 12px 40px;
    }
    .devhub-proj-grid-jsx {
        grid-template-columns: minmax(0, 1fr);
    }
    .devhub-skills-grid-jsx {
        grid-template-columns: minmax(0, 1fr);
    }
    .devhub-hero-banner-jsx {
        flex-direction: column;
        align-items: flex-start;
        gap: 14px;
    }
    .devhub-hero-svg-wrap {
        align-self: flex-end;
    }
    .devhub-stat-card-jsx {
        padding: 16px;
    }
    .devhub-card-box-jsx {
        padding: 16px;
    }
}

/* ============================================================ */
/* COLLAPSIBLE SIDEBAR (ICON RAIL WITH VISIBLE LOGO)            */
/* ============================================================ */
.sidebar-collapse-btn {
    margin-left: auto;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: var(--surface-inset);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 11px;
    transition: all 0.2s ease;
}
.sidebar-collapse-btn:hover {
    background: #2563EB;
    color: #FFFFFF;
    border-color: #2563EB;
}
[data-theme="dark"] .sidebar-collapse-btn {
    background: #0F172A;
    border-color: #334155;
    color: #94A3B8;
}

/* Sidebar Collapsed State (Icon Rail Mode) */
.app-wrapper.sidebar-collapsed {
    grid-template-columns: 72px 1fr !important;
}
.sidebar.collapsed {
    width: 72px !important;
    min-width: 72px !important;
    max-width: 72px !important;
    padding: 18px 8px !important;
}
.sidebar.collapsed .logo {
    justify-content: center;
    padding: 0;
    margin-bottom: 14px;
}
.sidebar.collapsed .logo span {
    display: none !important;
}
.sidebar.collapsed .sidebar-collapse-btn {
    display: none !important;
}
.sidebar.collapsed .logo-icon-wrap {
    cursor: pointer;
    transition: transform 0.2s ease;
}
.sidebar.collapsed .logo-icon-wrap:hover {
    transform: scale(1.08);
}
.sidebar.collapsed .nav-links .nav-item {
    justify-content: center;
    padding: 12px;
    gap: 0;
}
.sidebar.collapsed .nav-links .nav-item span,
.sidebar.collapsed .nav-links .nav-item .nav-badge-pill,
.sidebar.collapsed .nav-section-label,
.sidebar.collapsed .nav-bottom #profile-nav-btn span,
.sidebar.collapsed .nav-bottom #logout-btn span {
    display: none !important;
}
.sidebar.collapsed .nav-links .nav-item i {
    font-size: 18px;
    width: auto;
    margin: 0;
}

/* ============================================================ */
/* GROK-INSPIRED AI STUDY COMPANION STYLES                      */
/* ============================================================ */
.grok-chat-wrapper {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 120px);
    height: calc(100dvh - 120px);
    max-width: 1060px;
    width: 100%;
    margin: 0 auto;
    position: relative;
}

.grok-chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: 18px;
    box-shadow: 0 2px 10px rgba(20,41,91,0.02);
    margin-bottom: 14px;
    flex-shrink: 0;
}
[data-theme="dark"] .grok-chat-header {
    background: #1E293B;
    border-color: #334155;
}

.grok-header-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

.grok-avatar-badge {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: linear-gradient(135deg, #2563EB 0%, #1D4ED8 100%);
    color: #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    box-shadow: 0 4px 14px rgba(37,99,235,0.3);
}

.grok-title {
    font-size: 17px;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}
[data-theme="dark"] .grok-title { color: #F8FAFC; }

.grok-model-pill {
    background: #EFF6FF;
    border: 1px solid #DBEAFE;
    color: #2563EB;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 100px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
[data-theme="dark"] .grok-model-pill {
    background: rgba(37,99,235,0.2);
    color: #93C5FD;
    border-color: rgba(37,99,235,0.4);
}

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

.grok-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.grok-mode-select {
    padding: 8px 14px;
    border-radius: 10px;
    border: 1.5px solid var(--border-color);
    background: #F8FAFD;
    color: var(--text-primary);
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    outline: none;
    transition: border-color 0.2s ease;
}
.grok-mode-select:focus {
    border-color: #2563EB;
}
[data-theme="dark"] .grok-mode-select {
    background: #0F172A;
    border-color: #334155;
    color: #F8FAFC;
}

.grok-action-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background: var(--surface);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}
.grok-action-btn:hover {
    background: var(--surface-inset);
    color: #2563EB;
    border-color: #BFDBFE;
}
[data-theme="dark"] .grok-action-btn {
    background: #0F172A;
    border-color: #334155;
    color: #94A3B8;
}

/* Chat Stream */
.grok-chat-stream {
    flex: 1;
    overflow-y: auto;
    padding: 10px 4px 20px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

/* Welcome Hero */
.grok-welcome-view {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 20px 10px 10px;
    max-width: 900px;
    margin: 0 auto;
}

.grok-sparkle-glow {
    width: 60px;
    height: 60px;
    border-radius: 20px;
    background: linear-gradient(135deg, #2563EB 0%, #3B82F6 100%);
    color: #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    box-shadow: 0 10px 30px rgba(37,99,235,0.3);
    margin-bottom: 18px;
    animation: grokFloat 4s ease-in-out infinite;
}
@keyframes grokFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.grok-welcome-hero h2 {
    font-size: 26px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 8px;
    letter-spacing: -0.02em;
}
[data-theme="dark"] .grok-welcome-hero h2 { color: #F8FAFC; }

.grok-welcome-hero p {
    font-size: 14px;
    color: var(--text-secondary);
    max-width: 580px;
    margin: 0 auto 30px;
    line-height: 1.5;
}

.grok-quick-actions-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    width: 100%;
}
@media (max-width: 900px) {
    .grok-quick-actions-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
    .grok-quick-actions-grid { grid-template-columns: minmax(0, 1fr); }
}

.grok-card {
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 20px 18px;
    text-align: left;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(20,41,91,0.02);
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.grok-card:hover {
    transform: translateY(-4px);
    border-color: #93C5FD;
    box-shadow: 0 12px 28px -6px rgba(37,99,235,0.12);
}
[data-theme="dark"] .grok-card {
    background: #1E293B;
    border-color: #334155;
}

.grok-card-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    margin-bottom: 12px;
}

.grok-card h4 {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}
[data-theme="dark"] .grok-card h4 { color: #F8FAFC; }

.grok-card p {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* Chat Messages */
.grok-msg-row {
    display: flex;
    gap: 14px;
    width: 100%;
    animation: grokMsgIn 0.3s ease forwards;
}
@keyframes grokMsgIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.grok-msg-user {
    justify-content: flex-end;
}
.grok-user-bubble {
    background: linear-gradient(135deg, #2563EB 0%, #1D4ED8 100%);
    color: #FFFFFF;
    padding: 12px 20px;
    border-radius: 20px 20px 4px 20px;
    font-size: 14.5px;
    line-height: 1.5;
    max-width: 78%;
    box-shadow: 0 4px 14px rgba(37,99,235,0.25);
    word-break: break-word;
}

.grok-msg-ai {
    justify-content: flex-start;
}
.grok-ai-bubble {
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: 20px 20px 20px 4px;
    padding: 24px 26px;
    font-size: 14.5px;
    line-height: 1.65;
    color: var(--text-primary);
    max-width: 94%;
    width: 100%;
    box-shadow: 0 4px 20px -2px rgba(20,41,91,0.03);
}
[data-theme="dark"] .grok-ai-bubble {
    background: #1E293B;
    border-color: #334155;
    color: #F8FAFC;
}

.grok-tool-execution-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #EFF6FF;
    border: 1px solid #DBEAFE;
    color: #2563EB;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 4px 12px;
    border-radius: 100px;
    margin-bottom: 12px;
}
[data-theme="dark"] .grok-tool-execution-badge {
    background: rgba(37,99,235,0.2);
    color: #93C5FD;
    border-color: rgba(37,99,235,0.4);
}

.grok-msg-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid #F1F5F9;
    flex-wrap: wrap;
}
[data-theme="dark"] .grok-msg-actions {
    border-top-color: #334155;
}

.grok-msg-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: #F8FAFD;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}
.grok-msg-btn:hover {
    background: #2563EB;
    color: #FFFFFF;
    border-color: #2563EB;
}
[data-theme="dark"] .grok-msg-btn {
    background: #0F172A;
    border-color: #334155;
    color: #CBD5E1;
}

/* Floating Composer */
.grok-composer-wrap {
    position: sticky;
    bottom: 0;
    padding: 10px 0 6px;
    background: transparent;
    z-index: 40;
}

.grok-slash-popup {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 0;
    right: 0;
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 8px;
    box-shadow: 0 16px 40px -6px rgba(20,41,91,0.12);
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: 250px;
    overflow-y: auto;
    z-index: 50;
    animation: grokMsgIn 0.2s ease forwards;
}
[data-theme="dark"] .grok-slash-popup {
    background: #1E293B;
    border-color: #334155;
}

.grok-slash-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.15s ease;
}
.grok-slash-item:hover {
    background: #EFF6FF;
}
[data-theme="dark"] .grok-slash-item:hover {
    background: rgba(37,99,235,0.2);
}

.slash-badge {
    background: #2563EB;
    color: #FFFFFF;
    font-weight: 800;
    font-size: 12px;
    padding: 3px 8px;
    border-radius: 6px;
    font-family: monospace;
}
.slash-desc {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}
[data-theme="dark"] .slash-desc { color: #CBD5E1; }

.grok-composer-card {
    background: var(--surface);
    border: 1.5px solid var(--border-color);
    border-radius: 20px;
    padding: 14px 18px;
    box-shadow: 0 8px 30px -4px rgba(20,41,91,0.06);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.grok-composer-card:focus-within {
    border-color: #2563EB;
    box-shadow: 0 8px 32px rgba(37,99,235,0.14);
}
[data-theme="dark"] .grok-composer-card {
    background: #1E293B;
    border-color: #334155;
}

#grok-chat-input {
    width: 100%;
    border: none;
    background: transparent;
    outline: none;
    font-size: 14.5px;
    color: var(--text-primary);
    resize: none;
    max-height: 140px;
    font-family: inherit;
    line-height: 1.5;
}
[data-theme="dark"] #grok-chat-input { color: #F8FAFC; }

.grok-composer-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #F1F5F9;
}
[data-theme="dark"] .grok-composer-footer { border-top-color: #334155; }

.grok-tool-chips {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Model picker — shaped like the chips beside it so the composer keeps one
   visual language. Hidden entirely when the provider is not Gemini, since the
   choice would have no effect. */
.grok-model-pick {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px 4px 12px;
    border-radius: 100px;
    border: 1px solid var(--border-color);
    background: #F8FAFD;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
}
.grok-model-pick:hover { background: #EFF6FF; color: #2563EB; border-color: #BFDBFE; }
.grok-model-pick select {
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    max-width: 150px;
    padding-right: 2px;
}
.grok-model-pick select:focus-visible { outline: 2px solid #2563EB; outline-offset: 2px; border-radius: 4px; }
.sr-only-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[data-theme="dark"] .grok-model-pick { background: rgba(255,255,255,.04); }
[data-theme="dark"] .grok-model-pick select option { background: #0f172a; color: #e6edf7; }

/* On a phone the chip row is a horizontal scroller, so a wide picker pushes
   itself off-screen. The label alone is enough there — the "best for" text is
   still on the option's tooltip. */
@media (max-width: 640px) {
    .grok-model-pick { padding: 4px 8px 4px 10px; }
    .grok-model-pick select { max-width: 104px; }
}

/* Which model answered, shown on the answer itself. */
.grok-model-used {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 10px;
    padding: 4px 10px;
    border-radius: 100px;
    background: rgba(37,99,235,.08);
    border: 1px solid rgba(37,99,235,.18);
    color: var(--text-secondary);
    font-size: 11.5px;
    font-weight: 600;
}
.grok-model-used .grok-model-why { font-weight: 500; opacity: .85; }

.grok-chip-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 100px;
    border: 1px solid var(--border-color);
    background: #F8FAFD;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}
.grok-chip-btn.active, .grok-chip-btn:hover {
    background: #EFF6FF;
    color: #2563EB;
    border-color: #BFDBFE;
}
[data-theme="dark"] .grok-chip-btn {
    background: #0F172A;
    border-color: #334155;
    color: #94A3B8;
}
[data-theme="dark"] .grok-chip-btn.active {
    background: rgba(37,99,235,0.25);
    color: #93C5FD;
    border-color: rgba(37,99,235,0.4);
}

.grok-composer-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.grok-icon-btn {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.2s ease;
}
.grok-icon-btn:hover {
    background: var(--surface-inset);
    color: #2563EB;
}
[data-theme="dark"] .grok-icon-btn:hover {
    background: #0F172A;
    color: #60A5FA;
}

.grok-send-btn {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    border: none;
    background: linear-gradient(135deg, #2563EB 0%, #1D4ED8 100%);
    color: #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(37,99,235,0.25);
    transition: all 0.2s ease;
}
.grok-send-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(37,99,235,0.35);
}

/* ============================================================ */
/* GROK THINKING PROCESS & MULTI-STEP EXECUTION TREE            */
/* ============================================================ */
.grok-thinking-block {
    background: var(--surface-inset);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 16px 18px;
    margin-bottom: 16px;
    font-family: inherit;
    font-size: 13.5px;
    color: var(--text-secondary);
    line-height: 1.6;
    transition: all 0.25s ease;
}
[data-theme="dark"] .grok-thinking-block {
    background: #0F172A;
    border-color: #334155;
    color: #CBD5E1;
}

.grok-think-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 14px;
}
[data-theme="dark"] .grok-think-header { color: #F8FAFC; }

.grok-tree-steps-wrap {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 12px;
    position: relative;
    padding-left: 4px;
}

.grok-tree-step {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    position: relative;
    animation: grokStepFadeIn 0.3s ease forwards;
}
@keyframes grokStepFadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

.grok-step-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-size: 13px;
    flex-shrink: 0;
    background: var(--surface-inset);
    z-index: 2;
}
[data-theme="dark"] .grok-step-icon {
    background: #0F172A;
    color: #94A3B8;
}

.grok-step-text {
    flex: 1;
    font-size: 13px;
    color: var(--text-secondary);
    word-break: break-word;
}
[data-theme="dark"] .grok-step-text { color: #94A3B8; }
.grok-step-text strong { color: var(--text-primary); }
[data-theme="dark"] .grok-step-text strong { color: #F8FAFC; }

.grok-step-text a {
    color: #2563EB;
    font-weight: 600;
    text-decoration: underline;
}

.grok-working-timer {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-top: 4px;
}
.grok-working-timer i {
    color: #2563EB;
    font-size: 13px;
}

.grok-think-pill-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--surface-inset);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 100px;
    cursor: pointer;
    margin-bottom: 12px;
    transition: all 0.2s ease;
}
.grok-think-pill-toggle:hover {
    background: #E2E8F0;
    color: var(--text-primary);
}
[data-theme="dark"] .grok-think-pill-toggle {
    background: #1E293B;
    border-color: #334155;
    color: #94A3B8;
}

.grok-think-harder-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: 100px;
    padding: 6px 14px;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-secondary);
    box-shadow: 0 2px 6px rgba(0,0,0,0.04);
    margin: 12px auto;
}
[data-theme="dark"] .grok-think-harder-pill {
    background: #1E293B;
    border-color: #334155;
    color: #CBD5E1;
}

/* ============================================================ */
/* MASTER MULTI-DEVICE RESPONSIVENESS (MOBILE, TABLET, DESKTOP) */
/* ============================================================ */

/* Tablet & iPad Landscape / Small Laptops (<= 1024px) */
@media (max-width: 1024px) {
    .app-wrapper {
        grid-template-columns: minmax(0, 1fr) !important;
        width: 100% !important;
        position: relative;
    }
    
    .sidebar {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        bottom: 0 !important;
        width: 280px !important;
        height: 100vh !important;
        height: 100dvh !important;
        transform: translateX(-100%) !important;
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
        z-index: 1000 !important;
        box-shadow: 4px 0 30px rgba(0, 0, 0, 0.25) !important;
    }
    .sidebar.open {
        transform: translateX(0) !important;
    }
    
    .sidebar-overlay {
        position: fixed;
        inset: 0;
        background: rgba(15, 23, 42, 0.6);
        backdrop-filter: blur(4px);
        z-index: 999;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s ease;
    }
    .sidebar-overlay.active {
        opacity: 1;
        pointer-events: auto;
    }
    
    .hamburger-btn, #hamburger-btn {
        display: flex !important;
        align-items: center;
        justify-content: center;
    }
    
    .sidebar-collapse-btn {
        display: none !important;
    }

    .main-content {
        width: 100% !important;
        max-width: 100vw !important;
        min-width: 0 !important;
        overflow-x: hidden !important;
        padding-bottom: 120px !important;
        box-sizing: border-box !important;
    }
    
    .topbar {
        padding: 0 16px !important;
        height: 64px !important;
        min-height: 64px !important;
        gap: 8px !important;
        width: 100% !important;
        max-width: 100vw !important;
        box-sizing: border-box !important;
        justify-content: space-between !important;
    }
    
    .section-container.active, .section-container {
        padding: 20px 16px 120px !important;
        box-sizing: border-box !important;
    }
    
    .dash-hero-banner {
        padding: 24px 20px !important;
        grid-template-columns: 1fr !important;
        gap: 16px !important;
        min-height: auto !important;
        box-sizing: border-box !important;
        width: 100% !important;
    }
    .dash-hero-graphic svg, .hero-3d-scene {
        max-height: 120px !important;
        max-width: 220px !important;
        margin: 8px auto 0 !important;
        display: block !important;
    }
    
    .dash-stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 12px !important;
    }
    
    .grok-chat-wrapper {
        padding: 0 4px !important;
    }
    
    .grok-quick-actions-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
    
    .active-tool-workspace {
        gap: 18px !important;
    }
}

/* Mobile Devices & Phablets (<= 768px) */
@media (max-width: 768px) {
    .topbar {
        padding: 0 12px !important;
        height: 60px !important;
        min-height: 60px !important;
    }
    
    .search-bar {
        display: none !important;
    }
    
    .topbar-actions {
        gap: 6px !important;
        flex-shrink: 0 !important;
    }
    
    
    
    .icon-btn, .theme-toggle-btn {
        width: 34px !important;
        height: 34px !important;
        min-width: 34px !important;
        font-size: 14px !important;
    }
    
    .user-mini-info, .mini-chevron {
        display: none !important;
    }
    
    .user-mini {
        padding: 0 !important;
        gap: 0 !important;
    }
    
    .user-avatar-circle {
        width: 32px !important;
        height: 32px !important;
        min-width: 32px !important;
        font-size: 13px !important;
    }
    
    .section-container.active, .section-container {
        padding: 16px 12px 120px !important;
    }
    
    .dash-hero-banner {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 14px !important;
        padding: 20px 16px !important;
    }
    
    .dash-hero-heading {
        font-size: 22px !important;
        margin: 6px 0 6px !important;
    }
    
    .dash-hero-subtext {
        font-size: 13.5px !important;
        margin-bottom: 16px !important;
    }
    
    .dash-hero-btn-group {
        width: 100% !important;
        flex-direction: column !important;
        gap: 8px !important;
    }
    
    .dash-hero-cta, .dash-btn-primary, .dash-btn-secondary {
        width: 100% !important;
        justify-content: center !important;
        text-align: center !important;
        box-sizing: border-box !important;
    }
    
    .stat-grid-exact {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 12px !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }
    .stat-card-exact {
        padding: 16px 14px !important;
        min-height: auto !important;
        box-sizing: border-box !important;
    }
    .stat-card-val {
        font-size: 24px !important;
        margin: 6px 0 2px !important;
    }
    .stat-card-label {
        font-size: 12.5px !important;
        margin-bottom: 8px !important;
    }
    
    .grok-chat-header {
        padding: 12px 14px !important;
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 10px !important;
    }
    
    .grok-header-actions {
        width: 100% !important;
        justify-content: space-between !important;
    }
    
    .grok-welcome-hero {
        padding: 24px 14px 18px !important;
    }
    
    .grok-welcome-title {
        font-size: 22px !important;
    }
    
    .grok-ai-bubble {
        padding: 18px 16px !important;
        font-size: 14px !important;
    }
    
    .grok-msg-actions {
        gap: 6px !important;
    }
    
    .grok-msg-btn {
        font-size: 11px !important;
        padding: 5px 9px !important;
    }
    
    .grok-composer-wrap {
        padding: 8px 0 4px !important;
    }
    
    .grok-composer-card {
        padding: 12px 14px !important;
        border-radius: 16px !important;
    }
    
    .grok-composer-footer {
        flex-wrap: wrap !important;
        gap: 8px !important;
    }
    
    .grok-tool-chips {
        width: 100% !important;
        overflow-x: auto !important;
        padding-bottom: 4px !important;
        scrollbar-width: none !important;
    }
    .grok-tool-chips::-webkit-scrollbar {
        display: none !important;
    }
    
    .grok-composer-actions {
        width: 100% !important;
        justify-content: flex-end !important;
    }
    
    .tool-input-area {
        padding: 18px 16px !important;
    }
    
    .tool-output-wrapper {
        min-height: 320px !important;
    }
    
    .tool-output-header {
        padding: 12px 16px !important;
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 10px !important;
    }
    
    .tool-output-actions {
        width: 100% !important;
        overflow-x: auto !important;
        padding-bottom: 4px !important;
    }
    
    .tool-output-area {
        padding: 18px 16px !important;
        font-size: 14px !important;
    }
    
    .tools-grid {
        grid-template-columns: 1fr !important;
    }
    
    .note-container {
        flex-direction: column !important;
    }
    
    .notes-sidebar {
        width: 100% !important;
        height: auto !important;
        max-height: 200px !important;
    }
    
    .modal-content {
        width: 95vw !important;
        max-width: 95vw !important;
        padding: 22px 16px !important;
        margin: 10px auto !important;
    }
    
    .pricing-grid {
        grid-template-columns: 1fr !important;
    }
}

/* Small Screens & Compact Phones (<= 480px) */
@media (max-width: 480px) {
    .topbar {
        padding: 0 8px !important;
        height: 56px !important;
        min-height: 56px !important;
    }
    
    .topbar-actions {
        gap: 4px !important;
    }
    
    
    
    .icon-btn, .theme-toggle-btn {
        width: 30px !important;
        height: 30px !important;
        min-width: 30px !important;
        font-size: 13px !important;
    }
    
    .user-avatar-circle {
        width: 28px !important;
        height: 28px !important;
        min-width: 28px !important;
        font-size: 12px !important;
    }
    
    .section-container.active, .section-container {
        padding: 12px 8px 120px !important;
    }
    
    .stat-grid-exact {
        grid-template-columns: 1fr !important;
        gap: 10px !important;
    }
    
    .stat-card-exact {
        padding: 16px 14px !important;
        min-height: auto !important;
    }
    
    .dash-hero-graphic svg, .hero-3d-scene {
        max-height: 90px !important;
        max-width: 160px !important;
    }
    
    .dash-stats-grid {
        grid-template-columns: 1fr !important;
        gap: 8px !important;
    }
    
    .dash-stat-card {
        padding: 14px 12px !important;
    }
    
    .dash-stat-num {
        font-size: 20px !important;
    }
    
    .grok-quick-actions-grid {
        grid-template-columns: 1fr !important;
    }
    
    .grok-user-bubble {
        max-width: 90% !important;
        font-size: 13.5px !important;
        padding: 10px 14px !important;
    }
    
    .grok-ai-bubble {
        padding: 14px 12px !important;
        font-size: 13.5px !important;
        border-radius: 14px !important;
    }
    
    .tool-presets-row {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 6px !important;
    }
    
    .tool-presets-pills {
        width: 100% !important;
        overflow-x: auto !important;
        padding-bottom: 4px !important;
    }
    
    #run-tool-btn {
        width: 100% !important;
        justify-content: center !important;
    }
    
    .tool-input-footer {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 8px !important;
    }
}

/* ============================================================ */
/* CLASSROOM & TEACHER HUB STYLES (GOOGLE CLASSROOM REPLICA)    */
/* ============================================================ */

/* Portal Switcher Pill & Dropdown */
.portal-switch-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 14px;
    background: var(--surface-inset);
    border: 1px solid var(--border-color);
    border-radius: 100px;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
}
.portal-switch-pill:hover {
    background: #E2E8F0;
    border-color: #CBD5E1;
}
.portal-switch-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 210px;
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    padding: 6px;
    z-index: 1000;
}
.portal-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: background 0.15s ease;
}
.portal-menu-item:hover {
    background: var(--surface-inset);
}
.portal-menu-item.active {
    background: #EFF6FF;
    color: #2563EB;
}

/* ============================================================ */
/* PREMIUM CLASSROOM HERO BANNER & COMPONENTS                   */
/* ============================================================ */
.classroom-hero-banner {
    min-height: 250px;
    border-radius: 28px;
    background: linear-gradient(135deg, #0F172A 0%, #1E3A8A 50%, #2563EB 100%);
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 36px 44px;
    margin-bottom: 28px;
    display: grid;
    grid-template-columns: 1.3fr 0.9fr;
    gap: 32px;
    align-items: center;
    box-shadow: 0 16px 40px -8px rgba(37,99,235,0.25), 0 2px 10px rgba(0,0,0,0.12);
    position: relative;
    overflow: hidden;
}
.classroom-hero-banner::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(96,165,250,0.25) 0%, rgba(37,99,235,0) 70%);
    pointer-events: none;
}
.classroom-hero-left {
    position: relative;
    z-index: 2;
}
.classroom-hero-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border-radius: 100px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: #93C5FD;
    font-weight: 800;
    font-size: 11.5px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    border: 1px solid rgba(255, 255, 255, 0.25);
    margin-bottom: 12px;
}
.classroom-hero-title {
    font-size: 34px;
    font-weight: 850;
    color: #FFFFFF;
    letter-spacing: -0.025em;
    line-height: 1.2;
    margin: 0 0 10px;
    text-shadow: 0 2px 10px rgba(0,0,0,0.2);
}
.classroom-hero-desc {
    font-size: 14.5px;
    color: #E2E8F0;
    line-height: 1.55;
    margin-bottom: 22px;
    max-width: 520px;
}
.classroom-hero-actions {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}
.classroom-btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 13px 28px;
    border-radius: 14px;
    background: #FFFFFF;
    color: #1E40AF;
    font-weight: 800;
    font-size: 14.5px;
    border: none;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(0,0,0,0.18), 0 2px 6px rgba(0,0,0,0.1);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.classroom-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(255,255,255,0.3);
    background: #F8FAFC;
}
.classroom-btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 13px 22px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(10px);
    color: #FFFFFF;
    font-weight: 700;
    font-size: 14px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    cursor: pointer;
    transition: all 0.2s ease;
}
.classroom-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.22);
    border-color: #FFFFFF;
    transform: translateY(-2px);
}
.classroom-hero-right {
    position: relative;
    z-index: 2;
}
.classroom-hero-badges-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    padding: 20px 22px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.15);
}
.classroom-badge-row {
    display: flex;
    align-items: center;
    gap: 14px;
    color: #FFFFFF;
}
.classroom-badge-row .badge-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}
.classroom-badge-row .badge-icon.icon-blue { background: rgba(59, 130, 246, 0.35); color: #93C5FD; border: 1px solid rgba(147, 197, 253, 0.4); }
.classroom-badge-row .badge-icon.icon-green { background: rgba(16, 185, 129, 0.35); color: #A7F3D0; border: 1px solid rgba(167, 243, 208, 0.4); }
.classroom-badge-row .badge-icon.icon-purple { background: rgba(139, 92, 246, 0.35); color: #DDD6FE; border: 1px solid rgba(221, 214, 254, 0.4); }
.classroom-badge-row strong {
    display: block;
    font-size: 13.5px;
    font-weight: 750;
}
.classroom-badge-row span {
    font-size: 11.5px;
    color: var(--text-secondary);
}

@media (max-width: 900px) {
    .classroom-hero-banner {
        grid-template-columns: minmax(0, 1fr);
        padding: 28px 24px;
        gap: 24px;
    }
}

/* Classroom Cards Grid */
.classroom-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 22px;
    margin-top: 20px;
}
.class-card {
    background: var(--surface);
    border-radius: 18px;
    border: 1px solid var(--border-color);
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0,0,0,0.04);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
}
.class-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px rgba(37,99,235,0.1);
    border-color: #93C5FD;
}
.class-card-header {
    padding: 22px 20px;
    background: linear-gradient(135deg, #1E40AF 0%, #3B82F6 100%);
    color: #FFFFFF;
    position: relative;
}
.class-card-header.bg-emerald { background: linear-gradient(135deg, #065F46 0%, #10B981 100%); }
.class-card-header.bg-purple  { background: linear-gradient(135deg, #5B21B6 0%, #8B5CF6 100%); }
.class-card-header.bg-amber   { background: linear-gradient(135deg, #92400E 0%, #F59E0B 100%); }
.class-card-title {
    font-size: 20px;
    font-weight: 800;
    margin: 0;
    color: #FFFFFF;
}
.class-card-sub {
    font-size: 13px;
    opacity: 0.9;
    margin-top: 4px;
}
.class-card-code-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: rgba(255,255,255,0.22);
    backdrop-filter: blur(8px);
    border-radius: 100px;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.5px;
    margin-top: 10px;
}
.class-card-body {
    padding: 18px 20px;
    flex: 1;
}
.class-card-meta-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 10px;
}
.class-card-footer {
    padding: 14px 20px;
    border-top: 1px solid #F1F5F9;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--surface-inset);
}

/* Empty State */
.classroom-empty-state {
    text-align: center;
    padding: 64px 32px;
    background: var(--surface);
    border-radius: 24px;
    border: 2px dashed #CBD5E1;
    max-width: 640px;
    margin: 40px auto;
    box-shadow: 0 10px 30px rgba(0,0,0,0.03);
}
.classroom-empty-icon {
    width: 80px;
    height: 80px;
    border-radius: 24px;
    background: linear-gradient(135deg, #EFF6FF 0%, #DBEAFE 100%);
    color: #2563EB;
    font-size: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    box-shadow: 0 8px 24px rgba(37,99,235,0.12);
}
.classroom-empty-state h3 {
    font-size: 20px;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0 0 8px;
}
.classroom-empty-state p {
    font-size: 14.5px;
    color: var(--text-secondary);
    line-height: 1.55;
    max-width: 480px;
    margin: 0 auto;
}

/* Class Detail View */
.class-detail-top-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
    flex-wrap: wrap;
    gap: 12px;
}
.btn-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 16px;
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    font-weight: 700;
    font-size: 13.5px;
    color: var(--text-secondary);
    cursor: pointer;
}
.class-code-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: #EFF6FF;
    border: 1.5px solid #BFDBFE;
    border-radius: 100px;
    font-size: 14px;
    color: #1E40AF;
}
.btn-copy-code {
    background: none;
    border: none;
    cursor: pointer;
    color: #2563EB;
    font-size: 14px;
    padding: 2px 4px;
}
.class-hero-card {
    background: linear-gradient(135deg, #1E40AF 0%, #3B82F6 100%);
    border-radius: 24px;
    padding: 36px 32px;
    color: #FFFFFF;
    margin-bottom: 24px;
    box-shadow: 0 10px 30px rgba(37,99,235,0.15);
}
.class-hero-main h1 {
    font-size: 32px;
    font-weight: 800;
    margin: 0;
    color: #FFFFFF;
}
.class-hero-main p {
    font-size: 15px;
    opacity: 0.9;
    margin-top: 6px;
}
.class-hero-teachers {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 16px;
}
.class-teacher-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    background: rgba(255,255,255,0.2);
    border-radius: 100px;
    font-size: 12.5px;
    font-weight: 600;
}

/* Class Navigation Tabs */
.class-nav-tabs {
    display: flex;
    gap: 8px;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 24px;
    overflow-x: auto;
    padding-bottom: 2px;
}
.class-tab-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    border: none;
    background: none;
    font-size: 14.5px;
    font-weight: 700;
    color: var(--text-secondary);
    border-bottom: 3px solid transparent;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
}
.class-tab-btn:hover {
    color: #2563EB;
}
.class-tab-btn.active {
    color: #2563EB;
    border-bottom-color: #2563EB;
}

/* Stream Layout */
.stream-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 24px;
}
@media (max-width: 900px) {
    .stream-layout { grid-template-columns: minmax(0, 1fr); }
}
.stream-upcoming-card {
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 20px;
}
.stream-upcoming-card h4 {
    margin: 0 0 12px;
    font-size: 15px;
    font-weight: 800;
    color: var(--text-primary);
}
.stream-feed-col {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.stream-item-card {
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: 18px;
    padding: 20px 24px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.02);
}
.stream-item-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}
.stream-item-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #EFF6FF;
    color: #2563EB;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 15px;
}
.stream-item-meta h4 {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
}
.stream-item-meta span {
    font-size: 12px;
    color: var(--text-secondary);
}
.stream-priority-tag {
    margin-left: auto;
    padding: 4px 10px;
    border-radius: 100px;
    font-size: 11.5px;
    font-weight: 800;
}
.stream-priority-tag.urgent { background: #FEE2E2; color: #DC2626; }
.stream-priority-tag.important { background: #FEF3C7; color: #D97706; }
.stream-priority-tag.normal { background: #EFF6FF; color: #2563EB; }

/* Homework & Worksheets cards */
.homework-cards-list, .teacher-hw-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.hw-card, .ws-card, .note-card {
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: 18px;
    padding: 22px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    transition: all 0.2s ease;
}
.hw-card:hover, .ws-card:hover, .note-card:hover {
    border-color: #93C5FD;
    box-shadow: 0 6px 20px rgba(37,99,235,0.06);
}
.hw-due-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12.5px;
    font-weight: 700;
    color: #D97706;
    background: #FEF3C7;
    padding: 4px 10px;
    border-radius: 100px;
}
.status-pill-graded { background: #D1FAE5; color: #059669; padding: 4px 10px; border-radius: 100px; font-weight: 800; font-size: 12px; }
/* Marked by the machine, not yet confirmed by the teacher. Deliberately not
   the graded green: it is not a final score. */
.status-pill-pending { background: #FEF3C7; color: #B45309; padding: 4px 10px; border-radius: 100px; font-weight: 800; font-size: 12px; }
.status-pill-submitted { background: #EFF6FF; color: #2563EB; padding: 4px 10px; border-radius: 100px; font-weight: 800; font-size: 12px; }
.status-pill-assigned { background: var(--surface-inset); color: var(--text-secondary); padding: 4px 10px; border-radius: 100px; font-weight: 800; font-size: 12px; }

/* People List */
.people-list {
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    overflow: hidden;
}
.person-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    border-bottom: 1px solid #F1F5F9;
}
.person-row:last-child { border-bottom: none; }
.person-info {
    display: flex;
    align-items: center;
    gap: 12px;
}
.person-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #EFF6FF;
    color: #2563EB;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 14px;
}
.person-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}
.btn-action-remove {
    padding: 6px 12px;
    background: #FEF2F2;
    color: #DC2626;
    border: 1px solid #FECACA;
    border-radius: 8px;
    font-size: 12.5px;
    font-weight: 700;
    cursor: pointer;
}
.btn-action-block {
    padding: 6px 12px;
    background: #475569;
    color: #FFFFFF;
    border: none;
    border-radius: 8px;
    font-size: 12.5px;
    font-weight: 700;
    cursor: pointer;
}

/* ============================================================ */
/* TEACHER HUB PORTAL STYLING (ULTRA-PREMIUM STUDYHUB FACULTY) */
/* ============================================================ */
.teacher-portal-wrapper {
    width: 100%;
    max-width: 100vw;
    height: 100vh;
    height: 100dvh;
    max-height: 100vh;
    max-height: 100dvh;
    overflow-x: hidden;
    overflow-y: hidden;
    background: var(--surface-inset);
    color: var(--text-primary);
    display: flex;
    flex-direction: column;
    font-family: 'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    position: relative;
    box-sizing: border-box;
}

/* Header */
.teacher-header {
    height: 72px;
    min-height: 72px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(226, 232, 240, 0.8);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    position: relative;
    z-index: 100;
    box-shadow: 0 2px 14px rgba(0, 0, 0, 0.03);
    flex-shrink: 0;
}
.teacher-header-left {
    display: flex;
    align-items: center;
    gap: 20px;
}
.teacher-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 20px;
    font-weight: 850;
    color: var(--text-primary);
    cursor: pointer;
    text-decoration: none;
    letter-spacing: -0.02em;
}
.teacher-logo-box {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    background: linear-gradient(135deg, #059669 0%, #10B981 100%);
    color: #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
}
.teacher-role-badge {
    padding: 4px 10px;
    background: #ECFDF5;
    color: #059669;
    border: 1px solid #A7F3D0;
    border-radius: 100px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.teacher-class-select {
    padding: 9px 18px;
    border-radius: 12px;
    border: 1.5px solid #CBD5E1;
    background: var(--surface);
    font-size: 13.5px;
    font-weight: 700;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.teacher-class-select:focus {
    border-color: #059669;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
    outline: none;
}
.teacher-header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}
.teacher-icon-btn {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: var(--surface-inset);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
}
.teacher-icon-btn:hover {
    background: #E2E8F0;
    color: #059669;
}
.teacher-badge-dot {
    position: absolute;
    top: -3px;
    right: -3px;
    background: #EF4444;
    color: #FFFFFF;
    font-size: 10px;
    font-weight: 800;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #FFFFFF;
}
.teacher-user-pill {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 16px 6px 8px;
    background: var(--surface-inset);
    border: 1px solid var(--border-color);
    border-radius: 100px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.03);
}
.teacher-avatar-initial {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, #059669 0%, #10B981 100%);
    color: #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 14px;
    box-shadow: 0 2px 8px rgba(16,185,129,0.25);
}
.teacher-user-name {
    font-size: 13.5px;
    font-weight: 750;
    color: var(--text-primary);
    line-height: 1.2;
}
.teacher-user-lvl {
    font-size: 11px;
    color: #059669;
    font-weight: 700;
    display: block;
}

/* Layout */
.teacher-layout-body {
    display: flex;
    flex: 1;
    height: calc(100vh - 72px);
    height: calc(100dvh - 72px);
    overflow: hidden;
    position: relative;
}
.teacher-sidebar {
    width: 275px;
    height: 100%;
    background: var(--surface);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 24px 16px;
    flex-shrink: 0;
    overflow-y: auto;
}
.teacher-nav-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.teacher-nav-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 18px;
    border-radius: 14px;
    font-size: 14px;
    font-weight: 700;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.teacher-nav-item:hover {
    background: var(--surface-inset);
    color: var(--text-primary);
    transform: translateX(3px);
}
.teacher-nav-item i {
    font-size: 17px;
    width: 20px;
    text-align: center;
    color: var(--text-secondary);
    transition: color 0.15s ease;
}
.teacher-nav-item.active {
    background: linear-gradient(135deg, #059669 0%, #047857 100%) !important;
    color: #FFFFFF !important;
    box-shadow: 0 6px 18px rgba(5, 150, 105, 0.28);
}
.teacher-nav-item.active i, .teacher-nav-item.active span {
    color: #FFFFFF !important;
}
.teacher-quick-actions-box {
    background: var(--surface-inset);
    border: 1px solid var(--border-color);
    border-radius: 18px;
    padding: 14px;
    margin-bottom: 12px;
}
.teacher-sidebar-btn {
    width: 100%;
    padding: 12px;
    border-radius: 12px;
    border: none;
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    color: #FFFFFF;
    font-size: 13.5px;
    font-weight: 800;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 14px rgba(5, 150, 105, 0.25);
    transition: all 0.2s ease;
}
.teacher-sidebar-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(5, 150, 105, 0.35);
}
.teacher-sidebar-btn.btn-secondary {
    background: var(--surface);
    color: var(--text-primary);
    border: 1.5px solid #CBD5E1;
    box-shadow: none;
}
.teacher-sidebar-btn.btn-secondary:hover {
    background: var(--surface-inset);
    border-color: #94A3B8;
}
.teacher-switch-link {
    margin-top: 6px;
    font-size: 13.5px;
    font-weight: 750;
    color: #EF4444;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 12px;
    transition: all 0.15s ease;
}
.teacher-switch-link:hover {
    background: rgba(239, 68, 68, 0.08);
}

/* Teacher Main Content */
.teacher-main-content {
    flex: 1;
    height: 100%;
    min-height: 0;
    padding: 32px 40px 60px 40px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
}

/* Teacher Hero Banner */
.teacher-hero-banner {
    background: linear-gradient(135deg, #064E3B 0%, #065F46 45%, #047857 80%, #0284C7 100%);
    border-radius: 28px;
    padding: 36px 44px;
    color: #FFFFFF;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 24px;
    box-shadow: 0 16px 40px -10px rgba(5, 150, 105, 0.3);
    position: relative;
    overflow: hidden;
}
.teacher-hero-banner::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(52, 211, 153, 0.25) 0%, rgba(5, 150, 105, 0) 70%);
    pointer-events: none;
}
.teacher-hero-banner .dash-hero-badge {
    background: rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.28);
    color: #A7F3D0;
    padding: 6px 14px;
    border-radius: 100px;
    font-size: 11.5px;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}
.teacher-hero-title {
    font-size: 34px;
    font-weight: 900;
    letter-spacing: -0.035em;
    background: linear-gradient(135deg, #FFFFFF 0%, #F1F5F9 50%, #A7F3D0 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin: 0;
    line-height: 1.18;
}
.teacher-hero-sub {
    font-size: 15px;
    color: #E2E8F0;
    line-height: 1.55;
    margin-top: 8px;
    max-width: 580px;
    font-weight: 500;
}

/* Teacher Tab Pane Header System */
.pane-header-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 24px;
    padding-bottom: 18px;
    border-bottom: 1.5px solid var(--border-color);
    flex-wrap: wrap;
    gap: 16px;
}
.teacher-pane-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.12) 0%, rgba(5, 150, 105, 0.06) 100%);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: 100px;
    font-size: 11px;
    font-weight: 850;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #059669;
    margin-bottom: 6px;
}
.teacher-pane-title {
    font-size: 26px;
    font-weight: 850;
    letter-spacing: -0.03em;
    color: var(--text-primary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 12px;
    line-height: 1.25;
}
.teacher-pane-title i {
    color: #059669;
    font-size: 22px;
}
.teacher-pane-sub {
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 4px;
    line-height: 1.5;
    font-weight: 500;
}
.teacher-hero-actions {
    display: flex;
    gap: 12px;
    position: relative;
    z-index: 2;
}
.teacher-hero-actions .btn-primary {
    background: #FFFFFF;
    color: #065F46;
    font-weight: 800;
    padding: 13px 24px;
    border-radius: 14px;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 18px rgba(0,0,0,0.15);
    transition: all 0.2s ease;
}
.teacher-hero-actions .btn-primary:hover {
    transform: translateY(-2px);
    background: #F8FAFC;
    box-shadow: 0 8px 25px rgba(255,255,255,0.25);
}
.teacher-hero-actions .btn-secondary {
    background: rgba(255,255,255,0.14);
    backdrop-filter: blur(10px);
    color: #FFFFFF;
    border: 1px solid rgba(255,255,255,0.25);
    font-weight: 750;
    padding: 13px 20px;
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}
.teacher-hero-actions .btn-secondary:hover {
    background: rgba(255,255,255,0.22);
    border-color: #FFFFFF;
    transform: translateY(-2px);
}

/* Stats Row */
.teacher-stats-row {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px;
    margin-top: 28px;
}
@media (max-width: 1080px) {
    .teacher-stats-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
    .teacher-stats-row { grid-template-columns: minmax(0, 1fr); }
}
.teacher-stat-card {
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: 22px;
    padding: 24px;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.02);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.teacher-stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
    border-color: #CBD5E1;
}
.teacher-stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    margin-bottom: 14px;
}
.teacher-stat-icon.icon-blue   { background: #EFF6FF; color: #2563EB; border: 1px solid #DBEAFE; }
.teacher-stat-icon.icon-green  { background: #ECFDF5; color: #059669; border: 1px solid #A7F3D0; }
.teacher-stat-icon.icon-orange { background: #FFFBEB; color: #D97706; border: 1px solid #FDE68A; }
.teacher-stat-icon.icon-purple { background: #F5F3FF; color: #7C3AED; border: 1px solid #DDD6FE; }
.teacher-stat-val {
    font-size: 32px;
    font-weight: 850;
    color: var(--text-primary);
    letter-spacing: -0.03em;
    line-height: 1.1;
}
.teacher-stat-label {
    font-size: 13.5px;
    color: var(--text-secondary);
    font-weight: 700;
    margin-top: 4px;
}

/* Teacher Class Grid */
.teacher-classes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 22px;
    margin-top: 20px;
}

/* Card Forms */
.teacher-card-form {
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: 22px;
    padding: 28px 32px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.03);
}
.teacher-card-form h3 {
    font-size: 18px;
    font-weight: 800;
    color: var(--text-primary);
}
.teacher-card-form label {
    font-size: 13px;
    font-weight: 750;
    color: var(--text-secondary);
    margin-bottom: 6px;
    display: block;
}
.teacher-card-form .form-control {
    width: 100%;
    padding: 12px 16px;
    border-radius: 12px;
    border: 1.5px solid var(--border-color);
    background: var(--surface-inset);
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text-primary);
    transition: all 0.2s ease;
}
.teacher-card-form .form-control:focus {
    border-color: #059669;
    background: var(--surface);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
    outline: none;
}
.form-row-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
.form-row-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.form-row-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 850px) {
    .form-row-2, .form-row-3, .form-row-4 { grid-template-columns: minmax(0, 1fr); }
    .teacher-main-content { padding: 20px 16px; }
}

/* Worksheet Questions Live Editor */
.ws-questions-editor-list {
    display: flex;
    flex-direction: column;
    gap: 18px;
    margin-top: 18px;
}
.ws-q-edit-card {
    background: var(--surface);
    border: 1.5px solid var(--border-color);
    border-radius: 18px;
    padding: 20px 24px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.02);
    transition: all 0.2s ease;
}
.ws-q-edit-card:hover {
    border-color: #CBD5E1;
    box-shadow: 0 6px 18px rgba(0,0,0,0.04);
}
.ws-q-edit-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.ws-q-badge {
    padding: 4px 12px;
    background: linear-gradient(135deg, #059669 0%, #10B981 100%);
    color: #FFFFFF;
    border-radius: 100px;
    font-size: 12px;
    font-weight: 800;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.25);
}

/* Homework List & Cards */
.teacher-hw-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.teacher-hw-card {
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 22px 26px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.02);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    transition: all 0.2s ease;
}
.teacher-hw-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.05);
    border-color: #CBD5E1;
}

/* People & Roster Table */
.teacher-people-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 16px;
    background: var(--surface);
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0,0,0,0.02);
    border: 1px solid var(--border-color);
}
.teacher-people-table th {
    background: var(--surface-inset);
    padding: 14px 20px;
    text-align: left;
    font-size: 12.5px;
    font-weight: 800;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 1px solid var(--border-color);
}
.teacher-people-table td {
    padding: 16px 20px;
    border-bottom: 1px solid #F1F5F9;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text-primary);
}
.teacher-people-table tr:hover td {
    background: var(--surface-inset);
}

/* ============================================================ */
/* ULTRA-RESPONSIVE SYSTEM ACROSS ALL DEVICES (MOBILE/TABLET/DESKTOP) */
/* ============================================================ */
.teacher-mobile-menu-btn {
    display: none;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: var(--surface-inset);
    border: 1px solid #CBD5E1;
    color: var(--text-primary);
    font-size: 18px;
    cursor: pointer;
    transition: all 0.2s ease;
}
.teacher-mobile-menu-btn:hover {
    background: #E2E8F0;
    color: #059669;
}

.teacher-sidebar-backdrop {
    display: none;
}

@media (max-width: 992px) {
    .teacher-mobile-menu-btn {
        display: flex;
    }
    .teacher-header {
        padding: 0 14px !important;
        height: 60px !important;
        min-height: 60px !important;
        justify-content: space-between !important;
        box-sizing: border-box !important;
        width: 100% !important;
        max-width: 100vw !important;
        overflow: hidden !important;
    }
    .teacher-class-selector-wrap {
        display: none !important;
    }
    .teacher-role-badge {
        display: none !important;
    }
    .teacher-user-meta {
        display: none !important;
    }
    .teacher-user-pill {
        padding: 0 !important;
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
        gap: 0 !important;
    }
    .teacher-header-right {
        gap: 8px !important;
        flex-shrink: 0 !important;
        display: flex !important;
        align-items: center !important;
    }
    .teacher-layout-body {
        height: calc(100vh - 60px) !important;
        height: calc(100dvh - 60px) !important;
    }
    .teacher-sidebar-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        top: 60px;
        background: rgba(15, 23, 42, 0.45);
        backdrop-filter: blur(4px);
        -webkit-backdrop-filter: blur(4px);
        z-index: 150;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    }
    .teacher-sidebar-backdrop.active {
        opacity: 1;
        pointer-events: auto;
    }
    .teacher-sidebar {
        position: fixed;
        left: -290px;
        top: 60px;
        bottom: 0;
        z-index: 160;
        transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
        box-shadow: 10px 0 30px rgba(0, 0, 0, 0.15);
    }
    .teacher-sidebar.open {
        transform: translateX(290px);
    }
    .teacher-main-content {
        padding: 16px 14px 100px 14px !important;
        width: 100% !important;
        max-width: 100vw !important;
        box-sizing: border-box !important;
    }
    .teacher-hero-banner {
        padding: 20px 16px !important;
        border-radius: 18px !important;
        flex-direction: column !important;
        align-items: flex-start !important;
        box-sizing: border-box !important;
        width: 100% !important;
    }
    .teacher-hero-title {
        font-size: 22px !important;
        line-height: 1.25 !important;
    }
    .teacher-hero-sub {
        font-size: 13px !important;
        margin-bottom: 16px !important;
        line-height: 1.45 !important;
    }
    .teacher-hero-actions {
        width: 100% !important;
        flex-direction: column !important;
        gap: 8px !important;
    }
    .teacher-hero-actions .btn {
        width: 100% !important;
        justify-content: center !important;
        text-align: center !important;
        height: 42px !important;
        box-sizing: border-box !important;
    }
    .teacher-stats-row {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 10px !important;
        box-sizing: border-box !important;
        width: 100% !important;
    }
    .teacher-stat-card {
        padding: 14px 12px !important;
        min-height: auto !important;
        box-sizing: border-box !important;
    }
    .teacher-stat-icon {
        width: 36px !important;
        height: 36px !important;
        min-width: 36px !important;
        font-size: 15px !important;
        border-radius: 10px !important;
    }
    .teacher-stat-val {
        font-size: 22px !important;
        margin: 4px 0 2px !important;
    }
    .teacher-stat-label {
        font-size: 11.5px !important;
    }
    .teacher-classes-grid {
        grid-template-columns: 1fr !important;
    }
    .teacher-card-form {
        padding: 18px 14px !important;
        border-radius: 16px !important;
    }
}

@media (max-width: 640px) {
    .teacher-header {
        padding: 0 10px !important;
        height: 56px !important;
        min-height: 56px !important;
    }
    .teacher-layout-body {
        height: calc(100vh - 56px) !important;
        height: calc(100dvh - 56px) !important;
    }
    .teacher-sidebar-backdrop {
        top: 56px !important;
    }
    .teacher-sidebar {
        top: 56px !important;
    }
    .teacher-header-left {
        gap: 8px !important;
    }
    .teacher-logo {
        gap: 6px !important;
        font-size: 15px !important;
    }
    .teacher-logo-box {
        width: 30px !important;
        height: 30px !important;
        min-width: 30px !important;
        font-size: 14px !important;
        border-radius: 8px !important;
    }
    .portal-switch-pill {
        padding: 5px 8px !important;
        font-size: 11px !important;
    }
    .portal-switch-pill span {
        display: none !important;
    }
    .teacher-icon-btn {
        width: 32px !important;
        height: 32px !important;
        min-width: 32px !important;
        font-size: 14px !important;
    }
    .teacher-avatar-initial {
        width: 30px !important;
        height: 30px !important;
        min-width: 30px !important;
        font-size: 12px !important;
    }
    .teacher-main-content {
        padding: 14px 10px 100px 10px !important;
    }
    .teacher-hero-banner {
        padding: 16px 14px !important;
    }
    .teacher-hero-title {
        font-size: 19px !important;
    }
    .teacher-stats-row {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 8px !important;
    }
    .pane-header-row {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 10px !important;
    }
    .pane-header-row h2,
    .teacher-pane-title {
        font-size: 19px !important;
    }
    .teacher-stat-card {
        padding: 12px 10px !important;
    }
    .teacher-stat-val {
        font-size: 20px !important;
    }
    .teacher-stat-label {
        font-size: 11px !important;
    }
}




/* ============================================================
   RESPONSIVE + PERFORMANCE POLISH LAYER
   Loaded last on purpose so it can safely patch edge cases
   across every breakpoint without touching existing rules.
   ============================================================ */

/* ---- 1. Global fluid foundations ---- */
html {
    -webkit-tap-highlight-color: transparent;
}

body {
    overscroll-behavior-y: none;
    /* Fluid base size: never smaller than 14px, never larger than 15px,
       scales gently with viewport so text breathes on big screens
       without feeling oversized on phones. */
    font-size: clamp(13.5px, 0.95vw + 11px, 15px);
}

img, video, canvas, svg {
    max-width: 100%;
    height: auto;
}

/* Respect users who've asked the OS to reduce motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }
}

/* Only apply hover-triggered effects on devices that truly support hover,
   so tapping on touchscreens doesn't get "stuck" hover states. */
@media (hover: none) {
    .nav-item:hover::after { opacity: 0; }
    .nav-item:hover { transform: none; }
}

/* Thin, theme-aware scrollbars for a more native app feel (WebKit) */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 8px;
}
::-webkit-scrollbar-thumb:hover { background: var(--text-secondary); }

/* ---- 2. iOS Safari safe-area support (notch / home-indicator) ---- */
.topbar {
    padding-top: calc(18px + env(safe-area-inset-top));
}
.sidebar {
    padding-top: calc(24px + env(safe-area-inset-top));
    padding-left: calc(16px + env(safe-area-inset-left));
}
.auth-overlay, .modal-overlay {
    padding-top: calc(20px + env(safe-area-inset-top));
    padding-bottom: calc(20px + env(safe-area-inset-bottom));
}

/* ---- 3. Prevent iOS auto-zoom on form focus (inputs need >=16px) ---- */
@media (max-width: 768px) {
    input, select, textarea, button {
        font-size: 16px;
    }
    .form-group input, .form-group select, .form-group textarea {
        font-size: 16px;
    }
}

/* ---- 4. Touch target sizing — every tappable control gets a real hitbox ---- */
@media (max-width: 900px) {
    .icon-btn, .modal-x-btn, .auth-close-btn, .toggle-pw,
    .land-hamburger, #hamburger-btn,
    .devhub-mobile-menu-btn, .teacher-mobile-menu-btn {
        min-width: 44px;
        min-height: 44px;
    }
    .nav-item, .quick-tool-item {
        min-height: 44px;
    }
    button, .btn {
        min-height: 44px;
    }
}

/* ---- 5. Universal safety net: any grid using auto-fit already reflows;
   for grids still pinned to a fixed column count, collapse gracefully. ---- */
@media (max-width: 1024px) {
    .features-grid, .steps-grid, .tools-grid, .stat-grid, .ql-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
}

@media (max-width: 560px) {
    .features-grid, .steps-grid, .tools-grid, .stat-grid, .ql-grid {
        grid-template-columns: 1fr !important;
    }
}

/* ---- 6. Extra-small phones (older/small Androids, iPhone SE) ---- */
@media (max-width: 380px) {
    .auth-container {
        padding: 32px 20px 28px;
    }
    .section-header h2, .tool-header h2 {
        font-size: 19px !important;
    }
    .topbar {
        padding-left: 14px !important;
        padding-right: 14px !important;
    }
    .btn, button {
        font-size: 13.5px;
    }
}

/* ---- 7. Short / landscape phones — height is the scarce resource here ---- */
@media (max-height: 480px) and (orientation: landscape) {
    .auth-container {
        max-height: 92vh;
        max-height: 92dvh;
        overflow-y: auto;
        padding-top: 24px;
        padding-bottom: 20px;
    }
    .sidebar {
        padding-top: 12px;
    }
    .logo {
        margin-bottom: 16px;
    }
}

/* ---- 8. Modals: full-bleed, keyboard-safe sheets on small screens ---- */
@media (max-width: 640px) {
    .modal-overlay {
        padding: 0;
        align-items: flex-end;
    }
    .modal-content {
        max-width: 100% !important;
        width: 100% !important;
        border-radius: 20px 20px 0 0 !important;
        max-height: 92vh !important;
        max-height: 92dvh !important;
    }
}

/* ---- 9. Wide-screen comfort cap — keep line lengths and dashboards
   from stretching awkwardly on ultra-wide monitors ---- */
@media (min-width: 1600px) {
    .main-content > .section-container {
        max-width: 1440px;
        margin: 0 auto;
    }
}

/* ============================================================
   NEW FEATURES: Flashcards, Quiz Generator, Badges, Streak Freeze
   ============================================================ */

/* ---- Streak freeze button (dashboard stat card) ---- */
.streak-freeze-btn {
    margin-top: 10px;
    width: 100%;
    background: linear-gradient(135deg, #38BDF8, #2563EB);
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 8px 10px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: transform 0.15s, box-shadow 0.15s;
}
.streak-freeze-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(37,99,235,0.3); }
.streak-freeze-btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

/* ---- Achievement badges grid ---- */
.badge-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 14px;
}
.badge-tile {
    position: relative;
    background: var(--bg-color);
    border: 1.5px solid var(--border-color);
    border-radius: 16px;
    padding: 18px 14px;
    text-align: center;
    transition: transform 0.2s, box-shadow 0.2s;
}
.badge-tile.badge-earned {
    background: linear-gradient(135deg, rgba(37,99,235,0.06), rgba(139,92,246,0.05));
    border-color: rgba(37,99,235,0.35);
}
.badge-tile.badge-earned:hover { transform: translateY(-3px); box-shadow: 0 8px 20px rgba(37,99,235,0.12); }
.badge-tile.badge-locked { opacity: 0.55; filter: grayscale(0.6); }
.badge-icon {
    width: 46px; height: 46px;
    margin: 0 auto 10px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 19px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: #fff;
}
.badge-tile.badge-locked .badge-icon { background: var(--border-color); color: var(--text-secondary); }
.badge-label { font-weight: 800; font-size: 13px; color: var(--text-primary); margin-bottom: 4px; }
.badge-desc { font-size: 11px; color: var(--text-secondary); line-height: 1.4; }
.badge-check { position: absolute; top: 10px; right: 10px; color: var(--success-color); font-size: 14px; }
.badge-check-locked { color: var(--text-secondary); opacity: 0.5; }

/* ---- Flashcard deck grid ---- */
.fc-due-badge {
    width: 46px; height: 46px;
    border-radius: 14px;
    background: linear-gradient(135deg, #F59E0B, #F97316);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}
.fc-deck-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}
.fc-deck-card {
    background: var(--card-bg);
    border: 1.5px solid var(--border-color);
    border-radius: 16px;
    padding: 18px;
    transition: transform 0.2s, box-shadow 0.2s;
}
.fc-deck-card:hover { transform: translateY(-3px); box-shadow: 0 8px 20px rgba(20,41,91,0.08); }
.fc-deck-card-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.fc-deck-icon {
    width: 38px; height: 38px; border-radius: 10px;
    background: rgba(37,99,235,0.1); color: var(--accent-primary);
    display: flex; align-items: center; justify-content: center;
}
.fc-deck-due-badge {
    background: rgba(245,158,11,0.12); color: var(--warning-color);
    font-size: 11px; font-weight: 800; padding: 3px 9px; border-radius: 100px;
}
.fc-deck-card h4 { font-size: 15px; font-weight: 800; color: var(--text-primary); margin-bottom: 4px; }
.fc-deck-card p { font-size: 12.5px; color: var(--text-secondary); margin-bottom: 14px; }
.fc-deck-card-actions { display: flex; gap: 8px; }
.fc-deck-card-actions .fc-study-deck-btn { flex-grow: 1; }

/* ---- Flashcard review session overlay ---- */
.fc-review-overlay {
    position: fixed; inset: 0; z-index: 9998;
    background: rgba(15, 23, 42, 0.72);
    backdrop-filter: blur(8px);
    display: flex; align-items: center; justify-content: center;
    padding: 20px;
}
.fc-review-box {
    width: 100%; max-width: 560px;
    display: flex; flex-direction: column; gap: 20px;
}
.fc-review-top { display: flex; align-items: center; justify-content: space-between; }
.fc-review-top .icon-btn { background: rgba(255,255,255,0.1); color: #fff; }
.fc-review-progress { color: #fff; font-weight: 700; font-size: 14px; }

.fc-flip-wrap { perspective: 1400px; }
.fc-flip-card {
    position: relative;
    width: 100%;
    min-height: 260px;
    cursor: pointer;
    transform-style: preserve-3d;
    transition: transform 0.5s cubic-bezier(0.4,0.2,0.2,1);
}
.fc-flip-card.flipped { transform: rotateY(180deg); }
.fc-flip-face {
    position: absolute; inset: 0;
    backface-visibility: hidden;
    border-radius: 20px;
    padding: 32px;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    text-align: center;
    box-shadow: 0 20px 50px rgba(0,0,0,0.3);
}
.fc-flip-front { background: linear-gradient(135deg, #FFFFFF, #F1F5F9); }
.fc-flip-back { background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary)); color: #fff; transform: rotateY(180deg); }
.fc-flip-label { font-size: 11px; font-weight: 800; letter-spacing: 1.5px; opacity: 0.6; margin-bottom: 14px; }
.fc-flip-front p { font-size: 19px; font-weight: 700; color: var(--text-primary); line-height: 1.5; }
.fc-flip-back p { font-size: 17px; font-weight: 600; line-height: 1.5; }
.fc-flip-hint { position: absolute; bottom: 18px; font-size: 11.5px; color: var(--text-secondary); }

.fc-grade-row { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.fc-grade-prompt { color: #fff; font-size: 13px; font-weight: 600; opacity: 0.85; }
.fc-grade-btns { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.fc-grade-btn {
    padding: 12px 20px; border-radius: 12px; border: none;
    font-weight: 800; font-size: 13.5px; cursor: pointer;
    min-height: 44px; min-width: 80px;
    transition: transform 0.15s, box-shadow 0.15s;
}
.fc-grade-btn:hover { transform: translateY(-2px); }
.fc-grade-again { background: #FEE2E2; color: #DC2626; }
.fc-grade-hard { background: #FEF3C7; color: #D97706; }
.fc-grade-good { background: #DBEAFE; color: #2563EB; }
.fc-grade-easy { background: #D1FAE5; color: #059669; }

/* ---- AI Quiz Generator ---- */
.qz-progress-track {
    width: 200px; height: 8px; border-radius: 100px;
    background: var(--border-color); overflow: hidden;
}
.qz-progress-fill {
    height: 100%; border-radius: 100px;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
    transition: width 0.35s ease;
}
.qz-options { display: flex; flex-direction: column; gap: 10px; }
.qz-option-btn {
    display: flex; align-items: center; gap: 12px;
    padding: 14px 16px; text-align: left;
    border-radius: 12px; border: 1.5px solid var(--border-color);
    background: var(--bg-color); color: var(--text-primary);
    font-size: 14.5px; font-weight: 600; cursor: pointer;
    min-height: 48px;
    transition: border-color 0.15s, background 0.15s, transform 0.1s;
}
.qz-option-btn:hover:not(:disabled) { border-color: var(--accent-primary); transform: translateX(2px); }
.qz-option-btn:disabled { cursor: default; }
.qz-option-letter {
    width: 26px; height: 26px; border-radius: 50%; flex-shrink: 0;
    background: var(--border-color); color: var(--text-secondary);
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; font-weight: 800;
}
.qz-option-correct { background: rgba(16,185,129,0.1) !important; border-color: var(--success-color) !important; }
.qz-option-correct .qz-option-letter { background: var(--success-color); color: #fff; }
.qz-option-wrong { background: rgba(239,68,68,0.1) !important; border-color: var(--danger-color) !important; }
.qz-option-wrong .qz-option-letter { background: var(--danger-color); color: #fff; }

/* Chosen, not yet marked: the quiz is graded on the server when the student
   finishes, so during the quiz an option can only show that it is selected. */
.qz-option-selected { background: rgba(59,130,246,0.10) !important; border-color: var(--primary-color, #2850e8) !important; }
.qz-option-selected .qz-option-letter { background: var(--primary-color, #2850e8); color: #fff; }

#qz-feedback.qz-feedback-correct { background: rgba(16,185,129,0.1); color: #047857; border: 1px solid rgba(16,185,129,0.3); }
#qz-feedback.qz-feedback-wrong { background: rgba(239,68,68,0.08); color: #B91C1C; border: 1px solid rgba(239,68,68,0.25); }
#qz-feedback.qz-feedback-selected { background: rgba(59,130,246,0.08); color: var(--text-secondary); border: 1px solid rgba(59,130,246,0.22); }

.qz-score-ring {
    width: 120px; height: 120px; border-radius: 50%;
    margin: 0 auto;
    display: flex; align-items: center; justify-content: center;
    font-size: 22px; font-weight: 900; color: var(--text-primary);
    background: conic-gradient(var(--accent-primary) var(--qz-pct, 0%), var(--border-color) 0);
    position: relative;
}
.qz-score-ring::before {
    content: '';
    position: absolute; inset: 8px;
    border-radius: 50%;
    background: var(--card-bg);
}
.qz-score-ring span { position: relative; z-index: 1; }
.qz-ring-great { background: conic-gradient(var(--success-color) var(--qz-pct, 0%), var(--border-color) 0); }
.qz-ring-good { background: conic-gradient(var(--accent-primary) var(--qz-pct, 0%), var(--border-color) 0); }
.qz-ring-keep-going { background: conic-gradient(var(--warning-color) var(--qz-pct, 0%), var(--border-color) 0); }

.qz-review-item { padding: 16px 18px; margin-bottom: 10px; }
.qz-review-correct { border-left: 3px solid var(--success-color); }
.qz-review-wrong { border-left: 3px solid var(--danger-color); }

/* ---- Voice input active state ---- */
.grok-voice-active { color: #EF4444 !important; background: rgba(239,68,68,0.1) !important; }

/* ---- Responsive tweaks for new components ---- */
@media (max-width: 640px) {
    .fc-flip-card { min-height: 220px; }
    .fc-flip-front p { font-size: 16px; }
    .fc-grade-btn { min-width: 70px; padding: 10px 14px; font-size: 12.5px; }
    .qz-progress-track { width: 120px; }
    .badge-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
}

/* ============================================================
   NEW FEATURES ROUND 2: Weakness Radar, Study Roadmap, Diff Tests
   ============================================================ */

/* ---- Weakness Radar (dashboard card) ---- */
.weakness-radar-card { padding: 24px 28px; margin-bottom: 24px; }
.wr-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.wr-header h3 { font-weight: 800; font-size: 16px; color: var(--text-primary); margin-bottom: 4px; }
.wr-header p { font-size: 13px; color: var(--text-secondary); }
.wr-body { display: flex; justify-content: center; }

/* ---- Study Roadmap timeline ---- */
.rm-timeline { display: flex; flex-direction: column; gap: 4px; }
.rm-day-row { display: flex; gap: 14px; padding: 12px 4px; }
.rm-day-marker {
    width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 13px;
    position: relative;
}
.rm-day-row:not(:last-child) .rm-day-marker::after {
    content: '';
    position: absolute; top: 34px; left: 50%; transform: translateX(-50%);
    width: 2px; height: calc(100% + 12px);
    background: var(--border-color);
    z-index: -1;
}
.rm-day-content { flex-grow: 1; padding-top: 2px; }
.rm-day-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 4px; }
.rm-day-num { font-weight: 800; font-size: 13px; color: var(--text-primary); }
.rm-day-date { font-size: 12px; color: var(--text-secondary); }
.rm-day-type-pill { font-size: 10.5px; font-weight: 800; padding: 2px 9px; border-radius: 100px; }
.rm-day-content p { font-size: 13.5px; color: var(--text-secondary); line-height: 1.4; }

/* ---- Differentiated test tabs (teacher panel) ---- */
.diff-test-tabs { display: flex; gap: 8px; margin-bottom: 16px; }
.diff-tab-btn {
    flex: 1; padding: 10px; border-radius: 10px; border: 1.5px solid var(--border-color);
    background: var(--bg-color); color: var(--text-secondary);
    font-weight: 700; font-size: 13px; cursor: pointer;
    transition: all 0.15s;
    min-height: 44px;
}
.diff-tab-btn.active { background: var(--accent-primary); color: #fff; border-color: var(--accent-primary); }

@media (max-width: 640px) {
    .wr-header { flex-direction: column; }
    .rm-day-row { gap: 10px; }
}

/* Close controls shared by worksheet, legal and certificate dialogs. */
.modal-x-btn {
    border: 0; background: transparent; color: var(--text-secondary);
    cursor: pointer; font-size: 20px; padding: 8px; line-height: 1;
}
.modal-content > .modal-x-btn { position: absolute; top: 16px; right: 16px; }
