/*!*****************************************************************************************************************************************************************************************************************************************************************!*\
  !*** css ./node_modules/next/dist/build/webpack/loaders/css-loader/src/index.js??ruleSet[1].rules[13].oneOf[12].use[2]!./node_modules/next/dist/build/webpack/loaders/postcss-loader/src/index.js??ruleSet[1].rules[13].oneOf[12].use[3]!./src/app/globals.css ***!
  \*****************************************************************************************************************************************************************************************************************************************************************/
/* =====================================================================
   AllInOne Admin — design system
   Teal + coral brand on a cool mint-grey canvas, deep-ink sidebar.
   Component/page classes below are shared across the whole console; the
   class names match the original frontend so pages need no changes.
   ===================================================================== */

:root {
  /* Canvas & surfaces */
  --color-bg: #f2f6f6;
  --color-surface: #ffffff;
  --color-surface-2: #f4f8f8;
  --color-border: #e0e9e9;
  --color-text: #0f1f24;
  --color-text-muted: #5b6f75;

  /* Brand */
  --color-primary: #0d9488;
  --color-primary-600: #0f766e;
  --color-primary-soft: #e3f6f3;
  --color-on-primary: #ffffff;
  --color-accent: #ff7a59;
  --color-accent-soft: #fff0eb;
  --brand-gradient: linear-gradient(135deg, #14b8a6 0%, #0e7490 100%);

  /* Status */
  --color-success: #059669;
  --color-success-soft: #d9f7ea;
  --color-danger: #e11d48;
  --color-danger-soft: #ffe4ea;
  --color-warning: #d97706;
  --color-warning-soft: #fef1d6;
  --color-info: #0284c7;

  /* Sidebar (dark in both themes) */
  --sidebar-bg: linear-gradient(180deg, #0c2a30 0%, #081b1f 100%);
  --sidebar-text: #a6c3c5;
  --sidebar-text-active: #ffffff;
  --sidebar-heading: #5e878b;
  --sidebar-hover: rgba(255, 255, 255, 0.06);
  --sidebar-active-bg: rgba(45, 212, 191, 0.16);

  /* Shape & depth */
  --shadow-sm: 0 1px 2px rgba(12, 42, 48, 0.05), 0 1px 3px rgba(12, 42, 48, 0.04);
  --shadow-md: 0 10px 30px -8px rgba(12, 42, 48, 0.18);
  --shadow-primary: 0 6px 16px -6px rgba(13, 148, 136, 0.55);
  --radius: 14px;
  --radius-sm: 10px;
  --sidebar-width: 264px;
  --topbar-height: 68px;
  --font: 'Plus Jakarta Sans', 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'Consolas', ui-monospace, monospace;
}

/*
 * Dark palette. Declared once and applied from two places so an explicit
 * choice always beats the OS preference:
 *   - `@media (prefers-color-scheme: dark)` guarded by :not([data-theme='light'])
 *     — follow the system unless the user picked light.
 *   - `[data-theme='dark']` — the user picked dark, whatever the system says.
 * Every token below must also exist on bare :root, or a light viewer with no
 * media match would get an undefined variable.
 */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --color-bg: #091316;
    --color-surface: #0f1c20;
    --color-surface-2: #142529;
    --color-border: #1e3237;
    --color-text: #e2eeef;
    --color-text-muted: #88a2a7;
    --color-primary: #2dd4bf;
    --color-primary-600: #14b8a6;
    --color-primary-soft: #0e3532;
    /* Bright teal needs dark ink on top of it to stay readable. */
    --color-on-primary: #04211f;
    --color-accent: #ff8a6b;
    --color-accent-soft: #3a1d14;
    --color-success: #34d399;
    --color-success-soft: #0f3326;
    --color-danger: #fb7185;
    --color-danger-soft: #3d1520;
    --color-warning: #fbbf24;
    --color-warning-soft: #3a2c10;
    --color-info: #38bdf8;
    --sidebar-bg: linear-gradient(180deg, #071518 0%, #050e10 100%);
    --sidebar-active-bg: rgba(45, 212, 191, 0.14);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 12px 32px -8px rgba(0, 0, 0, 0.6);
    --shadow-primary: 0 6px 18px -6px rgba(45, 212, 191, 0.45);
  }
}
:root[data-theme='dark'] {
  --color-bg: #091316;
  --color-surface: #0f1c20;
  --color-surface-2: #142529;
  --color-border: #1e3237;
  --color-text: #e2eeef;
  --color-text-muted: #88a2a7;
  --color-primary: #2dd4bf;
  --color-primary-600: #14b8a6;
  --color-primary-soft: #0e3532;
  --color-on-primary: #04211f;
  --color-accent: #ff8a6b;
  --color-accent-soft: #3a1d14;
  --color-success: #34d399;
  --color-success-soft: #0f3326;
  --color-danger: #fb7185;
  --color-danger-soft: #3d1520;
  --color-warning: #fbbf24;
  --color-warning-soft: #3a2c10;
  --color-info: #38bdf8;
  --sidebar-bg: linear-gradient(180deg, #071518 0%, #050e10 100%);
  --sidebar-active-bg: rgba(45, 212, 191, 0.14);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 12px 32px -8px rgba(0, 0, 0, 0.6);
  --shadow-primary: 0 6px 18px -6px rgba(45, 212, 191, 0.45);
  /* Makes native controls (scrollbars, date pickers, selects) render dark. */
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    color-scheme: dark;
  }
}
:root[data-theme='light'] {
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

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

::selection {
  background: color-mix(in srgb, var(--color-primary) 28%, transparent);
}

a {
  color: var(--color-primary);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

/* ---------- Brand logo ---------- */
.brand-logo {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}
.brand-mark {
  flex-shrink: 0;
  filter: drop-shadow(0 4px 10px rgba(20, 184, 166, 0.35));
}
.brand-logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
  min-width: 0;
}
.brand-wordmark {
  font-weight: 800;
  font-size: 19px;
  letter-spacing: -0.02em;
  color: inherit;
}
.brand-wordmark b {
  font-weight: 800;
  color: var(--color-accent);
}
.brand-caption {
  margin-top: 3px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0.6;
}

/* ---------- App shell ---------- */
.app-shell {
  display: flex;
  min-height: 100vh;
}
.app-main {
  flex: 1 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  margin-left: var(--sidebar-width);
}
.app-content {
  padding: 28px 32px;
  flex: 1 1;
}

/* ---------- Sidebar ---------- */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  z-index: 50;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.12) transparent;
}
.sidebar-brand {
  position: relative;
  height: var(--topbar-height);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 0 48px 0 22px;
  color: #fff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.sidebar-brand-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #fff;
}
.sidebar-brand-text:hover {
  text-decoration: none;
}
/* Drawer close control — only meaningful while the sidebar floats over content. */
.sidebar-close {
  display: none;
  position: absolute;
  right: 10px;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--sidebar-text);
  cursor: pointer;
}
.sidebar-close:hover {
  background: var(--sidebar-hover);
  color: var(--sidebar-text-active);
}
/* Scrim behind the mobile drawer; inert until .app-shell.sidebar-open. */
.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(4, 16, 19, 0.6);
  -webkit-backdrop-filter: blur(2px);
          backdrop-filter: blur(2px);
  z-index: 45;
}
.sidebar-heading {
  padding: 18px 24px 6px;
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--sidebar-heading);
  font-weight: 700;
}
.sidebar-nav {
  list-style: none;
  margin: 0;
  padding: 2px 14px 6px;
}
.sidebar-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: var(--sidebar-text);
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.sidebar-link:hover {
  background: var(--sidebar-hover);
  color: var(--sidebar-text-active);
  text-decoration: none;
}
.sidebar-link.active {
  background: var(--sidebar-active-bg);
  color: #fff;
  font-weight: 600;
}
/* Coral indicator bar on the active item. */
.sidebar-link.active::before {
  content: '';
  position: absolute;
  left: -14px;
  top: 8px;
  bottom: 8px;
  width: 4px;
  border-radius: 0 4px 4px 0;
  background: var(--color-accent);
}
.sidebar-link.active .icon {
  color: #5eead4;
}
.sidebar-link .icon {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 0.95;
  flex-shrink: 0;
}
.sidebar-chevron {
  transition: transform 0.15s;
  font-size: 18px;
  line-height: 1;
  opacity: 0.7;
}
.sidebar-chevron.open {
  transform: rotate(90deg);
}
.sidebar-subnav {
  list-style: none;
  margin: 2px 0 4px 21px;
  padding: 0 0 0 12px;
  border-left: 1px solid rgba(255, 255, 255, 0.08);
}
.sidebar-sublink {
  display: block;
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  color: var(--sidebar-text);
  font-weight: 500;
  font-size: 13px;
  cursor: pointer;
}
.sidebar-sublink:hover {
  background: var(--sidebar-hover);
  color: var(--sidebar-text-active);
  text-decoration: none;
}
.sidebar-sublink.active {
  background: var(--sidebar-active-bg);
  color: #5eead4;
  font-weight: 600;
}

