@charset "UTF-8";
/* ═══════════════════════════════════════════════════════════════════════
   Admin Theme — design tokens
   Bootstrap 5.3 overlay. Swap the --brand-* values for the project's brand.
   ═══════════════════════════════════════════════════════════════════════ */
:root {
  --brand-accent: #9b2b24;
  --brand-accent-dark: #7c211b;
  --brand-accent-rgb: 155, 43, 36;
  /* text color on accent-coloured surfaces (buttons, card headers, …) */
  --brand-on-accent: #fff;
  /* dark neutral used by the topbar/sidebar/login chrome */
  --brand-dark: #04132b;
  /* focus ring color */
  --brand-focus-rgb: var(--brand-accent-rgb);
  --topbar-height: 50px;
  --sidebar-width: 230px;
  /* dark defaults */
  --topbar-bg: #04132b;
  --topbar-border: var(--brand-accent);
  --topbar-text: #ccc;
  --topbar-muted: #888;
  --topbar-sep: rgba(255,255,255,0.08);
  --sidebar-bg: #04132b;
  --sidebar-text: #d8d8d8;
  --sidebar-muted: #888;
  --sidebar-sep: rgba(255,255,255,0.07);
  --sidebar-active-bg: rgba(var(--brand-accent-rgb), 0.13);
  --bs-primary: #9b2b24;
  --bs-primary-rgb: 155, 43, 36;
  /* dark-mode links: light accent — readable on #212529 */
  --bs-link-color: #e0958f;
  --bs-link-hover-color:#ecb4b0;
  /* required-field asterisk (dark default; light override below) */
  --brand-req: #ff7a70;
}

[data-bs-theme=light] {
  --topbar-bg: #fff;
  --topbar-border: var(--brand-accent);
  --topbar-text: #333;
  --topbar-muted: #666;
  --topbar-sep: rgba(0,0,0,0.08);
  --sidebar-bg: #dde1e7;
  --sidebar-text: #333;
  --sidebar-muted: #777;
  --sidebar-sep: rgba(0,0,0,0.07);
  --sidebar-active-bg: rgba(var(--brand-accent-rgb), 0.18);
  /* light-mode links: darker accent for contrast on white */
  --bs-link-color: #8a241e;
  --bs-link-hover-color:var(--brand-dark);
  /* light-mode primary: darker accent — fixes all Bootstrap components using
     --bs-primary (form-check:checked fill, text-primary, badge, focus borders,
     …) on white bg */
  --bs-primary: #8a241e;
  --bs-primary-rgb: 138, 36, 30;
  --brand-focus-rgb: 138, 36, 30;
  --brand-req: #d9534f;
}

/* Tom Select — Bootstrap variable overrides for full light + dark support */
/* Multi-select items: replace hardcoded #efefef / #343a40 with BS variables */
.ts-wrapper.multi .ts-control > div {
  background: var(--bs-secondary-bg);
  color: var(--bs-body-color);
  border-color: var(--bs-border-color);
}

.ts-wrapper.multi .ts-control > div.active {
  background: var(--bs-primary);
  color: #fff;
  border-color: transparent;
}

.ts-wrapper.multi.disabled .ts-control > div,
.ts-wrapper.multi.disabled .ts-control > div.active {
  background: var(--bs-secondary-bg);
  color: var(--bs-secondary-color);
  border-color: var(--bs-border-color);
}

/* Dropdown: replace hardcoded #d0d0d0 border with BS variable */
.ts-dropdown {
  border-color: var(--bs-border-color);
}

/* Active (hovered) option already uses --bs-tertiary-bg from the BS5 theme */
/* Highlight in search results */
.ts-dropdown [data-selectable] .highlight {
  background: rgba(var(--brand-accent-rgb, 255, 200, 0), 0.3);
  border-radius: 2px;
}

/* remove_button plugin × inside item */
.ts-wrapper .item > .remove {
  border-left-color: var(--bs-border-color);
  color: var(--bs-body-color);
}

/* Brand focus ring — matches every other focused control in the admin
   (was a stray Bootstrap-blue ring). */
.focus .ts-control {
  border-color: var(--brand-accent) !important;
  box-shadow: 0 0 0 0.25rem rgba(var(--brand-focus-rgb), 0.25) !important;
}

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

a {
  color: var(--bs-link-color);
}

a:hover {
  color: var(--bs-link-hover-color);
}

body {
  background: var(--bs-body-bg);
}

h1 {
  font-size: 1.75rem !important;
  color: inherit !important;
}

h2 {
  font-size: 1.4rem !important;
  color: inherit !important;
}

h3 {
  font-size: 1.15rem !important;
  color: inherit !important;
}

h4 {
  font-size: 1rem !important;
  color: inherit !important;
}

/* Force Bootstrap CSS-variable colours on all buttons */
.btn {
  display: inline-block;
  height: auto !important;
  padding: var(--bs-btn-padding-y) var(--bs-btn-padding-x) !important;
  background-position: 0 0 !important;
  background-image: none !important;
  background-color: var(--bs-btn-bg) !important;
  color: var(--bs-btn-color) !important;
  border: 1px solid var(--bs-btn-border-color) !important;
  appearance: none;
}

.btn:hover, .btn:focus, .btn:active {
  background-position: 0 0 !important;
  background-image: none !important;
  background-color: var(--bs-btn-hover-bg, var(--bs-btn-bg)) !important;
  color: var(--bs-btn-hover-color, var(--bs-btn-color)) !important;
  border-color: var(--bs-btn-hover-border-color, var(--bs-btn-border-color)) !important;
}

/* ── Brand primary button ─────────────────────────────────── */
.btn-primary {
  --bs-btn-color: var(--brand-on-accent);
  --bs-btn-bg: var(--brand-accent);
  --bs-btn-border-color: var(--brand-accent);
  --bs-btn-hover-color: var(--brand-on-accent);
  --bs-btn-hover-bg: var(--brand-accent-dark);
  --bs-btn-hover-border-color: var(--brand-accent-dark);
  --bs-btn-active-color: var(--brand-on-accent);
  --bs-btn-active-bg: var(--brand-accent-dark);
  --bs-btn-active-border-color:var(--brand-accent-dark);
  --bs-btn-focus-shadow-rgb: var(--brand-accent-rgb);
  --bs-btn-disabled-color: var(--brand-on-accent);
  --bs-btn-disabled-bg: var(--brand-accent);
  --bs-btn-disabled-border-color: var(--brand-accent);
}

.admin-main label strong {
  color: inherit;
}

/* Error labels stay red */
.admin-main label.err,
.admin-main label.err strong,
.admin-main strong.err {
  color: var(--bs-danger) !important;
}

/* ── Topbar ──────────────────────────────────────────────────────────── */
.admin-topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--topbar-height);
  z-index: 1050;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 0.75rem 0 0;
  background: var(--topbar-bg);
  border-bottom: 2px solid var(--topbar-border);
  gap: 0.5rem;
}

.topbar-start {
  display: flex;
  align-items: center;
  gap: 0;
  flex-shrink: 0;
}

.topbar-hamburger {
  background: transparent;
  border: none;
  color: var(--topbar-text);
  width: var(--topbar-height);
  height: var(--topbar-height);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  cursor: pointer;
  flex-shrink: 0;
  padding: 0;
  transition: color 0.15s;
}

