/* TIL Tracker - Admin Stylesheet */

/* =============================================
   FONT FACES — self-hosted Inter variable
   Single woff2 covers weights 100–900 in modern browsers.
   ============================================= */
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url('fonts/inter/InterVariable.woff2') format('woff2-variations'),
         url('fonts/inter/InterVariable.woff2') format('woff2');
}
@font-face {
    font-family: 'Inter';
    font-style: italic;
    font-weight: 100 900;
    font-display: swap;
    src: url('fonts/inter/InterVariable-Italic.woff2') format('woff2-variations'),
         url('fonts/inter/InterVariable-Italic.woff2') format('woff2');
}

/* =============================================
   CSS RESET & BASE
   ============================================= */
*, *::before, *::after {
    box-sizing: border-box;
}

:root {
    /* ─────────────────────────────────────────────
       BRANDABLE TOKENS
       Per-tenant theme overrides will target these.
       Future: settings.php injects an inline <style>
       block setting these on :root for white-label.
       ───────────────────────────────────────────── */
    --brand-primary:        #4338ca;   /* indigo-700 */
    --brand-primary-hover:  #3730a3;   /* indigo-800 */
    --brand-primary-active: #312e81;   /* indigo-900 */
    --brand-primary-soft:   #eef2ff;   /* indigo-50  */
    --brand-primary-on:     #ffffff;
    --brand-nav-bg:         #1e1b4b;   /* indigo-950 — brand-tied dark nav */
    --brand-font:           'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

    /* ─────────────────────────────────────────────
       SEMANTIC COLOUR TOKENS
       ───────────────────────────────────────────── */
    --color-bg:            #f6f7fb;
    --color-surface:       #ffffff;
    --color-surface-alt:   #f8fafc;
    --color-border:        #e5e7eb;
    --color-border-strong: #d1d5db;
    --color-text:          #111827;
    --color-text-muted:    #6b7280;
    --color-text-subtle:   #9ca3af;

    /* Accent maps to brand for backwards compatibility */
    --color-accent:      var(--brand-primary);
    --color-accent-dk:   var(--brand-primary-hover);
    --color-accent-soft: var(--brand-primary-soft);

    --color-danger:     #dc2626;
    --color-danger-bg:  #fef2f2;
    --color-danger-br:  #fecaca;
    --color-success:    #16a34a;
    --color-success-bg: #f0fdf4;
    --color-success-br: #bbf7d0;
    --color-warn:       #b45309;
    --color-warn-bg:    #fffbeb;
    --color-warn-br:    #fde68a;
    --color-nav:        var(--brand-nav-bg);

    /* ─────────────────────────────────────────────
       TYPOGRAPHY SCALE
       ───────────────────────────────────────────── */
    --font-sans: var(--brand-font);
    --font-mono: 'JetBrains Mono', 'SF Mono', 'Consolas', 'Menlo', monospace;

    --fs-xs:   0.75rem;     /* 12px */
    --fs-sm:   0.8125rem;   /* 13px */
    --fs-base: 0.9375rem;   /* 15px — body */
    --fs-md:   1rem;        /* 16px */
    --fs-lg:   1.125rem;    /* 18px */
    --fs-xl:   1.375rem;    /* 22px */
    --fs-2xl:  1.75rem;     /* 28px */
    --fs-3xl:  2.25rem;     /* 36px */

    --lh-tight: 1.2;
    --lh-snug:  1.35;
    --lh-base:  1.5;
    --lh-loose: 1.7;

    --fw-regular:  400;
    --fw-medium:   500;
    --fw-semibold: 600;
    --fw-bold:     700;

    --tracking-tight:  -0.01em;
    --tracking-normal: 0;
    --tracking-wide:   0.04em;

    /* ─────────────────────────────────────────────
       SPACING SCALE (4px grid)
       ───────────────────────────────────────────── */
    --space-1:  0.25rem;   /*  4px */
    --space-2:  0.5rem;    /*  8px */
    --space-3:  0.75rem;   /* 12px */
    --space-4:  1rem;      /* 16px */
    --space-5:  1.25rem;   /* 20px */
    --space-6:  1.5rem;    /* 24px */
    --space-8:  2rem;      /* 32px */
    --space-10: 2.5rem;    /* 40px */
    --space-12: 3rem;      /* 48px */

    /* ─────────────────────────────────────────────
       RADIUS SCALE
       ───────────────────────────────────────────── */
    --radius-sm:   4px;
    --radius:      8px;    /* primary radius (was 6px) */
    --radius-md:   10px;
    --radius-lg:   14px;
    --radius-pill: 999px;

    /* ─────────────────────────────────────────────
       ELEVATION SCALE
       Layered shadows for a softer, more modern feel.
       ───────────────────────────────────────────── */
    --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
    --shadow:    0 1px 3px rgba(15, 23, 42, 0.06),
                 0 1px 2px rgba(15, 23, 42, 0.04);
    --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.08),
                 0 2px 4px rgba(15, 23, 42, 0.04);
    --shadow-lg: 0 12px 32px rgba(15, 23, 42, 0.12),
                 0 4px 8px rgba(15, 23, 42, 0.06);

    /* ─────────────────────────────────────────────
       MOTION
       ───────────────────────────────────────────── */
    --transition-fast: 0.12s ease;
    --transition:      0.18s ease;

    /* ─────────────────────────────────────────────
       FOCUS RING (accessibility)
       ───────────────────────────────────────────── */
    --focus-ring: 0 0 0 3px rgba(67, 56, 202, 0.18);
}

