/* ================================================================
   CSS RESET & BASE STYLES
   ================================================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

*::before,
*::after {
    box-sizing: border-box;
}

/* ================================================================
   CSS CUSTOM PROPERTIES (DESIGN TOKENS)
   ================================================================ */
:root {
    /* Color Palette */
    --primary: #1e40af;
    --primary-light: #3b82f6;
    --primary-dark: #1e3a8a;
    --secondary: #0f172a;
    --accent: #f59e0b;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;

    /* Neutral Colors */
    --white: #ffffff;
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;

    /* Spacing & Dimensions */
    --radius: 8px;
    --radius-sm: 4px;
    --radius-full: 50px;

    /* Shadows */
    --shadow: 0 1px 2px 0 rgb(0 0 0 / 0.06);
    --shadow-lg: 0 4px 6px -1px rgb(0 0 0 / 0.07), 0 2px 4px -2px rgb(0 0 0 / 0.05);
    --shadow-xl: 0 8px 16px -4px rgb(0 0 0 / 0.1);

    /* Typography */
    --font-family-base: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    --line-height-base: 1.6;

    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-base: 0.2s ease;
    --transition-slow: 0.3s ease;

    /* Z-Index Scale */
    --z-background: 0;
    --z-base: 1;
    --z-footer: 10;
    --z-modal: 100;
    --z-notification: 1000;
}

/* ================================================================
   BASE TYPOGRAPHY & LAYOUT
   ================================================================ */
body {
    font-family: var(--font-family-base);
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 35%, #334155 100%);
    min-height: 100vh;
    color: var(--gray-800);
    line-height: var(--line-height-base);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ================================================================
   LAYOUT COMPONENTS
   ================================================================ */
.bg-overlay {
    position: fixed;
    inset: 0;
    background: url('data:image/svg+xml,<svg width="80" height="80" viewBox="0 0 80 80" xmlns="http://www.w3.org/2000/svg"><defs><pattern id="smallGrid" width="8" height="8" patternUnits="userSpaceOnUse"><path d="M 8 0 L 0 0 0 8" fill="none" stroke="%23334155" stroke-width="0.5" opacity="0.1"/></pattern></defs><rect width="100%" height="100%" fill="url(%23smallGrid)"/></svg>') repeat;
    pointer-events: none;
    z-index: var(--z-background);
}

.container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    z-index: var(--z-base);
    padding: 2rem;
    gap: 2rem;
}


/* ================================================================
   NAVIGATION HEADER
   ================================================================ */
.nav-header {
    background: linear-gradient(90deg, rgba(11,20,35,0.95), rgba(17,24,39,0.95));
    box-shadow: 0 2px 8px rgba(2,6,23,0.3);
    position: sticky;
    top: 0;
    z-index: var(--z-modal);
    border-bottom: 1px solid rgba(255,255,255,0.03);
}

/* Light / white header variant (used on dashboard screenshot) */
.nav-header.light {
    background: var(--white);
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    border-bottom: 1px solid var(--gray-200);
}

.nav-header.light .nav-container { padding: 0.5rem 1.5rem; }
.nav-header.light .nav-title { color: var(--gray-900); }
.nav-header.light .nav-subtitle { color: var(--gray-500); }
.nav-header.light .nav-link { color: var(--gray-800); background: transparent; padding:0.35rem 0.7rem; border-radius:6px; }
.nav-header.light .nav-link:hover{ background: rgba(15,23,42,0.04); color: var(--gray-800); }
.nav-header.light .nav-link.active {
    background: var(--primary);
    color: var(--white);
    box-shadow: 0 2px 6px rgba(30,64,175,0.18);
}

.nav-header.light .nav-logo { box-shadow: 0 2px 6px rgba(14,40,110,0.1); }

.nav-header.light .user-toggle { background: transparent; border: 1px solid rgba(15,23,42,0.04); color: var(--gray-800); }
.nav-header.light .user-meta .user-name { color: var(--gray-900); }
.nav-header.light .user-meta .user-role { color: var(--gray-500); }
.nav-header.light .user-avatar { box-shadow: 0 6px 18px rgba(14,40,110,0.12); }

.nav-header.light .btn-logout-square { margin-right: 0.75rem; }

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0.5rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.nav-logo {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    color: var(--white);
    font-size: 0.85rem;
    box-shadow: 0 2px 6px rgba(14,40,110,0.15);
}

.nav-info {
    display: flex;
    flex-direction: column;
}

