/* =============================================
   TRADE ACADEMY - Design System
   Dark Modern Trading Platform Theme
   ============================================= */

/* --- CSS Variables / Design Tokens --- */
:root {
    /* Primary Colors - Blue (matches mobile app) */
    --primary: #2563EB;
    --primary-hover: #1D4ED8;
    --primary-light: rgba(37, 99, 235, 0.1);
    --primary-glow: rgba(37, 99, 235, 0.25);

    /* Accent */
    --accent: #3b82f6;
    --accent-hover: #2563eb;
    --accent-light: rgba(59, 130, 246, 0.1);

    /* Backgrounds - Light */
    --bg-darkest: #f8fafc;
    --bg-dark: #f1f5f9;
    --bg-card: #ffffff;
    --bg-card-hover: #f8fafc;
    --bg-sidebar: #ffffff;
    --bg-input: #f8fafc;
    --bg-input-focus: #ffffff;

    /* Text Colors */
    --text-primary: #334155;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --text-heading: #0f172a;

    /* Borders */
    --border: #e2e8f0;
    --border-light: #f1f5f9;
    --border-focus: var(--primary);

    /* Status Colors */
    --success: #10B981;
    --success-bg: rgba(16, 185, 129, 0.12);
    --danger: #EF4444;
    --danger-bg: rgba(239, 68, 68, 0.12);
    --warning: #F59E0B;
    --warning-bg: rgba(245, 158, 11, 0.12);
    --info: #3B82F6;
    --info-bg: rgba(59, 130, 246, 0.12);

    /* Spacing */
    --sidebar-width: 260px;
    --topbar-height: 64px;

    /* Border Radius */
    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 18px;
    --radius-xl: 24px;

    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.03);
    --shadow: 0 12px 30px rgba(15, 23, 42, 0.05);
    --shadow-lg: 0 20px 40px rgba(15, 23, 42, 0.08);
    --shadow-glow: 0 0 25px var(--primary-glow);

    /* Transitions */
    --transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    --transition-fast: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

/* --- Reset & Base --- */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-darkest);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition-fast);
}

a:hover {
    color: var(--primary-hover);
}

img {
    max-width: 100%;
    height: auto;
}

/* --- Typography --- */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--text-heading);
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -0.02em;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.35rem; }
h4 { font-size: 1.15rem; }


/* =============================================
   LANDING PAGE
   ============================================= */

/* --- Navbar --- */
.landing-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: 0 2rem;
    height: 76px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border-bottom: 1px solid transparent;
    transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.landing-nav.scrolled {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(226, 232, 240, 0.8);
    box-shadow: 0 4px 30px rgba(15, 23, 42, 0.05);
}

.nav-container {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.landing-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: 'Outfit', sans-serif;
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--text-heading);
    letter-spacing: -0.5px;
    text-decoration: none;
    transition: var(--transition);
}

.landing-logo:hover {
    color: var(--text-heading);
    transform: translateY(-1px);
}

.landing-logo .logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary), #EF6C00);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    box-shadow: 0 3px 12px rgba(245, 158, 11, 0.15);
    transition: var(--transition);
}

.landing-logo:hover .logo-icon {
    transform: rotate(5deg) scale(1.06);
}

.landing-nav-links {
    display: flex;
    align-items: center;
    gap: 2.5rem;
}

.landing-nav-links a {
    color: var(--text-secondary);
    font-size: 0.925rem;
    font-weight: 500;
    padding: 0.4rem 0;
    position: relative;
    transition: var(--transition);
    text-decoration: none;
}

.landing-nav-links a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary);
    border-radius: 2px;
    transition: width 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.landing-nav-links a:hover {
    color: var(--text-heading);
}

.landing-nav-links a:hover::after {
    width: 100%;
}

.nav-cta-btn {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1.5rem !important;
    background: var(--primary) !important;
    color: #000 !important;
    border-radius: 9999px;
    font-weight: 700 !important;
    font-size: 0.85rem !important;
    transition: var(--transition);
    box-shadow: 0 2px 10px rgba(245, 158, 11, 0.15);
}

.nav-cta-btn::after {
    display: none !important;
}

.nav-cta-btn:hover {
    background: var(--primary-hover) !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.25);
}