/* ---------- Topbar ---------- */
.topbar {
  height: var(--topbar-height);
  background: color-mix(in srgb, var(--color-surface) 82%, transparent);
  -webkit-backdrop-filter: saturate(160%) blur(10px);
          backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 18px;
  padding: 0 32px;
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  z-index: 40;
}
/* Drawer toggle; pinned left so the stats stay right-aligned. */
.topbar-menu-btn {
  display: inline-flex;
  align-items: center;
  margin-right: auto;
}
/* Balances read as small chips rather than bare text. */
.topbar-stat {
  text-align: right;
  font-size: 11.5px;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
}
.topbar-stat .label {
  color: var(--color-text-muted);
  font-weight: 500;
}
.topbar-stat .value {
  font-weight: 700;
  font-size: 14px;
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
  color: var(--color-primary-600);
}
.topbar-divider {
  width: 1px;
  height: 28px;
  background: var(--color-border);
}
.topbar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  position: relative;
  cursor: pointer;
  padding: 4px 10px 4px 4px;
  border-radius: 999px;
  font-weight: 600;
  transition: background 0.15s;
}
.topbar-user:hover {
  background: var(--color-surface-2);
}
.topbar-user-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0;
  border: none;
  background: none;
  color: inherit;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.topbar-user-caret {
  color: var(--color-text-muted);
  transition: transform 0.15s;
}
.topbar-user-caret.open {
  transform: rotate(180deg);
}