.nav-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--white);
    margin: 0;
    line-height: 1.2;
}

.nav-subtitle {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.75);
    margin: 0;
    line-height: 1.2;
}

.nav-menu {
    display: flex;
    gap: 0.5rem;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.7rem;
    border-radius: 6px;
    text-decoration: none;
    color: rgba(255,255,255,0.85);
    font-size: 0.85rem;
    font-weight: 600;
    transition: all var(--transition-base);
    opacity: 0.95;
}

/* small pill icon to the left of nav items */
.nav-link-icon{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    width:30px;
    height:30px;
    border-radius:6px;
    background: rgba(15,23,42,0.03);
    color:var(--gray-700);
    box-shadow:none;
    font-size:13px;
}
.nav-link-icon i{ width:16px; height:16px; display:block; }
/* background: linear-gradient(135deg,#334155,#1f3a8a);remove for blackground */
.nav-header.light .nav-link-icon{ box-shadow:0 6px 16px rgba(14,40,110,0.06); }
.nav-link-icon svg{ width:16px; height:16px; display:block; }
.nav-link-icon svg *{ fill: currentColor; stroke: currentColor; }
.nav-header.light .nav-link{ color:var(--gray-800); }

/* Active nav link: make the pill blue with white icon */
.nav-header.light .nav-link.active .nav-link-icon{
    background: var(--primary);
    color: var(--white);
    box-shadow: 0 2px 4px rgba(30,64,175,0.15);
}

/* Non-active nav link: subtle white background and darker icon/text */
.nav-header.light .nav-link:not(.active) .nav-link-icon{
    background: rgba(15,23,42,0.03);
    color: var(--gray-700);
    border: 1px solid rgba(15,23,42,0.03);
}

.nav-link:hover,
.nav-link.active {
    background: rgba(255, 255, 255, 0.06);
    color: var(--white);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.btn-theme-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    height: 34px;
    padding: 0 0.6rem;
    border-radius: 6px;
    border: 1px solid var(--gray-200);
    background: var(--white);
    color: var(--gray-700);
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-base);
}

.btn-theme-toggle:hover {
    border-color: var(--gray-300);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.06);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--white);
    font-size: 0.875rem;
    font-weight: 500;
}

/* User dropdown (avatar + name + dropdown menu) */
.user-dropdown {
    position: relative;
}

.user-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.35rem 0.6rem;
    background: rgba(255,255,255,0.02);
    border-radius: 10px;
    color: var(--white);
    border: 1px solid rgba(255,255,255,0.03);
    cursor: pointer;
    font-weight: 600;
}

/* Red logout square visible in header */
.btn-logout-square {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    margin-right: 0.4rem;
    background: #ef4444;
    color: var(--white);
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(220,38,38,0.18);
    text-decoration: none;
}
.btn-logout-square svg{ width:16px; height:16px; display:block; }
.btn-logout-square:hover{ background: #dc2626; box-shadow: 0 2px 6px rgba(220,38,38,0.25); }

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--primary);
    color: var(--white);
    font-weight: 700;
    font-size: 0.8rem;
    box-shadow: 0 1px 3px rgba(14,40,110,0.15);
}

.user-avatar-text {
    display: inline-block;
    font-size: 0.95rem;
    line-height: 1;
    letter-spacing: 0.6px;
}

.user-meta {
    display: flex;
    flex-direction: column;
    line-height: 1;
    text-align: left;
}

.user-name { font-size: 0.95rem; }
.user-role { font-size: 0.75rem; color: rgba(255,255,255,0.7); }

.user-caret { color: rgba(255,255,255,0.75); font-size: 0.8rem; }

.user-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    min-width: 170px;
    background: var(--white);
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
    border: 1px solid var(--gray-200);
    overflow: hidden;
    opacity: 0;
    transform: translateY(-6px) scale(0.98);
    transform-origin: top right;
    transition: all 160ms ease;
    pointer-events: none;
    z-index: var(--z-modal);
}

.user-dropdown.open .user-menu {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.user-menu-item {
    display: block;
    padding: 0.45rem 0.75rem;
    color: var(--gray-800);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.825rem;
}

.user-menu-item:hover { background: var(--gray-100); }

/* height: 1px; Remove height to allow for better visibility */

.user-menu-divider { background: var(--gray-200); margin: 0.35rem 0; }

/* Logout styled neutral (not red) to match provided screenshot */
.user-logout {
    background: transparent;
    color: var(--gray-800);
}

.user-logout:hover {
    background: var(--primary);
    color: var(--white);
}

/* ================================================================
   MAIN CONTENT LAYOUT
   ================================================================ */
.main-content {
    flex: 1;
    padding: 1.25rem 1.5rem;
    min-height: calc(100vh - 160px);
}

.content-container {
    max-width: 1400px;
    margin: 0 auto;
}

/* ================================================================
   PAGE HEADER
   ================================================================ */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding: 0.625rem 1rem;
    background: transparent;
    border-radius: 8px;
}

