:root {
    --primary: #1e3a5f;
    --primary-light: #2d5a8e;
    --primary-dark: #0f2744;
    --accent: #c9a227;
    --accent-light: #e8c84a;
    --success: #22c55e;
    --danger: #ef4444;
    --warning: #f59e0b;
    --bg: #f8f9fc;
    --bg-card: #ffffff;
    --text: #1a1a2e;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --radius: 12px;
    --radius-lg: 16px;
    --shadow: 0 4px 6px -1px rgba(0,0,0,.08), 0 2px 4px -2px rgba(0,0,0,.06);
    --shadow-lg: 0 10px 25px -5px rgba(0,0,0,.1), 0 8px 10px -6px rgba(0,0,0,.06);
    --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-display: 'Playfair Display', Georgia, serif;
    --touch-min: 48px;
    --mobile-nav-height: 68px;
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --safe-top: env(safe-area-inset-top, 0px);
}

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

html { scroll-behavior: smooth; }

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-text-size-adjust: 100%;
    overflow-x: hidden;
}

body.nav-open {
    overflow: hidden;
}

body.has-mobile-nav {
    padding-bottom: calc(var(--mobile-nav-height) + var(--safe-bottom));
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.25rem;
}

/* Navbar */
.navbar {
    background: var(--primary-dark);
    color: #fff;
    padding: 0.75rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow);
}

.navbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: #fff;
}