.topbar-hamburger:hover {
  color: var(--brand-accent);
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  text-decoration: none;
  padding: 0 0.75rem;
  height: var(--topbar-height);
  border-right: 1px solid var(--topbar-sep);
}

.topbar-brand-text {
  color: var(--topbar-text);
  font-weight: 700;
  font-size: 0.82rem;
  line-height: 1;
  white-space: nowrap;
}

.topbar-brand-sub {
  color: var(--topbar-muted);
  font-weight: 400;
}

.topbar-end {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex-shrink: 0;
  margin-left: auto;
}

.topbar-countdown,
.topbar-clock {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78rem;
  color: var(--topbar-muted);
  padding: 0 0.6rem;
  border-right: 1px solid var(--topbar-sep);
  white-space: nowrap;
}

#session-countdown {
  color: var(--topbar-text);
  font-variant-numeric: tabular-nums;
}

.topbar-user {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8rem;
  color: var(--topbar-text);
  padding: 0 0.6rem;
  border-right: 1px solid var(--topbar-sep);
  white-space: nowrap;
}

.topbar-username {
  max-width: 14ch;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-web-link {
  color: var(--topbar-muted);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0 0.75rem;
  height: var(--topbar-height);
  font-size: 0.8rem;
  border-left: 1px solid var(--topbar-sep);
  white-space: nowrap;
  transition: color 0.15s, background 0.15s;
}

.topbar-web-link:hover {
  color: var(--brand-accent);
}

.topbar-logout {
  color: var(--topbar-muted);
  text-decoration: none;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  font-size: 0.9rem;
  transition: color 0.15s, background 0.15s;
}

.topbar-logout:hover {
  color: #e55;
  background: rgba(255, 80, 80, 0.1);
}

.topbar-theme-toggle {
  background: transparent;
  border: 1px solid var(--topbar-sep);
  color: var(--topbar-muted);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  padding: 0;
  transition: border-color 0.15s, color 0.15s;
  flex-shrink: 0;
}

.topbar-theme-toggle:hover {
  border-color: var(--brand-accent);
  color: var(--brand-accent);
}

/* ── Mobile: reclaim space so the theme toggle + logout never fall off-screen.
   The brand wordmark (nowrap, ~175px) is the only shrinkable item; hiding it
   below Bootstrap's sm breakpoint keeps the end controls reachable on phones.
   The logo stays. (Matches the d-none/d-sm-inline pattern on the web-link.) */
@media (max-width: 575.98px) {
  .topbar-brand-text {
    display: none;
  }
  .topbar-brand {
    border-right: none;
  }
}
/* ── Admin layout (wrapper → main + sidebar) ────────────────────────── */
.admin-wrapper {
  display: flex;
  min-height: 100vh;
  align-items: stretch;
  padding-top: var(--topbar-height);
}

.admin-main {
  flex: 1 1 auto;
  min-width: 0;
  overflow-x: auto;
}

#main.admin-main {
  padding: 1.25rem 1.5rem 2rem;
}

/* light / dark main-area background */
[data-bs-theme=light] .admin-main {
  background: #f2f3f5;
}

[data-bs-theme=dark] .admin-main {
  background: #18191e;
}

/* Native select dropdown inherits OS theme via color-scheme */
[data-bs-theme=dark] .admin-main select {
  color-scheme: dark;
}

[data-bs-theme=light] .admin-main select {
  color-scheme: light;
}

/* Override browser defaults on filter selects */
[data-bs-theme=dark] .admin-main .form-select {
  background-color: var(--bs-body-bg) !important;
  color: var(--bs-body-color) !important;
  border-color: rgba(255, 255, 255, 0.2) !important;
  --bs-form-select-bg-img: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23dee2e6' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
}

[data-bs-theme=light] .admin-main .form-select {
  background-color: var(--bs-body-bg) !important;
  color: var(--bs-body-color) !important;
  border-color: var(--bs-border-color) !important;
}

/* ── Sidebar (always dark, left column) ─────────────────────────────── */
.admin-sidebar {
  width: var(--sidebar-width);
  flex: 0 0 var(--sidebar-width);
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: var(--topbar-height);
  height: calc(100vh - var(--topbar-height));
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: var(--sidebar-sep) var(--sidebar-bg);
  order: -1; /* left of .admin-main */
}

/* ── Sidebar: navigation ────────────────────────────────────────────── */
.sidebar-nav {
  flex: 1 1 auto;
  padding: 0.4rem 0;
}

.sidebar-nav-label {
  padding: 0.6rem 1rem 0.15rem;
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--sidebar-muted);
  font-weight: 700;
}

.sidebar-menu {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sidebar-link {
  display: flex;
  align-items: center;
  padding: 0.42rem 1rem;
  color: var(--sidebar-text);
  text-decoration: none;
  font-size: 0.8rem;
  border-left: 3px solid transparent;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
  line-height: 1.35;
}

.sidebar-link:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--brand-accent);
  border-left-color: rgba(248, 192, 0, 0.35);
}

.sidebar-item.active > .sidebar-link {
  background: var(--sidebar-active-bg);
  color: var(--brand-accent);
  border-left-color: var(--brand-accent);
  font-weight: 600;
}

/* ── Sidebar: module sub-menu ───────────────────────────────────────── */
.sidebar-submenu {
  border-top: 1px solid var(--sidebar-sep);
  padding: 0.25rem 0;
  flex-shrink: 0;
}

/* Strip window/card chrome inside sidebar submenu */
.sidebar-submenu .card,
.sidebar-submenu .window {
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  margin: 0 !important;
}

.sidebar-submenu .card-header {
  background: transparent !important;
  border: none !important;
  padding: 0.6rem 1rem 0.15rem !important;
  display: block !important;
}

.sidebar-submenu .card-header h1,
.sidebar-submenu .card-header h2,
.sidebar-submenu .card-header h3,
.sidebar-submenu .card-header h4 {
  font-size: 0.62rem !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.09em !important;
  color: var(--sidebar-muted) !important;
  margin: 0 !important;
}

.sidebar-submenu .card-header .window-controls {
  display: none;
}

.sidebar-submenu .card-body {
  padding: 0 !important;
}

.sidebar-submenu .mb-3 {
  margin-bottom: 0 !important;
}

/* Sub-menu list styling */
.sidebar-submenu ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sidebar-submenu li a {
  display: block;
  padding: 0.38rem 1rem 0.38rem 1.3rem;
  color: var(--sidebar-text);
  text-decoration: none;
  font-size: 0.78rem;
  border-left: 3px solid transparent;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
  line-height: 1.3;
}

.sidebar-submenu li a:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--brand-accent);
  border-left-color: rgba(248, 192, 0, 0.35);
}

.sidebar-submenu li.selected > a,
.sidebar-submenu li.open.selected > a {
  color: var(--brand-accent);
  border-left-color: var(--brand-accent);
  background: var(--sidebar-active-bg);
  font-weight: 600;
}

.sidebar-submenu ul ul li a {
  padding-left: 2rem;
  font-size: 0.74rem;
}

