/* ==========================================================================
   VelocityFeed backoffice — layout shell
   Modernist tokens: Archivo, zero radius, 2px rules, single red accent.
   All theming happens through the custom properties in :root /
   [data-theme="dark"]. Remap those and the whole shell follows.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Archivo:wght@400;600;800&display=swap');

/* --- tokens: light (default) ------------------------------------------- */
:root {
  --color-bg: #f3f2f2;
  --color-surface: #eae9e9;
  --color-surface-2: #ffffff;
  --color-text: #201e1d;
  --color-muted: #605d5d;
  --color-accent: #ec3013;
  --color-accent-hover: #dd2b0f;
  --color-accent-press: #ae1800;
  --color-accent-tint: #ffe0d9;
  --color-line: #d7d3d3;
  --color-rule: #201e1d;            /* the strong 2px divider ink */
  --color-rule-alpha: 0.4;
  --color-success: #1a7f37;
  --color-success-tint: #e3f3e6;

  /* sidebar is a dark field in both themes — the reference's dark rail */
  --sb-bg: #1b1918;
  --sb-bg-2: #262322;
  --sb-text: #cdc9c7;
  --sb-text-strong: #f8f4f4;
  --sb-muted: #7d7979;
  --sb-line: rgba(248, 244, 244, 0.14);
  --sb-hover: rgba(248, 244, 244, 0.07);
  --sb-active-bg: rgba(236, 48, 19, 0.14);

  --font-heading: "Archivo", system-ui, sans-serif;
  --font-body: "Archivo", system-ui, sans-serif;
  --font-mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-6: 24px;
  --space-8: 32px;

  --radius: 0px;
  --shadow-md: 0 3px 10px rgba(45, 43, 43, 0.16);
  --shadow-lg: 0 12px 32px rgba(45, 43, 43, 0.22);

  /* layout metrics */
  --sb-w: 248px;
  --sb-w-collapsed: 64px;
  --header-h: 60px;
  --t-fast: 140ms cubic-bezier(.4, 0, .2, 1);
  --t: 220ms cubic-bezier(.4, 0, .2, 1);
}

/* --- tokens: dark ------------------------------------------------------ */
[data-theme="dark"] {
  --color-bg: #171615;
  --color-surface: #201e1d;
  --color-surface-2: #262322;
  --color-text: #f3f2f2;
  --color-muted: #9b9797;
  --color-accent: #ff563c;
  --color-accent-hover: #ff9783;
  --color-accent-press: #dd2b0f;
  --color-accent-tint: rgba(255, 86, 60, 0.16);
  --color-line: #3a3736;
  --color-rule: #f3f2f2;
  --color-rule-alpha: 0.28;
  --color-success: #4fce6d;
  --color-success-tint: rgba(79, 206, 109, 0.16);

  --sb-bg: #121110;
  --sb-bg-2: #1c1a19;
  --shadow-md: 0 3px 10px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.6);
}

/* --- base ------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -0.015em;
  margin: 0;
}

a { color: var(--color-accent); text-decoration: none; text-underline-offset: 3px; }
a:hover { text-decoration: underline; }

button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

:focus { outline: none; }
:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }
::selection { background: rgba(236, 48, 19, 0.3); }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* icons render at their box size, never shrink in flex rows */
[data-lucide] { flex: 0 0 auto; }
svg.icon { width: 18px; height: 18px; stroke-width: 1.75; flex: 0 0 auto; }

/* ==========================================================================
   Frame
   ========================================================================== */
.app { display: flex; min-height: 100vh; }

/* --- sidebar ---------------------------------------------------------- */
.sidebar {
  position: sticky;
  top: 0;
  z-index: 40;
  flex: 0 0 var(--sb-w);
  width: var(--sb-w);
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--sb-bg);
  color: var(--sb-text);
  border-right: 2px solid var(--sb-line);
  transition: flex-basis 220ms cubic-bezier(.4, 0, .2, 1), width 220ms cubic-bezier(.4, 0, .2, 1);
  overflow: hidden;
}

