/**
 * SNOVA admin design system.
 * Vendor layout primitives remain underneath; this file owns the product identity.
 *
 * ── THE PALETTE IS SAMPLED FROM THE LOGO, NOT CHOSEN BESIDE IT ──────────────
 *
 * Every brand value below was read out of the logo artwork itself: the navy the
 * bird's underside is drawn in (#00246C family), the azure of its wing
 * (#309CCC), and the ice highlight along the top edge (#9CE4F0). Picking a blue
 * that merely looks close would drift the moment the mark is placed next to a
 * surface it tinted.
 *
 * ── ON-PRIMARY TEXT IS DARK, AND THAT IS MEASURED ───────────────────────────
 *
 * White on #3fa9e5 is 2.6:1 and fails WCAG AA outright. The deep navy below is
 * 6.9:1 against the same fill, so every control that paints itself primary
 * carries `--snova-on-primary` rather than white. This is the same relationship
 * the previous amber theme had, which is why the swap needed no structural
 * change — only the hues moved.
 *
 * ── SEMANTIC COLOUR IS NOT BRAND COLOUR ─────────────────────────────────────
 *
 * Success green, danger red and the status hues are deliberately untouched by
 * the rebrand. They encode approved/rejected/failed, and repainting them to
 * match a logo would delete information from every screen that reports state.
 */

:root {
    --bs-font-sans-serif: 'IBM Plex Sans Arabic', 'Public Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --snova-canvas: #0b1430;
    --snova-canvas-deep: #070f26;
    --snova-surface: #121d42;
    --snova-border: rgba(255, 255, 255, 0.075);
    --snova-border-strong: rgba(255, 255, 255, 0.13);
    --snova-text: #f4f8ff;
    --snova-muted: #98a7c9;
    --snova-primary: #3fa9e5;
    --snova-primary-strong: #6cc8f5;
    --snova-primary-soft: rgba(63, 169, 229, 0.14);
    --snova-accent: #9ce4f0;
    /* 6.9:1 on --snova-primary. Never white: that pairing measures 2.6:1. */
    --snova-on-primary: #06152f;
    --snova-brand-navy: #00246c;
    --snova-brand-ice: #c0f0f0;
    --snova-radius-sm: 0.65rem;
    --snova-radius: 0.95rem;
    --snova-shadow-sm: 0 8px 24px rgba(3, 8, 26, 0.14);
    --snova-shadow: 0 20px 55px rgba(3, 8, 26, 0.24);

    /*
     * ── THE TEXT RAMP ───────────────────────────────────────────────────────
     *
     * Four weights, because the panel was already using four and only naming
     * two. The light theme carried var(--snova-text), var(--snova-text-body), var(--snova-text-soft) and var(--snova-muted) as
     * literals across thirty-three component rules, which is how a fifth nearly
     * identical grey gets added by somebody eyedropping a screenshot.
     *
     * `--snova-text` is the strongest and `--snova-muted` the weakest; the two
     * between them are what a table body and an outline button were already
     * using.
     */
    --snova-text-body: #dbe4f7;
    --snova-text-soft: #b9c6e4;

    /*
     * ── SPACING ─────────────────────────────────────────────────────────────
     *
     * A 4px base on a 1.5 ratio, which is what the panel's existing paddings
     * already round to. Named rather than typed so two components asking for
     * "a comfortable gap" get the same one.
     */
    --snova-space-1: 0.25rem;
    --snova-space-2: 0.5rem;
    --snova-space-3: 0.75rem;
    --snova-space-4: 1rem;
    --snova-space-5: 1.5rem;
    --snova-space-6: 2rem;
    --snova-space-7: 3rem;

    /*
     * ── TYPE ────────────────────────────────────────────────────────────────
     *
     * The sizes the screens actually use today, given names. The vendor theme
     * still supplies heading sizes; these are for the panel's own components,
     * which had been typing `0.78rem` and `0.8rem` at each other.
     */
    --snova-text-xs: 0.72rem;
    --snova-text-sm: 0.8rem;
    --snova-text-base: 0.9375rem;
    --snova-text-lg: 1.05rem;
    --snova-text-xl: 1.35rem;
    --snova-text-2xl: 1.75rem;
}

/*
 * ── THE FRAMEWORK'S OWN TOKENS, POINTED AT THE BRAND ────────────────────────
 *
 * The vendor core stylesheet ships its own `--bs-primary`, and
 * every Bootstrap component that was never restyled here — input focus rings,
 * form-check marks, spinners, progress bars, list-group active states — reads
 * that variable rather than ours. Overriding only `--snova-*` therefore
 * rebranded the screens this file had already touched and left everything else
 * amber, which reads as a half-finished theme rather than a deliberate one.
 *
 * Bridging the two here means a component nobody has styled yet still comes out
 * on-brand, and the next palette change stays a one-line edit above.
 */
:root {
    --bs-primary: var(--snova-primary);
    --bs-primary-rgb: 63, 169, 229;
    --bs-link-color: var(--snova-primary);
    --bs-link-color-rgb: 63, 169, 229;
    --bs-link-hover-color: var(--snova-primary-strong);
    --bs-link-hover-color-rgb: 108, 200, 245;
    --bs-focus-ring-color: rgba(63, 169, 229, 0.4);
    --bs-primary-bg-subtle: rgba(63, 169, 229, 0.14);
    --bs-primary-border-subtle: rgba(63, 169, 229, 0.32);
    --bs-primary-text-emphasis: var(--snova-primary-strong);
    --bs-body-bg: var(--snova-canvas);
    --bs-body-bg-rgb: 11, 20, 48;
    --bs-border-color: var(--snova-border-strong);
}

.light-style {
    --snova-canvas: #f4f7fc;
    --snova-canvas-deep: #ffffff;
    --snova-surface: #ffffff;
    --snova-border: rgba(22, 43, 78, 0.08);
    --snova-border-strong: rgba(22, 43, 78, 0.15);
    --snova-text: #17233d;
    --snova-text-body: #33415f;
    --snova-text-soft: #43516d;

    /*
     * DARKENED FROM #6f7d98 ON 2026-09-10, AND THE REASON IS MEASURED.
     *
     * The old value is 3.86:1 against this canvas and 4.15:1 against white —
     * both below the 4.5:1 WCAG AA needs for normal text. `.text-muted` carries
     * secondary labels, hints and timestamps all over the panel, at normal size,
     * so the failure was not a corner case.
     *
     * This value measures 4.78:1 on the canvas and 5.13:1 on white. Same hue,
     * still clearly the quietest step in the ramp.
     *
     * The dark theme's #98a7c9 was already fine at 7.52:1 and is untouched.
     */
    --snova-muted: #616e88;
    --snova-primary-soft: rgba(63, 169, 229, 0.12);
    --snova-shadow-sm: 0 8px 24px rgba(22, 43, 78, 0.07);
    --snova-shadow: 0 20px 55px rgba(22, 43, 78, 0.12);
    --bs-body-bg: var(--snova-canvas);
    --bs-body-bg-rgb: 244, 247, 252;
    --bs-border-color: var(--snova-border-strong);
}

html { scroll-behavior: smooth; }

body {
    background: radial-gradient(circle at 85% -10%, rgba(63, 169, 229, 0.075), transparent 28rem), var(--snova-canvas);
    color: var(--snova-text);
    -webkit-font-smoothing: antialiased;
}

.layout-navbar-fixed .layout-wrapper:not(.layout-without-menu) .layout-page {
    padding-block-start: 4.5rem !important;
}

.content-wrapper .navbar { z-index: auto; }

::selection { color: var(--snova-on-primary); background: var(--snova-primary); }
a { text-underline-offset: 0.18em; }

code,
.font-latin {
    direction: ltr;
    unicode-bidi: embed;
    font-variant-numeric: tabular-nums;
}