/* Light-mode sidebar: replace yellow text with dark amber for readable contrast */
[data-bs-theme=light] .sidebar-link:hover,
[data-bs-theme=light] .sidebar-item.active > .sidebar-link,
[data-bs-theme=light] .sidebar-submenu li a:hover,
[data-bs-theme=light] .sidebar-submenu li.selected > a,
[data-bs-theme=light] .sidebar-submenu li.open.selected > a {
  color: #5a4000;
}

[data-bs-theme=light] .sidebar-link:hover,
[data-bs-theme=light] .sidebar-submenu li a:hover {
  background: rgba(0, 0, 0, 0.06);
}

/* ── Bootstrap card = Window ────────────────────────────────────────── */
.admin-main .card {
  margin-bottom: 1rem;
}

.admin-main .card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.45rem 0.85rem;
  background: var(--brand-accent);
  color: var(--brand-on-accent);
  border-bottom: 2px solid var(--brand-accent-dark);
}

.admin-main .card-header h1,
.admin-main .card-header h2,
.admin-main .card-header h3,
.admin-main .card-header h4 {
  margin: 0 !important;
  font-size: 0.88rem !important;
  font-weight: 700 !important;
  color: var(--brand-on-accent) !important;
  white-space: nowrap;
}

.window-controls {
  display: flex;
  gap: 0.4rem;
  align-items: center;
  flex-shrink: 0;
  margin-left: auto;
}

.admin-main .card-header .dt-breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  margin: 0 0.5rem;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--brand-on-accent);
  white-space: nowrap;
}

.admin-main .card-header .dt-breadcrumb a {
  color: var(--brand-on-accent);
  text-decoration: underline;
  text-underline-offset: 2px;
  opacity: 0.75;
}

.admin-main .card-header .dt-breadcrumb a:hover {
  opacity: 1;
}

.admin-main .card-header .dt-breadcrumb .dt-bc-sep {
  opacity: 0.45;
}

.admin-main .card-header .dt-breadcrumb .dt-bc-cur {
  font-weight: 700;
}

.admin-main .card-header .dt-breadcrumb .dt-bc-label {
  opacity: 0.6;
  font-weight: 400;
}

.admin-main .card-header .window-controls a,
.admin-main .card-header .window-controls button {
  color: var(--brand-on-accent);
  background: var(--brand-accent);
  text-decoration: none;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  border: 0;
  border-radius: 4px;
  white-space: nowrap;
  cursor: pointer;
  font-family: inherit;
  line-height: 1.5;
  transition: opacity 0.12s;
}

.admin-main .card-header .window-controls a:hover,
.admin-main .card-header .window-controls button:hover {
  opacity: 0.8;
}

.admin-main .card-body {
  padding: 0.85rem;
}

/* Nested card (window inside window) — subdued header */
.admin-main .card .card .card-header {
  background: rgba(var(--brand-accent-rgb), 0.22);
  border-bottom-color: rgba(var(--brand-accent-rgb), 0.45);
  color: var(--bs-body-color);
}

.admin-main .card .card .card-header h1,
.admin-main .card .card .card-header h2,
.admin-main .card .card .card-header h3,
.admin-main .card .card .card-header h4 {
  color: var(--bs-body-color) !important;
}

[data-bs-theme=dark] .admin-main .card .card .card-header {
  background: rgba(var(--brand-accent-rgb), 0.13);
  border-bottom-color: rgba(var(--brand-accent-rgb), 0.28);
}

/* ── DataTable filter widget card ───────────────────────────────────── */
.admin-main .card.filter .card-body {
  padding: 0.6rem 0.85rem;
}

/* Filter widget (App\Admin\DataTable\Filter). Own layout classes rather than
   Bootstrap .d-flex utilities so the phone layout can switch to a grid — the
   utilities are display:flex !important and can't be overridden cleanly. */
.dt-filter {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem; /* = old gap-3 */
}

.dt-filter__group {
  display: flex;
  align-items: center;
  gap: 0.25rem; /* = old gap-1 */
}

/* Phone: the flat row wraps unevenly and reads scattered. Lay it out as a
   two-column grid — the label column sizes to the WIDEST label, the control
   column fills the rest — so every select / input starts at the same x. Each
   label+control group is a subgrid sharing the parent's tracks; the checkbox
   spans full width and Reset aligns right. */
@media (max-width: 575.98px) {
  .dt-filter {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 0.5rem 0.6rem;
  }
  .dt-filter__group {
    display: grid;
    grid-template-columns: subgrid;
    grid-column: 1/-1;
  }
  .dt-filter .form-select,
  .dt-filter input[type=text],
  .dt-filter input[type=search] {
    width: 100%;
    min-width: 0;
  }
  /* Checkbox row spans both columns, flush-left (drop Bootstrap's indent). */
  .dt-filter__check {
    grid-column: 1/-1;
    padding-left: 0;
    display: flex;
    align-items: center;
    gap: 0.4rem;
  }
  .dt-filter__check .form-check-input {
    margin: 0;
    float: none;
  }
  /* Reset spans the row and sits on the right. */
  .dt-filter .dt-filter-reset {
    grid-column: 1/-1;
    justify-self: end;
    width: auto;
  }
}
/* ── DataTable overrides ─────────────────────────────────────────────── */
/* Unhide custom header spans (DataTables 2 only reveals .dt-column-title) —
   except the responsive label pair, whose visibility local.css swaps per
   breakpoint (Column::mobileLabel). */
.dt-table th span:not(.dt-column-title):not(.dt-column-order):not(.dt-label-desktop):not(.dt-label-mobile) {
  display: inline !important;
}

.dt-table thead th {
  vertical-align: middle;
}

.dt-table td {
  white-space: nowrap;
}

.dt-table td.dt-col-fill {
  white-space: normal;
  width: auto;
  min-width: 8rem;
}

.dt-drag-handle {
  cursor: grab;
  color: var(--bs-secondary-color);
  padding: 0 3px;
  user-select: none;
}

.dt-drag-handle:active {
  cursor: grabbing;
}

.ui-sortable-helper td {
  background: var(--bs-body-bg);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
}

/* DataTables Bootstrap 5 integration: table inside card-body */
.admin-main .card-body .dt-layout-row {
  margin: 0;
}

.admin-main .card-body .dt-layout-cell.dt-full {
  padding: 0;
}

/* Allow DataTables dropdowns to escape the table-responsive overflow clip. */
.admin-main .card-body .table-responsive {
  overflow-x: auto;
  overflow-y: visible;
}

/* ── DataTables controls styling ─────────────────────────────────────── */
/* Top row (length + search) and bottom row (info + paging) as flex */
.admin-main .dt-layout-row:not(:has(.dt-full)) {
  display: flex !important;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.4rem 0;
}

/* Labels: small, inline-flex so text + control align vertically */
.admin-main .dt-length label,
.admin-main .dt-search label {
  display: inline-flex !important;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  margin: 0;
  white-space: nowrap;
}