html {
    scrollbar-gutter: stable;
}

html, body {
    margin: 0;
    padding: 0;
    font-family: var(--font-sans);
    font-size: var(--fs-base);
    color: var(--color-text);
    background: var(--color-bg);
    line-height: var(--lh-base);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* Tabular numerics on financial figures — keeps columns aligned */
.data-table,
.stat-value,
.balance-value,
.report-bal-val,
.til-preview-value,
.tab-count,
.nav-badge,
.example-table {
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum" 1;
}

a {
    color: var(--color-accent);
    text-decoration: none;
}
a:hover {
    text-decoration: underline;
}

/* =============================================
   ICONS — Lucide SVG sprite at icons.svg
   Sized via 1em so icons inherit surrounding text scale.
   ============================================= */
.icon {
    display: inline-block;
    width: 1.05em;
    height: 1.05em;
    vertical-align: -0.18em;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex-shrink: 0;
    pointer-events: none;
}
.icon--lg { width: 1.25em; height: 1.25em; }
.icon--sm { width: 0.875em; height: 0.875em; vertical-align: -0.15em; }
.icon--xs { width: 0.75em;  height: 0.75em;  vertical-align: -0.1em; }

/* Inside a status badge, icon nudges left of label */
.status-badge .icon,
.badge .icon {
    margin-right: 0.3em;
    width: 0.95em;
    height: 0.95em;
    vertical-align: -0.15em;
    stroke-width: 2.4;
}

/* Buttons get a slight gap when an icon precedes the label */
.btn .icon { margin-right: 0.4em; vertical-align: -0.15em; }

/* =============================================
   NAVIGATION
   ============================================= */
.top-nav {
    background: var(--color-nav);
    color: #fff;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.nav-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    height: 52px;
}
.nav-brand {
    font-size: 0.95rem;
    font-weight: 700;
    color: #e2e8f0;
    white-space: nowrap;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.nav-logo {
    height: 28px;
    width: auto;
    max-width: 56px;
    border-radius: 4px;
    object-fit: contain;
    flex-shrink: 0;
}
.nav-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 0;
    margin-left: auto;
}
.nav-menu > li > a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0 1rem;
    height: 52px;
    color: #cbd5e1;
    font-size: 0.875rem;
    font-weight: var(--fw-medium);
    text-decoration: none;
    white-space: nowrap;
    transition: background var(--transition-fast), color var(--transition-fast);
}
.nav-menu > li > a > .icon {
    width: 1.05em;
    height: 1.05em;
    opacity: 0.85;
}
.nav-menu > li > a:hover > .icon,
.nav-menu > li > a.active > .icon { opacity: 1; }
.nav-menu > li > a:hover {
    background: rgba(255,255,255,0.08);
    color: #fff;
}
.nav-menu > li > a.active {
    background: rgba(255,255,255,0.12);
    color: #fff;
    border-bottom: 2px solid var(--color-accent);
}
.nav-logout {
    border-left: 1px solid rgba(255,255,255,0.1);
    color: #94a3b8 !important;
}
.staff-code {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: var(--color-text-muted);
    background: var(--color-bg-alt, #f1f5f9);
    border: 1px solid var(--color-border, #e2e8f0);
    border-radius: 3px;
    padding: 0 0.3rem;
    margin-left: 0.3rem;
    vertical-align: middle;
    line-height: 1.5;
}
.sort-header {
    color: inherit;
    text-decoration: none;
    white-space: nowrap;
}
.sort-header:hover {
    text-decoration: underline;
}
.sort-arrow {
    font-size: 0.75em;
    margin-left: 0.2em;
}
.sort-arrow--inactive {
    opacity: 0.35;
}
.nav-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.2rem;
    height: 1.2rem;
    padding: 0 0.3rem;
    background: var(--color-danger);
    color: #fff;
    border-radius: 99px;
    font-size: 0.7rem;
    font-weight: 700;
    margin-left: 0.25rem;
    vertical-align: middle;
    line-height: 1;
}
/* Version badge — shown in dashboard heading */
.version-badge {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--color-text-muted);
    vertical-align: middle;
    margin-left: 0.4rem;
    letter-spacing: 0.03em;
}
/* Year badge — shown in dashboard heading */
.year-badge {
    display: inline-flex;
    align-items: center;
    background: var(--color-accent);
    color: #fff;
    font-size: 0.85rem;
    font-weight: 700;
    padding: 0.2rem 0.65rem;
    border-radius: 999px;
    letter-spacing: 0.03em;
    align-self: center;
}
.section-year {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--color-text-muted);
    background: var(--color-border);
    border-radius: 999px;
    padding: 0.1rem 0.5rem;
    vertical-align: middle;
    margin-left: 0.4rem;
}