body[data-sidebar="collapsed"] .sidebar {
  flex-basis: var(--sb-w-collapsed);
  width: var(--sb-w-collapsed);
}

.sidebar__brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  height: var(--header-h);
  flex: 0 0 var(--header-h);
  padding: 0 var(--space-4);
  border-bottom: 2px solid var(--sb-line);
}

.brand__mark {
  flex: 0 0 auto;
  width: 30px; height: 30px;
  display: grid; place-items: center;
  background: var(--color-accent);
  color: #fff;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 17px;
  line-height: 1;
}

.brand__text { min-width: 0; }
.brand__name {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 14px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--sb-text-strong);
  white-space: nowrap;
}
.brand__sub {
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--sb-muted);
  white-space: nowrap;
}

/* nav */
.sidebar__nav {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: var(--space-4) 0;
  scrollbar-width: thin;
}
.sidebar__nav::-webkit-scrollbar { width: 6px; }
.sidebar__nav::-webkit-scrollbar-thumb { background: var(--sb-line); }

.nav-group + .nav-group { margin-top: var(--space-4); }

.nav-group__label {
  padding: 0 var(--space-4) var(--space-2);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--sb-muted);
  white-space: nowrap;
}

.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 10px var(--space-4);
  color: var(--sb-text);
  font-size: 14px;
  white-space: nowrap;
  border-left: 3px solid transparent;
  transition: background 140ms cubic-bezier(.4, 0, .2, 1), color 140ms cubic-bezier(.4, 0, .2, 1);
}
.nav-item:hover { background: var(--sb-hover); color: var(--sb-text-strong); text-decoration: none; }
.nav-item:active { background: rgba(248, 244, 244, 0.12); }
.nav-item.is-active {
  background: var(--sb-active-bg);
  border-left-color: var(--color-accent);
  color: #fff;
  font-weight: 600;
}
.nav-item.is-active svg { color: var(--color-accent); }

.nav-item__label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-item__badge {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 1px 6px;
  background: rgba(248, 244, 244, 0.1);
  color: var(--sb-text-strong);
}

/* collapse button, pinned to the rail's foot */
.sidebar__foot {
  flex: 0 0 auto;
  border-top: 2px solid var(--sb-line);
  padding: var(--space-2) 0;
}

.sidebar__collapse {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
  padding: 10px var(--space-4);
  color: var(--sb-muted);
  font-size: 13px;
  white-space: nowrap;
  transition: background 140ms cubic-bezier(.4, 0, .2, 1), color 140ms cubic-bezier(.4, 0, .2, 1);
}
.sidebar__collapse:hover { background: var(--sb-hover); color: var(--sb-text-strong); }
.sidebar__collapse svg { transition: transform 220ms cubic-bezier(.4, 0, .2, 1); }
body[data-sidebar="collapsed"] .sidebar__collapse svg { transform: rotate(180deg); }

/* collapsed state: labels fade out, icons centre */
.sidebar .brand__text,
.sidebar .nav-item__label,
.sidebar .nav-item__badge,
.sidebar .nav-group__label,
.sidebar .sidebar__collapse span {
  opacity: 1;
  transition: opacity 140ms cubic-bezier(.4, 0, .2, 1);
}
body[data-sidebar="collapsed"] .brand__text,
body[data-sidebar="collapsed"] .nav-item__label,
body[data-sidebar="collapsed"] .nav-item__badge,
body[data-sidebar="collapsed"] .sidebar__collapse span {
  opacity: 0;
  pointer-events: none;
}
body[data-sidebar="collapsed"] .nav-group__label {
  opacity: 0;
  height: 2px;
  padding: 0 var(--space-4);
  margin-bottom: var(--space-2);
  background: var(--sb-line);
  overflow: hidden;
}

