/* ============================================
   HudHud — Algerian Educational Platform
   ============================================ */

:root {
    /* Primary — Duolingo sky blue */
    --hh-primary: #1CB0F6;
    --hh-primary-dark: #1899D6;
    --hh-primary-light: #E8F4FD;
    --hh-primary-50: #EFF6FF;
    --hh-primary-border: #B8DFF6;
    --hh-secondary: #1899D6;
    --hh-secondary-light: #49C0F8;
    --hh-accent: #58CC02;
    --hh-accent-light: #E5F8CC;

    /* Neutrals — from English Test */
    --hh-dark: #0F172A;
    --hh-gray: #64748B;
    --hh-text-muted: #94A3B8;
    --hh-light: #F8FAFC;
    --hh-white: #FFFFFF;
    --hh-warm-white: #F1F5F9;
    --hh-border: #E2E8F0;
    --hh-border-light: #F1F5F9;

    /* Elevation — flat design */
    --hh-shadow: none;
    --hh-shadow-lg: none;

    /* Radius — larger, friendlier */
    --hh-radius: 16px;
    --hh-radius-lg: 24px;
    --hh-radius-full: 9999px;

    /* Typography — Nunito for Duolingo-style rounded feel */
    --hh-font: 'Nunito', 'Inter', 'Noto Sans Arabic', -apple-system, sans-serif;
    --hh-transition: 0.15s ease;

    /* Elevation — restored for interactive elements */
    --hh-hover-shadow: 0 6px 20px rgba(0,0,0,0.08);
    --hh-hover-shadow-colored: 0 8px 24px rgba(28,176,246,0.18);
    --hh-active-shadow: 0 2px 8px rgba(28,176,246,0.2);
}

* { box-sizing: border-box; }

/* Global: kill underlines on all interactive elements */
a, a:hover, a:focus,
.card, .card:hover { text-decoration: none !important; }

body {
    font-family: var(--hh-font);
    color: var(--hh-dark);
    overflow-x: hidden;
    background: var(--hh-light);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ---- Navbar ---- */
.hh-navbar {
    background: var(--hh-white);
    padding: 0;
    transition: var(--hh-transition);
    box-shadow: none;
    border-bottom: 2px solid var(--hh-border-light);
    height: 60px;
}
.hh-navbar .container { height: 100%; }
.hh-navbar.scrolled {
    background: var(--hh-white);
    box-shadow: none;
}

.hh-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
}
.brand-icon { font-size: 1.8rem; }
.brand-icon-img { height: 36px; width: auto; object-fit: contain; }
.hh-brand .brand-text,
.hh-navbar .brand-text {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--hh-primary) !important;
    letter-spacing: -0.5px;
}

.hh-navbar .nav-link {
    color: var(--hh-gray) !important;
    font-weight: 600;
    font-size: 0.9375rem;
    padding: 0.5rem 1rem !important;
    transition: var(--hh-transition);
}
.hh-navbar .nav-link:hover { color: var(--hh-primary) !important; }
.hh-navbar .navbar-toggler { border-color: var(--hh-border); }

.btn-hh-primary {
    background: var(--hh-primary);
    color: var(--hh-white) !important;
    border: none;
    font-weight: 700;
    border-radius: 10px;
    transition: all 0.15s;
}
.btn-hh-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(28,176,246,0.3);
    background: var(--hh-primary-dark);
}

/* ---- Hero ---- */
.hh-hero {
    background: linear-gradient(135deg, #1899D6 0%, #1CB0F6 50%, #49C0F8 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 8rem 0 5rem;
    position: relative;
    overflow: hidden;
}
.hh-hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 80%;
    height: 200%;
    background: radial-gradient(ellipse, rgba(255,255,255,0.08) 0%, transparent 70%);
    pointer-events: none;
}
.hh-hero::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 120px;
    background: linear-gradient(to top, var(--hh-white), transparent);
    pointer-events: none;
}

.hero-title {
    font-size: 3.2rem;
    font-weight: 800;
    color: var(--hh-white);
    line-height: 1.15;
    letter-spacing: -1px;
    margin-bottom: 1.5rem;
}
.hero-title span { color: #58CC02; }

.hero-subtitle {
    font-size: 1.15rem;
    color: rgba(255,255,255,0.8);
    line-height: 1.7;
    margin-bottom: 2.5rem;
    max-width: 540px;
}

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

.btn-hero-primary {
    background: var(--hh-primary);
    color: var(--hh-white);
    padding: 0.85rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: var(--hh-transition);
    text-decoration: none;
}
.btn-hero-primary:hover {
    background: var(--hh-primary-dark);
    color: var(--hh-white);
}
.btn-hero-secondary {
    background: rgba(255,255,255,0.12);
    color: var(--hh-white);
    padding: 0.85rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    border: 1px solid rgba(255,255,255,0.25);
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: var(--hh-transition);
    text-decoration: none;
}
.btn-hero-secondary:hover {
    background: rgba(255,255,255,0.2);
    color: var(--hh-white);
}

/* Hero Visual */
.hero-visual {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}
.hero-bird {
    filter: drop-shadow(0 20px 60px rgba(0,0,0,0.3));
    line-height: 1;
}
.hero-bird-img {
    width: 520px;
    max-width: 100%;
    height: auto;
    object-fit: contain;
}

/* ---- Section Common ---- */
.hh-section {
    padding: 5rem 0;
}
.hh-section-alt { background: var(--hh-light); }
.hh-section-warm { background: var(--hh-warm-white); }

.section-header {
    text-align: center;
    margin-bottom: 3.5rem;
}
.section-title {
    font-size: 2rem;
    font-weight: 800;
    color: var(--hh-dark);
    margin-bottom: 0.75rem;
    letter-spacing: -0.5px;
}
.section-subtitle {
    font-size: 1rem;
    color: var(--hh-gray);
    max-width: 600px;
    margin: 0 auto;
}

/* ---- Pillar Cards ---- */
.pillar-card {
    background: var(--hh-white);
    border-radius: var(--hh-radius-lg);
    padding: 2.5rem 2rem;
    text-align: center;
    transition: all 0.15s;
    border: 2px solid var(--hh-border);
    height: 100%;
    position: relative;
    overflow: hidden;
}
.pillar-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--hh-hover-shadow);
    border-color: var(--hh-primary-border);
    background: var(--hh-primary-50);
}
.pillar-card.active {
    border-color: var(--hh-accent);
    background: linear-gradient(180deg, var(--hh-accent-light) 0%, var(--hh-white) 40%);
}
.pillar-card.coming-soon { opacity: 0.85; }

.pillar-icon {
    width: 80px;
    height: 80px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.25rem;
    margin: 0 auto 1.5rem;
}
.pillar-icon.national { background: #E3F2FD; color: #1565C0; }
.pillar-icon.higher { background: #F3E5F5; color: #7B1FA2; }
.pillar-icon.languages { background: #E8F5E9; color: #2E7D32; }

.pillar-title {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--hh-dark);
    margin-bottom: 0.75rem;
}
.pillar-desc {
    font-size: 0.95rem;
    color: var(--hh-gray);
    line-height: 1.6;
}

/* Badges */
.badge-coming-soon {
    display: inline-block;
    background: linear-gradient(135deg, #CBD5E0, #A0AEC0);
    color: var(--hh-white);
    padding: 0.35rem 1rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 1rem;
}
.badge-active {
    display: inline-block;
    background: linear-gradient(135deg, var(--hh-accent), #2ECC71);
    color: var(--hh-white);
    padding: 0.35rem 1rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 1rem;
    animation: pulse-badge 2s infinite;
}
@keyframes pulse-badge {
    0%, 100% { box-shadow: 0 0 0 0 rgba(39,174,96,0.4); }
    50% { box-shadow: 0 0 0 8px rgba(39,174,96,0); }
}

/* ---- Tool Cards ---- */
.tool-card {
    background: var(--hh-white);
    border-radius: var(--hh-radius-lg);
    padding: 1.75rem;
    transition: all 0.15s;
    border: 2px solid var(--hh-border);
    height: 100%;
    display: flex;
    flex-direction: column;
}
.tool-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--hh-hover-shadow);
    border-color: var(--hh-primary-border);
}
.tool-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: var(--hh-primary-light);
    color: var(--hh-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    margin-bottom: 1.25rem;
}
.tool-title {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--hh-dark);
    margin-bottom: 0.5rem;
}
.tool-desc {
    font-size: 0.9rem;
    color: var(--hh-gray);
    line-height: 1.6;
    flex: 1;
}

/* ---- Audience Cards ---- */
.audience-card {
    background: var(--hh-white);
    border-radius: var(--hh-radius-lg);
    padding: 2.5rem;
    transition: all 0.15s;
    border: 2px solid var(--hh-border);
    height: 100%;
    position: relative;
}
.audience-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--hh-hover-shadow);
    border-color: var(--hh-primary-border);
    background: var(--hh-primary-50);
}
.audience-icon {
    font-size: 3rem;
    margin-bottom: 1.25rem;
}
.audience-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--hh-secondary);
    margin-bottom: 0.75rem;
}
.audience-desc {
    font-size: 0.95rem;
    color: var(--hh-gray);
    line-height: 1.7;
}