/* Style DT-generated select/input directly — avoids flash before JS adds Bootstrap classes */
.admin-main .dt-length select,
.admin-main .dt-search input[type=search] {
  display: inline-block;
  font-size: 0.82rem;
  padding: 0.25rem 0.5rem;
  color: var(--bs-body-color);
  background-color: var(--bs-body-bg);
  border: 1px solid var(--bs-border-color);
  border-radius: var(--bs-border-radius-sm);
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.admin-main .dt-length select {
  width: auto;
  padding-right: 1.75rem;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23adb5bd' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 0.5rem center;
  background-size: 12px 10px;
  appearance: none;
}

.admin-main .dt-search input[type=search] {
  min-width: 160px;
}

/* Focus ring in brand colour */
.admin-main .dt-length .form-select:focus,
.admin-main .dt-search .form-control:focus {
  border-color: var(--brand-accent);
  box-shadow: 0 0 0 0.2rem rgba(var(--brand-focus-rgb), 0.25);
}

/* Info text */
.admin-main .dt-info {
  font-size: 0.82rem;
  padding-top: 0.3rem;
}

/* Pagination — DT 2.x wraps buttons in <nav> inside .dt-paging */
.admin-main .dt-paging {
  display: flex;
  justify-content: flex-end;
  padding-right: 0;
}

.admin-main .dt-paging nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
}

.admin-main .dt-paging-button {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  height: auto !important;
  min-width: 2rem;
  padding: 0.25rem 0.55rem !important;
  font-size: 0.82rem;
  line-height: 1.5;
  border: 1px solid var(--bs-border-color) !important;
  border-radius: 0.3rem;
  background: transparent !important;
  background-image: none !important;
  background-position: 0 0 !important;
  color: var(--bs-body-color) !important;
  cursor: pointer;
  transition: background-color 0.12s, border-color 0.12s, color 0.12s;
}

.admin-main .dt-paging-button:hover:not(:disabled) {
  background-color: var(--bs-tertiary-bg) !important;
  border-color: var(--bs-border-color) !important;
  color: var(--bs-body-color) !important;
  background-position: 0 0 !important;
}

.admin-main .dt-paging-button.current,
.admin-main .dt-paging-button.current:hover {
  background-color: var(--brand-accent) !important;
  background-position: 0 0 !important;
  border-color: var(--brand-accent) !important;
  color: var(--brand-on-accent) !important;
  font-weight: 700;
}

.admin-main .dt-paging-button.disabled,
.admin-main .dt-paging-button:disabled {
  opacity: 0.4;
  cursor: default;
  pointer-events: none;
}

/* Pagination buttons to a comfortable finger target on phones. */
@media (max-width: 767.98px) {
  .admin-main .dt-paging-button {
    min-width: 44px;
    min-height: 44px;
  }
}
/* ── Font Awesome indicator icons ───────────────────────────────────── */
.fa-dt {
  font-size: 14px;
}

.fa-dt-yes {
  color: #3a3;
}

.fa-dt-no {
  color: #ccc;
}

.fa-dt-link {
  color: #27c;
  text-decoration: none;
}

.fa-dt-link:hover {
  color: #059;
}

/* ── Edit / delete icon links ───────────────────────────────────────── */
.dt-th-sort-reset {
  text-align: center !important;
}

.dt-action {
  font-size: 13px;
}

.dt-edit {
  color: #555;
}

.dt-edit:hover {
  color: #27c;
}

.dt-del {
  color: #a33;
}

.dt-del:hover {
  color: #f00;
}

/* ── Flash messages ─────────────────────────────────────────────────── */
/* Ensure Bootstrap .alert handles look; neutralise any inherited background */
div.error,
div.warn,
div.oki,
div.info {
  background: transparent !important;
  border: none !important;
  color: inherit !important;
  position: static !important;
  margin-bottom: 0 !important;
}

/* Inline .error text colour (labels, field hints) stays red */
span.error,
label.error,
.error:not(div) {
  color: var(--bs-danger) !important;
}

/* Links inside alerts — let Bootstrap handle colours */
.alert a {
  font-weight: 600;
}

/* ── Status toggle ──────────────────────────────────────────────────── */
span.status-green,
span.status-red {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  height: auto;
  background: none;
  vertical-align: middle;
}

span.status-green::before,
span.status-red::before {
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  font-style: normal;
  font-size: 1.15rem;
  line-height: 1;
  display: inline-block;
  -webkit-font-smoothing: antialiased;
}

span.status-green::before {
  content: "\f205"; /* fa-toggle-on */
  color: var(--bs-success);
}

span.status-red::before {
  content: "\f204"; /* fa-toggle-off */
  color: var(--bs-danger);
}

span.status-green[onclick],
span.status-red[onclick] {
  cursor: pointer;
}

span.status-green[onclick]:hover::before {
  opacity: 0.75;
}

span.status-red[onclick]:hover::before {
  opacity: 0.75;
}

/* ── dt-filter-reset button ─────────────────────────────────────────── */
.dt-filter-reset {
  cursor: pointer;
}

/* Checkbox in the filter flex row — Bootstrap adds margin-top:0.25em for
   inline use; zero it out so the box aligns with selects and labels. */
[id^=dtf-] .form-check {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 0;
}

[id^=dtf-] .form-check-input {
  margin-top: 0;
  float: none;
  flex-shrink: 0;
}

[id^=dtf-] .form-check-label {
  margin-bottom: 0;
}

/* ── Quill editor ───────────────────────────────────────────────────── */
.ql-editor {
  min-height: 200px;
  font: 100%/1.5 Arial, sans-serif;
  color: #333;
}

.ql-toolbar.ql-snow,
.ql-container.ql-snow {
  border-color: #ccc;
}

[data-bs-theme=dark] .ql-toolbar.ql-snow,
[data-bs-theme=dark] .ql-container.ql-snow {
  border-color: #495057;
  background: #2b3035;
}

[data-bs-theme=dark] .ql-editor {
  color: #dee2e6;
}

[data-bs-theme=dark] .ql-editor.ql-blank::before {
  color: #6c757d;
}

[data-bs-theme=dark] .ql-toolbar .ql-stroke {
  stroke: #adb5bd;
}

[data-bs-theme=dark] .ql-toolbar .ql-fill {
  fill: #adb5bd;
}

[data-bs-theme=dark] .ql-toolbar .ql-picker {
  color: #adb5bd;
}

[data-bs-theme=dark] .ql-toolbar .ql-picker-options {
  background: #2b3035;
  border-color: #495057;
}

[data-bs-theme=dark] .ql-toolbar button:hover .ql-stroke,
[data-bs-theme=dark] .ql-toolbar button.ql-active .ql-stroke {
  stroke: #fff;
}

[data-bs-theme=dark] .ql-toolbar button:hover .ql-fill,
[data-bs-theme=dark] .ql-toolbar button.ql-active .ql-fill {
  fill: #fff;
}

[data-bs-theme=dark] .ql-toolbar button:hover,
[data-bs-theme=dark] .ql-toolbar button.ql-active {
  color: #fff;
}

/* ── Sidebar backdrop (mobile overlay) ───────────────────────────────── */
.sidebar-backdrop {
  display: none;
  position: fixed;
  top: var(--topbar-height);
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 1040;
  backdrop-filter: blur(2px);
}

.sidebar-backdrop.is-open {
  display: block;
}