.brand-icon {
    font-size: 1.75rem;
    background: var(--accent);
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.brand-logo {
    width: 52px;
    height: 52px;
    object-fit: contain;
    flex-shrink: 0;
    border-radius: 50%;
    background: #000;
    padding: 2px;
}

.auth-logo {
    width: 130px;
    height: 130px;
    object-fit: contain;
    margin: 0 auto 1rem;
    display: block;
    border-radius: 50%;
    background: #0f0f0f;
    padding: 4px;
}

.hero-logo-wrap {
    display: flex;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.hero-logo {
    width: min(260px, 80vw);
    height: min(260px, 80vw);
    object-fit: contain;
    border-radius: 50%;
    background: radial-gradient(circle at center, #1a1a1a 0%, #000 70%);
    padding: 8px;
    box-shadow: var(--shadow-lg);
}

.footer-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.footer-logo {
    width: 72px;
    height: 72px;
    object-fit: contain;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.25);
    padding: 4px;
}

.footer-org {
    font-size: 0.8rem;
    opacity: 0.75;
}

.brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.brand-text strong { font-size: 1.1rem; }
.brand-text small { font-size: 0.7rem; opacity: 0.8; }

.navbar-menu {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.nav-link {
    color: rgba(255,255,255,0.85);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    transition: color 0.2s;
}

.nav-link:hover { color: var(--accent-light); }

.nav-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.nav-username {
    font-size: 0.85rem;
    opacity: 0.9;
}

.navbar-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
    min-width: var(--touch-min);
    min-height: var(--touch-min);
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    touch-action: manipulation;
}

.navbar-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: #fff;
    border-radius: 2px;
}

/* Main */
.main-content {
    flex: 1;
    padding: 2rem 0 3rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.6rem 1.25rem;
    min-height: var(--touch-min);
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

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

.btn-primary:hover {
    background: var(--accent-light);
    border-color: var(--accent-light);
    transform: translateY(-1px);
}

.btn-outline {
    background: transparent;
    color: var(--primary);
    border-color: var(--border);
}

.btn-outline:hover {
    border-color: var(--primary);
    background: rgba(30,58,95,0.05);
}

.navbar .btn-outline {
    color: #fff;
    border-color: rgba(255,255,255,0.4);
}

.navbar .btn-outline:hover {
    background: rgba(255,255,255,0.1);
    border-color: #fff;
}

.btn-lg { padding: 0.85rem 1.75rem; font-size: 1rem; }
.btn-sm { padding: 0.4rem 0.85rem; font-size: 0.8rem; }
.btn-block { width: 100%; }

/* Forms */
.form-group { margin-bottom: 1.25rem; }

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.4rem;
    font-size: 0.9rem;
}

.form-control {
    width: 100%;
    padding: 0.85rem 1rem;
    min-height: var(--touch-min);
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 16px;
    font-family: inherit;
    transition: border-color 0.2s;
    background: #fff;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(30,58,95,0.1);
}

.form-hint {
    display: block;
    margin-top: 0.3rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Alerts */
.alert {
    padding: 1rem 1.25rem;
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
    font-weight: 500;
}

.alert-success { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.alert-danger { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.alert-warning { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; }

/* Auth - Sliding full page (style login moderne) */
.auth-page-body {
    background: var(--primary-dark);
    overflow-x: hidden;
}

.main-content-auth {
    padding: 0;
    flex: 1;
    display: flex;
    min-height: 100vh;
    width: 100%;
    max-width: none;
}

.main-content-auth > div {
    width: 100%;
    flex: 1;
    display: flex;
}

.auth-shell {
    position: relative;
    width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--primary-dark);
    flex: 1;
    overflow: hidden;
}

.auth-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center top;
    background-repeat: no-repeat;
    z-index: 0;
}

.auth-bg-overlay {
    position: absolute;
    inset: 0;
    z-index: 0;
    background: linear-gradient(
        160deg,
        rgba(15, 39, 68, 0.88) 0%,
        rgba(15, 39, 68, 0.72) 45%,
        rgba(30, 58, 95, 0.6) 100%
    );
}

.auth-back-btn {
    position: fixed;
    top: 1.25rem;
    left: 1.25rem;
    z-index: 200;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.55rem 1.1rem;
    border-radius: 999px;
    background: rgba(15, 39, 68, 0.82);
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.88rem;
    border: 1px solid rgba(255, 255, 255, 0.28);
    backdrop-filter: blur(8px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
    transition: background 0.2s ease, transform 0.2s ease;
}

.auth-back-btn:hover {
    background: rgba(30, 58, 95, 0.92);
    transform: translateY(-1px);
    color: #fff;
}

.auth-back-icon {
    font-size: 1.1rem;
    line-height: 1;
}

.auth-stage {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-areas: "left right";
    width: 100%;
    min-height: 100vh;
    overflow: hidden;
    background: transparent;
    flex: 1;
    position: relative;
    z-index: 1;
}

.auth-form-container {
    width: 100%;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 3rem;
    background: #fff;
    transition: opacity 0.45s ease;
}

.auth-form-signin {
    grid-area: left;
}

.auth-form-signup {
    grid-area: right;
    display: none;
}

.auth-overlay-container {
    grid-area: right;
    position: relative;
    width: 100%;
    min-height: 100vh;
    overflow: hidden;
    z-index: 10;
    padding: 0;
}

.auth-shell--register .auth-form-signin {
    display: none;
}

.auth-shell--register .auth-form-signup {
    display: flex;
}

.auth-shell--register .auth-overlay-container {
    grid-area: left;
}

.auth-form-inner {
    width: 100%;
    max-width: 380px;
}

.auth-form-logo {
    width: 88px;
    height: 88px;
    object-fit: contain;
    border-radius: 50%;
    background: #0f0f0f;
    padding: 4px;
    margin: 0 auto 1rem;
    display: block;
}

.auth-form-inner h1 {
    font-family: var(--font-display);
    font-size: 1.85rem;
    color: var(--primary-dark);
    text-align: center;
    margin-bottom: 0.35rem;
}

.auth-form-lead {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.92rem;
    margin-bottom: 1.5rem;
}

.auth-input {
    background: #f3f5f9;
    border-color: transparent;
}

.auth-input:focus {
    background: #fff;
    border-color: var(--accent);
}

.btn-auth {
    border-radius: 999px;
    font-weight: 700;
    letter-spacing: 0.04em;
    padding: 0.8rem 1.5rem;
    font-size: 0.82rem;
    cursor: pointer;
    transition: all 0.25s ease;
    border: 2px solid transparent;
}

.btn-auth-solid {
    background: linear-gradient(135deg, var(--accent) 0%, #e8a020 100%);
    color: var(--primary-dark);
    border-color: var(--accent);
}

.btn-auth-solid:hover {
    background: linear-gradient(135deg, var(--accent-light) 0%, #f0b830 100%);
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(201, 162, 39, 0.35);
}

.btn-auth-ghost {
    background: transparent;
    color: #fff;
    border-color: rgba(255, 255, 255, 0.85);
    margin-top: 1.25rem;
}

.btn-auth-ghost:hover,
.btn-auth-ghost.is-active {
    background: rgba(255, 255, 255, 0.12);
}

.auth-overlay {
    position: absolute;
    inset: 0;
    width: 200%;
    height: 100%;
    transition: transform 0.65s ease-in-out;
}

.auth-shell--login .auth-overlay {
    transform: translateX(-50%);
}

.auth-shell--register .auth-overlay {
    transform: translateX(0);
}

.auth-overlay-panel {
    position: absolute;
    top: 0;
    width: 50%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #fff;
    padding: 2.5rem;
    overflow: hidden;
}

.auth-overlay-left {
    left: 0;
    transform: translateX(-20%);
    transition: transform 0.65s ease-in-out;
}

.auth-overlay-right {
    right: 0;
    transform: translateX(0);
    transition: transform 0.65s ease-in-out;
}

.auth-shell--register .auth-overlay-left {
    transform: translateX(0);
}

.auth-shell--register .auth-overlay-right {
    transform: translateX(20%);
}

.auth-overlay-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center top;
    transform: scale(1.05);
}

.auth-overlay-panel::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        145deg,
        rgba(15, 39, 68, 0.9) 0%,
        rgba(30, 58, 95, 0.82) 40%,
        rgba(201, 162, 39, 0.78) 100%
    );
}

.auth-overlay-content {
    position: relative;
    z-index: 1;
    max-width: 340px;
}

.auth-overlay-logo {
    width: 120px;
    height: 120px;
    object-fit: contain;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.35);
    padding: 6px;
    margin: 0 auto 1.25rem;
    display: block;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.auth-overlay-content h2 {
    font-family: var(--font-display);
    font-size: clamp(1.6rem, 3vw, 2rem);
    color: var(--accent-light);
    margin-bottom: 0.75rem;
}

.auth-overlay-content p {
    font-size: 0.95rem;
    line-height: 1.65;
    opacity: 0.95;
}

.auth-mobile-switch {
    display: none;
    width: 100%;
    gap: 0.75rem;
    padding: 1rem;
    background: var(--primary-dark);
    justify-content: center;
    position: sticky;
    bottom: 0;
    z-index: 20;
}

.auth-footer {
    text-align: center;
    margin-top: 1.5rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.auth-footer a { color: var(--primary-light); font-weight: 600; }

/* Welcome splash (home) */
.home-welcome-body {
    background: var(--primary-dark);
    overflow: hidden;
}

.home-welcome-body .main-content {
    padding: 0;
    flex: 1;
    display: flex;
    min-height: 100vh;
}

.home-welcome-body .main-content > div {
    width: 100%;
    flex: 1;
    display: flex;
}

.welcome-screen {
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem;
    overflow: hidden;
    background: var(--primary-dark);
}

.welcome-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center top;
    background-repeat: no-repeat;
    transform: scale(1.03);
    animation: welcome-bg-in 1.4s ease forwards;
}

@keyframes welcome-bg-in {
    from { transform: scale(1.08); opacity: 0.6; }
    to { transform: scale(1.03); opacity: 1; }
}

.welcome-overlay {
    position: absolute;
    inset: 0;
    z-index: 0;
    background: linear-gradient(
        160deg,
        rgba(15, 39, 68, 0.88) 0%,
        rgba(15, 39, 68, 0.72) 45%,
        rgba(30, 58, 95, 0.6) 100%
    );
}

.welcome-content {
    position: relative;
    z-index: 2;
    text-align: center;
    max-width: 560px;
}

.welcome-logo {
    width: 140px;
    height: 140px;
    object-fit: contain;
    margin: 0 auto 2rem;
    display: block;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.35);
    padding: 8px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
    opacity: 0;
    transform: scale(0.85);
    animation: welcome-logo-in 1s ease forwards;
}

@keyframes welcome-logo-in {
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.welcome-title {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-bottom: 2.5rem;
}

.welcome-word {
    display: block;
    font-family: var(--font-display);
    font-size: clamp(2.2rem, 6vw, 3.5rem);
    font-weight: 700;
    line-height: 1.15;
    color: #fff;
    opacity: 0;
    transform: translateY(28px);
    animation: welcome-word-in 0.9s cubic-bezier(0.22, 1, 0.36, 1) forwards;
    animation-delay: calc(0.35s + var(--i) * 0.22s);
}

.welcome-word--accent {
    color: var(--accent-light);
    text-shadow: 0 4px 24px rgba(232, 200, 74, 0.35);
}

@keyframes welcome-word-in {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.welcome-btn {
    opacity: 0;
    transform: translateY(16px);
    animation: welcome-btn-in 0.8s ease forwards;
    animation-delay: 1.1s;
    min-width: 200px;
    border-radius: 999px;
    font-size: 1rem;
    letter-spacing: 0.03em;
    box-shadow: 0 10px 30px rgba(201, 162, 39, 0.35);
}

.welcome-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 36px rgba(201, 162, 39, 0.45);
}

@keyframes welcome-btn-in {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 480px) {
    .welcome-logo {
        width: 110px;
        height: 110px;
        margin-bottom: 1.5rem;
    }

    .welcome-title {
        margin-bottom: 2rem;
    }
}

/* Hero */
.hero {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
    padding: 3rem 0;
}

.hero-badge {
    display: inline-block;
    background: rgba(201,162,39,0.15);
    color: var(--accent);
    padding: 0.35rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.hero-title {
    font-family: var(--font-display);
    font-size: 2.75rem;
    line-height: 1.2;
    color: var(--primary-dark);
    margin-bottom: 1rem;
}

.hero-subtitle {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
    max-width: 520px;
}

.hero-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.hero-card {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-light));
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    display: flex;
    gap: 2rem;
    justify-content: center;
    color: #fff;
    box-shadow: var(--shadow-lg);
}

.hero-stat {
    text-align: center;
}

.hero-stat span {
    display: block;
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--accent-light);
}

