/* =========================================================================
   PRLive v5 — minimal design system
   Light, low-contrast, modern. Neutral surfaces, hairline borders, one
   restrained accent. Full light/dark via [data-bs-theme]. Layers on Bootstrap.
   Legacy "glass-*" class names are kept but restyled flat & minimal.
   ========================================================================= */

:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #f1f2f4;
  --surface-hover: #f4f5f7;
  --field-bg: #f6f7f9;
  --border: #e7e9ec;
  --border-strong: #d9dce0;

  --ink: #1c1f24;
  --ink-soft: #6b7280;
  --ink-faint: #9aa0a8;

  --accent: #4f46e5;
  --accent-ink: #ffffff;
  --accent-soft: rgba(79, 70, 229, 0.10);
  --accent-border: rgba(79, 70, 229, 0.22);

  --chip-bg: rgba(17, 24, 39, 0.055);
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 1px 3px rgba(16, 24, 40, 0.06);
  --shadow-lg: 0 4px 16px rgba(16, 24, 40, 0.08);

  --cell-weekend: rgba(17, 24, 39, 0.035);
  --cell-holiday: rgba(225, 29, 72, 0.07);

  --reported-bg: rgba(79, 70, 229, 0.07);
  --reported-bg-hover: rgba(79, 70, 229, 0.12);

  --radius: 12px;
  --radius-sm: 8px;

  /* Legacy aliases so existing markup keeps working */
  --glass-bg: var(--surface);
  --glass-bg-strong: var(--surface);
  --glass-border: var(--border);
  --glass-shadow: var(--shadow);
  --glass-shadow-lg: var(--shadow-lg);
  --brand: var(--accent);
  --brand-2: var(--accent);

  --bs-body-font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --bs-body-bg: var(--bg);
  --bs-body-color: var(--ink);
  --bs-border-color: var(--border);
}

[data-bs-theme="dark"] {
  --bg: #0d0f12;
  --surface: #16181d;
  --surface-2: #1c1f25;
  --surface-hover: #1c1f25;
  --field-bg: #0f1116;
  --border: #282b31;
  --border-strong: #353941;

  --ink: #e6e8ec;
  --ink-soft: #9aa1ac;
  --ink-faint: #6b7280;

  --accent: #818cf8;
  --accent-ink: #0d0f12;
  --accent-soft: rgba(129, 140, 248, 0.16);
  --accent-border: rgba(129, 140, 248, 0.32);

  --chip-bg: rgba(255, 255, 255, 0.07);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 6px 20px rgba(0, 0, 0, 0.45);

  --cell-weekend: rgba(255, 255, 255, 0.035);
  --cell-holiday: rgba(244, 63, 94, 0.12);

  --reported-bg: rgba(129, 140, 248, 0.12);
  --reported-bg-hover: rgba(129, 140, 248, 0.17);
}