/* ---------- Profile menu ---------- */
.profile-menu {
  width: 320px;
  max-width: calc(100vw - 24px);
  padding: 0;
  cursor: default;
  overflow: hidden;
}
.profile-menu-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--color-surface-2);
  border-bottom: 1px solid var(--color-border);
}
.profile-menu-name {
  font-weight: 700;
  font-size: 15px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.profile-menu-section {
  padding: 6px;
}
.profile-menu-section + .profile-menu-section {
  border-top: 1px solid var(--color-border);
}
.profile-menu-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 10px;
}
.profile-menu-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--color-text-muted);
  font-weight: 600;
  font-size: 13px;
  white-space: nowrap;
}
.profile-menu-row .view-switch button {
  padding: 4px 10px;
  font-size: 12px;
}
.profile-menu-select {
  width: auto;
  max-width: 160px;
  padding: 5px 8px;
  font-size: 12.5px;
}
.profile-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 500;
}
.profile-menu-item.danger:hover {
  background: var(--color-danger-soft);
  color: var(--color-danger);
}

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--brand-gradient);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  box-shadow: 0 0 0 2px var(--color-surface), 0 0 0 4px var(--color-primary-soft);
}
.dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  min-width: 210px;
  padding: 6px;
  z-index: 60;
  font-weight: 500;
}
.dropdown-item {
  display: block;
  padding: 9px 12px;
  border-radius: 8px;
  color: var(--color-text);
  cursor: pointer;
}
.dropdown-item:hover {
  background: var(--color-primary-soft);
  color: var(--color-primary-600);
  text-decoration: none;
}

/* ---------- Page header ---------- */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 16px;
  flex-wrap: wrap;
}
.page-title {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0;
}
.page-subtitle {
  color: var(--color-text-muted);
  margin: 4px 0 0;
}

/* ---------- Cards ---------- */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.card-header {
  padding: 16px 22px;
  border-bottom: 1px solid var(--color-border);
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.card-body {
  padding: 22px;
}

/* ---------- Stat tiles ---------- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  grid-gap: 18px;
  gap: 18px;
  margin-bottom: 24px;
}
/* Tinted glow in the corner + a gradient rail along the top, per variant. */
.stat-tile {
  --tile-color: var(--color-primary);
  position: relative;
  overflow: hidden;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 20px 22px;
  box-shadow: var(--shadow-sm);
}
.stat-tile::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: linear-gradient(90deg, var(--tile-color), color-mix(in srgb, var(--tile-color) 30%, transparent));
}
.stat-tile::after {
  content: '';
  position: absolute;
  right: -40px;
  top: -40px;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--tile-color) 16%, transparent), transparent 70%);
  pointer-events: none;
}
.stat-tile .stat-label {
  color: var(--color-text-muted);
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
}
.stat-tile .stat-value {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-top: 6px;
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
}
.stat-tile.success {
  --tile-color: var(--color-success);
}
.stat-tile.danger {
  --tile-color: var(--color-danger);
}
.stat-tile.info {
  --tile-color: var(--color-info);
}
.stat-tile.warning {
  --tile-color: var(--color-warning);
}

/* ---------- Dashboard ---------- */
/* Hero: greeting on the left, balance card on the right, over the brand ink. */
.dash-hero {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  padding: 28px 30px;
  margin-bottom: 22px;
  border-radius: 20px;
  color: #e6f4f3;
  background:
    radial-gradient(520px 320px at 100% 0%, rgba(255, 122, 89, 0.3), transparent 60%),
    radial-gradient(600px 380px at 0% 120%, rgba(45, 212, 191, 0.35), transparent 60%),
    linear-gradient(135deg, #0c2a30 0%, #0a3a3c 55%, #0e4a4a 100%);
  box-shadow: var(--shadow-md);
}
.dash-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
  background-size: 36px 36px;
  -webkit-mask-image: linear-gradient(90deg, #000 0%, transparent 70%);
          mask-image: linear-gradient(90deg, #000 0%, transparent 70%);
  pointer-events: none;
}
.dash-hero > * {
  position: relative;
}
.dash-hero-main {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}
.dash-hero-date {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: -moz-fit-content;
  width: fit-content;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 12px;
  font-weight: 600;
  color: #b9d6d7;
}
.dash-hero-title {
  margin: 14px 0 4px;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #fff;
}
.dash-hero-sub {
  margin: 0;
  color: #9fc2c4;
}
.dash-balance {
  min-width: 260px;
  padding: 18px 22px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.12);
  -webkit-backdrop-filter: blur(6px);
          backdrop-filter: blur(6px);
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.dash-balance-label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #9fc2c4;
}
.dash-balance-who {
  margin-left: auto;
  padding: 1px 8px;
  border-radius: 999px;
  background: rgba(94, 234, 212, 0.15);
  color: #5eead4;
  text-transform: none;
  letter-spacing: 0;
}
.dash-balance-value {
  margin: 6px 0 8px;
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #fff;
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
}
.dash-balance-delta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: -moz-fit-content;
  width: fit-content;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
}
.dash-balance-delta.up {
  background: rgba(52, 211, 153, 0.16);
  color: #6ee7b7;
}
.dash-balance-delta.down {
  background: rgba(251, 113, 133, 0.16);
  color: #fda4af;
}