/* tooltip for the icon-only state */
body[data-sidebar="collapsed"] .nav-item[data-tip]:hover::after,
body[data-sidebar="collapsed"] .sidebar__collapse[data-tip]:hover::after {
  content: attr(data-tip);
  position: fixed;
  left: calc(var(--sb-w-collapsed) + 8px);
  z-index: 90;
  padding: 5px var(--space-3);
  background: var(--color-text);
  color: var(--color-bg);
  font-size: 12px;
  white-space: nowrap;
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

/* --- shell (header + content) ----------------------------------------- */
.shell {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

/* --- header ----------------------------------------------------------- */
.header {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: var(--space-4);
  height: var(--header-h);
  flex: 0 0 var(--header-h);
  padding: 0 var(--space-6);
  background: var(--color-surface-2);
  border-bottom: 2px solid color-mix(in srgb, var(--color-rule) 40%, transparent);
}

.header .header__mobile-toggle { display: none; }

.header__crumbs {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-width: 0;
  flex: 0 1 auto;
  overflow: hidden;
  white-space: nowrap;
  font-size: 13px;
  color: var(--color-muted);
}
.header__crumbs > * { overflow: hidden; text-overflow: ellipsis; }
.header__crumbs .crumb-sep { opacity: 0.5; }
.header__crumbs strong {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text);
}
.header__crumbs .crumb-current { color: var(--color-text); }

.header__spacer { flex: 1 1 auto; }

.header__meta {
  display: flex;
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  align-items: center;
  gap: var(--space-4);
  padding-right: var(--space-4);
  border-right: 1px solid var(--color-line);
  font-size: 12px;
  color: var(--color-muted);
  white-space: nowrap;
}
.header__meta b {
  font-family: var(--font-mono);
  font-weight: 400;
  color: var(--color-text);
}
.meta-item { display: flex; align-items: center; gap: 6px; }
.meta-item::before {
  content: "";
  width: 2px; height: 14px;
  background: var(--color-accent);
}
.meta-item.is-neutral::before { background: var(--color-line); }

.header__actions { display: flex; flex: 0 0 auto; align-items: center; gap: var(--space-1); }

.icon-btn {
  position: relative;
  width: 38px; height: 38px;
  display: grid; place-items: center;
  color: var(--color-text);
  border: 1px solid transparent;
  transition: background 140ms cubic-bezier(.4, 0, .2, 1), border-color 140ms cubic-bezier(.4, 0, .2, 1);
}
.icon-btn:hover { background: color-mix(in srgb, var(--color-text) 7%, transparent); }
.icon-btn:active { background: color-mix(in srgb, var(--color-text) 14%, transparent); }
.icon-btn[aria-expanded="true"] { background: color-mix(in srgb, var(--color-text) 10%, transparent); }

.icon-btn__badge {
  position: absolute;
  top: 4px; right: 4px;
  min-width: 16px; height: 16px;
  padding: 0 3px;
  display: grid; place-items: center;
  background: var(--color-accent);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 10px;
  line-height: 1;
}
.icon-btn__badge[hidden] { display: none; }

/* theme toggle shows one glyph at a time */
.theme-toggle .icon-moon { display: none; }
[data-theme="dark"] .theme-toggle .icon-moon { display: block; }
[data-theme="dark"] .theme-toggle .icon-sun { display: none; }

/* profile trigger */
.profile-btn {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  height: 38px;
  padding: 0 var(--space-2) 0 var(--space-1);
  border: 1px solid transparent;
  transition: background 140ms cubic-bezier(.4, 0, .2, 1);
}
.profile-btn:hover { background: color-mix(in srgb, var(--color-text) 7%, transparent); }
.profile-btn[aria-expanded="true"] { background: color-mix(in srgb, var(--color-text) 10%, transparent); }

.avatar {
  width: 30px; height: 30px;
  display: grid; place-items: center;
  background: var(--color-text);
  color: var(--color-bg);
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 12px;
  letter-spacing: 0.04em;
}
.profile-btn__text { text-align: left; line-height: 1.15; }
.profile-btn__name { font-size: 13px; font-weight: 600; white-space: nowrap; }
.profile-btn__org { font-size: 11px; color: var(--color-muted); white-space: nowrap; }
.profile-btn svg { transition: transform 140ms cubic-bezier(.4, 0, .2, 1); color: var(--color-muted); }
.profile-btn[aria-expanded="true"] svg { transform: rotate(180deg); }

/* --- dropdowns -------------------------------------------------------- */
.dropdown { position: relative; }

.menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 60;
  min-width: 240px;
  background: var(--color-surface-2);
  border: 1px solid var(--color-line);
  border-top: 2px solid var(--color-accent);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateY(-6px);
  visibility: hidden;
  transition: opacity 140ms cubic-bezier(.4, 0, .2, 1), transform 140ms cubic-bezier(.4, 0, .2, 1), visibility 140ms cubic-bezier(.4, 0, .2, 1);
}
.menu.is-open { opacity: 1; transform: translateY(0); visibility: visible; }

