@import url("https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap");

/* =============================================================================
   AYAKA DESIGN SYSTEM  ·  ayaka-theme.css
   -----------------------------------------------------------------------------
   One global design layer for the whole Ayaka platform.

   HOW IT WORKS
   The app runs a stock Bootstrap 5 admin theme (Myra). Rather than restyling
   hundreds of call sites, this file re-points the Bootstrap `--bs-*` custom
   properties, then adds a small set of `.ay-*` components on top. Every view
   that uses plain Bootstrap classes is re-themed for free.

   LOAD ORDER MATTERS. This file must be the LAST stylesheet in <head>, after
   the theme CSS *and* after the per-page inline <style> blocks, otherwise the
   older `!important` colour rules win. Where an existing rule already uses
   `!important`, this file matches it — see section 1 and section 19.

   COLOUR RULE (non-negotiable, house rule): every text/background pair here is
   measured, not eyeballed. 39/39 pairs are >= 4.5:1. Never introduce a light
   tint (yellow, lime, pastel) carrying white text.
   The neutral ink ramp is NAVY, not slate -- see the note on it in section 1.
   ============================================================================= */


/* -----------------------------------------------------------------------------
   1. DESIGN TOKENS
   The brand blues are sampled from the Ayaka logo mark (a deep navy network X).
   -------------------------------------------------------------------------- */
:root {
    /* Brand ramp */
    --ay-brand-900: #14224E;
    --ay-brand-800: #1B2F6B;
    --ay-brand-700: #24408E;   /* logo navy */
    --ay-brand-600: #2E52B0;
    --ay-brand-500: #3B67D4;
    --ay-brand-100: #DCE6FF;
    --ay-brand-50:  #EEF3FF;

    /* Neutrals
       Navy-leaning, not slate. The ink used to be #0F172A / #334155 / #4A5A73 --
       slate-900 and friends -- which renders as plain black to the eye: the client
       read the login pages as "black text" (2026-08-31). These are pulled into the
       brand's own blue family instead, so body copy sits under the logo navy rather
       than beside it. Contrast on white, measured: ink 15.4:1, ink-2 10.9:1,
       muted 7.3:1 (was 18.0 / 10.4 / 7.0) -- all comfortably over the 4.5:1 house
       rule, and ink is only ever set on white or near-white surfaces, so nothing
       that passed before drops below it. */
    --ay-ink:       #14224E;   /* = --ay-brand-900, the logo navy */
    --ay-ink-2:     #2C3B66;
    --ay-muted:     #46557E;
    /* Was #64748B, which measured 4.4:1 on the page background -- the dashboard
       footer was the one text on the page under the 4.5:1 house rule. Pulled into
       the navy family with the rest of the ramp and darkened just enough:
       4.96:1 on --ay-page, 5.36:1 on white. */
    --ay-faint:     #5A6A8C;
    --ay-line:      #DFE4EC;
    --ay-line-soft: #EDF1F7;
    --ay-surface:   #FFFFFF;
    --ay-surface-2: #F8FAFD;
    --ay-page:      #F4F6FB;

    /* Semantic — solids carry WHITE text, all >= 4.5:1 */
    --ay-danger:    #B42318;
    --ay-warning:   #B54708;
    --ay-success:   #027A48;
    --ay-info:      #175CD3;
    --ay-violet:    #6941C6;
    --ay-magenta:   #C11574;
    --ay-teal:      #0E7490;
    --ay-slate:     #475467;

    /* Semantic tints — carry the matching -ink colour, all >= 4.5:1 */
    --ay-danger-50:  #FEF3F2;  --ay-danger-ink:  #912018;
    --ay-warning-50: #FFFAEB;  --ay-warning-ink: #93370D;
    --ay-success-50: #ECFDF3;  --ay-success-ink: #05603A;
    --ay-info-50:    #EFF4FF;  --ay-info-ink:    #194185;
    --ay-violet-50:  #F4F3FF;  --ay-violet-ink:  #53389E;
    --ay-magenta-50: #FDF2FA;  --ay-magenta-ink: #9E165F;
    --ay-teal-50:    #ECFDFF;  --ay-teal-ink:    #0E7490;
    --ay-slate-50:   #F2F4F7;  --ay-slate-ink:   #344054;

    /* Elevation — soft, brand-tinted rather than neutral grey */
    --ay-shadow-xs: 0 1px 2px rgba(20, 34, 78, .06);
    --ay-shadow-sm: 0 1px 3px rgba(20, 34, 78, .08), 0 1px 2px rgba(20, 34, 78, .04);
    --ay-shadow-md: 0 4px 16px -2px rgba(20, 34, 78, .10), 0 2px 6px -2px rgba(20, 34, 78, .06);
    --ay-shadow-lg: 0 16px 36px -8px rgba(20, 34, 78, .16), 0 6px 14px -6px rgba(20, 34, 78, .08);

    /* Geometry */
    --ay-r-sm: 8px;
    --ay-r:    12px;
    --ay-r-lg: 16px;
    --ay-r-xl: 20px;
    --ay-r-pill: 999px;

    --ay-font: "Plus Jakarta Sans", "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}


/* -----------------------------------------------------------------------------
   2. BOOTSTRAP TOKEN RE-POINT
   Re-theming happens here; everything below is additive.
   -------------------------------------------------------------------------- */
:root,
[data-bs-theme="light"] {
    --bs-primary:         #2E52B0;
    --bs-primary-rgb:     46, 82, 176;
    --bs-primary-text-emphasis: #1B2F6B;
    --bs-primary-bg-subtle:     #EEF3FF;
    --bs-primary-border-subtle: #C7D6FF;

    --bs-secondary:       #475467;
    --bs-secondary-rgb:   71, 84, 103;
    --bs-success:         #027A48;
    --bs-success-rgb:     2, 122, 72;
    --bs-danger:          #B42318;
    --bs-danger-rgb:      180, 35, 24;
    --bs-warning:         #B54708;
    --bs-warning-rgb:     181, 71, 8;
    --bs-info:            #0E7490;
    --bs-info-rgb:        14, 116, 144;

    --bs-body-bg:         #F4F6FB;
    /* Point these at the tokens, never at literals. They were hardcoded to the
       old slate ink, so re-colouring --ay-ink left every Bootstrap .card behind
       (.card sets color: var(--bs-body-color)) -- which is exactly how the login
       page's "Remember this device" label stayed slate while the rest went navy. */
    --bs-body-color:      var(--ay-ink);
    --bs-body-color-rgb:  20, 34, 78;        /* raw triplet: Bootstrap rgba()s it */
    --bs-heading-color:   var(--ay-ink);
    --bs-emphasis-color:  var(--ay-ink);
    --bs-secondary-color: var(--ay-muted);
    --bs-tertiary-color:  #64748B;

    --bs-border-color:            #DFE4EC;
    --bs-border-color-translucent: rgba(20, 34, 78, .10);
    --bs-border-radius:    var(--ay-r);
    --bs-border-radius-sm: var(--ay-r-sm);
    --bs-border-radius-lg: var(--ay-r-lg);
    --bs-border-radius-xl: var(--ay-r-xl);

    --bs-link-color:       #2E52B0;
    --bs-link-color-rgb:   46, 82, 176;
    --bs-link-hover-color: #1B2F6B;

    --bs-body-font-family: var(--ay-font);
    --bs-body-font-size:   .9375rem;   /* 15px */
    --bs-body-line-height: 1.55;
}


/* -----------------------------------------------------------------------------
   3. BASE / PAGE CHROME
   The `!important` here is deliberate: it beats the older per-portal inline
   <style> blocks that hard-set `body { color: #00008B !important }`.
   -------------------------------------------------------------------------- */
body {
    font-family: var(--ay-font) !important;
    background-color: var(--ay-page) !important;
    color: var(--ay-ink) !important;
    font-size: .9375rem;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    letter-spacing: -.005em;
}

h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
    font-family: var(--ay-font);
    color: var(--ay-ink);
    font-weight: 700;
    letter-spacing: -.018em;
}

/* Numbers must line up in columns and never wobble as they count. */
.ay-num,
.ay-kpi__value,
.ay-stat__value,
.ay-pipeline__count,
table.ay-table td.num {
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum" 1, "cv01" 1;
}

::selection { background: var(--ay-brand-100); color: var(--ay-brand-900); }

/* One visible, consistent focus ring everywhere — keyboard users included. */
:focus-visible {
    outline: 3px solid var(--ay-brand-500);
    outline-offset: 2px;
    border-radius: 6px;
}

