/* Moved out of index.html (strict CSP: no inline <style>). */
* {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            background: #0a0e17;
            font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
            color: #eef4ff;
            overflow-x: hidden;
        }

        /* Auth Card Styles */
        .auth-card {
            background: #0d1a26;
            border: 1px solid rgba(56,139,180,0.18);
            border-radius: 16px;
            padding: 2rem;
            width: 100%;
            max-width: 450px;
            box-shadow: 0 4px 24px rgba(0,0,0,0.35);
        }
        .auth-card .logo {
            text-align: center;
            margin-bottom: 1.5rem;
        }
        .auth-card .logo img {
            height: 48px;
        }
        .auth-card h2 {
            text-align: center;
            color: #fff;
            margin-bottom: 1.5rem;
        }
        .auth-card .form-label {
            color: #9bb7d0;
        }
        .auth-card .form-control {
            background: #0f202d;
            border: 1px solid rgba(56,139,180,0.25);
            color: #eef4ff;
        }
        .auth-card .form-control:focus {
            border-color: #2e8fc0;
            box-shadow: 0 0 0 3px rgba(46,143,192,0.25);
        }
        .auth-card .btn-primary {
            background: linear-gradient(135deg, #1e6f9f, #124e72);
            border: none;
            width: 100%;
            padding: 0.75rem;
        }
        .auth-card .btn-primary:hover {
            background: linear-gradient(135deg, #2e8fc0, #1a6690);
        }
        .auth-card .auth-link {
            text-align: center;
            margin-top: 1rem;
            color: #9bb7d0;
        }
        .auth-card .auth-link a {
            color: #2e8fc0;
            text-decoration: none;
        }
        .error-message {
            color: #e05c6a;
            font-size: 0.85rem;
            margin-top: 0.5rem;
            text-align: center;
        }
        .auth-tab {
            transition: all 0.2s ease;
            background: none;
            border: none;
            padding: 0.75rem;
            font-size: 1rem;
            font-weight: 600;
            cursor: pointer;
        }
        .auth-tab:hover {
            color: #eef4ff;
        }

        /* Navbar Styles */
        .modern-navbar {
            background: linear-gradient(135deg, #0a0e17 0%, #0f172a 100%);
            backdrop-filter: blur(12px);
            border-bottom: 1px solid rgba(59, 130, 246, 0.15);
            padding: 0.75rem 2rem;
            position: sticky;
            top: 0;
            z-index: 1030;
        }
        .navbar-container {
            max-width: 1600px;
            margin: 0 auto;
            display: flex;
            align-items: center;
            justify-content: space-between;
            flex-wrap: wrap;
            gap: 1rem;
        }
        .navbar-brand {
            display: flex;
            align-items: center;
            gap: 0.75rem;
            text-decoration: none;
        }
        .navbar-brand img {
            height: 32px;
            width: auto;
        }
        .brand-title {
            font-size: 1.1rem;
            font-weight: 700;
            color: #fff;
        }
        .brand-sub {
            font-size: 0.65rem;
            color: #9bb7d0;
        }
        .nav-links {
            display: flex;
            align-items: center;
            gap: 0.25rem;
            flex-wrap: wrap;
        }
        .nav-link-custom {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            padding: 0.5rem 1rem;
            border-radius: 10px;
            color: #9bb7d0;
            text-decoration: none;
            font-size: 0.85rem;
            font-weight: 500;
            transition: all 0.2s ease;
        }
        .nav-link-custom:hover {
            background: rgba(59, 130, 246, 0.1);
            color: #fff;
        }
        .nav-link-custom.active {
            background: rgba(59, 130, 246, 0.15);
            color: #3b82f6;
            border: 1px solid rgba(59, 130, 246, 0.25);
        }
        .navbar-right {
            display: flex;
            align-items: center;
            gap: 1rem;
        }
        .user-info {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            background: rgba(255, 255, 255, 0.05);
            padding: 0.35rem 0.85rem;
            border-radius: 40px;
        }
        .user-avatar {
            width: 28px;
            height: 28px;
            background: linear-gradient(135deg, #3b82f6, #1e40af);
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 0.7rem;
            font-weight: 700;
            color: #fff;
        }
        .theme-btn {
            background: rgba(255, 255, 255, 0.05);
            border: 1px solid rgba(59, 130, 246, 0.2);
            border-radius: 40px;
            width: 34px;
            height: 34px;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
        }
        .mobile-toggle {
            display: none;
            background: rgba(255, 255, 255, 0.05);
            border: 1px solid rgba(59, 130, 246, 0.2);
            border-radius: 10px;
            padding: 0.5rem;
            cursor: pointer;
        }
        .main-app {
            min-height: calc(100vh - 140px);
        }
        .modern-footer {
            background: #0a0e17;
            border-top: 1px solid rgba(59, 130, 246, 0.1);
            padding: 1rem 2rem;
            margin-top: 2rem;
        }
        .footer-container {
            max-width: 1600px;
            margin: 0 auto;
            display: flex;
            justify-content: space-between;
            align-items: center;
            flex-wrap: wrap;
            gap: 1rem;
            font-size: 0.7rem;
            color: #6b8fa8;
        }
        @media (max-width: 992px) {
            .modern-navbar { padding: 0.75rem 1.25rem; }
            .nav-links {
                position: fixed;
                top: 70px;
                left: -100%;
                width: 260px;
                height: calc(100vh - 70px);
                background: #0f172a;
                flex-direction: column;
                align-items: flex-start;
                padding: 1rem;
                transition: left 0.3s ease;
                z-index: 1040;
            }
            .nav-links.open { left: 0; }
            .mobile-toggle { display: flex; }
            .nav-link-custom { width: 100%; }
        }
        @media (max-width: 576px) {
            .modern-navbar { padding: 0.6rem 1rem; }
            .user-name { display: none; }
        }

        /* Auth Card Styles - Enhanced */
.auth-card {
    background: #0d1a26;
    border: 1px solid rgba(56,139,180,0.18);
    border-radius: 20px;
    padding: 2.5rem 2.5rem;
    width: 100%;
    max-width: 450px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.5);
    position: relative;
    overflow: hidden;
}
.auth-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, #2e8fc0, transparent);
}
.auth-card .logo {
    text-align: center;
    margin-bottom: 1.5rem;
}
.auth-card .logo img {
    height: 50px;
    margin-bottom: 0.5rem;
}
.auth-card .logo h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #eef4ff;
    margin: 0.5rem 0 0.25rem;
}
.auth-card .logo p {
    color: #9bb7d0;
    font-size: 0.85rem;
    margin: 0;
}
.auth-card .form-label {
    color: #9bb7d0;
    font-weight: 500;
    font-size: 0.85rem;
}
.auth-card .form-control {
    background: #0f202d;
    border: 1px solid rgba(56,139,180,0.25);
    color: #eef4ff;
    border-radius: 10px;
    padding: 0.75rem 1rem;
    transition: all 0.2s ease;
}
.auth-card .form-control:focus {
    border-color: #2e8fc0;
    box-shadow: 0 0 0 3px rgba(46,143,192,0.25);
    background: #0f202d;
}
.auth-card .form-control::placeholder {
    color: #5f7f99;
}
.auth-card .btn-primary {
    background: linear-gradient(135deg, #1e6f9f, #124e72);
    border: none;
    width: 100%;
    padding: 0.85rem;
    border-radius: 10px;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}
.auth-card .btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #2e8fc0, #1a6690);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(30, 111, 159, 0.4);
}
.auth-card .btn-primary:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}
.auth-card .btn-primary:active:not(:disabled) {
    transform: scale(0.98);
}
.auth-card .auth-link {
    text-align: center;
    margin-top: 1.25rem;
    color: #9bb7d0;
    font-size: 0.9rem;
}
.auth-card .auth-link a {
    color: #2e8fc0;
    text-decoration: none;
    font-weight: 500;
}
.auth-card .auth-link a:hover {
    text-decoration: underline;
}
.auth-tab {
    flex: 1;
    padding: 0.75rem 0;
    font-weight: 600;
    font-size: 0.95rem;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #9bb7d0;
}
.auth-tab:hover {
    color: #eef4ff;
}
.auth-tab.active {
    color: #2e8fc0;
    border-bottom-color: #2e8fc0;
}
.error-message {
    color: #e05c6a;
    font-size: 0.85rem;
    margin-top: 0.5rem;
    text-align: center;
    background: rgba(224,92,106,0.1);
    border: 1px solid rgba(224,92,106,0.3);
    border-radius: 8px;
    padding: 0.75rem 1rem;
}
/* Password strength indicator */
.password-strength {
    height: 4px;
    border-radius: 2px;
    margin-top: 0.5rem;
    background: rgba(56,139,180,0.18);
    overflow: hidden;
}
.password-strength-bar {
    height: 100%;
    width: 0%;
    border-radius: 2px;
    transition: width 0.3s ease;
}

        /* Button styles */
        .db-btn {
            display: inline-flex;
            align-items: center;
            gap: 0.4rem;
            padding: 0.35rem 0.9rem;
            border-radius: 8px;
            font-size: 0.75rem;
            font-weight: 600;
            border: none;
            cursor: pointer;
            transition: all 0.2s ease;
        }
        .db-btn-primary {
            background: linear-gradient(135deg, #1e6f9f, #124e72);
            color: #fff;
        }
        .db-btn-outline {
            background: transparent;
            color: #2e8fc0;
            border: 1px solid rgba(46,143,192,0.3);
        }
        .sync-count {
            background: #ef4444;
            border-radius: 10px;
            padding: 0 5px;
            margin-left: 4px;
        }
        .notifications-container {
            position: fixed;
            bottom: 20px;
            right: 20px;
            z-index: 10001;
        }
        .notification {
            background: #1e293b;
            border-left: 4px solid #3b82f6;
            border-radius: 8px;
            padding: 12px 16px;
            margin-top: 8px;
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 12px;
            box-shadow: 0 4px 12px rgba(0,0,0,0.3);
        }
        .notification.success { border-left-color: #22c55e; }
        .notification.error { border-left-color: #ef4444; }
        .notification.warning { border-left-color: #f59e0b; }

/* Microsoft sign-in card */
.auth-shell { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: #080f17; padding: 20px; }
.auth-title { font-size: 1.5rem; font-weight: 700; margin-top: 0.5rem; color: #eef4ff; }
.auth-sub { color: #9bb7d0; font-size: 0.85rem; margin-top: 0.25rem; }
.auth-ms-btn { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; padding: 0.85rem;
  border-radius: 10px; font-weight: 600; background: linear-gradient(135deg, #1e6f9f, #124e72); border: none; }
.auth-staff-link { display: block; text-align: center; margin-top: 1.25rem; color: #2e8fc0; font-size: 0.9rem; text-decoration: none; }
.auth-staff-link.auth-platform-link { margin-top: 0.5rem; font-size: 0.8rem; color: #7f9bb3; }
.auth-error { background: rgba(239,68,68,0.12); border: 1px solid rgba(239,68,68,0.4); color: #fecaca; border-radius: 10px;
  padding: 0.75rem 1rem; margin-bottom: 1rem; font-size: 0.9rem; }

/* Permission-dependent controls in the module screens (body classes set by web/js/app.js).
   UX only: the server refuses these calls for users without the permission. */
body:not(.can-assessment-write) .grammar-check-btn { display: none !important; }
body:not(.can-cost-manage) .cost-only { display: none !important; }

/* Demo users (web/js/demoStore.js): the warning stays on top of every screen. */
.demo-banner {
    position: sticky; top: 0; z-index: 2000;
    display: flex; flex-wrap: wrap; gap: 4px 16px; align-items: baseline;
    padding: 8px 16px; background: #b45309; color: #fff; font-size: 14px; line-height: 1.35;
}
.demo-banner strong { font-weight: 600; }
.demo-banner-es { opacity: 0.9; font-size: 13px; }
.demo-banner-end { margin-left: auto; font-weight: 600; white-space: nowrap; }

/* Terms of Service and Privacy Policy at the first sign-in (web/js/termsGate.js). */
.terms-gate { position: fixed; inset: 0; z-index: 3000; display: flex; align-items: center; justify-content: center; padding: 16px; background: #0f1b2a; }
.terms-card { max-width: 560px; width: 100%; background: #16263a; color: #e6edf5; border-radius: 12px; padding: 28px; box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4); }
.terms-card h1 { font-size: 22px; margin: 0 0 12px; }
.terms-card a { color: #9bd0ff; }
.terms-es { opacity: 0.85; font-size: 14px; }
.terms-check { display: flex; gap: 8px; align-items: flex-start; margin: 16px 0; cursor: pointer; }
.terms-check input { margin-top: 4px; }
.terms-actions { display: flex; gap: 12px; flex-wrap: wrap; }