/* ── Responsive layout ───────────────────────────────────────────────── */
@media (max-width: 991.98px) {
  .admin-sidebar {
    position: fixed;
    top: var(--topbar-height);
    left: calc(-1 * var(--sidebar-width));
    height: calc(100vh - var(--topbar-height));
    z-index: 1045;
    transition: left 0.25s ease;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.35);
  }
  .admin-sidebar.is-open {
    left: 0;
  }
  #main.admin-main {
    padding: 0.75rem 0.75rem 2rem;
  }
}
@media (min-width: 992px) {
  .topbar-hamburger {
    display: none !important;
  }
  .sidebar-backdrop {
    display: none !important;
  }
  .admin-sidebar {
    left: auto;
    position: sticky;
    transition: none;
  }
}
/* ── Dashboard ───────────────────────────────────────────────────────── */
.dashboard-welcome {
  border-left: 4px solid var(--brand-accent);
}

.dashboard-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--brand-accent);
  color: var(--brand-on-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.dashboard-module-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 1.5rem 0.5rem 1rem;
  border-radius: 8px;
  text-decoration: none;
  font-size: 0.78rem;
  font-weight: 500;
  text-align: center;
  transition: background 0.15s, color 0.15s;
  color: var(--bs-body-color);
  background: transparent;
  border: 1px solid var(--bs-border-color);
  height: 100%;
}

.dashboard-module-link i {
  color: var(--brand-accent);
  transition: transform 0.15s;
}

.dashboard-module-link:hover {
  background: var(--brand-accent);
  color: var(--brand-on-accent);
  border-color: var(--brand-accent);
}

.dashboard-module-link:hover i {
  color: var(--brand-on-accent);
  transform: scale(1.15);
}

/* ── Login page ──────────────────────────────────────────────────────── */
.login-page .admin-sidebar {
  display: none;
}

.login-page .admin-main {
  padding: 0;
}

.login-page .admin-wrapper {
  padding-top: 0;
}

.login-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 1.5rem 1rem;
  background: var(--bs-body-bg);
}

.login-card {
  width: 100%;
  max-width: 400px;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
  border: 1px solid var(--bs-border-color);
}

/* Coloured header bar */
.login-header {
  background: var(--brand-dark);
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.login-header .brand-logo {
  height: 44px;
}

.login-header-text {
  display: flex;
  flex-direction: column;
  line-height: 1.3;
}

.login-header-text strong {
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
}

.login-header-text span {
  color: var(--brand-accent);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* Form body */
.login-body {
  background: var(--bs-body-bg);
  padding: 1.75rem 1.5rem 1.5rem;
}

.login-body .form-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--bs-secondary-color);
  margin-bottom: 0.3rem;
}

.login-body .form-control {
  font-size: 0.95rem;
  padding: 0.55rem 0.75rem;
  border-radius: 6px;
}

.login-body .form-control:focus {
  border-color: var(--brand-accent);
  box-shadow: 0 0 0 0.2rem rgba(var(--brand-focus-rgb), 0.25);
}

.btn-login {
  --bs-btn-color: var(--brand-on-accent);
  --bs-btn-bg: var(--brand-accent);
  --bs-btn-border-color: var(--brand-accent);
  --bs-btn-hover-color: var(--brand-on-accent);
  --bs-btn-hover-bg: var(--brand-accent-dark);
  --bs-btn-hover-border-color: var(--brand-accent-dark);
  --bs-btn-active-color: var(--brand-on-accent);
  --bs-btn-active-bg: var(--brand-accent-dark);
  --bs-btn-focus-shadow-rgb: var(--brand-accent-rgb);
  font-weight: 700;
  font-size: 0.95rem;
  padding: 0.65rem;
  letter-spacing: 0.02em;
}

.login-lang {
  margin-top: 1.25rem;
  font-size: 0.75rem;
  color: var(--bs-secondary-color);
  text-align: center;
}

.login-lang a {
  color: var(--bs-secondary-color);
  text-decoration: none;
}

.login-lang a:hover {
  color: var(--brand-accent-dark);
  text-decoration: underline;
}

.login-lang strong {
  color: var(--bs-body-color);
}

/* ── Form layout inside cards (legacy edit forms) ───────────────────── */
.admin-main form table th {
  font-weight: normal;
  white-space: nowrap;
  vertical-align: top;
  padding: 0.3rem 0.5rem 0.3rem 0;
  text-align: right;
  color: var(--bs-secondary-color);
}

.admin-main form table td {
  padding: 0.2rem 0.4rem;
  vertical-align: top;
}

/* ── Utility ─────────────────────────────────────────────────────────── */
.clear {
  clear: both;
}

/* ── Form elements inside card-body (module edit/add forms) ─────────── */
/* Text-like inputs without form-control: visual styling defaults (sized fields, date pickers, etc.).
   Width is intentionally NOT set here — let class-specific rules (.col-sm-9 > input,
   .form-inline-text, etc.) govern width without specificity conflicts. */
.card-body input:not(.form-control):not([type=submit]):not([type=button]):not([type=image]):not([type=checkbox]):not([type=radio]):not([type=hidden]):not([type=range]):not([type=file]) {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--bs-body-color);
  background-color: var(--bs-body-bg);
  border: 1px solid var(--bs-border-color);
  border-radius: var(--bs-border-radius-sm);
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
  vertical-align: middle;
}

.card-body input:not(.form-control):not([type=submit]):not([type=button]):not([type=image]):not([type=checkbox]):not([type=radio]):not([type=hidden]):not([type=range]):not([type=file]):focus {
  border-color: var(--brand-accent);
  outline: 0;
  box-shadow: 0 0 0 0.2rem rgba(var(--brand-focus-rgb), 0.25);
}

/* form-control inputs get Bootstrap focus highlight */
.card-body .form-control:focus,
.card-body .form-control:focus-visible {
  border-color: var(--brand-accent);
  box-shadow: 0 0 0 0.2rem rgba(var(--brand-focus-rgb), 0.25);
}

/* ── Bootstrap horizontal form rows ─────────────────────────────────── */
/* Col-form-label: compact size to match form inputs */
.card-body .col-form-label {
  font-size: 0.875rem;
  padding-top: calc(0.25rem + 1px);
  padding-bottom: calc(0.25rem + 1px);
}

/* Bare inputs / textareas inside form rows get form-control-like styling.
   Classed inputs use descendant selectors so they keep styling when wrapped in
   .form-inline-ig (Bootstrap-style input-group with unit suffix). */