.nav-mobile-toggle {
    display: none;
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.4rem;
    cursor: pointer;
    color: var(--text-heading);
    transition: var(--transition);
}

.nav-mobile-toggle:hover {
    background: var(--bg-dark);
}

/* --- Hero Section --- */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 160px 2rem 120px;
    position: relative;
    overflow: hidden;
    background-color: var(--bg-darkest);
    background-image:
        radial-gradient(rgba(148, 163, 184, 0.06) 1.5px, transparent 1.5px);
    background-size: 24px 24px;
}

.hero-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(130px);
    z-index: 0;
    opacity: 0.12;
    pointer-events: none;
}

.hero-blob-1 {
    width: 500px;
    height: 500px;
    background: var(--primary);
    top: -15%;
    left: -8%;
    animation: float-slow 18s ease-in-out infinite alternate;
}

.hero-blob-2 {
    width: 600px;
    height: 600px;
    background: #3b82f6;
    bottom: 0;
    right: -12%;
    animation: float-medium 15s ease-in-out infinite alternate-reverse;
}

.hero-blob-3 {
    width: 350px;
    height: 350px;
    background: #ec4899;
    top: 40%;
    left: 40%;
    opacity: 0.05;
    animation: float-slow 22s ease-in-out infinite alternate;
}

@keyframes float-slow {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(50px, -70px) scale(1.12); }
}

@keyframes float-medium {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(-60px, 50px) scale(1.06); }
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 850px;
    animation: fade-up 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes fade-up {
    from { opacity: 0; transform: translateY(35px); }
    to   { opacity: 1; transform: translateY(0); }
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(245, 158, 11, 0.06);
    color: var(--primary);
    padding: 8px 18px;
    border-radius: 9999px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 2rem;
    border: 1px solid rgba(245, 158, 11, 0.15);
    transition: var(--transition);
}

.hero-badge:hover {
    background: rgba(245, 158, 11, 0.1);
    transform: translateY(-2px);
}

.hero h1 {
    font-size: 4rem;
    font-weight: 800;
    line-height: 1.12;
    margin-bottom: 1.5rem;
    letter-spacing: -0.035em;
    background: linear-gradient(135deg, var(--text-heading) 40%, #475569);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero h1 .highlight {
    background: linear-gradient(135deg, var(--primary) 20%, #fb923c 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    position: relative;
    display: inline-block;
}

.hero h1 .highlight::after {
    content: '';
    position: absolute;
    bottom: 3px;
    left: 0;
    width: 100%;
    height: 6px;
    background: rgba(245, 158, 11, 0.15);
    z-index: -1;
    border-radius: 4px;
}

.hero p {
    font-size: 1.2rem;
    color: var(--text-secondary);
    max-width: 680px;
    margin: 0 auto 2.5rem;
    line-height: 1.75;
}

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

.hero-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    max-width: 700px;
    margin: 5rem auto 0;
    padding-top: 3.5rem;
    border-top: 1px dashed rgba(226, 232, 240, 0.8);
}

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

.hero-stat:not(:last-child)::after {
    content: '';
    position: absolute;
    right: -1rem;
    top: 15%;
    height: 70%;
    width: 1px;
    background: rgba(226, 232, 240, 0.8);
}

.hero-stat .stat-number {
    font-family: 'Outfit', sans-serif;
    font-size: 2.75rem;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, var(--text-heading) 50%, var(--primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-stat .stat-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.hero-wave {
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    line-height: 0;
    z-index: 10;
}

.hero-wave svg {
    display: block;
    width: 100%;
    height: 70px;
}

/* --- Landing Sections --- */
.landing-section {
    padding: 100px 2rem;
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

.section-header {
    text-align: center;
    margin-bottom: 4rem;
    position: relative;
}

.section-label {
    display: inline-block;
    font-family: 'Outfit', sans-serif;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--primary);
    background: rgba(245, 158, 11, 0.08);
    padding: 6px 16px;
    border-radius: 9999px;
    margin-bottom: 1rem;
}

.section-header h2 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
    letter-spacing: -0.025em;
    color: var(--text-heading);
}

.section-header p {
    color: var(--text-secondary);
    max-width: 580px;
    margin: 0 auto;
    font-size: 1.05rem;
    line-height: 1.7;
}

.landing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
}

/* --- Feature Cards --- */
.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.feature-card {
    background: var(--bg-card);
    border: 1px solid rgba(226, 232, 240, 0.8);
    border-radius: var(--radius-xl);
    padding: 3rem 2rem;
    text-align: center;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), #3b82f6);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-6px);
    border-color: rgba(245, 158, 11, 0.15);
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.06);
}