/* KPI cards: label + tinted icon bubble, big value, a derived ratio below. */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  grid-gap: 16px;
  gap: 16px;
  margin-bottom: 28px;
}
.kpi-card {
  --kpi: var(--color-primary);
  position: relative;
  padding: 18px 20px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}
.kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: color-mix(in srgb, var(--kpi) 40%, var(--color-border));
}
.kpi-card.tone-teal { --kpi: #14b8a6; }
.kpi-card.tone-coral { --kpi: #ff7a59; }
.kpi-card.tone-green { --kpi: var(--color-success); }
.kpi-card.tone-red { --kpi: var(--color-danger); }
.kpi-card.tone-blue { --kpi: #0ea5e9; }
.kpi-card.tone-violet { --kpi: #8b5cf6; }
.kpi-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.kpi-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--color-text-muted);
}
.kpi-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: color-mix(in srgb, var(--kpi) 14%, transparent);
  color: var(--kpi);
}
.kpi-value {
  margin-top: 4px;
  font-size: 25px;
  font-weight: 800;
  letter-spacing: -0.02em;
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.kpi-foot {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--color-border);
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-muted);
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
}

.dash-section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-text-muted);
}
.dash-section-title::after {
  content: '';
  flex: 1 1;
  height: 1px;
  background: var(--color-border);
}
/* Three-column chart grid; `.wide` cards take two columns. */
.dash-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-gap: 18px;
  gap: 18px;
  margin-bottom: 28px;
}
.chart-card.wide {
  grid-column: span 2;
}
.chart-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 16px 20px 0;
}
.chart-card-title {
  font-weight: 700;
}
.chart-card-tag {
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--color-primary-soft);
  color: var(--color-primary-600);
  font-size: 11px;
  font-weight: 700;
}
.chart-card-body {
  height: 290px;
  padding: 12px 18px 18px;
}
.chart-empty {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-text-muted);
  font-weight: 600;
}
@media (max-width: 1200px) {
  .dash-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .chart-card.wide {
    grid-column: span 2;
  }
}
@media (max-width: 760px) {
  .dash-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .chart-card.wide {
    grid-column: auto;
  }
  .dash-hero {
    padding: 22px 18px;
  }
  .dash-hero-title {
    font-size: 22px;
  }
  .dash-balance {
    min-width: 0;
    width: 100%;
  }
  .chart-card-body {
    height: 240px;
  }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-family: inherit;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s, box-shadow 0.15s, transform 0.05s, filter 0.15s;
  background: var(--color-surface-2);
  color: var(--color-text);
  white-space: nowrap;
}
.btn:hover {
  text-decoration: none;
  filter: brightness(1.04);
}
.btn:active:not(:disabled) {
  transform: translateY(1px);
}
.btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-primary) 35%, transparent);
}
.btn-primary {
  background: var(--color-primary);
  color: var(--color-on-primary);
  box-shadow: var(--shadow-primary);
}
.btn-primary:hover {
  background: var(--color-primary-600);
}
.btn-success {
  background: var(--color-success);
  color: #fff;
}
.btn-danger {
  background: var(--color-danger);
  color: #fff;
}
.btn-outline {
  background: var(--color-surface);
  border-color: var(--color-border);
  color: var(--color-text);
}
.btn-outline:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
  filter: none;
}
.btn-sm {
  padding: 5px 10px;
  font-size: 12px;
}
.btn-lg {
  padding: 12px 20px;
  font-size: 14.5px;
}
.btn-block {
  width: 100%;
}
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ---------- Forms ---------- */
.form-group {
  margin-bottom: 16px;
}
.form-label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
  font-size: 13px;
}
.form-control,
.form-select {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  color: var(--color-text);
  font-size: 14px;
  font-family: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.form-control:hover,
.form-select:hover {
  border-color: color-mix(in srgb, var(--color-primary) 40%, var(--color-border));
}
.form-control:focus,
.form-select:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--color-primary) 18%, transparent);
}
/* Input with a leading icon (sign-in form). */
.input-icon {
  position: relative;
}
.input-icon > svg {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-text-muted);
  pointer-events: none;
}
.input-icon > .form-control {
  padding-left: 38px;
}
/* Side-by-side form fields that stack once the container gets narrow. */
.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  grid-gap: 0 12px;
  gap: 0 12px;
}
/* Bet Side / Bet Amount / Win Amount / Outcome on one line — the outcome cell
   holds badges, so it gets the widest track. */
