/* ============================================
   DockLabs Design System — "Civic Institution" v3
   Typography-forward · Warm paper · Document-first
   Used by: All DockLabs applications (authenticated surfaces)
   Requires: Bootstrap 5.3+, Fraunces + Instrument Sans + JetBrains Mono

   Public/marketing surfaces (base_public.html) keep Poppins
   for CT state brand alignment. See keel/CLAUDE.md "Deployment
   Flexibility" and docs/plans/design-v3-migration.md.
   ============================================ */

/* =============================================
   0. Fonts — self-hosted variable WOFF2
   Latin + Latin-Extended subsets only. Browsers fetch the
   latin subset by default (~128KB across all 3 families);
   latin-ext only pulled on accented chars (+83KB).
   Served via WhiteNoise; files in keel/core/static/fonts/.
   ============================================= */

/* Fraunces — variable (opsz 9..144, wght 400..700) */
@font-face {
  font-family: 'Fraunces';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/static/fonts/fraunces-latin.5d2835174326.woff2") format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Fraunces';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/static/fonts/fraunces-latin-ext.3592119408ee.woff2") format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* Instrument Sans — variable (wght 400..700) */
@font-face {
  font-family: 'Instrument Sans';
  font-style: normal;
  font-weight: 400 700;
  font-stretch: 100%;
  font-display: swap;
  src: url("/static/fonts/instrument-sans-latin.e35fad09c70b.woff2") format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Instrument Sans';
  font-style: normal;
  font-weight: 400 700;
  font-stretch: 100%;
  font-display: swap;
  src: url("/static/fonts/instrument-sans-latin-ext.e2385a017626.woff2") format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* JetBrains Mono — variable (wght 400..600) */
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("/static/fonts/jetbrains-mono-latin.570751c5f8b4.woff2") format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("/static/fonts/jetbrains-mono-latin-ext.e6155c5cfacf.woff2") format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* =============================================
   1. Design Tokens (CSS Custom Properties)
   ============================================= */
:root {
    /* CT Brand Accents — v3 values */
    --ct-blue: #0A2B4E;           /* navy, was #1a3a6b — institutional */
    --ct-blue-light: #e8eef6;
    --ct-blue-hover: #12395F;     /* was #254d8f */

    /* Brass / FOIA accent — heraldic, rare, meaningful */
    --brass: #B8860B;             /* UI only on paper — 3.58:1 */
    --brass-soft: #F5EAD0;        /* FOIA pill background */
    --brass-text: #7A5A07;        /* text on paper OR brass-soft — 8.24:1 / 4.74:1 */

    /* Deprecated aliases — kept resolving for one release so
       product-specific CSS doesn't break. Remove in Phase E. */
    --accent-teal: var(--success);          /* map teal → success */
    --accent-teal-light: var(--success-bg);
    --accent-yellow: var(--brass);          /* map yellow → brass */
    --accent-yellow-light: var(--brass-soft);

    /* Legacy --ct-* aliases from docklabs.css (pre-v2 palette). Without
       these, product CSS that still references `var(--ct-green)` etc.
       resolves to nothing — making the property invalid and exposing
       any underlying rule (e.g. .pill's light --surface bg with white
       text on top, unreadable). Resolves to the closest v2 token. */
    --ct-dark-blue: var(--ct-blue);
    --ct-bold-blue: var(--ct-blue);
    --ct-light-blue: var(--ct-blue-light);
    --ct-pale-blue: var(--ct-blue-light);
    --ct-orange: var(--brass);
    --ct-yellow: var(--warning);
    --ct-brown: var(--brass-text);
    --ct-red: var(--error);
    --ct-green: var(--success);
    --ct-dark-gray: var(--text-primary);
    --ct-light-gray: var(--bg-warm);
    --ct-sidebar-width: var(--sidebar-width);

    /* Neutral Palette — warm paper, not white */
    --bg-page: #FAF7F2;           /* paper, was #ffffff — biggest token shift */
    --bg-sidebar: #FCFAF5;        /* subtle paper-warm */
    --bg-card: #FFFFFF;           /* cards stand out against paper */
    --surface: #FFFFFF;           /* alias for clarity */
    --bg-hover: #F1ECE2;          /* warm hover on paper */
    --bg-warm: #F7F3EA;
    --border: #E8E3D9;            /* rule — marginally warmer */
    --border-light: #F0EDE8;
    --border-strong: #D8D2C4;     /* rule-strong — for form fields / kbd pills */

    /* Text */
    --text-primary: #1A1A1A;      /* 16.8:1 on paper */
    --text-secondary: #5B5348;    /* 6.14:1 on paper — AA everywhere */
    --text-tertiary: #8A8275;     /* lighter — for de-emphasized metadata */
    --text-on-blue: #FFFFFF;

    /* Semantic — institutional, not alarm */
    --success: #2D5F3F;           /* forest, was teal #0d9488 */
    --success-bg: #E4EEE7;
    --warning: #B8860B;           /* brass */
    --warning-bg: var(--brass-soft);
    --error: #8B2E2A;             /* brick, was #e55353 */
    --error-bg: #F7E8E6;
    --info: #2C5F8D;              /* distinct from primary navy */
    --info-bg: #E8EEF6;

    /* Chart palette — derived from tokens, 6 colors for multi-series */
    --chart-1: var(--ct-blue);    /* navy */
    --chart-2: var(--brass);      /* brass */
    --chart-3: var(--success);    /* forest */
    --chart-4: var(--info);       /* info blue */
    --chart-5: var(--text-secondary); /* warm muted */
    --chart-6: var(--error);      /* brick */

    /* Typography */
    --font-display: 'Fraunces', Georgia, serif;
    --font-sans: 'Instrument Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

    /* Elevation — unchanged from v2 */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.08);

    /* Radius — v3 is sharp. Buttons/inputs keep a hint for touch. */
    --radius-sm: 4px;             /* buttons, form inputs, kbd pills */
    --radius-md: 0;               /* cards, alerts, tables (was 10px) */
    --radius-lg: 0;               /* modals, large containers (was 14px) */

    /* Layout */
    --sidebar-width: 260px;
}

/* =============================================
   2. Bootstrap Primary Overrides
   Tell Bootstrap our CT blue is the "primary" RGB so its built-in
   opacity modifiers (bg-opacity-10, bg-opacity-25, etc.) keep
   working. Use rgba(var(--bs-primary-rgb), var(--bs-bg-opacity, 1))
   instead of a hardcoded color so `bg-primary bg-opacity-10` tints
   correctly instead of rendering solid navy.
   ============================================= */
:root {
    --bs-primary-rgb: 10, 43, 78;     /* --ct-blue as RGB triplet */
    --bs-secondary-rgb: 91, 83, 72;   /* --text-secondary */
    --bs-success-rgb: 45, 95, 63;     /* --success (forest) */
    --bs-warning-rgb: 184, 134, 11;   /* --brass */
    --bs-danger-rgb: 139, 46, 42;     /* --error (brick) */
    --bs-info-rgb: 44, 95, 141;       /* --info */
}
.bg-primary   { background-color: rgba(var(--bs-primary-rgb),   var(--bs-bg-opacity, 1)) !important; }
.bg-secondary { background-color: rgba(var(--bs-secondary-rgb), var(--bs-bg-opacity, 1)) !important; }
.bg-success   { background-color: rgba(var(--bs-success-rgb),   var(--bs-bg-opacity, 1)) !important; }
.bg-warning   { background-color: rgba(var(--bs-warning-rgb),   var(--bs-bg-opacity, 1)) !important; }
.bg-danger    { background-color: rgba(var(--bs-danger-rgb),    var(--bs-bg-opacity, 1)) !important; }
.bg-info      { background-color: rgba(var(--bs-info-rgb),      var(--bs-bg-opacity, 1)) !important; }
.btn-primary {
    background-color: var(--ct-blue);
    border-color: var(--ct-blue);
}
.btn-primary:hover,
.btn-primary:focus {
    background-color: var(--ct-blue-hover);
    border-color: var(--ct-blue-hover);
}
.btn-outline-primary {
    color: var(--ct-blue);
    border-color: var(--ct-blue);
}
.btn-outline-primary:hover,
.btn-outline-primary:focus {
    background-color: var(--ct-blue);
    border-color: var(--ct-blue);
    color: #fff;
}
.text-primary { color: var(--ct-blue) !important; }
a { color: var(--ct-blue); }
a:hover { color: var(--ct-blue-hover); }