.menu__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--color-line);
}
.menu__title {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.menu__link { font-size: 11px; }

.menu__item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
  border: 0;
  background: transparent;
  padding: 10px var(--space-4);
  font: inherit;
  font-size: 14px;
  color: var(--color-text);
  text-align: left;
  cursor: pointer;
  transition: background 140ms cubic-bezier(.4, 0, .2, 1);
}
.menu__item:hover { background: color-mix(in srgb, var(--color-text) 7%, transparent); text-decoration: none; }
.menu__item svg { color: var(--color-muted); }
.menu__item.is-danger { color: var(--color-accent); }
.menu__item.is-danger svg { color: var(--color-accent); }
.menu__sep { height: 1px; background: var(--color-line); margin: var(--space-1) 0; }

/* notification list */
.notif-menu { min-width: 340px; }
.notif {
  display: flex;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--color-line);
}
.notif:last-of-type { border-bottom: 0; }
.notif__dot {
  flex: 0 0 auto;
  width: 6px; height: 6px;
  margin-top: 7px;
  background: var(--color-accent);
}
.notif.is-read .notif__dot { background: var(--color-line); }
.notif__body { min-width: 0; }
.notif__title { font-size: 13px; font-weight: 600; }
.notif__meta { font-size: 11px; color: var(--color-muted); font-family: var(--font-mono); }

/* --- page head + content --------------------------------------------- */
.page-head {
  padding: var(--space-6) var(--space-6) var(--space-4);
  border-bottom: 2px solid color-mix(in srgb, var(--color-rule) 40%, transparent);
  background: var(--color-bg);
}
.page-head__kicker {
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--color-muted);
  margin-bottom: var(--space-1);
}
.page-head h1 { font-size: 32px; }
.page-head__row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-4);
  flex-wrap: wrap;
}

/* THE content container — swap for {% block content %} in Django */
.main {
  flex: 1 1 auto;
  min-width: 0;
  padding: var(--space-6);
  background: var(--color-bg);
}

/* --- buttons (shared with the design system) -------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 14px;
  line-height: 1.2;
  padding: var(--space-2) calc(var(--space-3) * 1.2);
  border: 1px solid transparent;
  color: var(--color-text);
  transition: background 140ms cubic-bezier(.4, 0, .2, 1);
}
.btn-primary { background: var(--color-accent); color: #fff; }
.btn-primary:hover { background: var(--color-accent-hover); text-decoration: none; }
.btn-primary:active { background: var(--color-accent-press); }
.btn-secondary { border-color: color-mix(in srgb, var(--color-rule) 40%, transparent); }
.btn-secondary:hover { background: color-mix(in srgb, var(--color-text) 7%, transparent); text-decoration: none; }

/* --- placeholder shown inside the empty content slot ------------------ */
.slot {
  min-height: 320px;
  display: grid;
  place-items: center;
  padding: var(--space-8);
  border: 2px dashed var(--color-line);
  background: repeating-linear-gradient(
    135deg,
    transparent 0 9px,
    color-mix(in srgb, var(--color-text) 4%, transparent) 9px 10px
  );
  text-align: center;
}
.slot code {
  font-family: var(--font-mono);
  font-size: 13px;
  background: var(--color-surface-2);
  border: 1px solid var(--color-line);
  padding: 3px 6px;
}
.slot p { color: var(--color-muted); font-size: 13px; margin: var(--space-3) 0 0; }