/* ---- Bac Section ---- */
.bac-section {
    background: linear-gradient(135deg, #1899D6 0%, #1CB0F6 100%);
    padding: 5rem 0;
    color: var(--hh-white);
}
.bac-feature {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 0;
}
.bac-feature-icon {
    width: 48px;
    height: 48px;
    min-width: 48px;
    border-radius: 12px;
    background: rgba(255,255,255,0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
}
.bac-feature-text {
    font-size: 1.05rem;
    font-weight: 500;
}

.bac-visual {
    display: flex;
    justify-content: center;
    align-items: center;
}
.bac-mockup {
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: var(--hh-radius-lg);
    padding: 2rem;
    width: 100%;
    max-width: 380px;
    text-align: center;
}
.bac-mockup-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    opacity: 0.9;
}
.bac-mockup-score {
    font-size: 3.5rem;
    font-weight: 800;
    color: var(--hh-primary);
    line-height: 1;
    margin-bottom: 0.5rem;
}
.bac-mockup-label {
    font-size: 0.9rem;
    opacity: 0.7;
}

/* ---- Newsletter ---- */
.newsletter-section { background: var(--hh-warm-white); }
.newsletter-form {
    max-width: 500px;
    margin: 0 auto;
    display: flex;
    gap: 0.75rem;
}
.newsletter-form input {
    flex: 1;
    padding: 0.75rem 1.25rem;
    border: 1px solid var(--hh-border);
    border-radius: 10px;
    font-size: 0.95rem;
    background: var(--hh-white);
}
.newsletter-form input:focus {
    outline: none;
    border-color: var(--hh-primary);
    box-shadow: 0 0 0 3px rgba(28,176,246,0.15);
}
.newsletter-form button {
    padding: 0.75rem 1.75rem;
    white-space: nowrap;
}

/* ---- Footer ---- */
.hh-footer {
    background: var(--hh-dark);
    color: rgba(255,255,255,0.7);
    padding: 4rem 0 2rem;
}
.footer-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}
.footer-brand .brand-icon { font-size: 1.6rem; }
.footer-brand .brand-icon-img { height: 28px; }
.footer-brand .brand-text {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--hh-white);
}
.footer-desc {
    font-size: 0.9rem;
    line-height: 1.7;
    margin-bottom: 0.75rem;
}
.footer-made { font-size: 0.85rem; }
.footer-heading {
    color: var(--hh-white);
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 1rem;
}
.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}
.footer-links li {
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}
.footer-links a {
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    transition: var(--hh-transition);
}
.footer-links a:hover { color: var(--hh-primary); }
.footer-social { display: flex; gap: 0.75rem; }
.social-link {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    transition: var(--hh-transition);
    font-size: 1.1rem;
}
.social-link:hover {
    background: var(--hh-primary);
    color: var(--hh-white);
}
.footer-divider {
    border-color: rgba(255,255,255,0.1);
    margin: 2rem 0 1.5rem;
}
.footer-bottom {
    text-align: center;
    font-size: 0.85rem;
    opacity: 0.6;
}

/* ---- Stats Bar ---- */
.stats-bar {
    padding: 3rem 0;
    background: var(--hh-white);
    border-bottom: 1px solid var(--hh-border);
}
.stat-item { text-align: center; }
.stat-number {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--hh-primary);
    line-height: 1;
}
.stat-label {
    font-size: 0.9rem;
    color: var(--hh-gray);
    margin-top: 0.25rem;
}

/* ---- Responsive ---- */
@media (max-width: 991px) {
    .hero-title { font-size: 2.4rem; }
    .hero-visual { margin-top: 3rem; }
    .hero-bird-img { width: 400px; }
    .section-title { font-size: 1.8rem; }
    .hh-hero { padding-top: 7rem; }
    .hh-navbar .btn-sm { font-size: 0.78rem; padding: 0.3rem 0.65rem; }
}

@media (max-width: 576px) {
    .hero-title { font-size: 1.9rem; }
    .hero-subtitle { font-size: 1rem; }
    .hero-buttons { flex-direction: column; }
    .hero-buttons a { text-align: center; justify-content: center; }
    .hero-bird-img { width: 300px; }
    .hh-section { padding: 3.5rem 0; }
    .section-title { font-size: 1.5rem; }
    .newsletter-form { flex-direction: column; }
    .newsletter-form button { width: 100%; }
    .bac-mockup { max-width: 280px; }
}

/* ---- RTL adjustments ---- */
[dir="rtl"] .hero-subtitle { max-width: 580px; }
[dir="rtl"] .brand-text { letter-spacing: 0; }
[dir="rtl"] .hh-navbar .nav-link { font-size: 0.95rem; }

/* ---- Auth Pages ---- */
.auth-card {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: var(--hh-radius-lg);
    padding: 2.5rem;
    backdrop-filter: blur(12px);
}
.auth-brand {
    text-decoration: none;
    display: inline-block;
}
.auth-brand h2 {
    color: var(--hh-white);
    font-weight: 700;
    font-size: 1.5rem;
    margin: 0.3rem 0 0;
}
.auth-subtitle {
    color: rgba(255,255,255,0.6);
    font-size: 0.9rem;
    margin-bottom: 0;
}
.auth-field {
    margin-bottom: 1rem;
}
.auth-field label {
    display: block;
    color: rgba(255,255,255,0.8);
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 0.35rem;
}
.auth-input {
    width: 100%;
    padding: 0.65rem 1rem;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 10px;
    color: var(--hh-white);
    font-size: 0.95rem;
    transition: var(--hh-transition);
    font-family: var(--hh-font);
}
.auth-input::placeholder { color: rgba(255,255,255,0.35); }
.auth-input:focus {
    outline: none;
    border-color: var(--hh-primary);
    background: rgba(255,255,255,0.12);
    box-shadow: 0 0 0 3px rgba(28,176,246,0.2);
}
.auth-input option { color: var(--hh-dark); background: var(--hh-white); }

.btn-google {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.7rem 1rem;
    background: var(--hh-white);
    color: var(--hh-dark);
    border: none;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 500;
    text-decoration: none;
    transition: var(--hh-transition);
    cursor: pointer;
    font-family: var(--hh-font);
}
.btn-google:hover {
    background: #f1f1f1;
    color: var(--hh-dark);
}

.auth-divider {
    display: flex;
    align-items: center;
    margin: 1.25rem 0;
    color: rgba(255,255,255,0.4);
    font-size: 0.85rem;
}
.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(255,255,255,0.15);
}
.auth-divider span { padding: 0 1rem; }

.auth-footer {
    text-align: center;
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.6);
    font-size: 0.9rem;
}
.auth-footer a {
    color: var(--hh-primary);
    text-decoration: none;
    font-weight: 600;
}
.auth-footer a:hover { text-decoration: underline; }

.alert-sm {
    font-size: 0.85rem;
    padding: 0.6rem 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}