.bet-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(84px, 1fr)) minmax(118px, 1.2fr);
  grid-gap: 0 12px;
  gap: 0 12px;
}
@media (max-width: 560px) {
  .bet-summary {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  }
}
/* Balance cell: amount plus its inline refresh control. */
.balance-cell {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  justify-content: flex-end;
}
.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 3px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--color-text-muted);
  cursor: pointer;
}
.btn-icon:hover:not(:disabled) {
  background: var(--color-primary-soft);
  color: var(--color-primary);
}
.btn-icon:disabled {
  cursor: default;
  opacity: 0.6;
}
.spin {
  animation: spin 0.9s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
/* Read-only label/value pair — the compact alternative to a disabled input. */
.field-static {
  margin-bottom: 14px;
}
.field-static .form-label {
  margin-bottom: 2px;
  font-size: 12px;
  font-weight: 500;
  color: var(--color-text-muted);
}
.field-static-value {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
}
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
  margin-bottom: 18px;
}
.filter-bar .form-group {
  margin-bottom: 0;
}
.input-group {
  display: flex;
  align-items: stretch;
}
.input-group-text {
  display: flex;
  align-items: center;
  padding: 0 12px;
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-right: none;
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
  font-size: 13px;
  color: var(--color-text-muted);
  white-space: nowrap;
}
.input-group .form-control,
.input-group .form-select {
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

/* ---------- Tables ---------- */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
}
/* Mirrored horizontal scrollbar for <TableScroll>, pinned under the topbar. */
.table-scroll-top {
  position: -webkit-sticky;
  position: sticky;
  top: var(--topbar-height);
  z-index: 30;
  overflow-x: auto;
  overflow-y: hidden;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  margin-bottom: 4px;
}
table.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
table.table th,
table.table td {
  padding: 12px 16px;
  text-align: left;
  white-space: nowrap;
  vertical-align: middle;
  border-bottom: 1px solid var(--color-border);
}
table.table tbody tr:last-child td {
  border-bottom: none;
}
table.table thead th {
  background: var(--color-surface-2);
  color: var(--color-text-muted);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 10.5px;
  letter-spacing: 0.08em;
  position: -webkit-sticky;
  position: sticky;
  top: 0;
}
table.table tbody tr {
  transition: background 0.1s;
}
table.table tbody tr:hover {
  background: color-mix(in srgb, var(--color-primary) 5%, var(--color-surface));
}
table.table td.num,
table.table th.num {
  text-align: right;
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
}
.table-empty {
  text-align: center;
  padding: 48px;
  color: var(--color-text-muted);
}

/* ---------- Agent hierarchy (agent list) ----------
   One guide column per ancestor level, then the elbow into the agent itself.
   The rails stretch the full row height so the lines join up between rows. */
.agent-tree {
  display: flex;
  align-items: stretch;
  min-height: 40px;
}
/* Columns are as wide as the toggle button, so a child's guide line runs
   straight down from the centre of its parent's button. */
.agent-tree .tree-rail,
.agent-tree .tree-branch {
  flex: 0 0 30px;
  position: relative;
}
/* An ancestor column whose branch still has rows below keeps its line. */
.agent-tree .tree-rail.on::before,
.agent-tree .tree-branch::before {
  content: '';
  position: absolute;
  left: 15px;
  top: 0;
  bottom: 0;
  border-left: 1px dashed color-mix(in srgb, var(--color-primary) 35%, var(--color-border));
}
/* The last child ends the line at the elbow instead of carrying it down. */
.agent-tree .tree-branch.last::before {
  bottom: 50%;
}
.agent-tree .tree-branch::after {
  content: '';
  position: absolute;
  left: 15px;
  right: 0;
  top: 50%;
  border-top: 1px dashed color-mix(in srgb, var(--color-primary) 35%, var(--color-border));
}
/* Expand / collapse (+ / −) button, shared by the table and the tree view. */
.agent-tree .tree-toggle,
.agent-org-toggle {
  flex: 0 0 30px;
  width: 30px;
  height: 30px;
  align-self: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-surface);
  color: var(--color-primary);
  font: inherit;
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}
.agent-tree .tree-toggle:hover,
.agent-org-toggle:hover {
  border-color: var(--color-primary);
  background: var(--color-primary-soft);
  color: var(--color-primary);
}
.agent-tree .tree-toggle.empty,
.agent-org-toggle.empty {
  border: none;
  background: none;
  cursor: default;
}
.agent-tree .agent-tree-body {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-left: 4px;
}

/* Table / Tree switch on the agent list header. */
.view-switch {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface-2);
}
.view-switch button {
  padding: 6px 14px;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: var(--color-text-muted);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.view-switch button:hover {
  color: var(--color-text);
}
.view-switch button.active {
  background: var(--color-surface);
  color: var(--color-primary);
  box-shadow: var(--shadow-sm);
}

/* ---------- Agent hierarchy (tree view) ----------
   Nested lists. Each child draws its own piece of the parent's guide line
   (::before) plus the elbow into itself (::after); the last child stops the
   line at its elbow. 20px is half a row, where the elbow meets. */
.agent-org-wrap {
  padding: 10px 12px;
  overflow-x: auto;
}
.agent-org,
.agent-org ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
/* The parent's 30px toggle is centred 23px into its row (8px padding + 15px),
   so with a 38px indent the guide line sits at -15px, under that centre, and
   the elbow runs 23px to the child's toggle. */
.agent-org ul {
  padding-left: 38px;
}
.agent-org li {
  position: relative;
}
.agent-org ul > li::before {
  content: '';
  position: absolute;
  left: -15px;
  top: 0;
  bottom: 0;
  border-left: 1px dashed color-mix(in srgb, var(--color-primary) 35%, var(--color-border));
}
.agent-org ul > li:last-child::before {
  bottom: auto;
  height: 20px;
}
.agent-org ul > li::after {
  content: '';
  position: absolute;
  left: -15px;
  top: 20px;
  width: 23px;
  border-top: 1px dashed color-mix(in srgb, var(--color-primary) 35%, var(--color-border));
}
.agent-org-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
}
.agent-org-row:hover {
  background: color-mix(in srgb, var(--color-primary) 6%, var(--color-surface));
}
.agent-org-name {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
  min-width: 0;
}
.agent-org-meta {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  padding-left: 16px;
}
.agent-org-balance {
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  white-space: nowrap;
}
@media (max-width: 640px) {
  .agent-org-row {
    flex-wrap: wrap;
  }
  .agent-org-meta {
    flex-basis: 100%;
    margin-left: 38px;
    padding-left: 0;
    flex-wrap: wrap;
  }
}