/* ---- Base --------------------------------------------------------------- */
body {
  min-height: 100vh;
  color: var(--ink);
  background-color: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
.glass-orbs { display: none; }
a { text-decoration: none; color: var(--accent); }

/* ---- Surfaces (glass-* kept as flat panels) ----------------------------- */
.glass,
.card.glass-card,
.modal-content.glass {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.glass-strong { background: var(--surface); }
.card.glass-card { transition: border-color .15s ease; }
.card.glass-card:hover { border-color: var(--border-strong); }
.card.glass-card .card-header {
  background: transparent;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  color: var(--ink);
}
.glass-gloss::before { content: none; } /* drop the glossy highlight */

/* ---- Navbar ------------------------------------------------------------- */
.navbar.glass-nav {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: none;
}
.navbar.glass-nav .navbar-brand { font-weight: 700; letter-spacing: -0.02em; color: var(--ink); }
.brand-logo {
  display: inline-flex; align-items: center;
  padding: 5px 10px; border-radius: var(--radius-sm);
  background: #1f2433;
}
[data-bs-theme="dark"] .brand-logo { background: transparent; padding: 5px 0; }
.brand-logo img { display: block; }
.brand-divider { width: 1px; height: 20px; background: var(--border); }
.navbar.glass-nav .nav-link {
  color: var(--ink-soft); font-weight: 500; border-radius: var(--radius-sm);
  padding: 0.4rem 0.7rem; transition: color .15s ease, background .15s ease;
}
.navbar.glass-nav .nav-link:hover { color: var(--ink); background: var(--surface-2); }
.navbar.glass-nav .nav-link.active,
.navbar.glass-nav .dropdown-toggle.active { color: var(--accent); background: var(--accent-soft); }

.dropdown-menu {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  --bs-dropdown-link-color: var(--ink);
  --bs-dropdown-link-hover-bg: var(--surface-2);
}
.dropdown-item { border-radius: 6px; padding: 0.4rem 0.7rem; font-weight: 500; }
.dropdown-item:hover { background: var(--surface-2); color: var(--ink); }
.dropdown-item.active { background: var(--accent-soft); color: var(--accent); }

/* ---- Headings ----------------------------------------------------------- */
.page-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .75rem; margin-bottom: 1.1rem; }
.page-head h1 { font-size: 1.4rem; font-weight: 650; letter-spacing: -0.02em; margin: 0; color: var(--ink); }

/* ---- Metric tiles ------------------------------------------------------- */
.metric { padding: 1.1rem 1.25rem; }
.metric .metric-value { font-size: 1.8rem; font-weight: 680; line-height: 1; letter-spacing: -0.02em; }
.metric .metric-label { color: var(--ink-soft); font-size: .8rem; letter-spacing: .01em; }
.metric .metric-icon {
  width: 42px; height: 42px; display: grid; place-items: center;
  border-radius: var(--radius-sm); font-size: 1.15rem;
  color: var(--accent); background: var(--accent-soft);
}

/* ---- Tables ------------------------------------------------------------- */
.glass-table-wrap { border-radius: var(--radius); overflow: hidden; }
table.glass-table { margin: 0; --bs-table-bg: transparent; color: var(--ink); }
table.glass-table > thead th {
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  font-size: .74rem; text-transform: uppercase; letter-spacing: .03em;
  color: var(--ink-soft); font-weight: 600; white-space: nowrap;
}
table.glass-table > tbody tr { transition: background .12s ease; }
table.glass-table > tbody tr:hover { background: var(--surface-2); }
table.glass-table > tbody td { vertical-align: middle; border-color: var(--border); }

/* ---- Forms -------------------------------------------------------------- */
.form-control, .form-select {
  background: var(--field-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--ink);
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.form-control:focus, .form-select:focus {
  background: var(--surface);
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
  color: var(--ink);
}
.form-control::placeholder { color: var(--ink-faint); }
.form-label { font-weight: 600; font-size: .82rem; color: var(--ink-soft); }
.input-group-text { background: var(--field-bg); border-color: var(--border); color: var(--ink-soft); }
hr { border-color: var(--border); opacity: 1; }
.form-check-input:checked { background-color: var(--accent); border-color: var(--accent); }
.form-check-input:focus { box-shadow: 0 0 0 3px var(--accent-soft); border-color: var(--accent); }

/* ---- Buttons ------------------------------------------------------------ */
.btn { border-radius: var(--radius-sm); font-weight: 550; transition: background .12s ease, border-color .12s ease, color .12s ease; }
.btn-primary {
  border: 1px solid var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: none;
}
.btn-primary:hover, .btn-primary:focus {
  background: color-mix(in srgb, var(--accent) 88%, #000);
  border-color: color-mix(in srgb, var(--accent) 88%, #000);
  color: var(--accent-ink);
}
[data-bs-theme="dark"] .btn-primary:hover { background: color-mix(in srgb, var(--accent) 85%, #fff); border-color: color-mix(in srgb, var(--accent) 85%, #fff); }
.btn-glass {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--ink);
}
.btn-glass:hover { background: var(--surface-2); color: var(--ink); border-color: var(--border-strong); }
.btn-sm { border-radius: 7px; }

/* ---- Badges / pills ----------------------------------------------------- */
.badge { font-weight: 600; border-radius: 999px; padding: .34em .7em; }
.pill-soft { background: var(--accent-soft); color: var(--accent); }

/* ---- Auth screen -------------------------------------------------------- */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 2rem; }
.auth-card { width: 100%; max-width: 410px; padding: 2.25rem; }
.auth-logo {
  width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center;
  font-size: 1.5rem; color: var(--accent); background: var(--accent-soft);
}

/* ---- Utilities ---------------------------------------------------------- */
.text-ink-soft { color: var(--ink-soft) !important; }
.hover-lift { transition: border-color .15s ease, background .15s ease; }
.hover-lift:hover { border-color: var(--border-strong); }
.cursor-pointer { cursor: pointer; }

.flash-stack { position: fixed; top: 74px; right: 18px; z-index: 1090; width: min(360px, 90vw); }

.skeleton {
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-hover) 37%, var(--surface-2) 63%);
  background-size: 400% 100%; animation: shimmer 1.4s ease infinite; border-radius: 6px;
}
@keyframes shimmer { 0% { background-position: 100% 0 } 100% { background-position: -100% 0 } }

/* =========================================================================
   Chip language — calm, consistent, minimal. Tone keeps its semantic hue.
   ========================================================================= */
.chip {
  display: inline-flex; align-items: center; gap: .35em;
  padding: .2em .6em; border-radius: 999px;
  font-size: .76rem; font-weight: 600; line-height: 1.45;
  white-space: nowrap; vertical-align: middle; text-decoration: none; max-width: 100%;
}
.chip > span { overflow: hidden; text-overflow: ellipsis; }
.chip i { font-size: .9em; line-height: 1; }

.chip-country { background: var(--chip-bg); color: var(--ink-soft); padding: .15em .5em; gap: .3em; }
.chip-country .flag { font-size: 1.05em; line-height: 1; }
.chip-country .chip-code { font-weight: 700; letter-spacing: .02em; font-size: .72rem; }

.chip-media { background: var(--accent-soft); color: var(--accent); border: 1px solid var(--accent-border); }
a.chip-media:hover { background: var(--accent-soft); color: var(--accent); filter: brightness(.97); }

.chip-cat, .chip-vstatus { background: var(--chip-bg); color: var(--ink); }
.chip-cat .dot, .chip-vstatus .dot { width: .6em; height: .6em; border-radius: 50%; flex: 0 0 auto; }

.chip-tag { background: rgba(217, 119, 6, 0.12); color: #92600a; }
.chip-tag i { opacity: .7; }

/* Registration shown as a real EU licence plate (stays white in both themes). */
.plate {
  display: inline-flex; align-items: stretch; height: 1.75em; vertical-align: middle;
  border: 1.5px solid #111; border-radius: 5px; background: #fff; overflow: hidden;
  font-weight: 700; line-height: 1; box-shadow: 0 1px 2px rgba(0,0,0,.18);
}
.plate-eu {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 1px; padding: 0 .34em; background: #003399; color: #fff;
}
.plate-eu .plate-stars { color: #ffcc00; font-size: .5em; line-height: 1; }
.plate-eu .plate-cc { font-size: .58em; letter-spacing: .04em; }
.plate-no {
  display: flex; align-items: center; padding: 0 .5em; color: #111;
  font-family: "Consolas", "DejaVu Sans Mono", ui-monospace, monospace;
  letter-spacing: .09em; text-transform: uppercase; font-size: .95em;
}

.chip-tone { font-weight: 650; padding: .22em .65em; }
.chip-tone i { font-size: 1em; }
.chip-tone-pos { background: rgba(16, 185, 129, 0.13); color: #0f7a55; }
.chip-tone-neg { background: rgba(239, 68, 68, 0.13);  color: #b42318; }
.chip-tone-neu { background: rgba(100, 116, 139, 0.14); color: #475569; }

[data-bs-theme="dark"] .chip-tag { background: rgba(217, 119, 6, 0.18); color: #f0b65f; }
[data-bs-theme="dark"] .chip-tone-pos { background: rgba(16, 185, 129, 0.18); color: #4ade9e; }
[data-bs-theme="dark"] .chip-tone-neg { background: rgba(239, 68, 68, 0.18);  color: #f08a82; }
[data-bs-theme="dark"] .chip-tone-neu { background: rgba(148, 163, 184, 0.18); color: #b0b9c6; }

/* Sentiment rail */
.tone-row-pos td:first-child, .clip-item.tone-row-pos { --rail: #10b981; }
.tone-row-neg td:first-child, .clip-item.tone-row-neg { --rail: #ef4444; }
.tone-row-neu td:first-child, .clip-item.tone-row-neu { --rail: #94a3b8; }
table.glass-table > tbody tr[class*="tone-row-"] td:first-child { position: relative; }
table.glass-table > tbody tr[class*="tone-row-"] td:first-child::before {
  content: ""; position: absolute; left: 0; top: 7px; bottom: 7px; width: 3px; border-radius: 3px; background: var(--rail);
}

.clip-item { position: relative; padding-left: 1rem !important; transition: background .12s ease; }
.clip-item::before { content: ""; position: absolute; left: 0; top: 12px; bottom: 12px; width: 3px; border-radius: 3px; background: var(--rail, transparent); }
.clip-item:hover { background: var(--surface-2); }
.clip-title { color: var(--ink); font-weight: 600; letter-spacing: -.01em; }
.clip-title:hover { color: var(--accent); }
.clip-sub { color: var(--ink-soft); font-size: .8rem; }
.clip-sub .sep { opacity: .4; margin: 0 .1em; }
.clip-meta { gap: .35rem !important; }

table.glass-table.clip-table > tbody td { padding-top: .7rem; padding-bottom: .7rem; }
.clip-table .clip-cell-title { min-width: 240px; }
.clip-table .clip-title { display: inline; }

/* Vehicle "recent coverage": title wraps to at most two lines; date/tone/type stay on one line. */
.coverage-title {
  display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden;
}

.veh-swatch { width: 16px; height: 16px; border-radius: 4px; display: inline-block; border: 1px solid var(--border-strong); flex: 0 0 auto; }

/* Handover photo thumbnails */
.veh-photo { position: relative; width: 96px; height: 96px; border-radius: var(--radius-sm); overflow: hidden; border: 1px solid var(--border); }
.veh-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.veh-photo-del { position: absolute; top: 3px; right: 3px; border: 0; border-radius: 50%; width: 22px; height: 22px; padding: 0; line-height: 1; background: rgba(0, 0, 0, 0.55); color: #fff; display: grid; place-items: center; cursor: pointer; }
.veh-photo-del:hover { background: #dc2626; }

/* =========================================================================
   Fleet availability planner
   ========================================================================= */
.plan-wrap { overflow-x: auto; border-radius: var(--radius); }
/* Wide enough that each of the 28 days gets a legible ~40px column; scrolls. */
.plan { min-width: 1280px; }
.plan-row { display: flex; align-items: stretch; border-bottom: 1px solid var(--border); }
.plan-row:last-child { border-bottom: 0; }
.plan-veh {
  flex: 0 0 172px; width: 172px; padding: 8px 12px;
  border-right: 1px solid var(--border);
  position: sticky; left: 0; z-index: 3; display: block; background: var(--surface);
}
.plan-head { position: sticky; top: 0; z-index: 4; background: var(--surface); }
.plan-head .plan-veh { font-size: .78rem; color: var(--ink-soft); font-weight: 600; }
/* Header day-strip must grow to fill the row like the body track does, so the
   day columns line up exactly with the cells/bars below. */
.plan-head .plan-days { flex: 1 1 auto; min-width: 0; }
.plan-track { position: relative; flex: 1 1 auto; min-height: 62px; }
.plan-days { display: grid; grid-template-columns: repeat(var(--days), 1fr); }
.plan-grid { position: absolute; inset: 0; }
.plan-day { text-align: center; font-size: .82rem; color: var(--ink-soft); padding: 7px 0; border-right: 1px solid var(--border); }
.plan-day .plan-dow { font-size: .66rem; opacity: .65; text-transform: uppercase; }
.plan-cell { display: block; border-right: 1px solid var(--border); height: 100%; }
.plan-bookable { cursor: pointer; }
.plan-bookable:hover .plan-grid { background: var(--accent-soft); }
.is-weekend { background: var(--cell-weekend); }
.plan-day.is-today { color: var(--accent); font-weight: 700; }
.plan-cell.is-today { background: var(--accent-soft); }
.plan-day.is-holiday { color: #e11d48; }
.plan-cell.is-holiday { background: var(--cell-holiday); }

.plan-bar {
  position: absolute; top: 7px; height: 32px;
  border-radius: 6px; color: #fff; font-size: .82rem; font-weight: 600;
  display: flex; align-items: center; padding: 0 9px; gap: 6px;
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
  z-index: 1; box-shadow: none; text-decoration: none;
}
.plan-bar:hover { filter: brightness(0.96); }
.plan-key { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.plan-bar-event {
  top: auto; bottom: 6px; height: 18px; padding: 0 7px; gap: 4px;
  font-size: .72rem; font-weight: 600; box-shadow: none; z-index: 2;
  background: repeating-linear-gradient(45deg, #64748b, #64748b 5px, #58647a 5px, #58647a 10px);
}
.plan-bar-event i { font-size: .8em; }
.plan-key-event { background: repeating-linear-gradient(45deg, #64748b, #64748b 4px, #58647a 4px, #58647a 8px) !important; }

/* =========================================================================
   Multi-select picker (global filter: countries / brands)
   ========================================================================= */
.picker { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.picker-head { display: flex; align-items: center; justify-content: space-between; padding: .6rem .75rem; background: var(--surface-2); border-bottom: 1px solid var(--border); }
.picker-title { display: inline-flex; align-items: center; gap: .45rem; font-weight: 600; font-size: .82rem; color: var(--ink); }
.picker-title i { color: var(--ink-soft); font-size: .9em; }
.picker-count { font-size: .7rem; font-weight: 600; color: var(--accent); background: var(--accent-soft); padding: .14rem .6rem; border-radius: 999px; }
.picker-chips { display: flex; flex-wrap: wrap; gap: .3rem; padding: .55rem .6rem 0; }
.picker-chip { display: inline-flex; align-items: center; gap: .3rem; font-size: .74rem; font-weight: 500; color: var(--accent); background: var(--accent-soft); border: 1px solid var(--accent-border); border-radius: 999px; padding: .12rem .25rem .12rem .55rem; }
.picker-chip button { border: 0; background: transparent; color: var(--accent); cursor: pointer; line-height: 1; font-size: 1rem; padding: 0 .15rem; border-radius: 50%; }
.picker-chip button:hover { background: var(--accent); color: var(--accent-ink); }
.picker-search { position: relative; padding: .55rem .6rem 0; }
.picker-search i { position: absolute; left: 1.05rem; top: 1.1rem; color: var(--ink-faint); font-size: .8rem; pointer-events: none; }
.picker-search .form-control { padding-left: 1.85rem; }
.picker-list { max-height: 200px; overflow-y: auto; padding: .4rem; display: flex; flex-direction: column; gap: 1px; }
.picker-opt { display: flex; align-items: center; gap: .55rem; padding: .38rem .55rem; border-radius: 7px; cursor: pointer; font-size: .86rem; color: var(--ink); transition: background .1s ease; }
.picker-opt:hover { background: var(--surface-2); }
.picker-opt:has(input:checked) { background: var(--accent-soft); color: var(--accent); font-weight: 500; }
.picker-opt:has(input:checked) .text-ink-soft { color: var(--accent) !important; opacity: .7; }
.picker-opt input { margin: 0; flex: 0 0 auto; }
.picker-opt.d-none { display: none; }
.picker-actions { display: flex; gap: 1.2rem; padding: .5rem .75rem; border-top: 1px solid var(--border); background: var(--surface-2); }
.picker-actions a { font-size: .76rem; font-weight: 500; color: var(--ink-soft); }
.picker-actions a:hover { color: var(--accent); }

/* =========================================================================
   Modern multi-select — progressive enhancement of any <select multiple>.
   Type to search, click chips like checkboxes. Mobile-friendly touch targets.
   ========================================================================= */
.ms { position: relative; }
.ms-native { display: none !important; }
.ms-control {
  display: flex; align-items: center; gap: 6px; min-height: 40px;
  padding: 4px 8px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--field-bg); cursor: text;
}
.ms-control:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); background: var(--surface); }
.ms-chips { display: flex; flex-wrap: wrap; gap: 5px; flex: 1; align-items: center; min-width: 0; }
.ms-chip {
  display: inline-flex; align-items: center; gap: .3rem; max-width: 100%;
  background: var(--accent-soft); color: var(--accent); border: 1px solid var(--accent-border);
  border-radius: 999px; padding: 3px 4px 3px 10px; font-size: .8rem; font-weight: 500;
}
.ms-chip > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ms-chip button { border: 0; background: transparent; color: var(--accent); cursor: pointer; line-height: 1; font-size: 1.05rem; padding: 0 .15rem; border-radius: 50%; }
.ms-chip button:hover { background: var(--accent); color: var(--accent-ink); }
.ms-search { border: 0; outline: 0; background: transparent; flex: 1; min-width: 90px; color: var(--ink); font-size: .92rem; padding: 5px 2px; }
.ms-search::placeholder { color: var(--ink-faint); }
.ms-caret { color: var(--ink-faint); font-size: .8rem; transition: transform .15s ease; }
.ms.open .ms-caret { transform: rotate(180deg); }
.ms-dropdown {
  position: absolute; z-index: 1085; left: 0; right: 0; top: calc(100% + 4px);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg); max-height: 280px; overflow-y: auto; padding: .4rem; display: none;
  overscroll-behavior: contain;
}
.ms.open .ms-dropdown { display: block; }
.ms-opt { display: flex; align-items: center; gap: .6rem; padding: .5rem .55rem; border-radius: 7px; cursor: pointer; font-size: .9rem; color: var(--ink); }
.ms-opt:hover, .ms-opt.active { background: var(--surface-2); }
.ms-box { width: 19px; height: 19px; border: 1.5px solid var(--border-strong); border-radius: 5px; display: grid; place-items: center; flex: 0 0 auto; color: transparent; font-size: .72rem; }
.ms-opt.sel { color: var(--accent); font-weight: 500; }
.ms-opt.sel .ms-box { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.ms-empty { padding: .7rem; color: var(--ink-soft); font-size: .85rem; text-align: center; }
@media (max-width: 575px) {
  .ms-opt { padding: .65rem .55rem; }       /* bigger touch targets on phones */
  .ms-dropdown { max-height: 50vh; }
}

/* =========================================================================
   Bootstrap utility overrides — keep color utilities theme-aware & minimal.
   These classes are baked into views; restyle them rather than editing markup.
   ========================================================================= */

/* Reported clipping rows: Bootstrap's .table-info forces light-cyan + black
   text (unreadable in dark). Neutralise its table vars and use a themed tint. */
table.glass-table > tbody tr.table-info {
  --bs-table-bg: transparent;
  --bs-table-color: var(--ink);
  --bs-table-accent-bg: transparent;
}
table.glass-table > tbody tr.table-info > td { background: var(--reported-bg); color: var(--ink); }
table.glass-table > tbody tr.table-info:hover > td { background: var(--reported-bg-hover); }

/* Solid Bootstrap badges → soft, theme-aware chips that match the chip language */
.badge.text-bg-primary { background: var(--accent-soft) !important; color: var(--accent) !important; }
.badge.text-bg-secondary { background: var(--chip-bg) !important; color: var(--ink-soft) !important; }
.badge.text-bg-light { background: var(--chip-bg) !important; color: var(--ink-soft) !important; border-color: var(--border) !important; }
.badge.text-bg-success { background: rgba(16, 185, 129, 0.13) !important; color: #0f7a55 !important; }
.badge.text-bg-danger { background: rgba(239, 68, 68, 0.13) !important; color: #b42318 !important; }
a.badge.text-bg-secondary:hover { background: var(--surface-2) !important; color: var(--ink) !important; }
[data-bs-theme="dark"] .badge.text-bg-success { background: rgba(16, 185, 129, 0.18) !important; color: #4ade9e !important; }
[data-bs-theme="dark"] .badge.text-bg-danger { background: rgba(239, 68, 68, 0.18) !important; color: #f08a82 !important; }

/* Brand-blue utility → our accent, so icons/links read consistently */
.text-primary { color: var(--accent) !important; }

/* Themed neutral surfaces for the few raw bg utilities (error pages, etc.) */
.bg-light { background-color: var(--surface-2) !important; color: var(--ink); }

/* Alerts: tone down to soft tints in both themes */
.alert-warning { background: rgba(217, 119, 6, 0.12); border-color: rgba(217, 119, 6, 0.25); color: #92600a; }
.alert-danger { background: rgba(239, 68, 68, 0.12); border-color: rgba(239, 68, 68, 0.25); color: #b42318; }
[data-bs-theme="dark"] .alert-warning { color: #f0b65f; }
[data-bs-theme="dark"] .alert-danger { color: #f08a82; }

@media (prefers-reduced-motion: reduce) {
  .skeleton { animation: none; }
}