.card-body .col-sm-9 > input:not([class]):not([type=checkbox]):not([type=radio]),
.card-body .col-sm-9 input.form-inline-text,
.card-body .col-sm-9 input.form-inline-text-sm,
.card-body .col-sm-9 input.form-date-inline,
.card-body .col-sm-9 > textarea:not([class]) {
  display: block;
  width: 100%;
  padding: 0.25rem 0.5rem;
  font-size: 0.875rem;
  font-family: inherit;
  line-height: 1.5;
  color: var(--bs-body-color);
  background-color: var(--bs-body-bg);
  border: 1px solid var(--bs-border-color);
  border-radius: var(--bs-border-radius-sm);
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.card-body .col-sm-9 > input:not([class]):not([type=checkbox]):not([type=radio]):focus,
.card-body .col-sm-9 input.form-inline-text:focus,
.card-body .col-sm-9 input.form-inline-text-sm:focus,
.card-body .col-sm-9 input.form-date-inline:focus,
.card-body .col-sm-9 > textarea:not([class]):focus {
  border-color: var(--brand-accent);
  box-shadow: 0 0 0 0.2rem rgba(var(--brand-focus-rgb), 0.25);
  outline: 0;
}

/* Date inputs in groups: fixed width for DD.MM.YYYY (10 chars) */
.card-body .col-sm-9.d-flex input.form-date-inline {
  width: calc(10ch + 1rem + 2px);
  flex: 0 0 auto;
}

/* Short text inputs in groups: width follows size attribute, don't grow */
.card-body .col-sm-9.d-flex input.form-inline-text-sm {
  width: auto;
  flex: 0 0 auto;
}

/* Long text inputs in groups grow to fill remaining row width on sm+ */
@media (min-width: 576px) {
  .card-body .col-sm-9.d-flex input.form-inline-text {
    flex: 1 1 auto;
    min-width: 0;
    width: auto;
  }
}
/* Input-group wrapper (input + unit suffix like cm/kg).
   Acts as a single flex item inside the d-flex group; visually attaches a
   gray text suffix to the right of the input (Bootstrap input-group style). */
.card-body .col-sm-9.d-flex > .form-inline-ig {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: stretch;
}

.card-body .col-sm-9.d-flex .form-inline-ig > input {
  border-top-right-radius: 0 !important;
  border-bottom-right-radius: 0 !important;
}

.form-inline-ig__suffix {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.5rem;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--bs-secondary-color);
  background-color: rgba(var(--bs-body-color-rgb), 0.05);
  border: 1px solid var(--bs-border-color);
  border-left: 0;
  border-top-right-radius: var(--bs-border-radius-sm);
  border-bottom-right-radius: var(--bs-border-radius-sm);
  white-space: nowrap;
}

/* Inputs that already have a class (custom-sized inputs) still get base
   styling if they lack form-control */
.card-body .col-sm-9 input[class]:not([class*=form-control]),
.card-body .col-sm-9 > input[class]:not([class*=form-control]) {
  padding: 0.25rem 0.5rem;
  font-size: 0.875rem;
  border: 1px solid var(--bs-border-color);
  border-radius: var(--bs-border-radius-sm);
  background-color: var(--bs-body-bg);
  color: var(--bs-body-color);
}

/* Selects — keep auto width inside flex col-sm-9 rows */
.card-body .col-sm-9 select,
.card-body .form-select {
  display: inline-block;
  width: auto;
  min-width: 6rem;
  padding: 0.25rem 1.75rem 0.25rem 0.5rem;
  font-size: 0.875rem;
}

.card-body .form-select:focus,
.card-body .col-sm-9 select:focus {
  border-color: var(--brand-accent);
  box-shadow: 0 0 0 0.2rem rgba(var(--brand-focus-rgb), 0.25);
}

/* Inline secondary labels inside col-sm-9 d-flex rows (e.g. "Čas:" next to Date) */
.card-body .col-sm-9.d-flex > label,
.card-body .col-sm-9.d-flex .form-check-label {
  font-size: 0.875rem;
  color: var(--bs-secondary-color);
  margin-bottom: 0;
  white-space: nowrap;
}

/* Checkbox / radio + label pairs — any .form-check-inline-group wrapper, in any
   form. Keep the checkbox and label on one line; if the label wraps, its lines
   hang under the first line (the label is a flex item, so every wrapped line
   starts right of the checkbox, never underneath it). The wrapper carries the
   d-inline-flex + align-items-center + gap utilities in markup. */
.form-check-inline-group > input[type=checkbox],
.form-check-inline-group > input[type=radio] {
  flex: none;
}

.form-check-inline-group > label {
  margin-bottom: 0;
  white-space: normal;
  cursor: pointer;
}

.card-body .form-check-inline-group > label {
  font-size: 0.875rem;
  color: var(--bs-secondary-color);
}

/* ── Responsive form groups (xs < 576px) ────────────────────────────── */
/* Below sm breakpoint: col-sm-3/col-sm-9 stack to full width (Bootstrap),
   but the inner d-flex keeps items in one row — causing horizontal overflow.
   Switch to column layout so each field stacks vertically. */
@media (max-width: 575.98px) {
  /* Groups only — standalone checkboxes have offset-sm-3 and must keep row
     layout. */
  .card-body .col-sm-9.d-flex:not(.offset-sm-3) {
    flex-direction: column;
    align-items: stretch !important;
  }
  /* Inline labels (2nd+ field in group) — allow wrapping, reset nowrap */
  .card-body .col-sm-9.d-flex:not(.offset-sm-3) > label:not(.form-check-label) {
    white-space: normal;
  }
  /* Selects need explicit width: 100% since they default to auto. Also their
     TomSelect wrappers: the TS auto-sizer pins a px min-width that otherwise
     overflows (long option labels) or leaves them narrow — force full width. */
  .card-body .col-sm-9.d-flex:not(.offset-sm-3) > select,
  .card-body .col-sm-9.d-flex:not(.offset-sm-3) select,
  .card-body .col-sm-9.d-flex:not(.offset-sm-3) .ts-wrapper {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100%;
  }
  /* Checkbox+label group must not stretch — keep it compact */
  .card-body .col-sm-9.d-flex:not(.offset-sm-3) > .form-check-inline-group {
    align-self: flex-start;
  }
}
/* Checkboxes and radios — revert Bootstrap's appearance:none so the browser
   renders native controls. accent-color then applies brand colour reliably. */
.form-check-input[type=checkbox],
.form-check-input[type=radio],
.card-body input[type=checkbox],
.card-body input[type=radio] {
  appearance: auto;
  display: inline-block;
  width: 1.1em;
  height: 1.1em;
  vertical-align: middle;
  margin: 0 0.3em 0.1em 0;
  accent-color: var(--brand-accent);
  cursor: pointer;
}

[data-bs-theme=light] .form-check-input[type=checkbox],
[data-bs-theme=light] .form-check-input[type=radio],
[data-bs-theme=light] .card-body input[type=checkbox],
[data-bs-theme=light] .card-body input[type=radio] {
  accent-color: var(--brand-dark);
}

/* Ensure checkbox rows have no extra left padding inside cards */
.card-body div.checkbox,
.card-body div.radio {
  padding-left: 0 !important;
}

/* Row spacing */
.card-body > div {
  margin-bottom: 0.55rem;
}

.card-body > div:last-child {
  margin-bottom: 0;
}

/* Horizontal separator rows */
.card-body div.hr {
  border-top: 1px solid var(--bs-border-color);
  padding-top: 0.55rem;
  margin-top: 0.2rem;
}

/* Fieldsets */
.card-body fieldset {
  border: 1px solid var(--bs-border-color);
  border-radius: var(--bs-border-radius);
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
}

.card-body fieldset legend {
  font-size: 0.875rem;
  font-weight: 700;
  padding: 0 0.5rem;
  width: auto;
  float: none;
  color: var(--bs-body-color);
}

/* Required-field marker (Form::REQ_MARK) — the bold label alone is easy to
   miss, the red asterisk before the field name is the universal signal. */
.admin-main .req-mark {
  color: var(--brand-req);
  font-weight: 700;
  margin-right: 2px;
}

