/* modern-design.css — page-specific overrides only.
   All core tokens, layout, and components are in tailwind-input.css → tailwind-output.css */

/* Portal topbar (member-facing) */
.portal-topbar { background-color: #fff; }
.dark .portal-topbar { background-color: #1D2939; border-bottom-color: #374151; }
.portal-topnav-link {
    display: inline-flex; align-items: center; padding: 0.5rem 0.875rem;
    border-radius: 0.5rem; font-size: 0.875rem; font-weight: 500;
    color: #6B7280; text-decoration: none; white-space: nowrap;
    transition: background-color 0.15s ease, color 0.15s ease;
}
.portal-topnav-link:hover { background-color: #F3F4F6; color: #111827; }
.portal-topnav-link.active { background-color: #EEF4FF; color: #465fff; font-weight: 600; }

/* Portal sidebar (admin uses a different aside without .sidebar) */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 50;
    display: flex;
    flex-direction: column;
    width: 280px;
    background: #fff;
    border-right: 1px solid #e5e7eb;
    transform: translateX(-100%);
    transition: transform 0.3s ease, width 0.3s ease;
    overflow-y: auto;
}
.dark .sidebar { background: #111827; border-right-color: #374151; }
.sidebar.open { transform: translateX(0); }

.sidebar-header {
    padding: 1.25rem 1rem;
    border-bottom: 1px solid #f3f4f6;
}
.dark .sidebar-header { border-bottom-color: #374151; }

.sidebar-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: #111827;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.dark .sidebar-title { color: #f8fafc; }

.sidebar-nav {
    flex: 1;
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0.75rem;
    border-radius: 0.625rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #4b5563;
    text-decoration: none;
    transition: background-color 0.15s ease, color 0.15s ease;
}
.nav-item:hover { background: #f3f4f6; color: #111827; }
.nav-item.active { background: #eef4ff; color: #465fff; font-weight: 600; }
.dark .nav-item { color: #94a3b8; }
.dark .nav-item:hover { background: rgba(255, 255, 255, 0.05); color: #f1f5f9; }
.dark .nav-item.active { background: rgba(70, 95, 255, 0.12); color: #818cf8; }

.nav-icon { width: 1.5rem; height: 1.5rem; flex-shrink: 0; }
.sidebar.collapsed .nav-label,
.sidebar.collapsed .sidebar-title { display: none; }

/* ---- Desktop (>=1024px): static left sidebar, like the admin layout ---- */
@media (min-width: 1024px) {
    .sidebar {
        position: static;
        transform: none !important;
        display: flex !important;
        height: 100%;
        flex-shrink: 0;
        z-index: auto;
    }
    .sidebar.collapsed { width: 84px; }
    .sidebar.collapsed .sidebar-header { justify-content: center; }
    .sidebar.collapsed .nav-item { justify-content: center; padding-left: 0; padding-right: 0; }
    /* The sidebar now provides navigation on desktop, so hide the top-nav links
       (the topbar keeps the theme toggle + account actions). */
    .portal-topnav { display: none !important; }
}

/* ---- Mobile (<1024px): off-canvas drawer toggled by the hamburger ---- */
@media (max-width: 1023px) {
    .sidebar:not(.open) {
        display: none;
    }
}