/* Settings dropdown */
.nav-dropdown {
    position: relative;
}
.nav-dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0 1rem;
    height: 52px;
    background: none;
    border: none;
    color: #cbd5e1;
    font-size: 0.875rem;
    font-weight: var(--fw-medium);
    font-family: inherit;
    cursor: pointer;
    white-space: nowrap;
    transition: background var(--transition-fast), color var(--transition-fast);
}
.nav-dropdown-toggle > .icon {
    opacity: 0.85;
}
.nav-dropdown-toggle:hover > .icon { opacity: 1; }
.nav-dropdown-toggle:hover,
.nav-dropdown:hover .nav-dropdown-toggle {
    background: rgba(255,255,255,0.08);
    color: #fff;
}
.nav-dropdown-toggle--active {
    background: rgba(255,255,255,0.12);
    color: #fff;
    border-bottom: 2px solid var(--color-accent);
}
.nav-dropdown-chevron {
    width: 0.85em;
    height: 0.85em;
    opacity: 0.7;
    transition: transform var(--transition-fast);
}
.nav-dropdown.open .nav-dropdown-chevron {
    transform: rotate(180deg);
}
.nav-dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    min-width: 170px;
    background: var(--color-nav);
    border: 1px solid rgba(255,255,255,0.12);
    border-top: none;
    border-radius: 0 0 6px 6px;
    box-shadow: 0 6px 16px rgba(0,0,0,0.3);
    list-style: none;
    margin: 0;
    padding: 0.35rem 0;
    z-index: 200;
    flex-direction: column;
}
.nav-dropdown.open .nav-dropdown-menu {
    display: flex;
    flex-direction: column;
}
.nav-dropdown-menu li a {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.55rem 1.1rem;
    color: #cbd5e1;
    font-size: 0.875rem;
    text-decoration: none;
    white-space: nowrap;
    transition: background var(--transition-fast), color var(--transition-fast);
}
.nav-dropdown-menu li a > .icon { opacity: 0.7; width: 0.95em; height: 0.95em; }
.nav-dropdown-menu li a:hover > .icon,
.nav-dropdown-menu li a.active > .icon { opacity: 1; }
.nav-dropdown-menu li a:hover {
    background: rgba(255,255,255,0.08);
    color: #fff;
}
.nav-dropdown-menu li a.active {
    color: #fff;
    background: rgba(255,255,255,0.1);
}

.nav-year-item {
    display: flex;
    align-items: center;
    padding: 0 0.5rem;
    border-left: 1px solid rgba(255,255,255,0.1);
    margin-left: 0.25rem;
}

/* =============================================
   MOBILE NAV — hamburger toggle (hidden on desktop)
   ============================================= */
.nav-mobile-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    margin-left: auto;
    padding: 0;
    background: none;
    border: none;
    border-radius: var(--radius-sm);
    color: #cbd5e1;
    cursor: pointer;
    -webkit-appearance: none;
    -webkit-tap-highlight-color: rgba(255,255,255,0.18);
    touch-action: manipulation;     /* eliminates 300ms tap delay on iOS */
    user-select: none;
    position: relative;             /* z-index context — sits above any sibling */
    z-index: 2;
    transition: background var(--transition-fast), color var(--transition-fast);
}
.nav-mobile-toggle:active {
    background: rgba(255,255,255,0.18);
}
.nav-mobile-toggle:hover { background: rgba(255,255,255,0.08); color: #fff; }
.nav-mobile-toggle .icon { width: 1.4em; height: 1.4em; opacity: 0.95; }
.nav-mobile-icon-close { display: none; }
.top-nav.nav-open .nav-mobile-toggle      { background: rgba(255,255,255,0.12); color: #fff; }
.top-nav.nav-open .nav-mobile-icon-open   { display: none; }
.top-nav.nav-open .nav-mobile-icon-close  { display: inline-block; }
.nav-year-select {
    background: rgba(255,255,255,0.1);
    color: #e2e8f0;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: var(--radius);
    padding: 0.25rem 0.5rem;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    outline: none;
    transition: background 0.15s, border-color 0.15s;
}
.nav-year-select:hover,
.nav-year-select:focus {
    background: rgba(255,255,255,0.18);
    border-color: rgba(255,255,255,0.4);
}
.nav-year-select option {
    background: var(--color-nav);
    color: #e2e8f0;
}

/* =============================================
   LAYOUT
   ============================================= */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem 1.5rem 3rem;
}
.container--narrow {
    max-width: 680px;
}

.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}
.page-header h2 {
    margin: 0;
    font-size: 1.4rem;
}
.page-header-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.page-subtitle {
    margin: 0.25rem 0 0;
    color: var(--color-text-muted);
    font-size: 0.9rem;
}

.mt-4 { margin-top: 1.5rem; }
.mb-4 { margin-bottom: 1.5rem; }

/* =============================================
   CARDS
   ============================================= */
.card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 1.25rem 1.5rem;
    box-shadow: var(--shadow);
}
.card h3 {
    margin: 0 0 1rem;
    font-size: 1.05rem;
    color: var(--color-text);
}
.card--highlight {
    border-color: var(--color-accent);
    background: #f0f6ff;
}

/* =============================================
   BUTTONS
   ============================================= */
.btn {
    display: inline-block;
    -webkit-appearance: none;
    appearance: none;
    padding: 0.45rem 1rem;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 600;
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
    white-space: nowrap;
    line-height: 1.4;
    box-sizing: border-box;
    vertical-align: middle;
}
.btn-primary {
    background: var(--color-accent);
    color: #fff;
    border-color: var(--color-accent);
}
.btn-primary:hover {
    background: var(--color-accent-dk);
    border-color: var(--color-accent-dk);
    text-decoration: none;
    color: #fff;
}
.btn-secondary {
    background: var(--color-surface);
    color: var(--color-text);
    border-color: var(--color-border);
}
.btn-secondary:hover {
    background: #f8fafc;
    border-color: #94a3b8;
    text-decoration: none;
    color: var(--color-text);
}
.btn-danger {
    background: var(--color-danger);
    color: #fff;
    border-color: var(--color-danger);
}
.btn-danger:hover {
    background: #b91c1c;
    border-color: #b91c1c;
    text-decoration: none;
    color: #fff;
}
.btn-success {
    background: #16a34a;
    color: #fff;
    border-color: #16a34a;
}
.btn-success:hover {
    background: #15803d;
    border-color: #15803d;
    text-decoration: none;
    color: #fff;
}
.btn-success:disabled,
.btn-success[disabled] {
    background: #86efac;
    border-color: #86efac;
    cursor: not-allowed;
}
.btn-sm {
    padding: 0.25rem 0.65rem;
    font-size: 0.8rem;
}
.btn-block {
    width: 100%;
    text-align: center;
    display: block;
}