/* =============================================
   3. Body & Typography — v3 Civic Institution
   Fraunces for display, Instrument Sans for UI,
   JetBrains Mono for codes/data. Three voices for
   three data zones.
   ============================================= */
html {
    /* Prevents font-family: Times leak on the root element (audit F-005).
       Body sets the same font, but anything that inherits from <html>
       directly (widgets, fallbacks, non-standard elements) was hitting
       the browser default. */
    font-family: var(--font-sans);
}
body {
    font-family: var(--font-sans);
    background: var(--bg-page);
    color: var(--text-primary);
    line-height: 1.55;
    font-size: 14px;
}

h1, h2, h3,
.h1, .h2, .h3 {
    font-family: var(--font-display);
    color: var(--text-primary);
    font-weight: 500;
    letter-spacing: -0.015em;
    margin: 0;
}

h1, .h1 { font-size: 40px; line-height: 1.05; letter-spacing: -0.02em; }
h2, .h2 { font-size: 28px; line-height: 1.15; }
h3, .h3 { font-size: 18px; font-weight: 600; letter-spacing: -0.005em; }

/* h4-h6 treated as section labels — mono, uppercase, eyebrow style */
h4, .h4, h5, .h5, h6, .h6 {
    font-family: var(--font-mono);
    color: var(--text-secondary);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin: 0;
}
h4, .h4 { font-size: 13px; }
h5, .h5 { font-size: 12px; }
h6, .h6 { font-size: 11px; }

/* Mono utilities — for codes, IDs, FOIA sections, tabular figures */
code, kbd, samp, pre,
.font-mono, .mono {
    font-family: var(--font-mono);
}
.tabular-nums { font-variant-numeric: tabular-nums; }

/* Section label — the mono eyebrow pattern for grouping */
.section-label {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

/* =============================================
   4. Buttons
   Canonical button radius is --radius-sm (4px in v3).
   Do not override per-product; round pills /
   icon circles should use dedicated utility
   classes (e.g. .rounded-circle) instead.
   ============================================= */
.btn {
    font-family: var(--font-sans);
    font-weight: 500;
    font-size: 13px;
    letter-spacing: 0.01em;
    border-radius: var(--radius-sm);
    transition: all 0.15s ease;
    position: relative;
}
.btn:active:not(:disabled) { transform: scale(0.97); }
.btn-lg { font-size: 14px; padding: 0.625rem 1.5rem; }
.btn:disabled, .btn.btn-loading { opacity: 0.6; pointer-events: none; }
.btn-loading .spinner-border { vertical-align: -0.125em; }

.btn-danger { background-color: var(--error); border-color: var(--error); }
.btn-danger:hover { background-color: #d04444; border-color: #d04444; }

.btn-outline-secondary {
    color: var(--text-secondary);
    border-color: var(--border);
}
.btn-outline-secondary:hover {
    background-color: var(--bg-hover);
    border-color: var(--border);
    color: var(--text-primary);
}

/* =============================================
   5. App Layout (sidebar + main)
   ============================================= */
.dl-app {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

.dl-main {
    flex: 1 1 auto;
    min-width: 0;
    overflow-y: auto;
    background: var(--bg-page);
    display: flex;
    flex-direction: column;
}

/* =============================================
   6. Sidebar — Notion-style workspace navigator
   ============================================= */
.dl-sidebar {
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-light);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    overflow: hidden;
    transition: width 0.25s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s ease;
    position: relative;
}

.dl-sidebar.collapsed {
    width: 0;
    border-right: none;
    opacity: 0;
    pointer-events: none;
}

/* --- Header (brand + collapse) --- */
.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 12px 4px;
    flex-shrink: 0;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 4px 6px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background 0.15s;
    text-decoration: none;
}
.sidebar-brand:hover { background: var(--bg-hover); }

.sidebar-brand-icon {
    width: 28px;
    height: 28px;
    background: var(--ct-blue);
    border-radius: 7px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    color: white;
    font-weight: 700;
}

.sidebar-brand-text {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.sidebar-collapse-btn {
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    color: var(--text-tertiary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 14px;
    transition: all 0.15s;
    opacity: 0;
}
.dl-sidebar:hover .sidebar-collapse-btn,
.sidebar-collapse-btn:focus { opacity: 1; }
.sidebar-collapse-btn:hover {
    background: var(--bg-hover);
    color: var(--text-secondary);
}

/* --- Quick actions row --- */
.sidebar-quick {
    display: flex;
    gap: 2px;
    padding: 6px 14px 2px;
    flex-shrink: 0;
}

.sidebar-quick-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 5px 0;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-tertiary);
    border: none;
    background: transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.15s;
    font-family: var(--font-sans);
}
.sidebar-quick-btn:hover {
    background: var(--bg-hover);
    color: var(--text-secondary);
}

/* --- Scrollable body --- */
.sidebar-body {
    flex: 1;
    overflow-y: auto;
    padding: 4px 8px 12px;
}
.sidebar-body::-webkit-scrollbar { width: 4px; }
.sidebar-body::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
.sidebar-body::-webkit-scrollbar-track { background: transparent; }

/* --- Sections --- */
.sb-section { margin-top: 14px; }
.sb-section:first-child { margin-top: 6px; }

.sb-section-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 0 8px;
    margin-bottom: 2px;
}

/* --- Nav items --- */
.sb-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 8px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 13px;
    color: var(--text-secondary);
    transition: all 0.12s ease;
    font-weight: 400;
    text-decoration: none;
    user-select: none;
    min-height: 30px;
}
.sb-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}
/* v3 active state: subtle navy fill + 2px navy left border.
   Reads as "selected section" without the pill-shaped highlight
   that feels SaaS-y in v2. */
.sb-item.active {
    background: rgba(10, 43, 78, 0.06);
    color: var(--ct-blue);
    font-weight: 600;
    border-left: 2px solid var(--ct-blue);
    padding-left: calc(8px - 2px);  /* compensate border to preserve icon alignment */
}

.sb-icon {
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
    opacity: 0.7;
}
.sb-item.active .sb-icon { opacity: 1; }

.sb-item-label {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sb-badge {
    margin-left: auto;
    background: var(--success-bg);
    color: var(--success);
    font-size: 10px;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: var(--radius-sm);
    flex-shrink: 0;
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
}

.sb-item-actions {
    display: flex;
    gap: 1px;
    opacity: 0;
    transition: opacity 0.1s;
    flex-shrink: 0;
}
.sb-item:hover .sb-item-actions { opacity: 1; }

.sb-item-action {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    font-size: 12px;
    color: var(--text-tertiary);
    cursor: pointer;
    transition: all 0.1s;
}
.sb-item-action:hover {
    background: var(--border-light);
    color: var(--text-secondary);
}

/* --- Tree children --- */
.sb-children {
    padding-left: 18px;
    overflow: hidden;
    transition: max-height 0.25s ease;
}
.sb-children.collapsed { max-height: 0 !important; }

.sb-toggle {
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 8px;
    color: var(--text-tertiary);
    cursor: pointer;
    border-radius: 3px;
    flex-shrink: 0;
    transition: transform 0.2s ease, background 0.15s, color 0.15s;
}
.sb-toggle:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}
.sb-toggle.open { transform: rotate(90deg); }