.alert-danger { background: rgba(220,53,69,0.15); color: #ff6b6b; border: 1px solid rgba(220,53,69,0.3); }
.alert-success { background: rgba(39,174,96,0.15); color: #51cf66; border: 1px solid rgba(39,174,96,0.3); }
.alert-warning { background: rgba(255,193,7,0.15); color: #ffd43b; border: 1px solid rgba(255,193,7,0.3); }

/* ---- Signup Role Selection ---- */
.signup-hero { min-height: 100vh; display: flex; align-items: center; }
.signup-visual { padding: 2rem 0; }
.signup-logo-img {
    width: 320px;
    max-width: 90%;
    height: auto;
    filter: drop-shadow(0 20px 50px rgba(0,0,0,0.3));
    animation: float 4s ease-in-out infinite;
    margin-bottom: 1.5rem;
}
.signup-tagline {
    color: rgba(255,255,255,0.6);
    font-size: 1rem;
    margin-bottom: 2rem;
}
.signup-fact {
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: var(--hh-radius);
    padding: 1.25rem 1.5rem;
    text-align: left;
    max-width: 340px;
    margin: 0 auto;
}
.signup-fact-label {
    font-weight: 700;
    color: var(--hh-white);
    font-size: 0.95rem;
    margin-bottom: 0.4rem;
}
.signup-fact-text {
    color: rgba(255,255,255,0.7);
    font-size: 0.88rem;
    line-height: 1.5;
    margin: 0;
}
.signup-card {
    padding: 2.5rem;
}
.signup-title {
    color: var(--hh-white);
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 0.3rem;
}
.signup-subtitle {
    color: rgba(255,255,255,0.55);
    font-size: 0.95rem;
    margin-bottom: 1.75rem;
}
.signup-roles {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.signup-role {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: var(--hh-radius);
    text-decoration: none;
    color: var(--hh-white);
    cursor: pointer;
    transition: all 0.25s ease;
    position: relative;
    overflow: hidden;
}
.signup-role:hover {
    background: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.2);
    color: var(--hh-white);
}
.signup-role-teacher:hover {
    border-color: var(--hh-primary);
    box-shadow: none;
}
.signup-role-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
}
.teacher-icon { background: rgba(28,176,246,0.2); color: var(--hh-primary); }
.learner-icon { background: rgba(52,152,219,0.2); color: #3498DB; }
.parent-icon { background: rgba(39,174,96,0.2); color: #27AE60; }
.signup-role-content { flex: 1; }
.signup-role-name { font-weight: 600; font-size: 1rem; }
.signup-role-desc { font-size: 0.82rem; color: rgba(255,255,255,0.5); margin-top: 2px; }
.signup-role-arrow {
    font-size: 1.1rem;
    opacity: 0.4;
    transition: all 0.25s ease;
}
.signup-role:hover .signup-role-arrow { opacity: 0.8; }
.signup-coming-badge {
    font-size: 0.7rem;
    font-weight: 600;
    color: #ffd43b;
    background: rgba(255,212,59,0.15);
    padding: 3px 10px;
    border-radius: 20px;
    white-space: nowrap;
    flex-shrink: 0;
    opacity: 0.6;
    transition: all 0.3s ease;
}
.signup-role-soon.clicked {
    background: rgba(255,255,255,0.03);
    border-color: rgba(255,212,59,0.3);
    cursor: default;
}
.signup-role-soon.clicked .signup-coming-badge {
    opacity: 1;
    transform: scale(1.05);
    animation: badgePulse 0.4s ease;
}
.signup-role-soon.clicked .signup-role-icon { opacity: 0.5; }
.signup-role-soon.clicked .signup-role-name { opacity: 0.6; }
.signup-role-soon.clicked .signup-role-desc { opacity: 0.4; }
@keyframes badgePulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.15); }
    100% { transform: scale(1.05); }
}
@media (max-width: 991px) {
    .signup-logo-img { width: 240px; }
    .signup-fact { max-width: 100%; }
}
@media (max-width: 576px) {
    .signup-logo-img { width: 200px; }
    .signup-card { padding: 1.75rem; }
    .signup-title { font-size: 1.4rem; }
    .signup-role { padding: 0.85rem 1rem; gap: 0.75rem; }
    .signup-role-icon { width: 40px; height: 40px; font-size: 1.1rem; }
}

/* ---- App Layout (Dashboard) ---- */
.app-wrapper {
    display: flex;
    min-height: 100vh;
}
.app-sidebar {
    width: 220px;
    background: var(--hh-white);
    color: var(--hh-dark);
    position: fixed;
    top: 0;
    bottom: 0;
    overflow-y: auto;
    z-index: 1000;
    transition: var(--hh-transition);
    border-right: 2px solid var(--hh-border-light);
}
[dir="rtl"] .app-sidebar { border-right: none; border-left: 2px solid var(--hh-border-light); }
.app-sidebar-brand {
    padding: 0 1.25rem;
    border-bottom: 2px solid var(--hh-border-light);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    height: 60px;
}
.app-sidebar-brand .brand-icon { font-size: 1.5rem; }
.app-sidebar-brand .brand-icon-img { height: 28px; }
.app-sidebar-brand .brand-text { font-size: 1.15rem; font-weight: 800; color: var(--hh-primary); }

.app-sidebar-user {
    padding: 1rem 1.25rem;
    border-bottom: 2px solid var(--hh-border-light);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.app-sidebar-user img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--hh-border);
}
.app-user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--hh-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.875rem;
    color: var(--hh-white);
}
.app-user-name { font-weight: 700; font-size: 0.875rem; color: var(--hh-dark); }
.app-user-role { font-size: 0.75rem; color: var(--hh-text-muted); text-transform: capitalize; }

.app-nav { padding: 0.75rem 0; }
.app-nav-label {
    padding: 0.5rem 1.25rem;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--hh-text-muted);
    margin-top: 0.5rem;
}
.app-nav-item {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 8px 12px;
    color: var(--hh-dark);
    text-decoration: none;
    font-size: 0.8125rem;
    font-weight: 700;
    letter-spacing: 0.3px;
    transition: all 0.15s;
    border: 2px solid transparent;
    border-radius: var(--hh-radius);
    margin: 3px 8px;
}
[dir="rtl"] .app-nav-item { }
.app-nav-item:hover {
    color: var(--hh-dark);
    background: var(--hh-warm-white);
    border-color: transparent;
}
.app-nav-item.active {
    color: var(--hh-primary);
    background: var(--hh-primary-light);
    border-color: var(--hh-primary-border);
    font-weight: 700;
}
[dir="rtl"] .app-nav-item.active { }

/* Icon: colored pill backgrounds — flat cartoon style */
.app-nav-item i {
    font-size: 1rem;
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    flex-shrink: 0;
    /* default fallback color */
    background: var(--hh-warm-white);
    color: var(--hh-gray);
}