.page-title {
    font-size: 1.375rem;
    font-weight: 700;
    color: var(--white);
    margin: 0 0 0.2rem 0;
}

.page-subtitle {
    font-size: 0.825rem;
    color: var(--gray-300);
    margin: 0;
}

.page-actions-group {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.page-actions .btn-primary,
.page-actions-group .btn-primary,
.page-actions-group .btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.8rem;
    transition: all var(--transition-base);
    box-shadow: var(--shadow);
    border: 1px solid;
    cursor: pointer;
}

.page-actions .btn-primary,
.page-actions-group .btn-primary {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}

.page-actions .btn-primary:hover,
.page-actions-group .btn-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    box-shadow: var(--shadow-lg);
}

.page-actions-group .btn-secondary {
    background: var(--white);
    color: var(--gray-700);
    border-color: var(--gray-300);
}

.page-actions-group .btn-secondary:hover {
    background: var(--gray-50);
    border-color: var(--primary);
    color: var(--primary);
}

.page-actions-group .btn-analytics {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    padding: 0;
    border-radius: var(--radius-sm);
    border: 1px solid var(--gray-300);
    background: var(--white);
    color: var(--gray-600);
    text-decoration: none;
    font-size: 0.85rem;
    transition: all var(--transition-base);
    box-shadow: var(--shadow);
    cursor: pointer;
}

.page-actions-group .btn-analytics:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--gray-50);
}

/* ================================================================
   MESSAGES
   ================================================================ */
.messages-container {
    margin-bottom: 2rem;
}

.alert {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1rem;
    border-radius: var(--radius);
    margin-bottom: 0.75rem;
    font-size: 0.825rem;
    border: 1px solid;
    position: relative;
    animation: slideInDown 5s ease;
}

.alert-success {
    background: #f0fdf4;
    color: #166534;
    border-color: #bbf7d0;
}

.alert-error {
    background: #fef2f2;
    color: #b91c1c;
    border-color: #fecaca;
}

.alert-info {
    background: #f0f9ff;
    color: #1e40af;
    border-color: #bfdbfe;
}

.alert-close {
    position: absolute;
    right: 1rem;
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: var(--radius-sm);
    transition: background var(--transition-base);
}

.alert-close:hover {
    background: rgba(0, 0, 0, 0.1);
}

/* ================================================================
   FOOTER
   ================================================================ */
.footer {
    background: var(--white);
    border-top: 1px solid var(--gray-200);
    box-shadow: 0 -1px 3px 0 rgb(0 0 0 / 0.1);
    margin-top: auto;
    position: relative;
    z-index: var(--z-footer);
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.footer-links {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.footer-links a {
    color: var(--gray-600);
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 500;
    transition: color var(--transition-base);
}

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

/* Member login pill in footer
.footer-links .footer-member-login {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.9rem;
    background: linear-gradient(180deg, rgba(34,197,94,0.95), rgba(16,185,129,0.95));
    color: var(--white);
    border-radius: 999px;
    font-weight: 700;
    box-shadow: 0 8px 20px rgba(16,185,129,0.12);
    text-decoration: none;
}

.footer-links .footer-member-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(16,185,129,0.16);
} */

.footer-copyright {
    color: var(--gray-500);
    font-size: 0.8rem;
    text-align: right;
}

/* ================================================================
   FOOTER RESPONSIVE
   ================================================================ */
@media (max-width: 768px) {
    .footer-content {
        flex-direction: column;
        padding: 1.5rem;
    }

    .footer-links {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
    }

    .footer-copyright {
        text-align: center;
        width: 100%;
    }
}

@media (max-width: 480px) {
    .footer-content {
        padding: 1rem;
        gap: 1rem;
    }

    .footer-links {
        gap: 1rem;
    }

    .footer-links a {
        font-size: 0.8rem;
    }

    .footer-copyright {
        font-size: 0.8rem;
    }
}

/* ================================================================
   ANIMATIONS
   ================================================================ */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