/* --- Footer --- */
.sidebar-footer {
    flex-shrink: 0;
    border-top: 1px solid var(--border-light);
    padding: 8px;
}

/* =============================================
   Fleet switcher (v3) — compact-by-default,
   hover/focus expanded popover.

   Default: a small row of icon chips in the sidebar
   footer. Reserves ~32px of vertical space so long
   product-nav sidebars aren't visually masked by a
   tall vertical fleet list.

   Hover or keyboard focus anywhere inside the
   switcher: the full product list appears as a
   popover above the compact row. Uses :focus-within
   so keyboard users get the same expansion.

   Legacy .fleet-row / .fleet-chip classes kept as
   aliases at bottom of block for one release so any
   product-specific CSS that referenced them doesn't
   break immediately.
   ============================================= */
.fleet-switcher {
    position: relative;
    padding: 4px 2px 2px;
}

/* Collapsed grid: 8 icons (current product excluded).
   Compact grid centered in the sidebar footer. Uses auto-fit
   columns sized to the chip width so icons cluster together
   rather than stretching across the full sidebar width. */
.fleet-collapsed {
    display: grid;
    grid-template-columns: repeat(4, 32px);
    gap: 2px;
    justify-content: center;
}
.dl-sidebar.collapsed .fleet-collapsed {
    grid-template-columns: repeat(2, 32px);
}

/* Logo chip — displays the product's favicon.svg.
   The SVG already carries its own navy background + brand mark,
   so the chip is a transparent frame. Inactive chips are dimmed;
   hovering brightens + lifts them slightly. Active chip has a
   small navy dot below as a "you are here" marker. */
.fleet-logo-chip {
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    text-decoration: none;
    position: relative;
    flex-shrink: 0;
    padding: 0;
    background: transparent;
}
.fleet-logo-chip img,
.fleet-logo-chip > i {
    width: 24px;
    height: 24px;
    display: block;
    border-radius: 5px;
    object-fit: contain;
    opacity: 0.55;
    transition: opacity 0.12s ease, transform 0.12s ease;
    font-size: 14px;
    line-height: 24px;
    text-align: center;
    color: var(--text-tertiary);
}
.fleet-logo-chip:hover img,
.fleet-logo-chip:hover > i {
    opacity: 1;
    transform: scale(1.08);
}
/* Active chip styles retained for the expanded list only */
.fleet-logo-chip:focus-visible {
    outline: 2px solid var(--ct-blue);
    outline-offset: 2px;
}

/* Expanded list: "active" = where you are, "hovering" = where
   you'd go if you click. Both can be set at once; hovering wins
   visually via higher contrast so the preview is obvious. */
.fleet-list-item.active {
    background: rgba(10, 43, 78, 0.06);
    color: var(--ct-blue);
    font-weight: 600;
    border-left: 2px solid var(--ct-blue);
    padding-left: calc(8px - 2px);
}
.fleet-list-item.hovering {
    background: var(--brass-soft);
    color: var(--brass-text);
    box-shadow: inset 2px 0 0 var(--brass);
    padding-left: calc(8px - 2px);
}
.fleet-list-item.active.hovering {
    /* when user hovers the chip for the product they're already on —
       layer both: keep the navy border but brighten background */
    background: rgba(10, 43, 78, 0.12);
    color: var(--ct-blue);
    box-shadow: inset 2px 0 0 var(--ct-blue);
}

/* Logo inside expanded-list rows. Slightly smaller than the chip
   since it sits next to a text label. */
.fleet-icon-img img,
.fleet-icon-img > i {
    width: 18px;
    height: 18px;
    border-radius: 4px;
    display: block;
    object-fit: contain;
}

/* Backwards-compat alias — earlier templates may still reference
   .fleet-icon-chip. Remove in Phase E. */
.fleet-icon-chip {
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    color: var(--text-tertiary);
    font-size: 13px;
    text-decoration: none;
    transition: background 0.12s, color 0.12s;
}
.fleet-icon-chip:hover { background: var(--bg-hover); color: var(--text-primary); }
.fleet-icon-chip.active { background: rgba(10, 43, 78, 0.08); color: var(--ct-blue); }

/* Expanded popover — opens upward above the compact row.
   Hidden by default, shown on :hover or :focus-within of
   the parent .fleet-switcher. */
.fleet-expanded {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 100%;
    margin-bottom: 4px;
    background: var(--bg-sidebar);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    padding: 6px;
    max-height: 60vh;
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transform: translateY(4px);
    transition: opacity 0.12s ease, transform 0.12s ease, visibility 0.12s;
    z-index: 20;
    pointer-events: none;
}
.fleet-switcher:hover .fleet-expanded,
.fleet-switcher:focus-within .fleet-expanded {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}
.fleet-expanded-label {
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 2px 8px 4px;
}

/* Legacy aliases — kept for one release so product CSS
   that still references .fleet-row / .fleet-chip keeps
   rendering while we migrate. Remove in Phase E. */
.fleet-row { display: flex; align-items: center; gap: 2px; padding: 4px 4px 6px; overflow-x: auto; }
.fleet-row::-webkit-scrollbar { display: none; }
.fleet-chip {
    font-size: 10px; font-weight: 600; padding: 3px 8px;
    border-radius: var(--radius-sm); color: var(--text-tertiary);
    white-space: nowrap; text-decoration: none; letter-spacing: 0.02em;
    transition: all 0.15s;
}
.fleet-chip:hover { color: var(--text-secondary); background: var(--bg-hover); }
.fleet-chip.active { background: var(--ct-blue); color: white; }

/* User profile */
.sidebar-user {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 6px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background 0.15s;
    text-decoration: none;
}
.sidebar-user:hover { background: var(--bg-hover); }

.sidebar-avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-teal), var(--ct-blue));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 10px;
    font-weight: 600;
    flex-shrink: 0;
}

.sidebar-user-info { flex: 1; min-width: 0; }
.sidebar-user-name { font-size: 12px; font-weight: 500; color: var(--text-primary); }
.sidebar-user-role { font-size: 10px; color: var(--text-tertiary); }

/* =============================================
   7. Sidebar Expand Button (when collapsed)
   ============================================= */
.dl-sidebar.collapsed ~ .dl-main .topbar-expand { display: flex; }

/* =============================================
   8. Contextual Top Bar
   ============================================= */
.dl-topbar {
    display: flex;
    align-items: center;
    padding: 8px 28px;
    min-height: 46px;
    border-bottom: 1px solid var(--border-light);
    background: var(--bg-page);
    position: sticky;
    top: 0;
    z-index: 10;
    gap: 12px;
    flex-shrink: 0;
}

.topbar-expand {
    width: 28px;
    height: 28px;
    display: none;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    color: var(--text-tertiary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 16px;
    transition: all 0.15s;
    flex-shrink: 0;
}
.topbar-expand:hover { background: var(--bg-hover); color: var(--text-secondary); }

.dl-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-mono);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-secondary);
    flex: 1;
    min-width: 0;
}
.dl-breadcrumb a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.1s;
}
.dl-breadcrumb a:hover { color: var(--text-primary); }
.breadcrumb-sep { color: var(--border-strong); font-size: 11px; }
.breadcrumb-current { color: var(--text-primary); font-weight: 500; }

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.tb-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    border: none;
    background: transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.15s;
    font-family: var(--font-sans);
    white-space: nowrap;
    text-decoration: none;
}
.tb-btn:hover { background: var(--bg-hover); color: var(--text-primary); }
.tb-btn.primary { background: var(--ct-blue); color: white; }
.tb-btn.primary:hover { background: var(--ct-blue-hover); }