/* =============================================
   FORMS
   ============================================= */
.form-group {
    margin-bottom: 1rem;
}
.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.3rem;
    color: #374151;
}
.optional {
    font-weight: 400;
    color: var(--color-text-muted);
    font-size: 0.8rem;
}
.form-group input[type=text],
.form-group input[type=email],
.form-group input[type=password],
.form-group input[type=number],
.form-group input[type=date],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    font-size: 0.95rem;
    font-family: inherit;
    color: var(--color-text);
    background: var(--color-surface);
    transition: border-color 0.15s, box-shadow 0.15s;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: var(--focus-ring);
}
.form-group textarea {
    resize: vertical;
    min-height: 80px;
}
.form-hint {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    margin: 0.25rem 0 0;
}
.form-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1.25rem;
    flex-wrap: wrap;
}
.archive-preview-form {
    display: flex;
    gap: 0.75rem;
    align-items: flex-end;
    flex-wrap: wrap;
}
.archive-preview-form .form-group {
    margin: 0;
    flex: 1;
    min-width: 220px;
}
.archive-preview-action {
    display: flex;
    align-items: flex-end;
}
.archive-preview-btn {
    min-height: 40px;
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 400 !important;
    cursor: pointer;
}
.checkbox-label input[type=checkbox] {
    width: auto;
    margin: 0;
}

/* =============================================
   ALERTS / FLASH MESSAGES
   ============================================= */
.alert {
    padding: 0.8rem 1rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    font-size: 0.9rem;
    border: 1px solid transparent;
}
.alert-error {
    background: var(--color-danger-bg);
    color: #991b1b;
    border-color: #fca5a5;
}
.alert-success {
    background: var(--color-success-bg);
    color: #14532d;
    border-color: #86efac;
}
.alert-warn {
    background: var(--color-warn-bg);
    color: #78350f;
    border-color: #fcd34d;
}

/* =============================================
   TABLES
   ============================================= */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    background: var(--color-surface);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}
.data-table th,
.data-table td {
    padding: 0.65rem 0.9rem;
    text-align: left;
    border-bottom: 1px solid var(--color-border);
    vertical-align: top;     /* tall rows (e.g. bulk preview wrap badges)
                                top-align consistently across columns */
}
.data-table thead th {
    background: #f8fafc;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-muted);
}
.data-table tbody tr:last-child td {
    border-bottom: none;
}
.data-table tbody tr:hover {
    background: #fafbff;
}
.data-table tfoot td {
    font-size: 0.875rem;
    background: #f8fafc;
    border-top: 2px solid var(--color-border);
    border-bottom: none;
}
.text-right { text-align: right; }
.text-danger { color: var(--color-danger); }
.text-success { color: var(--color-success); }

.actions-cell {
    /* Stay as a real <td> (display:table-cell). display:flex on a <td>
       ejects it from the table-row layout in Chromium, which causes
       cells in this column to drift relative to siblings. Use inline
       siblings + margin for spacing instead of flex gap. */
    white-space: nowrap;
}
.actions-cell > * {
    vertical-align: middle;
}
.actions-cell > * + * {
    margin-left: 0.35rem;
}
.inline-form {
    display: inline;
}

/* =============================================
   DASHBOARD
   ============================================= */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}
.stat-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 1.25rem 1.5rem;
    box-shadow: var(--shadow);
    text-align: center;
}
.stat-card--warn {
    border-color: var(--color-warn);
    background: var(--color-warn-bg);
}
.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-accent);
}
.stat-label {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    margin-top: 0.25rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.dash-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}
@media (max-width: 768px) {
    .dash-grid { grid-template-columns: 1fr; }
}
.dash-section {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 1.25rem 1.5rem;
    box-shadow: var(--shadow);
}
.dash-section h3 {
    margin: 0 0 1rem;
    font-size: 1rem;
}
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}
.section-header h3 {
    margin: 0;
}
.empty-state {
    color: var(--color-text-muted);
    font-size: 0.9rem;
    padding: 1rem 0;
    font-style: italic;
}

/* =============================================
   EVENT DETAIL
   ============================================= */