.hero-stat small {
    font-size: 0.85rem;
    opacity: 0.8;
}

/* Features */
.features-section {
    padding: 3rem 0;
}

.features-section h2,
.section h2 {
    font-family: var(--font-display);
    font-size: 1.75rem;
    color: var(--primary-dark);
    margin-bottom: 1.5rem;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
}

.feature-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 1.75rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

.feature-icon { font-size: 2rem; display: block; margin-bottom: 0.75rem; }
.feature-card h3 { font-size: 1.1rem; margin-bottom: 0.5rem; color: var(--primary); }
.feature-card p { color: var(--text-muted); font-size: 0.9rem; }

/* Page header */
.app-back-bar {
    margin-bottom: 1.25rem;
}

.app-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.5rem 1rem;
    border-radius: 999px;
    background: var(--bg-card);
    color: var(--primary-dark);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.88rem;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    transition: background 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}

.app-back-btn:hover {
    background: var(--primary-dark);
    color: #fff;
    border-color: var(--primary-dark);
    transform: translateX(-2px);
}

.app-back-icon {
    font-size: 1.05rem;
    line-height: 1;
}

.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.page-header h1 {
    font-family: var(--font-display);
    font-size: 2rem;
    color: var(--primary-dark);
}

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

/* Dashboard */
.dashboard-body {
    background: var(--bg);
}