.tb-divider {
    width: 1px;
    height: 20px;
    background: var(--border-light);
    margin: 0 4px;
}

.icon-btn {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 15px;
    color: var(--text-tertiary);
    transition: all 0.15s;
    position: relative;
}
.icon-btn:hover { background: var(--bg-hover); color: var(--text-secondary); }

.notif-dot {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 6px;
    height: 6px;
    background: var(--accent-teal);
    border-radius: 50%;
    border: 1.5px solid var(--bg-page);
}

/* Topbar user avatar — identity dropdown trigger.
   Matches sidebar-avatar visually so the user's initials look the same
   in both places. The button is the click target; the avatar span is
   the visible circle. */
.topbar-user { margin-left: 4px; }
.topbar-avatar-btn {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: none;
    background: transparent;
    border-radius: 50%;
    cursor: pointer;
    transition: box-shadow 0.15s;
}
.topbar-avatar-btn:hover { box-shadow: 0 0 0 2px var(--bg-hover); }
.topbar-avatar-btn:focus-visible { outline: 2px solid var(--accent-teal); outline-offset: 2px; }
.topbar-avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-teal), var(--ct-blue));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 10px;
    font-weight: 600;
}

/* Logout form inside dropdown — make the button look like a dropdown-item */
.dropdown-item-form { margin: 0; padding: 0; }
.dropdown-item-form button.dropdown-item {
    border: none;
    background: transparent;
    width: 100%;
    text-align: left;
    cursor: pointer;
}

.search-trigger {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 12px;
    color: var(--text-tertiary);
    cursor: pointer;
    transition: all 0.15s;
    font-family: var(--font-sans);
}
.search-trigger:hover { border-color: var(--ct-blue); background: var(--bg-warm); }

.search-kbd {
    font-size: 10px;
    background: var(--bg-warm);
    border: 1px solid var(--border);
    padding: 0px 4px;
    border-radius: 3px;
    color: var(--text-tertiary);
    font-family: var(--font-mono);
    line-height: 1.6;
}

/* =============================================
   9. Page Tabs
   ============================================= */
.dl-page-tabs {
    display: flex;
    gap: 1px;
    border-bottom: 1px solid var(--border-light);
    padding: 0 32px;
    background: var(--bg-page);
}

.page-tab {
    padding: 10px 14px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-tertiary);
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: all 0.15s;
    margin-bottom: -1px;
    text-decoration: none;
}
.page-tab:hover { color: var(--text-secondary); }
.page-tab.active {
    color: var(--ct-blue);
    border-bottom-color: var(--ct-blue);
}

/* =============================================
   10. Page Content Area
   ============================================= */
.dl-content {
    padding: 24px 32px 48px;
    max-width: 1600px;
    flex: 1;
}

.page-header { margin-bottom: 24px; }

.page-tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: var(--bg-warm);
    border: 1px solid var(--border-light);
    border-radius: 20px;
    padding: 2px 11px;
    font-size: 11px;
    font-weight: 500;
    color: var(--text-tertiary);
    margin-bottom: 8px;
}

.page-tag-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--accent-teal);
}

/* Canonical page heading. Use on the top-level <h1> of every page so titles
   share one size/weight across products. Also applied automatically to
   <h1> inside .page-header so existing markup keeps working. */
.page-title,
.page-header h1 {
    font-family: var(--font-display);
    font-size: 40px;
    font-weight: 500;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    line-height: 1.05;
    margin-bottom: 3px;
}
.page-header p,
.page-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 400;
}

/* =============================================
   11. Cards
   ============================================= */
/* Clickable table rows: add .table-clickable to <table> and
   data-href="..." to each <tr>. JS in docklabs-v2.js handles click. */
.table-clickable tbody tr[data-href] { cursor: pointer; }
.table-clickable tbody tr[data-href]:hover td { background: var(--bg-page, #f8f9fa); }

.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    transition: box-shadow 0.2s ease;
}
.card:hover { box-shadow: var(--shadow-md); }

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px;
    border-bottom: 1px solid var(--border-light);
    background: transparent;
    font-family: var(--font-display);
    font-weight: 600;
    line-height: 1.4;
    letter-spacing: -0.005em;
}

.card-title { font-size: 13px; font-weight: 600; color: var(--text-primary); }

.card-action {
    font-size: 12px;
    color: var(--ct-blue);
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    padding: 2px 7px;
    border-radius: var(--radius-sm);
    transition: background 0.15s;
}
.card-action:hover { background: var(--ct-blue-light); }

.card-footer {
    background-color: transparent;
    border-top: 1px solid var(--border-light);
}

/* =============================================
   12. Stat Cards
   ============================================= */
.stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-left: 3px solid var(--border-strong);
    border-radius: 0;
    padding: 16px 18px;
    transition: box-shadow 0.2s ease;
    cursor: default;
}
.stat-card:hover { box-shadow: var(--shadow-md); }

.stat-label {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* v3 stat value: mono, tabular-nums, larger. Reads like a dashboard
   readout (briefing-deck vibe), not a SaaS "big number" KPI. */
.stat-value {
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
    font-size: 28px;
    font-weight: 500;
    color: var(--text-primary);
    letter-spacing: -0.01em;
    line-height: 1.15;
}

.stat-change {
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
    font-size: 11px;
    font-weight: 500;
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 3px;
}
.stat-change.up { color: var(--success); }
.stat-change.down { color: var(--error); }

/* v3 stat-card accent variants — left border picks up a semantic color.
   Value stays in --text-primary by default for scannability; only the
   left border colors to avoid color-clash when rendering dense dashboards. */
.stat-card.accent-green  { border-left-color: var(--success); }
.stat-card.accent-gold   { border-left-color: var(--brass); }
.stat-card.accent-red    { border-left-color: var(--error); }
.stat-card.accent-blue   { border-left-color: var(--ct-blue); }
.stat-card.accent-purple { border-left-color: #6A4C9C; }
.stat-card.accent-orange { border-left-color: var(--brass); }
.stat-card.accent-teal   { border-left-color: var(--success); }

/* stat-card-link: when the card is wrapped in an <a>, dim the hover
   transition to signal clickability. */
.stat-card-link:hover { background: var(--bg-hover); }

/* =============================================
   13. Status Badges
   v3: sharper radius, mono-ready for codes; semantic
   color classes below pick the right token.
   ============================================= */
.badge {
    font-family: var(--font-sans);
    font-size: 11px;
    font-weight: 500;
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    letter-spacing: 0.02em;
    white-space: nowrap;
    border: 1px solid transparent;
}

/* Semantic badge colors */
.badge-active, .badge-open, .badge-approved, .badge-accepted, .badge-awarded,
.badge-committed, .badge-closed_won, .badge-closed-won, .badge-retained {
    background: var(--success-bg);
    color: var(--success);
}
.badge-review, .badge-pending, .badge-under-review, .badge-under_review,
.badge-on-hold, .badge-forecasted, .badge-preparing,
.badge-proposal, .badge-negotiation, .badge-qualified {
    background: var(--brass-soft);
    color: var(--brass-text);
    border-color: #e3c98a;
}
.badge-draft, .badge-inactive, .badge-archived, .badge-lead {
    background: var(--bg-hover);
    color: var(--text-secondary);
    border-color: var(--border-strong);
}
.badge-closed, .badge-completed, .badge-submitted, .badge-posted, .badge-applied {
    background: var(--ct-blue-light);
    color: var(--ct-blue);
}
.badge-error, .badge-denied, .badge-cancelled, .badge-declined, .badge-rejected,
.badge-closed_lost, .badge-closed-lost {
    background: var(--error-bg);
    color: var(--error);
}
.badge-watching { background: var(--bg-hover); color: var(--text-secondary); }

/* Grant type badge */
.badge-grant-type {
    background-color: var(--ct-blue-light);
    color: var(--ct-blue) !important;
}

/* =============================================
   14. Data Rows
   ============================================= */
.grant-row, .data-row {
    display: flex;
    align-items: center;
    padding: 10px 18px;
    gap: 14px;
    transition: background 0.1s;
    cursor: pointer;
}
.grant-row:hover, .data-row:hover { background: var(--bg-hover); }

.grant-icon, .data-icon {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}
.grant-icon.blue, .data-icon.blue { background: var(--ct-blue-light); }
.grant-icon.teal, .data-icon.teal { background: var(--accent-teal-light); }
.grant-icon.yellow, .data-icon.yellow { background: var(--accent-yellow-light); }

.grant-info, .data-info { flex: 1; min-width: 0; }

.grant-name, .data-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.grant-meta, .data-meta { font-size: 11px; color: var(--text-tertiary); }

.grant-amount, .data-amount {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    text-align: right;
    white-space: nowrap;
}
.grant-amount-sub { font-size: 10px; color: var(--text-tertiary); font-weight: 400; }

/* =============================================
   15. Activity Feed (Timeline)
   ============================================= */
.activity-item {
    display: flex;
    gap: 10px;
    padding: 10px 18px;
    transition: background 0.1s;
}
.activity-item:hover { background: var(--bg-hover); }

.activity-dot-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 4px;
}

.activity-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--accent-teal);
    flex-shrink: 0;
}