.feature-card:hover::before {
    opacity: 1;
}

.feature-icon-wrapper {
    width: 72px;
    height: 72px;
    background: rgba(245, 158, 11, 0.06);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 2rem;
    font-size: 1.75rem;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.feature-card:hover .feature-icon-wrapper {
    transform: scale(1.12) rotate(-5deg);
    background: rgba(245, 158, 11, 0.1);
}

.feature-card h3 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.35rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: var(--text-heading);
}

.feature-card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.65;
}

/* --- News Tags --- */
.news-tags {
    margin-top: 1.5rem;
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

.news-tag {
    display: inline-block;
    background: var(--bg-dark);
    color: var(--text-secondary);
    padding: 6px 14px;
    border-radius: 9999px;
    font-size: 0.8rem;
    font-weight: 600;
    border: 1px solid rgba(226, 232, 240, 0.8);
    transition: var(--transition);
}

.news-tag:hover {
    background: rgba(245, 158, 11, 0.08);
    color: var(--primary);
    border-color: rgba(245, 158, 11, 0.2);
}

/* --- Cards (News & Course) --- */
.news-card, .course-card {
    background: var(--bg-card);
    border: 1px solid rgba(226, 232, 240, 0.8);
    border-radius: var(--radius-xl);
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.02);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.news-card:hover, .course-card:hover {
    transform: translateY(-8px);
    border-color: rgba(245, 158, 11, 0.2);
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.06);
}

.card-thumbnail-wrapper {
    position: relative;
    overflow: hidden;
    height: 200px;
    background: var(--bg-dark);
}

.card-thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.news-card:hover .card-thumbnail,
.course-card:hover .card-thumbnail {
    transform: scale(1.06);
}

.card-body {
    padding: 1.75rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.card-category {
    display: inline-flex;
    align-items: center;
    background: rgba(245, 158, 11, 0.06);
    color: var(--primary);
    padding: 4px 12px;
    border-radius: 9999px;
    font-size: 0.725rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    width: fit-content;
}

.card-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-heading);
    margin: 0.9rem 0 0.6rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.2s ease;
}

.news-card:hover .card-title,
.course-card:hover .card-title {
    color: var(--primary-hover);
}

.card-excerpt {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 1.25rem;
    flex-grow: 1;
}

.card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--text-secondary);
    border-top: 1px solid rgba(226, 232, 240, 0.7);
    padding-top: 1rem;
    margin-top: auto;
}

.card-meta span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.course-level {
    padding: 4px 12px;
    border-radius: 9999px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.course-level.beginner { background: rgba(16, 185, 129, 0.08); color: var(--success); }
.course-level.intermediate { background: rgba(245, 158, 11, 0.08); color: var(--warning); }
.course-level.advanced { background: rgba(239, 68, 68, 0.08); color: var(--danger); }

/* --- CTA Section --- */
.cta-section {
    position: relative;
    overflow: hidden;
    padding: 100px 2rem;
    text-align: center;
    background: var(--bg-card);
    background-image:
        radial-gradient(rgba(37, 99, 235, 0.05) 1.5px, transparent 1.5px);
    background-size: 24px 24px;
    border-top: 1px solid rgba(226, 232, 240, 0.8);
}

.cta-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    pointer-events: none;
}

.cta-blob-1 {
    width: 400px;
    height: 400px;
    background: rgba(37, 99, 235, 0.08);
    top: -20%;
    right: -5%;
    animation: float-slow 18s ease-in-out infinite alternate;
}

.cta-blob-2 {
    width: 350px;
    height: 350px;
    background: rgba(59, 130, 246, 0.08);
    bottom: -15%;
    left: -5%;
    animation: float-medium 16s ease-in-out infinite alternate-reverse;
}

.cta-content {
    position: relative;
    z-index: 2;
    max-width: 720px;
    margin: 0 auto;
}