.dashboard {
    max-width: 1100px;
    margin: 0 auto;
}

.dashboard-hero {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 2rem;
    align-items: center;
    padding: 2rem 2.25rem;
    margin-bottom: 2rem;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 55%, #2a5080 100%);
    color: #fff;
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
}

.dashboard-hero::after {
    content: '';
    position: absolute;
    top: -40%;
    right: -10%;
    width: 280px;
    height: 280px;
    border-radius: 50%;
    background: rgba(201, 162, 39, 0.15);
    pointer-events: none;
}

.dashboard-hero-content {
    position: relative;
    z-index: 1;
}

.dashboard-badge {
    display: inline-block;
    background: rgba(201, 162, 39, 0.2);
    color: var(--accent-light);
    padding: 0.3rem 0.85rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    margin-bottom: 0.75rem;
}

.dashboard-hero h1 {
    font-family: var(--font-display);
    font-size: clamp(1.75rem, 4vw, 2.35rem);
    margin-bottom: 0.5rem;
    color: #fff;
}

.dashboard-lead {
    font-size: 1rem;
    opacity: 0.92;
    margin-bottom: 1.5rem;
    max-width: 420px;
}

.dashboard-hero-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.dashboard-hero-actions .btn-outline {
    border-color: rgba(255, 255, 255, 0.5);
    color: #fff;
}

.dashboard-hero-actions .btn-outline:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: #fff;
    color: #fff;
}

.dashboard-hero-visual {
    position: relative;
    z-index: 1;
    text-align: center;
}

.dashboard-hero-logo {
    width: 120px;
    height: 120px;
    object-fit: contain;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.3);
    padding: 6px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.25);
}

.dashboard-best-score {
    margin-top: 0.85rem;
    padding: 0.5rem 1rem;
    border-radius: 999px;
    background: rgba(201, 162, 39, 0.25);
    border: 1px solid rgba(232, 200, 74, 0.4);
    font-size: 0.82rem;
}

.dashboard-best-score strong {
    color: var(--accent-light);
    font-size: 1.1rem;
    margin-left: 0.35rem;
}

.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 2.5rem;
}

.dashboard-stat-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.15rem 1.25rem;
    box-shadow: var(--shadow);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.dashboard-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.dashboard-stat-icon {
    font-size: 1.6rem;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: rgba(30, 58, 95, 0.08);
    flex-shrink: 0;
}

.dashboard-stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-dark);
    line-height: 1.1;
}

.dashboard-stat-label {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.dashboard-section {
    margin-bottom: 2.5rem;
}

.dashboard-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.dashboard-section-title {
    font-family: var(--font-display);
    font-size: 1.45rem;
    color: var(--primary-dark);
}

.dashboard-section-meta {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 600;
}

.dashboard-quick-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.dashboard-quick-card {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.35rem 1.5rem;
    border-radius: var(--radius);
    text-decoration: none;
    color: inherit;
    border: 2px solid var(--border);
    background: var(--bg-card);
    box-shadow: var(--shadow);
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.dashboard-quick-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.dashboard-quick-card--exam:hover {
    border-color: var(--primary);
}

.dashboard-quick-card--practice:hover {
    border-color: var(--accent);
}

.dashboard-quick-icon {
    font-size: 1.75rem;
    flex-shrink: 0;
}

.dashboard-quick-card strong {
    display: block;
    color: var(--primary-dark);
    margin-bottom: 0.25rem;
}

.dashboard-quick-card p {
    font-size: 0.88rem;
    color: var(--text-muted);
    margin: 0;
}

.dashboard-categories {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1rem;
}

.dashboard-category-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    box-shadow: var(--shadow);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.dashboard-category-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.dashboard-category-top {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    margin-bottom: 1rem;
}

.dashboard-category-icon {
    font-size: 1.75rem;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: rgba(201, 162, 39, 0.12);
    flex-shrink: 0;
}

.dashboard-category-card h3 {
    font-size: 0.98rem;
    color: var(--primary-dark);
    margin-bottom: 0.15rem;
    line-height: 1.3;
}

.dashboard-category-card p {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin: 0;
}

.dashboard-progress {
    height: 6px;
    background: var(--border);
    border-radius: 999px;
    overflow: hidden;
    margin-bottom: 0.65rem;
}

.dashboard-progress-bar {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--accent) 0%, var(--accent-light) 100%);
    transition: width 0.6s ease;
}

.dashboard-category-score {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.85rem;
}

.dashboard-sessions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.dashboard-session-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    text-decoration: none;
    color: inherit;
    box-shadow: var(--shadow);
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.dashboard-session-card:hover {
    transform: translateX(4px);
    border-color: var(--primary-light);
}

.dashboard-session-main {
    display: flex;
    align-items: center;
    gap: 1rem;
    min-width: 0;
}