.activity-line {
    width: 1.5px;
    flex: 1;
    background: var(--border-light);
    margin-top: 4px;
}

.activity-content { flex: 1; }

.activity-text {
    font-size: 12.5px;
    color: var(--text-secondary);
    line-height: 1.5;
}
.activity-text strong { color: var(--text-primary); font-weight: 500; }

.activity-time { font-size: 10px; color: var(--text-tertiary); margin-top: 1px; }

/* =============================================
   16. Mini Chart
   ============================================= */
.chart-label {
    padding: 8px 18px 0;
    font-size: 10px;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 500;
}

.mini-chart {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    height: 36px;
    padding: 6px 18px 12px;
}

.mini-bar {
    flex: 1;
    background: var(--ct-blue-light);
    border-radius: 2px 2px 0 0;
    transition: background 0.15s;
    min-height: 3px;
}
.mini-bar:hover { background: var(--ct-blue); }
.mini-bar.accent { background: var(--accent-teal-light); }
.mini-bar.accent:hover { background: var(--accent-teal); }

/* =============================================
   17. Two-Column Layout
   ============================================= */
.two-col {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 18px;
    margin-bottom: 24px;
}

/* =============================================
   18. Tables
   ============================================= */
.table th {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 1px solid var(--border);
    background: transparent;
    padding: 10px 18px;
}
.table tbody td {
    vertical-align: middle;
    font-size: 13px;
    padding: 10px 18px;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-light);
}
.table-hover tbody tr:hover { background-color: var(--bg-hover); }

/* Sortable columns */
.sortable-header a { color: var(--text-tertiary); text-decoration: none; white-space: nowrap; }
.sortable-header a:hover { color: var(--ct-blue); }
th.sortable { cursor: pointer; user-select: none; white-space: nowrap; }
th.sortable:hover { color: var(--ct-blue); }

/* =============================================
   19. Forms
   ============================================= */
.form-label {
    font-weight: 600;
    font-size: 13px;
    color: var(--text-primary);
}

.form-control, .form-select,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="url"],
input[type="tel"],
input[type="search"],
input[type="number"],
input[type="date"],
input[type="datetime-local"],
input[type="month"],
input[type="time"],
input[type="week"],
select,
textarea {
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-family: var(--font-sans);
    color: var(--text-primary);
    padding: 8px 12px;
}

.form-control:focus, .form-select:focus,
input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="url"]:focus,
input[type="tel"]:focus,
input[type="search"]:focus,
input[type="number"]:focus,
input[type="date"]:focus,
input[type="datetime-local"]:focus,
input[type="month"]:focus,
input[type="time"]:focus,
input[type="week"]:focus,
select:focus,
textarea:focus {
    border-color: var(--ct-blue);
    box-shadow: 0 0 0 3px rgba(10, 43, 78, 0.08);
    outline: none;
}

/* Mono input — use for codes, IDs, NAICS, statute refs */
.form-control.mono,
.form-control[type="text"].mono,
input.mono {
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
}

/* v3 keyboard shortcut pill — for ⌘K, shortcut hints */
kbd, .kbd, .tb-kbd {
    font-family: var(--font-mono);
    font-size: 10px;
    padding: 2px 5px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text-secondary);
    line-height: 1.4;
}

.required-field::after { content: ' *'; color: var(--error); }

/* =============================================
   20. WCAG 2.1 AA Focus Indicators
   Orange keyboard-only ring on every interactive
   element. Enumerated selectors (not just `*`) so
   we win any specificity battle against Bootstrap
   or product CSS that resets outline on :focus.
   ============================================= */
*:focus-visible,
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible,
.btn:focus-visible,
.form-control:focus-visible,
.form-select:focus-visible,
.form-check-input:focus-visible,
.dropdown-item:focus-visible,
.nav-link:focus-visible,
.page-link:focus-visible {
    outline: 3px solid #F27124;
    outline-offset: 2px;
    box-shadow: 0 0 0 0.25rem rgba(242, 113, 36, 0.25);
}

/* =============================================
   21. Alerts — v3 left-border treatment
   Flat surface, 3px left border in the semantic color,
   minimal background tint. Reads as a margin note, not
   a chrome box.
   ============================================= */
.alert {
    border-radius: 0;
    border: none;
    border-left: 3px solid;
    padding: 12px 16px;
    font-size: 13px;
    background: var(--bg-card);
    line-height: 1.5;
}
.alert-info    { border-left-color: var(--info);    background: var(--info-bg); }
.alert-success { border-left-color: var(--success); background: var(--success-bg); }
.alert-warning { border-left-color: var(--warning); background: var(--warning-bg); color: var(--brass-text); }
.alert-danger,
.alert-error   { border-left-color: var(--error);   background: var(--error-bg); }

.alert-title {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
    margin-bottom: 2px;
}
.alert-body { color: var(--text-secondary); }

/* =============================================
   21b. FOIA & Document Utilities — v3 vocabulary
   The "civic institution" details: FOIA classification
   chips, document callouts, eyebrow section markers.
   Used across Admiralty, Beacon, Manifest wherever
   records reference statute or retention status.
   ============================================= */

/* FOIA classification chip — mono, brass-on-paper,
   small heraldic dot prefix. Use on records that
   carry a statute reference or retention flag. */
.foia {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.06em;
    padding: 2px 7px;
    background: var(--brass-soft);
    border: 1px solid #e3c98a;
    color: var(--brass-text);
    text-transform: uppercase;
    border-radius: var(--radius-sm);
    white-space: nowrap;
}
.foia-dot {
    width: 5px;
    height: 5px;
    background: var(--brass);
    border-radius: 50%;
    flex-shrink: 0;
}