.cta-label {
    display: inline-block;
    font-family: 'Outfit', sans-serif;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--primary);
    margin-bottom: 1.5rem;
    background: rgba(245, 158, 11, 0.08);
    padding: 6px 16px;
    border-radius: 9999px;
}

.cta-section h2 {
    font-size: 2.75rem;
    font-weight: 800;
    color: var(--text-heading);
    margin-bottom: 1.25rem;
    letter-spacing: -0.03em;
    line-height: 1.15;
}

.cta-section p {
    font-size: 1.15rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 2.5rem;
    line-height: 1.75;
}

.cta-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-cta-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--primary);
    color: #000;
    padding: 0.85rem 2rem;
    border-radius: 9999px;
    font-weight: 700;
    font-size: 0.95rem;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    box-shadow: 0 4px 20px rgba(245, 158, 11, 0.25);
}

.btn-cta-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(245, 158, 11, 0.35);
    color: #000;
}

.btn-cta-outline {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    color: var(--text-heading);
    padding: 0.85rem 2rem;
    border-radius: 9999px;
    font-weight: 600;
    font-size: 0.95rem;
    border: 1px solid rgba(15, 23, 42, 0.15);
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.btn-cta-outline:hover {
    border-color: rgba(15, 23, 42, 0.3);
    background: rgba(15, 23, 42, 0.04);
    color: var(--text-heading);
    transform: translateY(-3px);
}

/* --- Footer --- */
.landing-footer {
    background: #fafbfc;
    border-top: 1px solid rgba(226, 232, 240, 0.6);
    position: relative;
    z-index: 2;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 5rem 2rem 2rem;
}

.footer-main {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1fr;
    gap: 3rem;
    margin-bottom: 4rem;
}

.footer-brand {
    max-width: 300px;
}

.footer-brand .landing-logo {
    margin-bottom: 1.25rem;
    font-size: 1.2rem;
}

.footer-brand .landing-logo .logo-icon {
    width: 34px;
    height: 34px;
    font-size: 1rem;
}

.footer-desc {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.7;
    margin-bottom: 1.5rem;
}

.footer-socials {
    display: flex;
    gap: 0.75rem;
}

.social-link {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--bg-dark);
    border: 1px solid rgba(226, 232, 240, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: var(--transition);
    text-decoration: none;
}

.social-link:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: #000;
    transform: translateY(-3px);
}

.footer-links-group h4 {
    font-family: 'Outfit', sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-heading);
    margin-bottom: 1.25rem;
}

.footer-links-group ul {
    list-style: none;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.footer-links-group ul li {
    color: var(--text-secondary);
    font-size: 0.875rem;
    line-height: 1.5;
}

.footer-links-group ul li a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition-fast);
}

.footer-links-group ul li a:hover {
    color: var(--primary);
}

.footer-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.75rem 0;
    border-top: 1px solid rgba(226, 232, 240, 0.6);
}

.footer-bottom p {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.footer-bottom-links {
    display: flex;
    gap: 1.5rem;
}

.footer-bottom-links a {
    color: var(--text-muted);
    font-size: 0.85rem;
    text-decoration: none;
    transition: var(--transition-fast);
}

.footer-bottom-links a:hover {
    color: var(--primary);
}



/* =============================================
   AUTH PAGES
   ============================================= */

.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background-color: var(--bg-darkest);
    background-image: radial-gradient(var(--border) 1px, transparent 1px);
    background-size: 24px 24px;
    position: relative;
}

.auth-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(ellipse at top center, rgba(37, 99, 235, 0.06) 0%, transparent 70%);
}

.auth-card {
    width: 100%;
    max-width: 420px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    position: relative;
    z-index: 1;
    box-shadow: none; /* Flat plate design requested */
}

.auth-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--text-heading);
    margin-bottom: 0.5rem;
}

.auth-title {
    text-align: center;
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
}

.auth-subtitle {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 2rem;
}

/* =============================================
   DASHBOARD LAYOUT
   ============================================= */

.dashboard-layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 50;
    display: flex;
    flex-direction: column;
    transition: var(--transition);
    overflow-y: auto;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 1.25rem 1.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-heading);
    border-bottom: 1px solid var(--border);
    letter-spacing: -0.3px;
}