/* ---------- Badges ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.01em;
}
.badge-success {
  background: var(--color-success-soft);
  color: var(--color-success);
}
.badge-danger {
  background: var(--color-danger-soft);
  color: var(--color-danger);
}
.badge-warning {
  background: var(--color-warning-soft);
  color: var(--color-warning);
}
.badge-muted {
  background: var(--color-surface-2);
  color: var(--color-text-muted);
  box-shadow: inset 0 0 0 1px var(--color-border);
}
.badge-info {
  background: color-mix(in srgb, var(--color-info) 14%, transparent);
  color: var(--color-info);
}

/* Sticky footer bar that appears while a form has unsaved changes. */
.form-actions-bar {
  position: -webkit-sticky;
  position: sticky;
  bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 12px 18px;
  border: 1px solid color-mix(in srgb, var(--color-primary) 35%, var(--color-border));
  border-radius: var(--radius);
  background: var(--color-surface);
  box-shadow: var(--shadow-md);
  z-index: 30;
}

/* ---------- Row action menu ---------- */
.row-menu-trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
/* Name-as-trigger: reads as a hyperlink, behaves as the menu button it is. */
.row-menu-link {
  padding: 0;
  border: none;
  background: none;
  font: inherit;
  font-weight: 700;
  color: var(--color-primary);
  text-align: left;
  cursor: pointer;
}
.row-menu-link:hover,
.row-menu-link.open {
  text-decoration: underline;
  text-underline-offset: 3px;
}
.row-menu-caret {
  font-size: 10px;
  line-height: 1;
  opacity: 0.7;
  transition: transform 0.15s;
}
.row-menu-caret.open {
  transform: rotate(180deg);
}
.row-menu {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 6px;
  min-width: 180px;
  z-index: 70;
  display: flex;
  flex-direction: column;
}
.row-menu-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 8px 12px;
  border: none;
  border-radius: 8px;
  background: none;
  color: var(--color-text);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.row-menu-item:hover {
  background: var(--color-primary-soft);
  text-decoration: none;
}
.row-menu-item.success {
  color: var(--color-success);
  font-weight: 600;
}
.row-menu-item.danger {
  color: var(--color-danger);
  font-weight: 600;
}

/* ---------- Alerts ---------- */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid transparent;
  font-weight: 500;
}
.alert-success {
  background: var(--color-success-soft);
  color: var(--color-success);
  border-color: color-mix(in srgb, var(--color-success) 25%, transparent);
}
.alert-danger {
  background: var(--color-danger-soft);
  color: var(--color-danger);
  border-color: color-mix(in srgb, var(--color-danger) 25%, transparent);
}
.alert-warning {
  background: var(--color-warning-soft);
  color: var(--color-warning);
  border-color: color-mix(in srgb, var(--color-warning) 25%, transparent);
}
.alert .close {
  cursor: pointer;
  font-weight: 700;
  opacity: 0.7;
  background: none;
  border: none;
  font-size: 18px;
  color: inherit;
}

/* ---------- Pagination ---------- */
.pagination {
  display: flex;
  gap: 6px;
  justify-content: center;
  margin-top: 20px;
  flex-wrap: wrap;
}
.pagination button {
  min-width: 36px;
  height: 36px;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--color-text);
  font-family: inherit;
  font-weight: 600;
  transition: border-color 0.15s, color 0.15s;
}
.pagination button:hover:not(:disabled):not(.active) {
  border-color: var(--color-primary);
  color: var(--color-primary);
}
.pagination button.active {
  background: var(--color-primary);
  color: var(--color-on-primary);
  border-color: var(--color-primary);
  box-shadow: var(--shadow-primary);
}
.pagination button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* ---------- Modal ---------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(4, 16, 19, 0.55);
  -webkit-backdrop-filter: blur(3px);
          backdrop-filter: blur(3px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 60px 16px;
  z-index: 100;
  overflow-y: auto;
}
.modal {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 18px;
  width: 100%;
  max-width: 520px;
  box-shadow: 0 24px 60px -12px rgba(0, 0, 0, 0.35);
  animation: modal-in 0.18s ease-out;
}
@keyframes modal-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
}
.modal.modal-lg {
  max-width: 1040px;
}
.modal-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 800;
  font-size: 16px;
}
.modal-body {
  padding: 24px;
}
.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--color-border);
  background: var(--color-surface-2);
  border-radius: 0 0 18px 18px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* ---------- Utilities ---------- */