/* Callout — document-style attention block.
   Heavier than an inline note, lighter than an alert.
   Use for "retention risk flagged" / "pending response" /
   similar prose notes attached to a record. */
.callout {
    background: var(--brass-soft);
    border-left: 3px solid var(--brass);
    padding: 10px 14px;
    font-size: 13px;
    color: var(--brass-text);
    line-height: 1.5;
}
.callout strong {
    color: #3d2d04;
    font-weight: 600;
}

/* Eyebrow — a mono section marker with a brass prefix line.
   Use above a <h2>/<h3> to give the section a "dateline"
   feel. Variant of .section-label with visual punctuation. */
.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--brass-text);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    margin-bottom: 10px;
}
.eyebrow::before {
    content: "";
    width: 24px;
    height: 1px;
    background: var(--brass);
    flex-shrink: 0;
}

/* =============================================
   21c. Pills — rectangular tag chips, v3 style
   Bootstrap's .badge is still available for semantic
   status. Use .pill for categorical tags (CT HQ, region,
   industry, user-applied labels). Sharp corners, mono
   for code-like content, warm-neutral palette.
   ============================================= */
.pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.04em;
    padding: 3px 9px;
    border: 1px solid var(--border-strong);
    color: var(--text-secondary);
    text-transform: uppercase;
    border-radius: var(--radius-sm);
    white-space: nowrap;
    background: var(--surface);
}
.pill-navy {
    background: rgba(10, 43, 78, 0.06);
    border-color: rgba(10, 43, 78, 0.2);
    color: var(--ct-blue);
}
.pill-brass,
.pill-amber {
    background: var(--brass-soft);
    border-color: #e3c98a;
    color: var(--brass-text);
}
.pill-success {
    background: var(--success-bg);
    border-color: #b5c9ba;
    color: var(--success);
}
.pill-muted {
    background: var(--bg-hover);
    border-color: var(--border-strong);
    color: var(--text-secondary);
}
.pill-error {
    background: var(--error-bg);
    border-color: #d9b5b3;
    color: var(--error);
}

/* Bootstrap bg-* compat on .pill base — templates often generate
   `<span class="pill bg-{% if ... %}primary{% else %}secondary{% endif %}">`
   patterns where the bg-* color can't be pre-computed. Without an
   explicit pill-* modifier, the .pill base renders warm-grey text on
   whatever solid Bootstrap bg you set — dark-on-dark and unreadable.
   These rules override .pill's text color when a bg-* modifier is
   present, matching the Bootstrap semantic. */
.pill.bg-primary,
.pill.bg-info {
    color: white;
    border-color: transparent;
}
.pill.bg-secondary,
.pill.bg-dark {
    color: white;
    border-color: transparent;
}
.pill.bg-success {
    color: white;
    border-color: transparent;
}
.pill.bg-warning {
    color: var(--brass-text);
    border-color: transparent;
}
.pill.bg-danger {
    color: white;
    border-color: transparent;
}
.pill.bg-light {
    color: var(--text-primary);
    border-color: var(--border-strong);
}

/* Semantic pill aliases — support dynamic class names generated by
   {% templates like pill pill-{{ status }} %}. Each status maps to the
   appropriate v3 pill color. Mirrors the .badge-* mapping for products
   that haven't migrated templates from .badge-{{ status }} yet. */
.pill-active, .pill-open, .pill-approved, .pill-accepted, .pill-awarded,
.pill-committed, .pill-closed_won, .pill-closed-won, .pill-retained,
.pill-claimed, .pill-responded, .pill-package_ready, .pill-implemented,
.pill-shared {
    background: var(--success-bg);
    border-color: #b5c9ba;
    color: var(--success);
}
.pill-review, .pill-pending, .pill-under-review, .pill-under_review,
.pill-on-hold, .pill-on_hold, .pill-forecasted, .pill-preparing,
.pill-proposal, .pill-negotiation, .pill-qualified, .pill-submitted,
.pill-searching, .pill-senior_review, .pill-scope_defined, .pill-implementing {
    background: var(--brass-soft);
    border-color: #e3c98a;
    color: var(--brass-text);
}
.pill-draft, .pill-inactive, .pill-archived, .pill-lead, .pill-received,
.pill-not-relevant, .pill-not_relevant, .pill-n\/a, .pill-watching {
    background: var(--bg-hover);
    border-color: var(--border-strong);
    color: var(--text-secondary);
}
.pill-closed, .pill-completed, .pill-posted, .pill-applied, .pill-decd_internal,
.pill-prospect, .pill-former, .pill-grant-type, .pill-primary {
    background: rgba(10, 43, 78, 0.06);
    border-color: rgba(10, 43, 78, 0.2);
    color: var(--ct-blue);
}
.pill-denied, .pill-cancelled, .pill-declined, .pill-rejected,
.pill-closed_lost, .pill-closed-lost, .pill-exempt, .pill-appealed,
.pill-likely_exempt, .pill-withdrawn, .pill-vetoed {
    background: var(--error-bg);
    border-color: #d9b5b3;
    color: var(--error);
}

/* =============================================
   22. Empty States
   ============================================= */