.two-col-panels {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}
@media (max-width: 900px) {
    .two-col-panels { grid-template-columns: 1fr; }
}
.multiselect-controls {
    display: flex;
    gap: 0.4rem;
    margin-bottom: 0.4rem;
}
.multiselect-list {
    width: 100%;
    height: 180px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    font-size: 0.9rem;
    padding: 0.25rem;
}
.checkbox-list {
    width: 100%;
    max-height: 240px;
    overflow-y: auto;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 0.25rem;
}
.checkbox-list-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.5rem;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 0.9rem;
}
.checkbox-list-item:hover {
    background: var(--color-surface-alt, #f8fafc);
}
.checkbox-list-item input[type=checkbox] {
    margin: 0;
    flex: 0 0 auto;
}
.til-preview {
    display: block;
    font-size: 0.85rem;
    color: var(--color-text-muted);
    margin-top: 0.3rem;
}
.til-preview-value {
    color: var(--color-accent);
    font-weight: 700;
}
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25em;
    padding: 0.2rem 0.55rem;
    border-radius: var(--radius-pill);
    font-size: 0.75rem;
    font-weight: var(--fw-semibold);
    line-height: 1.4;
}
.badge-info {
    background: var(--brand-primary-soft);
    color: var(--brand-primary-hover);
    border: 1px solid #c7d2fe;
}
.inline-edit-form { width: 100%; }
.inline-edit-fields {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: flex-end;
}
.inline-edit-fields .form-group {
    margin-bottom: 0;
}
.form-actions-inline {
    display: flex;
    gap: 0.4rem;
}
.edit-row {
    background: #f0f6ff;
}

/* =============================================
   STAFF EDIT
   ============================================= */
.staff-balance-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-top: 0.5rem;
}
.balance-item {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}
.balance-label {
    font-size: 0.78rem;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 600;
}
.balance-value {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--color-text);
}
.copy-link-row {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}
.copy-link-input {
    flex: 1;
    font-size: 0.8rem;
    color: var(--color-text-muted);
    background: #f8fafc;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 0.4rem 0.6rem;
}

/* =============================================
   LOGIN PAGE
   ============================================= */
.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}
.login-card {
    background: var(--color-surface);
    border-radius: var(--radius);
    padding: 2rem;
    width: 100%;
    max-width: 400px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--color-border);
}
.login-title {
    margin: 0 0 0.25rem;
    font-size: 1.5rem;
    color: var(--color-text);
}
.login-subtitle {
    color: var(--color-text-muted);
    margin: 0 0 1.5rem;
    font-size: 0.9rem;
}

/* =============================================
   BULK IMPORT
   ============================================= */
.bulk-instructions {
    margin: 0 0 1.25rem;
    padding-left: 1.3rem;
    font-size: 0.9rem;
    line-height: 1.8;
}
.bulk-instructions kbd {
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    padding: 0.1rem 0.4rem;
    font-size: 0.8rem;
    font-family: monospace;
}
.card h4 {
    margin: 1rem 0 0.4rem;
    font-size: 0.875rem;
    color: var(--color-text);
}
.bulk-example {
    background: #f8fafc;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    overflow-x: auto;
    margin-bottom: 0.5rem;
}
.example-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
    font-family: monospace;
}
.example-table th,
.example-table td {
    padding: 0.5rem 0.9rem;
    border-bottom: 1px solid var(--color-border);
    text-align: left;
}
.example-table thead th {
    background: #f1f5f9;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-family: system-ui, sans-serif;
}
.example-table tbody tr:last-child td { border-bottom: none; }

/* `textarea.` prefix bumps specificity above `.form-group textarea`
   so font-family + the wrap-related rules actually win. */
textarea.bulk-textarea {
    font-family: 'Consolas', 'Menlo', 'Courier New', monospace;
    font-size: 0.875rem;
    background: #fafbff;
    /* Tabular paste data should keep its row structure — disable wrap
       and show horizontal scrollbar for over-wide rows instead of
       breaking lines mid-row. */
    white-space: pre;
    overflow: auto;
    line-height: 1.55;
    min-height: 14rem;
    tab-size: 4;
}