.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--color-primary-soft);
  border-top-color: var(--color-primary);
  border-right-color: var(--color-accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
.center-screen {
  min-height: 60vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.text-success {
  color: var(--color-success);
}
.text-danger {
  color: var(--color-danger);
}
.text-muted {
  color: var(--color-text-muted);
}
.row-actions {
  display: flex;
  gap: 6px;
}

/* Toggle switch (table on/off) */
.switch {
  position: relative;
  display: inline-block;
  width: 42px;
  height: 24px;
  flex-shrink: 0;
}
.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.switch .slider {
  position: absolute;
  inset: 0;
  background: var(--color-border);
  border-radius: 999px;
  transition: 0.2s;
  cursor: pointer;
}
.switch .slider::before {
  content: '';
  position: absolute;
  height: 18px;
  width: 18px;
  left: 3px;
  top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: 0.2s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}
.switch input:checked + .slider {
  background: var(--color-primary);
}
.switch input:checked + .slider::before {
  transform: translateX(18px);
}
.switch input:focus-visible + .slider {
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-primary) 35%, transparent);
}
.switch input:disabled + .slider {
  opacity: 0.5;
  cursor: not-allowed;
}
.d-flex {
  display: flex;
}
.gap-2 {
  gap: 8px;
}
.mb-0 {
  margin-bottom: 0;
}
@media (max-width: 640px) {
  .d-none-sm {
    display: none;
  }
}

/* ---------- Sign-in ---------- */
.auth-page {
  display: grid;
  grid-template-columns: minmax(380px, 46%) 1fr;
  min-height: 100vh;
}
.auth-hero {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 32px;
  padding: 44px 52px;
  color: #e6f4f3;
  background:
    radial-gradient(600px 400px at 110% -10%, rgba(255, 122, 89, 0.28), transparent 60%),
    radial-gradient(700px 500px at -20% 110%, rgba(45, 212, 191, 0.3), transparent 60%),
    linear-gradient(160deg, #0c2a30 0%, #061518 100%);
}
/* Faint tile grid echoing the logo mark. */
.auth-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 44px 44px;
  -webkit-mask-image: linear-gradient(180deg, #000 30%, transparent 100%);
          mask-image: linear-gradient(180deg, #000 30%, transparent 100%);
  pointer-events: none;
}
.auth-hero > * {
  position: relative;
}
.auth-hero .brand-wordmark {
  font-size: 22px;
  color: #fff;
}
.auth-hero-title {
  margin: 0 0 24px;
  max-width: 440px;
  font-size: 32px;
  line-height: 1.2;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #fff;
}
.auth-hero-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-gap: 14px;
  gap: 14px;
}
.auth-hero-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 500;
  color: #b9d6d7;
}
.auth-hero-list svg {
  flex-shrink: 0;
  color: #5eead4;
}
.auth-hero-foot {
  font-size: 12px;
  color: #6f9396;
}
.auth-main {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 80px 24px 40px;
}
.auth-tools {
  position: absolute;
  top: 20px;
  right: 24px;
  display: flex;
  gap: 8px;
  align-items: center;
}
.auth-card {
  width: 100%;
  max-width: 400px;
}
.auth-card-logo {
  display: none;
  margin-bottom: 28px;
}
.auth-title {
  margin: 0;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.03em;
}
.auth-subtitle {
  margin: 6px 0 28px;
  color: var(--color-text-muted);
}
.auth-card .form-control {
  padding-top: 11px;
  padding-bottom: 11px;
}
.auth-card .btn-block {
  margin-top: 8px;
}
@media (max-width: 900px) {
  .auth-page {
    grid-template-columns: 1fr;
  }
  .auth-hero {
    display: none;
  }
  .auth-card-logo {
    display: block;
  }
}

/* ---------- API documentation ---------- */
.method-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #fff;
}
.method-post {
  background: #0d9488;
}
.method-get {
  background: #0284c7;
}
.method-callback {
  background: #f06543;
}
.api-path {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--color-text);
  word-break: break-all;
}
.code-block {
  position: relative;
  background: #071518;
  color: #dcecec;
  border: 1px solid #1a3035;
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin: 0;
}
.code-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: #0b2125;
  border-bottom: 1px solid #1a3035;
  font-size: 11px;
  color: #7fa3a7;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
}
.code-copy {
  background: transparent;
  border: 1px solid #23434a;
  color: #a6c3c5;
  border-radius: 6px;
  font-size: 11px;
  padding: 3px 9px;
  cursor: pointer;
}
.code-copy:hover {
  background: #12302f;
  color: #5eead4;
  border-color: #2dd4bf;
}
.code-block pre {
  margin: 0;
  padding: 14px 16px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.6;
}
.doc-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.doc-nav a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  font-weight: 600;
  color: var(--color-text);
  font-size: 13px;
}
.doc-nav a:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
  text-decoration: none;
}
.api-endpoint {
  scroll-margin-top: calc(var(--topbar-height) + 16px);
}
.tab-row {
  display: flex;
  gap: 4px;
  margin-bottom: 12px;
  padding: 3px;
  width: -moz-fit-content;
  width: fit-content;
  max-width: 100%;
  flex-wrap: wrap;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface-2);
}
.tab-btn {
  padding: 6px 14px;
  border: none;
  background: transparent;
  border-radius: 7px;
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
  font-size: 13px;
  color: var(--color-text-muted);
}
.tab-btn:hover {
  color: var(--color-text);
}
.tab-btn.active {
  background: var(--color-surface);
  color: var(--color-primary);
  box-shadow: var(--shadow-sm);
}
code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--color-primary-soft);
  color: var(--color-primary-600);
  padding: 1px 6px;
  border-radius: 5px;
}
.code-block code {
  background: transparent;
  color: inherit;
  padding: 0;
}

