﻿/* ── Design tokens ────────────────────────────────────── */
:root {
    --ink:        #1a1a22;   /* near-black plum-charcoal */
    --ink-soft:   #23232e;
    --ivory:      #f5f4f0;   /* warm canvas */
    --paper:      #fdfdfc;   /* card surface */
    --hairline:   #e7e4de;
    --gold:       #c2a06b;   /* champagne accent */
    --gold-soft:  #d9c39a;
    --muted:      #8b8b96;
    --font-ui:      'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    --font-display: 'Playfair Display', Georgia, 'Times New Roman', serif;
}

/* ── Reset ────────────────────────────────────────────── */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-ui);
    background: var(--ivory);
    min-height: 100vh;
    min-height: 100dvh;
    -webkit-tap-highlight-color: transparent;
}

button, input, select, textarea {
    font-family: inherit;
    touch-action: manipulation;
}

/* ── Login Screen ─────────────────────────────────────── */
.login-container {
    background:
        radial-gradient(ellipse 80% 60% at 70% -10%, rgba(194,160,107,0.22), transparent 60%),
        linear-gradient(160deg, #1c1c26 0%, #14141b 100%);
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

#loginSection { display: flex; }

.login-box {
    background: var(--paper);
    border-radius: 18px;
    box-shadow: 0 24px 80px rgba(0,0,0,0.45);
    padding: 44px 40px;
    width: 100%;
    max-width: 420px;
}

.login-box h1 {
    font-family: var(--font-display);
    font-weight: 600;
    color: var(--ink);
    margin-bottom: 6px;
    font-size: 32px;
    text-align: center;
    letter-spacing: 0.01em;
}
.login-box h1::after {
    content: '';
    display: block;
    width: 36px;
    height: 2px;
    background: var(--gold);
    margin: 14px auto 2px;
}

.subtitle {
    text-align: center;
    color: #718096;
    margin-bottom: 24px;
    font-size: 14px;
}

.login-box .subtitle { margin-bottom: 32px; }

#forgotPasswordForm {
    border-top: 1px solid #e2e8f0;
    padding-top: 20px;
}
#forgotPasswordForm h2 {
    text-align: center;
    margin-bottom: 20px;
    color: #2d3748;
    font-size: 18px;
}
#forgotPasswordLink { transition: color 0.2s; }
#forgotPasswordLink:hover { color: #5568d3; text-decoration: underline; }

/* ── App Shell ────────────────────────────────────────── */
#appSection { display: none; }

/* ── Header ───────────────────────────────────────────── */
.header {
    position: fixed;
    top: 0;
    left: 260px;
    right: 0;
    height: 60px;
    background: rgba(250, 249, 246, 0.86);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--hairline);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px 0 16px;
    z-index: 100;
    transition: left 0.25s ease;
}
.header.expanded { left: 0; }

.header-left { display: flex; align-items: center; gap: 12px; }

.menu-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    min-width: 44px;
    min-height: 44px;
}
.menu-toggle:hover { background: rgba(26,26,34,0.05); }
.menu-toggle svg { width: 22px; height: 22px; stroke: var(--ink); }

.app-title {
    font-family: var(--font-display);
    font-size: 19px;
    font-weight: 600;
    color: var(--ink);
    letter-spacing: 0.01em;
}

.user-info { display: flex; align-items: center; gap: 14px; }

.username {
    color: var(--muted);
    font-size: 12px;
    letter-spacing: 0.04em;
    display: none;
}

.logout-btn {
    background: none;
    border: 1px solid var(--hairline);
    color: var(--ink);
    padding: 6px 16px;
    border-radius: 999px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    min-height: 34px;
    white-space: nowrap;
    transition: border-color 0.15s, background 0.15s;
}
.logout-btn:hover { border-color: var(--gold); background: rgba(194,160,107,0.08); }