/* --- mobile ----------------------------------------------------------- */
.scrim {
  position: fixed;
  inset: 0;
  z-index: 35;
  background: rgba(23, 22, 21, 0.5);
  opacity: 0;
  visibility: hidden;
  transition: opacity 220ms cubic-bezier(.4, 0, .2, 1), visibility 220ms cubic-bezier(.4, 0, .2, 1);
}

@media (max-width: 1240px) {
  .header__meta { display: none; }
}

@media (max-width: 900px) {
  .header .header__mobile-toggle { display: grid; }

  .sidebar {
    position: fixed;
    left: 0; top: 0;
    flex-basis: var(--sb-w);
    width: var(--sb-w);
    transform: translateX(-100%);
    transition: transform 220ms cubic-bezier(.4, 0, .2, 1);
    box-shadow: var(--shadow-lg);
  }
  body[data-sidebar="collapsed"] .sidebar { flex-basis: var(--sb-w); width: var(--sb-w); }
  body[data-mobile-nav="open"] .sidebar { transform: translateX(0); }
  body[data-mobile-nav="open"] .scrim { opacity: 1; visibility: visible; }

  /* labels always visible in the drawer */
  body[data-sidebar="collapsed"] .brand__text,
  body[data-sidebar="collapsed"] .nav-item__label,
  body[data-sidebar="collapsed"] .nav-item__badge,
  body[data-sidebar="collapsed"] .sidebar__collapse span { opacity: 1; pointer-events: auto; }
  body[data-sidebar="collapsed"] .nav-group__label {
    opacity: 1; height: auto; background: none;
    padding: 0 var(--space-4) var(--space-2);
  }
  .sidebar__foot { display: none; }

  .header, .page-head, .main { padding-left: var(--space-4); padding-right: var(--space-4); }
  .profile-btn__text { display: none; }
  .page-head h1 { font-size: 25px; }
  .notif-menu { min-width: min(340px, calc(100vw - 32px)); }
  .menu { right: 0; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition-duration: 1ms !important; animation-duration: 1ms !important; }
}

/* ==========================================================================
   Data table pages — filter cards, tables, badges, pagination, toasts.
   Shared by clientweb/frontend/templates/sports/*.html.
   ========================================================================== */

.card {
  background: var(--color-surface-2);
  border: 1px solid var(--color-line);
  padding: var(--space-4) var(--space-6);
  margin-bottom: var(--space-4);
}

/* --- filter bar --------------------------------------------------------- */
.filter-bar {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: var(--space-4);
}

.field {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}
.field--search { flex: 1 1 240px; }

.field label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-muted);
}

.select,
.field input[type="text"],
.field input[type="search"],
.field input[type="password"] {
  width: 100%;
  height: 38px;
  padding: 0 var(--space-3);
  background: var(--color-bg);
  border: 1px solid var(--color-line);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 14px;
}
.select:focus-visible,
.field input:focus-visible { outline: 2px solid var(--color-accent); outline-offset: -2px; }

.field--search__row { display: flex; gap: var(--space-2); }
.field--search__row > input { flex: 1 1 auto; }

/* --- data table ---------------------------------------------------------- */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.data-table th {
  text-align: left;
  padding: var(--space-2) var(--space-3);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-muted);
  border-bottom: 2px solid color-mix(in srgb, var(--color-rule) 40%, transparent);
}
.data-table td {
  padding: var(--space-3);
  border-bottom: 1px solid var(--color-line);
  vertical-align: middle;
}
.data-table tbody tr:hover { background: var(--color-surface); }
.data-table td.is-message {
  text-align: center;
  color: var(--color-muted);
  padding: var(--space-8) var(--space-3);
}

/* --- badges --------------------------------------------------------------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.badge.is-active { background: var(--color-success-tint); color: var(--color-success); }
.badge.is-inactive { background: var(--color-line); color: var(--color-muted); }
.badge.is-live { background: var(--color-accent); color: #fff; margin-left: var(--space-2); }

/* compact select used inline in a table cell (Markets "Template" column) */
.table-select {
  height: 30px;
  padding: 0 var(--space-2);
  background: var(--color-bg);
  border: 1px solid var(--color-line);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 13px;
  max-width: 220px;
}
.table-select:disabled { opacity: 0.5; }

