/* ═══════════════════════════════════════════════════════════════════════════
   Operations Dashboard v2 — Custom Stylesheet
   Operational theme for Lifeguard Operations Centre.

   Themed via `data-bs-theme` on <html>: dark (default) and light. Every colour
   below is driven from the `--loc-*` custom properties so the whole app — chrome
   included — flips by overriding the palette in the [data-bs-theme="light"] block.
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
  --loc-red:      #c0392b;
  --loc-red-dim:  #922b21;
  --loc-gold:     #d4ac0d;
  --loc-bg:       #0d1117;
  --loc-surface:  #161b22;
  --loc-border:   #30363d;
  --loc-text:     #e6edf3;
  --loc-muted:    #8b949e;
  --loc-success:  #3fb950;
  --loc-warning:  #d29922;
  --loc-danger:   #f85149;
  --loc-info:     #58a6ff;

  /* Brand type roles — Archivo (display), Inter (body), IBM Plex Mono (data).
     Loaded from Google Fonts in every page head; system stacks cover offline
     kiosks. Read these vars — never hard-code a font name. See design.md §4. */
  --loc-display: 'Archivo', 'Segoe UI', system-ui, sans-serif;
  --loc-body:    'Inter', 'Segoe UI', system-ui, sans-serif;
  --loc-mono:    'IBM Plex Mono', 'JetBrains Mono', ui-monospace, 'Consolas', monospace;
  /* Point Bootstrap's own font vars at the brand roles so any component or
     template reading --bs-font-* inherits Inter / IBM Plex Mono too. */
  --bs-body-font-family: var(--loc-body);
  --bs-font-monospace:   var(--loc-mono);

  /* Derived surfaces / overlays — flipped wholesale in the light block below so
     the hard-coded literals that used to live in this file follow the theme. */
  --loc-input-bg:       #0d1117;   /* form fields */
  --loc-elevated:       #21262d;   /* input-group, chips, raised neutrals */
  --loc-overlay-soft:   rgba(255,255,255,.03);  /* card headers, faint fills */
  --loc-overlay:        rgba(255,255,255,.05);  /* hover */
  --loc-overlay-strong: rgba(255,255,255,.08);  /* stronger hover */
  --loc-overlay-faint:  rgba(255,255,255,.02);  /* quick-action bar, panels */
  --loc-loading-veil:   rgba(13,17,23,.7);      /* loading overlay scrim */
}

/* ── Light theme ──────────────────────────────────────────────────────────────
   Selected per-user (dark | light | auto) and applied as data-bs-theme on <html>.
   Bootstrap 5.3 recolours its own components from data-bs-theme; this block flips
   the LOC palette so the custom components + chrome follow. */
[data-bs-theme="light"] {
  --loc-red:      #c0392b;
  --loc-red-dim:  #a93226;
  --loc-gold:     #b7950b;
  --loc-bg:       #f5f7fa;
  --loc-surface:  #ffffff;
  --loc-border:   #d0d7de;
  --loc-text:     #1f2328;
  --loc-muted:    #656d76;
  --loc-success:  #1a7f37;
  --loc-warning:  #9a6700;
  --loc-danger:   #cf222e;
  --loc-info:     #0969da;

  --loc-input-bg:       #ffffff;
  --loc-elevated:       #eaeef2;
  --loc-overlay-soft:   rgba(0,0,0,.025);
  --loc-overlay:        rgba(0,0,0,.045);
  --loc-overlay-strong: rgba(0,0,0,.075);
  --loc-overlay-faint:  rgba(0,0,0,.02);
  --loc-loading-veil:   rgba(255,255,255,.7);
}

/* ── Light-theme overrides for hard-coded Bootstrap dark utilities ─────────────
   A handful of templates pin dark utility classes (chrome, tables, bright text).
   Flip them to the themed palette when light is active. */
[data-bs-theme="light"] .bg-dark { background-color: var(--loc-elevated) !important; }
[data-bs-theme="light"] .text-white { color: var(--loc-text) !important; }
[data-bs-theme="light"] .table-dark {
  --bs-table-color: var(--loc-text);
  --bs-table-hover-color: var(--loc-text);
  color: var(--loc-text);
}
/* Chrome (sidebar + header) — declared after .bg-dark so it wins the equal-
   specificity tie and paints on the page surface, not the raised neutral. */