/* ── Sidebar ──────────────────────────────────────────── */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 260px;
    height: 100dvh;
    background: linear-gradient(180deg, #1c1c26 0%, #16161e 100%);
    border-right: 1px solid rgba(255,255,255,0.04);
    overflow-y: auto;
    overflow-x: hidden;
    transition: transform 0.25s ease;
    z-index: 150;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.14) transparent;
}
.sidebar::-webkit-scrollbar { width: 5px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.14); border-radius: 3px; }

.sidebar.collapsed { transform: translateX(-100%); }

.sidebar-brand {
    padding: 22px 20px 18px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.sidebar-brand-name {
    font-family: var(--font-display);
    font-size: 19px;
    font-weight: 600;
    color: #f2f0ea;
    letter-spacing: 0.02em;
}
.sidebar-brand-rule {
    width: 28px;
    height: 2px;
    background: var(--gold);
    margin-top: 10px;
}

.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(12,12,17,0.55);
    z-index: 140;
    cursor: pointer;
}
.sidebar-backdrop.show { display: block; }

.nav-section { padding: 14px 0; border-bottom: 1px solid rgba(255,255,255,0.05); }
.nav-section:last-child { border-bottom: none; }

.nav-section-title {
    padding: 0 20px;
    font-size: 10px;
    font-weight: 600;
    color: #5e5e6d;
    text-transform: uppercase;
    letter-spacing: 1.6px;
    margin-bottom: 6px;
}

.nav-item {
    width: 100%;
    padding: 10px 20px;
    color: #a9a9b6;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13.5px;
    font-weight: 500;
    letter-spacing: 0.01em;
    transition: background 0.15s, color 0.15s;
    min-height: 42px;
    user-select: none;
    background: none;
    border: none;
    border-left: 2px solid transparent;
    text-align: left;
    -webkit-tap-highlight-color: transparent;
}
.nav-item:hover { background: rgba(255,255,255,0.04); color: #eceae4; }
.nav-item.active {
    background: rgba(194,160,107,0.10);
    color: #f2f0ea;
    font-weight: 600;
    border-left-color: var(--gold);
}
.nav-item.active .nav-icon { color: var(--gold-soft); }
.nav-icon {
    font-size: 15px;
    line-height: 1;
    flex-shrink: 0;
    width: 20px;
    text-align: center;
    color: #7c7c8a;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: color 0.15s;
}
.nav-item:hover .nav-icon { color: #d6d4cd; }
.nav-icon svg {
    width: 17px;
    height: 17px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.75;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* ── Main Content ─────────────────────────────────────── */
.main-content {
    margin-left: 260px;
    margin-top: 60px;
    padding: 24px;
    transition: margin-left 0.25s ease;
    min-height: calc(100dvh - 60px);
}

.main-content.expanded {
    margin-left: 0;
}

.content-section { display: none; }
.content-section.active { display: block; }

/* ── Page Header ──────────────────────────────────────── */
.page-header { margin-bottom: 24px; }
.page-title {
    font-family: var(--font-display);
    font-size: 26px;
    font-weight: 600;
    color: var(--ink);
    letter-spacing: 0.01em;
    margin-bottom: 4px;
}
.page-subtitle { color: var(--muted); font-size: 14px; }

/* ── Cards ────────────────────────────────────────────── */
.card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    padding: 24px;
    margin-bottom: 20px;
}

/* ── Dashboard ────────────────────────────────────────── */
.dashboard-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    padding: 20px 16px;
}
.stat-label { font-size: 13px; color: #718096; margin-bottom: 8px; font-weight: 500; }
.stat-value { font-size: 28px; font-weight: 700; color: #2d3748; }

.quick-links {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
}
.quick-link {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 12px;
    text-decoration: none;
    transition: transform 0.15s;
    display: block;
}
.quick-link:hover { transform: translateY(-2px); }
.quick-link-title { font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.quick-link-desc { font-size: 13px; opacity: 0.9; }