/* Preview / results table row states */
.row-ok  { background: #f0fdf4; }
.row-skip { background: #fffbeb; }
.text-muted { color: var(--color-text-muted); }

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25em;
    font-size: 0.78rem;
    font-weight: var(--fw-semibold);
    padding: 0.2rem 0.6rem;
    border-radius: var(--radius-pill);
    line-height: 1.4;
    letter-spacing: 0.01em;
}
.status-add    { background: #dcfce7; color: #15803d; }
.status-update { background: #dbeafe; color: #1e40af; }
.status-skip   { background: #fef3c7; color: #92400e; }
.status-error  { background: #fee2e2; color: #991b1b; }

/* Wrap-friendly variant for status badges in preview/results tables.
   The pill shape (--radius-pill) clips awkwardly when content wraps to
   multiple lines (e.g. "Will be updated — name: A → B"). This variant
   uses a rounded rectangle that handles multi-line content cleanly. */
.status-badge--wrap {
    display: inline-flex;
    align-items: flex-start;
    border-radius: var(--radius-md);
    padding: 0.4rem 0.7rem;
    line-height: 1.4;
    text-align: left;
    white-space: normal;
    max-width: 100%;
}

/* Spinner used inside buttons during long-running form submission.
   Trigger by adding data-loading="..." to a form — script.js swaps
   the submit button text to the loading message and prepends this. */
.btn-spinner {
    display: inline-block;
    width: 0.85em;
    height: 0.85em;
    border: 2px solid currentColor;
    border-bottom-color: transparent;
    border-radius: 50%;
    margin-right: 0.45em;
    vertical-align: -0.15em;
    animation: btn-spin 0.7s linear infinite;
}
@keyframes btn-spin {
    to { transform: rotate(360deg); }
}

/* Full-page loading overlay — paired with [data-loading] forms.
   Stays visible during the entire request so the user has clear
   feedback even on slow imports where the button-only spinner
   would appear to flash and then "hang". */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: loading-fade-in 0.18s ease-out;
    padding: var(--space-4);
}
@supports (backdrop-filter: blur(2px)) or (-webkit-backdrop-filter: blur(2px)) {
    .loading-overlay {
        backdrop-filter: blur(2px);
        -webkit-backdrop-filter: blur(2px);
    }
}
.loading-overlay-card {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    padding: var(--space-8) var(--space-10);
    box-shadow: var(--shadow-lg);
    text-align: center;
    min-width: 260px;
    max-width: 90vw;
}
.loading-overlay-spinner {
    width: 44px;
    height: 44px;
    border: 3px solid var(--color-border);
    border-top-color: var(--brand-primary);
    border-radius: 50%;
    margin: 0 auto var(--space-4);
    animation: btn-spin 0.7s linear infinite;
}
.loading-overlay-msg {
    color: var(--color-text);
    font-weight: var(--fw-semibold);
    font-size: var(--fs-md);
    line-height: var(--lh-snug);
}
@keyframes loading-fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* =============================================
   FILTER TABS (Acquittals / list pages)
   ============================================= */
.filter-tabs {
    display: flex;
    margin-bottom: 1.25rem;
    border-bottom: 2px solid var(--color-border);
}
.filter-tab {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.5rem 1rem;
    border-radius: var(--radius) var(--radius) 0 0;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-text-muted);
    text-decoration: none;
    border: 1px solid transparent;
    border-bottom: none;
    margin-bottom: -2px;
    transition: color 0.15s, background 0.15s;
}
.filter-tab:hover {
    color: var(--color-text);
    background: #f8fafc;
    text-decoration: none;
}
.filter-tab.active {
    color: var(--color-accent);
    background: var(--color-surface);
    border-color: var(--color-border);
    border-bottom-color: var(--color-surface);
}
.tab-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.4rem;
    padding: 0 0.3rem;
    height: 1.2rem;
    background: #e2e8f0;
    color: var(--color-text-muted);
    border-radius: 99px;
    font-size: 0.72rem;
    font-weight: 700;
}
.tab-count--warn {
    background: var(--color-warn-bg);
    color: var(--color-warn);
}

/* =============================================
   ACQUITTALS — STATUS BADGES & ROW STATES
   ============================================= */
.status-pending   { background: var(--color-warn-bg);    color: #78350f; }
.status-confirmed { background: var(--color-success-bg); color: #14532d; }

.row-pending       { background: #fffbeb !important; }
.row-pending:hover { background: #fef3c7 !important; }

.overdue-note {
    display: inline-block;
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--color-danger);
    background: var(--color-danger-bg);
    border-radius: 99px;
    padding: 0.1rem 0.4rem;
    margin-left: 0.3rem;
    vertical-align: middle;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}
.text-warn { color: var(--color-warn); }

/* =============================================
   DASHBOARD — PENDING STAT CARD
   ============================================= */
.stat-card--pending {
    border-color: var(--color-warn);
    background: var(--color-warn-bg);
}
.stat-card--pending .stat-value { color: var(--color-warn); }

/* =============================================
   STAFF EDIT — 4-COLUMN BALANCE GRID
   ============================================= */
.staff-balance-grid--4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-top: 0.5rem;
}

/* =============================================
   ADMIN REPORTS PAGE
   ============================================= */
.report-filter-form {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: flex-start;
}
.report-filter-form .form-group {
    min-width: 160px;
    flex: 1;
    margin-bottom: 0;
}

.report-output {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
}

/* Visible only when printing */
.report-print-header {
    display: none;
    font-size: 0.9rem;
    color: var(--color-text-muted);
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--color-border);
}

.report-section-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--color-text);
    border-bottom: 2px solid var(--color-border);
    padding-bottom: 0.5rem;
    margin: 0 0 1rem;
}

/* Balance cards in individual report view */
.report-balance-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
}
.report-bal-card {
    background: #f8fafc;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    text-align: center;
}
.report-bal-card--carryover {
    background: #f5f3ff;
    border-color: #c4b5fd;
}
.report-bal-card--carryover .report-bal-val { color: #7c3aed; }
.report-bal-card--pending {
    background: var(--color-warn-bg);
    border-color: #fcd34d;
}
.report-bal-card--balance {
    background: var(--color-success-bg);
    border-color: #86efac;
}
.report-bal-val {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--color-accent);
    line-height: 1;
    margin-bottom: 0.3rem;
}
.report-bal-card--pending .report-bal-val { color: var(--color-warn); }
.report-bal-card--balance .report-bal-val { color: var(--color-success); }
.report-bal-lbl {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 600;
}
.report-bal-formula {
    font-size: 0.7rem;
    color: var(--color-text-muted);
    margin-top: 0.35rem;
    line-height: 1.35;
    font-variant-numeric: tabular-nums;
}

/* Individual admin report: equation row (Earned … − Taken − Proposed = Unallocated) */
.report-balance-equation__flow {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 0.35rem 0.2rem;
    justify-content: flex-start;
}
.report-balance-equation__flow .report-bal-card {
    flex: 0 1 auto;
    min-width: 6.75rem;
    max-width: 11rem;
}
.report-balance-equation__op {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--color-text-muted);
    padding: 0 0.1rem;
    flex-shrink: 0;
    align-self: center;
    min-height: 2.5rem;
}
/* Off-duty card: same row as equation, pushed to the far right */
.report-balance-equation__offduty {
    margin-left: auto;
    flex: 0 0 auto;
    align-self: stretch;
}
.report-balance-equation__offduty .report-bal-card {
    max-width: 11rem;
}