.btn.is-disabled,
button.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

/* --- pagination ------------------------------------------------------------ */
.pagination {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  padding-top: var(--space-4);
}
.pagination button {
  min-width: 34px;
  height: 34px;
  padding: 0 var(--space-2);
  border: 1px solid var(--color-line);
  color: var(--color-text);
  font-family: var(--font-mono);
  font-size: 13px;
  transition: background 140ms cubic-bezier(.4, 0, .2, 1);
}
.pagination button:hover:not(:disabled) { background: var(--color-surface); }
.pagination button.is-active { background: var(--color-accent); border-color: var(--color-accent); color: #fff; }
.pagination button:disabled { opacity: 0.35; cursor: not-allowed; }
.pagination .pagination__ellipsis {
  min-width: 34px;
  text-align: center;
  color: var(--color-muted);
  font-family: var(--font-mono);
  font-size: 13px;
}

/* --- toasts ----------------------------------------------------------------- */
.toast-stack {
  position: fixed;
  top: var(--space-4);
  right: var(--space-4);
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  width: min(340px, calc(100vw - 32px));
}
.toast {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: var(--color-surface-2);
  border: 1px solid var(--color-line);
  border-left: 3px solid var(--color-muted);
  box-shadow: var(--shadow-md);
  font-size: 13px;
  opacity: 1;
  transform: translateY(0);
  transition: opacity 200ms cubic-bezier(.4, 0, .2, 1), transform 200ms cubic-bezier(.4, 0, .2, 1);
}
.toast.is-leaving { opacity: 0; transform: translateY(-6px); }
.toast.is-success { border-left-color: var(--color-success); }
.toast.is-danger { border-left-color: var(--color-accent); }
.toast__body { flex: 1 1 auto; }
.toast__close {
  flex: 0 0 auto;
  font-size: 16px;
  line-height: 1;
  color: var(--color-muted);
}
.toast__close:hover { color: var(--color-text); }

@media (max-width: 900px) {
  .filter-bar { flex-direction: column; align-items: stretch; }
  .data-table { display: block; overflow-x: auto; }
}

/* ==========================================================================
   Login page — standalone (no sidebar/header shell).
   ========================================================================== */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-6);
}

.login-card {
  width: 100%;
  max-width: 380px;
  background: var(--color-surface-2);
  border: 1px solid var(--color-line);
  padding: var(--space-8) var(--space-6);
}

.login-card__brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-6);
}
.login-card__brand-text {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 14px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-text);
  line-height: 1.3;
}
.login-card__brand-text small {
  display: block;
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--color-muted);
  font-weight: 600;
}

.login-card h1 {
  font-size: 22px;
  margin-bottom: var(--space-1);
}
.login-card__subtitle {
  color: var(--color-muted);
  font-size: 13px;
  margin: 0 0 var(--space-6);
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}
.login-form__submit { width: 100%; justify-content: center; }

/* ==========================================================================
   Single-object detail pages — back button, tabs.
   Shared by sports/competition.html and sports/market.html.
   ========================================================================== */
.back-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  margin-right: var(--space-3);
  vertical-align: middle;
  color: var(--color-text);
  background: var(--color-surface-2);
  border: 1px solid var(--color-line);
}
.back-btn:hover { background: color-mix(in srgb, var(--color-text) 7%, transparent); }

.tabs {
  display: flex;
  gap: var(--space-2);
  border-bottom: 2px solid color-mix(in srgb, var(--color-rule) 40%, transparent);
  margin-bottom: var(--space-4);
}
.tab-btn {
  padding: var(--space-2) var(--space-4);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 13px;
  color: var(--color-muted);
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
}
.tab-btn:hover { color: var(--color-text); }
.tab-btn.is-active { color: var(--color-accent); border-bottom-color: var(--color-accent); }

.tab-panel[hidden] { display: none; }
.tab-panel__loading,
.tab-panel__error { color: var(--color-muted); padding: var(--space-4) 0; font-size: 13px; }
.tab-panel__error { color: var(--color-accent); }