[data-bs-theme="light"] .app-sidebar,
[data-bs-theme="light"] .app-header { background-color: var(--loc-surface) !important; }
[data-bs-theme="light"] .app-sidebar .brand-text,
[data-bs-theme="light"] .app-header #live-clock,
[data-bs-theme="light"] .app-header .nav-link,
[data-bs-theme="light"] .app-header .sidebar-toggle { color: var(--loc-text) !important; }

/* Status badges + a few decorative greys carry dark-only literals; retint them
   for light so they stay legible. */
[data-bs-theme="light"] .badge-signed-on   { background: #dafbe1; color: #1a7f37; border-color: #4ac26b; }
[data-bs-theme="light"] .badge-signed-off  { background: var(--loc-elevated); color: var(--loc-muted); border-color: var(--loc-border); }
[data-bs-theme="light"] .badge-afloat      { background: #fff3cd; color: #9a6700; border-color: #d4a72c; }
[data-bs-theme="light"] .form-control::placeholder { color: var(--loc-muted); }
[data-bs-theme="light"] .ops-chip .ops-kbd,
[data-bs-theme="light"] .ops-group-tag,
[data-bs-theme="light"] .drag-handle,
[data-bs-theme="light"] .ops-preview .ops-ph,
[data-bs-theme="light"] .ops-src-note { color: var(--loc-muted); }
/* Selected chips (location / matter type / service / RWC area + reason) fill with
   a pale tint of their accent in light; white label text vanishes on it, so use
   dark text — the coloured dot + border still signal the selection. */
[data-bs-theme="light"] .ops-chip.on { color: var(--loc-text); }
[data-bs-theme="light"] .ops-chip.on .ops-kbd { color: var(--loc-text); border-color: var(--loc-border); }

/* ── Brand theme ──────────────────────────────────────────────────────────────
   The on-brand "operations navy" skin, drawn straight from the Operations Dashboard logo:
   navy ground, lifeguard red, sun yellow, sea blue, and the brand green. Unlike
   dark/light, "brand" is not a Bootstrap mode — it rides on the dark BS base
   (data-bs-theme="dark") while data-theme-pref="brand" stays on <html>, so this
   block just repaints the --loc-* palette. The html[...] selector outscores the
   :root dark defaults, so the navy palette wins everywhere the app reads a var. */
html[data-theme-pref="brand"] {
  --loc-red:      #e5392e;   /* lifeguard red */
  --loc-red-dim:  #c12e25;
  --loc-gold:     #ffc52e;   /* sun yellow */
  --loc-bg:       #081d33;   /* deep navy page */
  --loc-surface:  #0e2a47;   /* operations navy — cards + chrome */
  --loc-border:   #1e466e;   /* navy hairline */
  --loc-text:     #eaf2f9;
  --loc-muted:    #93b4cf;   /* slate-blue */
  --loc-success:  #1fa971;   /* brand green */
  --loc-warning:  #ffc52e;
  --loc-danger:   #e5392e;
  --loc-info:     #5bb3d6;   /* sea blue */

  --loc-input-bg:       #0a2542;
  --loc-elevated:       #163a5f;   /* navy-2 — chips, input-group, raised neutrals */
  --loc-overlay-soft:   rgba(255,255,255,.04);
  --loc-overlay:        rgba(91,179,214,.10);   /* sea-tinted hover */
  --loc-overlay-strong: rgba(91,179,214,.18);
  --loc-overlay-faint:  rgba(255,255,255,.03);
  --loc-loading-veil:   rgba(8,29,51,.72);
}

/* Chrome + hard-coded dark utilities: flip the Bootstrap-dark greys to the navy
   surface so the sidebar, header and any pinned .bg-dark panels read as brand. */
html[data-theme-pref="brand"] .bg-dark { background-color: var(--loc-surface) !important; }

/* Status badges carry dark-only literals; retint to the brand status colours
   (the green / grey / yellow flag language from the brand guide). */
html[data-theme-pref="brand"] .badge-signed-on  { background: rgba(31,169,113,.16); color: #4fd6a0; border-color: rgba(31,169,113,.5); }
html[data-theme-pref="brand"] .badge-signed-off { background: var(--loc-elevated); color: var(--loc-muted); border-color: var(--loc-border); }
html[data-theme-pref="brand"] .badge-afloat     { background: rgba(255,197,46,.16); color: #ffd96b; border-color: rgba(255,197,46,.5); }

/* ── Base ───────────────────────────────────────────────────────────────── */
html, body { height: 100%; }

body {
  background-color: var(--loc-bg);
  color: var(--loc-text);
  font-family: var(--loc-body);
  font-size: 14px;
}

/* Display face on every heading — gives them operational weight. */
h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 { font-family: var(--loc-display); letter-spacing: -.01em; }

.font-monospace { font-family: var(--loc-mono) !important; }

/* Keyboard focus ring — sea blue, per the brand guide. */
:focus-visible { outline: 3px solid var(--loc-info); outline-offset: 2px; border-radius: 4px; }
.fs-tiny { font-size: 0.65rem; }

/* ── Sidebar ─────────────────────────────────────────────────────────────── */
.app-sidebar { border-right: 1px solid var(--loc-border); }
.sidebar-brand { border-bottom: 1px solid var(--loc-border); height: 52px; display: flex; align-items: center; }
.sidebar-brand .brand-link { height: 100%; }
.nav-header { font-size: 0.68rem; letter-spacing: .08em; }
.nav-link { color: var(--loc-muted) !important; border-radius: 6px; margin: 1px 8px; transition: all .15s; }
.nav-link:hover  { color: var(--loc-text) !important; background: var(--loc-overlay); }
.nav-link.active { color: #fff !important; background: var(--loc-red) !important; }
.nav-icon { margin-right: .5rem; width: 1.2rem; text-align: center; }

/* ── Header ──────────────────────────────────────────────────────────────── */
.app-header { height: 52px; border-bottom: 1px solid var(--loc-border) !important; }
#live-clock { font-size: 1rem; font-family: var(--loc-mono); letter-spacing: .05em; }
#ws-status   { font-size: .65rem; animation: pulse-dot 2s infinite; }
@keyframes pulse-dot { 0%,100%{opacity:1} 50%{opacity:.4} }

/* ── Cards ───────────────────────────────────────────────────────────────── */
.card {
  background: var(--loc-surface) !important;
  border: 1px solid var(--loc-border) !important;
  border-radius: 8px;
}
.card-header {
  background: var(--loc-overlay-soft) !important;
  border-bottom: 1px solid var(--loc-border) !important;
  padding: .6rem 1rem;
}

/* ── Tables ──────────────────────────────────────────────────────────────── */
.table-dark {
  --bs-table-bg: transparent;
  --bs-table-hover-bg: var(--loc-overlay);
  --bs-table-border-color: var(--loc-border);
}
.table th { font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; color: var(--loc-muted); font-weight: 600; }
.table td { vertical-align: middle; }

/* ── Badges ──────────────────────────────────────────────────────────────── */
.badge { font-weight: 500; letter-spacing: .03em; }

/* Status badges */
.badge-signed-on   { background: #0d4429; color: var(--loc-success); border: 1px solid #238636; }
.badge-signed-off  { background: #21262d; color: var(--loc-muted);   border: 1px solid var(--loc-border); }
.badge-afloat      { background: #3a2a00; color: var(--loc-warning);  border: 1px solid #9e6a03; }

/* ── Forms ───────────────────────────────────────────────────────────────── */
.form-control, .form-select {
  background: var(--loc-input-bg) !important;
  border: 1px solid var(--loc-border) !important;
  color: var(--loc-text) !important;
  border-radius: 6px;
}
.form-control:focus, .form-select:focus {
  border-color: var(--loc-red) !important;
  box-shadow: 0 0 0 .2rem rgba(192,57,43,.2) !important;
  outline: none;
}
.form-label { font-size: .72rem; text-transform: uppercase; letter-spacing: .07em; color: var(--loc-muted); font-weight: 600; margin-bottom: .35rem; }
.form-control::placeholder { color: #484f58; }
.input-group-text { background: var(--loc-elevated) !important; border-color: var(--loc-border) !important; color: var(--loc-muted) !important; }

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.btn-danger    { background: var(--loc-red); border-color: var(--loc-red); }
.btn-danger:hover { background: var(--loc-red-dim); border-color: var(--loc-red-dim); }
.btn-outline-secondary { border-color: var(--loc-border); color: var(--loc-muted); }
.btn-outline-secondary:hover { background: var(--loc-overlay-strong); color: var(--loc-text); border-color: var(--loc-muted); }
.btn { border-radius: 6px; font-size: .85rem; font-weight: 500; }

/* ── Modals ──────────────────────────────────────────────────────────────── */
.modal-content   { background: var(--loc-surface); border: 1px solid var(--loc-border); }
.modal-header    { border-bottom: 1px solid var(--loc-border); }
.modal-footer    { border-top: 1px solid var(--loc-border); }
.btn-close-white { filter: invert(1); }

/* ── Alerts ──────────────────────────────────────────────────────────────── */
.alert-danger  { background: rgba(248,81,73,.12); border-color: rgba(248,81,73,.4); color: #ff7b72; }
.alert-success { background: rgba(63,185,80,.12); border-color: rgba(63,185,80,.4); color: #7ee787; }
.alert-warning { background: rgba(210,153,34,.12); border-color: rgba(210,153,34,.4); color: #e3b341; }
.alert-info    { background: rgba(88,166,255,.12); border-color: rgba(88,166,255,.4); color: #79c0ff; }

/* ── Toasts ──────────────────────────────────────────────────────────────── */
#toast-container .toast { background: var(--loc-surface); border: 1px solid var(--loc-border); color: var(--loc-text); min-width: 280px; }
#toast-container .toast-header { background: var(--loc-overlay); border-bottom: 1px solid var(--loc-border); }

/* ── Page header breadcrumb area ─────────────────────────────────────────── */
.app-content-header { background: var(--loc-surface); }

/* ── Scrollbar ───────────────────────────────────────────────────────────── */
::-webkit-scrollbar       { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--loc-bg); }
::-webkit-scrollbar-thumb { background: var(--loc-border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--loc-muted); }

/* ══════════════════════════════════════════════════════════════════════════
   Operational page specifics
   ══════════════════════════════════════════════════════════════════════════ */

/* Station cards on the Stations page */
.station-card { transition: border-color .2s; }
.station-card.status-signed-on   { border-color: var(--loc-success) !important; }
.station-card.status-signed-off  { border-color: var(--loc-border) !important; }
.station-card.status-not-started { border-color: var(--loc-border) !important; }

.station-card .card-header { padding: .5rem .75rem; }

/* Quick OPS Entry modal — tap-once chips (location / matter type / service) */
.ops-group-tag { font-size: .62rem; text-transform: uppercase; letter-spacing: .08em; color: #6e7681; font-weight: 600; margin: .1rem .15rem .3rem; }
.form-label .ops-hint { text-transform: none; letter-spacing: 0; font-size: .7rem; font-weight: 400; color: var(--loc-muted); margin-left: auto; }
.ops-chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.ops-chip {
  display: inline-flex; align-items: center; gap: .4rem; cursor: pointer; user-select: none;
  padding: .34rem .66rem; border-radius: 999px; font-size: .83rem; font-weight: 500;
  background: var(--loc-bg); color: var(--loc-text);
  border: 1px solid var(--loc-border); transition: border-color .12s, background .12s;
}
.ops-chip:hover { background: var(--loc-overlay); border-color: var(--loc-muted); }
.ops-chip.on { color: #fff; font-weight: 600; }       /* per-colour bg/border set inline */
.ops-chip .ops-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; } /* bg set inline */
.ops-chip .ops-kbd {
  font-family: var(--loc-mono); font-size: .62rem; color: #6e7681;
  border: 1px solid var(--loc-border); border-radius: 4px; padding: 0 .3rem;
}
.ops-chip.on .ops-kbd { color: #fff; border-color: rgba(255,255,255,.35); }

/* Live preview / summary bar in the modal footer */
.ops-preview {
  width: 100%; display: flex; align-items: center; gap: .55rem; flex-wrap: wrap;
  min-height: 44px; padding: .55rem .75rem; border-radius: 8px;
  background: var(--loc-overlay-soft); border: 1px dashed var(--loc-border);
}
.ops-preview.ready { border-style: solid; border-color: rgba(63,185,80,.4); background: rgba(63,185,80,.06); }
.ops-preview .ops-ph { color: #6e7681; font-size: .85rem; }
.ops-preview .ops-pv-meta { margin-left: auto; color: var(--loc-muted); font-size: .72rem; text-align: right; }
.ops-preview .ops-pv-note {
  width: 100%; color: var(--loc-text); font-size: .82rem; font-style: italic;
  border-top: 1px dashed var(--loc-border); padding-top: .4rem; margin-top: .05rem;
}
.ops-src-note { margin-top: .7rem; font-size: .73rem; color: #6e7681; display: flex; gap: .4rem; align-items: flex-start; }
.ops-src-note b { color: var(--loc-muted); font-weight: 600; }
.ops-more-toggle { background: none; border: 0; color: var(--loc-info); font-size: .8rem; cursor: pointer; padding: .2rem 0; }
.ops-more-toggle:hover { text-decoration: underline; }

/* ── Keyboard shortcuts: key badges, footer save-hint, "?" reference overlay ──── */
.kbd-badge {
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--loc-mono); font-size: .66rem; line-height: 1;
  min-width: 1.35em; padding: .18rem .32rem; color: var(--loc-muted);
  background: var(--loc-overlay-soft); border: 1px solid var(--loc-border); border-radius: 5px;
}
.btn .kbd-badge { margin-left: .4rem; }
.save-hint { font-size: .72rem; color: var(--loc-muted); display: inline-flex; align-items: center; gap: .25rem; }
/* Shortcuts reference overlay rows */
.kbd-help-group { font-size: .66rem; text-transform: uppercase; letter-spacing: .08em; color: var(--loc-muted); font-weight: 700; margin: 1rem 0 .25rem; }
.kbd-help-group:first-child { margin-top: 0; }
.kbd-help-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .38rem 0; border-bottom: 1px solid var(--loc-border); }
.kbd-help-row:last-child { border-bottom: 0; }
.kbd-help-row > span:first-child { color: var(--loc-text); font-size: .85rem; }
.kbd-help-keys { display: inline-flex; align-items: center; gap: .3rem; flex: none; color: var(--loc-muted); }

/* Per-row edit/delete buttons in the OPS log "Actions" column */
.ops-act-btn { background: none; border: 0; color: var(--loc-muted); padding: .12rem .35rem; border-radius: 4px; line-height: 1; cursor: pointer; font-size: .9rem; }
.ops-act-btn:hover { color: var(--loc-text); background: var(--loc-overlay-strong); }
.ops-act-btn.danger:hover { color: #fff; background: var(--loc-danger); }
.ops-act-btn:disabled { opacity: .4; cursor: default; }

/* RWC timer */
.rwc-timer { font-size: 1.1rem; font-family: var(--loc-mono); color: var(--loc-warning); }
.rwc-card-afloat { border-color: rgba(210,153,34,.5) !important; }

/* Audit log */
.audit-action { font-size: .7rem; font-family: var(--loc-mono); padding: .15rem .4rem; border-radius: 3px; background: var(--loc-overlay-strong); }

/* ── Beach flags (shared: stations board, sign-on, admin defaults) ─────────────── */
.flag {
  display: inline-block; width: 26px; height: 18px; border-radius: 2px;
  border: 1px solid rgba(255,255,255,.25); vertical-align: middle; flex: none;
  box-shadow: 0 1px 2px rgba(0,0,0,.5);
}
.flag.ry  { background: linear-gradient(180deg, var(--loc-red) 0 50%, var(--loc-gold) 50% 100%); }
.flag.red { background: var(--loc-red); }
.flag.bw  { background: repeating-conic-gradient(#0b0f14 0 25%, #f5f7fa 0 50%); background-size: 50% 50%; }
.flag.xs  { width: 18px; height: 13px; }
.flag.lg  { width: 34px; height: 23px; }
.flag-sock {
  display: inline-block; width: 26px; height: 15px; vertical-align: middle; flex: none;
  background: repeating-linear-gradient(90deg, #ff7518 0 6px, #ffa44d 6px 9px);
  clip-path: polygon(0 0, 100% 22%, 100% 78%, 0 100%); border-radius: 2px;
  box-shadow: 0 1px 2px rgba(0,0,0,.5);
}
.flag-sock.xs { width: 20px; height: 12px; }
.flag-none {
  display: inline-block; width: 26px; height: 18px; border-radius: 2px; vertical-align: middle;
  border: 1px dashed var(--loc-border);
  background: repeating-linear-gradient(45deg, #21262d 0 5px, #1a1f26 5px 10px);
}
.flag-row { display: inline-flex; align-items: center; gap: 5px; }

/* Rule-enforcing flag picker (sign-on modal, flags-change modal, admin defaults) */
.flag-picker { display: flex; gap: 6px; flex-wrap: wrap; }
.flag-picker .fp {
  background: transparent; border: 1px solid var(--loc-border); color: var(--loc-muted);
  cursor: pointer; padding: 6px 10px; font-size: .8rem; font-weight: 600; border-radius: 6px;
  display: inline-flex; align-items: center; gap: 6px; transition: .12s;
}
.flag-picker .fp:hover:not(:disabled) { border-color: var(--loc-muted); color: var(--loc-text); }
.flag-picker .fp:disabled { opacity: .32; cursor: not-allowed; }
.flag-picker .fp.on.fp-ry   { background: rgba(212,172,13,.18); color: var(--loc-gold); border-color: rgba(212,172,13,.55); }
.flag-picker .fp.on.fp-bw   { background: rgba(255,255,255,.12); color: #fff; border-color: #fff; }
.flag-picker .fp.on.fp-red  { background: rgba(192,57,43,.28); color: #ff8a80; border-color: #ff8a80; }
.flag-picker .fp.on.fp-sock { background: rgba(255,117,24,.2); color: #ffb066; border-color: rgba(255,117,24,.6); }
.flag-picker .fp-div { width: 1px; align-self: stretch; background: var(--loc-border); margin: 0 2px; }

/* ── Admin: merged tabbed page (/admin) ──────────────────────────────────────── */
.admin-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--loc-border); flex-wrap: wrap; }
.admin-tabs .atab {
  border: none; background: transparent; color: var(--loc-muted);
  font-weight: 600; font-size: .85rem; padding: .8rem 1.1rem;
  border-bottom: 2px solid transparent; cursor: pointer;
  display: flex; align-items: center; gap: .5rem; margin-bottom: -1px; transition: .15s;
}
.admin-tabs .atab:hover  { color: var(--loc-text); }
.admin-tabs .atab.active { color: var(--loc-text); border-bottom-color: var(--loc-red); }

.admin-subtabs {
  display: inline-flex; gap: 3px; padding: 4px; flex-wrap: wrap;
  background: var(--loc-surface); border: 1px solid var(--loc-border); border-radius: 9px;
}
.admin-subtabs .stab {
  border: none; background: transparent; color: var(--loc-muted);
  font-weight: 600; font-size: .8rem; padding: .45rem .95rem; border-radius: 6px;
  cursor: pointer; display: flex; align-items: center; gap: .4rem;
}
.admin-subtabs .stab.active { background: var(--loc-red); color: #fff; }
.admin-subtabs .stab:not(.active):hover { color: var(--loc-text); background: var(--loc-overlay); }

.admin-pane { display: none; }
.admin-pane.active { display: block; }

/* Season cards (Configuration → Seasons) — grouped into sections */
.season-section { margin-bottom: 1.25rem; }
.season-section-hd {
  font-size: .68rem; text-transform: uppercase; letter-spacing: .08em;
  color: var(--loc-muted); font-weight: 700; margin-bottom: .5rem;
  padding-bottom: .35rem; border-bottom: 1px solid var(--loc-border);
}
.season-area { margin-bottom: .55rem; }
.season-arealbl {
  display: block; font-size: .7rem; text-transform: uppercase; letter-spacing: .05em;
  color: var(--loc-muted); font-weight: 700; margin-bottom: .3rem;
}
.season-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.season-chip {
  background: var(--loc-elevated); color: var(--loc-text); font-weight: 500;
  font-size: .8rem; padding: .35em .6em;
}
.season-rwc {
  background: rgba(210,153,34,.18); color: var(--loc-warning);
  font-size: .6rem; font-weight: 700; padding: .12em .32em;
  border-radius: 3px; margin-left: 5px; vertical-align: middle;
}

/* ── Drag-to-reorder rows (admin config tables) ─────────────────────────────── */
tr.dragging {
  background: rgba(88,166,255,.14) !important;     /* override table-hover striping */
  box-shadow: inset 0 0 0 1px rgba(88,166,255,.45);
  cursor: grabbing;
}
.drag-handle {
  cursor: grab; color: #6e7681; text-align: center; width: 28px;
  user-select: none; touch-action: none;          /* don't scroll the page on touch-drag */
}
.drag-handle:active { cursor: grabbing; }
tr:hover .drag-handle { color: #adbac7; }

/* Solid colour chip in the OPS-list admin tables */
.color-chip {
  display: inline-block; width: 16px; height: 16px; border-radius: 4px;
  border: 1px solid rgba(255,255,255,.25); vertical-align: middle;
}

/* Preset swatch picker in the OPS-list add/edit modal */
.swatch-grid { display: flex; flex-wrap: wrap; gap: 6px; }
.swatch {
  width: 26px; height: 26px; border-radius: 6px; cursor: pointer;
  border: 2px solid transparent; position: relative; padding: 0;
}
.swatch.selected { border-color: #fff; box-shadow: 0 0 0 2px rgba(255,255,255,.25); }
.swatch.used::after {
  content: ""; position: absolute; right: 2px; bottom: 2px;
  width: 6px; height: 6px; border-radius: 50%;
  background: #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.5);
}

/* ── Sidebar mini-collapse polish ────────────────────────────────────────────
   When the sidebar is collapsed to its mini (icon) width, hide the bottom
   update notice + online roster; they reappear when the sidebar expands on hover. */
.sidebar-collapse .app-sidebar:not(:hover) #update-sidebar-notice,
.sidebar-collapse .app-sidebar:not(:hover) #online-users { display: none !important; }

/* In the mini rail the brand + nav icons must centre, and the active highlight
   must sit inside the rail. AdminLTE pins each nav-link to a fixed 3.6rem inside
   the 4.6rem rail; the app's left padding + side margins leave the icon (and the
   red active background) offset so it reads as "cut off". Zero the horizontal
   padding, centre the icon (flex), and auto-margin the fixed-width link so it
   sits centred in the rail regardless of the exact widths. Restored on hover. */
.sidebar-collapse .app-sidebar:not(:hover) .sidebar-brand { justify-content: center !important; }
.sidebar-collapse .app-sidebar:not(:hover) .brand-link {
  justify-content: center !important;
  padding-left: 0 !important; padding-right: 0 !important;
}
.sidebar-collapse .app-sidebar:not(:hover) .sidebar-menu .nav-link {
  justify-content: center !important;
  padding-left: 0 !important; padding-right: 0 !important;
  margin-left: auto !important; margin-right: auto !important;
}
.sidebar-collapse .app-sidebar:not(:hover) .sidebar-menu .nav-icon {
  margin-right: 0 !important;
}

/* ── Currently-online roster (supervisor & above) ────────────────────────────
   Make the wrapper a flex column so the bottom widgets pin to the foot of the
   sidebar while the nav menu takes the remaining height and scrolls if needed. */
.sidebar-wrapper { display: flex; flex-direction: column; }
.sidebar-wrapper > nav { flex: 1 1 auto; min-height: 0; overflow-y: auto; }
.sidebar-online-users { margin-top: auto; border-top: 1px solid var(--loc-border); padding-top: .5rem; }
.online-users-list { max-height: 30vh; overflow-y: auto; }
.online-user { font-size: .8rem; color: var(--loc-text); }
.online-users-head { color: var(--loc-muted) !important; }
.online-user .online-name { min-width: 0; flex: 1 1 auto; }
.online-dot { width: 7px; height: 7px; flex-shrink: 0;
              box-shadow: 0 0 0 2px rgba(25, 135, 84, .25); }

/* ── Sidebar toggle button visibility ────────────────────────────────────────
   The toggle sits in a `navbar-expand` header, which Bootstrap hides
   (.navbar-expand .navbar-toggler{display:none}). Force it visible so users can
   actually collapse/expand the sidebar (desktop) and open it (mobile). */
.app-header .sidebar-toggle {
  display: inline-flex !important; align-items: center; justify-content: center;
  padding: .25rem .5rem; border-radius: 6px; cursor: pointer;
}
.app-header .sidebar-toggle:hover { background: rgba(255,255,255,.08); }