.dashboard-session-main strong {
    display: block;
    color: var(--primary-dark);
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dashboard-session-main p {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin: 0;
}

.dashboard-session-meta {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    flex-shrink: 0;
}

.dashboard-session-time {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.dashboard-empty {
    text-align: center;
    padding: 3rem 2rem;
    background: var(--bg-card);
    border: 2px dashed var(--border);
    border-radius: var(--radius-lg);
}

.dashboard-empty-icon {
    font-size: 2.5rem;
    display: block;
    margin-bottom: 0.75rem;
}

.dashboard-empty h3 {
    color: var(--primary-dark);
    margin-bottom: 0.35rem;
}

.dashboard-empty p {
    color: var(--text-muted);
    margin-bottom: 1.25rem;
}

/* Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.25rem;
    margin-bottom: 2.5rem;
}

.stats-grid-sm { grid-template-columns: repeat(3, 1fr); max-width: 600px; }

.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 1.5rem;
    text-align: center;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

.stat-icon { font-size: 1.5rem; margin-bottom: 0.5rem; }
.stat-value { font-size: 1.75rem; font-weight: 700; color: var(--primary); }
.stat-label { font-size: 0.8rem; color: var(--text-muted); margin-top: 0.25rem; }

/* Categories */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
}

.category-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    transition: transform 0.2s, box-shadow 0.2s;
}

.category-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.category-icon { font-size: 2rem; margin-bottom: 0.75rem; }
.category-card h3 { font-size: 1.05rem; color: var(--primary); margin-bottom: 0.25rem; }
.category-meta { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 0.75rem; }

.category-scores {
    display: flex;
    gap: 1rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

/* Section */
.section { margin-bottom: 2.5rem; }

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.link {
    color: var(--primary-light);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
}

.link:hover { text-decoration: underline; }

/* Table */
.table-responsive { overflow-x: auto; }

.table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-card);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.table th,
.table td {
    padding: 0.85rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
}

.table th {
    background: var(--primary-dark);
    color: #fff;
    font-weight: 600;
}

.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: rgba(30,58,95,0.03); }

/* Badges */
.badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-primary { background: rgba(30,58,95,0.1); color: var(--primary); }
.badge-secondary { background: rgba(100,116,139,0.15); color: var(--text-muted); }

.score-badge {
    display: inline-block;
    padding: 0.25rem 0.65rem;
    border-radius: 6px;
    font-weight: 700;
    font-size: 0.85rem;
}