.skip-link {
    position: fixed;
    z-index: 1100;
    inset-block-start: 0.75rem;
    inset-inline-start: 0.75rem;
    padding: 0.65rem 1rem;
    color: var(--snova-on-primary);
    background: var(--snova-primary);
    border-radius: var(--snova-radius-sm);
    transform: translateY(-150%);
    transition: transform 0.15s ease;
}

.skip-link:focus { color: var(--snova-on-primary); transform: translateY(0); }

/* Shell */
.layout-wrapper,
.layout-container,
.layout-page,
.content-wrapper { background: transparent !important; }

.layout-page { min-width: 0; }
.container-xxl { max-width: 100% !important; }

.container-p-y {
    padding-block: 1.75rem 2.5rem !important;
    padding-inline: clamp(1rem, 2vw, 2rem) !important;
}

#admin-main:focus { outline: 0; }

/* Sidebar */
.layout-menu {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.025), transparent 18rem), var(--snova-canvas-deep) !important;
    border-inline-end: 1px solid var(--snova-border);
    box-shadow: 16px 0 40px rgba(3, 8, 26, 0.12);
}

.light-style .layout-menu {
    background: linear-gradient(180deg, rgba(63, 169, 229, 0.06), transparent 18rem), var(--snova-canvas-deep) !important;
    box-shadow: 16px 0 40px rgba(22, 43, 78, 0.06);
}

[dir='rtl'].light-style .layout-menu { box-shadow: -16px 0 40px rgba(22, 43, 78, 0.06); }