.sidebar-logo strong {
    font-weight: 800;
    color: var(--primary);
}

.sidebar-logo .logo-icon {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}

.sidebar-logo .logo-icon svg {
    width: 32px;
    height: 32px;
    display: block;
}

.sidebar-nav {
    flex: 1;
    padding: 1rem 0;
}

.sidebar-section {
    padding: 0 0.75rem;
    margin-bottom: 0.5rem;
}

.sidebar-section-title {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--text-muted);
    padding: 0.5rem 0.75rem;
    font-weight: 600;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0.6rem 0.75rem;
    border-radius: var(--radius);
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition-fast);
    margin-bottom: 2px;
}

.sidebar-link:hover {
    background: var(--bg-card);
    color: var(--text-primary);
}

.sidebar-link.active {
    background: var(--primary-light);
    color: var(--primary);
}

.sidebar-link .link-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.sidebar-link .link-icon svg {
    width: 18px;
    height: 18px;
}

.sidebar-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--border);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg-card);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--primary);
    border: 2px solid var(--border);
    overflow: hidden;
    flex-shrink: 0;
}

.sidebar-user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sidebar-user-info {
    flex: 1;
    min-width: 0;
}

.sidebar-user-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-role {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: capitalize;
}

/* Topbar */
.topbar {
    height: var(--topbar-height);
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    position: sticky;
    top: 0;
    z-index: 40;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.topbar-title h1 {
    font-size: 1.25rem;
    font-weight: 700;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.mobile-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--radius-sm);
}

.mobile-toggle:hover {
    background: var(--bg-card);
}

.mobile-toggle svg {
    width: 24px;
    height: 24px;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
}

.content-body {
    padding: 2rem;
    max-width: 1400px;
}

/* =============================================
   DASHBOARD WIDGETS
   ============================================= */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.stat-card::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 80px;
    height: 80px;
    border-radius: 0 0 0 80px;
    opacity: 0.05;
}

.stat-card:hover {
    border-color: var(--border-light);
    transform: translateY(-2px);
}

.stat-card .stat-icon {
    width: 42px;
    height: 42px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.75rem;
}

.stat-card .stat-icon svg {
    width: 20px;
    height: 20px;
}

.stat-card .stat-icon.primary { background: var(--primary-light); color: var(--primary); }
.stat-card .stat-icon.success { background: var(--success-bg); color: var(--success); }
.stat-card .stat-icon.info { background: var(--info-bg); color: var(--info); }
.stat-card .stat-icon.danger { background: var(--danger-bg); color: var(--danger); }

.stat-card .stat-value {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--text-heading);
    line-height: 1;
    margin-bottom: 4px;
}

.stat-card .stat-label {
    font-size: 0.825rem;
    color: var(--text-secondary);
}

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

/* =============================================
   COMPONENTS
   ============================================= */

/* Card / Panel */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
}

.card-header h3 {
    font-size: 1rem;
    font-weight: 700;
}

.card-content {
    padding: 1.5rem;
}

.card-content.no-padding {
    padding: 0;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0.6rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: 50px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.btn:active {
    transform: translateY(0);
}

.btn {
    font-family: inherit;
    white-space: nowrap;
    line-height: 1.4;
}

.btn svg {
    width: 16px;
    height: 16px;
}

/* --- Button primary text color: white on blue --- */
.btn-primary {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.btn-primary:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
    box-shadow: var(--shadow-glow);
    color: #fff;
}

.btn-secondary {
    background: var(--bg-input);
    color: var(--text-primary);
    border-color: var(--border);
}

.btn-secondary:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-light);
    color: var(--text-heading);
}

.btn-danger {
    background: var(--danger-bg);
    color: var(--danger);
    border-color: rgba(239, 68, 68, 0.2);
}

.btn-danger:hover {
    background: var(--danger);
    color: #fff;
}

.btn-sm {
    padding: 0.4rem 0.75rem;
    font-size: 0.8rem;
}

.btn-lg {
    padding: 0.75rem 1.75rem;
    font-size: 1rem;
}

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

.btn-outline:hover {
    background: var(--bg-card);
    border-color: var(--primary);
    color: var(--primary);
}

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

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.form-control {
    width: 100%;
    padding: 0.65rem 0.875rem;
    font-size: 0.9rem;
    font-family: inherit;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    transition: var(--transition);
    outline: none;
}