.score-excellent { background: #dcfce7; color: #166534; }
.score-good { background: #dbeafe; color: #1e40af; }
.score-average { background: #fef3c7; color: #92400e; }
.score-poor { background: #fee2e2; color: #991b1b; }

/* Quiz config */
.quiz-config-form { max-width: 800px; }

.config-section {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 1.75rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

.config-section h2 {
    font-size: 1.1rem;
    color: var(--primary);
    margin-bottom: 1.25rem;
}

.category-select-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.75rem;
}

.category-select-card,
.mode-card {
    cursor: pointer;
}

.category-select-card input,
.mode-card input {
    position: absolute;
    opacity: 0;
}

.category-select-card .card-content,
.mode-card .card-content {
    display: block;
    padding: 1rem;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    transition: all 0.2s;
    text-align: center;
}

.category-select-card input:checked + .card-content,
.mode-card input:checked + .card-content {
    border-color: var(--accent);
    background: rgba(201,162,39,0.08);
}

.cat-icon, .mode-icon { font-size: 1.5rem; display: block; margin-bottom: 0.5rem; }

.mode-select {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.mode-card .card-content { text-align: left; }
.mode-card .card-content p { font-size: 0.85rem; color: var(--text-muted); margin-top: 0.35rem; }

.range-input {
    width: 100%;
    accent-color: var(--accent);
}

.range-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* Quiz page */
.quiz-page .main-content { padding-top: 1rem; }

.quiz-container { max-width: 720px; margin: 0 auto; }

.quiz-header {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 1.25rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow);
}

.quiz-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.quiz-category { font-size: 0.9rem; color: var(--text-muted); }

.quiz-progress-bar {
    height: 8px;
    background: var(--border);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--accent-light));
    border-radius: 4px;
    transition: width 0.4s ease;
}

.quiz-progress-text {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-align: right;
}

.question-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
}

.question-number {
    display: inline-block;
    background: var(--primary-dark);
    color: var(--accent-light);
    padding: 0.25rem 0.75rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.question-text {
    font-size: 1.15rem;
    line-height: 1.7;
    margin-bottom: 1.5rem;
    color: var(--text);
}

.answer-input {
    font-size: 1.05rem;
    resize: vertical;
    min-height: 80px;
}

.qcm-options {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.qcm-option {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    padding: 1rem 1.1rem;
    min-height: var(--touch-min);
    border: 2px solid var(--border);
    border-radius: 12px;
    background: #fff;
    cursor: pointer;
    transition: all 0.2s;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.qcm-option.is-selected,
.qcm-option:has(input[type="radio"]:checked) {
    border-color: var(--accent);
    background: rgba(201, 162, 39, 0.08);
    box-shadow: 0 0 0 1px rgba(201, 162, 39, 0.25);
}

.qcm-option:hover {
    border-color: var(--primary-light);
    background: rgba(30, 58, 95, 0.03);
}

.qcm-option input[type="radio"] {
    margin-top: 0.2rem;
    accent-color: var(--accent);
    flex-shrink: 0;
}

.qcm-option input[type="radio"]:checked + .qcm-label {
    background: var(--accent);
    color: var(--primary-dark);
}

.qcm-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 8px;
    background: var(--primary-dark);
    color: #fff;
    font-weight: 700;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.qcm-text {
    line-height: 1.5;
    font-size: 0.98rem;
}

.qcm-option.qcm-correct {
    border-color: var(--success);
    background: #f0fdf4;
}

.qcm-option.qcm-incorrect {
    border-color: var(--danger);
    background: #fef2f2;
}

.qcm-option.qcm-selected {
    box-shadow: inset 0 0 0 1px currentColor;
}

.qcm-review-options {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.qcm-review-option {
    padding: 0.65rem 0.85rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    font-size: 0.9rem;
}

.qcm-review-option.is-correct {
    border-color: var(--success);
    background: #f0fdf4;
}

.qcm-review-option.is-selected {
    border-color: var(--danger);
    background: #fef2f2;
}

.quiz-actions { margin-top: 1rem; }

.quiz-actions-sticky {
    position: sticky;
    bottom: calc(0.75rem + var(--safe-bottom));
    z-index: 20;
    padding-top: 0.5rem;
    background: linear-gradient(180deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.95) 35%, #fff 100%);
}

.has-mobile-nav .quiz-actions-sticky {
    bottom: calc(0.75rem + var(--mobile-nav-height) + var(--safe-bottom));
}

body.quiz-page .mobile-bottom-nav {
    display: none !important;
}

body.quiz-page.has-mobile-nav {
    padding-bottom: var(--safe-bottom);
}

body.quiz-page .quiz-actions-sticky,
body.quiz-page .feedback-panel .btn {
    bottom: calc(0.75rem + var(--safe-bottom));
}

.feedback-panel .btn {
    position: sticky;
    bottom: calc(0.75rem + var(--safe-bottom));
}

.has-mobile-nav .feedback-panel .btn {
    bottom: calc(0.75rem + var(--mobile-nav-height) + var(--safe-bottom));
}

.feedback-panel {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 2px solid var(--border);
}

.feedback-panel.hidden { display: none; }

.feedback-icon { font-size: 2.5rem; text-align: center; margin-bottom: 0.5rem; }

.feedback-text {
    text-align: center;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.feedback-text.correct { color: var(--success); }
.feedback-text.incorrect { color: var(--danger); }

.correct-answer {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

.correct-answer.hidden { display: none; }

.correct-answer .label {
    font-weight: 700;
    color: var(--success);
    display: block;
    margin-bottom: 0.25rem;
}

/* Results */
.results-header {
    display: flex;
    gap: 2.5rem;
    align-items: center;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-lg);
    flex-wrap: wrap;
}

.results-score-circle {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: 6px solid;
}

.results-score-circle.score-excellent { border-color: var(--success); background: #f0fdf4; }
.results-score-circle.score-good { border-color: #3b82f6; background: #eff6ff; }
.results-score-circle.score-average { border-color: var(--warning); background: #fffbeb; }
.results-score-circle.score-poor { border-color: var(--danger); background: #fef2f2; }

.score-value { font-size: 2.25rem; font-weight: 800; line-height: 1; }
.score-label { font-size: 0.8rem; color: var(--text-muted); }

.confetti-canvas {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
}

.results-header--celebrate {
    position: relative;
    overflow: hidden;
}

.results-header--try {
    position: relative;
}

.results-title--bravo {
    animation: bravo-pop 0.65s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.results-title--try {
    animation: bravo-pop 0.65s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.results-mood {
    font-size: 3.5rem;
    line-height: 1;
    margin-bottom: 0.5rem;
    display: inline-block;
}

.results-mood--win {
    animation: mood-bounce 0.9s ease both;
}

.results-mood--try {
    animation: mood-encourage 1.2s ease-in-out infinite;
}

.results-encourage {
    color: var(--primary-light);
    font-weight: 600;
    font-size: 0.95rem;
    margin: -0.25rem 0 0.75rem;
}

@keyframes mood-bounce {
    0% { transform: scale(0.3) rotate(-12deg); opacity: 0; }
    55% { transform: scale(1.15) rotate(6deg); opacity: 1; }
    100% { transform: scale(1) rotate(0deg); }
}

@keyframes mood-encourage {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-6px) scale(1.05); }
}

@media (prefers-reduced-motion: reduce) {
    .results-mood--win,
    .results-mood--try,
    .results-title--bravo,
    .results-title--try {
        animation: none;
    }
}

@keyframes bravo-pop {
    0% {
        opacity: 0;
        transform: scale(0.85) translateY(12px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.results-summary h1 {
    font-family: var(--font-display);
    font-size: 1.75rem;
    color: var(--primary-dark);
    margin-bottom: 0.5rem;
}

.results-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin: 1rem 0;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.results-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.answers-list { display: flex; flex-direction: column; gap: 1rem; }

.answer-item {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 1.25rem;
    border-left: 4px solid;
    box-shadow: var(--shadow);
}

.answer-item.correct { border-left-color: var(--success); }
.answer-item.incorrect { border-left-color: var(--danger); }

.answer-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.answer-num { font-weight: 700; color: var(--text-muted); }
.answer-status { font-size: 0.85rem; font-weight: 600; }

.answer-question {
    font-weight: 500;
    margin-bottom: 0.75rem;
    line-height: 1.5;
}

.answer-row {
    font-size: 0.9rem;
    margin-bottom: 0.35rem;
}

.answer-row .label {
    font-weight: 600;
    color: var(--text-muted);
}

.answer-row.correct-ans .label { color: var(--success); }

/* Filter bar */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.filter-btn {
    padding: 0.4rem 0.9rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
    color: var(--text-muted);
    background: var(--bg-card);
    border: 1px solid var(--border);
    transition: all 0.2s;
}

.filter-btn:hover,
.filter-btn.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

.empty-icon { font-size: 3rem; display: block; margin-bottom: 1rem; }
.empty-state h3 { margin-bottom: 0.5rem; color: var(--primary); }
.empty-state p { color: var(--text-muted); margin-bottom: 1.5rem; }

/* Footer */
.footer {
    background: var(--primary-dark);
    color: rgba(255,255,255,0.7);
    padding: 1.25rem 0;
    text-align: center;
    font-size: 0.85rem;
    margin-top: auto;
}

/* Mobile bottom navigation */
.mobile-bottom-nav {
    display: none;
}

.mobile-only { display: none; }
.desktop-only { display: block; }

.history-cards {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.history-card {
    display: block;
    padding: 1rem 1.1rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    text-decoration: none;
    color: inherit;
    box-shadow: var(--shadow);
}

.history-card-top {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    margin-bottom: 0.65rem;
}

.history-card-top strong {
    display: block;
    color: var(--primary-dark);
    font-size: 0.95rem;
}

.history-card-top p {
    margin: 0;
    font-size: 0.82rem;
    color: var(--text-muted);
}

.history-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    align-items: center;
}

/* Responsive */
@media (max-width: 900px) {
    .auth-stage {
        grid-template-columns: 1fr;
        grid-template-areas: "main";
        min-height: calc(100vh - var(--mobile-nav-height) - var(--safe-bottom));
    }

    .auth-form-container {
        grid-area: main;
        width: 100%;
        min-height: calc(100vh - 72px - var(--safe-bottom));
        display: none;
        padding: 1.5rem 1rem 6.5rem;
    }

    .auth-shell--login .auth-form-signin,
    .auth-shell--register .auth-form-signup {
        display: flex;
    }

    .auth-overlay-container {
        display: none;
    }

    .auth-mobile-switch {
        display: flex;
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 120;
        padding: 0.75rem 1rem calc(0.75rem + var(--safe-bottom));
        background: var(--primary-dark);
        box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.2);
    }

    .auth-mobile-switch .btn-auth {
        flex: 1;
        min-height: var(--touch-min);
        margin-top: 0;
    }

    .auth-back-btn {
        top: calc(0.75rem + var(--safe-top));
        left: 0.75rem;
        font-size: 0.82rem;
        padding: 0.6rem 0.95rem;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 1rem;
    }

    .main-content {
        padding: 1.25rem 0 2rem;
    }

    .mobile-bottom-nav {
        display: flex;
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 110;
        height: calc(var(--mobile-nav-height) + var(--safe-bottom));
        padding: 0.35rem 0.5rem var(--safe-bottom);
        background: rgba(15, 39, 68, 0.97);
        border-top: 1px solid rgba(255, 255, 255, 0.12);
        backdrop-filter: blur(10px);
        box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.18);
    }

    .mobile-nav-item {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 0.15rem;
        min-height: var(--touch-min);
        color: rgba(255, 255, 255, 0.72);
        text-decoration: none;
        font-size: 0.68rem;
        font-weight: 600;
        border-radius: 10px;
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
    }

    .mobile-nav-item.is-active,
    .mobile-nav-item:hover {
        color: var(--accent-light);
        background: rgba(255, 255, 255, 0.06);
    }

    .mobile-nav-icon {
        font-size: 1.15rem;
        line-height: 1;
    }

    .has-mobile-nav .footer {
        padding-bottom: calc(1rem + var(--mobile-nav-height));
    }

    .navbar-menu {
        display: none;
        position: fixed;
        top: calc(64px + var(--safe-top));
        left: 0;
        right: 0;
        bottom: 0;
        background: var(--primary-dark);
        flex-direction: column;
        padding: 1rem 1rem calc(1rem + var(--safe-bottom));
        gap: 0.35rem;
        overflow-y: auto;
        z-index: 99;
    }

    .navbar-menu .nav-link,
    .navbar-menu .btn {
        width: 100%;
        justify-content: center;
        min-height: var(--touch-min);
        padding: 0.85rem 1rem;
        font-size: 1rem;
    }

    .navbar-menu .nav-user {
        flex-direction: column;
        width: 100%;
        gap: 0.5rem;
        margin-top: 0.5rem;
        padding-top: 0.75rem;
        border-top: 1px solid rgba(255, 255, 255, 0.12);
    }

    .navbar-menu.open { display: flex; }
    .navbar-toggle { display: flex; }
    .navbar-inner { position: relative; }

    .brand-text strong { font-size: 0.95rem; }
    .brand-text small { font-size: 0.62rem; }
    .brand-logo { width: 44px; height: 44px; }

    .app-back-bar { margin-bottom: 1rem; }
    .app-back-btn {
        min-height: 42px;
        padding: 0.55rem 1rem;
    }

    .dashboard {
        max-width: none;
    }

    .dashboard-hero {
        grid-template-columns: 1fr;
        text-align: center;
        padding: 1.5rem 1.1rem;
        margin-bottom: 1.25rem;
    }

    .dashboard-lead { margin-left: auto; margin-right: auto; }

    .dashboard-hero-actions {
        justify-content: stretch;
        flex-direction: column;
        width: 100%;
    }

    .dashboard-hero-actions .btn {
        width: 100%;
    }

    .dashboard-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
        margin-bottom: 1.75rem;
    }

    .dashboard-stat-card {
        flex-direction: column;
        text-align: center;
        padding: 1rem 0.75rem;
        gap: 0.5rem;
    }

    .dashboard-quick-grid { grid-template-columns: 1fr; }
    .dashboard-quick-card {
        padding: 1.15rem 1.1rem;
        min-height: var(--touch-min);
    }

    .dashboard-categories {
        grid-template-columns: 1fr;
    }

    .dashboard-category-card .btn {
        min-height: var(--touch-min);
    }

    .dashboard-session-card {
        flex-direction: column;
        align-items: flex-start;
        padding: 1rem;
    }

    .dashboard-session-main strong {
        white-space: normal;
    }

    .page-header {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }

    .page-header .btn {
        width: 100%;
    }

    .category-select-grid,
    .mode-select {
        grid-template-columns: 1fr;
    }

    .category-select-card .card-content,
    .mode-card .card-content {
        padding: 1.1rem;
        min-height: var(--touch-min);
        text-align: left;
    }

    .range-input {
        height: 28px;
    }

    .quiz-page .main-content {
        padding-top: 0.75rem;
        padding-bottom: 0.5rem;
    }

    .quiz-header {
        padding: 1rem;
        margin-bottom: 1rem;
        position: sticky;
        top: calc(0.5rem + var(--safe-top));
        z-index: 30;
    }

    .quiz-info {
        flex-wrap: wrap;
    }

    .question-card {
        padding: 1.15rem 1rem 0.5rem;
        border-radius: var(--radius);
    }

    .question-text {
        font-size: 1.05rem;
        line-height: 1.65;
    }

    .qcm-option {
        padding: 1rem;
        gap: 0.75rem;
    }

    .qcm-label {
        width: 2.25rem;
        height: 2.25rem;
        font-size: 1rem;
    }

    .has-mobile-nav .quiz-actions-sticky,
    .has-mobile-nav .feedback-panel .btn {
        bottom: calc(0.75rem + var(--mobile-nav-height) + var(--safe-bottom));
    }

    body.quiz-page .quiz-actions-sticky,
    body.quiz-page .feedback-panel .btn {
        bottom: calc(0.75rem + var(--safe-bottom));
    }

    .qcm-text {
        font-size: 1rem;
        line-height: 1.45;
    }

    .results-header {
        flex-direction: column;
        text-align: center;
        padding: 1.5rem 1.1rem;
    }

    .results-meta,
    .results-actions {
        justify-content: center;
        width: 100%;
    }

    .results-actions {
        flex-direction: column;
    }

    .results-actions .btn {
        width: 100%;
    }

    .filter-bar {
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 0.35rem;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .filter-bar::-webkit-scrollbar { display: none; }

    .filter-btn {
        flex-shrink: 0;
        min-height: 40px;
        padding: 0.55rem 1rem;
    }

    .mobile-only { display: block; }
    .desktop-only { display: none; }

    .welcome-screen {
        padding: 1.25rem 1rem calc(1.5rem + var(--safe-bottom));
        min-height: 100dvh;
    }

    .welcome-btn {
        width: 100%;
        max-width: 280px;
    }

    .hero {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .hero-subtitle { margin-left: auto; margin-right: auto; }
    .hero-actions { justify-content: center; }
    .hero-title { font-size: 2rem; }

    .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
    .stats-grid,
    .dashboard-stats {
        grid-template-columns: 1fr 1fr;
    }

    .dashboard-stat-value {
        font-size: 1.35rem;
    }

    .dashboard-section-title {
        font-size: 1.25rem;
    }

    .category-select-grid { grid-template-columns: 1fr; }

    .auth-form-container {
        padding: 1.25rem 0.9rem 6rem;
    }

    .auth-form-logo {
        width: 72px;
        height: 72px;
    }

    .auth-form-inner h1 {
        font-size: 1.5rem;
    }

    .table th,
    .table td {
        padding: 0.7rem 0.65rem;
        font-size: 0.82rem;
    }
}

.hidden { display: none !important; }
