/* =============================================================
   SLR Manager — main.css
   Design tokens, reset, typography, layout skeleton
   ============================================================= */

/* ---- Google Font loaded in HTML ---- */

:root {
    /* Colors */
    --c-primary:       #4F46E5;
    --c-primary-dark:  #3730A3;
    --c-primary-light: #EEF2FF;
    --c-accent:        #818CF8;

    --c-success:  #10B981;
    --c-warning:  #F59E0B;
    --c-danger:   #EF4444;
    --c-maybe:    #8B5CF6;

    --c-sidebar-bg:    #1E1B4B;
    --c-sidebar-hover: #2D2A6E;
    --c-sidebar-active:#4F46E5;
    --c-sidebar-text:  #C7D2FE;
    --c-sidebar-muted: #6B75CA;

    --c-bg:      #F0F4FF;
    --c-surface: #FFFFFF;
    --c-border:  #E5E7EB;
    --c-border-light: #F3F4F6;

    --c-text:       #111827;
    --c-text-muted: #6B7280;
    --c-text-light: #9CA3AF;

    /* Dimensions */
    --sidebar-w: 240px;
    --header-h: 60px;

    /* Spacing */
    --sp-xs: 0.25rem;
    --sp-sm: 0.5rem;
    --sp-md: 1rem;
    --sp-lg: 1.5rem;
    --sp-xl: 2rem;
    --sp-2xl: 3rem;

    /* Radius */
    --r-sm: 6px;
    --r-md: 10px;
    --r-lg: 14px;
    --r-xl: 20px;
    --r-full: 9999px;

    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04);
    --shadow-md: 0 4px 12px rgba(0,0,0,.10), 0 2px 4px rgba(0,0,0,.06);
    --shadow-lg: 0 12px 32px rgba(0,0,0,.14);

    /* Typography */
    --font: 'Inter', system-ui, -apple-system, sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
    font-family: var(--font);
    background: var(--c-bg);
    color: var(--c-text);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
}

a { color: inherit; text-decoration: none; }

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
}

input, textarea, select {
    font-family: inherit;
    font-size: 0.875rem;
}

ul, ol { list-style: none; }

img { max-width: 100%; display: block; }

/* ---- App layout ---- */
#app {
    display: flex;
    min-height: 100vh;
}

/* ---- Sidebar ---- */
.sidebar {
    width: var(--sidebar-w);
    min-height: 100vh;
    background: var(--c-sidebar-bg);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 200;
    transition: transform 0.3s cubic-bezier(.4,0,.2,1);
    overflow-y: auto;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 199;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1.25rem 1.25rem 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.brand-icon {
    width: 40px;
    height: 40px;
    background: var(--c-primary);
    border-radius: var(--r-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
}

.brand-name {
    display: block;
    font-weight: 700;
    font-size: 0.9375rem;
    color: white;
    letter-spacing: -0.01em;
}

.brand-sub {
    display: block;
    font-size: 0.6875rem;
    color: var(--c-sidebar-muted);
    font-weight: 400;
    margin-top: 1px;
}

/* ---- Sidebar Nav ---- */
.sidebar-nav {
    flex: 1;
    padding: 1rem 0.75rem;
}

.nav-section-label {
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--c-sidebar-muted);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 0 0.5rem;
    margin-bottom: 0.375rem;
}

.nav-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.5625rem 0.75rem;
    border-radius: var(--r-sm);
    color: var(--c-sidebar-text);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    position: relative;
}

.nav-item:hover {
    background: var(--c-sidebar-hover);
    color: white;
}

.nav-item.active {
    background: var(--c-sidebar-active);
    color: white;
}

.nav-icon {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    opacity: 0.85;
}

.nav-item.active .nav-icon { opacity: 1; }

.nav-label { flex: 1; }

.nav-badge {
    background: var(--c-accent);
    color: white;
    font-size: 0.6875rem;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: var(--r-full);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
}

.nav-badge:empty { display: none; }

.nav-item-sm {
    padding: 0.4375rem 0.75rem;
    font-size: 0.8125rem;
    opacity: 0.75;
}

.nav-item-sm:hover { opacity: 1; }

/* ---- Sidebar Footer ---- */
.sidebar-footer {
    padding: 0.75rem;
    border-top: 1px solid rgba(255,255,255,0.08);
}

.review-label {
    display: block;
    font-size: 0.6875rem;
    color: var(--c-sidebar-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 0.375rem;
}

.review-title-input {
    width: 100%;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: var(--r-sm);
    padding: 0.5rem 0.625rem;
    color: white;
    font-size: 0.8125rem;
    outline: none;
    transition: border-color 0.15s;
}

.review-title-input::placeholder { color: rgba(255,255,255,0.35); }

.review-title-input:focus {
    border-color: var(--c-accent);
    background: rgba(255,255,255,0.12);
}

/* ---- Main Wrapper ---- */
.main-wrapper {
    margin-left: var(--sidebar-w);
    flex: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ---- Top Header ---- */
.top-header {
    height: var(--header-h);
    background: var(--c-surface);
    border-bottom: 1px solid var(--c-border);
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0 1.5rem;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    padding: 4px;
    border-radius: var(--r-sm);
}

.hamburger span {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--c-text-muted);
    border-radius: 2px;
    transition: 0.3s;
}

.header-breadcrumb {
    flex: 1;
    font-weight: 600;
    font-size: 1rem;
    color: var(--c-text);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.progress-mini {
    width: 120px;
    height: 6px;
    background: var(--c-border);
    border-radius: var(--r-full);
    overflow: hidden;
}

.progress-mini-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--c-primary), var(--c-accent));
    border-radius: var(--r-full);
    transition: width 0.5s ease;
    width: 0%;
}

.progress-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--c-text-muted);
    min-width: 32px;
    text-align: right;
}

/* ---- Page Content ---- */
.page-content {
    flex: 1;
    padding: var(--sp-xl);
    max-width: 1100px;
    width: 100%;
    margin: 0 auto;
    position: relative;
}

/* ---- Page Header ---- */
.page-header {
    margin-bottom: var(--sp-xl);
}

.page-header h1 {
    font-size: 1.625rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--c-text);
}

.page-subtitle {
    font-size: 0.9375rem;
    color: var(--c-text-muted);
    margin-top: 0.25rem;
}

/* ---- Loading ---- */
.loading-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--c-bg);
    z-index: 50;
    transition: opacity 0.3s;
}

.loading-overlay.hidden { display: none; }

.spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--c-border);
    border-top-color: var(--c-primary);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

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

/* ---- Utilities ---- */
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
.mt-sm { margin-top: var(--sp-sm); }
.mt-md { margin-top: var(--sp-md); }
.mt-lg { margin-top: var(--sp-lg); }
.mb-md { margin-bottom: var(--sp-md); }
.mb-lg { margin-bottom: var(--sp-lg); }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.gap-sm { gap: var(--sp-sm); }
.gap-md { gap: var(--sp-md); }
.text-muted { color: var(--c-text-muted); font-size: 0.875rem; }
.text-sm { font-size: 0.8125rem; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.w-full { width: 100%; }