.form-control:focus {
    border-color: var(--border-focus);
    background: var(--bg-input-focus);
    box-shadow: 0 0 0 3px var(--primary-light);
}

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

textarea.form-control {
    resize: vertical;
    min-height: 120px;
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    padding-right: 2.5rem;
}

.form-error {
    color: var(--danger);
    font-size: 0.8rem;
    margin-top: 0.35rem;
}

.form-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-check input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
    cursor: pointer;
}

.form-check label {
    font-size: 0.875rem;
    color: var(--text-primary);
    cursor: pointer;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

/* Tables */
.table-container {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    text-align: left;
    padding: 0.75rem 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.data-table td {
    padding: 0.85rem 1rem;
    font-size: 0.875rem;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.data-table tbody tr {
    transition: var(--transition-fast);
}

.data-table tbody tr:hover {
    background: var(--bg-card-hover);
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 50px;
}

.badge-success { background: var(--success-bg); color: var(--success); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-info { background: var(--info-bg); color: var(--info); }
.badge-primary { background: var(--primary-light); color: var(--primary); }

/* Action buttons in tables */
.action-buttons {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

/* Flash Messages */
.flash-message {
    padding: 0.875rem 1.25rem;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    animation: slideDown 0.3s ease;
    position: relative;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.flash-message.success {
    background: var(--success-bg);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.flash-message.error {
    background: var(--danger-bg);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.flash-close {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    font-size: 1.1rem;
    opacity: 0.7;
}

.flash-close:hover {
    opacity: 1;
}

/* Pagination */
.pagination-wrapper {
    display: flex;
    justify-content: center;
    padding: 1.25rem;
}

.pagination-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.pagination-info {
    font-size: 0.825rem;
    color: var(--text-muted);
}

.pagination-info strong {
    color: var(--text-primary);
    font-weight: 600;
}

.pagination {
    display: flex;
    gap: 4px;
    list-style: none;
    align-items: center;
}

.pagination li a,
.pagination li span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 0.5rem;
    font-size: 0.85rem;
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    transition: var(--transition-fast);
    text-decoration: none;
}

.pagination li a:hover {
    background: var(--primary-light);
    color: var(--primary);
    border-color: var(--primary);
}

.pagination li.active span {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    font-weight: 700;
}

.pagination li.disabled span {
    opacity: 0.35;
    pointer-events: none;
    cursor: default;
}

/* Modal */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 200;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}

.modal-overlay.active {
    display: flex;
}

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

.modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 2rem;
    max-width: 420px;
    width: 90%;
    text-align: center;
    animation: scaleIn 0.2s ease;
}

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.modal-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--danger-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
}

.modal-icon svg {
    width: 28px;
    height: 28px;
    color: var(--danger);
}

.modal-title {
    font-size: 1.15rem;
    margin-bottom: 0.5rem;
}

.modal-text {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

.modal-buttons {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
}

/* Filter Bar */
.filter-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: nowrap;
    margin-bottom: 1.5rem;
}

.filter-bar input.form-control {
    flex: 1;
    min-width: 0;
    max-width: none;
    height: 40px;
    padding-top: 0;
    padding-bottom: 0;
    box-sizing: border-box;
}

.filter-bar select.form-control {
    flex-shrink: 0;
    width: auto;
    max-width: none;
    height: 40px;
    padding-top: 0;
    padding-bottom: 0;
    box-sizing: border-box;
}

.filter-bar .btn {
    flex-shrink: 0;
    height: 40px;
    padding-top: 0;
    padding-bottom: 0;
    box-sizing: border-box;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
    color: var(--text-muted);
}

.empty-state svg {
    width: 48px;
    height: 48px;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state p {
    font-size: 0.9rem;
}

/* Page header with actions */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.page-header h1 {
    font-size: 1.5rem;
}

/* Thumbnail preview in table */
.table-thumbnail {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    background: var(--bg-input);
}

/* Status dot */
.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 6px;
}

.status-dot.active { background: var(--success); }
.status-dot.inactive { background: var(--danger); }

/* Avatar in profile */
.avatar-preview {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: var(--bg-input);
    border: 3px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
    overflow: hidden;
    margin-bottom: 1rem;
}

.avatar-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Utility Classes */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-primary { color: var(--primary); }
.text-sm { font-size: 0.85rem; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.flex-1 { flex: 1; }

/* =============================================
   RESPONSIVE DESIGN
   ============================================= */

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

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
        box-shadow: var(--shadow-lg);
    }

    .main-content {
        margin-left: 0;
    }

    .mobile-toggle {
        display: flex;
    }

    .content-body {
        padding: 1.25rem;
    }

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

    .filter-bar {
        flex-wrap: wrap;
    }

    .filter-bar input.form-control,
    .filter-bar select.form-control {
        width: 100%;
        max-width: 100%;
        flex: 1 1 100%;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .hero h1 {
        font-size: 2.25rem;
    }

    .hero-stats {
        flex-direction: column;
        gap: 1.5rem;
    }

    .landing-nav-links {
        display: none;
    }

    .data-table th, .data-table td {
        padding: 0.6rem 0.75rem;
        font-size: 0.8rem;
    }

    .action-buttons {
        flex-direction: column;
    }
}

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

    .hero h1 {
        font-size: 1.75rem;
    }

    .hero-buttons {
        flex-direction: column;
    }

    .modal-buttons {
        flex-direction: column;
    }
}

/* Sidebar overlay for mobile */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 45;
}

.sidebar-overlay.active {
    display: block;
}

/* File input styling */
.file-input-wrapper {
    position: relative;
}

.file-input-wrapper input[type="file"] {
    width: 100%;
    padding: 0.65rem 0.875rem;
    font-size: 0.9rem;
    font-family: inherit;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    cursor: pointer;
}

.file-input-wrapper input[type="file"]::file-selector-button {
    background: var(--bg-card-hover);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    padding: 0.35rem 0.75rem;
    margin-right: 0.75rem;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.85rem;
    transition: var(--transition-fast);
}

.file-input-wrapper input[type="file"]::file-selector-button:hover {
    background: var(--border-light);
}

/* List items for dashboard widgets */
.list-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.25rem;
    border-bottom: 1px solid var(--border);
    transition: var(--transition-fast);
}

.list-item:last-child {
    border-bottom: none;
}

.list-item:hover {
    background: var(--bg-card-hover);
}

.list-item-content {
    flex: 1;
    min-width: 0;
}

.list-item-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.list-item-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 2px;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--border-light);
}