.light-style .layout-menu .menu-header-text { color: var(--snova-muted); }
.light-style .layout-menu .menu-link { color: #53627f; }
.light-style .layout-menu .menu-link:hover,
.light-style .layout-menu .menu-item.active > .menu-link,
.light-style .layout-menu .menu-item.open > .menu-link.menu-toggle { color: var(--snova-text) !important; }
.light-style .layout-menu .menu-icon { color: var(--snova-muted); }

[dir='rtl'] .layout-menu { box-shadow: -16px 0 40px rgba(3, 8, 26, 0.12); }

.layout-menu .app-brand {
    height: 5.25rem !important;
    padding-inline: 1.25rem;
    border-block-end: 1px solid var(--snova-border);
}

.layout-menu .app-brand-link { min-width: 0; gap: 0.7rem; }

/*
 * The logo, unplated.
 *
 * This used to be a gradient tile with a glyph centred in it, because there was
 * no mark to show. There is one now, and it already carries its own metal
 * gradient from navy to ice — sitting it on a coloured plate would put two
 * gradients in a 41px square and muddy both. The glow is the only affordance
 * kept: it separates the logo's darkest navy from the sidebar behind it, which
 * is nearly the same colour by design.
 */
.admin-brand-mark {
    flex: 0 0 auto;
    width: 2.55rem;
    height: 2.55rem;
    object-fit: contain;
    filter: drop-shadow(0 6px 16px rgba(63, 169, 229, 0.35));
}
.admin-brand-copy { min-width: 0; line-height: 1.1; }

.admin-brand-name {
    display: block;
    overflow: hidden;
    color: var(--snova-text);
    font-size: 1.02rem;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.admin-brand-label {
    display: block;
    margin-block-start: 0.22rem;
    color: var(--snova-muted);
    font-size: 0.67rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.layout-menu .menu-inner { padding: 0.75rem 0.8rem 1.5rem !important; }
.layout-menu .menu-header { margin-block-start: 0.9rem; padding: 0.65rem 0.75rem 0.35rem; }

.layout-menu .menu-header-text {
    color: #67789e;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.11em;
}

.layout-menu .menu-item { margin-block: 0.14rem; }

.layout-menu .menu-link {
    min-height: 2.7rem;
    color: #b5c2de;
    border: 1px solid transparent;
    border-radius: 0.72rem;
    transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.layout-menu .menu-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.045);
    border-color: var(--snova-border);
    transform: translateX(2px);
}

[dir='rtl'] .layout-menu .menu-link:hover { transform: translateX(-2px); }
.layout-menu .menu-icon { color: #8294b8; transition: color 0.15s ease; }

.layout-menu .menu-item.active > .menu-link,
.layout-menu .menu-item.open > .menu-link.menu-toggle {
    color: #fff !important;
    background: linear-gradient(90deg, var(--snova-primary-soft), rgba(63, 169, 229, 0.06)) !important;
    border-color: rgba(63, 169, 229, 0.2);
    box-shadow: none !important;
}

.layout-menu .menu-item.active > .menu-link::before {
    position: absolute;
    inset-block: 0.55rem;
    inset-inline-start: -0.82rem;
    width: 0.22rem;
    content: '';
    background: var(--snova-primary);
    border-radius: 2rem;
    box-shadow: 0 0 14px rgba(63, 169, 229, 0.55);
}

.layout-menu .menu-item.active > .menu-link .menu-icon,
.layout-menu .menu-item.open > .menu-link .menu-icon { color: var(--snova-primary); }
.layout-menu .menu-sub .menu-link { min-height: 2.35rem; font-size: 0.86rem; }

/* Cover nested links too: the vendor active-item rule otherwise paints them white. */
html.light-style .layout-wrapper .layout-menu .menu-inner .menu-link:hover,
html.light-style .layout-wrapper .layout-menu .menu-inner .menu-link:focus-visible,
html.light-style .layout-wrapper .layout-menu .menu-inner .menu-item.active > .menu-link,
html.light-style .layout-wrapper .layout-menu .menu-inner .menu-item.active > .menu-link > div:not(.badge),
html.light-style .layout-wrapper .layout-menu .menu-inner .menu-item.open > .menu-link.menu-toggle {
    color: var(--snova-text) !important;
}

/* Top bar */
.layout-navbar {
    min-height: 4.15rem;
    margin-block-start: 1rem;
    color: var(--snova-text);
    background: rgba(20, 32, 70, 0.82) !important;
    border: 1px solid var(--snova-border) !important;
    border-radius: var(--snova-radius) !important;
    box-shadow: var(--snova-shadow-sm) !important;
    backdrop-filter: blur(18px);
}

.light-style .layout-navbar { background: rgba(255, 255, 255, 0.88) !important; }

.admin-topbar-context { min-width: 0; }

.admin-topbar-kicker {
    display: block;
    color: var(--snova-primary);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.11em;
    text-transform: uppercase;
}

.admin-topbar-title {
    display: block;
    overflow: hidden;
    max-width: 34rem;
    color: var(--snova-text);
    font-size: 0.92rem;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.admin-locale-button,
.admin-user-trigger {
    color: #c4cfe8 !important;
    background: rgba(255, 255, 255, 0.035);
    border: 1px solid var(--snova-border) !important;
}

.light-style .admin-locale-button,
.light-style .admin-user-trigger {
    color: var(--snova-text-soft) !important;
    background: rgba(22, 43, 78, 0.035);
}

.admin-locale-button:hover,
.admin-user-trigger:hover {
    color: #fff !important;
    background: rgba(255, 255, 255, 0.07);
    border-color: var(--snova-border-strong) !important;
}

.light-style .admin-locale-button:hover,
.light-style .admin-user-trigger:hover {
    color: var(--snova-text) !important;
    background: rgba(63, 169, 229, 0.1);
}

.admin-locale-button {
    display: inline-flex;
    min-height: 2.45rem;
    align-items: center;
    gap: 0.45rem;
    padding-inline: 0.75rem !important;
    border-radius: 0.72rem !important;
}

.admin-user-trigger {
    display: flex !important;
    min-height: 2.75rem;
    align-items: center;
    gap: 0.65rem;
    padding: 0.25rem 0.35rem 0.25rem 0.75rem !important;
    border-radius: 0.85rem;
}

[dir='rtl'] .admin-user-trigger { padding: 0.25rem 0.75rem 0.25rem 0.35rem !important; }
.admin-user-copy { max-width: 10rem; line-height: 1.15; }

.admin-user-name,
.admin-user-role {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.admin-user-name { color: var(--snova-text); font-size: 0.79rem; font-weight: 600; }
.admin-user-role { margin-block-start: 0.15rem; color: var(--snova-muted); font-size: 0.66rem; }

.admin-avatar-fallback {
    display: grid;
    width: 100%;
    height: 100%;
    place-items: center;
    color: var(--snova-on-primary);
    background: linear-gradient(135deg, var(--snova-primary), #a8dcf7);
    font-weight: 800;
}

.dropdown-menu {
    background: #16224b;
    border: 1px solid var(--snova-border-strong);
    border-radius: var(--snova-radius);
    box-shadow: var(--snova-shadow);
}

.light-style .dropdown-menu { background: #fff; }

.dropdown-item { border-radius: 0.55rem; }

/* Page headers */
.admin-page-header { position: relative; padding-block: 0.35rem 0.4rem; }

.admin-page-header h1 {
    margin: 0;
    color: var(--snova-text);
    font-size: clamp(1.45rem, 2vw, 2rem);
    font-weight: 700;
    letter-spacing: -0.03em;
}

.admin-page-header p {
    max-width: 52rem;
    margin-block-start: 0.5rem;
    color: var(--snova-muted) !important;
    line-height: 1.75;
}

.admin-page-back {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-block-end: 0.65rem;
    color: var(--snova-muted);
    font-size: 0.78rem;
    font-weight: 600;
}

.admin-page-actions { padding-block-start: 0.2rem; }
.admin-page-header .badge { vertical-align: 0.18em; }

/* Legacy CRUD screens still use a two-column title row. Keep them visually
   aligned with the shared page-header while they are migrated incrementally. */
.row.g-6 > .col-md-6:first-child > h4.mt-6 {
    margin-block-start: 0 !important;
    color: var(--snova-text);
    font-size: clamp(1.45rem, 2vw, 2rem);
    font-weight: 700;
    letter-spacing: -0.03em;
}

.row.g-6 > .col-md-6:first-child > h4.mt-6 + p { color: var(--snova-muted) !important; }
[dir='rtl'] .admin-page-back .ti { transform: scaleX(-1); }

/* Cards */
.card,
.block {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.018), transparent 65%), var(--snova-surface) !important;
    border: 1px solid var(--snova-border) !important;
    border-radius: var(--snova-radius) !important;
    box-shadow: var(--snova-shadow-sm) !important;
}

.card-header,
.block-header {
    color: var(--snova-text);
    background: transparent !important;
    border-block-end: 1px solid var(--snova-border) !important;
}

.card-title,
.card-header h5,
.block-title { color: var(--snova-text); font-weight: 650; letter-spacing: -0.015em; }

/*
 * A heading tag used AS the card header keeps its outline level and loses its
 * outline size. Screens picked h2 (captain dossier, rewards, settings groups)
 * or h5 (everything else) for the same visual job, so the same card read twice
 * as large on one screen as on the next. One size for all of them; the tag
 * still tells assistive tech where the section starts.
 */
h1.card-header, h2.card-header, h3.card-header, h4.card-header, h5.card-header, h6.card-header {
    margin-block-end: 0;
    font-size: 1.125rem;
    font-weight: 650;
    letter-spacing: -0.015em;
    line-height: 1.4;
}

.admin-stat-card {
    overflow: hidden;
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.admin-stat-card::after {
    position: absolute;
    inset-block: 0;
    inset-inline-start: 0;
    width: 0.22rem;
    content: '';
    background: var(--stat-color, var(--snova-primary));
    opacity: 0.9;
}

.admin-stat-card[data-tone='danger'] { --stat-color: #ff5f73; }
.admin-stat-card[data-tone='success'] { --stat-color: #9ce4f0; }
.admin-stat-card[data-tone='primary'] { --stat-color: #7f86ff; }
.admin-stat-card[data-tone='info'] { --stat-color: #3dc8ee; }
.admin-stat-card[data-tone='warning'] { --stat-color: #3fa9e5; }
.admin-stat-card[data-tone='secondary'] { --stat-color: #9aa8c6; }

.admin-stat-card:has(.stretched-link):hover {
    border-color: color-mix(in srgb, var(--stat-color) 45%, transparent) !important;
    box-shadow: 0 18px 40px rgba(3, 8, 26, 0.28) !important;
    transform: translateY(-3px);
}

.admin-stat-label { display: block; margin-block-end: 0.45rem; color: var(--snova-muted); font-size: 0.78rem; }
.admin-stat-value { color: var(--snova-text); font-size: 2rem; font-weight: 700; letter-spacing: -0.04em; line-height: 1; }

.admin-stat-icon {
    width: 3rem;
    height: 3rem;
    border: 1px solid color-mix(in srgb, var(--stat-color) 30%, transparent);
    background: color-mix(in srgb, var(--stat-color) 13%, transparent) !important;
    color: var(--stat-color) !important;
    border-radius: 0.9rem !important;
}

.admin-stat-link-hint {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    margin-block-start: 0.8rem;
    color: var(--stat-color);
    font-size: 0.7rem;
    font-weight: 600;
}

/* Forms: every field rule lives in admin-fields.css (2026-10-19). */

.btn {
    min-height: 2.55rem;
    border-radius: var(--snova-radius-sm);
    font-weight: 600;
    box-shadow: none;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn:hover { transform: translateY(-1px); }

.btn-primary {
    color: var(--snova-on-primary) !important;
    background: linear-gradient(135deg, var(--snova-primary-strong), #2b8fd4) !important;
    border-color: transparent !important;
    box-shadow: 0 8px 20px rgba(63, 169, 229, 0.18) !important;
}

.btn-primary:hover,
.btn-primary:focus { box-shadow: 0 10px 26px rgba(63, 169, 229, 0.28) !important; }
.btn-outline-secondary { color: #c2cde6; border-color: var(--snova-border-strong); }
.light-style .btn-outline-secondary { color: var(--snova-text-soft); }
.btn-icon { min-height: 2.35rem; border-radius: 0.7rem !important; }

/* Tables */
.table-responsive,
.card-datatable {
    border-radius: 0 0 var(--snova-radius) var(--snova-radius);
    scrollbar-color: rgba(63, 169, 229, 0.4) rgba(255, 255, 255, 0.035);
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
}

.table {
    --bs-table-bg: transparent;
    --bs-table-border-color: var(--snova-border);
    margin-block-end: 0;
    color: #d6def0;
}

.light-style .table { color: var(--snova-text-body); }

.table > :not(caption) > * > * { padding: 0.9rem 1rem; vertical-align: middle; }

.table thead th {
    color: #8d9dbf;
    background: rgba(255, 255, 255, 0.018);
    border-block-end-color: var(--snova-border-strong);
    font-size: 0.67rem;
    font-weight: 700;
    letter-spacing: 0.065em;
    text-transform: uppercase;
    white-space: nowrap;
}

.light-style .table thead th {
    color: #64728d;
    background: rgba(22, 43, 78, 0.025);
}

.table-hover > tbody > tr:hover > * { --bs-table-accent-bg: rgba(63, 169, 229, 0.025); color: var(--snova-text); }
.table a:not(.btn) { color: #8fd0f5; }
.table code { color: #d6def0; }
.light-style .table a:not(.btn) { color: #167cad; }
.light-style .table code { color: var(--snova-text-body); }

.dataTables_wrapper,
.dt-container {
    padding-block-end: 0.75rem;
    background: var(--snova-surface);
    border: 1px solid var(--snova-border);
    border-radius: var(--snova-radius);
    box-shadow: var(--snova-shadow-sm);
}

.dataTables_wrapper .table,
.dt-container .table { border-block: 1px solid var(--snova-border); }
.pagination { gap: 0.3rem; }

.page-link {
    min-width: 2.25rem;
    color: #c4cfe8;
    text-align: center;
    background: var(--snova-surface);
    border: 1px solid var(--snova-border);
    border-radius: 0.6rem !important;
}

.light-style .page-link { color: var(--snova-text-soft); }

.active > .page-link,
.page-link.active { color: var(--snova-on-primary); background: var(--snova-primary); border-color: var(--snova-primary); }

/* Feedback */
.alert { border-width: 1px; border-radius: var(--snova-radius-sm); }
.badge { padding: 0.42em 0.68em; border-radius: 0.5rem; font-weight: 600; }
.admin-empty-state { padding-block: 4rem !important; }

.admin-empty-icon {
    display: grid;
    width: 3.5rem;
    height: 3.5rem;
    margin: 0 auto 1rem;
    place-items: center;
    color: var(--snova-primary);
    background: var(--snova-primary-soft);
    border: 1px solid rgba(63, 169, 229, 0.18);
    border-radius: 1rem;
}

.nav-pills .nav-link { border: 1px solid transparent; border-radius: 0.65rem; }
.nav-pills .nav-link.active { color: var(--snova-on-primary); background: var(--snova-primary); }

/* The selection box itself is dressed as a field in admin-fields.css. */
.select2-container { width: 100% !important; }

.select2-container--default .select2-selection--multiple {
    min-height: 2.15rem;
    padding-block: 0.15rem;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice {
    margin-block: 0.15rem;
    color: var(--snova-on-primary);
    background: var(--snova-primary);
    border: 0;
    border-radius: 0.4rem;
    font-size: 0.75rem;
    font-weight: 600;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
    color: var(--snova-on-primary);
    margin-inline-end: 0.25rem;
}

.select2-container--default .select2-results__option--highlighted[aria-selected],
.select2-container--default .select2-results__option--highlighted.select2-results__option--selectable {
    color: var(--snova-on-primary);
    background: var(--snova-primary);
}

.select2-dropdown {
    color: var(--snova-text);
    background: #16224b;
    border-color: var(--snova-border-strong);
}

.light-style .select2-dropdown {
    color: var(--snova-text);
    background: #fff;
}

.admin-notifications-menu { min-width: min(20rem, calc(100vw - 2rem)); }
.admin-notifications-list { max-height: 20rem; overflow-y: auto; }

.admin-quick-action.admin-theme-toggle {
    display: inline-grid;
    width: 2.45rem;
    min-height: 2.45rem;
    padding: 0 !important;
    color: var(--snova-text) !important;
    place-items: center;
    background: transparent;
    border: 1px solid var(--snova-border) !important;
    border-radius: 0.72rem;
}

.admin-theme-toggle:hover { color: var(--snova-primary) !important; background: var(--snova-primary-soft); }

.admin-role-icon,
.admin-catalog-hub-icon {
    display: grid;
    width: 3rem;
    height: 3rem;
    color: var(--snova-primary);
    background: var(--snova-primary-soft);
    border: 1px solid rgba(63, 169, 229, 0.2);
    border-radius: 0.9rem;
    place-items: center;
    font-size: 1.35rem;
}

.admin-role-actions { border-block-start: 1px solid var(--snova-border); }
.admin-catalog-hub-card { transition: transform 0.18s ease, border-color 0.18s ease; }
.admin-catalog-hub-card:hover { border-color: rgba(63, 169, 229, 0.4) !important; transform: translateY(-2px); }
[dir='rtl'] .admin-catalog-hub-card .ti-chevron-right { transform: scaleX(-1); }

.admin-file-field {
    padding: 1rem;
    background: color-mix(in srgb, var(--snova-surface) 80%, var(--snova-canvas));
    border: 1px solid var(--snova-border);
    border-radius: var(--snova-radius-sm);
}

/* Footer */
.content-footer { color: var(--snova-muted); background: transparent !important; }
.admin-footer { border-block-start: 1px solid var(--snova-border); }

.admin-build-marker {
    color: #7082a8;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.62rem;
    letter-spacing: 0.04em;
}

/* Login */
.admin-auth-page {
    min-height: 100vh;
    background: radial-gradient(circle at 12% 10%, rgba(156, 228, 240, 0.13), transparent 28rem), radial-gradient(circle at 90% 84%, rgba(63, 169, 229, 0.12), transparent 25rem), var(--snova-canvas-deep);
}

.admin-auth-shell {
    display: grid;
    width: min(72rem, calc(100% - 2rem));
    min-height: min(43rem, calc(100vh - 3rem));
    margin: 1.5rem auto;
    overflow: hidden;
    grid-template-columns: minmax(0, 1.08fr) minmax(24rem, 0.92fr);
    background: var(--snova-surface);
    border: 1px solid var(--snova-border-strong);
    border-radius: 1.6rem;
    box-shadow: 0 35px 90px rgba(2, 6, 22, 0.38);
}

.admin-auth-story {
    position: relative;
    display: flex;
    overflow: hidden;
    padding: clamp(2rem, 4vw, 4rem);
    flex-direction: column;
    justify-content: space-between;
    background: radial-gradient(ellipse at 100% 0, rgba(156, 228, 240, .14), transparent 65%), linear-gradient(145deg, #102b48, #154c71);
    border-inline-end: 1px solid var(--snova-border);
}

.admin-auth-story::before,
.admin-auth-story::after {
    position: absolute;
    content: '';
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 50%;
}

.admin-auth-story::before { inset-block-end: -10rem; inset-inline-end: -7rem; width: 26rem; height: 26rem; }
.admin-auth-story::after { inset-block-end: -4rem; inset-inline-end: -1rem; width: 14rem; height: 14rem; }

.admin-auth-brand {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.admin-auth-brand .admin-brand-mark { width: 3rem; height: 3rem; }
.admin-auth-brand strong { display: block; color: #fff; font-size: 1.1rem; }
.admin-auth-brand small { color: #b9cee0; }
.admin-auth-message { position: relative; z-index: 1; max-width: 30rem; }

.admin-auth-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    color: var(--snova-accent);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.admin-auth-message h1 {
    margin: 1rem 0;
    color: #fff;
    font-size: clamp(2rem, 4vw, 3.65rem);
    font-weight: 750;
    letter-spacing: -0.055em;
    line-height: 1.08;
}

.admin-auth-message p { max-width: 27rem; color: #a8b6d2; font-size: 1rem; line-height: 1.8; }
[dir='rtl'] .admin-auth-message h1 { line-height: 1.4; letter-spacing: 0; }
/* Fields show focus with their own ring (admin-fields.css); buttons and checks keep the outline. */
.admin-auth-form :is(button, .form-check-input):focus-visible { outline: 3px solid var(--snova-primary); outline-offset: 3px; }

.admin-auth-route {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 0.7rem;
    color: #8798ba;
    font-size: 0.78rem;
}

.admin-auth-route::before { width: 2.7rem; height: 1px; content: ''; background: linear-gradient(90deg, var(--snova-primary), transparent); }
.admin-auth-panel { display: flex; padding: clamp(2rem, 5vw, 4rem); align-items: center; justify-content: center; }
.admin-auth-form { width: min(100%, 25rem); }
.admin-auth-form h2 { color: #fff; font-size: 1.75rem; font-weight: 700; letter-spacing: -0.035em; }
.admin-auth-form > p { margin-block: 0.6rem 2rem; color: var(--snova-muted); line-height: 1.7; }

.admin-auth-submit { min-height: 3rem; margin-block-start: 0.5rem; }

.light-style .admin-auth-page {
    background: radial-gradient(circle at 12% 10%, rgba(63, 169, 229, 0.1), transparent 28rem), var(--snova-canvas);
}

.light-style .admin-auth-story {
    color: #f4f8ff;
    background: linear-gradient(145deg, #07122e, #10214e);
}

.light-style .admin-auth-form h2 { color: var(--snova-text); }

@media (max-width: 1199.98px) {
    .layout-menu { box-shadow: var(--snova-shadow); }
    .admin-topbar-context { display: none; }
}

@media (max-width: 991.98px) {
    .admin-auth-shell { grid-template-columns: 1fr; }
    .admin-auth-story { min-height: 16rem; border-inline-end: 0; border-block-end: 1px solid var(--snova-border); }
    .admin-auth-message h1 { max-width: 31rem; font-size: 2.35rem; }
    .admin-auth-message p,
    .admin-auth-route { display: none; }
}

@media (max-width: 767.98px) {
    .container-p-y { padding-block: 1.25rem 2rem !important; padding-inline: 0.85rem !important; }
    .layout-navbar { min-height: 3.8rem; margin: 0.75rem 0.75rem 0; padding-inline: 0.7rem; }
    .admin-user-copy,
    .admin-locale-name { display: none; }
    .admin-locale-button { width: 2.5rem; padding: 0 !important; justify-content: center; }
    .admin-user-trigger { padding: 0.2rem !important; background: transparent; border-color: transparent !important; }
    .admin-page-header { display: block !important; }
    .admin-page-header h1 { font-size: 1.45rem; }
    .admin-page-actions { width: 100%; margin-block-start: 1rem; }
    .admin-page-actions .btn { flex: 1 1 auto; }
    .row.g-6 { --bs-gutter-y: 1.1rem; }
    .card-body,
    .card-header { padding: 1rem; }
    .table > :not(caption) > * > * { padding: 0.8rem; }

    .admin-responsive-table thead { display: none; }
    .admin-responsive-table,
    .admin-responsive-table tbody,
    .admin-responsive-table tr,
    .admin-responsive-table td { display: block; width: 100%; }
    .admin-responsive-table { min-width: 0 !important; }
    .admin-responsive-table tr { padding: 0.8rem 1rem; border-block-end: 1px solid var(--snova-border); }
    .admin-responsive-table tr:last-child { border-block-end: 0; }
    .admin-responsive-table td {
        display: grid;
        padding: 0.3rem 0 !important;
        grid-template-columns: minmax(6rem, 0.75fr) minmax(0, 1.25fr);
        gap: 0.75rem;
        border: 0 !important;
    }
    .admin-responsive-table td::before {
        content: attr(data-label);
        color: #7f90b2;
        font-size: 0.68rem;
        font-weight: 700;
        letter-spacing: 0.045em;
        text-transform: uppercase;
    }
    .admin-responsive-table td > * { min-width: 0; overflow-wrap: anywhere; }

    .content-footer .footer-container { padding-inline: 0.85rem; text-align: center; }
    .admin-auth-shell { width: calc(100% - 1rem); min-height: calc(100vh - 1rem); margin: 0.5rem; border-radius: 1.2rem; }
    .admin-auth-story { min-height: 12rem; padding: 1.5rem; }
    .admin-auth-message h1 { margin-block-end: 0; font-size: 1.8rem; }
    .admin-auth-eyebrow { display: none; }
    .admin-auth-panel { padding: 1.5rem; }
}

/* Captain dossier */
.admin-captain-hero { overflow: hidden; }

.admin-captain-hero__grid {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) minmax(12rem, 16rem);
    gap: 1.5rem 2rem;
    align-items: start;
}

.admin-captain-photo {
    position: relative;
    width: 7.5rem;
    height: 7.5rem;
    overflow: hidden;
    border: 3px solid var(--snova-border-strong);
    border-radius: 1.35rem;
    background: #111b3e;
}

.admin-captain-photo.is-online { border-color: var(--snova-accent); box-shadow: 0 0 0 4px rgba(156, 228, 240, 0.18); }

.admin-captain-photo img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.admin-captain-photo__fallback {
    display: grid;
    width: 100%;
    height: 100%;
    place-items: center;
    color: var(--snova-on-primary);
    background: linear-gradient(135deg, var(--snova-primary), #a8dcf7);
    font-size: 2.2rem;
    font-weight: 800;
}

.admin-captain-photo--card {
    flex: 0 0 auto;
    width: 3.25rem;
    height: 3.25rem;
    border-width: 2px;
    border-radius: 0.9rem;
}

.admin-captain-photo--card .admin-captain-photo__fallback {
    font-size: 1.15rem;
}

.admin-captain-photo__pulse {
    position: absolute;
    inset-inline-end: 0.1rem;
    inset-block-end: 0.1rem;
    width: 0.7rem;
    height: 0.7rem;
    border: 2px solid #111b3e;
    border-radius: 50%;
    background: #28c76f;
}

.admin-captain-rating {
    color: var(--snova-primary);
    font-weight: 700;
}

.admin-captain-rating small { color: var(--snova-muted); font-weight: 600; }

.admin-captain-facts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.85rem 1.25rem;
}

.admin-captain-facts dt {
    margin: 0;
    color: var(--snova-muted);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.admin-captain-facts dd { margin: 0.2rem 0 0; color: var(--snova-text); font-weight: 600; }

.admin-captain-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.admin-avatar-note {
    color: var(--snova-muted);
    font-size: 0.8rem;
}

.admin-change-log + .admin-change-log {
    margin-block-start: 0.9rem;
    padding-block-start: 0.9rem;
    border-block-start: 1px solid var(--snova-border);
}

@media (max-width: 991.98px) {
    .admin-captain-hero__grid { grid-template-columns: minmax(0, 1fr); }
    .admin-captain-actions { max-width: 22rem; }
}

.admin-breadcrumbs .breadcrumb { margin: 0; background: transparent; }
.admin-breadcrumbs .breadcrumb-item,
.admin-breadcrumbs .breadcrumb-item a { color: var(--snova-muted); font-size: 0.8rem; }
.admin-breadcrumbs .breadcrumb-item.active { color: var(--snova-text); }

.admin-quick-action {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    min-height: 2.4rem;
    padding-inline: 0.55rem;
    color: var(--snova-text);
}

.admin-setting-card {
    padding-block-end: 1.25rem;
    border-block-end: 1px solid var(--snova-border);
}

.admin-setting-card:last-child { padding-block-end: 0; border-block-end: 0; }

.admin-setting-card__head {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: space-between;
    margin-block-end: 0.75rem;
}

.admin-setting-card__title {
    margin: 0;
    color: var(--snova-text);
    font-size: 1rem;
    font-weight: 650;
}

.admin-setting-card__current { text-align: end; }

.admin-audit-row + .admin-audit-row {
    margin-block-start: 1rem;
    padding-block-start: 1rem;
    border-block-start: 1px solid var(--snova-border);
}

.admin-document-item,
.admin-change-request {
    scroll-margin-block-start: 7rem;
}

/*
 * A review returns to its card with a #fragment. Land there at once: the smooth
 * page scroll replayed the whole page from the top on every review, and it stalls
 * outright in a tab that is not in front.
 */
html:has(.admin-document-item:target, .admin-change-request:target) {
    scroll-behavior: auto;
}

.admin-document-item + .admin-document-item {
    margin-block-start: 1rem;
    padding-block-start: 1rem;
    border-block-start: 1px solid var(--snova-border);
}

.admin-document-preview {
    display: block;
    width: 100%;
    max-width: 16rem;
    max-height: 12rem;
    height: auto;
    margin-block-start: 0.5rem;
    object-fit: contain;
    background: var(--snova-surface);
    border: 1px solid var(--snova-border);
    border-radius: 0.5rem;
}

/* Order photographs: a fixed frame per shot, the image contained inside it. */
.admin-proof-thumb {
    display: inline-block;
    overflow: hidden;
    border: 1px solid var(--snova-border);
    border-radius: 0.5rem;
    background: var(--snova-surface);
    line-height: 0;
    transition: border-color 0.15s ease, transform 0.15s ease;
}

.admin-proof-thumb:hover,
.admin-proof-thumb:focus-visible {
    border-color: var(--snova-primary);
    transform: translateY(-1px);
}

.admin-proof-thumb img {
    display: block;
    width: 7.5rem;
    height: 5.625rem;
    object-fit: cover;
}

/* An arrow that reads "from → to" in both writing directions. */
[dir='rtl'] .admin-flip-rtl { transform: scaleX(-1); }

.admin-legend-dot {
    display: inline-block;
    width: 0.65rem;
    height: 0.65rem;
    margin-inline-end: 0.35rem;
    border-radius: 50%;
    vertical-align: middle;
}

.admin-legend-dot.is-online { background: #28c76f; }
.admin-legend-dot.is-offline { background: #8395b4; }
.admin-legend-dot.is-order { background: #ea5455; }
.admin-legend-dot.is-secondary { background: #82868b; }
.admin-legend-dot.is-warning { background: #ff9f43; }
.admin-legend-dot.is-danger { background: #ea5455; }
.admin-legend-dot.is-info { background: #00cfe8; }
.admin-legend-dot.is-success { background: #28c76f; }

/*
 * ── VEHICLE IDENTITY ────────────────────────────────────────────────────────
 *
 * The client's vehicle artwork is photographic and lit from the top-left, so it
 * sits on a tile rather than bare on the canvas: against --snova-surface a white
 * refrigerated van loses its own edges. The tile is the same rounded square as
 * .admin-stat-icon, so a vehicle mark and a KPI mark read as one family.
 *
 * `object-fit: contain` is doing real work — the PNGs are normalised to a square
 * canvas but the artwork inside them is not square (the tow truck is 116x48),
 * and stretching a flatbed to fill a tile is how it stops looking like a truck.
 */
.admin-vehicle-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
}

/*
 * Hard caps, not hopes. These PNGs are 128×128; a grid cell's default
 * min-size is the image's intrinsic width, so `width: 2.5rem` alone was
 * being blown out to 128px and every captain card / map pin looked like a
 * billboard. min/max + overflow keep the tile at the size we asked for.
 */
.admin-vehicle-mark {
    display: grid;
    flex-shrink: 0;
    width: 2.5rem;
    height: 2.5rem;
    min-width: 2.5rem;
    min-height: 2.5rem;
    max-width: 2.5rem;
    max-height: 2.5rem;
    overflow: hidden;
    background: var(--snova-primary-soft);
    border: 1px solid var(--snova-border-strong);
    border-radius: 0.7rem;
    place-items: center;
    color: var(--snova-primary);
    font-size: 1.15rem;
}

.admin-vehicle-mark img {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    padding: 0.15rem;
    object-fit: contain;
}

.admin-vehicle-badge[data-size='sm'] .admin-vehicle-mark {
    width: 1.5rem;
    height: 1.5rem;
    min-width: 1.5rem;
    min-height: 1.5rem;
    max-width: 1.5rem;
    max-height: 1.5rem;
    border-radius: 0.4rem;
    font-size: 0.8rem;
}

.admin-vehicle-badge[data-size='lg'] .admin-vehicle-mark {
    width: 3rem;
    height: 3rem;
    min-width: 3rem;
    min-height: 3rem;
    max-width: 3rem;
    max-height: 3rem;
    border-radius: 0.75rem;
    font-size: 1.35rem;
}

.admin-vehicle-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/*
 * ── THE ARTWORK DOES NOT MIRROR UNDER RTL ───────────────────────────────────
 *
 * The chevron rule above flips, and that is right for a chevron: it points at
 * "next", and "next" is the other way in Arabic. These are photographs of real
 * vehicles, and a mirrored photograph is a different vehicle — the scooter's
 * delivery box, the tow truck's cab and every badge and mirror on them end up on
 * the wrong side. So nothing here declares a transform, and the surrounding
 * layout flips around artwork that stays as the client drew it.
 */

/*
 * ── GOOGLE MAPS UNDER LEAFLET (ADR 097, admin-basemap.js) ───────────────────
 *
 * Below every Leaflet pane and blind to the pointer: Leaflet keeps every drag,
 * wheel and click. `!important` because Google writes its own inline position
 * on the element it draws into.
 */
.snova-google-basemap {
    position: absolute !important;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}

.snova-basemap-notice {
    max-width: 22rem;
    margin: 0 0 0.5rem 0.5rem;
    padding: 0.35rem 0.6rem;
    border-radius: 0.375rem;
    background: rgba(234, 84, 85, 0.92);
    color: #fff;
    font-size: 0.75rem;
    line-height: 1.35;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
}

/*
 * ── MAP MARKERS ─────────────────────────────────────────────────────────────
 *
 * A Leaflet DivIcon, not a circleMarker: the vehicle has to be visible at a
 * glance, and the availability ring has to survive being drawn on top of a
 * photograph. The ring is the border, so colour still answers "can this captain
 * take work" before the picture answers "in what".
 */
.admin-map-pin {
    display: grid;
    box-sizing: border-box;
    width: 28px;
    height: 28px;
    min-width: 28px;
    min-height: 28px;
    max-width: 28px;
    max-height: 28px;
    overflow: hidden;
    background: #f4f8ff;
    border: 2px solid #8395b4;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(3, 8, 26, 0.4);
    place-items: center;
}

.admin-map-pin img {
    display: block;
    width: 18px;
    height: 18px;
    max-width: 18px;
    max-height: 18px;
    object-fit: contain;
}

.admin-map-pin .ti {
    font-size: 14px;
    line-height: 1;
}

.admin-map-pin.is-online { border-color: #28c76f; }
.admin-map-pin.is-offline { opacity: 0.55; }

/*
 * Order pins are solid status colours, captains stay vehicle circles.
 * The tones are the same ones OrderStatusStyle gives the table badge.
 */
.admin-map-order {
    display: block;
    box-sizing: border-box;
    width: 16px;
    height: 16px;
    background: #82868b;
    border: 2px solid #fff;
    border-radius: 50%;
    box-shadow: 0 1px 5px rgba(3, 8, 26, 0.45);
}

.admin-map-order.is-secondary { background: #82868b; }
.admin-map-order.is-warning { background: #ff9f43; }
.admin-map-order.is-danger { background: #ea5455; }
.admin-map-order.is-info { background: #00cfe8; }
.admin-map-order.is-success { background: #28c76f; }

.admin-dispatch-map { position: relative; }

.admin-dispatch-map .leaflet-container {
    background: #dbe4ee;
    font-family: inherit;
}

.admin-map-fit {
    position: absolute;
    z-index: 500;
    top: 0.75rem;
    inset-inline-end: 0.75rem;
}

tr[data-order-fly] { cursor: pointer; }

.admin-map-legend .admin-vehicle-badge { font-size: 0.75rem; }

/*
 * A rating star is amber, not brand blue.
 *
 * These five call sites shipped a literal ★ that had been double-encoded
 * somewhere upstream and rendered as "â˜…" on the captains, ratings and customer
 * screens. A glyph from the icon font cannot be re-mangled by a file's encoding,
 * which is the reason to draw it rather than to repair the character. Amber is
 * semantic here in the same way the status colours are — see the note at the top
 * of this file — so it is set explicitly rather than inherited from the brand.
 */
.admin-rating-star { color: #ff9f43; vertical-align: -0.05em; }

/* Artwork inside a filter chip. Sized to the chip's own line-height so a row of
   chips does not grow taller than a row without them. */
.admin-chip-art {
    display: block;
    width: 1.1rem;
    height: 1.1rem;
    min-width: 1.1rem;
    min-height: 1.1rem;
    max-width: 1.1rem;
    max-height: 1.1rem;
    object-fit: contain;
}

/*
 * Catalogue image preview. Fixed box so a row's height does not depend on the
 * aspect ratio of whatever the operator uploaded, and `contain` so a portrait
 * photograph is letterboxed rather than cropped to a detail of itself.
 *
 * `.is-shipped` marks the platform's own artwork rather than an upload: dashed,
 * because the difference between "this row has a picture" and "this row is
 * borrowing one" is the difference between finished and not.
 */
.admin-catalog-thumb {
    width: 4.5rem;
    height: 3rem;
    min-width: 4.5rem;
    max-width: 4.5rem;
    max-height: 3rem;
    object-fit: contain;
}

/*
 * ── SUB-MENU ICONS ──────────────────────────────────────────────────────────
 *
 * The template ships icons only on top-level entries; every child was a bare
 * word, so the three items under «Operations» were told apart by reading them.
 * The sidebar markup gives every child an icon, and the indent was narrowed to
 * pay for it rather than adding to it — otherwise a child row ends up 1.4rem
 * further right than the design.
 *
 * `display` is here because the THEME file, not the core file, hides this icon:
 *
 *     .bg-menu-theme.menu-vertical .menu-sub > .menu-item .menu-link .menu-icon
 *         { display: none }
 *
 * — six classes, in all four theme builds (light, dark, and both RTL). The rule
 * below used to be `.menu-vertical .menu-sub .menu-icon`, three classes, which
 * lost. So the icons never drew, the narrowed indent stayed, and the dot the
 * template draws to mark a child — absolutely positioned at 1.1rem, sized for
 * the 2.625rem indent it no longer had — landed ON TOP of the first letter of
 * every child label. «Live dispatch map» rendered as a dot wearing an L.
 *
 * The selector below therefore matches the theme's weight exactly and wins on
 * order, and the dot is switched off: with an icon in the row it was saying the
 * same thing twice, in the same place. Switched off at the FIRST sub level only
 * — the one the sidebar actually has, where all 17 children carry an icon. A
 * deeper level keeps both the vendor's 3.4rem indent and its dot, so nesting one
 * later does not silently lose its only marker.
 *
 * Lighter and smaller than a parent's icon on purpose: the hierarchy has to
 * survive both rows having a mark.
 */
.bg-menu-theme.menu-vertical .menu-sub > .menu-item > .menu-link .menu-icon {
    display: inline-block;
    margin-inline-end: 0.5rem;
    font-size: 1.05rem;
    opacity: 0.72;
}

.menu-vertical .menu-inner > .menu-item > .menu-sub > .menu-item > .menu-link::before { content: none; }

.menu-vertical .menu-sub .menu-link { padding-inline-start: 1.4rem; }

.menu-vertical .menu-sub .menu-sub > .menu-item > .menu-link { padding-inline-start: 2.5rem; }

.bg-menu-theme.menu-vertical .menu-sub > .menu-item.active > .menu-link .menu-icon { opacity: 1; }

/*
 * The screen's mark, beside its title. Larger than the KPI and catalogue tiles
 * because it is the one thing on the page identifying where the operator is,
 * and it shrinks on a phone where the title has to keep the width.
 */
.admin-page-icon {
    display: grid;
    flex-shrink: 0;
    width: 3.25rem;
    height: 3.25rem;
    background: var(--snova-primary-soft);
    border: 1px solid rgba(63, 169, 229, 0.2);
    border-radius: 1rem;
    place-items: center;
    color: var(--snova-primary);
    font-size: 1.6rem;
}

@media (max-width: 575.98px) {
    .admin-page-icon {
        width: 2.5rem;
        height: 2.5rem;
        border-radius: 0.75rem;
        font-size: 1.2rem;
    }
}

.admin-catalog-thumb.is-shipped {
    padding: 0.15rem;
    border: 1px dashed var(--snova-border-strong);
    border-radius: 0.4rem;
    opacity: 0.85;
}

.admin-action-menu .dropdown-item:disabled,
.admin-action-menu .dropdown-item.disabled { opacity: 0.45; }

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

/* ── live dispatch map ──────────────────────────────────────────────────────
 * A row whose order changed while the operator was looking at the page. The
 * page cannot redraw the row (the Blade template owns that), so it marks it as
 * stale instead of silently showing a status that is no longer true.
 * Honours prefers-reduced-motion: the tint stays, the pulse does not.
 */
.admin-row-changed {
    position: relative;
    animation: admin-row-flash 1.6s ease-out 1;
}

.admin-row-changed::after {
    content: "";
    position: absolute;
    inset-inline-start: 0;
    inset-block: 0;
    inline-size: 3px;
    background: #ff9f43;
}

@keyframes admin-row-flash {
    from { background-color: rgba(255, 159, 67, .22); }
    to   { background-color: transparent; }
}

@media (prefers-reduced-motion: reduce) {
    .admin-row-changed { animation: none; background-color: rgba(255, 159, 67, .12); }
}

/*
 * ── THE ONE SEARCH BOX ──────────────────────────────────────────────────────
 *
 * Navbar-resident, so it sizes against the bar rather than the page: a fixed
 * width would overflow the bar on a laptop and float in the middle of it on a
 * wide monitor.
 *
 * RTL IS HANDLED BY LOGICAL PROPERTIES, NOT A MIRRORED BLOCK. `inset-inline-start`
 * and `padding-inline` flip themselves under dir="rtl", which is the whole
 * panel's direction in Arabic — the primary locale. Writing `left`/`right` here
 * would mean a second copy of this block that drifts.
 */
.admin-search {
    position: relative;
    flex: 1 1 auto;
    max-width: 26rem;
    min-width: 0;
}

.admin-search-icon {
    position: absolute;
    inset-inline-start: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--snova-muted);
    pointer-events: none;
}

/* Scoped to its form so it outranks the generic field padding in admin-fields.css. */
.admin-search .admin-search-input {
    padding-inline: 2.4rem 3.4rem;
    background: var(--snova-canvas-deep);
    border-color: var(--snova-border-strong);
    border-radius: var(--snova-radius-sm);
}

.light-style .admin-search-input {
    background: #fff;
}

/* The browser's own clear button duplicates Escape and crowds the shortcut hint. */
.admin-search-input::-webkit-search-cancel-button {
    display: none;
}

.admin-search-hint {
    position: absolute;
    inset-inline-end: 0.6rem;
    top: 50%;
    transform: translateY(-50%);
    padding: 0.1rem 0.4rem;
    font-size: 0.7rem;
    color: var(--snova-muted);
    background: var(--snova-primary-soft);
    border: 1px solid var(--snova-border-strong);
    border-radius: 0.35rem;
    pointer-events: none;
}

/*
 * Hidden on narrow screens rather than shrunk: a keyboard hint on a device with
 * no keyboard is decoration taking space from the field it decorates.
 */
@media (max-width: 991.98px) {
    .admin-search-hint { display: none; }
    .admin-search .admin-search-input { padding-inline-end: 1rem; }
    .admin-search { max-width: 100%; }
}

.admin-search-results {
    position: absolute;
    inset-inline: 0;
    top: calc(100% + 0.4rem);
    z-index: 1050;
    max-height: 24rem;
    overflow-y: auto;
    padding: 0.4rem;
    background: var(--snova-surface);
    border: 1px solid var(--snova-border-strong);
    border-radius: var(--snova-radius);
    box-shadow: var(--snova-shadow);
}

.light-style .admin-search-results {
    background: #fff;
}

.admin-search-group + .admin-search-group {
    margin-top: 0.35rem;
    padding-top: 0.35rem;
    border-top: 1px solid var(--snova-border);
}

.admin-search-group-label {
    display: flex;
    gap: 0.4rem;
    align-items: center;
    margin: 0.25rem 0.5rem 0.35rem;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--snova-muted);
}

.admin-search-option {
    display: flex;
    gap: 0.75rem;
    align-items: baseline;
    justify-content: space-between;
    padding: 0.5rem 0.6rem;
    color: inherit;
    text-decoration: none;
    border-radius: var(--snova-radius-sm);
}

.admin-search-option:hover,
.admin-search-option.is-active {
    background: var(--snova-primary-soft);
    color: inherit;
}

.admin-search-option-label {
    font-weight: 600;
    overflow-wrap: anywhere;
}

.admin-search-option-meta {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-shrink: 0;
    font-size: 0.8rem;
    color: var(--snova-muted);
}

.admin-search-option-tag {
    padding: 0.05rem 0.4rem;
    background: var(--snova-primary-soft);
    border-radius: 0.35rem;
}

.admin-search-empty {
    margin: 0;
    padding: 0.85rem 0.6rem;
    text-align: center;
    color: var(--snova-muted);
}

.admin-search-all {
    display: flex;
    gap: 0.4rem;
    align-items: center;
    justify-content: center;
    width: 100%;
    margin-top: 0.35rem;
    padding: 0.5rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--snova-primary);
    background: none;
    border: 0;
    border-top: 1px solid var(--snova-border);
    border-radius: var(--snova-radius-sm);
}

.admin-search-all:hover,
.admin-search-all.is-active {
    background: var(--snova-primary-soft);
}

/*
 * ── THE BULK SELECTION BAR ──────────────────────────────────────────────────
 *
 * Sticky at the top of the list rather than pinned to the viewport bottom: the
 * selection belongs to the list it was made in, and a bar floating over the page
 * covers the last row on a short screen — which is the row an operator is most
 * likely to still be deciding about.
 */
.admin-bulk-bar {
    position: sticky;
    top: 4.2rem;
    z-index: 5;
    display: flex;
    gap: 1rem;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    padding: 0.7rem 1rem;
    background: var(--snova-primary-soft);
    border: 1px solid var(--snova-border-strong);
    border-radius: var(--snova-radius);
    box-shadow: var(--snova-shadow-sm);
}

.light-style .admin-bulk-bar {
    background: rgba(63, 169, 229, 0.1);
}

.admin-bulk-count strong {
    font-size: 1.05rem;
}

/*
 * `display: contents` lets the <form> wrap the whole card grid without becoming
 * a grid item itself — the cards stay direct children of the Bootstrap row and
 * keep their column widths. Without it the entire grid collapses into one
 * column, which is what a naive wrapper does to a `.row`.
 */
.d-contents {
    display: contents;
}

/*
 * The comparison line under a KPI. Small and quiet: it qualifies the number
 * above it and must not compete with it for the glance.
 */
.admin-stat-trend {
    display: inline-flex;
    gap: 0.25rem;
    align-items: center;
    margin-top: 0.15rem;
    font-size: 0.78rem;
    font-weight: 500;
}

/*
 * A country flag beside a dial code. Was four copies of the same inline style,
 * two of them inside JavaScript strings — where a change to one is guaranteed
 * not to reach the others.
 */
.admin-flag {
    width: 20px;
    height: 15px;
    margin-inline-end: var(--snova-space-1);
    vertical-align: -0.1em;
}

/*
 * ── NAVIGATION PROGRESS ─────────────────────────────────────────────────────
 *
 * Every navigation in this panel is a full page load. Before compression that
 * meant 2.5 MB of silence between the click and the paint, and even at 441 KB
 * there is a gap on a slow connection where nothing tells the operator the
 * click registered — so they click again.
 *
 * A two-pixel bar, not a spinner over the content: the old page is still
 * readable and useful during the wait, and covering it would take that away to
 * say something a bar at the top edge says already.
 */
.admin-progress {
    position: fixed;
    inset-block-start: 0;
    inset-inline-start: 0;
    z-index: 2000;
    width: 0;
    height: 2px;
    background: var(--snova-primary);
    box-shadow: 0 0 8px var(--snova-primary);
    opacity: 0;
    transition: width 0.2s ease, opacity 0.2s ease;
}

.admin-progress.is-active {
    opacity: 1;
}

/*
 * Respecting a reduced-motion preference by removing the ANIMATION, not the
 * indicator: someone who asked for less movement still needs to know the page
 * is loading. It appears at full width instead of growing.
 */
@media (prefers-reduced-motion: reduce) {
    .admin-progress {
        transition: opacity 0.01ms;
    }
}

/* ── THE DESIGN-SYSTEM GALLERY ────────────────────────────────────────────── */
.admin-ds-swatches {
    display: grid;
    gap: var(--snova-space-4);
    grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr));
}

.admin-ds-swatch { margin: 0; }

.admin-ds-chip {
    display: block;
    height: 3.5rem;
    margin-block-end: var(--snova-space-2);
    border: 1px solid var(--snova-border-strong);
    border-radius: var(--snova-radius-sm);
}

.admin-ds-space {
    display: inline-block;
    height: 0.75rem;
    background: var(--snova-primary);
    border-radius: 2px;
}

/* ── Realtime simulator ──────────────────────────────────────────────────────
 *
 * A coverage grid and a log. The only opinionated bit is `.admin-sim-pair`:
 * unseen pairs are deliberately LOW CONTRAST and seen ones are solid, because
 * the page is read by scanning for what has NOT happened yet. Making both
 * legible would defeat the one job the grid has.
 */
.admin-sim-pair {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .2rem .5rem;
    border: 1px dashed var(--snova-border, #d8dee9);
    border-radius: var(--snova-radius-sm, .375rem);
    font-family: var(--bs-font-monospace);
    font-size: var(--snova-text-xs, .75rem);
    color: var(--snova-muted, #616e88);
    background: transparent;
}

.admin-sim-pair.is-seen {
    border-style: solid;
    border-color: var(--bs-success);
    color: var(--bs-success);
    background: color-mix(in srgb, var(--bs-success) 10%, transparent);
    font-weight: 600;
}

/* Arrived, but not in the contract the grid was built from. */
.admin-sim-pair.is-undocumented {
    border-color: var(--bs-warning);
    color: var(--bs-warning);
    background: color-mix(in srgb, var(--bs-warning) 12%, transparent);
}

.admin-sim-count {
    padding: 0 .3rem;
    border-radius: 999px;
    background: color-mix(in srgb, currentColor 18%, transparent);
}

.admin-sim-stream {
    max-height: 32rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: .5rem;
}

.admin-sim-row {
    border: 1px solid var(--snova-border, #d8dee9);
    border-radius: var(--snova-radius-sm, .375rem);
    padding: .5rem .65rem;
}

.admin-sim-row-head {
    display: flex;
    align-items: baseline;
    gap: .5rem;
    flex-wrap: wrap;
}

.admin-sim-time {
    font-variant-numeric: tabular-nums;
    color: var(--snova-muted, #616e88);
    font-size: var(--snova-text-xs, .75rem);
}

.admin-sim-chan {
    font-size: var(--snova-text-xs, .75rem);
    color: var(--snova-muted, #616e88);
}

.admin-sim-payload {
    margin: .4rem 0 0;
    padding: .4rem .5rem;
    background: var(--snova-canvas-deep, #eceff4);
    border-radius: var(--snova-radius-sm, .375rem);
    font-size: var(--snova-text-xs, .75rem);
    max-height: 12rem;
    overflow: auto;
    white-space: pre-wrap;
    word-break: break-word;
}

.admin-sim-console {
    max-height: 18rem;
    overflow: auto;
    background: var(--snova-canvas-deep, #eceff4);
    border-radius: var(--snova-radius-sm, .375rem);
    padding: .6rem .75rem;
    font-size: var(--snova-text-xs, .75rem);
    white-space: pre-wrap;
}

.admin-sim-channel + .admin-sim-channel {
    border-top: 1px solid var(--snova-border, #d8dee9);
    padding-top: 1rem;
}