/* When the label stacks onto its own line (phones — every form label does),
   a leading asterisk reads awkwardly — hide the inline marker and append the
   * after the label text instead. Covers both the col-form-label fields and
   the custom (empty-class) select labels. */
@media (max-width: 575.98px) {
  .card-body label .req-mark {
    display: none;
  }
  .card-body label:has(.req-mark)::after {
    content: "*";
    color: var(--brand-req);
    font-weight: 700;
    margin-left: 2px;
  }
}
/* Submit / button row */
.submit {
  display: flex !important;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.5rem;
  align-items: center;
  padding: 0;
  clear: none !important;
  text-align: right !important;
  margin-bottom: 0 !important;
}

.btn-save, .btn-reset, .btn-list, .btn-del, .btn-edit,
.btn-set, .btn-default {
  background-image: none;
}

/* Compact button size for the admin toolbar */
.submit .btn {
  font-size: 0.85rem;
  padding: 0.3rem 0.75rem;
}

/* wheretogo select sits inline in the button row */
.wheretogo {
  width: auto !important;
  display: inline-block !important;
  font-size: 0.85rem;
}

/* ── Tom Select ─────────────────────────────────────────────────────── */
/* Zero the residual width a focused single-select adds: the autogrow search
   input still carries 4px margins + a 4px min-width, so opening one nudges
   the field beside it. Empty, it should take no space; it still grows as you
   type (autogrow), so search is unaffected. */
.ts-wrapper.plugin-input_autogrow.single .ts-control > input {
  margin: 0 !important;
  min-width: 0 !important;
}

/* Pin the single-select height to its natural (closed) value so focusing —
   when the search input enters the flow — can't grow the control a pixel and
   push the row below down. The control's overflow:hidden clips any spill. */
.card-body .ts-wrapper.form-select.single {
  height: calc(1.5em + 0.75rem + var(--bs-border-width) * 2);
}

.card-body .ts-wrapper.form-select-sm.single {
  height: calc(1.5em + 0.5rem + var(--bs-border-width) * 2);
}

/* Single-select TomSelect: a long selected option must not wrap onto a second
   line and spill out of the control — clip it with an ellipsis instead. Global:
   applies to every auto-wrapped <select> (e.g. selects in repeater rows). */
.ts-wrapper.single .ts-control {
  flex-wrap: nowrap;
}