/* ==========================================================================
   Topbar Profile Dropdown
   ========================================================================== */

.topbar-profile {
    position: relative;
}

.topbar-avatar-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: 1.5px solid var(--border);
    border-radius: 50px;
    padding: 4px 10px 4px 4px;
    cursor: pointer;
    transition: var(--transition-fast);
    color: var(--text-secondary);
}

.topbar-avatar-btn:hover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.topbar-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    font-size: 0.8rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}

.topbar-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.topbar-avatar-caret {
    width: 14px;
    height: 14px;
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.topbar-avatar-btn[aria-expanded="true"] .topbar-avatar-caret {
    transform: rotate(180deg);
}

/* Dropdown panel */
.topbar-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 230px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    z-index: 200;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s;
    pointer-events: none;
}

.topbar-dropdown.is-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

/* Dropdown header */
.topbar-dropdown-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
}

.topbar-dropdown-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    font-size: 0.9rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}

.topbar-dropdown-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.topbar-dropdown-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-heading);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.topbar-dropdown-role {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 1px;
}

.topbar-dropdown-divider {
    height: 1px;
    background: var(--border-light);
    margin: 0;
}

/* Dropdown items */
.topbar-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 16px;
    background: none;
    border: none;
    font-family: inherit;
    font-size: 0.875rem;
    color: var(--text-secondary);
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s ease, color 0.15s ease;
    text-align: left;
}

.topbar-dropdown-item svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    opacity: 0.7;
}

.topbar-dropdown-item:hover {
    background: var(--bg-card-hover);
    color: var(--text-heading);
}

.topbar-dropdown-item:hover svg {
    opacity: 1;
}

.topbar-dropdown-logout {
    color: var(--danger);
}

.topbar-dropdown-logout:hover {
    background: var(--danger-bg);
    color: var(--danger);
}