.empty-state {
    text-align: center;
    padding: 3rem;
}
.empty-state .empty-icon {
    font-size: 40px;
    margin-bottom: 12px;
}
.empty-state h5 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}
.empty-state p {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

/* =============================================
   23. Timeline / Progress Tracker (vertical)
   ============================================= */
.timeline {
    position: relative;
    padding-left: 2rem;
}
.timeline::before {
    content: '';
    position: absolute;
    left: 0.75rem;
    top: 0; bottom: 0;
    width: 2px;
    background: var(--border);
}
.timeline-item {
    position: relative;
    padding-bottom: 1.5rem;
}
.timeline-item::before {
    content: '';
    position: absolute;
    left: -1.6rem;
    top: 0.25rem;
    width: 12px; height: 12px;
    border-radius: 50%;
    background: var(--ct-blue);
    border: 2px solid white;
    box-shadow: 0 0 0 2px var(--ct-blue);
}
.timeline-item.completed::before { background: var(--success); box-shadow: 0 0 0 2px var(--success); }
.timeline-item.active::before { background: var(--accent-yellow); box-shadow: 0 0 0 2px var(--accent-yellow); }

/* =============================================
   24. Progress Tracker (horizontal)
   ============================================= */
.progress-tracker {
    display: flex;
    justify-content: space-between;
    margin-bottom: 2rem;
    padding: 0;
    list-style: none;
}
.progress-tracker li {
    flex: 1;
    text-align: center;
    position: relative;
    padding-top: 2.25rem;
    font-size: 12px;
    color: var(--text-tertiary);
}
.progress-tracker li::before {
    content: '';
    position: absolute;
    top: 0; left: 50%;
    transform: translateX(-50%);
    width: 24px; height: 24px;
    border-radius: 50%;
    background: var(--border);
    border: 2px solid var(--border);
}
.progress-tracker li::after {
    content: '';
    position: absolute;
    top: 11px;
    left: calc(-50% + 12px);
    width: calc(100% - 24px);
    height: 2px;
    background: var(--border);
}
.progress-tracker li:first-child::after { display: none; }
.progress-tracker li.completed::before { background: var(--success); border-color: var(--success); }
.progress-tracker li.completed::after { background: var(--success); }
.progress-tracker li.completed { color: var(--success); font-weight: 600; }
.progress-tracker li.active::before { background: var(--ct-blue); border-color: var(--ct-blue); }
.progress-tracker li.active { color: var(--ct-blue); font-weight: 600; }

/* =============================================
   25. Modals
   ============================================= */
.modal-content {
    border-radius: var(--radius-lg);
    border: none;
    box-shadow: var(--shadow-lg);
}
.modal-backdrop { background: rgba(0, 0, 0, 0.3); }

/* =============================================
   26. Breadcrumbs (Bootstrap override)
   ============================================= */
.breadcrumb {
    font-size: 13px;
    background-color: transparent;
    margin-bottom: 0;
}

/* =============================================
   27. Quick Action Buttons
   ============================================= */
.quick-action-grid {
    display: grid;
    gap: 0.5rem;
}
.quick-action-grid .btn {
    text-align: left;
    display: flex;
    align-items: center;
}

/* =============================================
   28. htmx Indicators
   ============================================= */
.htmx-indicator { display: none; }
.htmx-request .htmx-indicator { display: inline; }
.htmx-request.htmx-indicator { display: inline; }

/* =============================================
   29. Notification Badge
   ============================================= */
.notification-badge {
    font-size: 0.625rem;
    min-width: 1.125rem;
    padding: 0.2em 0.45em;
}

/* =============================================
   30. Greeting Wave Animation
   ============================================= */
.greeting-wave {
    display: inline-block;
    animation: wave 1.8s ease-in-out infinite;
    transform-origin: 70% 70%;
}

@keyframes wave {
    0%, 60%, 100% { transform: rotate(0deg); }
    10%, 30% { transform: rotate(14deg); }
    20% { transform: rotate(-8deg); }
    40% { transform: rotate(-4deg); }
}

/* =============================================
   31. Page Entrance Animation
   ============================================= */
/* Page entrance: subtle slide-up. Elements are always visible (opacity
   is never 0) — the animation only handles the transform. The old
   "both" fill mode with opacity:0 left elements permanently invisible
   when animations didn't fire (backgrounded tab, render race). */
/* Entrance animation disabled: translateY on every child promotes elements
   to compositor layers, which Chrome renders with grayscale AA — causing
   soft/blurry text (esp. h1 headings). Keeping keyframes for opt-in use. */
@keyframes fadeUp {
    from { transform: translateY(4px); }
    to { transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

/* =============================================
   32. Print Styles
   ============================================= */
@media print {
    .dl-sidebar, .dl-topbar, .dl-page-tabs,
    .btn, .no-print, form { display: none !important; }
    .dl-app { display: block; }
    .dl-main { overflow: visible; }
    .dl-content { padding: 0; max-width: none; }
    .card { box-shadow: none; border: 1px solid #ddd; }
    h1, h2, h3, h4, h5, h6 { color: #000; }
}

/* =============================================
   33. Responsive
   ============================================= */
@media (max-width: 1024px) {
    .dl-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100dvh;
        z-index: 1050;
        width: var(--sidebar-width);
        transform: translateX(-100%);
        opacity: 0;
        pointer-events: none;
        transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s ease;
    }
    .dl-sidebar.collapsed {
        width: var(--sidebar-width);
        opacity: 0;
        border-right: none;
        pointer-events: none;
    }
    .dl-sidebar.mobile-open,
    .dl-sidebar.mobile-open.collapsed {
        transform: translateX(0);
        opacity: 1;
        pointer-events: auto;
        width: var(--sidebar-width);
        border-right: 1px solid var(--border-light);
    }
    .dl-sidebar-backdrop {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.4);
        z-index: 1040;
    }
    .dl-sidebar-backdrop.active { display: block; }
    .topbar-expand { display: flex !important; }
    .stats-row { grid-template-columns: repeat(2, 1fr); }
    .two-col { grid-template-columns: 1fr; }
    .dl-content { padding: 20px 16px; }
}

@media (max-width: 640px) {
    .stats-row { grid-template-columns: 1fr; }
    .dl-page-tabs { overflow-x: auto; padding: 0 16px; }
}

@media (max-width: 767.98px) {
    .dl-topbar { padding: 8px 12px; gap: 8px; }
    .dl-breadcrumb { display: none; }
    .topbar-actions { margin-left: auto; gap: 2px; }
    .search-trigger { padding: 5px 8px; }
    .search-trigger .search-kbd { display: none; }
    .tb-divider { display: none; }
}

@media (max-width: 479.98px) {
    .search-trigger { font-size: 0; padding: 5px 8px; gap: 0; }
    .search-trigger i { font-size: 14px !important; }
    .topbar-primary-action-label { display: none; }
}

@media (max-width: 575.98px) {
    .table { font-size: 0.85rem; }
    .progress-tracker { flex-wrap: wrap; gap: 0.5rem; }
    .progress-tracker li { flex-basis: 45%; }
}

/* =============================================
   34. Public Layout (portal pages)
   ============================================= */
.dl-public-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 28px;
    border-bottom: 1px solid var(--border-light);
    background: var(--bg-page);
}

.dl-public-topbar .sidebar-brand {
    text-decoration: none;
}

/* Public topbar buttons need 44px touch targets (mobile a11y).
   Scoped to .dl-public-topbar so the dense dashboard .tb-btn is unchanged. */
.dl-public-topbar .tb-btn {
    padding: 13px 16px;
    font-size: 13px;
}

.dl-public-content {
    min-height: calc(100vh - 120px);
}

/* Public footer */
.dl-footer {
    border-top: 1px solid var(--border-light);
    padding: 24px 28px;
    background: var(--bg-warm);
    font-size: 12px;
    color: var(--text-tertiary);
}
.dl-footer a {
    color: var(--text-secondary);
    text-decoration: none;
    display: inline-block;
    padding: 14px 6px;
}
.dl-footer a:hover { color: var(--ct-blue); }

/* =============================================
   Landing Page Components (shared across all products)
   ============================================= */

/* Hero section — gradient with white text */
.hero-section {
    background: linear-gradient(135deg, var(--ct-blue) 0%, var(--ct-blue-hover) 100%);
    color: #fff;
    padding: 5rem 0;
    position: relative;
    overflow: hidden;
}
.hero-section .hero-icon {
    font-size: 3.5rem;
    opacity: 0.95;
    margin-bottom: 1rem;
    display: inline-block;
}
.hero-section h1 {
    font-family: 'Poppins', sans-serif;
    font-size: 2.75rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 0.75rem;
}
.hero-section .hero-subtitle {
    font-size: 1.25rem;
    opacity: 0.92;
    font-weight: 500;
    margin-bottom: 1rem;
}
.hero-section .lead {
    font-size: 1.1rem;
    opacity: 0.85;
    max-width: 720px;
    margin-left: auto;
    margin-right: auto;
}
.hero-section .btn-light {
    font-weight: 600;
    color: var(--ct-blue);
    border-radius: var(--radius-sm);
    padding: 0.75rem 1.5rem;
}
.hero-section .btn-outline-light {
    font-weight: 600;
    border-radius: var(--radius-sm);
    padding: 0.75rem 1.5rem;
    border-width: 2px;
}

/* Stats bar (under hero) */
.stats-bar {
    background-color: var(--bg-warm);
    border-bottom: 1px solid var(--border-light);
    padding: 2rem 0;
}
.stats-bar .stat-value {
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--ct-blue);
    font-family: 'Poppins', sans-serif;
    line-height: 1.1;
}
.stats-bar .stat-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
    margin-top: 0.25rem;
}

/* "How It Works" — vertical timeline (audit F-006).
   Pairs with the editorial features section: same palette + typography,
   different geometry. Sequence reads top-to-bottom; the brass column
   rule + dot markers replace the old centered numeric circles. */