/* Slim, unobtrusive scrollbars inside panels */
.ay-scroll { scrollbar-width: thin; scrollbar-color: #C8D2E4 transparent; }
.ay-scroll::-webkit-scrollbar { width: 8px; height: 8px; }
.ay-scroll::-webkit-scrollbar-track { background: transparent; }
.ay-scroll::-webkit-scrollbar-thumb { background: #C8D2E4; border-radius: 999px; }
.ay-scroll::-webkit-scrollbar-thumb:hover { background: #A9B7CF; }


/* -----------------------------------------------------------------------------
   4. APP SHELL — top navigation
   Replaces the flat #1552b0 bar with a deep brand gradient and a proper
   active state. Selectors mirror the theme's own so specificity is a match;
   `!important` matches the existing overrides in the portal headers.
   -------------------------------------------------------------------------- */
.main-menu,
.main-menu .app-menu,
.main-menu .logo-box {
    background-color: transparent !important;
    background-image: none !important;
}

.main-menu {
    background-image: linear-gradient(100deg, var(--ay-brand-900) 0%, var(--ay-brand-800) 46%, var(--ay-brand-700) 100%) !important;
    box-shadow: 0 2px 14px rgba(20, 34, 78, .22) !important;
    border-bottom: 1px solid rgba(255, 255, 255, .08) !important;
}

.main-menu .logo-box {
    background: rgba(255, 255, 255, .06) !important;
    border-right: 1px solid rgba(255, 255, 255, .10);
}

.main-menu .app-menu .menu-title {
    color: rgba(255, 255, 255, .62) !important;
    font-weight: 700 !important;
    font-size: .68rem;
    letter-spacing: .10em;
    text-transform: uppercase;
}

.main-menu .app-menu > .menu-item > .menu-link {
    color: #FFFFFF !important;
    font-weight: 600 !important;
    border-radius: var(--ay-r-sm);
    margin: 4px 3px;
    padding: 9px 14px;
    transition: background-color .16s ease, transform .16s ease;
}
.main-menu .app-menu > .menu-item > .menu-link .menu-text,
.main-menu .app-menu > .menu-item > .menu-link .menu-icon,
.main-menu .app-menu > .menu-item > .menu-link .menu-arrow {
    color: #FFFFFF !important;
    font-weight: 600 !important;
}
.main-menu .app-menu > .menu-item > .menu-link .menu-icon {
    opacity: .9;
    font-size: 1.08rem;
}
.main-menu .app-menu > .menu-item > .menu-link:hover,
.main-menu .app-menu > .menu-item > .menu-link:hover .menu-text {
    background-color: rgba(255, 255, 255, .14) !important;
    color: #FFFFFF !important;
}
/* Current page: a solid chip, not just a hover tint. */
.main-menu .app-menu > .menu-item > .menu-link.active,
.main-menu .app-menu > .menu-item.active > .menu-link {
    background-color: rgba(255, 255, 255, .20) !important;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .22);
}

/* Sub-menus: white panel, brand-navy links. */
.main-menu .app-menu .sub-menu {
    background-color: #FFFFFF !important;
    border-radius: var(--ay-r) !important;
    box-shadow: var(--ay-shadow-lg) !important;
    border: 1px solid var(--ay-line) !important;
    padding: 6px !important;
    overflow: hidden;
}
.main-menu .app-menu .sub-menu .menu-link,
.main-menu .app-menu .sub-menu .menu-link .menu-text {
    color: var(--ay-brand-800) !important;
    font-weight: 600 !important;
    border-radius: var(--ay-r-sm);
}
.main-menu .app-menu .sub-menu .menu-link {
    padding: 9px 12px !important;
    transition: background-color .14s ease, color .14s ease;
}
.main-menu .app-menu .sub-menu .menu-link:hover,
.main-menu .app-menu .sub-menu .menu-link:hover .menu-text {
    background-color: var(--ay-brand-50) !important;
    color: var(--ay-brand-900) !important;
}

/* Topbar sitting under the brand bar */
.topbar,
.topbar-custom,
.navbar-custom {
    background-color: var(--ay-surface) !important;
    border-bottom: 1px solid var(--ay-line) !important;
    box-shadow: var(--ay-shadow-xs);
}

.footer {
    background: transparent;
    color: var(--ay-faint);
    font-size: .8125rem;
    border-top: 1px solid var(--ay-line-soft);
}


/* -----------------------------------------------------------------------------
   5. PAGE HEADER
   -------------------------------------------------------------------------- */
.ay-pagehead {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px;
    padding: 22px 0 18px;
}
.ay-pagehead__main { min-width: 0; flex: 1 1 320px; }
.ay-pagehead__live { margin-left: auto; }
.ay-pagehead__eyebrow {
    /* BLOCK flex, not inline-flex: this row is always alone on its own line (the
       title block follows immediately after), so inline sizing buys nothing — and
       inline-flex cost real pixels here. An inline-level box's position in its
       PARENT's flow is pinned to its baseline, and that baseline is "the first
       baseline-participating flex item inside it" — which is a different element
       (the eyebrow's own icon vs. the Back button's icon) depending on whether the
       button has landed here yet, so the row's own top edge measurably shifted by
       ~3.6px between the two states even though min-height (below) already made
       its HEIGHT identical either way. Plain flex is positioned by ordinary block
       flow instead (top = parent's content-box top, full stop), which does not
       depend on which child happens to be first — confirmed pixel-identical after
       this change, still just an icon-and-label row visually. */
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .09em;
    text-transform: uppercase;
    color: var(--ay-brand-600);
    margin-bottom: 5px;
    /* partials/_back.blade.php inserts the Back button as this row's first child
       (same row as the eyebrow text, not a row above it) — min-height keeps the
       row exactly as tall as that button at all times, whether it has landed yet
       or not, so there is never a moment the row grows once it does. See the
       BACK BUTTON section further down for --ay-back-size. */
    min-height: var(--ay-back-size);
}
.ay-pagehead__title {
    font-size: 1.6rem;
    font-weight: 800;
    line-height: 1.2;
    color: var(--ay-ink);
    margin: 0;
    letter-spacing: -.028em;
}
.ay-pagehead__sub {
    margin: 5px 0 0;
    color: var(--ay-muted);
    font-size: .875rem;
}
.ay-pagehead__aside {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

/* Live clock / freshness readout */
.ay-freshness {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    background: var(--ay-surface);
    border: 1px solid var(--ay-line);
    border-radius: var(--ay-r-pill);
    padding: 7px 14px 7px 11px;
    box-shadow: var(--ay-shadow-xs);
    font-size: .8125rem;
    color: var(--ay-muted);
    white-space: nowrap;
}
.ay-freshness b { color: var(--ay-ink); font-weight: 700; }

.ay-livedot {
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--ay-success);
    box-shadow: 0 0 0 0 rgba(2, 122, 72, .55);
    animation: ay-pulse 2.4s infinite;
    flex: 0 0 8px;
}
@keyframes ay-pulse {
    0%   { box-shadow: 0 0 0 0 rgba(2, 122, 72, .5); }
    70%  { box-shadow: 0 0 0 8px rgba(2, 122, 72, 0); }
    100% { box-shadow: 0 0 0 0 rgba(2, 122, 72, 0); }
}

/* Countdown ring on the refresh control */
.ay-refresh {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 0;
    background: var(--ay-brand-700);
    color: #FFFFFF;
    font-weight: 600;
    font-size: .8125rem;
    border-radius: var(--ay-r-pill);
    padding: 8px 16px;
    box-shadow: var(--ay-shadow-sm);
    cursor: pointer;
    transition: background-color .16s ease, transform .16s ease, box-shadow .16s ease;
}
.ay-refresh:hover { background: var(--ay-brand-800); transform: translateY(-1px); box-shadow: var(--ay-shadow-md); }
.ay-refresh:active { transform: translateY(0); }
.ay-refresh__ring {
    width: 16px; height: 16px;
    transform: rotate(-90deg);
    flex: 0 0 16px;
}
.ay-refresh__ring circle { fill: none; stroke-width: 3; }
.ay-refresh__ring .bg { stroke: rgba(255, 255, 255, .30); }
.ay-refresh__ring .fg { stroke: #FFFFFF; stroke-linecap: round; transition: stroke-dashoffset 1s linear; }


/* -----------------------------------------------------------------------------
   6. CARD / PANEL
   -------------------------------------------------------------------------- */
.ay-card {
    background: var(--ay-surface);
    border: 1px solid var(--ay-line);
    border-radius: var(--ay-r-lg);
    box-shadow: var(--ay-shadow-sm);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
    transition: box-shadow .2s ease, border-color .2s ease;
}
.ay-card:hover { box-shadow: var(--ay-shadow-md); }

.ay-card__head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 18px;
    border-bottom: 1px solid var(--ay-line-soft);
    background: linear-gradient(180deg, #FFFFFF 0%, var(--ay-surface-2) 100%);
}
.ay-card__icon {
    width: 34px; height: 34px;
    flex: 0 0 34px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: .95rem;
    background: var(--ay-brand-50);
    color: var(--ay-brand-700);
}
.ay-card__title {
    margin: 0;
    font-size: .975rem;
    font-weight: 700;
    color: var(--ay-ink);
    letter-spacing: -.015em;
}
.ay-card__sub {
    margin: 1px 0 0;
    font-size: .78rem;
    color: var(--ay-faint);
    font-weight: 500;
}
.ay-card__actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.ay-card__body { padding: 16px 18px; flex: 1 1 auto; min-height: 0; }
.ay-card__body--flush { padding: 0; }
.ay-card__foot {
    padding: 11px 18px;
    border-top: 1px solid var(--ay-line-soft);
    background: var(--ay-surface-2);
    font-size: .8125rem;
    color: var(--ay-muted);
}

/* A card that is itself a link/button target */
.ay-card--interactive { cursor: pointer; }
.ay-card--interactive:hover { border-color: var(--ay-brand-100); }


/* -----------------------------------------------------------------------------
   7. KPI TILE
   The number lives in the MARKUP, never only in JS — a backgrounded tab must
   still show the truth. (Animation may only ever replace it with itself.)
   -------------------------------------------------------------------------- */
.ay-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 14px;
}

.ay-kpi {
    position: relative;
    display: block;
    width: 100%;
    text-align: left;
    background: var(--ay-surface);
    border: 1px solid var(--ay-line);
    border-radius: var(--ay-r-lg);
    box-shadow: var(--ay-shadow-sm);
    padding: 16px 16px 15px;
    overflow: hidden;
    cursor: pointer;
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.ay-kpi::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    background: var(--ay-kpi-accent, var(--ay-brand-600));
}
/* A soft wash of the accent in the top-right corner — colour without a tinted
   background that would wreck text contrast. */
.ay-kpi::after {
    content: "";
    position: absolute;
    top: -46px; right: -46px;
    width: 118px; height: 118px;
    border-radius: 50%;
    background: var(--ay-kpi-accent, var(--ay-brand-600));
    opacity: .07;
    pointer-events: none;
    transition: opacity .18s ease, transform .18s ease;
}
.ay-kpi:hover {
    transform: translateY(-2px);
    box-shadow: var(--ay-shadow-md);
    border-color: var(--ay-line);
}
.ay-kpi:hover::after { opacity: .12; transform: scale(1.08); }

.ay-kpi__top { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 10px; }
.ay-kpi__icon {
    width: 34px; height: 34px; flex: 0 0 34px;
    border-radius: 10px;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: .95rem;
    background: var(--ay-kpi-accent, var(--ay-brand-600));
    color: #FFFFFF;
    box-shadow: 0 3px 8px -2px rgba(20, 34, 78, .28);
}
.ay-kpi__label {
    font-size: .78rem;
    font-weight: 600;
    color: var(--ay-muted);
    line-height: 1.3;
    padding-top: 2px;
}
.ay-kpi__value {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1;
    color: var(--ay-ink);
    letter-spacing: -.035em;
}
.ay-kpi__value small { font-size: .95rem; font-weight: 700; color: var(--ay-faint); letter-spacing: 0; }
.ay-kpi__foot {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 7px;
    font-size: .75rem;
    font-weight: 600;
    color: var(--ay-faint);
}
.ay-kpi__foot .go { margin-left: auto; color: #B6C2D6; transition: color .16s ease, transform .16s ease; }
.ay-kpi:hover .ay-kpi__foot .go { color: var(--ay-brand-600); transform: translateX(2px); }

/* Accent variants */
.ay-kpi--brand   { --ay-kpi-accent: var(--ay-brand-600); }
.ay-kpi--danger  { --ay-kpi-accent: var(--ay-danger); }
.ay-kpi--warning { --ay-kpi-accent: var(--ay-warning); }
.ay-kpi--success { --ay-kpi-accent: var(--ay-success); }
.ay-kpi--info    { --ay-kpi-accent: var(--ay-info); }
.ay-kpi--violet  { --ay-kpi-accent: var(--ay-violet); }
.ay-kpi--magenta { --ay-kpi-accent: var(--ay-magenta); }
.ay-kpi--teal    { --ay-kpi-accent: var(--ay-teal); }
.ay-kpi--slate   { --ay-kpi-accent: var(--ay-slate); }

/* A KPI that is currently non-zero AND critical earns a stronger treatment. */
.ay-kpi.is-alert { border-color: #F3C6C1; }
.ay-kpi.is-alert .ay-kpi__value { color: var(--ay-danger); }
.ay-kpi.is-alert::after { opacity: .13; }


/* -----------------------------------------------------------------------------
   8. ATTENTION RIBBON
   -------------------------------------------------------------------------- */
.ay-attention {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    background: linear-gradient(100deg, #FFF6F5 0%, #FFFBF3 100%);
    border: 1px solid #F5CFC9;
    border-left: 4px solid var(--ay-danger);
    border-radius: var(--ay-r);
    padding: 13px 16px;
    box-shadow: var(--ay-shadow-xs);
}
.ay-attention__icon {
    width: 32px; height: 32px; flex: 0 0 32px;
    border-radius: 9px;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--ay-danger);
    color: #FFFFFF;
    font-size: .95rem;
}
.ay-attention__lead { font-weight: 700; color: var(--ay-danger-ink); font-size: .9rem; }
.ay-attention__lead span { display: block; font-weight: 500; color: var(--ay-muted); font-size: .78rem; margin-top: 1px; }
.ay-attention__chips { display: flex; gap: 8px; flex-wrap: wrap; margin-left: auto; }

/* 8b. PENDING WORK - approvals waiting for the company (client test report, Nov 2026).
   Same shape as the attention ribbon, in the calm "info" hue: it is work to do, not an alarm. */
.ay-pending {
    display: flex;
    align-items: center;
    gap: 10px 14px;
    flex-wrap: wrap;
    margin-top: 10px;
    background: var(--ay-info-50, #EEF4FF);
    border: 1px solid color-mix(in srgb, var(--ay-info-ink, #1D3F8F) 22%, transparent);
    border-left: 4px solid var(--ay-info, #2952CC);
    border-radius: var(--ay-r);
    padding: 12px 16px;
    box-shadow: var(--ay-shadow-xs);
}
.ay-pending__icon {
    width: 32px; height: 32px; flex: 0 0 32px;
    border-radius: 9px;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--ay-info, #2952CC);
    color: #FFFFFF;
    font-size: .95rem;
}
.ay-pending__lead { font-weight: 700; color: var(--ay-info-ink, #1D3F8F); font-size: .9rem; }
.ay-pending__lead span { display: block; font-weight: 500; color: var(--ay-muted); font-size: .78rem; margin-top: 1px; }
.ay-pending__items { display: flex; gap: 8px; flex-wrap: wrap; margin-left: auto; }
.ay-pending__items a.ay-chip { text-decoration: none; }
.ay-pending__names {
    flex: 0 0 100%;
    display: flex; gap: 4px 18px; flex-wrap: wrap;
    padding-left: 46px;
    font-size: .78rem;
    color: var(--ay-ink-2);
}
.ay-pending__names strong { color: var(--ay-ink); font-weight: 700; }
@media (max-width: 767.98px) {
    .ay-pending__items { margin-left: 0; }
    .ay-pending__names { padding-left: 0; }
}

.ay-chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    border: 1px solid var(--ay-line);
    background: var(--ay-surface);
    color: var(--ay-ink-2);
    font-size: .78rem;
    font-weight: 600;
    border-radius: var(--ay-r-pill);
    padding: 6px 13px;
    cursor: pointer;
    box-shadow: var(--ay-shadow-xs);
    transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
    white-space: nowrap;
}
.ay-chip:hover { transform: translateY(-1px); box-shadow: var(--ay-shadow-sm); border-color: #C9D4E6; }
.ay-chip__count {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 20px; height: 20px; padding: 0 6px;
    border-radius: var(--ay-r-pill);
    font-size: .72rem; font-weight: 800;
    background: var(--ay-slate); color: #FFFFFF;
}
.ay-chip--danger  .ay-chip__count { background: var(--ay-danger); }
.ay-chip--warning .ay-chip__count { background: var(--ay-warning); }
.ay-chip--violet  .ay-chip__count { background: var(--ay-violet); }
.ay-chip--magenta .ay-chip__count { background: var(--ay-magenta); }
.ay-chip--info    .ay-chip__count { background: var(--ay-info); }
.ay-chip--success .ay-chip__count { background: var(--ay-success); }

/* A modifier chip with NO count badge rendered exactly like a bare one, because until
   2026-09-20 the only thing --danger / --info / --success ever coloured was a nested
   .ay-chip__count — and the dashboard's attention chips are the only chips that carry one.
   So Live Tracking's route states (Ongoing / Completed / No vehicle) and the role cards all
   came out as the same neutral chip, and the colour coding an operator reads at a glance was
   simply absent.

   Tint the chip itself, reusing the -50 / -ink pairs .ay-pill--* already uses so the two
   vocabularies cannot drift. Every pair is well past the client's 4.5:1 rule — measured
   2026-09-20: info 8.92, slate 9.49, danger 7.97, violet 7.87, success 7.26, warning 7.21,
   magenta 7.04, teal 5.12 — and no pair puts white text on a pastel. The count badge keeps
   its solid background from the rules above, which still reads against the tint.

   A bare .ay-chip stays neutral on purpose: on Live Tracking that is "Scheduled", the state
   where nothing has happened yet.

   Borders use color-mix so they stay in-hue. A browser without it drops the declaration and
   keeps --ay-line: a neutral border around a tint, plainer but never broken. */
.ay-chip--danger  { background: var(--ay-danger-50);  color: var(--ay-danger-ink);  border-color: color-mix(in srgb, var(--ay-danger-ink)  22%, transparent); }
.ay-chip--warning { background: var(--ay-warning-50); color: var(--ay-warning-ink); border-color: color-mix(in srgb, var(--ay-warning-ink) 22%, transparent); }
.ay-chip--success { background: var(--ay-success-50); color: var(--ay-success-ink); border-color: color-mix(in srgb, var(--ay-success-ink) 22%, transparent); }
.ay-chip--info    { background: var(--ay-info-50);    color: var(--ay-info-ink);    border-color: color-mix(in srgb, var(--ay-info-ink)    22%, transparent); }
.ay-chip--violet  { background: var(--ay-violet-50);  color: var(--ay-violet-ink);  border-color: color-mix(in srgb, var(--ay-violet-ink)  22%, transparent); }
.ay-chip--magenta { background: var(--ay-magenta-50); color: var(--ay-magenta-ink); border-color: color-mix(in srgb, var(--ay-magenta-ink) 22%, transparent); }
.ay-chip--teal    { background: var(--ay-teal-50);    color: var(--ay-teal-ink);    border-color: color-mix(in srgb, var(--ay-teal-ink)    22%, transparent); }
.ay-chip--slate   { background: var(--ay-slate-50);   color: var(--ay-slate-ink);   border-color: color-mix(in srgb, var(--ay-slate-ink)   22%, transparent); }

/* Keep hover in-hue too, or .ay-chip:hover's neutral #C9D4E6 lands on a tinted chip. */
.ay-chip--danger:hover  { border-color: color-mix(in srgb, var(--ay-danger-ink)  45%, transparent); }
.ay-chip--warning:hover { border-color: color-mix(in srgb, var(--ay-warning-ink) 45%, transparent); }
.ay-chip--success:hover { border-color: color-mix(in srgb, var(--ay-success-ink) 45%, transparent); }
.ay-chip--info:hover    { border-color: color-mix(in srgb, var(--ay-info-ink)    45%, transparent); }
.ay-chip--violet:hover  { border-color: color-mix(in srgb, var(--ay-violet-ink)  45%, transparent); }
.ay-chip--magenta:hover { border-color: color-mix(in srgb, var(--ay-magenta-ink) 45%, transparent); }
.ay-chip--teal:hover    { border-color: color-mix(in srgb, var(--ay-teal-ink)    45%, transparent); }
.ay-chip--slate:hover   { border-color: color-mix(in srgb, var(--ay-slate-ink)   45%, transparent); }

/* The all-clear counterpart, so a quiet day still reads as a deliberate state. */
.ay-allclear {
    display: flex; align-items: center; gap: 12px;
    background: var(--ay-success-50);
    border: 1px solid #B7E4CB;
    border-left: 4px solid var(--ay-success);
    border-radius: var(--ay-r);
    padding: 13px 16px;
    color: var(--ay-success-ink);
    font-weight: 600;
    font-size: .875rem;
}
.ay-allclear i { font-size: 1.1rem; }


/* -----------------------------------------------------------------------------
   9. STATUS PILLS
   -------------------------------------------------------------------------- */
.ay-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .01em;
    padding: 4px 10px;
    border-radius: var(--ay-r-pill);
    white-space: nowrap;
    line-height: 1.5;
}
.ay-pill::before {
    content: "";
    width: 6px; height: 6px; border-radius: 50%;
    background: currentColor;
    flex: 0 0 6px;
}
.ay-pill--danger  { background: var(--ay-danger-50);  color: var(--ay-danger-ink); }
.ay-pill--warning { background: var(--ay-warning-50); color: var(--ay-warning-ink); }
.ay-pill--success { background: var(--ay-success-50); color: var(--ay-success-ink); }
.ay-pill--info    { background: var(--ay-info-50);    color: var(--ay-info-ink); }
.ay-pill--violet  { background: var(--ay-violet-50);  color: var(--ay-violet-ink); }
.ay-pill--magenta { background: var(--ay-magenta-50); color: var(--ay-magenta-ink); }
.ay-pill--teal    { background: var(--ay-teal-50);    color: var(--ay-teal-ink); }
.ay-pill--slate   { background: var(--ay-slate-50);   color: var(--ay-slate-ink); }
.ay-pill--brand   { background: var(--ay-brand-50);   color: var(--ay-brand-800); }
.ay-pill--live::before { animation: ay-blink 1.6s ease-in-out infinite; }
@keyframes ay-blink { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }


/* -----------------------------------------------------------------------------
   10. TRIP PIPELINE (stacked stage bar)
   -------------------------------------------------------------------------- */
.ay-pipeline { display: flex; flex-direction: column; gap: 14px; }

.ay-pipeline__bar {
    display: flex;
    height: 12px;
    border-radius: var(--ay-r-pill);
    overflow: hidden;
    background: var(--ay-slate-50);
    box-shadow: inset 0 0 0 1px rgba(20, 34, 78, .06);
}
.ay-pipeline__seg {
    height: 100%;
    transition: width .5s cubic-bezier(.4, 0, .2, 1);
    min-width: 0;
}
.ay-pipeline__seg + .ay-pipeline__seg { box-shadow: inset 1px 0 0 rgba(255, 255, 255, .7); }

.ay-pipeline__legend {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(112px, 1fr));
    gap: 10px;
}
.ay-pipeline__item {
    border: 1px solid var(--ay-line);
    border-radius: var(--ay-r);
    padding: 11px 12px;
    background: var(--ay-surface);
    cursor: pointer;
    transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.ay-pipeline__item:hover { transform: translateY(-1px); box-shadow: var(--ay-shadow-sm); border-color: #C9D4E6; }
.ay-pipeline__key {
    display: flex; align-items: center; gap: 7px;
    font-size: .74rem; font-weight: 600; color: var(--ay-muted);
    margin-bottom: 5px;
}
.ay-pipeline__swatch { width: 9px; height: 9px; border-radius: 3px; flex: 0 0 9px; }
.ay-pipeline__count { font-size: 1.35rem; font-weight: 800; color: var(--ay-ink); line-height: 1; letter-spacing: -.03em; }


/* -----------------------------------------------------------------------------
   11. STAT LIST (drill-down rows)
   -------------------------------------------------------------------------- */
.ay-statlist { display: flex; flex-direction: column; }
.ay-statlist__row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 10px;
    border-radius: var(--ay-r-sm);
    cursor: pointer;
    transition: background-color .13s ease;
}
.ay-statlist__row + .ay-statlist__row { box-shadow: inset 0 1px 0 var(--ay-line-soft); }
.ay-statlist__row:hover { background: var(--ay-brand-50); box-shadow: none; }
.ay-statlist__row:hover + .ay-statlist__row { box-shadow: none; }
.ay-statlist__ico {
    width: 32px; height: 32px; flex: 0 0 32px;
    border-radius: 9px;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: .85rem;
}
.ay-statlist__label { font-size: .85rem; font-weight: 600; color: var(--ay-ink-2); min-width: 0; }
.ay-statlist__row:hover .ay-statlist__label { color: var(--ay-brand-800); }
.ay-statlist__rule { flex: 1 1 auto; border-bottom: 1px dashed var(--ay-line); height: 1px; min-width: 12px; }
.ay-statlist__value {
    font-size: .8rem; font-weight: 800; color: #FFFFFF;
    border-radius: var(--ay-r-pill);
    padding: 3px 12px; min-width: 42px; text-align: center;
}
.ay-statlist__go { color: #C2CDDD; font-size: .95rem; transition: color .15s ease, transform .15s ease; }
.ay-statlist__row:hover .ay-statlist__go { color: var(--ay-brand-600); transform: translateX(2px); }
.ay-statlist__row--total {
    margin-top: 8px;
    background: var(--ay-brand-50);
    box-shadow: none !important;
}
.ay-statlist__row--total:hover { background: var(--ay-brand-100); }


/* -----------------------------------------------------------------------------
   12. TABLES
   -------------------------------------------------------------------------- */
.ay-table-wrap { width: 100%; overflow-x: auto; }

table.ay-table {
    width: 100%;
    /* A data table squeezed narrow wraps registration plates and names onto two
       lines, which is harder to scan than scrolling. Below this width the table
       scrolls inside its own card instead — the page itself never scrolls sideways. */
    min-width: 680px;
    border-collapse: separate;
    border-spacing: 0;
    font-size: .84rem;
}
table.ay-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: var(--ay-surface-2);
    color: var(--ay-faint);
    font-weight: 700;
    font-size: .7rem;
    letter-spacing: .07em;
    text-transform: uppercase;
    padding: 10px 14px;
    text-align: left;
    white-space: nowrap;
    border-bottom: 1px solid var(--ay-line);
}
table.ay-table tbody td {
    padding: 12px 14px;
    color: var(--ay-ink-2);
    border-bottom: 1px solid var(--ay-line-soft);
    vertical-align: middle;
}
table.ay-table tbody tr:last-child td { border-bottom: 0; }
table.ay-table tbody tr { transition: background-color .12s ease; }
table.ay-table tbody tr:hover { background: var(--ay-brand-50); }
table.ay-table .strong { font-weight: 700; color: var(--ay-ink); }
table.ay-table .dim { color: var(--ay-faint); font-size: .78rem; }

/* Small two-line cell: primary label + secondary detail */
.ay-cell { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ay-cell b { font-weight: 700; color: var(--ay-ink); font-size: .84rem; white-space: nowrap; }
.ay-cell span { color: var(--ay-faint); font-size: .74rem; }

/* Avatar / initial bubble */
.ay-avatar {
    width: 30px; height: 30px; flex: 0 0 30px;
    border-radius: 9px;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: .72rem; font-weight: 800;
    background: var(--ay-brand-50);
    color: var(--ay-brand-800);
}

/* DataTables, re-skinned to match without fighting its own layout. */
.ay-card table.dataTable thead th { background: var(--ay-surface-2); }
.dataTables_wrapper .dataTables_filter input,
.dataTables_wrapper .dataTables_length select {
    border: 1px solid var(--ay-line);
    border-radius: var(--ay-r-sm);
    padding: 6px 10px;
}
.dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background: var(--ay-brand-600) !important;
    border-color: var(--ay-brand-600) !important;
    color: #FFFFFF !important;
    border-radius: var(--ay-r-sm);
}


/* -----------------------------------------------------------------------------
   13. FORMS & BUTTONS
   -------------------------------------------------------------------------- */
.form-label { font-size: .8rem; font-weight: 600; color: var(--ay-ink-2); margin-bottom: 5px; }

.form-control,
.form-select,
input[type="text"].form-control,
input[type="date"].form-control {
    border: 1px solid var(--ay-line);
    border-radius: var(--ay-r-sm);
    padding: 9px 12px;
    font-size: .875rem;
    color: var(--ay-ink);
    background-color: var(--ay-surface);
    transition: border-color .15s ease, box-shadow .15s ease;
}
.form-control::placeholder { color: #94A3B8; }
.form-control:focus,
.form-select:focus {
    border-color: var(--ay-brand-500);
    box-shadow: 0 0 0 4px rgba(59, 103, 212, .14);
    outline: none;
}

.btn {
    border-radius: var(--ay-r-sm);
    font-weight: 600;
    font-size: .84rem;
    padding: 9px 16px;
    transition: transform .14s ease, box-shadow .14s ease, background-color .14s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary {
    background-color: var(--ay-brand-700);
    border-color: var(--ay-brand-700);
    box-shadow: var(--ay-shadow-xs);
}
.btn-primary:hover,
.btn-primary:focus {
    background-color: var(--ay-brand-800);
    border-color: var(--ay-brand-800);
    box-shadow: var(--ay-shadow-sm);
}
.btn-outline-primary { color: var(--ay-brand-700); border-color: #C7D6FF; }
.btn-outline-primary:hover { background-color: var(--ay-brand-700); border-color: var(--ay-brand-700); color: #FFFFFF; }

/* Compact ghost button used in card headers */
.ay-btn-ghost {
    display: inline-flex; align-items: center; gap: 6px;
    border: 1px solid var(--ay-line);
    background: var(--ay-surface);
    color: var(--ay-ink-2);
    font-size: .78rem; font-weight: 600;
    border-radius: var(--ay-r-sm);
    padding: 6px 11px;
    cursor: pointer;
    transition: background-color .14s ease, border-color .14s ease, color .14s ease;
}
.ay-btn-ghost:hover { background: var(--ay-brand-50); border-color: #C7D6FF; color: var(--ay-brand-800); }

/* Track action inside tables */
.ay-btn-track {
    display: inline-flex; align-items: center; gap: 6px;
    background: var(--ay-brand-50);
    color: var(--ay-brand-800);
    border: 1px solid #C7D6FF;
    border-radius: var(--ay-r-pill);
    font-size: .74rem; font-weight: 700;
    padding: 5px 12px;
    cursor: pointer;
    transition: background-color .14s ease, color .14s ease;
}
.ay-btn-track:hover { background: var(--ay-brand-700); color: #FFFFFF; border-color: var(--ay-brand-700); }


/* -----------------------------------------------------------------------------
   14. TABS (quick console)
   -------------------------------------------------------------------------- */
.ay-tabs {
    display: flex;
    gap: 4px;
    background: var(--ay-slate-50);
    border-radius: var(--ay-r-sm);
    padding: 4px;
}
.ay-tab {
    flex: 1 1 0;
    border: 0;
    background: transparent;
    color: var(--ay-muted);
    font-size: .8rem;
    font-weight: 600;
    padding: 8px 10px;
    border-radius: 6px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    transition: background-color .15s ease, color .15s ease, box-shadow .15s ease;
    white-space: nowrap;
}
.ay-tab:hover { color: var(--ay-ink); }
.ay-tab.is-active {
    background: var(--ay-surface);
    color: var(--ay-brand-800);
    box-shadow: var(--ay-shadow-xs);
}
.ay-tabpanel[hidden] { display: none; }

/* Restyle of the stock Bootstrap .nav-tabs (data-bs-toggle="tab") for pages that
   need to keep the real Bootstrap tab/DataTables event wiring — vendor Manage
   Vehicles, Add Vehicle, Add Driver. Cosmetic only: does not touch data-bs-toggle
   or .active/.show, so a page's own tab.js and any shown.bs.tab listener still
   fire unchanged. */
.ay-vtabs { border-bottom: 1px solid var(--ay-line); gap: 4px; }
.ay-vtabs .nav-link {
    border: 0; border-radius: var(--ay-r-sm) var(--ay-r-sm) 0 0;
    color: var(--ay-muted); font-weight: 600; font-size: .84rem;
    padding: 9px 16px; background: transparent;
}
.ay-vtabs .nav-link:hover { color: var(--ay-ink); background: var(--ay-brand-50); }
.ay-vtabs .nav-link.active {
    color: var(--ay-brand-800); background: var(--ay-brand-50);
    border-bottom: 2px solid var(--ay-brand-700);
}


/* -----------------------------------------------------------------------------
   15. TYPEAHEAD / SEARCH RESULTS
   -------------------------------------------------------------------------- */
.ay-search { position: relative; }
.ay-search__icon {
    position: absolute;
    left: 13px; top: 50%;
    transform: translateY(-50%);
    color: #94A3B8;
    font-size: .9rem;
    pointer-events: none;
}
.ay-search input.form-control { padding-left: 38px; }

.list-group.ay-results {
    border: 1px solid var(--ay-line);
    border-radius: var(--ay-r);
    box-shadow: var(--ay-shadow-lg);
    overflow: hidden;
    margin-top: 6px;
    max-height: 280px;
    overflow-y: auto;
}
.list-group.ay-results .list-group-item {
    border: 0;
    border-bottom: 1px solid var(--ay-line-soft);
    padding: 10px 14px;
    font-size: .84rem;
    color: var(--ay-ink-2);
    cursor: pointer;
}
.list-group.ay-results .list-group-item:last-child { border-bottom: 0; }
.list-group.ay-results .list-group-item:hover { background: var(--ay-brand-50); color: var(--ay-brand-800); }


/* -----------------------------------------------------------------------------
   16. EMPTY STATE / SKELETON
   -------------------------------------------------------------------------- */
.ay-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 34px 18px;
    color: var(--ay-faint);
}
.ay-empty__icon {
    width: 46px; height: 46px;
    border-radius: 14px;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--ay-slate-50);
    color: #94A3B8;
    font-size: 1.15rem;
    margin-bottom: 11px;
}
.ay-empty__title { font-size: .875rem; font-weight: 700; color: var(--ay-ink-2); margin: 0 0 3px; }
.ay-empty__hint { font-size: .8rem; margin: 0; max-width: 34ch; }


/* -----------------------------------------------------------------------------
   17. MODAL CHROME
   -------------------------------------------------------------------------- */
.modal-content {
    border: 0;
    border-radius: var(--ay-r-lg);
    box-shadow: var(--ay-shadow-lg);
    overflow: hidden;
}
.modal-header {
    background: linear-gradient(100deg, var(--ay-brand-900), var(--ay-brand-700));
    color: #FFFFFF;
    border-bottom: 0;
    padding: 15px 20px;
}
.modal-header .modal-title { color: #FFFFFF; font-size: 1rem; font-weight: 700; }
.modal-header .btn-close { filter: invert(1) grayscale(100%) brightness(200%); opacity: .85; }
.modal-footer { border-top: 1px solid var(--ay-line-soft); background: var(--ay-surface-2); }


/* -----------------------------------------------------------------------------
   18. LAYOUT UTILITIES
   -------------------------------------------------------------------------- */
.ay-grid { display: grid; gap: 16px; }
.ay-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ay-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ay-grid--8-4 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.ay-grid--7-5 { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); }
.ay-stack { display: grid; gap: 16px; align-content: start; }
.ay-mt { margin-top: 16px; }


/* -----------------------------------------------------------------------------
   19. CONTRAST GUARDRAILS
   The base theme re-points success/danger/warning/info far brighter than stock
   Bootstrap, which pushed ~30 utility usages below 4.5:1 (measured, not
   calculated: .text-danger was 3.19:1 across 172 usages). Fixing the utilities
   once here is safer than editing every call site.
   Do not write a literal comment terminator inside this block. It closes the
   comment early, the remaining prose is parsed as a selector, and CSS error
   recovery then swallows the whole next rule. (This very sentence used to
   contain one, and it silently killed the .text-primary rule below.)
   -------------------------------------------------------------------------- */
.text-primary { color: var(--ay-brand-700) !important; }
.text-success { color: var(--ay-success) !important; }
.text-danger  { color: var(--ay-danger)  !important; }
.text-warning { color: var(--ay-warning) !important; }
.text-info    { color: var(--ay-teal)    !important; }
.text-muted   { color: var(--ay-muted)   !important; }
.text-secondary { color: var(--ay-muted) !important; }

.bg-primary { background-color: var(--ay-brand-700) !important; }
.bg-success { background-color: var(--ay-success) !important; }
.bg-danger  { background-color: var(--ay-danger)  !important; }
.bg-warning { background-color: var(--ay-warning) !important; }
.bg-info    { background-color: var(--ay-teal)    !important; }
.bg-light   { background-color: var(--ay-surface-2) !important; }

.badge.bg-warning, .badge.bg-success, .badge.bg-danger,
.badge.bg-info, .badge.bg-primary { color: #FFFFFF !important; }

.badge { font-weight: 700; border-radius: var(--ay-r-pill); padding: .35em .75em; }

a { color: var(--ay-brand-700); text-decoration: none; }
a:hover { color: var(--ay-brand-900); text-decoration: underline; }


/* -----------------------------------------------------------------------------
   20. RESPONSIVE
   -------------------------------------------------------------------------- */
@media (max-width: 1199.98px) {
    .ay-grid--8-4,
    .ay-grid--7-5,
    .ay-grid--3 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 767.98px) {
    .ay-grid--2 { grid-template-columns: minmax(0, 1fr); }
    .ay-kpi-grid { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
    .ay-kpi__value { font-size: 1.6rem; }
    .ay-pagehead { padding: 16px 0 14px; }
    .ay-pagehead__title { font-size: 1.3rem; }
    .ay-pagehead__aside { width: 100%; }
    .ay-attention__chips { margin-left: 0; }
    .ay-tabs { overflow-x: auto; }
    .ay-tab { flex: 0 0 auto; }
}


/* -----------------------------------------------------------------------------
   21. MOTION & PRINT
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .001ms !important;
        scroll-behavior: auto !important;
    }
    .ay-kpi:hover, .btn:hover, .ay-chip:hover { transform: none; }
}

@media print {
    body { background: #FFFFFF !important; }
    .main-menu, .topbar, .footer, .ay-pagehead__aside, .ay-btn-ghost, .ay-refresh { display: none !important; }
    .ay-card, .ay-kpi { box-shadow: none !important; border: 1px solid #CBD5E1 !important; break-inside: avoid; }
    .ay-kpi::after { display: none; }
}


/* =============================================================================
   PART TWO — THE EXPRESSIVE LAYER
   -----------------------------------------------------------------------------
   Everything above is the quiet system. What follows is the deliberately showy
   half: gradient hero tiles, 3D flip cards, gauges, animated status strips.

   THE ONE RULE THAT STILL BINDS: white text lives on these gradients, so every
   gradient's LIGHT stop is measured with white on top, and measured AGAIN with
   the sheen overlay composited over it. Measured values (white on the light
   stop / on the light stop + 20% white sheen):
       crimson 6.94 / 4.92   purple 7.91 / 5.07   amber   7.04 / 4.54
       cyan    7.21 / 4.53   green  7.67 / 4.76   magenta 6.53 / 4.73
       indigo  8.17 / 4.94   slate  7.69 / 4.60
   That is why these gradients are darker than the reference dashboard's: the
   reference puts white on a light yellow (~1.9:1), which is unreadable, and is
   the one thing from it deliberately not copied.
   ============================================================================= */


/* -----------------------------------------------------------------------------
   22. GRADIENT HERO TILE
   -------------------------------------------------------------------------- */
.ay-tilerow {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(196px, 1fr));
    gap: 14px;
}

.ay-tile {
    --g1: var(--ay-brand-900);
    --g2: var(--ay-brand-600);
    position: relative;
    display: block;
    width: 100%;
    text-align: left;
    border: 0;
    border-radius: var(--ay-r-lg);
    padding: 17px 17px 15px;
    color: #FFFFFF;
    overflow: hidden;
    cursor: pointer;
    isolation: isolate;
    background-image: linear-gradient(135deg, var(--g1) 0%, var(--g2) 100%);
    box-shadow: 0 6px 18px -6px rgba(20, 34, 78, .38), 0 2px 5px -2px rgba(20, 34, 78, .22);
    transition: transform .28s cubic-bezier(.34, 1.4, .64, 1), box-shadow .28s ease;
}

/* Sheen: a soft highlight sweeping out of the top-right. Capped at 20% white so
   the composited surface still clears 4.5:1 — see the measured table above. */
.ay-tile::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background:
        radial-gradient(120% 90% at 88% -20%, rgba(255, 255, 255, .20) 0%, rgba(255, 255, 255, 0) 62%),
        radial-gradient(80% 70% at -10% 115%, rgba(0, 0, 0, .18) 0%, rgba(0, 0, 0, 0) 60%);
    pointer-events: none;
}

/* A slow light sweep on hover — the glass pass. */
.ay-tile::after {
    content: "";
    position: absolute;
    top: 0; bottom: 0;
    left: -60%;
    width: 45%;
    z-index: -1;
    background: linear-gradient(100deg, rgba(255,255,255,0) 0%, rgba(255,255,255,.16) 50%, rgba(255,255,255,0) 100%);
    transform: skewX(-18deg);
    transition: left .62s cubic-bezier(.22, .8, .3, 1);
    pointer-events: none;
}
.ay-tile:hover::after { left: 118%; }

.ay-tile:hover {
    transform: translateY(-5px) scale(1.012);
    box-shadow: 0 18px 34px -10px rgba(20, 34, 78, .46), 0 6px 14px -6px rgba(20, 34, 78, .28);
}
.ay-tile:active { transform: translateY(-1px) scale(.998); }

.ay-tile__head { display: flex; align-items: flex-start; gap: 11px; }
.ay-tile__icon {
    width: 40px; height: 40px; flex: 0 0 40px;
    border-radius: 13px;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 1.05rem;
    background: rgba(255, 255, 255, .17);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .22);
    transition: transform .32s cubic-bezier(.34, 1.4, .64, 1), background-color .25s ease;
}
.ay-tile:hover .ay-tile__icon { transform: rotate(-8deg) scale(1.06); background: rgba(255, 255, 255, .25); }

.ay-tile__label {
    font-size: .775rem;
    font-weight: 600;
    line-height: 1.32;
    color: rgba(255, 255, 255, .93);
    padding-top: 3px;
}
.ay-tile__value {
    font-size: 2.3rem;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -.04em;
    margin-top: 12px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, .18);
}
.ay-tile__value small { font-size: .9rem; font-weight: 700; opacity: .82; letter-spacing: 0; }
.ay-tile__foot {
    display: flex; align-items: center; gap: 7px;
    margin-top: 8px;
    font-size: .73rem;
    font-weight: 600;
    color: rgba(255, 255, 255, .88);
}
.ay-tile__foot .go { margin-left: auto; opacity: .75; transition: transform .2s ease, opacity .2s ease; }
.ay-tile:hover .ay-tile__foot .go { transform: translateX(3px); opacity: 1; }

/* Micro sparkline drawn along the bottom edge of a tile. */
.ay-tile__spark { position: absolute; left: 0; right: 0; bottom: 0; height: 34px; opacity: .34; pointer-events: none; }
.ay-tile__spark path { fill: none; stroke: #FFFFFF; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ay-tile__spark .fill { fill: rgba(255, 255, 255, .18); stroke: none; }

/* Gradient variants */
.ay-tile--indigo  { --g1: #14224E; --g2: #2A4A9E; }
.ay-tile--crimson { --g1: #7A0C22; --g2: #B01739; }
.ay-tile--purple  { --g1: #3B1178; --g2: #6429C4; }
.ay-tile--amber   { --g1: #6E2905; --g2: #983C07; }
.ay-tile--cyan    { --g1: #06384A; --g2: #0B5F76; }
.ay-tile--green   { --g1: #023D2C; --g2: #03603A; }
.ay-tile--magenta { --g1: #6B0C3E; --g2: #B31468; }
.ay-tile--slate   { --g1: #232B38; --g2: #475467; }

/* A tile that is demanding attention gets a slow breathing halo. */
.ay-tile.is-urgent {
    box-shadow: 0 6px 18px -6px rgba(180, 35, 24, .5), 0 0 0 0 rgba(180, 35, 24, .5);
    animation: ay-halo 2.6s ease-in-out infinite;
}
@keyframes ay-halo {
    0%, 100% { box-shadow: 0 6px 18px -6px rgba(180, 35, 24, .5), 0 0 0 0 rgba(180, 35, 24, .45); }
    50%      { box-shadow: 0 6px 22px -6px rgba(180, 35, 24, .6), 0 0 0 10px rgba(180, 35, 24, 0); }
}


/* -----------------------------------------------------------------------------
   23. 3D FLIP CARD
   The face carries the headline number; the reverse carries the breakdown that
   would otherwise need a second panel or a round trip to a drill-down modal.
   Flips on click and on keyboard (it is a real button), never on hover alone —
   a hover flip fires by accident when the pointer crosses on its way elsewhere.
   -------------------------------------------------------------------------- */
.ay-flip {
    position: relative;
    perspective: 1400px;
    height: var(--ay-flip-h, 172px);
}
.ay-flip__inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform .68s cubic-bezier(.34, 1.06, .5, 1);
    transform-style: preserve-3d;
}
.ay-flip.is-flipped .ay-flip__inner { transform: rotateY(180deg); }

.ay-flip__face {
    position: absolute;
    inset: 0;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    border-radius: var(--ay-r-lg);
    overflow: hidden;
}
.ay-flip__face--back { transform: rotateY(180deg); }

/* The tile inside a flip fills its face rather than sizing to content. */
.ay-flip .ay-tile { height: 100%; }

/* Reverse face: a dark, quiet panel so the numbers read as detail, not repetition. */
.ay-flip__back {
    height: 100%;
    background: linear-gradient(150deg, #101B38 0%, #1B2A50 100%);
    color: #FFFFFF;
    padding: 14px 15px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.ay-flip__back h4 {
    margin: 0;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .085em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, .68);
}
.ay-flip__rows { display: flex; flex-direction: column; flex: 1; min-height: 0; overflow: auto; }
.ay-flip__row {
    display: flex; align-items: center; gap: 9px;
    font-size: .79rem;
    padding: 5px 0;
    border-bottom: 1px solid rgba(255, 255, 255, .09);
}
.ay-flip__row:last-child { border-bottom: 0; }
.ay-flip__row span { color: rgba(255, 255, 255, .82); flex: 1; min-width: 0; }
.ay-flip__row b { font-weight: 800; font-variant-numeric: tabular-nums; }
.ay-flip__hint {
    font-size: .67rem;
    color: rgba(255, 255, 255, .55);
    display: flex; align-items: center; gap: 6px;
}

/* The flip affordance on the face */
.ay-flip__btn {
    position: absolute;
    top: 12px; right: 12px;
    z-index: 3;
    width: 26px; height: 26px;
    border: 0;
    border-radius: 8px;
    background: rgba(255, 255, 255, .16);
    color: #FFFFFF;
    font-size: .7rem;
    cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
    transition: background-color .18s ease, transform .3s ease;
}
.ay-flip__btn:hover { background: rgba(255, 255, 255, .32); transform: rotate(180deg); }
.ay-flip__face--back .ay-flip__btn { background: rgba(255, 255, 255, .12); }


/* -----------------------------------------------------------------------------
   24. ENTRANCE + MOTION
   Panels rise in on load, staggered by --i. Purely additive: the content is in
   the markup and readable by anything that ignores the animation.
   -------------------------------------------------------------------------- */
@keyframes ay-rise {
    from { opacity: 0; transform: translateY(14px) scale(.985); }
    to   { opacity: 1; transform: none; }
}
.ay-rise {
    animation: ay-rise .5s cubic-bezier(.22, .8, .3, 1) both;
    animation-delay: calc(var(--i, 0) * 55ms);
}

@keyframes ay-shimmer { from { background-position: -420px 0; } to { background-position: 420px 0; } }
.ay-skeleton {
    background: linear-gradient(90deg, #EDF1F7 0%, #F7FAFF 40%, #EDF1F7 80%);
    background-size: 420px 100%;
    animation: ay-shimmer 1.25s linear infinite;
    border-radius: var(--ay-r-sm);
    height: 12px;
}

/* Stage bars fill from zero when the panel appears. */
@keyframes ay-grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.ay-pipeline__seg { transform-origin: left center; animation: ay-grow .8s cubic-bezier(.22, .8, .3, 1) both; }


/* -----------------------------------------------------------------------------
   25. RADIAL GAUGE
   A conic-gradient ring. No library, no canvas, and it prints.
   -------------------------------------------------------------------------- */
.ay-gauge {
    --pct: 0;
    --gauge-color: var(--ay-success);
    position: relative;
    width: var(--gauge-size, 132px);
    height: var(--gauge-size, 132px);
    border-radius: 50%;
    flex: 0 0 auto;
    background: conic-gradient(var(--gauge-color) calc(var(--pct) * 1%), #E9EEF6 0);
    display: grid;
    place-items: center;
}
.ay-gauge::after {
    content: "";
    position: absolute;
    inset: 12px;
    border-radius: 50%;
    background: var(--ay-surface);
    box-shadow: inset 0 1px 4px rgba(20, 34, 78, .10);
}
.ay-gauge__inner { position: relative; z-index: 1; text-align: center; }
.ay-gauge__pct {
    font-size: 1.55rem; font-weight: 800; color: var(--ay-ink);
    line-height: 1; letter-spacing: -.035em;
    font-variant-numeric: tabular-nums;
}
.ay-gauge__cap {
    font-size: .66rem; font-weight: 700; color: var(--ay-faint);
    letter-spacing: .06em; text-transform: uppercase; margin-top: 3px;
}


/* -----------------------------------------------------------------------------
   26. LIVE STATUS STRIP
   The horizontal band of small status cards — the reference dashboard's best
   idea, rebuilt with readable colour and a live pulse on the active states.
   -------------------------------------------------------------------------- */
.ay-statusstrip {
    display: grid;
    /* Auto-fit alone left a ragged 10 + 2 wrap on a wide screen. A fixed six
       columns makes twelve states read as two clean rows instead. */
    grid-template-columns: repeat(auto-fit, minmax(116px, 1fr));
    gap: 10px;
}
@media (min-width: 1200px) {
    .ay-statusstrip { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}
.ay-status {
    position: relative;
    border: 1px solid var(--ay-line);
    border-radius: var(--ay-r);
    background: var(--ay-surface);
    padding: 12px 13px 11px;
    text-align: left;
    width: 100%;
    cursor: pointer;
    overflow: hidden;
    transition: transform .2s cubic-bezier(.34, 1.4, .64, 1), box-shadow .2s ease, border-color .2s ease;
}
.ay-status::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 3px;
    background: var(--ay-status-accent, var(--ay-slate));
}
.ay-status:hover {
    transform: translateY(-3px);
    box-shadow: var(--ay-shadow-md);
    border-color: #C9D4E6;
}
.ay-status__label {
    display: flex; align-items: center; gap: 6px;
    font-size: .72rem; font-weight: 700;
    color: var(--ay-muted);
    line-height: 1.25;
    min-height: 2.4em;
}
.ay-status__value {
    font-size: 1.55rem; font-weight: 800; line-height: 1;
    color: var(--ay-status-accent, var(--ay-ink));
    letter-spacing: -.035em;
    margin-top: 6px;
    font-variant-numeric: tabular-nums;
}
.ay-status--live .ay-status__label::before {
    content: "";
    width: 7px; height: 7px; border-radius: 50%;
    background: var(--ay-status-accent);
    flex: 0 0 7px;
    animation: ay-blink 1.6s ease-in-out infinite;
}
.ay-status--slate   { --ay-status-accent: var(--ay-slate); }
.ay-status--teal    { --ay-status-accent: var(--ay-teal); }
.ay-status--success { --ay-status-accent: var(--ay-success); }
.ay-status--danger  { --ay-status-accent: var(--ay-danger); }
.ay-status--warning { --ay-status-accent: var(--ay-warning); }
.ay-status--violet  { --ay-status-accent: var(--ay-violet); }
.ay-status--magenta { --ay-status-accent: var(--ay-magenta); }
.ay-status--brand   { --ay-status-accent: var(--ay-brand-700); }


/* -----------------------------------------------------------------------------
   27. MOTION OPT-OUT (expressive layer)
   Everything in Part Two is decoration. Someone who has asked their OS for less
   motion gets the same information with none of it.
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    .ay-rise { animation: none; opacity: 1; transform: none; }
    .ay-pipeline__seg { animation: none; transform: none; }
    .ay-tile.is-urgent { animation: none; }
    .ay-tile::after { display: none; }
    .ay-tile:hover, .ay-status:hover { transform: none; }
    .ay-tile:hover .ay-tile__icon { transform: none; }
    .ay-skeleton { animation: none; }
    /* A flip with no rotation still has to swap faces, so hide/show instead. */
    .ay-flip__inner { transition: none; }
    .ay-flip.is-flipped .ay-flip__inner { transform: none; }
    .ay-flip.is-flipped .ay-flip__face--front { visibility: hidden; }
    .ay-flip__face--back { transform: none; visibility: hidden; }
    .ay-flip.is-flipped .ay-flip__face--back { visibility: visible; }
}

@media print {
    .ay-tile, .ay-status { box-shadow: none !important; }
    .ay-tile::after, .ay-tile__spark { display: none; }
    .ay-flip { height: auto; }
    .ay-flip__inner { transform: none !important; }
    .ay-flip__face { position: static; }
    .ay-flip__face--back { display: none; }
}


/* =============================================================================
   PART THREE — DEPTH, DATA AND DARK
   -----------------------------------------------------------------------------
   Bento layout, hand-drawn SVG charts, pointer-tracked 3D tilt, hover-expand
   panels, a command palette, and a full dark theme for night-shift operations.

   No charting library. Every graph here is inline SVG generated from the same
   server-rendered numbers that appear as text elsewhere on the page, so the
   charts print, scale, theme themselves, and cannot disagree with the tiles.

   The dark theme is driven by data-ay-theme on <html> — deliberately NOT
   data-bs-theme, which the Admin header pins to "light" with a MutationObserver.
   Ours is a separate axis, so the two never fight.
   ============================================================================= */


/* -----------------------------------------------------------------------------
   28. AMBIENT PAGE WASH
   Two very faint brand-tinted glows behind the whole page, so a long dashboard
   does not read as a flat grey sheet. Fixed, non-interactive, and behind the
   content's own stacking context.
   -------------------------------------------------------------------------- */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background:
        radial-gradient(50rem 28rem at 10% -10%, rgba(46, 82, 176, .09), transparent 60%),
        radial-gradient(42rem 26rem at 94% 2%, rgba(193, 21, 116, .055), transparent 62%);
}
.ay-shell { position: relative; z-index: 1; }


/* -----------------------------------------------------------------------------
   30. BENTO GRID
   A 12-column bed. Panels claim spans, so the page reads as a composed layout
   rather than a stack of equal boxes.
   -------------------------------------------------------------------------- */
.ay-bento {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 16px;
    align-items: stretch;
}
.ay-bento > .sp3  { grid-column: span 3; }
.ay-bento > .sp4  { grid-column: span 4; }
.ay-bento > .sp5  { grid-column: span 5; }
.ay-bento > .sp6  { grid-column: span 6; }
.ay-bento > .sp7  { grid-column: span 7; }
.ay-bento > .sp8  { grid-column: span 8; }
.ay-bento > .sp9  { grid-column: span 9; }
.ay-bento > .sp12 { grid-column: span 12; }

@media (max-width: 1399.98px) {
    .ay-bento > .sp3 { grid-column: span 6; }
    .ay-bento > .sp4 { grid-column: span 6; }
    .ay-bento > .sp5 { grid-column: span 12; }
    .ay-bento > .sp7 { grid-column: span 12; }
    .ay-bento > .sp8 { grid-column: span 12; }
    .ay-bento > .sp9 { grid-column: span 12; }
}
@media (max-width: 767.98px) {
    .ay-bento > [class*="sp"] { grid-column: span 12; }
}


/* -----------------------------------------------------------------------------
   31. 3D TILT + LAYERED DEPTH
   The tilt angle is written by JS as --rx/--ry; with no JS it is simply flat.
   -------------------------------------------------------------------------- */
.ay-tilt {
    transform-style: preserve-3d;
    transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
    transition: transform .18s ease-out;
    will-change: transform;
}
.ay-tilt.is-resting { transition: transform .5s cubic-bezier(.22, .8, .3, 1); }
/* Content lifted off the surface so the parallax is visible while tilting. */
.ay-tilt .ay-lift-1 { transform: translateZ(18px); }
.ay-tilt .ay-lift-2 { transform: translateZ(34px); }

/* A specular highlight that tracks the pointer (--mx/--my written by JS). */
.ay-gloss::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 2;
    border-radius: inherit;
    pointer-events: none;
    opacity: 0;
    background: radial-gradient(22rem 22rem at var(--mx, 50%) var(--my, 50%), rgba(255,255,255,.22), transparent 45%);
    transition: opacity .25s ease;
}
.ay-gloss:hover::after { opacity: 1; }


/* -----------------------------------------------------------------------------
   32. HOVER-EXPAND PANEL
   Collapsed the panel shows its headline; on hover or focus-within it grows to
   reveal the detail rows. Uses grid-template-rows 0fr->1fr, which animates
   smoothly without a hard-coded max-height that clips longer content.
   -------------------------------------------------------------------------- */
.ay-expand__more {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows .42s cubic-bezier(.22, .8, .3, 1), opacity .3s ease;
    opacity: 0;
}
.ay-expand__more > * { overflow: hidden; min-height: 0; }
.ay-expand:hover .ay-expand__more,
.ay-expand:focus-within .ay-expand__more,
.ay-expand.is-open .ay-expand__more {
    grid-template-rows: 1fr;
    opacity: 1;
}
.ay-expand__cue {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: .72rem; font-weight: 700; color: var(--ay-faint);
    transition: color .2s ease;
}
.ay-expand:hover .ay-expand__cue { color: var(--ay-brand-700); }
.ay-expand__cue i { transition: transform .3s ease; }
.ay-expand:hover .ay-expand__cue i { transform: rotate(180deg); }


/* -----------------------------------------------------------------------------
   33. COLUMN CHART (inline SVG)
   -------------------------------------------------------------------------- */
.ay-chart { width: 100%; display: block; overflow: visible; }
.ay-chart .grid line { stroke: var(--ay-line-soft); stroke-width: 1; }
.ay-chart .axis text { fill: var(--ay-faint); font-size: 8px; font-weight: 600; }

.ay-chart .col { transition: opacity .18s ease; cursor: pointer; }
.ay-chart .col rect { transform-origin: center bottom; animation: ay-grow-y .75s cubic-bezier(.22,.8,.3,1) both; }
.ay-chart .col rect { animation-delay: calc(var(--i, 0) * 26ms); }
@keyframes ay-grow-y { from { transform: scaleY(0); } to { transform: scaleY(1); } }
.ay-chart:hover .col { opacity: .42; }
.ay-chart .col:hover { opacity: 1; }
.ay-chart .col:hover rect { filter: brightness(1.14); }
.ay-chart .colhit { fill: transparent; }

.ay-legend { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 12px; }
.ay-legend__item { display: inline-flex; align-items: center; gap: 7px; font-size: .76rem; font-weight: 600; color: var(--ay-muted); }
.ay-legend__dot { width: 10px; height: 10px; border-radius: 3px; flex: 0 0 10px; }


/* -----------------------------------------------------------------------------
   34. DONUT (inline SVG)
   Segments grow on hover — the "expand" the reference dashboard's flat pie has
   no equivalent of.
   -------------------------------------------------------------------------- */
.ay-donut { position: relative; display: grid; place-items: center; }
.ay-donut svg { transform: rotate(-90deg); overflow: visible; }
.ay-donut circle.seg {
    fill: none;
    stroke-linecap: butt;
    transform-origin: center;
    transition: stroke-width .22s ease, opacity .22s ease;
    cursor: pointer;
    animation: ay-dash 1.05s cubic-bezier(.22,.8,.3,1) both;
}
@keyframes ay-dash { from { stroke-dasharray: 0 100; } }
.ay-donut:hover circle.seg { opacity: .45; }
.ay-donut circle.seg:hover { opacity: 1; stroke-width: 15; }
.ay-donut__center {
    position: absolute;
    text-align: center;
    pointer-events: none;
}
.ay-donut__big { font-size: 1.7rem; font-weight: 800; letter-spacing: -.04em; color: var(--ay-ink); line-height: 1; font-variant-numeric: tabular-nums; }
.ay-donut__cap { font-size: .66rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--ay-faint); margin-top: 4px; }


/* -----------------------------------------------------------------------------
   35. RANKED HORIZONTAL BARS
   -------------------------------------------------------------------------- */
.ay-rank { display: flex; flex-direction: column; gap: 13px; }
.ay-rank__row { display: grid; grid-template-columns: 22px 1fr auto; align-items: center; gap: 11px; }
.ay-rank__pos {
    width: 22px; height: 22px; border-radius: 7px;
    display: grid; place-items: center;
    font-size: .68rem; font-weight: 800;
    background: var(--ay-slate-50); color: var(--ay-slate-ink);
}
.ay-rank__row:nth-child(1) .ay-rank__pos { background: linear-gradient(140deg, #B45309, #F59E0B); color: #FFFFFF; }
.ay-rank__row:nth-child(2) .ay-rank__pos { background: linear-gradient(140deg, #475467, #98A2B3); color: #FFFFFF; }
.ay-rank__row:nth-child(3) .ay-rank__pos { background: linear-gradient(140deg, #7A3E12, #B07B4A); color: #FFFFFF; }
.ay-rank__body { min-width: 0; }
.ay-rank__top { display: flex; align-items: baseline; gap: 8px; margin-bottom: 5px; }
.ay-rank__name { font-size: .82rem; font-weight: 700; color: var(--ay-ink); }
.ay-rank__meta { font-size: .72rem; color: var(--ay-faint); margin-left: auto; }
.ay-rank__track { height: 8px; border-radius: var(--ay-r-pill); background: var(--ay-slate-50); overflow: hidden; }
.ay-rank__fill {
    height: 100%;
    border-radius: var(--ay-r-pill);
    background: linear-gradient(90deg, var(--ay-brand-700), var(--ay-brand-500));
    transform-origin: left center;
    animation: ay-grow .9s cubic-bezier(.22,.8,.3,1) both;
    animation-delay: calc(var(--i, 0) * 90ms);
}
.ay-rank__fill--good { background: linear-gradient(90deg, #027A48, #34C77B); }
.ay-rank__fill--warn { background: linear-gradient(90deg, #B54708, #F59E0B); }
.ay-rank__fill--bad  { background: linear-gradient(90deg, #B42318, #F04438); }
.ay-rank__score { font-size: .95rem; font-weight: 800; color: var(--ay-ink); font-variant-numeric: tabular-nums; }


/* -----------------------------------------------------------------------------
   36. ACTIVITY TIMELINE
   -------------------------------------------------------------------------- */
.ay-timeline { position: relative; padding-left: 26px; }
.ay-timeline::before {
    content: "";
    position: absolute;
    left: 8px; top: 6px; bottom: 6px;
    width: 2px;
    background: linear-gradient(180deg, var(--ay-line) 0%, var(--ay-line-soft) 100%);
}
.ay-tl { position: relative; padding: 0 0 15px; }
.ay-tl:last-child { padding-bottom: 0; }
.ay-tl__node {
    position: absolute;
    left: -26px; top: 2px;
    width: 18px; height: 18px;
    border-radius: 50%;
    display: grid; place-items: center;
    font-size: .55rem;
    color: #FFFFFF;
    background: var(--ay-slate);
    box-shadow: 0 0 0 3px var(--ay-surface);
}
.ay-tl--danger  .ay-tl__node { background: var(--ay-danger); }
.ay-tl--warning .ay-tl__node { background: var(--ay-warning); }
.ay-tl--success .ay-tl__node { background: var(--ay-success); }
.ay-tl--info    .ay-tl__node { background: var(--ay-info); }
.ay-tl--live .ay-tl__node { animation: ay-halo-node 2.2s ease-in-out infinite; }
@keyframes ay-halo-node {
    0%, 100% { box-shadow: 0 0 0 3px var(--ay-surface), 0 0 0 3px rgba(180,35,24,.45); }
    50%      { box-shadow: 0 0 0 3px var(--ay-surface), 0 0 0 9px rgba(180,35,24,0); }
}
.ay-tl__title { font-size: .83rem; font-weight: 700; color: var(--ay-ink); }
.ay-tl__meta { font-size: .74rem; color: var(--ay-faint); margin-top: 2px; }


/* -----------------------------------------------------------------------------
   37. COMMAND PALETTE
   -------------------------------------------------------------------------- */
.ay-cmdk-trigger {
    display: inline-flex; align-items: center; gap: 9px;
    border: 1px solid var(--ay-line);
    background: var(--ay-surface);
    color: var(--ay-faint);
    border-radius: var(--ay-r-pill);
    padding: 7px 9px 7px 14px;
    font-size: .8rem; font-weight: 600;
    cursor: pointer;
    box-shadow: var(--ay-shadow-xs);
    transition: border-color .18s ease, color .18s ease, box-shadow .18s ease;
}
.ay-cmdk-trigger:hover { border-color: var(--ay-brand-500); color: var(--ay-brand-700); box-shadow: var(--ay-shadow-sm); }
.ay-kbd {
    font-family: var(--ay-font);
    font-size: .68rem; font-weight: 700;
    border: 1px solid var(--ay-line);
    border-bottom-width: 2px;
    border-radius: 6px;
    padding: 2px 6px;
    color: var(--ay-muted);
    background: var(--ay-surface-2);
}

.ay-cmdk {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding: 12vh 16px 16px;
    background: rgba(10, 17, 32, .55);
    backdrop-filter: blur(6px);
}
.ay-cmdk.is-open { display: flex; animation: ay-fade .18s ease both; }
@keyframes ay-fade { from { opacity: 0; } to { opacity: 1; } }

.ay-cmdk__panel {
    width: min(620px, 100%);
    background: var(--ay-surface);
    border: 1px solid var(--ay-line);
    border-radius: var(--ay-r-lg);
    box-shadow: var(--ay-shadow-lg);
    overflow: hidden;
    animation: ay-rise .24s cubic-bezier(.22,.8,.3,1) both;
}
.ay-cmdk__field { display: flex; align-items: center; gap: 11px; padding: 15px 18px; border-bottom: 1px solid var(--ay-line-soft); }
.ay-cmdk__field i { color: var(--ay-faint); }
.ay-cmdk__field input {
    flex: 1; border: 0; outline: none; background: transparent;
    font-family: var(--ay-font); font-size: 1rem; font-weight: 500; color: var(--ay-ink);
}
.ay-cmdk__field input::placeholder { color: var(--ay-faint); }
.ay-cmdk__list { max-height: 46vh; overflow-y: auto; padding: 7px; }
.ay-cmdk__group { font-size: .66rem; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; color: var(--ay-faint); padding: 9px 11px 5px; }
.ay-cmdk__item {
    display: flex; align-items: center; gap: 12px;
    width: 100%; text-align: left;
    border: 0; background: transparent;
    padding: 10px 11px;
    border-radius: var(--ay-r-sm);
    cursor: pointer;
    font-size: .86rem; font-weight: 600; color: var(--ay-ink-2);
}
.ay-cmdk__item:hover, .ay-cmdk__item.is-active { background: var(--ay-brand-50); color: var(--ay-brand-800); }
.ay-cmdk__item .ico {
    width: 28px; height: 28px; flex: 0 0 28px;
    border-radius: 9px; display: grid; place-items: center;
    background: var(--ay-slate-50); color: var(--ay-slate-ink); font-size: .78rem;
}
.ay-cmdk__item .hint { margin-left: auto; font-size: .72rem; color: var(--ay-faint); font-weight: 500; }
.ay-cmdk__foot {
    display: flex; align-items: center; gap: 14px;
    padding: 10px 18px;
    border-top: 1px solid var(--ay-line-soft);
    background: var(--ay-surface-2);
    font-size: .72rem; color: var(--ay-faint);
}


/* -----------------------------------------------------------------------------
   38. TOASTS
   -------------------------------------------------------------------------- */
.ay-toasts { position: fixed; right: 18px; bottom: 18px; z-index: 2100; display: flex; flex-direction: column; gap: 10px; }
.ay-toast {
    display: flex; align-items: flex-start; gap: 11px;
    min-width: 270px; max-width: 380px;
    background: var(--ay-surface);
    border: 1px solid var(--ay-line);
    border-left: 4px solid var(--ay-brand-600);
    border-radius: var(--ay-r);
    box-shadow: var(--ay-shadow-lg);
    padding: 13px 15px;
    animation: ay-toast-in .3s cubic-bezier(.22,.8,.3,1) both;
}
@keyframes ay-toast-in { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }
.ay-toast--danger  { border-left-color: var(--ay-danger); }
.ay-toast--success { border-left-color: var(--ay-success); }
.ay-toast--warning { border-left-color: var(--ay-warning); }
.ay-toast__title { font-size: .84rem; font-weight: 700; color: var(--ay-ink); }
.ay-toast__msg { font-size: .78rem; color: var(--ay-muted); margin-top: 2px; }


/* -----------------------------------------------------------------------------
   39. SEGMENTED CONTROL
   -------------------------------------------------------------------------- */
.ay-seg { display: inline-flex; background: var(--ay-slate-50); border-radius: var(--ay-r-pill); padding: 3px; gap: 2px; }
.ay-seg button {
    border: 0; background: transparent;
    font-size: .75rem; font-weight: 700; color: var(--ay-muted);
    padding: 6px 14px; border-radius: var(--ay-r-pill); cursor: pointer;
    transition: background-color .18s ease, color .18s ease, box-shadow .18s ease;
}
.ay-seg button.is-active { background: var(--ay-surface); color: var(--ay-brand-800); box-shadow: var(--ay-shadow-xs); }


/* -----------------------------------------------------------------------------
   40. MOTION OPT-OUT (part three)
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    .ay-chart .col rect,
    .ay-donut circle.seg,
    .ay-rank__fill { animation: none; transform: none; stroke-dasharray: revert; }
    .ay-tilt { transform: none !important; transition: none; }
    .ay-gloss::after { display: none; }
    .ay-expand__more { transition: none; }
    .ay-tl--live .ay-tl__node { animation: none; }
    .ay-cmdk.is-open, .ay-cmdk__panel, .ay-toast { animation: none; }
}


/* =============================================================================
   PART FOUR — VIVID DATA
   -----------------------------------------------------------------------------
   The first pass drew flat bars. This one gives every graph gradient fills,
   a soft glow, a draw-on animation and real hover feedback, and adds three
   chart types the dashboard did not have: concentric activity rings, a demand
   heatmap, and a gradient area trace.

   Still inline SVG, still no charting library. The colours are the SAME verified
   ramp used everywhere else — a gradient between two measured stops is safe as
   long as no text sits on it, and no text sits on a chart fill.
   ============================================================================= */


/* -----------------------------------------------------------------------------
   41. CHART CHROME
   -------------------------------------------------------------------------- */
.ay-chartwrap { position: relative; }

.ay-chart .grid line { stroke: var(--ay-line-soft); stroke-width: 1; stroke-dasharray: 2 4; }
.ay-chart .axis text { fill: var(--ay-faint); font-size: 9px; font-weight: 700; letter-spacing: .04em; }
.ay-chart .baseline { stroke: var(--ay-line); stroke-width: 1.5; }

/* Bars: grow up from the axis, then glow when the column is hovered. */
.ay-chart .bar {
    transform-origin: center bottom;
    animation: ay-grow-y .8s cubic-bezier(.22, .8, .3, 1) both;
    animation-delay: calc(var(--i, 0) * 24ms);
    transition: filter .2s ease;
}
@keyframes ay-grow-y { from { transform: scaleY(0); } to { transform: scaleY(1); } }

.ay-chart .col { cursor: pointer; }
.ay-chart .col .halo { opacity: 0; transition: opacity .2s ease; }
.ay-chart .col:hover .halo { opacity: 1; }
.ay-chart .col:hover .bar { filter: url(#ayGlow) brightness(1.1); }
.ay-chart .colhit { fill: transparent; }

/* The completion trace draws itself in. */
.ay-chart .trace {
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: var(--len, 2000);
    stroke-dashoffset: var(--len, 2000);
    animation: ay-draw 1.5s cubic-bezier(.22, .8, .3, 1) .35s forwards;
    filter: url(#ayGlowSoft);
}
@keyframes ay-draw { to { stroke-dashoffset: 0; } }

.ay-chart .tracearea {
    opacity: 0;
    animation: ay-fadein .8s ease 1.1s forwards;
}
@keyframes ay-fadein { to { opacity: 1; } }

.ay-chart .dot {
    opacity: 0;
    animation: ay-pop .35s cubic-bezier(.34, 1.6, .64, 1) both;
    animation-delay: calc(1.05s + var(--i, 0) * 30ms);
    transform-box: fill-box;
    transform-origin: center;
}
@keyframes ay-pop { from { opacity: 0; transform: scale(0); } to { opacity: 1; transform: scale(1); } }


/* -----------------------------------------------------------------------------
   42. CONCENTRIC ACTIVITY RINGS
   Three metrics in one dial. Each ring sweeps from zero on load.
   -------------------------------------------------------------------------- */
.ay-rings { position: relative; display: grid; place-items: center; }
.ay-rings svg { transform: rotate(-90deg); overflow: visible; }
.ay-rings .track { fill: none; stroke: var(--ay-line-soft); }
.ay-rings .ring {
    fill: none;
    stroke-linecap: round;
    stroke-dasharray: var(--c) var(--c);
    stroke-dashoffset: var(--c);
    animation: ay-sweep 1.25s cubic-bezier(.22, .8, .3, 1) both;
    animation-delay: calc(var(--i, 0) * 140ms);
    filter: url(#ayGlowSoft);
    transition: stroke-width .2s ease;
    cursor: pointer;
}
@keyframes ay-sweep { to { stroke-dashoffset: var(--off); } }
.ay-rings .ring:hover { stroke-width: 15; }

.ay-rings__center { position: absolute; text-align: center; pointer-events: none; }
.ay-rings__big {
    font-size: 1.75rem; font-weight: 800; letter-spacing: -.04em;
    color: var(--ay-ink); line-height: 1; font-variant-numeric: tabular-nums;
}
.ay-rings__cap {
    font-size: .64rem; font-weight: 700; letter-spacing: .08em;
    text-transform: uppercase; color: var(--ay-faint); margin-top: 4px;
}

.ay-ringkey { display: grid; gap: 10px; }
.ay-ringkey__row { display: flex; align-items: center; gap: 9px; font-size: .8rem; }
.ay-ringkey__dot { width: 10px; height: 10px; border-radius: 999px; flex: 0 0 10px; }
.ay-ringkey__label { color: var(--ay-muted); font-weight: 600; flex: 1; min-width: 0; }
.ay-ringkey__val { font-weight: 800; color: var(--ay-ink); font-variant-numeric: tabular-nums; }


/* -----------------------------------------------------------------------------
   43. DEMAND HEATMAP
   Seven days by hour. Reads the shape of a week at a glance — which the tiles,
   which are all "right now", cannot show at all.
   -------------------------------------------------------------------------- */
.ay-heat { display: grid; gap: 8px; }
.ay-heat__grid {
    display: grid;
    grid-template-columns: 34px repeat(24, minmax(0, 1fr));
    gap: 3px;
    align-items: center;
}
.ay-heat__daylabel {
    font-size: .66rem; font-weight: 700; color: var(--ay-faint);
    text-transform: uppercase; letter-spacing: .05em;
}
.ay-heat__cell {
    aspect-ratio: 1 / 1;
    border-radius: 3px;
    background: var(--cell, #EEF3FF);
    cursor: pointer;
    transition: transform .16s cubic-bezier(.34, 1.5, .64, 1), box-shadow .16s ease;
    animation: ay-cellin .4s ease both;
    animation-delay: calc(var(--i, 0) * 3ms);
}
@keyframes ay-cellin { from { opacity: 0; transform: scale(.4); } to { opacity: 1; transform: scale(1); } }
.ay-heat__cell:hover {
    transform: scale(1.55);
    box-shadow: 0 4px 12px -2px rgba(20, 34, 78, .4);
    position: relative;
    z-index: 2;
}
.ay-heat__hours {
    display: grid;
    grid-template-columns: 34px repeat(24, minmax(0, 1fr));
    gap: 3px;
    font-size: .6rem; font-weight: 700; color: var(--ay-faint);
    text-align: center;
}
.ay-heat__scale { display: flex; align-items: center; gap: 7px; font-size: .7rem; color: var(--ay-faint); font-weight: 600; }
.ay-heat__swatches { display: flex; gap: 3px; }
.ay-heat__swatches i { width: 13px; height: 13px; border-radius: 3px; display: block; }


/* -----------------------------------------------------------------------------
   44. DEPTH CARD
   A card that lifts on hover with a layered shadow and a colour bleed, so the
   page has a foreground and a background rather than one flat plane.
   -------------------------------------------------------------------------- */
.ay-depth {
    position: relative;
    transition: transform .3s cubic-bezier(.34, 1.25, .64, 1), box-shadow .3s ease;
}
.ay-depth::after {
    content: "";
    position: absolute;
    left: 8%; right: 8%;
    bottom: -8px;
    height: 18px;
    border-radius: 50%;
    background: var(--ay-depth-color, rgba(20, 34, 78, .30));
    filter: blur(14px);
    opacity: 0;
    transition: opacity .3s ease, transform .3s ease;
    z-index: -1;
}
.ay-depth:hover { transform: translateY(-4px); box-shadow: var(--ay-shadow-lg); }
.ay-depth:hover::after { opacity: .55; transform: translateY(3px); }


/* -----------------------------------------------------------------------------
   45. FLIP AFFORDANCE
   The corner button alone was too quiet to find. A labelled bar slides up from
   the bottom edge on hover, and the whole bar is the flip target.
   -------------------------------------------------------------------------- */
.ay-flip__cue {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    z-index: 4;
    display: flex; align-items: center; justify-content: center; gap: 8px;
    border: 0;
    padding: 9px 12px;
    font-family: inherit;
    font-size: .72rem; font-weight: 700; letter-spacing: .02em;
    color: #FFFFFF;
    background: rgba(0, 0, 0, .34);
    backdrop-filter: blur(4px);
    cursor: pointer;
    transform: translateY(100%);
    transition: transform .28s cubic-bezier(.22, .8, .3, 1);
}
.ay-flip:hover .ay-flip__cue,
.ay-flip:focus-within .ay-flip__cue { transform: translateY(0); }
.ay-flip__cue i { transition: transform .3s ease; }
.ay-flip__cue:hover i { transform: rotate(180deg); }

/* Touch has no hover, so the cue is simply always visible there. */
@media (pointer: coarse) {
    .ay-flip__cue { transform: translateY(0); }
}


/* -----------------------------------------------------------------------------
   46. LIVING GRADIENT
   A very slow drift across the hero tiles, so the row is never quite static.
   16 seconds is deliberately below the threshold where it reads as motion.
   -------------------------------------------------------------------------- */
.ay-tile {
    background-size: 190% 190%;
    animation: ay-drift 16s ease-in-out infinite;
}
@keyframes ay-drift {
    0%, 100% { background-position: 0% 50%; }
    50%      { background-position: 100% 50%; }
}


/* -----------------------------------------------------------------------------
   47. MINI STAT STRIP inside a card foot
   -------------------------------------------------------------------------- */
.ay-ministats { display: grid; grid-auto-flow: column; gap: 0; }
.ay-ministat { padding: 0 14px; border-left: 1px solid var(--ay-line-soft); }
.ay-ministat:first-child { padding-left: 0; border-left: 0; }
.ay-ministat__k { font-size: .68rem; font-weight: 700; color: var(--ay-faint); text-transform: uppercase; letter-spacing: .05em; }
.ay-ministat__v { font-size: 1.05rem; font-weight: 800; color: var(--ay-ink); font-variant-numeric: tabular-nums; margin-top: 2px; }


/* -----------------------------------------------------------------------------
   48. MOTION OPT-OUT (part four)
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    .ay-chart .bar,
    .ay-chart .dot,
    .ay-heat__cell { animation: none; transform: none; opacity: 1; }
    .ay-chart .trace { animation: none; stroke-dashoffset: 0; }
    .ay-chart .tracearea { animation: none; opacity: 1; }
    .ay-rings .ring { animation: none; stroke-dashoffset: var(--off); }
    .ay-tile { animation: none; background-size: 100% 100%; }
    .ay-depth:hover { transform: none; }
    .ay-heat__cell:hover { transform: none; }
    .ay-flip__cue { transform: translateY(0); transition: none; }
}

@media print {
    .ay-flip__cue { display: none; }
    .ay-depth::after { display: none; }
    .ay-tile { animation: none; }
}


/* =============================================================================
   PART FIVE — MATERIAL, MOTION AND CONNECTION
   -----------------------------------------------------------------------------
   Ripples, physical press, a genuinely projected 3D donut, chart morphing,
   expandable rows, and cross-filtering that wires every panel to every other.

   The connection layer is the important one: clicking a hero tile does not just
   look nice, it filters the route board, dims the panels that no longer apply,
   and puts a removable filter chip in the page header. Nothing on this page is
   a dead end.
   ============================================================================= */


/* -----------------------------------------------------------------------------
   49. RIPPLE
   Painted at the exact click point, so the feedback comes from where the finger
   or cursor actually landed rather than from the centre of the control.
   -------------------------------------------------------------------------- */
.ay-ripple-host { position: relative; overflow: hidden; }
.ay-ripple {
    position: absolute;
    border-radius: 50%;
    background: currentColor;
    opacity: .30;
    transform: scale(0);
    pointer-events: none;
    animation: ay-ripple .62s cubic-bezier(.22, .8, .3, 1) forwards;
    z-index: 5;
}
@keyframes ay-ripple {
    to { transform: scale(2.6); opacity: 0; }
}
/* On the dark gradient tiles the ripple has to be white to be seen at all. */
.ay-tile .ay-ripple, .ay-btn3d--solid .ay-ripple { background: #FFFFFF; opacity: .34; }


/* -----------------------------------------------------------------------------
   50. 3D PRESS BUTTON
   A real hard edge underneath the cap. Pressing shortens the edge and moves the
   cap down by exactly the same amount, so the button looks like it is being
   pushed into the page rather than sliding across it.
   -------------------------------------------------------------------------- */
.ay-btn3d {
    --edge: 4px;
    --face: var(--ay-brand-700);
    --base: var(--ay-brand-900);
    /* Foreground lives in a variable so every variant, and the hover rule below,
       can reuse whatever colour that variant actually wants. */
    --btn-fg: #FFFFFF;
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 0;
    border-radius: var(--ay-r-sm);
    padding: 10px 18px;
    font-family: inherit;
    font-size: .82rem;
    font-weight: 700;
    color: var(--btn-fg);
    background: linear-gradient(180deg, color-mix(in srgb, var(--face) 88%, #FFFFFF) 0%, var(--face) 100%);
    box-shadow: 0 var(--edge) 0 0 var(--base), 0 calc(var(--edge) + 5px) 12px -4px rgba(20, 34, 78, .45);
    transform: translateY(0);
    transition: transform .09s ease, box-shadow .09s ease, filter .16s ease;
    cursor: pointer;
    overflow: hidden;
}
.ay-btn3d:hover { filter: brightness(1.07); }
/* An <a> styled as a button must KEEP ITS OWN COLOUR on hover. The generic
   `a:hover { color: var(--ay-brand-900); text-decoration: underline; }` further down
   this file has specificity (0,1,1) and beats `.ay-btn3d` (0,1,0), so without this the
   white label on the navy button turned #14224E on #24408E - navy on navy, about 1.1:1,
   effectively invisible - and picked up an underline it was never meant to have.
   `a.ay-btn3d:hover` is (0,2,1), so it wins without needing !important. */
a.ay-btn3d:hover,
a.ay-btn3d:focus { color: var(--btn-fg); text-decoration: none; }
.ay-btn3d:active {
    transform: translateY(var(--edge));
    box-shadow: 0 0 0 0 var(--base), 0 2px 5px -2px rgba(20, 34, 78, .4);
}
.ay-btn3d--danger  { --face: #B42318; --base: #6E1410; }
.ay-btn3d--success { --face: #027A48; --base: #024A2C; }
.ay-btn3d--slate   { --face: #475467; --base: #2B3442; }
.ay-btn3d--ghost {
    --face: #FFFFFF; --base: #C9D4E6;
    --btn-fg: var(--ay-brand-800);
    color: var(--btn-fg);
    box-shadow: 0 var(--edge) 0 0 var(--base), 0 calc(var(--edge) + 4px) 10px -5px rgba(20, 34, 78, .25);
}

/* Any control can opt into the press without the full 3D treatment. */
.ay-press { transition: transform .09s ease; }
.ay-press:active { transform: scale(.965); }


/* -----------------------------------------------------------------------------
   51. 3D DONUT
   The SVG carries the projection; this rotates the whole assembly a little on
   hover and lifts individual segments along their own bisector.
   -------------------------------------------------------------------------- */
.ay-pie3d {
    position: relative;
    display: grid;
    place-items: center;
    perspective: 900px;
}
.ay-pie3d__svg {
    width: 100%;
    max-width: 260px;
    overflow: visible;
    transform: rotateZ(0deg);
    transition: transform .8s cubic-bezier(.22, .8, .3, 1);
}
.ay-pie3d:hover .ay-pie3d__svg { transform: rotateZ(-8deg); }

.ay-pie3d .p3-wall { transition: opacity .25s ease; }
.ay-pie3d .p3-top {
    cursor: pointer;
    transform-box: fill-box;
    transform-origin: center;
    transition: transform .32s cubic-bezier(.34, 1.35, .64, 1), filter .25s ease;
    animation: ay-p3in .6s cubic-bezier(.22, .8, .3, 1) both;
    animation-delay: calc(var(--i, 0) * 80ms);
}
@keyframes ay-p3in { from { opacity: 0; transform: scale(.7); } to { opacity: 1; transform: none; } }

/* Explode the hovered slice outward, dim the rest. */
.ay-pie3d__svg:hover .p3-top { filter: saturate(.55) brightness(.92); }
.ay-pie3d .p3-top:hover,
.ay-pie3d .p3-top:focus-visible,
.ay-pie3d .p3-top.is-active {
    transform: translate(var(--dx), var(--dy));
    filter: brightness(1.12) drop-shadow(0 6px 12px rgba(20, 34, 78, .45)) !important;
}
.ay-pie3d .p3-sheen { pointer-events: none; mix-blend-mode: screen; }

.ay-pie3d__center {
    position: absolute;
    top: 38%;
    text-align: center;
    pointer-events: none;
}
.ay-pie3d__big {
    font-size: 1.9rem; font-weight: 800; letter-spacing: -.045em;
    color: var(--ay-ink); line-height: 1; font-variant-numeric: tabular-nums;
    text-shadow: 0 2px 8px rgba(255, 255, 255, .9);
}
.ay-pie3d__cap {
    font-size: .64rem; font-weight: 700; letter-spacing: .09em;
    text-transform: uppercase; color: var(--ay-faint); margin-top: 3px;
}

/* Legend rows that drive, and follow, the slice hover. */
.ay-legend2 { display: grid; gap: 6px; }
.ay-legend2__row {
    display: flex; align-items: center; gap: 9px;
    padding: 7px 9px;
    border-radius: var(--ay-r-sm);
    cursor: pointer;
    font-size: .79rem;
    border: 1px solid transparent;
    transition: background-color .16s ease, border-color .16s ease, transform .16s ease;
}
.ay-legend2__row:hover, .ay-legend2__row.is-active {
    background: var(--ay-brand-50);
    border-color: #C7D6FF;
    transform: translateX(3px);
}
.ay-legend2__dot { width: 11px; height: 11px; border-radius: 4px; flex: 0 0 11px; }
.ay-legend2__label { color: var(--ay-muted); font-weight: 600; flex: 1; min-width: 0; }
.ay-legend2__val { font-weight: 800; color: var(--ay-ink); font-variant-numeric: tabular-nums; }
.ay-legend2__pct { font-size: .7rem; color: var(--ay-faint); font-weight: 700; min-width: 34px; text-align: right; }


/* -----------------------------------------------------------------------------
   52. CHART MORPH
   SVG geometry attributes (x/y/width/height) are animatable in CSS, so the same
   rects can BE the bars and then BECOME the points on a line. Nothing is
   crossfaded — the marks physically move.
   -------------------------------------------------------------------------- */
.ay-chart .bar {
    transition: y .62s cubic-bezier(.34, 1.15, .5, 1),
                height .62s cubic-bezier(.34, 1.15, .5, 1),
                x .62s cubic-bezier(.34, 1.15, .5, 1),
                width .62s cubic-bezier(.34, 1.15, .5, 1),
                rx .62s ease,
                opacity .4s ease;
}
.ay-chart.is-line .halo { opacity: 0 !important; }
.ay-chart .trace, .ay-chart .tracearea, .ay-chart .dot { transition: opacity .4s ease; }
.ay-chart.is-bars .trace, .ay-chart.is-bars .tracearea { opacity: .3; }


/* -----------------------------------------------------------------------------
   53. EXPANDABLE TABLE ROW
   The manifest for a route is one click away instead of one page away.
   -------------------------------------------------------------------------- */
table.ay-table tr.ay-row { cursor: pointer; }
table.ay-table tr.ay-row .ay-rowchev { transition: transform .28s ease; color: #B6C2D6; }
table.ay-table tr.ay-row.is-open .ay-rowchev { transform: rotate(90deg); color: var(--ay-brand-600); }
table.ay-table tr.ay-row.is-open > td { background: var(--ay-brand-50); }

table.ay-table tr.ay-rowdetail > td { padding: 0; border-bottom: 1px solid var(--ay-line-soft); }
.ay-rowdetail__inner {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows .38s cubic-bezier(.22, .8, .3, 1);
    background: linear-gradient(180deg, var(--ay-brand-50) 0%, var(--ay-surface) 100%);
}
.ay-rowdetail__inner > div { overflow: hidden; min-height: 0; }
tr.ay-rowdetail.is-open .ay-rowdetail__inner { grid-template-rows: 1fr; }
.ay-rowdetail__pad { padding: 14px 16px 16px; }

/* Passenger manifest chips */
.ay-manifest { display: flex; flex-wrap: wrap; gap: 8px; }
.ay-pax {
    display: inline-flex; align-items: center; gap: 8px;
    border: 1px solid var(--ay-line);
    background: var(--ay-surface);
    border-radius: var(--ay-r-pill);
    padding: 5px 12px 5px 5px;
    font-size: .76rem; font-weight: 600; color: var(--ay-ink-2);
    box-shadow: var(--ay-shadow-xs);
}
.ay-pax__av {
    width: 22px; height: 22px; border-radius: 50%;
    display: grid; place-items: center;
    font-size: .62rem; font-weight: 800;
    background: var(--ay-brand-700); color: #FFFFFF;
}
.ay-pax--done .ay-pax__av { background: var(--ay-success); }
.ay-pax--wait .ay-pax__av { background: var(--ay-warning); }
.ay-pax--miss .ay-pax__av { background: var(--ay-danger); }

/* A route's stop-by-stop progress rail */
.ay-progressrail { display: flex; align-items: center; gap: 0; margin: 12px 0 4px; }
.ay-stop {
    position: relative;
    display: grid; place-items: center;
    width: 22px; height: 22px; border-radius: 50%;
    font-size: .58rem; font-weight: 800;
    background: var(--ay-slate-50); color: var(--ay-slate-ink);
    flex: 0 0 22px;
    z-index: 1;
}
.ay-stop--done { background: var(--ay-success); color: #FFFFFF; }
.ay-stop--now  { background: var(--ay-teal); color: #FFFFFF; animation: ay-halo-node 2s ease-in-out infinite; }
.ay-leg { height: 3px; flex: 1 1 auto; background: var(--ay-line); }
.ay-leg--done { background: var(--ay-success); }


/* -----------------------------------------------------------------------------
   54. CROSS-FILTER
   One click on any tile scopes the whole page. Panels that cannot honour the
   filter are dimmed rather than hidden, so nothing silently disappears.
   -------------------------------------------------------------------------- */
.ay-filterbar {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    background: var(--ay-brand-50);
    border: 1px solid #C7D6FF;
    border-radius: var(--ay-r-pill);
    padding: 8px 8px 8px 16px;
    font-size: .8rem; font-weight: 600; color: var(--ay-brand-800);
    animation: ay-rise .28s cubic-bezier(.22, .8, .3, 1) both;
}
.ay-filterbar[hidden] { display: none; }
.ay-filterbar__clear {
    border: 0; background: var(--ay-brand-700); color: #FFFFFF;
    border-radius: var(--ay-r-pill); padding: 5px 13px;
    font-size: .74rem; font-weight: 700; cursor: pointer;
    display: inline-flex; align-items: center; gap: 6px;
}
.ay-filterbar__clear:hover { background: var(--ay-brand-900); }

.ay-tile.is-selected {
    outline: 3px solid #FFFFFF;
    outline-offset: -3px;
    box-shadow: 0 0 0 3px var(--ay-brand-500), 0 18px 34px -10px rgba(20, 34, 78, .5);
}
.is-dimmed { opacity: .42; filter: saturate(.5); transition: opacity .3s ease, filter .3s ease; }
tr.is-filtered-out { display: none; }


/* -----------------------------------------------------------------------------
   55. LIVE SIMULATION
   A demo mode that walks the numbers so the page can be shown moving. It is
   labelled on screen the entire time it is running — a dashboard that invents
   numbers without saying so is worse than a static one.
   -------------------------------------------------------------------------- */
.ay-simbar {
    display: inline-flex; align-items: center; gap: 10px;
    border-radius: var(--ay-r-pill);
    padding: 7px 8px 7px 14px;
    font-size: .78rem; font-weight: 700;
    border: 1px solid var(--ay-line);
    background: var(--ay-surface);
    color: var(--ay-muted);
    box-shadow: var(--ay-shadow-xs);
}
.ay-simbar.is-on {
    border-color: #F5CFC9;
    background: linear-gradient(100deg, #FFF6F5, #FFFBF3);
    color: var(--ay-warning-ink);
}
.ay-simtoggle {
    border: 0; border-radius: var(--ay-r-pill);
    background: var(--ay-brand-700); color: #FFFFFF;
    font-size: .72rem; font-weight: 700; padding: 5px 13px; cursor: pointer;
}
.ay-simbar.is-on .ay-simtoggle { background: var(--ay-warning); }

/* A value that just changed flashes once, so movement is never missed. */
@keyframes ay-tick {
    0%   { background-color: rgba(59, 103, 212, .34); }
    100% { background-color: transparent; }
}
.ay-ticked { animation: ay-tick .9s ease-out; border-radius: 6px; }

/* Vehicles crawling along a route line — the "simulation" made visible. */
.ay-simtrack {
    position: relative;
    height: 6px;
    border-radius: var(--ay-r-pill);
    background: var(--ay-line-soft);
    overflow: visible;
}
.ay-simtrack__done {
    position: absolute; inset: 0 auto 0 0;
    border-radius: var(--ay-r-pill);
    background: linear-gradient(90deg, var(--ay-brand-700), var(--ay-teal));
    transition: width 1s linear;
}
.ay-simtrack__van {
    position: absolute; top: 50%;
    width: 26px; height: 26px;
    margin: -13px 0 0 -13px;
    border-radius: 50%;
    display: grid; place-items: center;
    background: var(--ay-surface);
    border: 2px solid var(--ay-teal);
    color: var(--ay-teal);
    font-size: .66rem;
    box-shadow: var(--ay-shadow-sm);
    transition: left 1s linear;
    z-index: 2;
}


/* -----------------------------------------------------------------------------
   56. MOTION OPT-OUT (part five)
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    .ay-ripple { display: none; }
    .ay-pie3d__svg, .ay-pie3d .p3-top { transition: none; animation: none; }
    .ay-pie3d:hover .ay-pie3d__svg { transform: none; }
    .ay-chart .bar { transition: none; }
    .ay-rowdetail__inner { transition: none; }
    .ay-ticked { animation: none; }
    .ay-simtrack__done, .ay-simtrack__van { transition: none; }
    .ay-stop--now { animation: none; }
}

@media print {
    .ay-filterbar, .ay-simbar { display: none !important; }
    .is-dimmed { opacity: 1; filter: none; }
    tr.ay-rowdetail { display: none; }
}


/* =============================================================================
   PART SIX — ANIMATION SAFETY GATE, AND THE 3D DEMAND PANEL
   ============================================================================= */


/* -----------------------------------------------------------------------------
   57. THE ANIMATION SAFETY GATE  ***read this before adding any animation***
   -----------------------------------------------------------------------------
   Every entrance animation in this file was written as
       animation: fade-in .5s both;
   whose keyframes start at opacity:0 / scale(0) / a full stroke-dashoffset.
   `both` applies the FROM state before the animation starts — so if the
   animation never runs, the element stays in its hidden start state and the
   content is simply GONE, with no error anywhere.

   That is not hypothetical. Animations do not run in an embedded preview or
   thumbnail renderer, in a backgrounded tab, in some print paths, or anywhere
   the page is rasterised rather than displayed. It hid the top of this
   dashboard in exactly that way.

   THE RULE, from here on: the DEFAULT state of every element is fully visible.
   Entrance animations apply only under html.ay-anim, which ayaka-theme.js adds
   the moment it parses. No JavaScript, no animation, no problem — the page
   simply renders finished instead of animating into place.

   This block comes last on purpose, so it wins over the Part 2-5 declarations.
   -------------------------------------------------------------------------- */

/* --- default: the finished state, no animation ------------------------------ */
.ay-rise,
.ay-cmdk__panel,
.ay-filterbar {
    animation: none;
    opacity: 1;
    transform: none;
}
.ay-pipeline__seg,
.ay-rank__fill,
.ay-chart .bar,
.ay-chart .face-front,
.ay-chart3d .col3d {
    animation: none;
    transform: none;
    opacity: 1;
}
.ay-chart .trace,
.ay-chart .trace3d {
    animation: none;
    stroke-dashoffset: 0;
}
.ay-chart .tracearea,
.ay-chart .dot,
.ay-chart .dot3d,
.ay-heat__cell,
.ay-pie3d .p3-top {
    animation: none;
    opacity: 1;
    transform: none;
}
.ay-donut circle.seg { animation: none; }
.ay-rings .ring {
    animation: none;
    stroke-dashoffset: var(--off);   /* the ANSWER, not the empty ring */
}

/* --- with JS present: animate in -------------------------------------------- */
html.ay-anim .ay-rise {
    animation: ay-rise .5s cubic-bezier(.22, .8, .3, 1) both;
    animation-delay: calc(var(--i, 0) * 55ms);
}
html.ay-anim .ay-cmdk__panel { animation: ay-rise .24s cubic-bezier(.22, .8, .3, 1) both; }
html.ay-anim .ay-filterbar   { animation: ay-rise .28s cubic-bezier(.22, .8, .3, 1) both; }

html.ay-anim .ay-pipeline__seg {
    transform-origin: left center;
    animation: ay-grow .8s cubic-bezier(.22, .8, .3, 1) both;
}
html.ay-anim .ay-rank__fill {
    transform-origin: left center;
    animation: ay-grow .9s cubic-bezier(.22, .8, .3, 1) both;
    animation-delay: calc(var(--i, 0) * 90ms);
}
html.ay-anim .ay-chart .bar {
    transform-origin: center bottom;
    animation: ay-grow-y .8s cubic-bezier(.22, .8, .3, 1) both;
    animation-delay: calc(var(--i, 0) * 24ms);
}
html.ay-anim .ay-chart3d .col3d {
    transform-origin: center bottom;
    animation: ay-grow-y .75s cubic-bezier(.22, .8, .3, 1) both;
    animation-delay: calc(var(--i, 0) * 26ms);
}
html.ay-anim .ay-chart .trace,
html.ay-anim .ay-chart .trace3d {
    stroke-dasharray: var(--len, 2000);
    stroke-dashoffset: var(--len, 2000);
    animation: ay-draw 1.5s cubic-bezier(.22, .8, .3, 1) .35s forwards;
}
html.ay-anim .ay-chart .tracearea { opacity: 0; animation: ay-fadein .8s ease 1.1s forwards; }
html.ay-anim .ay-chart .dot,
html.ay-anim .ay-chart .dot3d {
    animation: ay-pop .35s cubic-bezier(.34, 1.6, .64, 1) both;
    animation-delay: calc(1.05s + var(--i, 0) * 30ms);
}
html.ay-anim .ay-heat__cell {
    animation: ay-cellin .4s ease both;
    animation-delay: calc(var(--i, 0) * 3ms);
}
html.ay-anim .ay-pie3d .p3-top {
    animation: ay-p3in .6s cubic-bezier(.22, .8, .3, 1) both;
    animation-delay: calc(var(--i, 0) * 80ms);
}
html.ay-anim .ay-donut circle.seg { animation: ay-dash 1.05s cubic-bezier(.22, .8, .3, 1) both; }
html.ay-anim .ay-rings .ring {
    stroke-dashoffset: var(--c);
    animation: ay-sweep 1.25s cubic-bezier(.22, .8, .3, 1) both;
    animation-delay: calc(var(--i, 0) * 140ms);
}

/* Reduced motion: the gate is simply never opened, so every element keeps the
   finished state defined above. This is why the fix is a gate and not a pile of
   `animation: none` overrides — those had to restore each hidden property by
   hand, and any one that was missed left content invisible. */
@media (prefers-reduced-motion: reduce) {
    html.ay-anim .ay-rise,
    html.ay-anim .ay-cmdk__panel,
    html.ay-anim .ay-filterbar,
    html.ay-anim .ay-pipeline__seg,
    html.ay-anim .ay-rank__fill,
    html.ay-anim .ay-chart .bar,
    html.ay-anim .ay-chart3d .col3d,
    html.ay-anim .ay-chart .tracearea,
    html.ay-anim .ay-chart .dot,
    html.ay-anim .ay-chart .dot3d,
    html.ay-anim .ay-heat__cell,
    html.ay-anim .ay-pie3d .p3-top,
    html.ay-anim .ay-donut circle.seg {
        animation: none;
        opacity: 1;
        transform: none;
    }
    html.ay-anim .ay-chart .trace,
    html.ay-anim .ay-chart .trace3d { animation: none; stroke-dashoffset: 0; }
    html.ay-anim .ay-rings .ring { animation: none; stroke-dashoffset: var(--off); }
}


/* -----------------------------------------------------------------------------
   58. THE 3D DEMAND PANEL
   A dark, saturated stage so the solid columns read as lit objects rather than
   as flat fills on paper. White and light-blue text only — measured 12/12 at
   >= 4.5:1 against both ends of the panel gradient.
   -------------------------------------------------------------------------- */
.ay-stage {
    position: relative;
    border-radius: var(--ay-r-lg);
    overflow: hidden;
    background:
        radial-gradient(60rem 26rem at 18% -30%, rgba(76, 111, 224, .38), transparent 62%),
        radial-gradient(48rem 24rem at 88% 120%, rgba(23, 169, 196, .30), transparent 60%),
        linear-gradient(165deg, #101C3E 0%, #1E325F 100%);
    color: #FFFFFF;
    padding: 18px 20px 14px;
}
/* A faint ground grid, so the columns look like they are standing on something. */
.ay-stage::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(255, 255, 255, .045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, .045) 1px, transparent 1px);
    background-size: 46px 46px;
    mask-image: linear-gradient(180deg, transparent 0%, #000 45%, #000 100%);
    -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 45%, #000 100%);
}
.ay-stage > * { position: relative; z-index: 1; }

.ay-stage__head { display: flex; align-items: flex-start; gap: 14px; flex-wrap: wrap; margin-bottom: 6px; }
.ay-stage__title { margin: 0; font-size: 1.02rem; font-weight: 800; letter-spacing: -.02em; color: #FFFFFF; }
.ay-stage__sub { margin: 3px 0 0; font-size: .78rem; color: #B8C8E8; font-weight: 500; }
.ay-stage__actions { margin-left: auto; display: flex; align-items: center; gap: 9px; }

/* Segmented control, restyled for the dark stage. */
.ay-stage .ay-seg { background: rgba(255, 255, 255, .10); }
.ay-stage .ay-seg button { color: #B8C8E8; }
.ay-stage .ay-seg button.is-active { background: rgba(255, 255, 255, .92); color: #14224E; }

/* --- the chart itself ------------------------------------------------------- */
.ay-chart3d { width: 100%; display: block; overflow: visible; }
.ay-chart3d .grid3d polyline { fill: none; stroke: rgba(255, 255, 255, .13); stroke-width: 1; }
.ay-chart3d .axis text { fill: #93A8CE; font-size: 9.5px; font-weight: 700; letter-spacing: .04em; }
.ay-chart3d .bandlabel { font-size: 8px; font-weight: 800; letter-spacing: .14em; opacity: .85; }

.ay-chart3d .col3d { cursor: pointer; transition: filter .2s ease, transform .22s cubic-bezier(.34,1.4,.64,1); }
.ay-chart3d:hover .col3d { filter: saturate(.55) brightness(.72); }
.ay-chart3d .col3d:hover {
    filter: saturate(1.15) brightness(1.12) drop-shadow(0 0 16px rgba(120, 170, 255, .55));
    transform: translateY(-4px);
}
.ay-chart3d .face-top   { transition: fill .2s ease; }
.ay-chart3d .face-side  { transition: fill .2s ease; }

.ay-chart3d .trace3d {
    fill: none;
    stroke: #FF8FCB;
    stroke-width: 2.4;
    stroke-linecap: round;
    stroke-linejoin: round;
    filter: drop-shadow(0 0 6px rgba(255, 143, 203, .75));
}
.ay-chart3d .dot3d { fill: #FFFFFF; stroke: #FF8FCB; stroke-width: 2; }

.ay-chart3d .nowline {
    stroke: #FFC46B; stroke-width: 1.6; stroke-dasharray: 3 4;
    filter: drop-shadow(0 0 5px rgba(255, 196, 107, .7));
}
.ay-chart3d .nowdot { fill: #FFC46B; filter: drop-shadow(0 0 6px rgba(255, 196, 107, .9)); }
html.ay-anim .ay-chart3d .nowdot { animation: ay-nowpulse 2.2s ease-in-out infinite; }
@keyframes ay-nowpulse { 0%, 100% { r: 4; opacity: 1; } 50% { r: 6; opacity: .75; } }
.ay-chart3d .nowlabel { fill: #FFD9A0; font-size: 8.5px; font-weight: 800; letter-spacing: .1em; }

.ay-chart3d .peak line   { stroke: rgba(255, 255, 255, .55); stroke-width: 1; stroke-dasharray: 2 3; }
.ay-chart3d .peak circle { fill: #FFFFFF; }
.ay-chart3d .peak text   { fill: #FFFFFF; font-size: 9px; font-weight: 800; letter-spacing: .08em; }

/* --- legend + decision strip ------------------------------------------------ */
.ay-stage__legend { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 10px; }
.ay-stage__key { display: inline-flex; align-items: center; gap: 8px; font-size: .78rem; font-weight: 700; }
.ay-stage__chip {
    width: 22px; height: 12px; border-radius: 3px; flex: 0 0 22px;
    box-shadow: inset 0 -4px 0 rgba(0, 0, 0, .28), 0 2px 5px rgba(0, 0, 0, .35);
}
.ay-stage__keylabel--login  { color: #C3D2FF; }
.ay-stage__keylabel--logout { color: #9EE9F6; }
.ay-stage__keylabel--done   { color: #FFB4DE; }

.ay-stage__decide {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
    gap: 12px;
    margin-top: 14px;
    padding-top: 13px;
    border-top: 1px solid rgba(255, 255, 255, .14);
}
.ay-stage__stat { min-width: 0; }
.ay-stage__k {
    font-size: .64rem; font-weight: 800; letter-spacing: .1em;
    text-transform: uppercase; color: #93A8CE;
}
.ay-stage__v {
    font-size: 1.28rem; font-weight: 800; color: #FFFFFF;
    letter-spacing: -.03em; margin-top: 3px; font-variant-numeric: tabular-nums;
}
.ay-stage__v small { font-size: .78rem; font-weight: 700; color: #B8C8E8; letter-spacing: 0; }
.ay-stage__note { font-size: .7rem; color: #B8C8E8; margin-top: 2px; }

@media (prefers-reduced-motion: reduce) {
    .ay-chart3d .col3d:hover { transform: none; }
    html.ay-anim .ay-chart3d .nowdot { animation: none; }
}

@media print {
    .ay-stage { background: #FFFFFF !important; color: var(--ay-ink) !important; border: 1px solid #CBD5E1; }
    .ay-stage::before { display: none; }
    .ay-stage__title, .ay-stage__v { color: var(--ay-ink) !important; }
    .ay-stage__sub, .ay-stage__k, .ay-stage__note { color: var(--ay-muted) !important; }
    .ay-chart3d .axis text { fill: var(--ay-muted); }
}


/* =============================================================================
   PART SEVEN — THE SEMANTIC COLOUR SYSTEM, THE PHI SCALE, AND FOUR REAL FIXES
   ============================================================================= */


/* -----------------------------------------------------------------------------
   59. FOUR LIVE DEFECTS CLOSED
   -----------------------------------------------------------------------------
   (a) `.ay-chart .col rect` (specificity 0-2-1) OUT-SPECIFIES the safety gate's
       reset `.ay-chart .bar` (0-2-0), so it was the one rule that still defeated
       section 57: with no JS the whole demand chart collapsed to an empty plot
       area, taking the transparent .colhit hit targets with it — so the tooltips
       and the cross-filter click targets died too.
   (b) `.ay-toast` and `.ay-cmdk.is-open` were never brought under the gate. Both
       fade in from opacity 0 with `both`. Narrow exposure, since both are raised
       by JS, but a frame-zero rasteriser would drop every error toast — a silent
       server error becoming doubly silent.
   (c) The reduced-motion rule `.ay-donut circle.seg { stroke-dasharray: revert }`
       did not hide content, it CORRUPTED it: `revert` rolls back past the SVG
       presentation attribute to the UA value `none`, so every segment drew a
       full circle and reduced-motion users saw a donut claiming one category was
       100% of the day. `animation: none` alone was always sufficient.
   (d) The global reduced-motion nuke set animation-duration but not
       animation-delay, so a delayed entrance still waited before snapping in.
   -------------------------------------------------------------------------- */
.ay-chart .col rect,
.ay-chart3d .col3d polygon,
.ay-chart3d .col3d rect {
    animation: none;
    transform: none;
    opacity: 1;
}
html.ay-anim .ay-chart .col rect {
    transform-origin: center bottom;
    animation: ay-grow-y .8s cubic-bezier(.22, .8, .3, 1) both;
    animation-delay: calc(var(--i, 0) * 24ms);
}
/* The invisible hit areas must never be animated — a scaled-to-zero hit target
   is an unclickable column. */
.ay-chart .colhit,
html.ay-anim .ay-chart .colhit,
.ay-chart3d .colhit,
html.ay-anim .ay-chart3d .colhit {
    animation: none !important;
    transform: none !important;
    opacity: 1;
}

.ay-toast, .ay-cmdk.is-open { animation: none; opacity: 1; transform: none; }
html.ay-anim .ay-toast { animation: ay-toast-in .3s cubic-bezier(.22, .8, .3, 1) both; }
html.ay-anim .ay-cmdk.is-open { animation: ay-fade .18s ease both; }

@media (prefers-reduced-motion: reduce) {
    /* Undo (c): never `revert` a property whose value came from an SVG
       presentation attribute. */
    .ay-donut circle.seg,
    html.ay-anim .ay-donut circle.seg { stroke-dasharray: revert-layer; animation: none; }
    /* Undo (d): kill the delay as well as the duration. */
    *, *::before, *::after { animation-delay: 0s !important; }
    html.ay-anim .ay-chart .col rect,
    html.ay-anim .ay-toast,
    html.ay-anim .ay-cmdk.is-open { animation: none; opacity: 1; transform: none; }
}


/* -----------------------------------------------------------------------------
   60. THE SEMANTIC COLOUR SYSTEM
   -----------------------------------------------------------------------------
   ONE HUE, ONE MEANING. Split-complementary, anchored on the logo navy #24408E
   (H 224.2°). Its complement is 44.2°; the split arms are 14.2° and 74.2°.

   THREE FAMILIES, and the grouping is the whole idea:

   1. OPPOSITION BAND — the only two states allowed to interrupt. Both sit on
      the 14.2° arm, 140-158° from the brand hue, i.e. maximum figure-ground
      against navy chrome:
        SOS              H   4.2°   #B42318
        service failure  H  21.8°   #B54708
      Reading the two-step ramp IS the lesson: the closer to pure red, the
      closer to human harm.

   2. TRIAD — safety watch, H 326.9°, which is 103.3° from the navy against an
      ideal 104.2°. Triadic makes it as salient as an alert but unmistakably
      not one: a watch is not a failure.

   3. ANALOGOUS FAMILY — everything that is merely happening, 6-69° from navy,
      so it recedes into the chrome instead of competing for the eye.

   THE COMPLEMENT ITSELF (44.2°, the gold/amber zone) IS DELIBERATELY EMPTY.
   Two reasons, and both are load-bearing: a dark gold there measures ΔE00
   2.2-8.7 against the existing amber under deuteranopia (indistinguishable),
   and gold reads as money in India — a gold gradient on a "late trips" bar
   would read as a billing figure.

   COLOUR-BLINDNESS, measured (Viénot-Brettel-Mollon 1999 + CIEDE2000):
   nine colour-coded states collapse to about SIX distinguishable families
   under deuteranopia and protanopia. 32 of 36 pairs clear ΔE00 11; three
   collide. No repalette fixes this — a constrained hue search returned a best
   worst-case of 5.1. So the form rules in section 61 are NOT decoration. They
   are the primary identifier for at least three states.
   -------------------------------------------------------------------------- */
:root {
    /* --- opposition band: may interrupt ------------------------------------ */
    --ay-sos:        #B42318;   /* H   4.2  reserved — see 61a */
    --ay-sos-50:     #FEF3F2;
    --ay-sos-ink:    #912018;

    --ay-fail:       #B54708;   /* H  21.8  a failure that is already billing */
    --ay-fail-50:    #FFFAEB;
    --ay-fail-ink:   #93370D;

    /* --- triad: watch, not failure ----------------------------------------- */
    --ay-watch:      #C11574;   /* H 326.9 */
    --ay-watch-50:   #FDF2FA;
    --ay-watch-ink:  #9E165F;

    /* --- analogous: things merely happening -------------------------------- */
    --ay-live:       #0E7490;   /* H 192.9  in progress / moving */
    --ay-ok:         #027A48;   /* H 155.0  healthy / completed / on time */
    --ay-blocked:    #6941C6;   /* H 258.0  waiting on a human */
    --ay-idle:       #475467;   /* H 215.6 @ S18  neutral — the absence of colour */

    /* --- the platform's own failures, and the ledger ------------------------ */
    --ay-system:     #1E293B;   /* H 217.2  brand hue with the light taken out */
    --ay-system-50:  #E3E8EF;
    --ay-money:      #175CD3;   /* H 218.0  brand hue at full chroma */
    --ay-money-50:   #EFF4FF;
    --ay-money-ink:  #194185;
}

/* `info` meant two different colours: --ay-info drove the blue pills while
   section 19 re-pointed .text-info/.bg-info to teal. Under one-hue-one-meaning
   blue is money and teal is live, so one class name spanned two meanings.
   The utilities go to idle — an untyped "info" is not a state. */
.text-info { color: var(--ay-idle) !important; }
.bg-info   { background-color: var(--ay-idle) !important; }

/* Gold leak: the "late" rank bar ramped #B54708 -> #F59E0B, a 16° rotation into
   the money zone. Held at 0.9° drift instead. */
.ay-rank__fill--warn { background: linear-gradient(90deg, #B54708, #EF6820); }

/* Three different meanings were sharing one near-black. The slate tile moves up
   so the darkest thing on the page stays diagnostic (= system failure). */
.ay-tile--slate { --g1: #3A4557; --g2: #475467; }
.ay-btn3d--slate { --face: #475467; --base: #323C4C; }


/* -----------------------------------------------------------------------------
   61. FORM RULES — non-negotiable, because colour alone is not enough
   -----------------------------------------------------------------------------
   Measured: this palette resolves to ~6 families, not 9, under red-green
   dichromacy. These shape/position cues are the primary identifier for the
   three colliding pairs, not a nicety. Treat a change to them as a functional
   change, not a styling one.
   -------------------------------------------------------------------------- */

/* (a) SOS is the ONLY solid-filled chip in a list. Every other state is a pale
       tint. That makes it identifiable by FILL alone, under any colour vision
       and in pure greyscale. It also gets a reserved token nothing else may
       reference — if SOS shares the generic Bootstrap danger colour used by 172
       .text-danger call sites, SOS stops being special. */
.ay-pill--sos {
    background: var(--ay-sos);
    color: #FFFFFF;
    font-weight: 800;
    box-shadow: 0 2px 6px -1px rgba(180, 35, 24, .5);
}
.ay-pill--sos::before { background: #FFFFFF; }

/* (b) Blocked work is the only DASHED-outline chip — a shape cue that survives
       greyscale completely. It recedes on purpose: blocked work is high-volume
       every morning, and in the opposition band the 07:00 board would be a wall
       of red. It earns attention by COUNT, not by hue. */
.ay-pill--blocked {
    background: transparent;
    color: var(--ay-violet-ink);
    border: 1px dashed var(--ay-blocked);
}
.ay-pill--blocked::before { background: var(--ay-blocked); }

/* (c) Live carries a STATIC glyph as well as the pulsing dot. Mandatory, not
       optional: reduced motion disables the pulse, and live is only ΔE00 10.3
       from idle slate — a reduced-motion dichromat would otherwise have no cue
       left at all. */
.ay-pill--live::after {
    content: "\25B6";
    font-size: .62em;
    opacity: .85;
    margin-left: 1px;
}

/* (d) System failure: solid ink chip plus a diagonal hatch, so the platform's
       own defects never look like an operator's problem. */
.ay-pill--system {
    background:
        repeating-linear-gradient(45deg, rgba(255,255,255,.10) 0 3px, transparent 3px 6px),
        var(--ay-system);
    color: #FFFFFF;
}
.ay-pill--system::before { background: #FFFFFF; }

/* (e) Money is NEVER a pill. Right-aligned tabular numerals with a currency
       glyph — because billing blue and blocked violet are the same colour to a
       dichromat (ΔE00 1.8), and they co-occur on the route board. The form rule
       is what keeps them apart, so it is enforced here rather than trusted. */
.ay-money {
    display: inline-flex;
    align-items: baseline;
    gap: 2px;
    justify-content: flex-end;
    color: var(--ay-money);
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    text-align: right;
}
.ay-money::before { content: "\20B9"; font-weight: 700; opacity: .75; }

/* (f) Idle is the only state with NO glyph. The absence of an icon is itself
       the cue, and it must stay the lowest-chroma value in the system so that
       anything chromatic reads as signal by contrast. */
.ay-pill--idle { background: var(--ay-slate-50); color: var(--ay-slate-ink); }

/* (g) Safety watch is a name PREFIX, never a status pill — it must occupy a
       different column from the trip-status colours so it cannot compete with
       them. Magenta collapses to near-grey under CVD (deuteranopia renders it
       #707070) and collides with idle; the column split is the only thing
       keeping them apart. */
.ay-watchflag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--ay-watch-ink);
    font-weight: 700;
    font-size: .74rem;
}
.ay-watchflag i { color: var(--ay-watch); }

/* (h) Flag triband. Service-failure orange and healthy green separated by white
       reproduce the Indian flag's colour order. In a pipeline bar they must
       never be neighbours — order is idle, live, healthy, blocked, failure, SOS.
       Documented here because the ordering lives in the markup, not the CSS. */


/* -----------------------------------------------------------------------------
   62. THE PHI SCALE
   -----------------------------------------------------------------------------
   TWO ratios, not one, because the eye compares type and space differently.
   Type is read SEQUENTIALLY (a label now, its number a second later), so a
   small ratio still registers as "a different level". Space is judged
   SIMULTANEOUSLY (two gaps in one glance), so the same small ratio reads as a
   mistake rather than a level.

   TYPE      phi^(1/3) = 1.173985   chosen by measurement: the real range
             (.64rem micro-label to 2.3rem KPI) spans 3.594x, and
             log(3.594)/log(phi^(1/3)) = 7.97 — almost exactly 8 steps.
             phi^(1/4) needs 10.63 (a fractional step, so one end falls off the
             scale) and yields 14 stops for 11 real levels. phi^(1/2) needs 5.32
             — too coarse to separate table body from button from card sub.
   GEOMETRY  phi^(1/2) = 1.272020, phase-anchored at 6px because that is the
             only phase reproducing 12, 16 AND 20 — the file's three dominant
             existing values, so nothing has to move.

   FREE FINDING: the existing radii (6/8/10/12/16/20) were ALREADY a sqrt(phi)
   ramp off a 6px base. No migration needed.
   -------------------------------------------------------------------------- */
:root {
    --ay-ratio-type:  1.173985;   /* phi^(1/3) */
    --ay-ratio-space: 1.272020;   /* phi^(1/2) */

    /* Type — anchored at 15px, the existing body size, so nothing re-flows. */
    --ay-fs-3xs: .5rem;      /*  8px  step -4 */
    --ay-fs-2xs: .5625rem;   /*  9px  step -3 */
    --ay-fs-xs:  .6875rem;   /* 11px  step -2  uppercase micro-labels */
    --ay-fs-sm:  .8125rem;   /* 13px  step -1  the largest bucket */
    --ay-fs-md:  .9375rem;   /* 15px  step  0  ANCHOR */
    --ay-fs-lg:  1.125rem;   /* 18px  step +1 */
    --ay-fs-xl:  1.3125rem;  /* 21px  step +2 */
    --ay-fs-2xl: 1.5rem;     /* 24px  step +3  page title */
    --ay-fs-3xl: 1.75rem;    /* 28px  step +4 */
    --ay-fs-4xl: 2.0625rem;  /* 33px  step +5  KPI + hero tile value */
    --ay-fs-5xl: 2.4375rem;  /* 39px  step +6 */

    /* Space — 4px and 5px carry the worst rounding (+7.9%, +6.0%) and are
       unavoidable at the floor of any geometric scale. */
    --ay-sp-1:  4px;   --ay-sp-2:  5px;   --ay-sp-3:  6px;
    --ay-sp-4:  8px;   --ay-sp-5: 10px;   --ay-sp-6: 12px;
    --ay-sp-7: 16px;   --ay-sp-8: 20px;   --ay-sp-9: 25px;
    --ay-sp-10: 32px;  --ay-sp-11: 41px;
}

/* A true phi split. 12 columns cannot give one — 12/phi = 7.416, and the
   integer neighbours straddle it badly (7/5 = 1.400, 8/4 = 2.000). Fractional
   fr units land it exactly, and unlike a column span it is gap-independent:
   CSS subtracts the gap before dividing the remainder. */
.ay-grid--phi {
    display: grid;
    grid-template-columns: minmax(0, 1.618fr) minmax(0, 1fr);
    gap: var(--ay-sp-7);
}
@media (max-width: 1199.98px) {
    .ay-grid--phi { grid-template-columns: minmax(0, 1fr); }
}

/* A landscape golden rectangle for the hero tiles — very nearly what they
   already were. min-height rather than aspect-ratio, so a long label wraps
   instead of being clipped. */
.ay-tile { min-height: calc(196px / 1.618); }

/* OPTICAL OVERRIDES — where strict proportion looks wrong.
   The headline one: a 1.618 line-height on 15px body text is 24.27px of
   leading, which is exactly type step +3. Text set that loose stops reading as
   paragraphs and starts reading as a list. Line-height is NOT on the scale. */
.ay-pagehead__title,
.ay-tile__value,
.ay-kpi__value,
.ay-stage__v { line-height: 1.05; }

/* All-caps sits at cap height with no x-height differential, so it reads a full
   step larger than it measures: drop one step and give the tracking back. */
.ay-card__sub,
.ay-stage__k,
.ay-kpi__label { letter-spacing: .01em; }

/* Tracking runs INVERSELY to size — strict proportion would hold it constant
   in em, which makes large text look gappy and small text look cramped. */
.ay-tile__value,
.ay-kpi__value { letter-spacing: -.038em; }

/* Icon fonts reserve descender space inside the em box, so a glyph optically
   centred by the grid sits about a pixel low. */
.ay-card__icon i,
.ay-kpi__icon i,
.ay-tile__icon i { transform: translateY(-1px); }


/* -----------------------------------------------------------------------------
   63. TWO BROKEN THEME TOKENS
   -----------------------------------------------------------------------------
   (a) The hand-edited theme sets
           --bs-card-border-color: 1px solid #939ca9;
       — a full `border` shorthand assigned to a COLOUR token. Bootstrap then
       composes `border: var(--bs-card-border-width) solid var(--bs-card-border-color)`,
       which expands to `1px solid 1px solid #939ca9` — invalid, so border-style
       computes to `none` and every .card in three portals renders with no border
       at all. Views have been written around the missing border, so this restores
       it deliberately rather than by accident.

   (b) --bs-font-sans-serif is `"Nunito", cursive`. `cursive` is a generic family,
       so on any device where Nunito fails to load the entire application renders
       in the system handwriting font. Replaced with a real fallback stack.
   -------------------------------------------------------------------------- */
:root,
[data-bs-theme="light"] {
    --bs-card-border-color: var(--ay-line);
    --bs-card-border-width: 1px;
    --bs-font-sans-serif: var(--ay-font);
}
.card {
    border: 1px solid var(--ay-line);
    border-radius: var(--ay-r-lg);
    box-shadow: var(--ay-shadow-sm);
}
.card.border-0 { border: 0 !important; }


/* -----------------------------------------------------------------------------
   64. MERGED SHELL  —  html[data-ay-shell="merged"]
   -----------------------------------------------------------------------------
   One bar instead of two: the brand, the navigation and the account all sit on
   the blue bar, and the white top bar is gone.

   The whole collapse is driven by ONE variable. The theme pins the nav with
   `.main-menu { top: var(--bs-topbar-height) }` and offsets the page with
   `.navbar-custom { margin-top: calc(var(--bs-topbar-height) * -1);
   margin-bottom: var(--bs-topbar-height) }`. Setting that variable to 0 makes
   every one of those sums resolve correctly with no top bar present — far safer
   than hand-unpicking the theme's geometry rule by rule.

   Scoped to the attribute so the Admin portal, which still has a top bar, is
   untouched.

   Measured 7/7 at >= 4.5:1 against the LIGHT end of the navy gradient (#24408E);
   the dark end is higher, so the light end is the binding case.
   -------------------------------------------------------------------------- */
html[data-ay-shell="merged"] {
    --bs-topbar-height: 0px;
}
/* Client, 2026-09-12: "if I open in the tab, then no menu is visible" — desktop-only.
   Below 1200px the theme collapses the whole horizontal bar into an off-canvas drawer
   (.main-menu, parked at opacity:0 until html.sidebar-enable is added — see the note
   in Admin/header.blade.php), and .button-toggle-menu inside THIS pair is the ONLY
   control that adds that class. Hiding navbar-custom/.topbar at every width, as this
   rule did, removed the escape hatch along with the redundant bar: any window/tab
   narrower than 1200px (an un-maximized browser, a smaller monitor, a laptop at
   normal zoom) showed no nav and had no way to open one. Scoped to desktop width,
   where the merged single bar already carries the brand and account and a second
   copy really is redundant — see style.css's own
   `@media (min-width:1200px) .navbar-custom .topbar .button-toggle-menu { display:none }`
   two lines below the analogous `.main-menu { top: var(--bs-topbar-height) }` rule,
   which already assumes this pair is desktop-hidden, not hidden everywhere. */
@media (min-width: 1200px) {
    html[data-ay-shell="merged"] .navbar-custom,
    html[data-ay-shell="merged"] .topbar { display: none !important; }
}

/* One flex row: brand, menu items, then the account pushed to the far end.
   All three are <li> children of .app-menu, because .main-menu itself is
   display:block in this theme's horizontal mode — anything placed as a sibling
   of .app-menu stacks ABOVE it and gets clipped by the bar's fixed height. */
html[data-ay-shell="merged"] .main-menu .app-menu {
    display: flex;
    align-items: stretch;
    gap: 2px;
    height: var(--bs-horizontal-menu-height, 55px);
}
html[data-ay-shell="merged"] .main-menu .app-menu > .menu-item {
    display: flex;
    align-items: center;
}
/* The theme's own logo box stays hidden — the brand is an .app-menu item now. */
html[data-ay-shell="merged"] .main-menu .logo-box { display: none !important; }
html[data-ay-shell="merged"] .main-menu .app-menu > .menu-title { display: none !important; }

.ay-navbrand-item { padding-left: 0 !important; flex: 0 0 auto; }

.ay-navbrand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 0 20px 0 4px;
    height: 100%;
    flex: 0 0 auto;
    color: #FFFFFF;
    font-weight: 800;
    font-size: 1.02rem;
    letter-spacing: -.02em;
    text-decoration: none;
    white-space: nowrap;
}
.ay-navbrand:hover { color: #FFFFFF; text-decoration: none; opacity: .9; }
.ay-navbrand img {
    display: block;
    /* 26px inside a 55px bar. The asset ships at 2x (52px tall) and is trimmed
       of its transparent border, so it is crisp on high-DPI and its optical size
       matches the number here.
       flex: 0 0 auto is load-bearing: the brand link is a flex container, and
       without it the image was shrunk to a 9px slice to make room for the
       wordmark. `width: auto` alone does not stop a flex item from shrinking. */
    flex: 0 0 auto;
    height: 26px;
    width: auto;
    min-width: 26px;
}
.ay-navbrand span { flex: 0 0 auto; }
.ay-navbrand span { line-height: 1; }

/* Account block, pushed to the right of the same row. margin-left:auto rather
   than absolute positioning, so in the <1200px drawer it simply becomes the
   last stacked item instead of overlapping the menu. */
/* Compact auto-refresh, in the nav bar rather than on the page.
   Client direction 2026-09-11: "Auto refresh should add in the header nav bar
   (Make it small & compact within the nav bar)".

   It lives INSIDE .ay-navuser so there is only one margin-left:auto in the bar --
   two of them would split the free space and leave a gap between the control and
   the account block instead of keeping the right-hand cluster together.

   Sized off the nav's own translucent-white language (same fill and inset hairline
   as .ay-navuser__badge) because the bar is brand navy: the old .ay-refresh pill was
   solid --ay-brand-700 on white, which disappears against this background. */
.ay-navrefresh {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 28px;
    padding: 0 11px;
    border: 0;
    border-radius: var(--ay-r-pill);
    background: rgba(255, 255, 255, .18);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .22);
    color: #FFFFFF;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .02em;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color .16s ease;
}
.ay-navrefresh:hover  { background: rgba(255, 255, 255, .30); }
.ay-navrefresh:active { background: rgba(255, 255, 255, .38); }
.ay-navrefresh:focus-visible { outline: 2px solid #FFFFFF; outline-offset: 2px; }
.ay-navrefresh__ring { width: 14px; height: 14px; transform: rotate(-90deg); flex: 0 0 14px; }
.ay-navrefresh__ring circle { fill: none; stroke-width: 3; }
.ay-navrefresh__ring .bg { stroke: rgba(255, 255, 255, .35); }
.ay-navrefresh__ring .fg { stroke: #FFFFFF; stroke-linecap: round; transition: stroke-dashoffset 1s linear; }
/* tabular-nums so the countdown does not jiggle the account block beside it as
   the digit count changes 120 -> 99 -> 9. */
.ay-navrefresh__s { font-variant-numeric: tabular-nums; }
/* Paused is a real state, not a stall: the countdown holds while a field has focus
   or a modal is open, and saying so stops it reading as a frozen widget. */
.ay-navrefresh.is-paused { background: rgba(255, 255, 255, .10); color: #DCE6FF; }
.ay-navrefresh.is-paused .ay-navrefresh__ring .fg { stroke: #DCE6FF; }

.ay-navuser {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 0 2px 0 14px !important;
    flex: 0 0 auto;
}
.ay-navuser__badge {
    display: inline-flex;
    align-items: center;
    background: rgba(255, 255, 255, .18);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .22);
    color: #FFFFFF;
    font-size: .68rem;
    font-weight: 800;
    letter-spacing: .05em;
    text-transform: uppercase;
    padding: 4px 10px;
    border-radius: var(--ay-r-pill);
    white-space: nowrap;
}
.ay-navuser__name {
    color: #DCE6FF;
    font-size: .82rem;
    font-weight: 600;
    white-space: nowrap;
}
.ay-navuser__out {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: #FFFFFF;
    font-size: .8rem;
    font-weight: 700;
    text-decoration: none;
    padding: 7px 13px;
    border-radius: var(--ay-r-sm);
    background: rgba(255, 255, 255, .12);
    transition: background-color .16s ease, color .16s ease;
    white-space: nowrap;
}
.ay-navuser__out:hover {
    background: var(--ay-sos);
    color: #FFFFFF;
    text-decoration: none;
}

@media (max-width: 1199.98px) {
    /* Drawer mode: the bar is a vertical panel, so the account stacks. */
    html[data-ay-shell="merged"] .main-menu .app-menu { display: block; }
    .ay-navuser {
        margin: 10px 0 0;
        padding: 12px 14px !important;
        border-top: 1px solid rgba(255, 255, 255, .14);
        flex-wrap: wrap;
    }
    .ay-navbrand { padding: 14px 16px; }
}
@media (max-width: 575.98px) {
    .ay-navuser__name { display: none; }
    .ay-navuser__out span { display: none; }
}


/* -----------------------------------------------------------------------------
   64b. MERGED SHELL — MAKING IT FIT THE COMPANY PANEL
   -----------------------------------------------------------------------------
   The merged bar was built for the vendor and super-admin portals, which carry
   two to four top-level items. The company panel carries SEVEN (Dashboard,
   Master, SOS Alerts, Live Tracking, Routes, Billing, Analytics) plus the brand
   and the account block. Measured on a 1280px laptop before this block: the row
   needed 1565px and had 1075px, so the account was pushed 200px off the right
   edge and Analytics sat under it.

   Two causes, both fixed here:
     1. The stock theme centres .app-menu at max-width:85% with auto side
        margins, which threw away 190px of the 1265px bar for no reason once the
        brand and account live INSIDE the row.
     2. Seven items at 14px side padding plus two word-buttons is simply more
        than a 1280px bar holds, so the row tightens and the account collapses to
        icons between 1200 and 1500px.

   NO overflow on this row, deliberately. An `overflow-x:auto` safety net was
   tried here and had to come out: any non-visible overflow-x makes the element a
   clipping container on BOTH axes, so it sliced off every drop-down the moment
   one extended below the 55px bar. A nav that owns drop-downs cannot also be a
   scroll container. If a future menu item overflows, it overflows visibly --
   which is noticeable and fixable, unlike a silently clipped menu.
   -------------------------------------------------------------------------- */
@media (min-width: 1200px) {
    html[data-ay-shell="merged"] .main-menu .app-menu {
        max-width: 100%;
        /* The stock rule sets max-width:85% AND width:85%. Overriding only
           max-width leaves the element at 85% and the fix looks like it did
           nothing -- both have to be reset. */
        width: 100%;
        margin-left: 0;
        margin-right: 0;
        padding: 0 10px;
    }

    /* Only a DENSE bar is tightened: a bar that does not fit a laptop otherwise. That
       was the company panel alone (seven top-level items); the cab-company bar joined
       it at eight, and the super-admin bar when Report Library made it overflow 1366px
       (Nov 2026). A bar with room to spare should NOT be marked dense -- it would
       shrink its labels and turn its Logout into a bare icon for no reason. The width
       reclaim above is general: it helps every merged bar and costs none of them
       anything. */
    html[data-ay-nav="dense"] .main-menu .app-menu > .menu-item > .menu-link {
        padding-left: 9px;
        padding-right: 9px;
        gap: 7px;
    }
    html[data-ay-nav="dense"] .ay-navuser { gap: 8px; padding-left: 10px !important; }
}

/* -----------------------------------------------------------------------------
   64c. HORIZONTAL SUB-MENUS MUST OPEN ON CLICK, NOT ONLY ON HOVER
   -----------------------------------------------------------------------------
   Reported as "no menu is clickable, everything just stays on the dashboard".
   The stock theme hides sub-menus in horizontal layout:

       @media (min-width: 1200px) {
         html[data-layout="horizontal"] .main-menu .collapse { display: none; }
       }

   and reveals them ONLY on .menu-item:hover. Bootstrap's collapse still runs on
   click and correctly adds .show — but CSS keeps display:none, so clicking
   "Master" or "Analytics" visibly did nothing. Hover is also unreachable on a
   touchscreen and easy to miss with a trackpad.

   This makes the class Bootstrap is already toggling do what it says, using the
   same declarations as the theme's own hover rule so an opened menu is
   positioned identically however it was opened.
   -------------------------------------------------------------------------- */
@media (min-width: 1200px) {
    html[data-layout="horizontal"] .main-menu .app-menu .menu-item > .collapse.show {
        position: absolute;
        top: 100%;
        left: 0;
        width: 220px;
        display: block !important;
        height: inherit !important;
        transition: none !important;
        /* The base rule carries `animation-fill-mode: both`. Opened by HOVER the
           animation runs and settles; opened by .show it holds the keyframe's
           starting offset instead, which parked the panel 96px ABOVE the bar and
           spread its items across it. Same trap recorded on 2026-08-31: an
           animation with fill-mode:both hides or displaces content that never
           got its trigger. Anchor the panel explicitly and drop the animation. */
        animation: none !important;
    }
}

@media (min-width: 1200px) and (max-width: 1499.98px) {
    /* Laptop width: keep every menu item readable and let the account go compact
       rather than squeezing the navigation, which is what people actually use. */
    html[data-ay-nav="dense"] .main-menu .app-menu > .menu-item > .menu-link {
        font-size: .875rem;
    }
    html[data-ay-nav="dense"] .ay-navuser__badge { display: none; }
    html[data-ay-nav="dense"] .ay-navuser__out span { display: none; }
    html[data-ay-nav="dense"] .ay-navuser__out { padding: 7px 9px; }
    /* The countdown IS the control, so the ring and the seconds stay; only the
       word "Refresh" goes, matching what the account buttons beside it do. */
    html[data-ay-nav="dense"] .ay-navrefresh span:not(.ay-navrefresh__s) { display: none; }
    html[data-ay-nav="dense"] .ay-navrefresh { padding: 0 9px; }
}

/* The VENDOR bar carries eight items since Live Tracking and Reports joined it (client test
   report, Nov 2026) - one more than the row holds at laptop width, and this row must never
   overflow (see 64b: it owns drop-downs, so it cannot scroll). Below 1600px that bar shows
   its LABELS without their icons: the words are what people read, and dropping eight icons
   buys back more room than the extra item costs. From 1600px up the icons are back. */
@media (min-width: 1200px) and (max-width: 1599.98px) {
    html[data-ay-nav="dense"][data-ay-nav-fit="labels"] .main-menu .app-menu > .menu-item > .menu-link > .menu-icon {
        display: none;
    }
    html[data-ay-nav="dense"][data-ay-nav-fit="labels"] .main-menu .app-menu > .menu-item > .menu-link {
        padding-left: 10px;
        padding-right: 10px;
    }
}
/* The narrowest desktop widths (a 1280px laptop): the same eight labels, a touch smaller. */
@media (min-width: 1200px) and (max-width: 1319.98px) {
    html[data-ay-nav="dense"][data-ay-nav-fit="labels"] .main-menu .app-menu > .menu-item > .menu-link {
        padding-left: 5px;
        padding-right: 5px;
        font-size: .78rem;
    }
    html[data-ay-nav="dense"][data-ay-nav-fit="labels"] .ay-navuser__name { max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}


/* -----------------------------------------------------------------------------
   64d. A DISABLED LINK-BUTTON STILL HAS TO BE READABLE
   -----------------------------------------------------------------------------
   Bootstrap greys .btn-link:disabled to #98A6AD, which measures 2.5:1 on white.
   The one that matters is "Resend OTP in 60s" on all three login pages: it is
   disabled for the whole 60-second wait, so the state a user stares at while
   waiting for an OTP was the least readable text on the page. WCAG exempts
   disabled controls; the house rule here does not, and this one is doing real
   work (it carries the countdown).

   --ay-faint is 5.36:1 on white and still reads as clearly inactive next to the
   enabled #2E52B0.
   -------------------------------------------------------------------------- */
.btn-link:disabled,
.btn-link.disabled,
fieldset:disabled .btn-link {
    color: var(--ay-faint, #5A6A8C);
}


/* -----------------------------------------------------------------------------
   64e. MEGA MENU  —  html.ay-mega-on  +  body-level .ay-mega
   -----------------------------------------------------------------------------
   Replaces the theme's in-bar drop-down entirely (see ayaka-megamenu.js for the
   four separate ways that one broke). The panel is a sibling of the page, fixed
   to the navbar's bottom edge, so nothing in the bar's ancestry can clip it,
   stack over it, animate it out of place or scroll the page out from under it.

   `html.ay-mega-on` is set by the script ONLY at >= 1200px. Below that the class
   is removed and the stock vertical drawer takes over untouched.
   -------------------------------------------------------------------------- */

/* Silence the theme's own drop-down while the mega menu owns this job. Covers
   BOTH paths it used: :hover and .collapse.show. */
html.ay-mega-on .main-menu .app-menu > .menu-item > .collapse,
html.ay-mega-on .main-menu .app-menu > .menu-item:hover > .collapse,
html.ay-mega-on .main-menu .app-menu > .menu-item > .collapse.show {
    display: none !important;
}

/* The open toggle reads as pressed. */
html.ay-mega-on .main-menu .app-menu > .menu-item > a.is-mega-open {
    background: rgba(255, 255, 255, .20);
}
html.ay-mega-on .main-menu .app-menu > .menu-item > a.is-mega-open .menu-arrow {
    transform: rotate(180deg);
}

.ay-mega {
    position: fixed;
    z-index: 1100;                 /* above the bar's 999, below modals */
    background: var(--ay-surface, #FFFFFF);
    /* SOLID border all the way round, per client 2026-08-31 -- it used to be a
       bottom hairline plus a large soft shadow, which left the panel's edges
       undefined against a pale page. */
    border: 1px solid var(--ay-line, #DFE4EC);
    border-radius: 0 0 var(--ay-r, 14px) var(--ay-r, 14px);
    box-shadow: 0 10px 22px rgba(20, 34, 78, .10);
    overflow-y: auto;
    /* NO fade or slide. The client asked for the animation gone: a menu is a
       response to a click, and 140ms of movement on every open reads as lag.
       It appears immediately and exactly where it was measured to belong. */
}
.ay-mega[hidden] { display: none; }

/* Compact: the panel now hugs its content instead of spanning the window, and
   the whole scale is tightened. It was a full-width band carrying 13 short
   links, so most of it was empty. */
.ay-mega__inner { padding: 9px 10px 10px; }

.ay-mega__head {
    display: flex; align-items: baseline; gap: 8px;
    padding: 0 4px 6px; margin-bottom: 6px;
    border-bottom: 1px solid var(--ay-line-soft, #EDF1F7);
}
.ay-mega__title {
    font-size: .64rem; font-weight: 800; letter-spacing: .08em;
    text-transform: uppercase; color: var(--ay-brand-700, #24408E);
}
.ay-mega__count { font-size: .64rem; color: var(--ay-faint, #5A6A8C); }

.ay-mega__cols {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(158px, auto);
    gap: 1px 10px;
}
.ay-mega__col { display: flex; flex-direction: column; gap: 1px; }

.ay-mega__item {
    display: flex; align-items: center; gap: 8px;
    padding: 5px 8px;
    border-radius: var(--ay-r-sm, 10px);
    color: var(--ay-ink, #14224E);
    font-size: .8rem; font-weight: 600;
    line-height: 1.25;
    white-space: nowrap;
    text-decoration: none;
    transition: background-color .12s ease, color .12s ease;
}
.ay-mega__item:hover,
.ay-mega__item:focus {
    background: var(--ay-brand-50, #EEF3FF);
    color: var(--ay-brand-800, #1B2F6B);
    text-decoration: none;
    outline: none;
}
.ay-mega__item:focus-visible { box-shadow: 0 0 0 2px var(--ay-brand-500, #3B67D4); }

.ay-mega__ico {
    flex: 0 0 auto; width: 19px; height: 19px; border-radius: 6px;
    display: grid; place-items: center; font-size: .62rem;
    background: var(--ay-brand-50, #EEF3FF);
    color: var(--ay-brand-700, #24408E);
}
.ay-mega__item:hover .ay-mega__ico { background: #FFFFFF; }
.ay-mega__text { min-width: 0; }


/* -----------------------------------------------------------------------------
   65. HERO TILES: SIX ACROSS ON A LAPTOP
   -----------------------------------------------------------------------------
   The row was minmax(196px, 1fr), which on a 1366px laptop left 1125px of
   content width and fitted only five columns — the sixth tile dropped to a row
   of its own. Measured, not guessed.

       columns that fit = floor((rowWidth + gap) / (min + gap))
       1125px at min 196: floor(1139 / 210) = 5      <- the bug
       1125px at min 158: floor(1139 / 172) = 6
       1050px at min 158: floor(1064 / 172) = 6      <- also fits 1280px screens

   auto-fit rather than a hard `repeat(6, ...)`: the same class carries the
   four-tile rows on the super-admin pages, and auto-fit collapses the empty
   tracks so those still stretch to full width instead of shrinking to a sixth.

   The tile chrome shrinks with the column so the content still breathes at
   ~165px. This is one stylesheet shared by both callers, so the company portal
   and the super admin's read-only view of it change together.
   -------------------------------------------------------------------------- */
.ay-tilerow {
    grid-template-columns: repeat(auto-fit, minmax(158px, 1fr));
    gap: 12px;
}

.ay-tile {
    padding: 13px 13px 12px;
    border-radius: var(--ay-r);
}
.ay-tile__head { gap: 9px; }
.ay-tile__icon {
    width: 34px; height: 34px; flex: 0 0 34px;
    border-radius: 11px;
    font-size: .92rem;
}
.ay-tile__label { font-size: .72rem; line-height: 1.28; padding-top: 1px; }
.ay-tile__value {
    font-size: 1.75rem;          /* --ay-fs-3xl */
    margin-top: 9px;
    letter-spacing: -.035em;
}
.ay-tile__value small { font-size: .8rem; }
.ay-tile__foot { font-size: .68rem; margin-top: 6px; gap: 5px; }
.ay-tile__spark { height: 26px; }

/* The flip card is absolutely positioned over a fixed height, so it has to come
   down with the tile or the reverse face floats in empty space. */
.ay-flip { --ay-flip-h: 148px; }
.ay-flip__back { padding: 12px 13px; gap: 6px; }
.ay-flip__back h4 { font-size: .68rem; }
.ay-flip__row { font-size: .74rem; padding: 3px 0; }
.ay-flip__hint { font-size: .63rem; }
.ay-flip__btn { width: 22px; height: 22px; top: 9px; right: 9px; font-size: .62rem; }
.ay-flip__cue { padding: 7px 10px; font-size: .67rem; }

@media (max-width: 1199.98px) {
    /* Below the laptop band, let them breathe again rather than forcing six up. */
    .ay-tilerow { grid-template-columns: repeat(auto-fit, minmax(172px, 1fr)); }
}


/* -----------------------------------------------------------------------------
   66. MERGED SHELL — EMPLOYEE PORTAL
   -----------------------------------------------------------------------------
   The employee portal does not use the theme's .main-menu / .navbar-custom pair;
   it has its own white "logo bar" above a fixed Bootstrap navbar. Merging it
   therefore needs its own rules rather than section 64's.

   Measured against the bar's own #222547: brand 14.75:1, account name 14.75:1,
   the ID line 9.82:1, and the avatar's letter on its 20%-white chip 7.73:1.
   -------------------------------------------------------------------------- */
.navbar.bg-dark-blue .ay-navbrand {
    height: auto;
    padding: 0;
    flex: 0 0 auto;
}
.navbar.bg-dark-blue .ay-navbrand span { font-size: .98rem; }

.ay-navuser__avatar {
    width: 34px; height: 34px; flex: 0 0 34px;
    border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    background: rgba(255, 255, 255, .20);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .24);
    color: #FFFFFF;
    font-weight: 800;
    font-size: .85rem;
}
.navbar.bg-dark-blue .ay-navuser__name {
    color: #FFFFFF;
    font-size: .82rem;
    font-weight: 600;
    line-height: 1.2;
}
.ay-navuser__sub {
    color: #C3D2FF;
    font-size: .7rem;
    line-height: 1.2;
}

/* The nav is fixed, so on a narrow screen the collapsed menu must not push the
   account off the edge — it stays on the bar and the menu drops beneath. */
@media (max-width: 991.98px) {
    .navbar.bg-dark-blue .dropdown.ms-auto { order: 2; margin-left: auto !important; }
    .navbar.bg-dark-blue .navbar-toggler { order: 1; }
    .navbar.bg-dark-blue #navbarMain { order: 3; width: 100%; }
}

/* =============================================================================
   67. MASTER SUB-MENU AS A TWO-COLUMN MEGA MENU

   The Master menu is 13 items. In one column that is ~500px of dropdown, taller
   than the space under the nav on a laptop, and the panel is position:absolute
   so the PAGE cannot scroll to reach the overflow.

   Scrolling it was the first fix and it worked, but a dropdown you have to
   scroll hides half its own contents: you cannot see what is on the menu without
   operating it. Two columns show all 13 at once, so nothing is hidden and there
   is nothing to scroll.

   CSS multi-column rather than grid, deliberately: `columns` fills DOWN then
   across, so the workflow order still reads 1-7 down the first column and 8-13
   down the second. A grid with auto-flow row would deal the items left-right and
   scramble that sequence.
   ========================================================================== */

@media (min-width: 1200px) {
    .main-menu .app-menu #menuMaster .sub-menu {
        /* ⚠ display MUST be overridden. The theme sets `display: grid` on
           .sub-menu, and CSS multi-column is ignored outright on a grid
           container — column-count computed as 2 while every item still stacked
           in one column, because the grid was laying them out instead.
           Block is what makes `columns` take effect.

           Columns rather than a 2-track grid on purpose: they balance themselves
           whatever the item count, which matters because permissions hide rows,
           and they fill DOWN then across so the workflow order still reads 1-7
           down the first column and 8-13 down the second. A grid with auto-flow
           row would deal the items left-right and scramble that sequence. */
        display: block !important;

        /* Wide enough for two full labels ("Manage Vehicle Types" is the longest)
           without wrapping. min() keeps it inside a narrow laptop viewport. */
        width: min(560px, calc(100vw - 40px));
        column-count: 2;
        column-gap: 10px;
        /* The divider between the columns: makes it read as two lists rather than
           one list that happens to have wrapped. */
        column-rule: 1px solid var(--ay-line);
        padding: 10px !important;

        /* SOLID BORDER, as asked. The 1px hairline from section 4 nearly vanished
           against the page behind it; at this size the panel is a surface in its
           own right and needs to state its edge. */
        border: 2px solid var(--ay-brand-700) !important;
        border-radius: 14px !important;

        /* No scrolling needed at 13 items, but the cap stays as a backstop: if the
           menu ever outgrows two columns this degrades to a scroll rather than
           running off the bottom of the screen again. */
        max-height: min(70vh, 520px);
        overflow-y: auto;
        overflow-x: hidden;
    }

    /* A row must never be split across the column break. */
    .main-menu .app-menu #menuMaster .sub-menu .menu-item {
        break-inside: avoid;
        page-break-inside: avoid;   /* older WebKit */
    }

    /* Give each row a little more height now there is width to spare. */
    .main-menu .app-menu #menuMaster .sub-menu .menu-link {
        padding: 10px 12px !important;
    }
}

/* Below 1200px the menu is the off-canvas drawer, not a floating panel: it is
   already a single scrolling column the full height of the screen. Two columns
   there would halve the label width for no gain. */
@media (max-width: 1199.98px) {
    .main-menu .app-menu #menuMaster .sub-menu {
        column-count: 1;
        width: auto;
        max-height: none;
        overflow-y: visible;
    }
}


/* =============================================================================
   68. ROUTE MANAGEMENT DASHBOARD  —  .rm-*

   The page was a bare Bootstrap table with two header rows of different widths
   (7 and 8) over 8-cell body rows, so from column 4 onwards every label sat
   above the wrong data. It is now one header row of seven columns inside the
   design system's own card and table, so it reads like the rest of the product.
   ========================================================================== */

/* Right-align the three count columns and give them tabular figures, so the
   numbers line up on the decimal rather than drifting with glyph width. */
.rm-table th.num,
.rm-table td.num {
    text-align: right;
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum" 1;
    font-weight: 700;
    color: var(--ay-ink);
    white-space: nowrap;
}

/* The employee count opens the passenger list, so it has to look pressable. */
.rm-link {
    color: var(--ay-brand-600);
    font-weight: 700;
    cursor: pointer;
    border-bottom: 1px dashed var(--ay-brand-100);
}
.rm-link:hover { color: var(--ay-brand-800); border-bottom-color: var(--ay-brand-500); }

/* Actions wrap rather than stretch the row: a shift with routes carries three
   buttons, one without carries one. */
.rm-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.rm-btn {
    --edge: 2px;
    padding: 6px 11px;
    font-size: .74rem;
    white-space: nowrap;
}

.rm-alerts { display: grid; gap: 2px; font-size: .76rem; line-height: 1.35; }

/* Summary pills in the card header. They replace the old second header row,
   which was inside the table and therefore had to pretend to be columns. */
.rm-summary { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }

@media (max-width: 767.98px) {
    .rm-summary { width: 100%; margin-top: 8px; }
}


/* =============================================================================
   69. ROUTE PLANNER MODAL  —  #vendor-modal

   It opened with a map fixed at 700px tall inside a fullscreen modal whose body
   has roughly 600px on a laptop, so the route panel beside it was pushed off the
   bottom of the screen and the planner appeared to be a map and nothing else.

   The fixes are: give the body the height it actually has and let it scroll,
   size the map to its column rather than to a constant, and bring the type down
   so a route with a dozen stops fits without scrolling to read a name.
   ========================================================================== */

#vendor-modal .modal-content {
    /* Fullscreen dialog: pin the content to the viewport so the body below can
       be given a real height to divide up. */
    height: 100vh;
    max-height: 100vh;
    overflow: hidden;
}

#vendor-modal .modal-header {
    padding: 10px 16px;
    background: var(--ay-brand-800);
    color: #fff;
    flex: 0 0 auto;
}
#vendor-modal .modal-title { font-size: 1rem; font-weight: 700; }

/* A close button that is unmistakably a close button. The default btn-close is a
   small dark glyph, which on this dark header was nearly invisible. */
#vendor-modal .btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
    opacity: .9;
    width: 1.1rem;
    height: 1.1rem;
}
#vendor-modal .btn-close:hover { opacity: 1; }

#vendor-modal .modal-body {
    /* Everything the header does not take. The body scrolls, not the page. */
    height: calc(100vh - 52px);
    overflow-y: auto;
    padding: 12px;
    font-size: .82rem;          /* was 15px — smaller, so more fits */
}

/* The two columns stay side by side and each own half the height. On a narrow
   screen they stack, and the map keeps a usable minimum. */
#vendor-modal .modal-body > .row { height: 100%; margin: 0; }
#vendor-modal .modal-body > .row > [class^="col-"] {
    height: 100%;
    overflow-y: auto;
    padding: 0 8px;
}

#vendor-modal #map {
    width: 100%;
    height: 100%;
    min-height: 320px;
    border-radius: 10px;
}

/* Compact the panel: tables, inputs and buttons all come down a size so a full
   route list is readable without scrolling for every name. */
#vendor-modal table { font-size: .78rem; }
#vendor-modal table td,
#vendor-modal table th { padding: 5px 7px; vertical-align: middle; }
#vendor-modal .form-select,
#vendor-modal .form-control { font-size: .8rem; padding: 4px 8px; }
#vendor-modal .btn { font-size: .78rem; padding: 5px 10px; }
#vendor-modal label { font-size: .78rem; margin-bottom: 2px; }

@media (max-width: 991.98px) {
    #vendor-modal .modal-body > .row > [class^="col-"] { height: auto; overflow: visible; }
    #vendor-modal #map { height: 42vh; }
}


/* =============================================================================
   70. ROUTE PLANNER MAP POPUP  —  the Google InfoWindow

   Google puts its own close button in an absolutely-positioned box above the
   content, which reserves a strip of empty space across the whole top of the
   bubble. Ours sits on the same line as the employee name instead, so that strip
   is dead weight — hidden here, and the padding it reserved is reclaimed.
   ========================================================================== */

/* Google's default close control. Ours is inside the content, labelled "Close",
   and aligned with the name. */
#vendor-modal .gm-style-iw button.gm-ui-hover-effect,
#vendor-modal .gm-style-iw-chr { display: none !important; }

/* The bubble reserves top padding for that button; take it back. */
#vendor-modal .gm-style-iw-c { padding: 10px !important; }
#vendor-modal .gm-style-iw-d { overflow: auto !important; }


/* =============================================================================
   71. PASSENGER LIST POPUP  —  .emp-card

   It was a fifteen-column table inside a modal. Half the columns sat off the
   right edge — "Shift Direction" onwards — so reading a three-person route meant
   dragging a horizontal scrollbar to reach the rest of each row.

   One card per passenger, facts in two columns inside it, and the cards
   themselves two to a row: a whole route is visible without scrolling.
   ========================================================================== */

.emp-cards-body { padding: 14px; }

.emp-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(330px, 1fr));
    gap: 10px;
}

.emp-card {
    border: 1px solid var(--ay-line);
    border-radius: 12px;
    background: #fff;
    padding: 10px 12px;
}

.emp-card__head {
    display: flex;
    align-items: center;
    gap: 9px;
    padding-bottom: 8px;
    margin-bottom: 8px;
    border-bottom: 1px solid var(--ay-line-soft);
}

/* The stop number. This is the pickup order, which is what the map markers show,
   so the two read the same way. */
.emp-card__seq {
    width: 24px; height: 24px; flex: 0 0 24px;
    border-radius: 7px;
    display: grid; place-items: center;
    background: var(--ay-brand-700); color: #fff;
    font-size: .72rem; font-weight: 800;
}

.emp-card__name { font-size: .86rem; font-weight: 700; color: var(--ay-ink); }
.emp-card__sub  { font-size: .72rem; color: var(--ay-muted); }

.emp-card__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px 12px; }
.emp-card__k {
    font-size: .62rem; font-weight: 800; letter-spacing: .06em;
    text-transform: uppercase; color: var(--ay-muted);
}
.emp-card__v { font-size: .76rem; color: var(--ay-ink-2); word-break: break-word; }

/* The reorder buttons are secondary to the data; shrink them to match. */
.emp-card__head .btn { padding: 2px 7px; font-size: .68rem; line-height: 1.2; }


/* =============================================================================
   72. ROUTE PLANNER ROUTE LIST

   The route table was 487px of content in a 410px panel, so its last column —
   the one carrying Cancel trip — sat past the right edge and could only be
   reached by dragging a horizontal scrollbar. Compacted to fit.
   ========================================================================== */

#vendor-modal #TableBody,
#vendor-modal #TableBody + *,
#vendor-modal table:has(#TableBody) {
    font-size: .72rem;
}
#vendor-modal table:has(#TableBody) th,
#vendor-modal table:has(#TableBody) td {
    padding: 5px 6px;
    vertical-align: top;
}

/* Headers were holding the table wider than its pane on their own: a nowrap
   heading cannot be narrower than its own text. Let them wrap — a two-line
   heading costs nothing and buys the row the width it needs. (The last 16px
   came from "Vendor/Vehicle", a single unbreakable token with no space to wrap
   on; that header is now just "Vendor".) */
#vendor-modal table:has(#TableBody) th {
    white-space: normal;
    line-height: 1.2;
}

/* The Office cell carries the campus AND the numbered passenger list, which is
   what makes the row wide. Let it wrap on WORD boundaries — break-word here
   snapped mid-word ("Sharp Kraft Bangal ore", "Emplo yee43"), which is harder to
   read than a slightly taller row. */
#vendor-modal table:has(#TableBody) td:nth-child(4) {
    min-width: 120px;
    white-space: normal;
    overflow-wrap: break-word;   /* only breaks a word that cannot fit at all */
    word-break: normal;
}

/* The panel holds a table, a vendor picker and a filter; the map is happy with
   less. 44/56 rather than 50/50 buys the table the width it needs so nothing has
   to be squeezed to the point of breaking words. */
#vendor-modal .modal-body > .row > .col-md-6:first-child  { flex: 0 0 44%; max-width: 44%; }
#vendor-modal .modal-body > .row > .col-md-6:last-child   { flex: 0 0 56%; max-width: 56%; }

/* Cancel is an action, not data: keep it on one line and compact. */
#vendor-modal table:has(#TableBody) td:last-child .btn {
    padding: 3px 7px;
    font-size: .68rem;
    white-space: nowrap;
}

/* ============================================================================
   MONTHLY MESSAGING CONSUMPTION  (.ay-months)
   ----------------------------------------------------------------------------
   The "SMS per month" list on the company dashboard and on the super admin's
   company page. Both render it inside a one-third bento column, which is why it
   is not built on .ay-rank: that component gives its label and its meta text a
   whole line each and pushes the score out on its own, so in a narrow column
   "Aug 2026" wrapped onto two lines and "15 OTP - 0 alert" collided with the
   figure it belonged to.

   Here the month, the bar and the total share ONE row on a three-column grid --
   two fixed ends and an elastic middle -- so the row cannot reflow no matter how
   narrow the card gets. Both fixed columns are nowrap with tabular figures, so
   the numbers line up vertically down the list.

   The bar is STACKED rather than single: OTP SMS first, alert SMS after it, both
   as a share of the busiest month. That is the whole question this list answers
   -- how much of the bill is boarding codes and how much is notifications --
   without spending a second line on it. Colours are the same brand/violet pair
   the strip above the list uses for the same two things.
   ========================================================================== */
.ay-months { display: flex; flex-direction: column; gap: 10px; }

.ay-months__row {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 10px;
}

.ay-months__m {
    font-size: .78rem;
    font-weight: 700;
    color: var(--ay-ink);
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.ay-months__bar {
    display: flex;
    height: 8px;
    border-radius: var(--ay-r-pill);
    background: var(--ay-slate-50);
    overflow: hidden;
    min-width: 0;
}
.ay-months__seg { height: 100%; }
.ay-months__seg--otp   { background: linear-gradient(90deg, #1B2F6B, #5A83E8); }
.ay-months__seg--alert { background: linear-gradient(90deg, #5B21B6, #8B5CF6); }

.ay-months__n {
    font-size: .88rem;
    font-weight: 800;
    color: var(--ay-ink);
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

/* Legend for the two segments. Sits above the list so the colours are named
   before they are used, not after. */
.ay-months__key {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 11px;
    font-size: .72rem;
    color: var(--ay-muted);
}
.ay-months__key span { display: inline-flex; align-items: center; gap: 6px; }

/* The swatch carries its OWN block name rather than a bare .otp / .alert.
   `.alert` is a Bootstrap COMPONENT class (padding, border, radius) and bootstrap.css
   loads before this file, so a 10px legend square marked .alert rendered as a full
   alert box roughly three times the size of the one beside it. Anything generic
   enough to read as a plain English word is already taken somewhere in that theme. */
.ay-months__sw {
    width: 10px; height: 10px; border-radius: 3px;
    display: inline-block; flex: none;
}
.ay-months__sw--otp   { background: linear-gradient(90deg, #1B2F6B, #5A83E8); }
.ay-months__sw--alert { background: linear-gradient(90deg, #5B21B6, #8B5CF6); }


/* -----------------------------------------------------------------------------
   73. SHOW / HIDE PASSWORD  —  .ay-pw
   -----------------------------------------------------------------------------
   The "eye" toggle that ayaka-theme.js attaches to every input[type="password"]
   in the product. Three decisions in here are load-bearing.

   1. THIS IS NOT A BOOTSTRAP .input-group, and must never become one.
      jquery-validate's default errorPlacement is error.insertAfter(element), so
      the moment a field fails validation a <label class="error"> is injected
      immediately after the input — i.e. INSIDE whatever wraps it. Inside an
      .input-group that label becomes a flex item on the same row, picked up by
      .input-group > :not(:first-child) with its negative margin, and the
      neighbouring .form-control (flex: 1 1 auto; width: 1%) collapses to a
      sliver. A plain position:relative block wrapper takes the injected label
      on its own line and nothing moves.

   2. THE PADDING SELECTOR IS DELIBERATELY (0,2,1).
      Section 13 (~line 846) carries `input[type="text"].form-control { padding:
      9px 12px }`, which is also (0,2,1). The instant the toggle flips the field
      to type="text" that rule starts matching and re-asserts the padding
      SHORTHAND, wiping any padding-right set at lower specificity — the
      revealed characters then run underneath the eye. Matching its specificity
      and sitting later in the file is what keeps the gutter. This section stays
      at the END of this file for that reason; do not move it up.

   3. HEIGHT IS A FALLBACK, NOT THE MECHANISM.
      height:100% is only what the button uses until the JS has measured the
      field once (#addVendorModal is display:none at attach time, so its field
      reports offsetHeight 0). ayaka-theme.js sets an explicit pixel height from
      the input itself on show/resize, which also keeps the button off a
      validation label that has grown the wrapper underneath it.

   Colour is var(--ay-faint) (#5A6A8C — 5.36:1 on white, clears the 4.5:1 rule)
   rising to var(--ay-brand-700) on hover. No tint behind white text anywhere.
   -------------------------------------------------------------------------- */
.ay-pw {
    position: relative;
    display: block;
}

/* Defensive only: if a future password field is ever placed inside a Bootstrap
   .input-group, the wrapper becomes the flex item and has to carry the sizing
   the .form-control used to, or it shrink-wraps to nothing. */
.ay-pw--grouped {
    flex: 1 1 auto;
    width: 1%;
    min-width: 0;
}
/* bootstrap.css sizes the field with `.input-group > .form-control`, a CHILD
   combinator, so a field moved one level down into this wrapper stops matching
   it and would fall back to whatever width it has intrinsically. Restate it. */
.ay-pw--grouped > input {
    width: 100%;
}

/* See note 2 above. Both states are listed because the field changes type. */
.ay-pw > input[type="password"],
.ay-pw > input[type="text"] {
    padding-right: 44px;
}

.ay-pw__eye {
    position: absolute;
    top: 0;
    right: 0;
    height: 100%;              /* fallback; JS pins an exact pixel height */
    width: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--ay-faint);
    line-height: 0;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    border-radius: 0 var(--ay-r-sm) var(--ay-r-sm) 0;
    transition: color .15s ease;
}

.ay-pw__eye:hover {
    color: var(--ay-brand-700);
}

/* Keyboard users must be able to see where they are. :focus-visible only, so a
   mouse click on the eye does not leave a ring behind. */
.ay-pw__eye:focus {
    outline: none;
}
.ay-pw__eye:focus-visible {
    color: var(--ay-brand-700);
    outline: 2px solid var(--ay-brand-500);
    outline-offset: -3px;
    border-radius: var(--ay-r-sm);
}

/* pointer-events:none keeps the click target the BUTTON, so event.target is
   never the <svg> or a <path> inside it. */
.ay-pw__eye svg {
    width: 18px;
    height: 18px;
    display: block;
    pointer-events: none;
}

/* Edge and IE render their own reveal control inside the field; two eyes side
   by side, and theirs sits under ours. */
.ay-pw > input::-ms-reveal,
.ay-pw > input::-ms-clear {
    display: none;
}

/* A printed page has no interaction and no reason to show a control. */
@media print {
    .ay-pw__eye { display: none !important; }
    .ay-pw > input[type="password"],
    .ay-pw > input[type="text"] { padding-right: 12px; }
}

/* ============================================================================
   BACK BUTTON — PRE-PAINT SPACE RESERVATION  (partials/_back.blade.php)
   ----------------------------------------------------------------------------
   The Back button ships at the very end of <body> and a footer <script> MOVES
   it into the page. Its FIRST choice is the shared .ay-pagehead component's
   eyebrow line (or title) — see the min-height on .ay-pagehead__eyebrow up in
   section 5, PAGE HEADER, and --ay-back-size below. That placement never needs
   reservation of its own: the row is unconditionally tall enough for the
   button whether it has landed yet or not.

   Everything below is for pages that have NO .ay-pagehead to sit inline with
   (a bare form, the employee portal's own bespoke headers) — there the script
   falls back to insertBefore(btn, el.firstChild) on the top of whichever
   generic content container the page has. That script runs late (after
   several slow, render-blocking library tags), and a browser is free to paint
   the page's already-parsed content before the parser gets that far. Result:
   the container briefly renders WITHOUT the button, then gains ~36px of height
   a moment later when it lands — and a click aimed at something near the top
   of the page (a tab, a heading action) in that gap can miss, with no error
   and no visible cause. Confirmed live, twice, in real Chrome.

   Fix: give each candidate container an empty ::before placeholder, sized to
   the button's own footprint, so the gap already exists at first paint (this
   file loads synchronously in <head>) — then hide the placeholder the moment
   the container's real first child IS the button (:has(> .ay-back:first-child)),
   so the two never stack. This is deliberately a SEPARATE generated box, not a
   padding-top override: several of these containers (.container-fluid under
   the theme's own >=1200px horizontal-layout rule, and Bootstrap's .p-4 on the
   employee portal's bare .page-content) already set padding-top themselves,
   for reasons that have nothing to do with this button — clobbering it with a
   flat reserved value would either lose to that rule's specificity (silently
   reserving nothing) or win and eat the page's own intended top padding. An
   added ::before has no such fight: it stacks with whatever padding-top the
   container already had, exactly as the real button will once it lands.

   ⚠️ This selector list is a hand mirror of the SELECTORS array (plus the
   .page-content fallback) in partials/_back.blade.php's placement script.
   Keep the two in sync:
     - a container the script can land in but that is missing here still has
       the original race.
     - a selector here that the script never actually uses is left with a
       permanent, un-hidden placeholder gap — that is why main.nxl-container
       excludes pages where .main-content also matches (the script prefers
       that inner container, per its own SELECTORS order, and would never
       reach the outer one), why the .page-content fallback excludes every
       container above it (the script only ever reaches that branch when none
       of the others matched ANYWHERE on the page), and why every selector here
       ALSO excludes a container that holds a .ay-pagehead__eyebrow or
       __title — on those pages the button lands inside that row instead
       (INLINE_SELECTORS, tried first), never as this container's own first
       child, so reserving block space here would just be a permanent unused
       gap on top of a page that no longer needs one.
   .emp-wrap is deliberately NOT mirrored here: its one real use
   (employees/index.blade.php) is the employee portal's own home page, and
   partials/_back.blade.php hides the button on every portal's home page —
   so the button can never actually land there, and reserving space would
   only fight that page's own deliberate padding-top for nothing.
   ========================================================================== */
:root {
    /* .ay-back's own box (28px, border-box) + its margin-bottom (8px). */
    --ay-back-reserve: 36px;
    /* .ay-back's own box alone, no margin — for the inline eyebrow/title row,
       where the gap is a right-hand margin instead, not a reserved block. */
    --ay-back-size: 28px;
}

@media (max-width: 575.98px) {
    /* .ay-back shrinks to 24px under this same breakpoint; margin-bottom is unchanged. */
    :root {
        --ay-back-reserve: 32px;
        --ay-back-size: 24px;
    }
}

@media print {
    /* .ay-back is display:none on print (see _back.blade.php) — nothing to reserve. */
    :root {
        --ay-back-reserve: 0px;
        --ay-back-size: 0px;
    }
}

main .main-content:not(:has(.ay-pagehead__eyebrow)):not(:has(.ay-pagehead__title))::before,
.page-content > .container:not(:has(.ay-pagehead__eyebrow)):not(:has(.ay-pagehead__title))::before,
.page-content > .container-fluid:not(:has(.ay-pagehead__eyebrow)):not(:has(.ay-pagehead__title))::before,
main.nxl-container:not(:has(.main-content)):not(:has(.ay-pagehead__eyebrow)):not(:has(.ay-pagehead__title))::before,
body > .container:not(:has(.ay-pagehead__eyebrow)):not(:has(.ay-pagehead__title))::before,
body > .container-fluid:not(:has(.ay-pagehead__eyebrow)):not(:has(.ay-pagehead__title))::before,
.page-content:not(:has(main .main-content)):not(:has(> .container)):not(:has(> .container-fluid)):not(:has(main.nxl-container)):not(:has(.ay-pagehead__eyebrow)):not(:has(.ay-pagehead__title))::before {
    content: "";
    display: block;
    height: var(--ay-back-reserve);
}

main .main-content:has(> .ay-back:first-child)::before,
.page-content > .container:has(> .ay-back:first-child)::before,
.page-content > .container-fluid:has(> .ay-back:first-child)::before,
main.nxl-container:has(> .ay-back:first-child)::before,
body > .container:has(> .ay-back:first-child)::before,
body > .container-fluid:has(> .ay-back:first-child)::before,
.page-content:has(> .ay-back:first-child)::before {
    /* !important is load-bearing here, not decoration: the .page-content fallback's
       reservation selector above needs four :not(:has(...)) guards to only match the
       employee portal's bare wrapper (see the big comment above), and that stack of
       :has() arguments gives it MORE raw specificity than this hide rule's single
       :has() — without !important the reservation's `display: block` was winning even
       once the real button had actually landed, doubling the gap. Confirmed live on
       the employee portal's /profile page: the placeholder stayed display:block with
       .ay-back genuinely sitting at :first-child. !important makes "the real button is
       here" always beat "reserve space for it", regardless of how specific either
       selector list needs to be. */
    display: none !important;
}

/* ============================================================================
   74. STICKY SIDEWAYS SCROLLBAR  —  .ay-hscroll   (client request 2026-09-23)
   ----------------------------------------------------------------------------
   Built by ayaka-theme.js initHScroll() for any scroll container carrying
   data-ay-hscroll (the report tables). It is pinned to the bottom of the
   window over exactly the table's width, and only while the table's own
   scrollbar is below the fold. Above page content, below Bootstrap modals
   (1050+) and SweetAlert (1060).
   ============================================================================ */
.ay-hscroll {
    position: fixed;
    bottom: 0;
    z-index: 1030;
    display: none;
    height: 16px;
    overflow-x: auto;
    overflow-y: hidden;
    background: var(--ay-surface-2);
    border-top: 1px solid var(--ay-line);
    box-shadow: 0 -2px 8px rgba(20, 34, 78, .08);
    /* Firefox: a full-size bar in the theme's muted ink, so it reads as grabbable. */
    scrollbar-width: auto;
    scrollbar-color: var(--ay-muted) transparent;
}
.ay-hscroll.is-on { display: block; }
.ay-hscroll__spacer { height: 1px; }

/* WebKit / Blink. A styled scrollbar is never an overlay one, so on a Mac the bar
   cannot turn into an empty strip whose thumb only appears mid-scroll. */
.ay-hscroll::-webkit-scrollbar { height: 14px; }
.ay-hscroll::-webkit-scrollbar-track { background: transparent; }
.ay-hscroll::-webkit-scrollbar-thumb {
    background: var(--ay-muted);
    border: 3px solid var(--ay-surface-2);
    border-radius: 999px;
}
.ay-hscroll::-webkit-scrollbar-thumb:hover { background: var(--ay-ink); }

@media print {
    .ay-hscroll { display: none !important; }
}

/* ============================================================================
   75. LIVE DASHBOARDS  —  data-live-*   (client decision 2026-10-03)
   ----------------------------------------------------------------------------
   The admin dashboard, the super admin's read-only copy of it and the vendor
   dashboard repaint themselves every 10 s (public/js/dashboard-live.js). A value
   that changed glows once (.ay-live-tick); nothing re-runs its entrance
   animation — a page that re-animates every ten seconds is noise.
   ============================================================================ */

/* A ring of light, never a background: some of these values sit on a coloured pill
   carrying white text, and animating background-color would fade the pill itself to
   transparent (white on white) for most of a second. box-shadow follows the element's
   own corner radius, so a pill glows as a pill. */
@keyframes ay-live-tick {
    0%   { box-shadow: 0 0 0 3px rgba(59, 103, 212, .55); }
    100% { box-shadow: 0 0 0 3px rgba(59, 103, 212, 0); }
}
.ay-live-tick { animation: ay-live-tick .9s ease-out; }
@media (prefers-reduced-motion: reduce) {
    .ay-live-tick { animation: none; }
}

/* "Live · updated 4s ago" beside the clock. Dark ink on light tints, all past
   4.5:1; never white on a pale fill. */
.ay-livestate {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 6px 12px;
    border-radius: var(--ay-r-pill);
    border: 1px solid color-mix(in srgb, var(--ay-success-ink) 22%, transparent);
    background: var(--ay-success-50);
    color: var(--ay-success-ink);
    font-size: .76rem; font-weight: 700;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}
.ay-livestate::before {
    content: ""; width: 7px; height: 7px; border-radius: 50%;
    background: currentColor; flex: 0 0 7px;
}
/* A poll failed: still trying, with back-off. */
.ay-livestate.is-warn {
    background: var(--ay-warning-50); color: var(--ay-warning-ink);
    border-color: color-mix(in srgb, var(--ay-warning-ink) 22%, transparent);
}
/* Signed out / not permitted: the poller has stopped for good. */
.ay-livestate.is-stopped {
    background: var(--ay-slate-50); color: var(--ay-slate-ink);
    border-color: var(--ay-line);
}

/* A region the poll swapped in must not rise in again, and a ring it redrew must not
   pop in again. (0,3,1) / (0,4,1) beat the entrance rules of section "ANIMATION GATE". */
html.ay-anim [data-live-swapped] .ay-rise,
html.ay-anim [data-live-swapped].ay-rise { animation: none; opacity: 1; transform: none; }
html.ay-anim .is-live .ay-pie3d .p3-top   { animation: none; opacity: 1; transform: none; }

/* WOMEN ALONE RIGHT NOW > 0 (2026-10-03, tester issue 3): the magenta tile goes the SOS
   crimson while it is urgent — white on #B01739 is 6.3:1 — on top of the breathing halo
   every urgent tile gets. */
.ay-tile--magenta.is-urgent { --g1: #7A0C22; --g2: #B01739; }

/* A timeline entry that opens a drill-down (the Safety card's "woman alone" line). A real
   <button>, reset to read exactly like its neighbours. */
.ay-tl--btn {
    display: block; width: 100%;
    margin: 0; padding: 0 0 15px;
    border: 0; background: none;
    font: inherit; color: inherit; text-align: left;
    cursor: pointer;
}
.ay-tl--btn:last-child { padding-bottom: 0; }
.ay-tl--btn .ay-tl__title,
.ay-tl--btn .ay-tl__meta { display: block; }
.ay-tl--btn:hover .ay-tl__title { color: var(--ay-brand-700); text-decoration: underline; }
.ay-tl--btn:focus-visible { outline: 2px solid var(--ay-brand-700); outline-offset: 3px; border-radius: 6px; }

/* ============================================================================
   VENDOR TODAY BOARD + LIVE TRACKING LIST (client test report, Nov 2026)
   vendor/partials/today_board (dashboard, live region) and vendor/live_tracking.
   Every pill is dark ink on its own pale tint (the *-50 / *-ink pairs), never
   white on a pastel; all pairs clear 4.5:1.
   ============================================================================ */
.vtb {
    margin: 4px 0 18px;
    padding: 16px 18px 14px;
    background: var(--ay-surface);
    border: 1px solid var(--ay-line);
    border-radius: var(--ay-r-lg);
    box-shadow: var(--ay-shadow-sm);
}
.vtb__head { display: flex; align-items: baseline; gap: 6px 12px; flex-wrap: wrap; }
.vtb__title { margin: 0; font-size: 1.05rem; font-weight: 800; color: var(--ay-ink); }
.vtb__date { font-size: .8rem; font-weight: 700; color: var(--ay-brand-700); }
.vtb__sub { flex: 1 1 100%; font-size: .78rem; color: var(--ay-muted); }

.vtb__strip { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.vtb-count {
    display: inline-flex; align-items: baseline; gap: 6px;
    padding: 5px 11px; border-radius: var(--ay-r-pill);
    font-size: .78rem; font-weight: 700;
    border: 1px solid transparent;
}
.vtb-count b { font-size: .95rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.vtb-count--all  { color: var(--ay-ink);         background: var(--ay-brand-50);   border-color: var(--ay-brand-100); }
.vtb-count--wait { color: var(--ay-warning-ink); background: var(--ay-warning-50); }
.vtb-count--live { color: var(--ay-teal-ink);    background: var(--ay-teal-50); }
.vtb-count--ok   { color: var(--ay-success-ink); background: var(--ay-success-50); }
.vtb-count--done { color: var(--ay-info-ink);    background: var(--ay-info-50); }
.vtb-count--warn { color: var(--ay-danger-ink);  background: var(--ay-danger-50); }
.vtb-count--off  { color: var(--ay-slate-ink);   background: var(--ay-slate-50); }

.vtb__people { margin: 10px 0 0; font-size: .8rem; color: var(--ay-ink-2); }
.vtb__people b { color: var(--ay-ink); font-variant-numeric: tabular-nums; }

.vtb__scroll { margin-top: 12px; overflow-x: auto; border: 1px solid var(--ay-line); border-radius: var(--ay-r); }
.vtb-table { width: 100%; min-width: 860px; border-collapse: collapse; font-size: .84rem; color: var(--ay-ink); }
.vtb-table th {
    padding: 9px 12px; text-align: left; white-space: nowrap;
    font-size: .68rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase;
    color: var(--ay-muted); background: var(--ay-surface-2); border-bottom: 1px solid var(--ay-line);
}
.vtb-table td { padding: 10px 12px; vertical-align: middle; border-bottom: 1px solid var(--ay-line-soft); }
.vtb-table tr:last-child td { border-bottom: 0; }
.vtb-table b { font-weight: 800; }
.vtb-sub { display: block; margin-top: 1px; font-size: .74rem; font-weight: 500; color: var(--ay-muted); }
.vtb-none { color: var(--ay-faint); }

.vtb-shift { display: inline-flex; align-items: center; gap: 9px; }
.vtb-dir {
    width: 26px; height: 26px; flex: 0 0 26px; display: grid; place-items: center;
    border-radius: 8px; color: #FFFFFF; font-size: .72rem;
}
.vtb-dir--login  { background: linear-gradient(135deg, #4C6FE0, #24408E); }
.vtb-dir--logout { background: linear-gradient(135deg, #0B7A92, #0B5F76); }

.vtb-pick { display: inline-flex; align-items: center; gap: 9px; white-space: nowrap; }
.vtb-bar { width: 74px; height: 7px; border-radius: 99px; background: var(--ay-line-soft); overflow: hidden; display: inline-block; }
.vtb-bar__fill { display: block; height: 100%; border-radius: 99px; background: var(--ay-success); }

.vtb-pill, .vtb-flag {
    display: inline-block; padding: 2px 10px; border-radius: var(--ay-r-pill);
    font-size: .72rem; font-weight: 800; white-space: nowrap;
}
.vtb-flag { margin: 1px 4px 1px 0; }
.vtb-pill--wait { color: var(--ay-warning-ink); background: var(--ay-warning-50); border: 1px solid #FEDF89; }
.vtb-pill--live { color: var(--ay-teal-ink);    background: var(--ay-teal-50);    border: 1px solid #A5F0FC; }
.vtb-pill--ok   { color: var(--ay-success-ink); background: var(--ay-success-50); border: 1px solid #A6F4C5; }
.vtb-pill--done { color: var(--ay-info-ink);    background: var(--ay-info-50);    border: 1px solid #B2CCFF; }
.vtb-pill--warn, .vtb-flag--warn { color: var(--ay-danger-ink); background: var(--ay-danger-50); border: 1px solid #FECDCA; }
.vtb-pill--off,  .vtb-flag--off  { color: var(--ay-slate-ink);  background: var(--ay-slate-50);  border: 1px solid var(--ay-line); }

.vtb-track {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 12px; border: 0; border-radius: var(--ay-r-sm);
    font-size: .78rem; font-weight: 700; white-space: nowrap;
    color: #FFFFFF; background: var(--ay-brand-700); cursor: pointer;
}
.vtb-track:hover { background: var(--ay-brand-800); color: #FFFFFF; }
.vtb-track:focus-visible { outline: 2px solid var(--ay-brand-700) !important; outline-offset: 2px; }
/* The cab company has not been given Live Tracking: no Track buttons, no Track column. */
.vtb--notrack .vtb-track { display: none; }
.vtb--notrack .vc-actions a[href*="track_vehicle"] { display: none; }
/* ...nor the Trips option: the cards' links open the Trips page. */
.vtb--notrips .vc-actions a[href^="/trip_list"] { display: none; }
.vtb--notrack .vtb-table th:last-child,
.vtb--notrack .vtb-table td:last-child { display: none; }

.vtb__empty {
    margin-top: 12px; padding: 16px; text-align: center; font-size: .86rem;
    color: var(--ay-muted); background: var(--ay-brand-50);
    border: 1px dashed var(--ay-line); border-radius: var(--ay-r);
}

/* EXPORT TO EXCEL button (partials/_export_button). Its own colours, NOT .btn-success: in
   the vendor and super-admin shells .btn-success is a light teal, and white on it is 2.5:1.
   White on --ay-success (#027A48) is 5.4:1, on its ink 7.5:1. */
.btn.ay-btn-export {
    color: #FFFFFF; background: var(--ay-success); border: 1px solid var(--ay-success);
    font-weight: 700; white-space: nowrap;
}
.btn.ay-btn-export:hover, .btn.ay-btn-export:focus, .btn.ay-btn-export:active {
    color: #FFFFFF; background: var(--ay-success-ink); border-color: var(--ay-success-ink);
}
.btn.ay-btn-export:disabled { color: #FFFFFF; background: var(--ay-success-ink); border-color: var(--ay-success-ink); opacity: .9; }
.btn.ay-btn-export:focus-visible { outline: 2px solid var(--ay-success-ink) !important; outline-offset: 2px; }

/* ROUTES PAGE additions (client test report, Nov 2026): who is not routed, the route lock,
   and the planner's hint line. Dark ink on pale tints; every pair clears 4.5:1. */
.rm-campus { font-weight: 800; color: var(--ay-ink); }
.rm-dir { font-size: .76rem; font-weight: 700; color: var(--ay-muted); }
.rm-unrouted {
    display: block; margin-top: 3px; padding: 3px 8px; border-radius: var(--ay-r-sm);
    border: 1px solid #FECDCA; background: var(--ay-danger-50); color: var(--ay-danger-ink);
    font-size: .76rem; font-weight: 600; text-align: left; line-height: 1.35; cursor: pointer; max-width: 300px;
}
.rm-unrouted b { font-weight: 800; }
.rm-unrouted i { margin-left: 4px; font-size: .72rem; }
.rm-unrouted:hover { background: #FEE4E2; }
.rm-unrouted:focus-visible { outline: 2px solid var(--ay-danger-ink) !important; outline-offset: 2px; }
.rm-locked {
    display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px; border-radius: var(--ay-r-sm);
    border: 1px solid var(--ay-line); background: var(--ay-slate-50); color: var(--ay-slate-ink);
    font-size: .78rem; font-weight: 700; cursor: pointer;
}
.rm-locked:hover { background: #E4E7EC; }
.rm-hint { margin-top: 5px; font-size: .72rem; color: var(--ay-muted); }
.rm-modal-hint { margin-left: 12px; font-size: .78rem; color: var(--ay-muted); }
/* TRIP ALERTS (company and cab company dashboards). Dark ink on white; the icon chip is the
   only coloured part and every pair clears 4.5:1. */
.ay-talerts { margin: 12px 0 16px; padding: 12px 15px 6px; background: var(--ay-surface);
    border: 1px solid var(--ay-line); border-radius: var(--ay-r); box-shadow: var(--ay-shadow-xs); }
.ay-talerts__head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 6px;
    font-size: .86rem; font-weight: 800; color: var(--ay-ink); }
.ay-talerts__head i { color: var(--ay-brand-700); }
.ay-talerts__head span { font-size: .74rem; font-weight: 500; color: var(--ay-muted); }
.ay-talerts__list { list-style: none; margin: 0; padding: 0; }
.ay-talert { display: flex; gap: 10px; align-items: flex-start; padding: 7px 0; border-top: 1px solid var(--ay-line-soft);
    font-size: .84rem; color: var(--ay-ink-2); }
.ay-talert:first-child { border-top: 0; }
.ay-talert__icon { flex: 0 0 26px; height: 26px; display: grid; place-items: center; border-radius: 8px; font-size: .74rem; }
.ay-talert--warn .ay-talert__icon { background: var(--ay-warning-50); color: var(--ay-warning-ink); }
.ay-talert--bad  .ay-talert__icon { background: var(--ay-danger-50);  color: var(--ay-danger-ink); }
.ay-talert--info .ay-talert__icon { background: var(--ay-info-50);    color: var(--ay-info-ink); }
.ay-talert--ok   .ay-talert__icon { background: var(--ay-success-50); color: var(--ay-success-ink); }
.ay-talert__body { flex: 1 1 auto; min-width: 0; }
.ay-talert__body strong { color: var(--ay-ink); }
.ay-talert__when { flex: 0 0 auto; font-size: .74rem; color: var(--ay-muted); white-space: nowrap; }

/* The company's Cancel trip dialog: billing choice + "the cab cannot continue". */
.rm-cancel { text-align: left; font-size: .9rem; color: var(--ay-ink); }
.rm-cancel p { margin: 0 0 10px; }
.rm-cancel__warn { padding: 8px 11px; border-radius: var(--ay-r-sm); background: var(--ay-warning-50); color: var(--ay-warning-ink); border: 1px solid #FEDF89; }
.rm-cancel__set { margin: 0 0 10px; padding: 9px 12px 6px; border: 1px solid var(--ay-line); border-radius: var(--ay-r-sm); }
.rm-cancel__set legend { float: none; width: auto; margin: 0; padding: 0 5px; font-size: .78rem; font-weight: 800; color: var(--ay-muted); }
.rm-cancel__set label, .rm-cancel__check { display: flex; gap: 8px; align-items: flex-start; margin: 0 0 7px; font-weight: 400; cursor: pointer; }
.rm-cancel__set input, .rm-cancel__check input { margin-top: 4px; flex: 0 0 auto; }

.rm-pop__lead { margin: 0 0 10px; font-weight: 700; color: var(--ay-ink); }
.rm-pop__wrap { max-height: 320px; overflow: auto; border: 1px solid var(--ay-line); border-radius: var(--ay-r-sm); }
.rm-pop__table { width: 100%; border-collapse: collapse; font-size: .84rem; text-align: left; color: var(--ay-ink); }
.rm-pop__table th { position: sticky; top: 0; padding: 8px 10px; background: var(--ay-surface-2); font-size: .7rem;
    letter-spacing: .04em; text-transform: uppercase; color: var(--ay-muted); border-bottom: 1px solid var(--ay-line); }
.rm-pop__table td { padding: 8px 10px; border-bottom: 1px solid var(--ay-line-soft); vertical-align: top; }
.rm-pop__sub { font-size: .76rem; color: var(--ay-muted); }
.rm-pop__foot { margin: 12px 0 0; font-size: .82rem; color: var(--ay-ink-2); text-align: left; }

/* The row an auto "Export to Excel" button sits in, above its table (ayaka-export.js). */
.ay-export-bar { display: flex; justify-content: flex-end; margin: 8px 0; }

/* Live Tracking list: its search box and the driver's presence under his name. */
.vlt-tools { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 12px; }
.vlt-search { flex: 1 1 260px; max-width: 420px; }
.vlt-tools__count { font-size: .8rem; color: var(--ay-muted); }
.vlt-phone { font-size: .76rem; color: var(--ay-ink-2); }
.vlt-phone a { color: var(--ay-brand-700); font-weight: 700; }

/* =====================================================================================
   REPORT LIBRARY (client test report, Nov 2026) - resources/views/reports/hub + show.
   One hub and one report page shared by the company, the cab company and the Ayaka master
   login, so the styles live here and not in one portal's page. Dark ink on white; the only
   coloured parts are icon chips and the tile accents, and every pair clears 4.5:1.
   ===================================================================================== */
.rl-range { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 14px; margin-bottom: 16px; padding: 13px 15px;
    background: var(--ay-surface); border: 1px solid var(--ay-line); border-radius: var(--ay-r); }
.rl-range__dates { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; }
.rl-range__dates input { width: auto; min-width: 150px; }
.rl-lbl { display: block; margin: 0 0 3px; font-size: .7rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--ay-muted); }
.rl-presets { display: flex; flex-wrap: wrap; gap: 6px; }
.rl-preset { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--ay-line); background: var(--ay-surface);
    font-size: .78rem; font-weight: 600; text-decoration: none; color: var(--ay-ink-2); }
.rl-preset:hover { border-color: var(--ay-brand-500); color: var(--ay-brand-700); }
.rl-preset--on, .rl-preset--on:hover { background: var(--ay-brand-700); border-color: var(--ay-brand-700); color: #FFFFFF; }
.rl-find { position: relative; margin-left: auto; min-width: 230px; }
.rl-find i { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--ay-faint); font-size: .82rem; pointer-events: none; }
.rl-find input { padding-left: 31px; }
.rl-pick { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; margin-bottom: 16px; padding: 13px 15px;
    background: var(--ay-surface); border: 1px solid var(--ay-line); border-radius: var(--ay-r); }
.rl-pick select { min-width: 260px; width: auto; }

.rl-group { margin-bottom: 22px; }
.rl-group__title { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; font-size: .78rem; font-weight: 800;
    letter-spacing: .08em; text-transform: uppercase; color: var(--ay-muted); }
.rl-group__title i { color: var(--ay-brand-700); }
.rl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(288px, 1fr)); gap: 12px; }
.rl-card { display: flex; gap: 13px; align-items: flex-start; padding: 15px 16px; border-radius: var(--ay-r);
    border: 1px solid var(--ay-line); background: var(--ay-surface); text-decoration: none; color: inherit;
    transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease; }
.rl-card:hover { transform: translateY(-2px); border-color: var(--ay-brand-500); box-shadow: var(--ay-shadow-sm); color: inherit; }
.rl-card:focus-visible { outline: 2px solid var(--ay-brand-500); outline-offset: 2px; }
.rl-card__icon { flex: none; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 10px;
    background: var(--ay-brand-50); color: var(--ay-brand-700); font-size: .95rem; }
.rl-card__body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.rl-card__name { font-weight: 700; font-size: .93rem; color: var(--ay-ink); }
.rl-card__blurb { font-size: .78rem; line-height: 1.45; color: var(--ay-muted); }
.rl-card__go { margin-left: auto; align-self: center; color: var(--ay-faint); }
.rl-card--locked { background: var(--ay-slate-50); cursor: not-allowed; }
.rl-card--locked:hover { transform: none; border-color: var(--ay-line); box-shadow: none; }
.rl-card--locked .rl-card__icon { background: #E4E7EC; color: var(--ay-slate-ink); }
.rl-card__lock { margin-top: 3px; font-size: .74rem; font-weight: 700; color: var(--ay-slate-ink); }
.rl-empty { margin-bottom: 18px; padding: 26px; text-align: center; color: var(--ay-muted);
    background: var(--ay-surface); border: 1px dashed var(--ay-line); border-radius: var(--ay-r); }
/* the search hides with the hidden attribute, which must win over display:flex / grid */
.rl-card[hidden], .rl-group[hidden], .rl-empty[hidden], .rl-table tr[hidden] { display: none; }

.rl-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin-bottom: 14px; }
.rl-tile { padding: 12px 14px; background: var(--ay-surface); border: 1px solid var(--ay-line); border-left: 4px solid var(--ay-brand-700);
    border-radius: var(--ay-r-sm); box-shadow: var(--ay-shadow-xs); }
.rl-tile--ok   { border-left-color: var(--ay-success); }
.rl-tile--warn { border-left-color: #B54708; }
.rl-tile--bad  { border-left-color: #B42318; }
.rl-tile__label { font-size: .72rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--ay-muted); }
.rl-tile__value { margin-top: 2px; font-size: 1.25rem; font-weight: 800; line-height: 1.25; color: var(--ay-ink); overflow-wrap: anywhere; }

.rl-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 11px 15px; border-bottom: 1px solid var(--ay-line-soft); }
.rl-bar__count { margin-right: auto; font-size: .84rem; color: var(--ay-muted); }
.rl-bar input[type="search"] { width: auto; min-width: 220px; }
.rl-scroll { max-height: 70vh; overflow: auto; }
.rl-table { width: 100%; margin: 0; border-collapse: separate; border-spacing: 0; font-size: .84rem; color: var(--ay-ink); }
.rl-table thead th { position: sticky; top: 0; z-index: 1; padding: 9px 11px; background: var(--ay-surface-2); border-bottom: 1px solid var(--ay-line);
    font-size: .7rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--ay-muted); text-align: left; white-space: nowrap; }
.rl-table tbody td, .rl-table tfoot td { padding: 8px 11px; border-bottom: 1px solid var(--ay-line-soft); vertical-align: top; }
.rl-table tbody tr:hover td { background: var(--ay-brand-50); }
.rl-table .rl-num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.rl-table thead th.rl-num { text-align: right; }
.rl-table tfoot td { position: sticky; bottom: 0; background: var(--ay-surface-2); border-top: 1px solid var(--ay-line); font-weight: 800; }
.rl-table td.rl-wide { min-width: 220px; }
/* a date, a time, a plate: never broken over two lines */
.rl-table td.rl-short { white-space: nowrap; }
.rl-notes { margin: 14px 0 26px; padding: 12px 16px 12px 34px; background: var(--ay-surface); border: 1px solid var(--ay-line);
    border-radius: var(--ay-r); font-size: .82rem; color: var(--ay-ink-2); }
.rl-notes li { margin: 3px 0; }
.rl-notes__head { margin: 0 0 4px -18px; font-size: .72rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--ay-muted); list-style: none; }
.rl-alert { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 14px; padding: 11px 14px; border-radius: var(--ay-r-sm);
    border: 1px solid #FEDF89; background: var(--ay-warning-50); color: var(--ay-warning-ink); font-size: .86rem; }
.rl-alert--bad { border-color: #FDA29B; background: var(--ay-danger-50); color: var(--ay-danger-ink); }
@media (max-width: 720px) {
    .rl-find { margin-left: 0; width: 100%; }
    .rl-grid { grid-template-columns: 1fr; }
    .rl-range__dates input { min-width: 0; }
}
