.dashboard-content {
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

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

.welcome-subtitle {
    font-size: 1.3rem;
    color: #1e293b;
    line-height: 1.5;
    font-weight: 400;
    max-width: 800px;
}

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

.stat-card {
    background: white;
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    flex-shrink: 0;
}

.stat-icon.blue {
    background: #e0e7ff;
    color: #4361ee;
}

.stat-icon.green {
    background: #d1fae5;
    color: #10b981;
}

.stat-icon.purple {
    background: #f3e8ff;
    color: #9333ea;
}

.stat-icon.orange {
    background: #fff3e0;
    color: #f97316;
}

.stat-details {
    flex: 1;
    min-width: 0;
}

.stat-details h3 {
    font-size: 1.8rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
    line-height: 1.2;
    word-break: break-word;
}

.stat-details p {
    color: #64748b;
    margin: 0;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.menu-section {
    margin-top: 2rem;
}

.menu-title {
    font-size: 1.5rem;
    color: #1e293b;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 0.75rem;
}

.menu-title i {
    color: #4361ee;
}

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

.menu-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem 1rem;
    text-align: center;
    text-decoration: none;
    border: 1px solid #e2e8f0;
    transition: all 0.3s ease;
}

.menu-card:hover {
    border-color: #4361ee;
    transform: translateY(-3px);
    box-shadow: 0 10px 15px -3px rgb(67 97 238 / 0.1);
}

.menu-icon {
    width: 50px;
    height: 50px;
    background: #f1f5f9;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    color: #4361ee;
    font-size: 1.5rem;
}

.menu-name {
    display: block;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.loading-spinner {
    text-align: center;
    padding: 3rem;
    color: #64748b;
    font-size: 1.1rem;
}

.loading-spinner:after {
    content: '';
    display: block;
    width: 40px;
    height: 40px;
    margin: 1rem auto;
    border: 3px solid #f1f5f9;
    border-top-color: #4361ee;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ===== MOBILE RESPONSIVE STYLES ===== */
@media (max-width: 1200px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
}

@media (max-width: 992px) {
    .dashboard-content {
        padding: 1.5rem;
    }
    
    .welcome-subtitle {
        font-size: 1.2rem;
    }
    
    .menu-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .dashboard-content {
        padding: 1rem;
    }
    
    .welcome-subtitle {
        font-size: 1.1rem;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);  /* 2 cards per row on mobile */
        gap: 0.75rem;
    }
    
    .stat-card {
        padding: 1rem;
    }
    
    .stat-icon {
        width: 45px;
        height: 45px;
        font-size: 1.3rem;
    }
    
    .stat-details h3 {
        font-size: 1.3rem;
    }
    
    .stat-details p {
        font-size: 0.8rem;
    }
    
    .menu-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
    
    .menu-card {
        padding: 1rem 0.5rem;
    }
    
    .menu-icon {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }
    
    .menu-name {
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    .dashboard-content {
        padding: 0.75rem;
    }
    
    .welcome-subtitle {
        font-size: 1rem;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);  /* Keep 2 cards per row even on small mobile */
        gap: 0.5rem;
    }
    
    .stat-card {
        padding: 0.75rem;
        gap: 0.5rem;
    }
    
    .stat-icon {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }
    
    .stat-details h3 {
        font-size: 1.2rem;
    }
    
    .stat-details p {
        font-size: 0.75rem;
        white-space: normal;  /* Allow text to wrap on very small screens */
        line-height: 1.2;
    }
    
    .menu-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }
    
    .menu-title {
        font-size: 1.3rem;
    }
}

/* Tablet-specific improvements */
@media (min-width: 769px) and (max-width: 1024px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .menu-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Small desktop */
@media (min-width: 1025px) and (max-width: 1280px) {
    .menu-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}

/* ===== DARK MODE - DASHBOARD ===== */
html.dark-mode .welcome-subtitle { color: #94a3b8; }

html.dark-mode .menu-title { color: #f1f5f9; border-bottom-color: #334155; }
html.dark-mode .menu-title i { color: #818cf8; }

html.dark-mode .menu-card {
    background: #1e293b;
    border-color: #334155;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
html.dark-mode .menu-card:hover {
    border-color: #818cf8;
    background: #263548;
    box-shadow: 0 10px 20px rgba(67,97,238,0.2);
    transform: translateY(-4px);
}
html.dark-mode .menu-icon {
    background: #334155;
    color: #818cf8;
}
html.dark-mode .menu-card:hover .menu-icon {
    background: #4361ee;
    color: #ffffff;
}
html.dark-mode .menu-name { color: #e2e8f0; }

html.dark-mode .stat-card {
    background: #1e293b;
    border: 1px solid #334155;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}
html.dark-mode .stat-card:hover {
    box-shadow: 0 10px 25px rgba(0,0,0,0.4);
}
html.dark-mode .stat-details h3 { color: #f1f5f9; }
html.dark-mode .stat-details p { color: #94a3b8; }

html.dark-mode .stat-icon.blue { background: #1e3a8a; color: #818cf8; }
html.dark-mode .stat-icon.green { background: #064e3b; color: #34d399; }
html.dark-mode .stat-icon.purple { background: #3b0764; color: #c084fc; }
html.dark-mode .stat-icon.orange { background: #431407; color: #fb923c; }

/* ══════════════════════════════════════════
   HUB USER PANEL
══════════════════════════════════════════ */
.hub-user-panel { margin-bottom: 2rem; }

/* ── Auth Panel Card ── */
.hub-auth-panel {
    background: #fff;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 12px rgba(67,97,238,0.07);
    overflow: visible;
    display: flex;
    flex-direction: column;
}
.hub-auth-panel::before {
    content: '';
    display: block;
    height: 4px;
    background: linear-gradient(90deg, #4361ee 0%, #7c3aed 50%, #06b6d4 100%);
    border-radius: 16px 16px 0 0;
    flex-shrink: 0;
}

/* ── Single row ── */
.hub-panel-footer {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    flex-wrap: wrap;
    position: relative;
}

/* thin vertical separator between nav buttons and dropdowns */
.hub-panel-sep {
    width: 1px;
    height: 22px;
    background: #e2e8f0;
    flex-shrink: 0;
    margin: 0 0.25rem;
}

/* ── Profile / Settings pill buttons ── */
.hub-nav-btn {
    display: inline-flex; align-items: center; gap: 0.4rem;
    padding: 0.42rem 1rem;
    border-radius: 50px;
    font-size: 0.82rem; font-weight: 600;
    text-decoration: none;
    border: 1.5px solid #e2e8f0;
    background: #f8fafc;
    color: #475569;
    cursor: pointer;
    transition: all 0.17s ease;
    white-space: nowrap;
    font-family: inherit;
}
.hub-nav-btn i { font-size: 0.78rem; color: #4361ee; }
.hub-nav-btn:hover {
    background: #e0e7ff; border-color: #4361ee; color: #4361ee;
    transform: translateY(-1px); box-shadow: 0 3px 10px rgba(67,97,238,0.13);
}

/* ── Language picker ── */
.hub-lang-wrap { position: relative; }
.hub-lang-toggle {
    display: inline-flex; align-items: center; gap: 0.42rem;
    padding: 0.42rem 1rem;
    border-radius: 50px;
    background: #f8fafc; border: 1.5px solid #e2e8f0;
    font-size: 0.82rem; color: #475569; cursor: pointer;
    transition: all 0.17s; white-space: nowrap; font-family: inherit;
}
.hub-lang-toggle .globe { color: #4361ee; font-size: 0.8rem; }
.hub-lang-toggle .chev { font-size: 0.62rem; transition: transform 0.2s; margin-left: 2px; }
.hub-lang-toggle:hover { border-color: #4361ee; background: #e0e7ff; color: #4361ee; }
.hub-lang-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    min-width: 180px;
    background: #fff;
    border: 1.5px solid #e2e8f0;
    border-radius: 14px;
    box-shadow: 0 8px 28px rgba(0,0,0,0.12);
    z-index: 9999;
    max-height: 240px;
    overflow-y: auto;
    padding: 0.4rem;
}
.hub-lang-dropdown.open { display: block; }
.hub-lang-option {
    display: flex; align-items: center; gap: 0.5rem;
    padding: 0.5rem 0.75rem; border-radius: 9px;
    color: #334155; font-size: 0.84rem; text-decoration: none;
    transition: background 0.12s;
}
.hub-lang-option:hover { background: #f1f5f9; }

/* ── Account switcher ── */
.hub-acct-wrap { position: relative; }
.hub-acct-toggle {
    display: inline-flex; align-items: center; gap: 0.42rem;
    padding: 0.42rem 1rem;
    border-radius: 50px;
    background: #f8fafc; border: 1.5px solid #e2e8f0;
    font-size: 0.82rem; color: #475569; cursor: pointer;
    transition: all 0.17s; white-space: nowrap; font-family: inherit;
}
.hub-acct-toggle .acct-icon { color: #4361ee; font-size: 0.8rem; }
.hub-acct-toggle .chev { font-size: 0.62rem; transition: transform 0.2s; margin-left: 2px; }
.hub-acct-toggle:hover { border-color: #4361ee; background: #e0e7ff; color: #4361ee; }
.hub-acct-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    min-width: 230px;
    background: #fff;
    border: 1.5px solid #e2e8f0;
    border-radius: 16px;
    box-shadow: 0 8px 28px rgba(0,0,0,0.12);
    z-index: 9999;
    overflow: visible;
    padding: 0.5rem;
}
.hub-acct-dropdown.open { display: block; }
.hub-acct-label {
    font-size: 0.71rem; font-weight: 700; color: #94a3b8;
    text-transform: uppercase; letter-spacing: 0.07em;
    padding: 0.4rem 0.75rem 0.3rem;
}
.hub-acct-item {
    display: flex; align-items: center; gap: 0.6rem;
    padding: 0.55rem 0.75rem; border-radius: 10px;
    color: #334155; font-size: 0.84rem;
    cursor: pointer; transition: background 0.12s;
    border: none; background: none; width: 100%; text-align: left; font-family: inherit;
}
.hub-acct-item:hover { background: #f1f5f9; }
.hub-acct-item.active-acct { background: #eef2ff; }
.acct-mini-av {
    width: 32px; height: 32px; min-width: 32px; border-radius: 50%;
    background: linear-gradient(135deg, #4361ee, #7c3aed);
    display: flex; align-items: center; justify-content: center;
    font-size: 0.78rem; font-weight: 700; color: #fff;
    overflow: hidden; flex-shrink: 0;
}
.acct-mini-av img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.acct-meta { display: flex; flex-direction: column; gap: 0.1rem; flex: 1; min-width: 0; }
.acct-meta strong { font-size: 0.84rem; font-weight: 600; color: #1e293b; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acct-meta span { font-size: 0.73rem; color: #64748b; }
.hub-acct-item.active-acct .acct-meta strong { color: #4361ee; }
.acct-check { margin-left: auto; color: #4361ee; font-size: 0.8rem; flex-shrink: 0; }
.hub-acct-sep { height: 1px; background: #f1f5f9; margin: 0.4rem 0; }
.hub-acct-action {
    display: flex; align-items: center; gap: 0.6rem;
    padding: 0.55rem 0.75rem; border-radius: 10px;
    font-size: 0.84rem; font-weight: 600; color: #4361ee;
    text-decoration: none; transition: background 0.12s;
    border: none; background: none; width: 100%; cursor: pointer; font-family: inherit;
}
.hub-acct-action i { font-size: 0.82rem; }
.hub-acct-action:hover { background: #e0e7ff; }

/* ── Guest panel ── */
.hub-guest-panel {
    display: flex; align-items: center; gap: 1.25rem;
    background: linear-gradient(135deg, #f0f4ff 0%, #faf5ff 100%);
    border: 1.5px solid #c7d2fe; border-radius: 16px;
    padding: 1.25rem 1.75rem; flex-wrap: wrap;
}
.hub-guest-icon { font-size: 2.5rem; color: #a5b4fc; line-height: 1; flex-shrink: 0; }
.hub-guest-text { flex: 1; min-width: 140px; }
.hub-guest-text p { margin: 0 0 0.15rem; font-weight: 700; font-size: 0.98rem; color: #1e293b; }
.hub-guest-text span { font-size: 0.82rem; color: #64748b; }
.hub-panel-login-btn {
    display: inline-flex; align-items: center; gap: 0.5rem;
    background: linear-gradient(135deg, #4361ee, #7c3aed);
    color: #fff; padding: 0.6rem 1.4rem; border-radius: 50px;
    font-weight: 700; font-size: 0.88rem; text-decoration: none;
    box-shadow: 0 4px 14px rgba(67,97,238,0.32); transition: all 0.2s; white-space: nowrap;
}
.hub-panel-login-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(67,97,238,0.4); }

/* ── Dark mode ── */
html.dark-mode .hub-auth-panel { background: #1e293b; border-color: #334155; }
html.dark-mode .hub-panel-sep { background: #334155; }
html.dark-mode .hub-nav-btn { background: #0f172a; border-color: #334155; color: #cbd5e1; }
html.dark-mode .hub-nav-btn i { color: #818cf8; }
html.dark-mode .hub-nav-btn:hover { background: #1e3a8a; border-color: #818cf8; color: #e0e7ff; }
html.dark-mode .hub-lang-toggle,
html.dark-mode .hub-acct-toggle { background: #0f172a; border-color: #334155; color: #cbd5e1; }
html.dark-mode .hub-lang-toggle:hover,
html.dark-mode .hub-acct-toggle:hover { background: #1e3a8a; border-color: #818cf8; color: #e0e7ff; }
html.dark-mode .hub-lang-dropdown,
html.dark-mode .hub-acct-dropdown { background: #1e293b; border-color: #334155; box-shadow: 0 8px 28px rgba(0,0,0,0.4); }
html.dark-mode .hub-lang-option,
html.dark-mode .hub-acct-item { color: #cbd5e1; }
html.dark-mode .hub-lang-option:hover,
html.dark-mode .hub-acct-item:hover { background: #0f172a; }
html.dark-mode .hub-acct-item.active-acct { background: #1e3a8a; }
html.dark-mode .hub-acct-sep { background: #334155; }
html.dark-mode .hub-acct-label { color: #475569; }
html.dark-mode .acct-meta strong { color: #f1f5f9; }
html.dark-mode .hub-acct-action { color: #818cf8; }
html.dark-mode .hub-acct-action:hover { background: #1e3a8a; }

/* ── Mobile — never wrap, dropdowns always visible ── */

/* Outer footer: overflow visible so dropdowns are never clipped */
.hub-panel-footer {
    flex-wrap: nowrap !important;
    overflow: visible !important;
    position: relative;
}

/* Inner scroll wrapper keeps buttons on one line */
.hub-panel-footer-inner {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    width: 100%;
}
.hub-panel-footer-inner::-webkit-scrollbar { display: none; }

/* All direct children of footer-inner never shrink */
.hub-panel-footer-inner > *,
.hub-nav-btn,
.hub-lang-wrap,
.hub-acct-wrap,
.hub-panel-sep { flex-shrink: 0; }

@media (max-width: 480px) {
    .hub-panel-footer { padding: 0.65rem 0.9rem; }
    .hub-panel-footer-inner { gap: 0.4rem; }
    .hub-nav-btn,
    .hub-lang-toggle,
    .hub-acct-toggle { padding: 0.4rem 0.75rem; font-size: 0.79rem; }
    .hub-lang-dropdown { left: 0; right: auto; }
    .hub-acct-dropdown { left: auto; right: 0; min-width: 210px; }
}
@media (max-width: 360px) {
    .hub-panel-footer { padding: 0.55rem 0.75rem; }
    .hub-panel-footer-inner { gap: 0.35rem; }
    .hub-nav-btn,
    .hub-lang-toggle,
    .hub-acct-toggle { padding: 0.38rem 0.65rem; font-size: 0.76rem; }
}