.ts-wrapper.single .ts-control > .item {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

/* Dropdown sizes to its widest option (each label on one line) instead of the
   narrow control width, so long option labels don't wrap onto several lines.
   Capped so a very long label can't run off-screen. */
.ts-dropdown {
  width: max-content;
  min-width: 100%;
  max-width: min(90vw, 34rem);
}

.ts-dropdown .option,
.ts-dropdown .create,
.ts-dropdown .no-results {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* No select may exceed its column — a long-option picker must clip instead of
   pushing the page sideways. Global guard. (max-width only — a global
   min-width:0 would let TomSelect wrappers collapse to their content in
   flex-row groups.) */
.card-body .form-select {
  max-width: 100%;
}

.card-body .ts-wrapper {
  max-width: 100%;
}

/* === jQuery UI Datepicker — theme-aware overrides === */
.ui-datepicker {
  background: var(--bs-body-bg);
  border: 1px solid var(--bs-border-color);
  color: var(--bs-body-color);
  font-size: 0.85rem;
  padding: 0.4rem;
  z-index: 1050 !important;
}

.ui-datepicker .ui-widget-header {
  background: var(--bs-secondary-bg);
  border-color: var(--bs-border-color);
  color: var(--bs-body-color);
  font-weight: 600;
}

.ui-datepicker .ui-datepicker-prev,
.ui-datepicker .ui-datepicker-next {
  cursor: pointer;
  top: 4px;
}

.ui-datepicker .ui-datepicker-prev:hover,
.ui-datepicker .ui-datepicker-next:hover {
  background: var(--bs-tertiary-bg);
  border-color: var(--bs-border-color);
}

.ui-datepicker .ui-datepicker-title {
  color: var(--bs-body-color);
}

.ui-datepicker table th {
  color: var(--bs-secondary-color);
}

.ui-datepicker table td .ui-state-default {
  background: var(--bs-body-bg);
  border-color: transparent;
  color: var(--bs-body-color);
  text-align: center;
}

.ui-datepicker table td:hover .ui-state-default,
.ui-datepicker table td .ui-state-hover {
  background: var(--bs-tertiary-bg);
  border-color: var(--bs-border-color);
  color: var(--bs-body-color);
}

.ui-datepicker table td .ui-state-highlight {
  border-color: var(--brand-accent);
}

.ui-datepicker table td .ui-state-active {
  background: var(--brand-accent);
  border-color: var(--brand-accent);
  color: #000;
}

[data-bs-theme=dark] .ui-datepicker .ui-icon {
  filter: invert(1);
}

/* =============================================================================
   DataTable list + form-repeater polish (former local.css)

   Only the rules unique to this layer live here. The icon/action colours,
   Quill base, and .dt-filter-reset that used to be duplicated here now live in
   their theme partials (_theme-datatable / _theme-quill / _theme-feedback) —
   this partial no longer restates them.
   ============================================================================= */
/* Status toggle cursor — only on the clickable toggle cells (delegated handler) */
span.js-status-toggle {
  cursor: pointer;
}

/* DataTable — full-width table (column layout is driven by DataTables widths) */
.dt-table {
  width: 100%;
}

/* Form repeater (Form\Item\Repeater) */
.repeater-table td.repeater-handle {
  cursor: grab;
  color: var(--bs-secondary-color, #888);
}

.repeater-table tr.ui-sortable-helper {
  background: var(--bs-tertiary-bg, #f5f5f5);
}

/* Beat the theme's right-aligned form-table headers and auto-width selects. */
.admin-main form table.repeater-table th {
  text-align: left;
}

/* Required column headers: asterisk after the text (like the stacked form
   labels), not before. Only the table view shows thead. */
.repeater-table th .req-mark {
  display: none;
}

.repeater-table th:has(.req-mark)::after {
  content: "*";
  color: var(--brand-req);
  font-weight: 700;
  margin-left: 2px;
}

.card-body .repeater-table .form-select {
  width: 100%;
}

/* Score inputs must never collapse below 3 digits + spinner (mobile).
   The inputs carry dir="rtl", which flips the spinner to the LEFT edge while
   the digits stay right-aligned — the only way to get a gap between the two,
   since browsers glue the spinner to the content with no stylable offset. */
.repeater-table input[type=number] {
  min-width: 4rem;
  padding-left: 0.5rem;
}

/* DataTables Responsive — row toggle and child rows. While columns are
   collapsed, tapping any cell without an active element toggles the child
   row (see the details.target selector in DataTable::initScript). */
.dt-table.collapsed > tbody > tr > td:not(.child):not(:has(a, .js-status-toggle)) {
  cursor: pointer;
}

/* Collapsed columns render as label/value pairs in the child row; values may
   wrap there (the nowrap on .dt-table td is for the grid layout, not details). */
.dt-table tr.child td.child {
  white-space: normal;
}

.dt-table tr.child span.dtr-data pre {
  display: inline;
  margin: 0;
  font-size: inherit;
}

/* The child-row <li> inherits the column's text-end/text-center utility
   classes; a details list reads better uniformly left-aligned. */
.dt-table tr.child ul.dtr-details > li {
  text-align: left !important;
}

/* Alternate column header for phones (Column::mobileLabel); the <768px
   media block below swaps the two. */
.dt-table th .dt-label-mobile {
  display: none;
}

/* Phones: swap in the mobile column headers, slim the cells. */
@media (max-width: 767.98px) {
  .dt-table th .dt-label-mobile {
    display: inline;
  }
  .dt-table th .dt-label-desktop {
    display: none;
  }
  /* Slimmer cells and a slightly smaller font buy row width on phones. */
  .dt-table {
    font-size: 0.9rem;
  }
  .dt-table > thead > tr > th,
  .dt-table > tbody > tr > td {
    padding-left: 0.3rem;
    padding-right: 0.3rem;
  }
}
/* Touch targets: on phones the row action icons and status pill are far below
   the ~44px finger-target minimum and sit adjacent (edit vs delete → mistaps),
   so enlarge their hit area (min-size/padding, not margin, to avoid shifting
   the grid). Desktop keeps the compact icons. */
@media (max-width: 767.98px) {
  .dt-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    font-size: 16px;
  }
  span.js-status-toggle {
    display: inline-flex;
    padding: 0.6rem;
  }
}
/* Phone: a wide repeater table would trap horizontal scroll inside
   .table-responsive, hiding the rightmost inputs and the remove button off the
   edge. Restack each row as a card: the row is a flex-wrap container — the
   reorder handle and the remove button share the top line (handle left, ×
   right), then each field wraps onto its own line. */
@media (max-width: 767.98px) {
  .repeater-table thead {
    display: none;
  }
  .repeater-table,
  .repeater-table tbody {
    display: block;
    width: 100%;
  }
  /* No inner table cell borders on the card (they read as stray lines). */
  .repeater-table td {
    border: 0;
    padding: 0;
  }
  .repeater-table tr.repeater-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    border: 1px solid var(--bs-border-color);
    border-radius: var(--bs-border-radius);
    padding: 0.5rem;
    margin-bottom: 0.5rem;
  }
  /* Each field is its own full-width line by default. */
  .repeater-table tr.repeater-row > td {
    flex: 0 0 100%;
  }
  .repeater-table .ts-wrapper {
    max-width: 100%;
  }
  /* Controls on the top line: drag handle left, remove button right. */
  .repeater-table tr.repeater-row > td.repeater-handle {
    order: -1;
    flex: 0 0 auto;
    text-align: left;
  }
  .repeater-table tr.repeater-row > td:last-child { /* remove-button cell */
    order: -1;
    flex: 1 1 auto;
    /* beat the cell's .text-center !important so × sits at the far right */
    text-align: right !important;
  }
  /* Compact × flush with the right edge of the inputs/selects — no padding
     box (the theme's blanket .btn padding is !important, so override it), so
     the controls line adds no extra vertical height. */
  .repeater-table .repeater-remove {
    padding: 0 !important;
    line-height: 1;
  }
  /* Scoreline: home : away  +  end-type select, all on one row. */
  .repeater-table tr.repeater-row > td.repeater-cell--ScoreHome {
    flex: 0 0 4rem;
  }
  .repeater-table tr.repeater-row > td.repeater-cell--ScoreHost {
    flex: 0 0 4rem;
    position: relative;
  }
  .repeater-table tr.repeater-row > td.repeater-cell--ScoreType {
    flex: 1 1 auto;
  }
  .repeater-table td.repeater-cell--ScoreHome input,
  .repeater-table td.repeater-cell--ScoreHost input {
    min-width: 0;
  }
  /* The "domácí : hosté" colon, centred in the gap between the two inputs. */
  .repeater-table td.repeater-cell--ScoreHost::before {
    content: ":";
    position: absolute;
    left: -0.4rem;
    top: 50%;
    transform: translateY(-50%);
    font-weight: 600;
    color: var(--bs-body-color);
  }
}
/* In the table view (desktop) the column headers already label the fields, so
   a field placeholder (Note → "Poznámka") is redundant with the header — show
   it only in the mobile card view where the headers are hidden. */
@media (min-width: 768px) {
  .repeater-table input::placeholder {
    color: transparent;
  }
}
/* Audit detail meta/value tables — key + column-header widths (were inline). */
.audit-key {
  width: 14ex;
}

.audit-col {
  width: 20ex;
}

/* Repeater icon-only column headers (drag handle + remove) — were inline 3ex. */
.repeater-th-icon {
  width: 3ex;
}

/* =============================================================================
   Per-module widget styles. Each project adds its own sections here; the
   template ships only the generic submit bar used by every edit form.
   ========================================================================== */
/* Floating submit bar — used by long edit forms.
   Default state: inline at form bottom. JS adds .submit--floating to fix it to
   the viewport bottom when the bar's natural position scrolls out of view, and
   removes the class once the natural position is visible again. */
/* Resting state (inline at the form bottom / mid-form): a plain button row —
   no background, no border, no padding, so it doesn't read as an empty strip
   under the last window. All bar chrome lives on .submit--floating. */
.submit.submit--sticky {
  margin: 0 !important;
}

/* Active floating mode: pinned to viewport bottom, with the bar chrome.
   position:fixed (not sticky) because .admin-main has overflow-x:auto which
   would otherwise trap a sticky element inside its scroll container. */
.submit.submit--sticky.submit--floating {
  position: fixed;
  bottom: 0;
  left: var(--sidebar-width);
  right: 0;
  z-index: 100;
  background: var(--bs-body-bg);
  padding: 0.5rem 1.5rem !important;
  border-top: 1px solid var(--bs-border-color);
  box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.08);
}

/* Resting flush bar (mid-form or form bottom): keep a little breathing room
   from the window below. Must not apply while floating — bottom:0 positions
   the margin edge, so a margin-bottom would lift the fixed bar off the
   viewport edge and scrolled content would peek through underneath. */
.submit.submit--sticky.submit--flush:not(.submit--floating) {
  margin-bottom: 0.75rem !important;
}

/* Placeholder reserves the bar's space in the flow while the bar is floating */
.submit-placeholder {
  display: none;
}

.submit-placeholder.is-active {
  display: block;
}

/* Bump + halo flash for radio inputs confirmed via AJAX (.js-set-actual) */
input[type=radio].preset-bump {
  display: inline-block;
  border-radius: 50%;
  animation: preset-bump 0.6s ease-out;
}

@keyframes preset-bump {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(var(--brand-accent-rgb), 0.85);
  }
  35% {
    transform: scale(1.6);
    box-shadow: 0 0 0 6px rgba(var(--brand-accent-rgb), 0.55);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(var(--brand-accent-rgb), 0);
  }
}
@media (max-width: 991.98px) {
  .submit.submit--sticky.submit--floating {
    left: 0;
    padding: 0.4rem 0.75rem !important;
  }
}
@media (max-width: 575.98px) {
  .submit.submit--sticky {
    gap: 0.35rem;
  }
  .submit.submit--sticky.submit--floating {
    padding: 0.35rem 0.5rem !important;
  }
  .submit.submit--sticky .btn {
    font-size: 0.8rem;
    padding: 0.25rem 0.55rem;
  }
}