/* ── Vivid icon colors per category ── */
/* Dashboard / AI Tools — Orange */
.app-nav-item i.bi-speedometer2,
.app-nav-item i.bi-cpu         { background: #FFF3E0; color: #F57C00; }
/* Users — Blue */
.app-nav-item i.bi-people      { background: #E3F2FD; color: #1976D2; }
/* Usage / Analytics — Purple */
.app-nav-item i.bi-graph-up    { background: #F3E5F5; color: #7B1FA2; }
/* Charts — Green */
.app-nav-item i.bi-bar-chart-line { background: #E8F5E9; color: #2E7D32; }
/* Login / Key — Red */
.app-nav-item i.bi-key         { background: #FFEBEE; color: #D32F2F; }
/* Settings — Teal */
.app-nav-item i.bi-gear        { background: #E0F2F1; color: #00796B; }
/* Subjects — Green */
.app-nav-item i.bi-grid-3x3-gap { background: #E8F5E9; color: #2E7D32; }
/* My Content — Purple */
.app-nav-item i.bi-folder2     { background: #F3E5F5; color: #7B1FA2; }
/* Profile — Warm amber */
.app-nav-item i.bi-person      { background: #FFF8E1; color: #F9A825; }
/* Switch / navigation — Sky */
.app-nav-item i.bi-arrow-left-right,
.app-nav-item i.bi-arrow-left-circle,
.app-nav-item i.bi-arrow-repeat { background: #E8F4FD; color: #1CB0F6; }
/* Logout — Soft red */
.app-nav-item i.bi-box-arrow-right,
.app-nav-item i.bi-box-arrow-left { background: #FBE9E7; color: #E64A19; }

.app-main {
    flex: 1;
    margin-left: 220px;
    background: var(--hh-white);
    min-height: 100vh;
}
[dir="rtl"] .app-main { margin-left: 0; margin-right: 220px; }

.app-topbar {
    background: var(--hh-white);
    padding: 0 2rem;
    height: 60px;
    border-bottom: 2px solid var(--hh-border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.app-topbar-title {
    font-size: 1.125rem;
    font-weight: 800;
    color: var(--hh-primary);
}
.app-content { padding: 2rem; }

/* Dashboard cards */
.dash-tool-card {
    background: var(--hh-white);
    border-radius: var(--hh-radius-lg);
    padding: 1.75rem;
    border: 2px solid var(--hh-border);
    transition: all 0.15s;
    text-decoration: none;
    display: block;
    height: 100%;
    color: var(--hh-dark);
}
.dash-tool-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--hh-hover-shadow);
    border-color: var(--hh-primary-border);
    color: var(--hh-dark);
}
.dash-tool-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: var(--hh-primary-light);
    color: var(--hh-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    margin-bottom: 1rem;
}
.dash-tool-title {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--hh-dark);
    margin-bottom: 0.4rem;
}
.dash-tool-desc {
    font-size: 0.85rem;
    color: var(--hh-gray);
    line-height: 1.5;
    margin: 0;
}

/* Mobile sidebar toggle */
.app-sidebar-toggle {
    display: none;
    background: var(--hh-primary);
    color: var(--hh-white);
    border: none;
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    font-size: 1.2rem;
    cursor: pointer;
}

@media (max-width: 991px) {
    .app-sidebar {
        transform: translateX(-100%);
    }
    [dir="rtl"] .app-sidebar { transform: translateX(100%); }
    .app-sidebar.open { transform: translateX(0); }
    .app-main { margin-left: 0 !important; margin-right: 0 !important; }
    .app-sidebar-toggle { display: inline-flex; }
    .app-content { padding: 1.25rem; }
    .app-topbar { padding: 0.75rem 1.25rem; }
}

/* ---- Smooth scroll ---- */
html { scroll-behavior: smooth; }

/* ---- Scroll padding for fixed navbar ---- */
html { scroll-padding-top: 80px; }

/* ============================================
   AI Tool Pages
   ============================================ */

/* Tool Header */
.tool-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
}
.tool-header-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    background: var(--hh-primary-light);
    color: var(--hh-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}
.tool-header-title {
    font-weight: 700;
    color: var(--hh-secondary);
    font-size: 1.5rem;
    margin: 0;
}
.tool-header-desc {
    color: var(--hh-gray);
    font-size: 0.9rem;
    margin: 0.25rem 0 0;
}

/* Tool Form Card */
.tool-form-card {
    background: var(--hh-white);
    border-radius: var(--hh-radius);
    padding: 1.75rem;
    border: 1px solid var(--hh-border);
    position: sticky;
    top: 1rem;
}
.tool-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--hh-secondary);
    margin-bottom: 0.4rem;
}
.tool-input {
    border-radius: 10px !important;
    border: 1px solid var(--hh-border) !important;
    padding: 0.6rem 1rem !important;
    font-size: 0.9rem !important;
    transition: var(--hh-transition);
}
.tool-input:focus {
    border-color: var(--hh-primary) !important;
    box-shadow: 0 0 0 3px rgba(28,176,246,0.15) !important;
}
.tool-char-count {
    text-align: right;
    font-size: 0.75rem;
    color: var(--hh-gray);
    margin-top: 0.25rem;
}
.tool-hint {
    font-size: 0.78rem;
    color: var(--hh-gray);
    margin-top: 0.3rem;
}
.tool-or-divider {
    text-align: center;
    color: var(--hh-gray);
    font-size: 0.8rem;
    font-weight: 500;
    margin: 0.25rem 0 0.75rem;
    position: relative;
}
.tool-or-divider::before,
.tool-or-divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 35%;
    height: 1px;
    background: var(--hh-border);
}
.tool-or-divider::before { left: 0; }
.tool-or-divider::after { right: 0; }

/* CEFR Level Buttons */
.tool-level-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 0.4rem;
}
.tool-level-btn {
    padding: 0.5rem 0;
    border-radius: 8px;
    border: 1.5px solid var(--hh-border);
    background: var(--hh-white);
    color: var(--hh-secondary);
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--hh-transition);
}
.tool-level-btn:hover {
    border-color: var(--hh-primary);
    background: var(--hh-primary-light);
}
.tool-level-btn.active {
    background: var(--hh-primary);
    color: var(--hh-white);
    border-color: var(--hh-primary);
}

/* Generate Button */
.tool-generate-btn {
    background: var(--hh-primary);
    color: var(--hh-white);
    border: none;
    padding: 0.75rem 2rem;
    border-radius: 10px;
    font-weight: 600;
    font-size: 1rem;
    transition: var(--hh-transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}
.tool-generate-btn:hover {
    background: var(--hh-primary-dark);
    color: var(--hh-white);
}
.tool-generate-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Output States */
.tool-output-empty {
    background: var(--hh-white);
    border: 2px dashed var(--hh-border);
    border-radius: var(--hh-radius);
    padding: 4rem 2rem;
    text-align: center;
    min-height: 350px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.tool-output-empty-icon {
    width: 64px;
    height: 64px;
    background: url('../img/bird.png') center/contain no-repeat;
    opacity: 0.2;
    filter: grayscale(100%);
    margin-bottom: 1rem;
    font-size: 0;
    color: transparent;
}
.tool-output-empty-icon i { display: none; }
.tool-output-empty h5 {
    color: var(--hh-gray);
    font-weight: 600;
}
.tool-output-empty p {
    color: var(--hh-gray);
    font-size: 0.9rem;
    opacity: 0.7;
}

.tool-output-loading {
    background: var(--hh-white);
    border: 1px solid var(--hh-border);
    border-radius: var(--hh-radius);
    padding: 4rem 2rem;
    text-align: center;
    min-height: 350px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.tool-loading-spinner {
    width: 56px;
    height: 56px;
    background: url('../img/bird.png') center/contain no-repeat;
    animation: birdBob 1.2s ease-in-out infinite;
    margin-bottom: 1rem;
    border: none;
    border-radius: 0;
}
@keyframes birdBob {
    0%, 100% { transform: translateY(0) scale(1); }
    25% { transform: translateY(-8px) scale(1.04); }
    50% { transform: translateY(0) scale(1); }
    75% { transform: translateY(-4px) scale(1.02); }
}
@keyframes spin { to { transform: rotate(360deg); } }
.tool-output-loading p {
    color: var(--hh-gray);
    font-weight: 500;
}

/* Result Card */
.tool-output-result {
    background: var(--hh-white);
    border: 1px solid var(--hh-border);
    border-radius: var(--hh-radius);
    overflow: hidden;
}
.tool-result-header {
    padding: 1.25rem 1.75rem;
    border-bottom: 1px solid var(--hh-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
}
.tool-result-header h5 {
    font-weight: 700;
    color: var(--hh-secondary);
    margin: 0;
    font-size: 1.1rem;
}
.tool-result-meta {
    display: flex;
    gap: 0.5rem;
}
.tool-badge {
    padding: 0.3rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    background: var(--hh-primary-light);
    color: var(--hh-primary);
}
.tool-badge-secondary {
    background: #EBF5FB;
    color: var(--hh-secondary-light);
}
.tool-result-body {
    padding: 1.75rem;
    line-height: 1.85;
    color: var(--hh-dark);
    font-size: 0.95rem;
}
.tool-result-body p {
    margin-bottom: 1rem;
}
.tool-result-body p:last-child {
    margin-bottom: 0;
}

/* Vocabulary Tags */
.tool-result-vocab {
    padding: 1rem 1.75rem;
    border-top: 1px solid var(--hh-border);
    background: var(--hh-light);
}
.tool-result-vocab h6 {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--hh-gray);
    margin-bottom: 0.5rem;
}
.tool-vocab-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}
.tool-vocab-tag {
    padding: 0.25rem 0.65rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 500;
    background: var(--hh-primary-light);
    color: var(--hh-primary-dark);
}

/* Result Actions */
.tool-result-actions {
    padding: 1rem 1.75rem;
    border-top: 1px solid var(--hh-border);
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.tool-action-btn {
    padding: 0.45rem 1rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--hh-secondary);
    border: 1px solid var(--hh-border);
    background: var(--hh-white);
    display: flex;
    align-items: center;
    gap: 0.4rem;
    transition: var(--hh-transition);
}
.tool-action-btn:hover {
    border-color: var(--hh-primary);
    color: var(--hh-primary);
    background: var(--hh-primary-light);
}

/* Error State */
.tool-output-error {
    background: #FFF5F5;
    border: 1px solid #FED7D7;
    border-radius: var(--hh-radius);
    padding: 1.25rem 1.5rem;
    color: #C53030;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* ---- Discussion Questions Styles ---- */
.dq-questions-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}
.dq-question-card {
    display: flex;
    gap: 1rem;
    padding: 1.25rem 1.75rem;
    border-bottom: 1px solid var(--hh-border);
    transition: var(--hh-transition);
}
.dq-question-card:last-child {
    border-bottom: none;
}
.dq-question-card:hover {
    background: var(--hh-light);
}
.dq-question-number {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--hh-primary-light);
    color: var(--hh-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    flex-shrink: 0;
    margin-top: 0.1rem;
}
.dq-question-content {
    flex: 1;
}
.dq-question-text {
    font-size: 0.95rem;
    color: var(--hh-dark);
    margin: 0 0 0.5rem;
    line-height: 1.6;
    font-weight: 500;
}
.dq-type-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.2rem 0.6rem;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: capitalize;
    margin-bottom: 0.4rem;
}
.dq-type-opinion { background: #FFF3E0; color: #E65100; }
.dq-type-experience { background: #E8F5E9; color: #2E7D32; }
.dq-type-hypothetical { background: #E3F2FD; color: #1565C0; }
.dq-type-comparative { background: #F3E5F5; color: #7B1FA2; }
.dq-question-hint {
    font-size: 0.82rem;
    color: var(--hh-gray);
    background: var(--hh-light);
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    margin-top: 0.4rem;
    display: flex;
    align-items: flex-start;
    gap: 0.4rem;
}
.dq-question-hint i {
    color: var(--hh-primary);
    flex-shrink: 0;
    margin-top: 0.1rem;
}

/* ---- Vocabulary Builder Styles ---- */
.vb-instructions {
    padding: 1rem 1.75rem;
    background: var(--hh-primary-light);
    border-bottom: 1px solid var(--hh-border);
    font-size: 0.9rem;
    color: var(--hh-secondary);
    font-weight: 500;
}
.vb-instructions p { margin: 0; }
.vb-exercise-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}
.vb-exercise-item {
    display: flex;
    gap: 1rem;
    padding: 1.25rem 1.75rem;
    border-bottom: 1px solid var(--hh-border);
    transition: var(--hh-transition);
}
.vb-exercise-item:last-child {
    border-bottom: none;
}
.vb-exercise-item:hover {
    background: var(--hh-light);
}
.vb-item-number {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--hh-secondary);
    color: var(--hh-white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.75rem;
    flex-shrink: 0;
    margin-top: 0.15rem;
}
.vb-item-content {
    flex: 1;
}
.vb-item-word {
    font-weight: 700;
    color: var(--hh-primary);
    font-size: 1rem;
    margin-bottom: 0.25rem;
}
.vb-item-definition {
    font-size: 0.88rem;
    color: var(--hh-gray);
    margin-bottom: 0.35rem;
    font-style: italic;
}
.vb-item-sentence {
    font-size: 0.9rem;
    color: var(--hh-dark);
    line-height: 1.6;
    padding: 0.5rem 0.75rem;
    background: var(--hh-light);
    border-radius: 8px;
    border-left: 3px solid var(--hh-primary);
}
.vb-word-bank {
    padding: 1rem 1.75rem;
    border-top: 1px solid var(--hh-border);
    background: var(--hh-light);
}
.vb-word-bank h6 {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--hh-gray);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.vb-answer-section {
    padding: 1rem 1.75rem;
    border-top: 1px solid var(--hh-border);
}
.vb-answers {
    margin-top: 1rem;
    padding: 1rem;
    background: var(--hh-accent-light);
    border-radius: 10px;
    border: 1px solid #C6F6D5;
}
.vb-answer-list {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}
.vb-answer-item {
    font-size: 0.88rem;
    color: var(--hh-dark);
    padding: 0.3rem 0;
}
.vb-answer-item strong {
    color: var(--hh-accent);
    margin-right: 0.3rem;
}

/* ---- Grammar Exercises Styles ---- */
.gr-exercise-list {
    display: flex;
    flex-direction: column;
}
.gr-exercise-item {
    display: flex;
    gap: 1rem;
    padding: 1.25rem 1.75rem;
    border-bottom: 1px solid var(--hh-border);
    transition: var(--hh-transition);
}
.gr-exercise-item:last-child { border-bottom: none; }
.gr-exercise-item:hover { background: var(--hh-light); }
.gr-item-content { flex: 1; }
.gr-item-question {
    font-size: 0.95rem;
    color: var(--hh-dark);
    margin: 0 0 0.6rem;
    line-height: 1.7;
}
.gr-options {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-top: 0.4rem;
}
.gr-option {
    padding: 0.45rem 0.85rem;
    border-radius: 8px;
    background: var(--hh-light);
    font-size: 0.88rem;
    color: var(--hh-dark);
    border: 1px solid transparent;
    transition: var(--hh-transition);
}
.gr-option:hover {
    border-color: var(--hh-primary);
    background: var(--hh-primary-light);
}
.gr-tip {
    padding: 1rem 1.75rem;
    border-top: 1px solid var(--hh-border);
    background: #FFF8E1;
}
.gr-tip h6 {
    font-size: 0.82rem;
    font-weight: 600;
    color: #F57F17;
    margin-bottom: 0.4rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.gr-tip p {
    font-size: 0.88rem;
    color: var(--hh-dark);
    margin: 0;
    line-height: 1.6;
}
.gr-answer-item {
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(0,0,0,0.06);
    font-size: 0.88rem;
}
.gr-answer-item:last-child { border-bottom: none; }
.gr-answer-item strong {
    color: var(--hh-accent);
    margin-right: 0.3rem;
}
.gr-explanation {
    font-size: 0.82rem;
    color: var(--hh-gray);
    margin-top: 0.2rem;
    padding-left: 1.2rem;
    font-style: italic;
}

/* ---- Lesson Planner Styles ---- */
.lp-section {
    padding: 1rem 1.75rem;
    border-bottom: 1px solid var(--hh-border);
}
.lp-section:last-child { border-bottom: none; }
.lp-section-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--hh-secondary);
    margin-bottom: 0.6rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}
.lp-section-title i { color: var(--hh-primary); }
.lp-section p {
    font-size: 0.9rem;
    color: var(--hh-dark);
    margin: 0;
    line-height: 1.7;
}
.lp-objectives-list {
    margin: 0;
    padding-left: 1.25rem;
    list-style: none;
}
.lp-objectives-list li {
    font-size: 0.9rem;
    color: var(--hh-dark);
    padding: 0.25rem 0;
    position: relative;
    padding-left: 1.25rem;
}
.lp-objectives-list li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--hh-accent);
    font-weight: 700;
}
.lp-materials {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}
.lp-phases {
    display: flex;
    flex-direction: column;
}
.lp-phase-card {
    padding: 1.25rem 1.75rem;
    border-bottom: 1px solid var(--hh-border);
    transition: var(--hh-transition);
}
.lp-phase-card:hover { background: var(--hh-light); }
.lp-phase-card:last-child { border-bottom: none; }
.lp-phase-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.6rem;
}
.lp-phase-header i {
    color: var(--hh-primary);
    font-size: 1.1rem;
}
.lp-phase-title {
    font-weight: 700;
    color: var(--hh-secondary);
    font-size: 0.95rem;
    flex: 1;
}
.lp-phase-duration {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--hh-primary);
    background: var(--hh-primary-light);
    padding: 0.2rem 0.6rem;
    border-radius: 6px;
}
.lp-phase-activity {
    font-size: 0.9rem;
    color: var(--hh-dark);
    line-height: 1.7;
    margin-bottom: 0.5rem;
}
.lp-phase-instructions {
    font-size: 0.82rem;
    color: var(--hh-gray);
    background: var(--hh-light);
    padding: 0.6rem 0.85rem;
    border-radius: 8px;
    border-left: 3px solid var(--hh-primary);
    line-height: 1.6;
}
.lp-homework {
    background: #FFF8E1;
}
.lp-differentiation {
    background: #E8F5E9;
}

/* ---- Dialogue Generator Styles ---- */
.dl-scene-text {
    padding: 1rem 1.75rem;
    background: var(--hh-light);
    color: var(--hh-gray);
    font-size: 0.88rem;
    font-style: italic;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-bottom: 1px solid var(--hh-border);
}
.dl-scene-text i { color: var(--hh-primary); }
.dl-dialogue {
    padding: 1.5rem 1.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.dl-line {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    max-width: 85%;
}
.dl-line-a { align-self: flex-start; }
.dl-line-b { align-self: flex-end; flex-direction: row-reverse; }
.dl-speaker {
    min-width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.7rem;
    flex-shrink: 0;
    text-align: center;
    padding: 0 4px;
    line-height: 1.1;
}
.dl-line-a .dl-speaker { background: var(--hh-primary-light); color: var(--hh-primary); }
.dl-line-b .dl-speaker { background: #EBF5FB; color: var(--hh-secondary-light); }
.dl-bubble {
    padding: 0.75rem 1rem;
    border-radius: 14px;
    font-size: 0.9rem;
    line-height: 1.6;
}
.dl-line-a .dl-bubble {
    background: var(--hh-light);
    color: var(--hh-dark);
    border-bottom-left-radius: 4px;
}
.dl-line-b .dl-bubble {
    background: var(--hh-primary);
    color: var(--hh-white);
    border-bottom-right-radius: 4px;
}

/* ---- Three Titles Styles ---- */
.tt-instruction {
    padding: 0 1.75rem;
    color: var(--hh-gray);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}
.tt-titles {
    padding: 0 1.75rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.tt-title-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border-radius: 10px;
    border: 2px solid var(--hh-border);
    cursor: pointer;
    transition: var(--hh-transition);
}
.tt-title-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(28,176,246,0.12);
    border-color: var(--hh-primary);
    background: var(--hh-primary-light);
}
.tt-title-card.selected {
    border-color: var(--hh-primary);
    background: var(--hh-primary-light);
    box-shadow: 0 2px 8px rgba(28,176,246,0.2);
}
.tt-title-card.tt-correct {
    border-color: var(--hh-accent);
    background: var(--hh-accent-light);
}
.tt-title-card.tt-wrong {
    border-color: #FED7D7;
    background: #FFF5F5;
    opacity: 0.7;
}
.tt-letter {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--hh-secondary);
    color: var(--hh-white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    flex-shrink: 0;
}
.tt-title-card.tt-correct .tt-letter { background: var(--hh-accent); }
.tt-title-card.tt-wrong .tt-letter { background: #E53E3E; }
.tt-title-text {
    font-size: 0.95rem;
    color: var(--hh-dark);
    font-weight: 500;
    line-height: 1.5;
}
.tt-answer {
    padding: 0 1.75rem 1rem;
}
.tt-answer-box {
    padding: 0.75rem 1rem;
    background: var(--hh-accent-light);
    border-radius: 10px;
    border: 1px solid #C6F6D5;
    font-size: 0.9rem;
    color: var(--hh-dark);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* ---- Lead-in Activity Styles ---- */
.li-activity-card {
    padding: 1.25rem 1.75rem;
    border-bottom: 1px solid var(--hh-border);
    transition: var(--hh-transition);
}
.li-activity-card:last-child { border-bottom: none; }
.li-activity-card:hover { background: var(--hh-light); }
.li-activity-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}
.li-activity-num {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--hh-white);
    font-size: 1.1rem;
    flex-shrink: 0;
}
.li-activity-title {
    font-weight: 700;
    color: var(--hh-secondary);
    font-size: 1rem;
    margin: 0;
}
.li-activity-type {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--hh-gray);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.li-activity-time {
    margin-left: auto;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--hh-primary);
    background: var(--hh-primary-light);
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    white-space: nowrap;
}
[dir="rtl"] .li-activity-time { margin-left: 0; margin-right: auto; }
.li-activity-desc {
    font-size: 0.9rem;
    color: var(--hh-dark);
    line-height: 1.6;
    margin: 0 0 0.5rem;
}
.li-activity-steps {
    font-size: 0.85rem;
    color: var(--hh-dark);
    background: var(--hh-light);
    padding: 0.75rem 1rem;
    border-radius: 8px;
    border-left: 3px solid var(--hh-primary);
}
.li-activity-steps strong {
    font-size: 0.82rem;
    color: var(--hh-secondary);
}
.li-activity-steps ol {
    margin: 0.4rem 0 0;
    padding-left: 1.25rem;
}
.li-activity-steps li {
    padding: 0.15rem 0;
    line-height: 1.5;
}

/* ---- Reading Bits & Pieces Styles ---- */
.rb-texts {
    display: flex;
    flex-direction: column;
}
.rb-text-card {
    padding: 1.25rem 1.75rem;
    border-bottom: 1px solid var(--hh-border);
    transition: var(--hh-transition);
}
.rb-text-card:last-child { border-bottom: none; }
.rb-text-card:hover { background: var(--hh-light); }
.rb-text-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}
.rb-type-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}
.rb-type-email { background: #E3F2FD; color: #1565C0; }
.rb-type-sms { background: #E8F5E9; color: #2E7D32; }
.rb-type-social { background: #FCE4EC; color: #C62828; }
.rb-type-note { background: #FFF8E1; color: #F57F17; }
.rb-type-sign { background: #F3E5F5; color: #7B1FA2; }
.rb-type-menu { background: #FFF3E0; color: #E65100; }
.rb-type-ad { background: #E0F2F1; color: #00695C; }
.rb-type-postcard { background: #E8EAF6; color: #283593; }
.rb-type-invitation { background: #FBE9E7; color: #BF360C; }
.rb-type-mixed { background: var(--hh-primary-light); color: var(--hh-primary); }
.rb-text-title {
    font-weight: 700;
    color: var(--hh-secondary);
    font-size: 0.95rem;
    margin: 0;
}
.rb-text-type-badge {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--hh-gray);
}
.rb-text-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    font-size: 0.82rem;
    color: var(--hh-gray);
}
.rb-meta-item {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}
.rb-meta-item strong { color: var(--hh-secondary); }
.rb-text-body {
    font-size: 0.9rem;
    color: var(--hh-dark);
    line-height: 1.7;
    padding: 0.75rem 1rem;
    background: var(--hh-light);
    border-radius: 10px;
    border: 1px solid var(--hh-border);
}

/* ---- Simplify/Upgrade Styles ---- */
.sp-direction-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}
.sp-dir-btn {
    padding: 0.65rem 1rem;
    border-radius: 10px;
    border: 2px solid var(--hh-border);
    background: var(--hh-white);
    color: var(--hh-secondary);
    font-weight: 600;
    font-size: 0.88rem;
    cursor: pointer;
    transition: var(--hh-transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
}
.sp-dir-btn:hover {
    border-color: var(--hh-primary);
    background: var(--hh-primary-light);
}
.sp-dir-btn.active {
    background: var(--hh-primary);
    color: var(--hh-white);
    border-color: var(--hh-primary);
}
.sp-changes {
    padding: 1rem 1.75rem;
    border-top: 1px solid var(--hh-border);
    background: var(--hh-light);
}
.sp-changes h6 {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--hh-secondary);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.sp-changes h6 i { color: var(--hh-primary); }
.sp-changes ul {
    margin: 0;
    padding-left: 1.25rem;
}
.sp-changes li {
    font-size: 0.85rem;
    color: var(--hh-dark);
    padding: 0.2rem 0;
    line-height: 1.5;
}

/* ---- Dashboard Category Filter ---- */
.dash-filter-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 1.5rem;
}
.dash-filter-btn {
    padding: 0.45rem 1rem;
    border-radius: 20px;
    border: 1.5px solid var(--hh-border);
    background: var(--hh-white);
    color: var(--hh-gray);
    font-weight: 600;
    font-size: 0.82rem;
    cursor: pointer;
    transition: var(--hh-transition);
    display: flex;
    align-items: center;
    gap: 0.35rem;
}
.dash-filter-btn:hover {
    border-color: var(--hh-primary);
    color: var(--hh-primary);
    background: var(--hh-primary-light);
}
.dash-filter-btn.active {
    background: var(--hh-primary);
    color: var(--hh-white);
    border-color: var(--hh-primary);
}
.dash-filter-btn .filter-count {
    background: rgba(0,0,0,0.1);
    padding: 0.1rem 0.4rem;
    border-radius: 10px;
    font-size: 0.7rem;
}
.dash-filter-btn.active .filter-count {
    background: rgba(255,255,255,0.25);
}

/* Dashboard tool card category colors — vivid + card tinting */
/* Reading — Blue */
.dash-tool-card[data-cat="reading"] { border-left: 4px solid #1976D2; }
.dash-tool-card[data-cat="reading"] .dash-tool-icon { background: #BBDEFB; color: #0D47A1; }
.dash-tool-card[data-cat="reading"]:hover { background: #E3F2FD; border-color: #1976D2; }
/* Vocabulary — Purple */
.dash-tool-card[data-cat="vocabulary"] { border-left: 4px solid #7B1FA2; }
.dash-tool-card[data-cat="vocabulary"] .dash-tool-icon { background: #E1BEE7; color: #4A148C; }
.dash-tool-card[data-cat="vocabulary"]:hover { background: #F3E5F5; border-color: #7B1FA2; }
/* Writing — Orange */
.dash-tool-card[data-cat="writing"] { border-left: 4px solid #EF6C00; }
.dash-tool-card[data-cat="writing"] .dash-tool-icon { background: #FFE0B2; color: #BF360C; }
.dash-tool-card[data-cat="writing"]:hover { background: #FFF3E0; border-color: #EF6C00; }
/* Speaking — Green */
.dash-tool-card[data-cat="speaking"] { border-left: 4px solid #2E7D32; }
.dash-tool-card[data-cat="speaking"] .dash-tool-icon { background: #C8E6C9; color: #1B5E20; }
.dash-tool-card[data-cat="speaking"]:hover { background: #E8F5E9; border-color: #2E7D32; }
/* Grammar — Red/Pink */
.dash-tool-card[data-cat="grammar"] { border-left: 4px solid #C62828; }
.dash-tool-card[data-cat="grammar"] .dash-tool-icon { background: #FFCDD2; color: #B71C1C; }
.dash-tool-card[data-cat="grammar"]:hover { background: #FFEBEE; border-color: #C62828; }
/* Listening — Teal */
.dash-tool-card[data-cat="listening"] { border-left: 4px solid #00796B; }
.dash-tool-card[data-cat="listening"] .dash-tool-icon { background: #B2DFDB; color: #004D40; }
.dash-tool-card[data-cat="listening"]:hover { background: #E0F7FA; border-color: #00796B; }
/* Utility — Slate */
.dash-tool-card[data-cat="utility"] { border-left: 4px solid #546E7A; }
.dash-tool-card[data-cat="utility"] .dash-tool-icon { background: #CFD8DC; color: #263238; }
.dash-tool-card[data-cat="utility"]:hover { background: #ECEFF1; border-color: #546E7A; }

/* ==========================================
   TRUE / FALSE TOOL
   ========================================== */
.tf-statement-card {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.25rem;
    background: #fff;
    border: 1px solid var(--hh-border);
    border-radius: 12px;
    margin-bottom: 0.75rem;
    transition: border-color 0.2s;
}
.tf-statement-card:hover { border-color: var(--hh-primary); }
.tf-statement-num {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--hh-primary-light);
    color: var(--hh-primary);
    font-weight: 700;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.tf-statement-text {
    flex: 1;
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--hh-secondary);
}
.tf-options {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}
.tf-option-badge {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.tf-true { background: #E8F5E9; color: #2E7D32; }
.tf-false { background: #FFEBEE; color: #C62828; }
.tf-ng { background: #FFF3E0; color: #E65100; }
.tf-ans-true { color: #2E7D32; font-weight: 700; }
.tf-ans-false { color: #C62828; font-weight: 700; }
.tf-ans-ng { color: #E65100; font-weight: 700; }

/* ---- Level Selector Tabs ---- */
.level-selector-tabs {
    display: flex;
    gap: 0.25rem;
    margin-bottom: 0.5rem;
    background: var(--hh-light-bg, #f8f9fa);
    border-radius: 8px;
    padding: 3px;
}
.level-tab-btn {
    flex: 1;
    padding: 0.35rem 0.5rem;
    border: none;
    background: transparent;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--hh-gray, #6c757d);
    cursor: pointer;
    transition: var(--hh-transition, all 0.2s);
    text-align: center;
}
.level-tab-btn:hover { color: var(--hh-primary, #1CB0F6); }
.level-tab-btn.active {
    background: var(--hh-white, #fff);
    color: var(--hh-primary, #1CB0F6);
    border: 2px solid var(--hh-border);
}
.level-panel { display: none; }
.level-panel.active { display: block; }

/* Grade panel sections */
.level-grade-section { margin-bottom: 0.5rem; }
.level-grade-section:last-child { margin-bottom: 0; }
.level-grade-label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--hh-gray, #6c757d);
    margin-bottom: 0.25rem;
    padding-left: 2px;
}

/* Grid variants for different column counts */
.level-grid-5 { grid-template-columns: repeat(5, 1fr) !important; }
.level-grid-4 { grid-template-columns: repeat(4, 1fr) !important; }
.level-grid-3 { grid-template-columns: repeat(3, 1fr) !important; }
.level-grid-age { grid-template-columns: repeat(6, 1fr) !important; }

/* ---- Dashboard Favorites ---- */
.dash-tool-card { position: relative; }
.dash-fav-btn {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(255,255,255,0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--hh-transition, all 0.2s);
    color: #ccc;
    font-size: 1rem;
    z-index: 2;
}
.dash-fav-btn:hover { color: var(--hh-primary, #1CB0F6); transform: scale(1.15); }
.dash-fav-btn.favorited { color: var(--hh-primary, #1CB0F6); }
.dash-fav-btn.favorited i::before { content: "\F415"; }

/* ---- Follow-up Suggestions (Don't stop - Create more!) ---- */
.followup-section {
    margin-top: 1.5rem;
    background: var(--hh-white, #fff);
    border-radius: var(--hh-radius, 12px);
    border: 1.5px solid var(--hh-border, #e9ecef);
    overflow: hidden;
}
.followup-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 1.25rem;
    cursor: pointer;
    user-select: none;
    background: linear-gradient(135deg, #fef9f4 0%, #f8f4ff 100%);
    border-bottom: 1px solid var(--hh-border, #e9ecef);
}
.followup-emoji { font-size: 1.3rem; }
.followup-title {
    font-weight: 700;
    font-size: 1rem;
    color: var(--hh-dark, #1a1a2e);
    flex: 1;
}
.followup-chevron {
    transition: transform 0.2s;
    color: var(--hh-gray, #6c757d);
}
.followup-chevron.collapsed { transform: rotate(180deg); }
.followup-body { padding: 1rem 1.25rem; }
.followup-group { margin-bottom: 1rem; }
.followup-group:last-of-type { margin-bottom: 0.75rem; }
.followup-group-label {
    font-size: 0.82rem;
    color: var(--hh-gray, #6c757d);
    margin-bottom: 0.5rem;
    font-weight: 500;
}
.followup-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}
.followup-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s;
    border: 1.5px solid;
}
.followup-chip i { font-size: 0.7rem; }
.followup-chip-topic {
    color: #E65100;
    border-color: #FFE0B2;
    background: #FFF8E1;
}
.followup-chip-topic:hover {
    background: #FFE0B2;
    color: #BF360C;
    border-color: #FFCC80;
}
.followup-chip-result {
    color: #00695C;
    border-color: #B2DFDB;
    background: #E0F2F1;
}
.followup-chip-result:hover {
    background: #B2DFDB;
    color: #004D40;
    border-color: #80CBC4;
}
.followup-all {
    text-align: center;
    padding-top: 0.75rem;
    border-top: 1px solid var(--hh-border, #e9ecef);
    margin-top: 0.75rem;
}
.followup-all-btn {
    display: inline-block;
    padding: 0.5rem 1.5rem;
    border-radius: 20px;
    border: 1.5px solid var(--hh-border, #e9ecef);
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--hh-gray, #6c757d);
    text-decoration: none;
    transition: all 0.2s;
}
.followup-all-btn:hover,
.followup-all-btn.active {
    border-color: var(--hh-primary, #1CB0F6);
    color: var(--hh-primary, #1CB0F6);
    background: var(--hh-primary-light, #DDF4FF);
}
.followup-all-btn .followup-all-chevron {
    font-size: 0.7rem;
    margin-left: 0.25rem;
    transition: transform 0.2s;
}
.followup-all-btn.active .followup-all-chevron {
    transform: rotate(180deg);
}

/* Expanded all-tools panel */
.followup-all-tools {
    margin-top: 0.75rem;
    padding: 0.75rem;
    background: var(--hh-primary-light, #DDF4FF);
    border-radius: 10px;
    border: 1px solid rgba(28, 176, 246, 0.15);
    animation: followupSlideIn 0.25s ease-out;
}
.followup-all-group {
    margin-bottom: 0.6rem;
}
.followup-all-group:last-child {
    margin-bottom: 0;
}
.followup-all-group-label {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--hh-secondary, #1A365D);
    margin-bottom: 0.35rem;
    padding-left: 0.15rem;
}

/* ===== Follow-up Inline Blocks ===== */
.followup-block {
    margin-top: 1.25rem;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    animation: followupSlideIn 0.35s ease-out;
}
@keyframes followupSlideIn {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}
.followup-block-header {
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, #DDF4FF 0%, #F0F9FF 100%);
    border-bottom: 1px solid #f0e6de;
    font-size: 0.92rem;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.25rem;
}
.followup-block-header i.bi-stars {
    color: var(--hh-primary, #1CB0F6);
}
.followup-block-body {
    padding: 1rem 1.25rem;
}
.followup-block-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem 0;
}
.followup-block-result {
    line-height: 1.65;
}
.followup-block-result h5 { margin-bottom: 0.4rem; }
.followup-block-result h6 { margin-top: 0.75rem; }
.followup-block-result blockquote {
    font-size: 0.95rem;
}
.followup-block-result .table {
    font-size: 0.9rem;
}
.followup-block-actions {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid #f0f0f0;
    display: flex;
    gap: 0.5rem;
}

/* Responsive */
@media (max-width: 991px) {
    .tool-form-card { position: static; }
    .tool-level-grid { grid-template-columns: repeat(3, 1fr); }
    .tool-output-empty, .tool-output-loading { min-height: 250px; padding: 2rem; }
    .dq-question-card, .vb-exercise-item, .gr-exercise-item { padding: 1rem; }
    .lp-phase-card, .lp-section { padding: 1rem; }
    .dl-line { max-width: 95%; }
    .li-activity-card, .rb-text-card { padding: 1rem; }
    .tf-statement-card { flex-wrap: wrap; padding: 1rem; }
    .tf-options { width: 100%; justify-content: flex-start; }
    .dash-filter-tabs { gap: 0.3rem; }
    .level-selector-tabs { flex-wrap: wrap; }
    .level-grid-5 { grid-template-columns: repeat(5, 1fr) !important; }
    .level-grid-age { grid-template-columns: repeat(3, 1fr) !important; }
}

/* ================================================================
   WORKSHEET NAVIGATION BAR + EXPORT
   ================================================================ */

/* ── Worksheet Bar ─────────────────────────────────────────────── */
.worksheet-bar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--hh-white);
    border: 1px solid var(--hh-border);
    border-radius: var(--hh-radius);
    padding: 0.45rem 0.65rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    animation: followupSlideIn 0.3s ease-out;
}

.ws-bar-bird {
    width: 22px;
    height: 22px;
    object-fit: contain;
    opacity: 0.7;
    flex-shrink: 0;
}
.worksheet-bar-chips {
    flex: 1;
    display: flex;
    gap: 0.3rem;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding: 2px 0;
}
.worksheet-bar-chips::-webkit-scrollbar { display: none; }

.ws-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    padding: 0.28rem 0.6rem;
    border-radius: 20px;
    font-size: 0.76rem;
    font-weight: 500;
    white-space: nowrap;
    cursor: pointer;
    border: 1.5px solid var(--hh-border);
    background: var(--hh-white);
    color: var(--hh-secondary);
    transition: all 0.2s;
    flex-shrink: 0;
}
.ws-chip:hover {
    border-color: var(--hh-primary);
    background: var(--hh-primary-light);
    color: var(--hh-primary-dark);
}
.ws-chip.active {
    background: var(--hh-primary);
    color: var(--hh-white);
    border-color: var(--hh-primary);
}
.ws-chip.active:hover {
    background: var(--hh-primary-dark);
}

.ws-chip-num {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    font-weight: 700;
    background: var(--hh-secondary);
    color: var(--hh-white);
    flex-shrink: 0;
}
.ws-chip.active .ws-chip-num {
    background: var(--hh-white);
    color: var(--hh-primary);
}

.ws-chip-label {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ws-chip-edit {
    background: none;
    border: none;
    padding: 0;
    font-size: 0.6rem;
    color: inherit;
    opacity: 0;
    transition: opacity 0.2s;
    cursor: pointer;
    flex-shrink: 0;
    line-height: 1;
}
.ws-chip:hover .ws-chip-edit { opacity: 0.6; }
.ws-chip:hover .ws-chip-edit:hover { opacity: 1; }

.ws-chip-rename-input {
    font-size: 0.76rem;
    font-weight: 500;
    border: none;
    border-bottom: 1.5px solid var(--hh-primary);
    background: transparent;
    color: inherit;
    outline: none;
    width: 100px;
    padding: 0;
}

/* Export & Share buttons */
.worksheet-bar-actions {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ws-export-btn {
    background: var(--hh-primary);
    color: var(--hh-white);
    border: none;
    padding: 0.38rem 0.9rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    cursor: pointer;
    transition: all 0.2s;
}
.ws-export-btn:hover {
    background: var(--hh-primary-dark);
}
.ws-export-btn i { font-size: 0.95rem; }

/* ── Export Modal ──────────────────────────────────────────────── */
.ws-export-modal .modal-content {
    border-radius: var(--hh-radius-lg);
    border: none;
    box-shadow: var(--hh-shadow-lg);
}

.ws-export-modal-header {
    border-bottom: 1px solid var(--hh-border);
    padding: 1.25rem 1.5rem;
}

.ws-export-modal-title-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.ws-export-modal-title-row i {
    font-size: 1.3rem;
    color: var(--hh-primary);
}
.ws-export-modal-title-row h5 {
    margin: 0;
    font-weight: 700;
    color: var(--hh-secondary);
}

.ws-export-modal-body {
    padding: 1.5rem;
}

.ws-export-field {
    margin-bottom: 1.25rem;
}
.ws-export-field-label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--hh-secondary);
    margin-bottom: 0.4rem;
}

.ws-export-sections-list {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    max-height: 200px;
    overflow-y: auto;
}

.ws-export-section-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.65rem;
    border: 1px solid var(--hh-border);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s;
    font-size: 0.85rem;
}
.ws-export-section-item:hover {
    border-color: var(--hh-primary);
    background: var(--hh-primary-light);
}
.ws-export-section-item input[type="checkbox"] {
    accent-color: var(--hh-primary);
    width: 16px;
    height: 16px;
}

.ws-export-section-num {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    background: var(--hh-secondary);
    color: var(--hh-white);
    flex-shrink: 0;
}

.ws-export-section-label {
    flex: 1;
    font-weight: 500;
    color: var(--hh-dark);
}

.ws-export-section-badge {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
    background: var(--hh-primary-light);
    color: var(--hh-primary);
}

/* Format buttons */
.ws-export-formats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.ws-format-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1.25rem 1rem;
    border: 2px solid var(--hh-border);
    border-radius: var(--hh-radius);
    background: var(--hh-white);
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--hh-secondary);
}
.ws-format-btn:hover {
    border-color: var(--hh-primary);
    background: var(--hh-primary-light);
}
.ws-format-btn i {
    font-size: 2rem;
    color: var(--hh-primary);
}
.ws-format-btn.loading {
    opacity: 0.7;
    pointer-events: none;
}
.ws-format-btn[data-format="pdf"] i { color: #C53030; }
.ws-format-btn[data-format="docx"] i { color: #2B579A; }

/* ── Responsive ────────────────────────────────────────────────── */
@media (max-width: 991px) {
    .worksheet-bar {
        position: relative;
        top: auto;
    }
}
@media (max-width: 576px) {
    .worksheet-bar {
        padding: 0.35rem 0.5rem;
        gap: 0.4rem;
    }
    .ws-chip {
        padding: 0.22rem 0.45rem;
        font-size: 0.7rem;
    }
    .ws-export-btn {
        padding: 0.3rem 0.6rem;
        font-size: 0.75rem;
    }
    .ws-export-label { display: none; }
    .ws-export-formats {
        grid-template-columns: 1fr;
    }
}

/* ── Share Button & Modal ──────────────────────────────────────── */
.ws-share-btn {
    background: #10b981;
    color: #fff;
    border: none;
    padding: 0.38rem 0.9rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    transition: all 0.15s;
}
.ws-share-btn:hover {
    background: #059669;
    color: #fff;
}
.ws-share-btn i { font-size: 0.95rem; }

.ws-share-modal .modal-content {
    border-radius: var(--hh-radius-lg);
    border: none;
    box-shadow: var(--hh-shadow-lg);
}
.ws-share-modal-header {
    border-bottom: 1px solid var(--hh-border);
    padding: 1rem 1.25rem;
}
.ws-share-modal-title-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #10b981;
    font-size: 1.1rem;
}
.ws-share-modal-body {
    padding: 1.25rem;
}
.ws-share-desc {
    color: var(--hh-muted);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}
.ws-share-field {
    margin-bottom: 1rem;
}
.ws-share-field-label {
    display: block;
    font-weight: 600;
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
    color: var(--hh-heading);
}
.ws-share-section-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-radius: var(--hh-radius-sm);
    cursor: pointer;
    transition: background 0.15s;
}
.ws-share-section-item:hover {
    background: #f8f9fa;
}
.ws-share-section-item input[type=radio] {
    accent-color: #10b981;
}
.ws-share-section-num {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--hh-primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    flex-shrink: 0;
}
.ws-share-section-label {
    flex: 1;
    font-size: 0.9rem;
    font-weight: 500;
}
.ws-share-section-badge {
    font-size: 0.75rem;
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
    background: #e8f8fb;
    color: var(--hh-primary-dark);
    font-weight: 600;
}
.ws-share-create {
    text-align: center;
    padding: 0.5rem 0;
}
.ws-share-create-btn {
    background: #10b981;
    color: #fff;
    border: none;
    padding: 0.6rem 1.5rem;
    border-radius: var(--hh-radius-sm);
    font-weight: 700;
    font-size: 0.95rem;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    transition: all 0.15s;
}
.ws-share-create-btn:hover {
    background: #059669;
    color: #fff;
}
.ws-share-create-btn:disabled {
    opacity: 0.7;
    cursor: wait;
}
.ws-share-link-row {
    display: flex;
    gap: 0.5rem;
}
.ws-share-link-input {
    flex: 1;
    font-size: 0.85rem;
    border-radius: var(--hh-radius-sm);
    background: #f8f9fa;
    border: 1px solid var(--hh-border);
    color: var(--hh-heading);
}
.ws-share-copy-btn {
    background: #10b981;
    color: #fff;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: var(--hh-radius-sm);
    font-weight: 600;
    font-size: 0.85rem;
    white-space: nowrap;
    transition: all 0.15s;
}
.ws-share-copy-btn:hover {
    background: #059669;
    color: #fff;
}

@media (max-width: 576px) {
    .ws-share-btn {
        padding: 0.3rem 0.6rem;
        font-size: 0.75rem;
    }
    .ws-share-label { display: none; }
    .ws-share-link-row {
        flex-direction: column;
    }
}

/* ============================================
   Admin Portal Styles
   ============================================ */
.admin-metric-card {
    border-radius: var(--hh-radius-lg);
    transition: all 0.15s;
    border: 2px solid var(--hh-border);
}
.admin-metric-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--hh-hover-shadow);
    border-color: var(--hh-primary-border);
}
.admin-metric-value {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--hh-dark);
    line-height: 1.2;
}
.admin-metric-label {
    font-size: 0.75rem;
    color: var(--hh-gray);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}
.admin-metric-sub {
    font-size: 0.8rem;
    color: var(--hh-gray);
    margin-top: 0.25rem;
}

/* Admin tables */
.admin-table {
    font-size: 0.85rem;
}
.admin-table th {
    background: var(--hh-light);
    font-weight: 600;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--hh-gray);
    border-bottom-width: 1px;
    white-space: nowrap;
}
.admin-table td {
    vertical-align: middle;
}
.admin-table .badge {
    font-size: 0.72rem;
    font-weight: 500;
    padding: 0.3em 0.6em;
}

/* Admin filter bar */
.admin-filters {
    background: var(--hh-white);
    padding: 1rem;
    border-radius: var(--hh-radius-lg);
    margin-bottom: 1rem;
    border: 2px solid var(--hh-border);
}
.admin-filters .form-control,
.admin-filters .form-select {
    font-size: 0.85rem;
    border-color: #E5E5E5;
}
.admin-filters label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--hh-gray);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 0.25rem;
}

/* Admin cards */
.admin-card {
    border: 2px solid var(--hh-border);
    border-radius: var(--hh-radius-lg);
}
.admin-card .card-title {
    font-size: 0.85rem;
    font-weight: 800;
    color: var(--hh-dark);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* User detail avatar */
.admin-user-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--hh-primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 700;
    margin: 0 auto 1rem;
}