/* ---------- Swagger UI wrapper ---------- */
.swagger-page {
  background: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
  color: #3b4151;
  /* The panel is always light, so pin native controls to the light scheme.
     Without this the root's `color-scheme: dark` paints UA field text white
     on Swagger's own white input background. */
  color-scheme: light;
}
.swagger-page .swagger-ui .topbar {
  display: none;
}
.swagger-page .swagger-ui .info {
  margin: 24px 0;
}
.swagger-page .swagger-ui {
  padding: 8px 20px 20px;
}
/* Prevent the global `code {}` styling (light bg/padding) from bleeding into
   Swagger's syntax-highlighted example blocks — that caused the white boxes. */
.swagger-page .swagger-ui code,
.swagger-page .swagger-ui pre,
.swagger-page .swagger-ui pre code,
.swagger-page .swagger-ui .microlight,
.swagger-page .swagger-ui .microlight code,
.swagger-page .swagger-ui .highlight-code code {
  background: transparent;
  color: inherit;
  padding: 0;
  border-radius: 0;
  font-size: inherit;
}
/* Hint text beside Swagger's "Examples:" dropdown label (callback actions). */
.swagger-page .swagger-ui .examples-select__section-label::after {
  content: ' (balance, placeBet, betResult)';
  margin-left: 4px;
  color: var(--color-text-muted);
  font-weight: 400;
  font-size: 12px;
}
/* Swagger sets a white background on its inputs but leaves the text colour to
   the UA, so state it explicitly — the field text must stay dark in every
   theme. */
.swagger-page .swagger-ui input[type='text'],
.swagger-page .swagger-ui input[type='email'],
.swagger-page .swagger-ui input[type='password'],
.swagger-page .swagger-ui input[type='number'],
.swagger-page .swagger-ui input[type='search'],
.swagger-page .swagger-ui input[type='url'],
.swagger-page .swagger-ui input[type='tel'],
.swagger-page .swagger-ui input[type='file'],
.swagger-page .swagger-ui textarea {
  color: #3b4151;
  -webkit-text-fill-color: #3b4151;
}
.swagger-page .swagger-ui input::placeholder,
.swagger-page .swagger-ui textarea::placeholder {
  color: #8a90a2;
  -webkit-text-fill-color: #8a90a2;
  opacity: 1;
}
/* Halve the height of the Try-it-out request-body editor. */
.swagger-page .swagger-ui textarea.body-param__text {
  min-height: 180px;
  height: 180px;
}
/* Keep Swagger's own dark example container styling intact. */
.swagger-page .swagger-ui .highlight-code,
.swagger-page .swagger-ui .microlight {
  background: #41444e;
}
.swagger-page .swagger-ui .highlight-code > .microlight code,
.swagger-page .swagger-ui .microlight code {
  color: #ffffff;
}

/* ---------- Responsive ----------
   Above 900px the sidebar is a fixed rail and the content is inset by its
   width. Below that it becomes an overlay drawer with a scrim, and the page
   chrome tightens up so tables and filters get the full viewport width. */
@media (min-width: 901px) {
  /* The hamburger is a no-op while the rail is permanently visible. */
  .topbar-menu-btn {
    display: none;
  }
}

@media (max-width: 900px) {
  .app-main {
    margin-left: 0;
  }
  .sidebar {
    width: min(var(--sidebar-width), 84vw);
    transform: translateX(-100%);
    transition: transform 0.22s ease;
    box-shadow: 8px 0 32px rgba(0, 0, 0, 0.4);
    overscroll-behavior: contain;
    padding-bottom: env(safe-area-inset-bottom);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .sidebar-close {
    display: inline-flex;
  }
  .app-shell.sidebar-open .sidebar-backdrop {
    display: block;
  }

  .app-content {
    padding: 18px 14px;
  }
  .topbar {
    gap: 8px;
    padding: 0 12px;
  }
  .topbar-stat {
    font-size: 10.5px;
    padding: 4px 8px;
  }
  .topbar-stat .value {
    font-size: 13px;
  }
  .topbar-divider {
    display: none;
  }
  .topbar-username {
    display: none;
  }
  .topbar-user {
    padding: 2px;
  }
  .avatar {
    width: 32px;
    height: 32px;
  }
}

@media (max-width: 640px) {
  .page-header {
    margin-bottom: 16px;
  }
  .page-title {
    font-size: 20px;
  }
  .card-body {
    padding: 14px;
  }
  .card-header {
    padding: 14px;
  }
  .stat-grid {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
  }
  .stat-tile .stat-value {
    font-size: 22px;
  }
  /* Filters go full width rather than squeezing into unusable slivers. */
  .filter-bar {
    gap: 10px;
  }
  .filter-bar > * {
    flex: 1 1 100%;
    min-width: 0;
  }
  .filter-bar .form-control,
  .filter-bar .form-select {
    width: 100%;
  }
  .modal-backdrop {
    padding: 16px 10px;
  }
  .pagination {
    gap: 4px;
  }
  .pagination button {
    min-width: 32px;
    height: 32px;
    font-size: 12px;
  }
  /* Both balances stay readable — the bar grows a second row instead of
     squeezing or dropping one of them. */
  .topbar {
    height: auto;
    min-height: var(--topbar-height);
    flex-wrap: wrap;
    row-gap: 6px;
    padding: 8px 12px;
  }
}