.how-it-works .how-head {
    max-width: 640px;
    margin-bottom: 3.5rem;
}
.how-it-works .how-head h2 {
    font-family: var(--font-display);
    text-align: left;
    margin: 0;
}
.how-it-works .how-timeline {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: 120px 1fr;
    position: relative;
    max-width: 840px;
}
.how-it-works .how-timeline::before {
    content: "";
    position: absolute;
    left: 24px;
    top: 1.85rem;
    bottom: 1.85rem;
    width: 1px;
    background: var(--brass);
    opacity: 0.45;
}
.how-it-works .how-step {
    display: contents;
}
.how-it-works .how-marker {
    position: relative;
    padding: 1.5rem 0;
}
.how-it-works .how-marker .how-dot {
    position: absolute;
    left: 18px;
    top: 1.85rem;
    width: 13px;
    height: 13px;
    background: var(--bg-warm);
    border: 2px solid var(--brass);
    border-radius: 50%;
}
.how-it-works .how-marker .how-num {
    display: block;
    padding: 1.15rem 0 0 52px;
    font-family: var(--font-display);
    font-weight: 600;
    color: var(--brass);
    font-size: 0.85rem;
    letter-spacing: 0.12em;
    font-variant-numeric: tabular-nums;
}
.how-it-works .how-body {
    padding: 1.5rem 0 1.5rem 2rem;
    border-bottom: 1px solid var(--border-light);
}
.how-it-works .how-step:last-child .how-body {
    border-bottom: 0;
}
.how-it-works .how-body h3 {
    font-family: var(--font-display);
    font-weight: 600;
    color: var(--ct-blue);
    font-size: 1.5rem;
    line-height: 1.2;
    letter-spacing: -0.005em;
    margin: 0 0 0.5rem;
}
.how-it-works .how-body p {
    font-family: var(--font-sans);
    color: var(--text-secondary);
    line-height: 1.6;
    font-size: 1rem;
    margin: 0;
    max-width: 560px;
}
@media (max-width: 600px) {
    .how-it-works .how-timeline { grid-template-columns: 80px 1fr; }
    .how-it-works .how-timeline::before { left: 14px; }
    .how-it-works .how-marker .how-dot { left: 8px; }
    .how-it-works .how-marker .how-num { padding-left: 36px; font-size: 0.75rem; }
    .how-it-works .how-body { padding-left: 1.25rem; }
    .how-it-works .how-body h3 { font-size: 1.25rem; }
}

/* Legacy `.feature-card` — still used by helm's "DockLabs Fleet" product grid
   (helm/templates/landing.html). NOT used by the features section anymore;
   that moved to the editorial layout below. Kept here so the fleet grid keeps
   rendering. Audit F-010 covers a future redesign of that grid. */
.feature-card {
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 2rem 1.5rem;
    background: var(--bg-card);
    height: 100%;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
    text-align: center;
}
.feature-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}
.feature-card .feature-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--ct-blue-light);
    color: var(--ct-blue);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    margin: 0 auto 1rem auto;
}
.feature-card .feature-icon.teal {
    background: var(--accent-teal-light);
    color: var(--accent-teal);
}
.feature-card .feature-icon.yellow {
    background: var(--accent-yellow-light);
    color: var(--warning);
}

/* Features section — editorial spread layout (replaces the 3-col icon-in-circle
   grid that was AI Slop blacklist #2). Brass numerals, no card containers,
   left-aligned heading. Pairs with F-004 (kills centered-everything). */
.features-section .features-head {
    max-width: 640px;
    margin-bottom: 4rem;
}
.features-section .features-head h2 {
    text-align: left;
    margin: 0;
}
.features-section .features-head .section-intro {
    text-align: left;
    margin: 1rem 0 0;
    max-width: 560px;
}
.features-section .features-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4rem 3rem;
}
@media (max-width: 900px) {
    .features-section .features-list {
        grid-template-columns: repeat(2, 1fr);
        gap: 2.5rem 2rem;
    }
}
@media (max-width: 600px) {
    .features-section .features-list { grid-template-columns: 1fr; gap: 2rem; }
}
.features-section .feature-item .feature-num {
    font-family: var(--font-display);
    font-weight: 700;
    color: var(--brass);
    font-size: 3.25rem;
    line-height: 1;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
}
.features-section .feature-item .feature-rule {
    height: 1px;
    width: 48px;
    background: var(--brass);
    margin: 1rem 0 1.25rem;
}
.features-section .feature-item h3 {
    font-family: var(--font-sans);
    font-weight: 600;
    color: var(--ct-blue);
    font-size: 1.15rem;
    line-height: 1.3;
    margin: 0 0 0.75rem;
}
.features-section .feature-item p {
    color: var(--text-secondary);
    line-height: 1.6;
    font-size: 0.97rem;
    margin: 0;
}

/* Generic "opp-card" used by Harbor & Bounty for content cards */
.opp-card {
    border-radius: var(--radius-lg);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
    border: 1px solid var(--border-light);
}
.opp-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

/* Demo / sizzle reel container */
.demo-frame {
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-lg);
    background: var(--bg-warm);
}
.demo-placeholder {
    aspect-ratio: 16 / 9;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    color: var(--text-tertiary);
    background: linear-gradient(135deg, var(--bg-warm) 0%, var(--bg-hover) 100%);
}
.demo-placeholder i {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* Section spacing — varied rhythm so the page reads as a narrative
   instead of a stack of equal-weight blocks (audit F-003). Each named
   section type gets purpose-fit padding; the unmodified `.landing-section`
   default is the fallback for product-specific extras. */
.landing-section {
    padding: 5rem 0;
}
.landing-section.alt {
    background: var(--bg-warm);
}
.landing-section.features-section {
    /* breathes — first major content section after hero */
    padding: 6rem 0 7rem;
}
.landing-section.how-it-works {
    /* breathes — editorial timeline needs vertical room (F-006) */
    padding: 5rem 0 6rem;
}
.landing-section.cta-band {
    /* breathes — last impression before the footer */
    padding: 6rem 0 7rem;
}
.landing-section h2 {
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 2.5rem;
}
.landing-section .section-intro {
    color: var(--text-secondary);
    text-align: center;
    max-width: 640px;
    margin: -1.5rem auto 2.5rem auto;
}

/* === Tabs — underline-only treatment ===
 *
 * Bootstrap's default .nav-tabs draws a 1px bottom border on the strip and
 * makes the active tab "lift" by hiding its bottom border, on the assumption
 * that the tab strip sits directly atop a paneled container. When tabs are
 * used inline with content that has no panel container (cards, plain divs,
 * grid rows), the active-tab indicator visually points at empty space and
 * the layout reads as broken. Replace with a clean underline-only treatment
 * that doesn't pretend to attach to a panel below it.
 *
 * Tabs SHOULD only be used for switching views WITHIN a detail page — never
 * for top-level section navigation (sections go in the sidebar). See
 * keel/CLAUDE.md → "UI & Frontend → Tabs are for in-record view switching."
 */
.nav-tabs {
    border-bottom: 1px solid var(--border-color);
}

.nav-tabs .nav-link {
    border: none;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    color: var(--text-secondary);
    padding: 0.5rem 1rem;
    margin-bottom: -1px;
    background: transparent;
    transition: color 120ms ease, border-color 120ms ease;
}

.nav-tabs .nav-link:hover,
.nav-tabs .nav-link:focus-visible {
    color: var(--text-primary);
    border-color: transparent;
    background: transparent;
}

.nav-tabs .nav-link.active,
.nav-tabs .nav-item.show .nav-link {
    color: var(--text-primary);
    background: transparent;
    border-color: transparent;
    border-bottom-color: var(--brand-primary, currentColor);
    font-weight: 600;
}

.nav-tabs .nav-link.disabled,
.nav-tabs .nav-link:disabled {
    color: var(--text-muted);
    border-color: transparent;
    background: transparent;
}