/* Individual staff report header in admin reports */
.report-individual-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}
.report-individual-header h3 { margin: 0; font-size: 1.25rem; }
.report-individual-meta {
    text-align: right;
    font-size: 0.875rem;
    color: var(--color-text-muted);
}
.report-individual-meta p { margin: 0.2rem 0; }
.carryover-notice {
    background: #eff6ff;
    border-left: 3px solid var(--color-accent);
    border-radius: 0 4px 4px 0;
    padding: 0.5rem 0.8rem;
    font-size: 0.875rem;
    color: var(--color-text);
    margin-bottom: 0.75rem;
}
.period-badge {
    display: inline-block;
    padding: 0.3rem 0.9rem;
    background: var(--color-accent);
    color: #fff;
    font-size: 0.95rem;
    font-weight: 700;
    border-radius: 999px;
    letter-spacing: 0.03em;
}

.nowrap { white-space: nowrap; }

/* =============================================
   PRINT — ADMIN PAGES
   ============================================= */
@media print {
    .no-print            { display: none !important; }
    .top-nav             { display: none !important; }
    .report-print-header { display: block !important; }
    .report-output       { border: none; box-shadow: none; padding: 0; }
    .data-table          { box-shadow: none; }
}

/* =============================================
   MODAL (type-to-confirm delete)
   ============================================= */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.modal-box {
    background: var(--color-surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    width: 100%;
    max-width: 460px;
    padding: 2rem;
}
.modal-title {
    margin: 0 0 1rem;
    font-size: 1.15rem;
    color: var(--color-danger);
}
.modal-body {
    margin: 0 0 0.85rem;
    color: var(--color-text);
    font-size: 0.95rem;
    line-height: 1.5;
}
.modal-confirm-input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    font-size: 1rem;
    font-family: monospace;
    border: 2px solid var(--color-border);
    border-radius: var(--radius);
    margin-bottom: 1.25rem;
    outline: none;
    transition: border-color 0.15s;
}
.modal-confirm-input:focus {
    border-color: var(--color-danger);
}
.modal-confirm-input.input-match {
    border-color: var(--color-danger);
    background: var(--color-danger-bg);
    color: var(--color-danger);
    font-weight: 700;
}
.modal-actions {
    display: flex;
    gap: 0.75rem;
}

/* =============================================
   RESPONSIVE
   ============================================= */
/* Mobile breakpoint covers landscape phones (up to ~932px) and iPad portrait (768px).
   iPad landscape (1024px+) and laptops keep the desktop nav. */
@media (max-width: 1023px) {
    .container { padding: 1rem; }
    .staff-balance-grid   { grid-template-columns: 1fr 1fr; }
    .staff-balance-grid--4 { grid-template-columns: 1fr 1fr; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .data-table { font-size: 0.8rem; }
    .data-table th,
    .data-table td { padding: 0.5rem 0.6rem; }
    .report-individual-meta { text-align: left; }

    /* ── Mobile nav: hamburger reveals an in-flow push-down menu ──
       When opened, the menu wraps to a new row inside .nav-inner so it
       pushes page content down rather than overlaying it. The nav also
       drops its sticky positioning while open so it scrolls away with
       the page — matching mobile-site conventions (Wikipedia, GitHub). */
    .nav-brand { font-size: 0.85rem; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
    .nav-mobile-toggle { display: inline-flex; }

    .top-nav.nav-open { position: relative; }
    .nav-inner {
        flex-wrap: wrap;
        height: auto;
        min-height: 52px;
        row-gap: 0;
    }

    .top-nav .nav-menu {
        display: none;
        flex-direction: column;
        flex-basis: 100%;
        order: 99;
        margin: 0 -1.5rem;
        background: var(--brand-nav-bg);
        padding: 0.4rem 0 0.6rem;
        box-shadow: 0 4px 12px rgba(0,0,0,0.2);
        border-top: 1px solid rgba(255,255,255,0.08);
        gap: 0;
    }
    .top-nav.nav-open .nav-menu { display: flex; }

    /* Each menu row — full-width tap target */
    .top-nav .nav-menu > li { width: 100%; }
    .top-nav .nav-menu > li > a,
    .top-nav .nav-menu > li > .nav-dropdown-toggle {
        display: flex;
        height: auto;
        min-height: 48px;
        width: 100%;
        padding: 0.55rem 1.5rem;
        gap: 0.85rem;
        font-size: 0.95rem;
        border-bottom: none;
    }
    .top-nav .nav-menu > li > a.icon,
    .top-nav .nav-menu > li > a > .icon { width: 1.15em; height: 1.15em; }

    /* Active state — left border accent (no bottom underline since rows are vertical) */
    .top-nav .nav-menu > li > a.active {
        background: rgba(255,255,255,0.08);
        border-bottom: none;
        box-shadow: inset 3px 0 0 var(--brand-primary);
    }
    .top-nav .nav-menu > li > a.active > .icon { color: #fff; opacity: 1; }

    /* Admin dropdown — expand inline rather than floating panel */
    .top-nav .nav-menu .nav-dropdown { position: static; }
    .top-nav .nav-menu .nav-dropdown-menu {
        position: static;
        display: none;
        flex-direction: column;
        background: rgba(0,0,0,0.22);
        border: none;
        box-shadow: none;
        border-radius: 0;
        margin: 0;
        padding: 0.2rem 0 0.4rem;
        min-width: 0;
        width: 100%;
    }
    .top-nav .nav-menu .nav-dropdown.open .nav-dropdown-menu { display: flex; }
    .top-nav .nav-menu .nav-dropdown-menu li a {
        padding: 0.55rem 1.5rem 0.55rem 3.4rem;
        min-height: 42px;
        font-size: 0.9rem;
    }
    .top-nav .nav-menu .nav-dropdown-toggle { width: 100%; justify-content: flex-start; }

    /* Year selector — full-width labelled row */
    .top-nav .nav-menu .nav-year-item {
        padding: 0.7rem 1.5rem;
        margin: 0.4rem 0 0;
        border-left: none;
        border-top: 1px solid rgba(255,255,255,0.08);
        height: auto;
    }
    .top-nav .nav-menu .nav-year-select {
        width: 100%;
        padding: 0.55rem 0.75rem;
        font-size: 0.95rem;
    }
    .top-nav .nav-menu .nav-year-item::before {
        content: "Year:";
        font-size: 0.85rem;
        color: #94a3b8;
        margin-right: 0.6rem;
        font-weight: var(--fw-semibold);
    }

    /* Logout — visually separated */
    .top-nav .nav-menu .nav-logout {
        border-left: none;
        border-top: 1px solid rgba(255,255,255,0.08);
        margin-top: 0.3rem;
    }
}
@media (max-width: 480px) {
    .stats-grid            { grid-template-columns: 1fr; }
    .staff-balance-grid    { grid-template-columns: 1fr; }
    .staff-balance-grid--4 { grid-template-columns: 1fr 1fr; }
    .filter-tab            { padding: 0.4rem 0.6rem; font-size: 0.8rem; }
}

/* =============================================
   List search bar
   ============================================= */
.list-search-form {
    margin-bottom: 0.75rem;
}
.list-search-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}
.list-search-input {
    flex: 1;
    max-width: 360px;
    padding: 0.45rem 0.75rem;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    font-size: 0.875rem;
    background: var(--color-surface);
    color: var(--color-text);
    transition: border-color 0.15s, box-shadow 0.15s;
}
.list-search-input:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: var(--focus-ring);
}

/* =============================================
   Pagination
   ============================================= */
.pagination {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 1rem;
}
.pagination-info {
    font-size: 0.875rem;
    color: var(--color-text-muted);
}

/* =============================================
   SETTINGS PAGE
   ============================================= */
.settings-section-heading {
    margin: 0 0 1.25rem;
    font-size: 1rem;
    font-weight: 700;
    color: var(--color-text);
    padding-bottom: 0.6rem;
    border-bottom: 1px solid var(--color-border);
}

/* Two-column layout for TIL rate inputs */
.settings-rate-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
}
@media (max-width: 560px) {
    .settings-rate-row { grid-template-columns: 1fr; }
}

.settings-rate-input {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.settings-rate-input input {
    width: 100px;
}
.settings-rate-unit {
    font-size: 1.1rem;
    color: var(--color-text-muted);
    font-weight: 600;
}

/* Logo preview block */
.settings-logo-preview-block {
    display: flex;
    align-items: flex-start;
    gap: 1.25rem;
    padding: 1rem;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
}
.settings-logo-preview {
    display: block;
    height: 80px;
    width: auto;
    max-width: 160px;
    border-radius: 6px;
    border: 1px solid var(--color-border);
    object-fit: contain;
    background: #fff;
    flex-shrink: 0;
}
.settings-logo-preview-meta {
    flex: 1;
    min-width: 0;
}
.settings-logo-preview-meta p {
    margin: 0 0 0.4rem;
    font-size: 0.875rem;
}
.text-muted {
    color: var(--color-text-muted);
}

/* =============================================
   SLEEP TIL WORKFLOW STATUS BADGES
   ============================================= */
/* Step 1 — Accrual Request Pending (muted grey) */
.status-sleep-step1 {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #cbd5e1;
}
/* Step 2 — Acquittal Request Pending (blue) */
.status-sleep-step2 {
    background: #dbeafe;
    color: #1d4ed8;
    border: 1px solid #93c5fd;
}
/* Step 3 — Confirming Payout / TIL Conversion (amber) */
.status-sleep-step3 {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fcd34d;
}
/* =============================================
   TAGS PAGE
   ============================================= */
.tags-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1rem;
}
.tags-card-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.tags-rename-form {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex: 1;
    min-width: 0;
}
.tags-name-input {
    font-weight: 600;
    font-size: 1rem;
    padding: 0.3rem 0.5rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius, 6px);
    flex: 1;
    min-width: 0;
}
.tags-chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
}
.tag-chip {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
    border-radius: 99px;
    font-size: 0.78rem;
    font-weight: 500;
    white-space: nowrap;
}
.tag-chip--inactive {
    background: #f1f5f9;
    color: #64748b;
    border-color: #cbd5e1;
}
.staff-tag-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.2rem;
    margin-top: 0.3rem;
}
.tags-empty-msg {
    font-size: 0.875rem;
    color: var(--color-text-muted);
    margin: 0;
    font-style: italic;
}
.tags-staff-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr));
    gap: 0.25rem 1rem;
    max-height: 13rem;
    overflow-y: auto;
    padding: 0.6rem 0.75rem;
    background: #f8fafc;
    border: 1px solid var(--color-border);
    border-radius: var(--radius, 6px);
    margin-bottom: 0.6rem;
}
.tags-panel-actions {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

/* Step number pill inside the badge */
.sleep-step-num {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 700;
    background: rgba(0,0,0,0.12);
    border-radius: 3px;
    padding: 0 0.25rem;
    margin-right: 0.2rem;
    vertical-align: middle;
    line-height: 1.4;
}
