/* ============================================
   1. TOKENS — primitivos + semânticos
   See ./tokens.css (shared with design/ui/src/index.css)
   ============================================ */
@import url('./tokens.css');


/* ============================================
   2. BASE — reset, body, tipografia global
   ============================================ */
@font-face {
  font-family: 'Geist';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url(https://cdn.jsdelivr.net/fontsource/fonts/geist:vf@latest/latin-wght-normal.woff2) format('woff2-variations');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

body {
  font-family: 'Geist', sans-serif;
}

h1,
h2,
h3,
.font-headline {
  font-family: 'Manrope', sans-serif;
}

/* Metric / numeric values — Geist, not Manrope headlines */
.font-data,
.stat-strip__card h2 {
  font-family: 'Geist', sans-serif;
  font-variant-numeric: tabular-nums;
}

/* ============================================
   3. COMPONENTES PARTILHADOS — botões, cards, inputs, sidebar
   ============================================ */
.material-symbols-outlined {
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

/* Brand logos / symbols — light/dark (assets/stakemonkey-logo-*.svg, stakemonkey-symbol-*.svg) */
.app-brand-logo--dark,
.app-brand-symbol--dark {
  display: none;
}

html.dark .app-brand-logo--light,
html.dark .app-brand-symbol--light {
  display: none;
}

html.dark .app-brand-logo--dark,
html.dark .app-brand-symbol--dark {
  display: block;
}

#app-sidebar {
  margin: var(--spacing-2);
  border-radius: var(--radius-lg);
  height: calc(100% - 2 * var(--spacing-2));
  overflow: hidden;
}

.sidebar-nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  color: var(--text-muted);
  border-radius: 0.5rem;
  transition: background-color 0.15s ease, color 0.15s ease;
  cursor: pointer;
  text-decoration: none;
}

.sidebar-nav-link:hover {
  background-color: var(--bg-surface-high);
}

.sidebar-nav-link.is-active {
  background-color: color-mix(in srgb, var(--bg-surface-high) 95%, var(--text-primary));
  color: var(--text-primary);
}

.sidebar-nav-icon {
  width: 1.25rem;
  height: 1.25rem;
  flex-shrink: 0;
}

/* Sidebar user menu (footer) */
.sidebar-user-footer {
  padding-bottom: var(--spacing-2);
}

.sidebar-user-trigger {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  width: 100%;
  padding: 0.5rem 0.625rem;
  border: none;
  border-radius: var(--radius-lg);
  background: transparent;
  color: var(--text-primary);
  cursor: pointer;
  transition: background-color 0.15s ease;
  text-align: left;
}

.sidebar-user-trigger:hover,
.sidebar-user-trigger[aria-expanded='true'] {
  background-color: var(--bg-surface-high);
}

.sidebar-user-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  border-radius: var(--radius-full);
  background-color: color-mix(in srgb, var(--color-violet-700) 35%, var(--color-neutral-900));
  color: var(--color-violet-300);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1;
}

.sidebar-user-avatar--lg {
  width: 2.25rem;
  height: 2.25rem;
  font-size: 0.75rem;
}

html:not(.dark) .sidebar-user-avatar {
  background-color: color-mix(in srgb, var(--color-violet-100) 65%, var(--color-violet-300));
  color: var(--color-violet-700);
}

.sidebar-user-label {
  flex: 1;
  min-width: 0;
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: lowercase;
}

.sidebar-user-chevron {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
  color: var(--text-muted);
}

.sidebar-user-dropdown {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(100% + 0.5rem);
  z-index: 80;
  padding: 0.625rem;
  border-radius: var(--radius-xl);
  background: var(--bg-surface-overlay);
  border: 1px solid var(--border-default);
  box-shadow: var(--dropdown-shadow);
}

.sidebar-user-dropdown-header {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.375rem 0.25rem 0.625rem;
}

.sidebar-user-name-menu {
  flex: 1;
  min-width: 0;
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--text-primary);
  text-transform: lowercase;
  line-height: 1.25;
}

.sidebar-theme-switch {
  display: flex;
  align-items: center;
  gap: 0.125rem;
  padding: 0.1875rem;
  border-radius: var(--radius-lg);
  background: var(--bg-surface-high);
}

.sidebar-theme-option {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  flex: 1;
  min-height: 2rem;
  padding: 0.375rem 0.5rem;
  border: none;
  border-radius: calc(var(--radius-lg) - 2px);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.sidebar-theme-option:hover {
  color: var(--text-primary);
}

.sidebar-theme-option.is-active {
  background: var(--bg-surface-raised);
  color: var(--text-primary);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
}

.sidebar-theme-icon {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
}

.sidebar-theme-label {
  font-size: 0.75rem;
  font-weight: 500;
}

#global-metric-btns.sidebar-theme-switch {
  padding-block: 0;
  padding-inline: 0.25rem;
}

#global-metric-btns .sidebar-theme-option {
  flex: 0 0 auto;
  padding-inline: 0.5rem;
  line-height: 1;
}

#global-metric-btns .sidebar-theme-label {
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
  line-height: 1.2;
}

.sidebar-user-dropdown-divider {
  height: 1px;
  margin: 0.375rem 0;
  background: var(--border-default);
}

.sidebar-user-menu-item {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  width: 100%;
  padding: 0.6875rem 0.75rem;
  border: none;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--text-primary);
  font-size: 0.875rem;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.sidebar-user-menu-item:hover {
  background-color: var(--bg-surface-high);
}

.sidebar-user-menu-item--danger {
  color: var(--color-coral-500);
}

.sidebar-user-menu-item--danger:hover {
  background-color: color-mix(in srgb, var(--color-coral-500) 12%, transparent);
}

.sidebar-user-menu-item.is-active {
  background-color: var(--bg-surface-high);
}

.sidebar-user-menu-icon {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
  color: var(--text-muted);
}

.sidebar-user-menu-item--danger .sidebar-user-menu-icon {
  color: inherit;
}

body.privacy-mode #page-canvas {
  filter: blur(8px);
  user-select: none;
  pointer-events: none;
}

.ghost-border {
  border: none;
}

.glass-panel {
  background: var(--glass-panel-bg);
  backdrop-filter: blur(var(--glass-panel-blur));
  border: 1px solid var(--glass-panel-border);
}

.dash-card {
  background-color: var(--bg-surface-raised);
  border: 1px solid var(--border-default);
  box-shadow: none;
}

.dash-card :is(.text-outline, .text-slate-500),
.dash-card thead.text-outline {
  color: var(--text-muted) !important;
}

.dash-card .text-outline\/40 {
  color: color-mix(in srgb, var(--text-inverse) 45%, transparent) !important;
}

/* Light — page / sidebar / cards inverted */
html:not(.dark) body.bg-background {
  background-color: var(--bg-surface-raised);
}

html:not(.dark) #app-sidebar {
  background-color: var(--color-neutral-0);
}

html:not(.dark) .dash-card {
  background-color: var(--color-neutral-0);
  border-color: var(--border-strong);
}

html:not(.dark) .chart-ref-line--avg::after {
  background: color-mix(in srgb, var(--color-neutral-0) 88%, transparent);
}

/* Light — softer hover / active surfaces */
html:not(.dark) .sidebar-nav-link:hover,
html:not(.dark) .sidebar-user-trigger:hover,
html:not(.dark) .sidebar-user-trigger[aria-expanded='true'],
html:not(.dark) .sidebar-user-menu-item:hover,
html:not(.dark) .sidebar-theme-option:hover:not(.is-active) {
  background-color: var(--state-hover-bg);
}

html:not(.dark) .sidebar-nav-link.is-active,
html:not(.dark) .sidebar-user-menu-item.is-active {
  background-color: var(--state-active-bg);
}

html:not(.dark) .sidebar-theme-switch {
  background: var(--state-hover-bg);
}

html:not(.dark) .sidebar-theme-option.is-active {
  background: var(--state-active-bg);
  box-shadow: none;
}

html:not(.dark) .page-filter-trigger:hover {
  background: var(--state-hover-bg);
}

html:not(.dark) .my-bets-filter-option.is-active {
  background: var(--state-active-bg);
}

/* ============================================
   4. DASHBOARD — específico de dashboard.html
   ============================================ */
/* Chart card header — title row + time range filter, divider below */
.chart-card-header {
  flex-shrink: 0;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-default);
  overflow: visible;
  position: relative;
  z-index: 2;
}

.chart-card-header__row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.chart-card-header__copy {
  min-width: 0;
  flex: 1;
}

.chart-card-header__tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.375rem;
  flex-shrink: 0;
  padding-top: 0.2rem;
}

.chart-metric-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.5rem 0.625rem;
  border: none;
  border-radius: var(--radius-lg);
  background: var(--chart-range-chip-active);
  color: var(--text-primary);
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.15s ease;
}

.chart-metric-trigger:hover,
.chart-metric-trigger[aria-expanded='true'] {
  background: var(--chart-range-chip-active);
}

.chart-metric-trigger:focus-visible {
  outline: 2px solid var(--accent-sky);
  outline-offset: 1px;
}

.chart-metric-label {
  flex: 1;
  min-width: 0;
  text-align: left;
}

.chart-metric-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 0.35rem);
  z-index: 500;
  min-width: 9.75rem;
  padding: 0.35rem;
  border-radius: var(--radius-xl);
  background: var(--bg-surface-overlay);
  border: 1px solid var(--border-default);
  box-shadow: var(--dropdown-shadow);
}

.chart-metric-option {
  font-size: 0.8125rem;
}

.chart-metric-chevron {
  font-size: 1rem;
  line-height: 1;
  color: var(--text-muted);
  flex-shrink: 0;
}

.chart-range-filter {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.125rem;
  flex-shrink: 0;
}

.chart-range-btn {
  appearance: none;
  border: none;
  background: transparent;
  padding: 0.6rem 0.65rem;
  border-radius: var(--radius-lg);
  font-size: 0.6875rem;
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0.02em;
  color: var(--text-muted);
  cursor: pointer;
  transition:
    color 0.15s ease,
    background-color 0.15s ease;
}

.chart-range-btn:hover {
  background: var(--chart-range-chip-hover);
  color: var(--text-primary);
}

.chart-range-btn.is-active {
  background: var(--chart-range-chip-active);
  color: var(--text-primary);
  font-weight: 700;
}

.chart-range-btn.is-active:hover {
  background: var(--chart-range-chip-active);
  color: var(--text-primary);
}

/* Explicit horizontal inset for plots (margin so flex/grid children cannot bleed to card edges). */
.graph-x-inset {
  margin-left: var(--graph-x-inset-x);
  margin-right: var(--graph-x-inset-x);
  min-width: 0;
  width: auto;
  box-sizing: border-box;
}

body.sidebar-collapsed #app-sidebar {
  transform: translateX(-100%);
}

body.sidebar-collapsed #app-main {
  margin-left: 0;
}

body.sidebar-collapsed #app-header {
  left: 0;
}

body.sidebar-collapsed #mass-action-bar {
  left: 0;
}

/* Mobile/tablet: sidebar overlays content; main column is always full width.
   The `sidebar-collapsed` body class still drives open/closed state. */
@media (max-width: 1023px) {
  #app-main {
    margin-left: 0 !important;
  }

  #app-header {
    left: 0 !important;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
  }

  #mass-action-bar {
    left: 0 !important;
  }

  #app-sidebar {
    /* On desktop the sidebar uses a 0.5rem inset margin and rounded corners;
       on mobile we want it edge-to-edge so translateX(-100%) actually moves
       it fully off-screen (otherwise its right edge sticks 8px into the
       viewport when collapsed — that's the vertical strip on the left). */
    margin: 0;
    border-radius: 0;
    height: 100%;
    box-shadow: -8px 0 40px -8px rgba(0, 0, 0, 0.55);
  }

  /* Belt-and-braces: when collapsed, kill the shadow entirely. */
  body.sidebar-collapsed #app-sidebar {
    box-shadow: none;
  }

  /* Backdrop when the sidebar is open over mobile content (dashboard only) */
  body:has(#app-sidebar):not(.sidebar-collapsed)::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 55;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
  }

  /* Header on mobile: single row — toggle, title, import. */
  #app-header {
    display: grid;
    grid-template-columns: auto auto 1fr auto;
    grid-template-areas:
      "toggle title . import";
    align-items: center;
    column-gap: 0.5rem;
    row-gap: 0.5rem;
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
  }

  #app-header>div,
  #app-header .app-header-title-group {
    display: contents;
  }

  #btn-sidebar-toggle {
    grid-area: toggle;
  }

  #app-header .app-header-title-row {
    grid-area: title;
    min-width: 0;
  }

  #app-header .app-header-title {
    font-size: 1rem;
    min-width: 0;
  }

  #btn-import-bets {
    grid-area: import;
    justify-self: end;
  }


  /* Compact the toggle so the title and Import Bets get more room. */
  #btn-sidebar-toggle {
    padding: 0.375rem;
  }

  /* Import Bets keeps its text on mobile — slightly tighter padding to fit. */
  #app-header #btn-import-bets {
    padding-inline: 0.75rem !important;
  }

  /* Use the actual measured header height for page-canvas top padding so
     content never sits under the (now taller) header. JS sets --app-header-h. */
  #page-canvas {
    padding-top: calc(var(--app-header-h, 4rem) + 0.75rem);
  }

  /* Tighten page-canvas insets so cards have room to breathe */
  #page-canvas {
    padding-left: max(0.75rem, env(safe-area-inset-left, 0px));
    padding-right: max(0.75rem, env(safe-area-inset-right, 0px));
  }

  #view-dashboard>.grid {
    gap: 0.75rem;
  }

  #view-dashboard>.grid+.grid,
  #view-dashboard>.grid+.dash-card,
  #view-dashboard>section.dash-card {
    margin-top: 0.75rem;
  }

  /* Chart cards: let them grow with their content instead of clipping inside
     the desktop fixed 400px height. Reduce internal padding so the chart
     canvas gets some real width on a phone. */
  .dash-card[data-chart-card] {
    height: auto !important;
    min-height: 26rem;
    padding: 0.875rem !important;
  }

  /* Ensure the chart canvas itself never collapses below a usable size. */
  .dash-card[data-chart-card] .chart-vbars-plot,
  .dash-card[data-chart-card] .chart-plot-main {
    min-height: 12rem;
  }

  /* Compact summary stat cards too. */
  #view-dashboard>.grid.grid-cols-1>.dash-card {
    padding: 1rem !important;
  }

  /* Stack the header copy and tools so neither gets crushed. */
  .chart-card-header {
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
  }

  .chart-card-header__row {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }

  .chart-card-header__copy h3 {
    font-size: 1rem;
    line-height: 1.2;
  }

  .chart-card-header__copy p {
    font-size: 0.6875rem;
    line-height: 1.3;
  }

  .chart-card-header__tools {
    width: 100%;
    justify-content: flex-start;
    padding-top: 0;
  }

  /* The 7-button range filter is the biggest offender — pack tighter and
     let it overflow horizontally with a touch-friendly scroll if needed. */
  .chart-range-filter {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    justify-content: flex-start;
  }

  .chart-range-filter::-webkit-scrollbar {
    display: none;
  }

  .chart-range-btn {
    padding: 0.4rem 0.55rem;
    font-size: 0.6875rem;
  }

  /* Metric combobox is fine but cap its width so it can't push the row. */
  .chart-metric-trigger {
    padding: 0.4rem 0.55rem;
    font-size: 0.75rem;
  }
}

.hide-data {
  filter: blur(8px);
}

/* Scrollable graph/card regions without visible scrollbar (wheel / touch / trackpad still work). */
.graph-no-scrollbar {
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.graph-no-scrollbar::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

/* Main column: inset from sidebar seam and gap below fixed header. */
#page-canvas {
  padding-top: calc(4rem + var(--layout-page-header-gap));
  padding-left: max(var(--layout-page-sidebar-inset), env(safe-area-inset-left, 0px));
  padding-right: max(var(--layout-page-sidebar-inset), env(safe-area-inset-right, 0px));
  box-sizing: border-box;
}

/* Views inherit page-canvas insets only — no extra page-level margin/padding. */
#page-canvas>.view-panel {
  margin: 0;
  padding: 0;
}

#page-canvas>.view-panel .graph-x-inset {
  margin-left: 0;
  margin-right: 0;
}

#view-dashboard>.grid {
  gap: var(--layout-dashboard-card-gap);
}

#view-dashboard>.grid+.grid,
#view-dashboard>.grid+.dash-card,
#view-dashboard>section.dash-card {
  margin-top: var(--layout-dashboard-card-gap);
}

#app-header {
  border-bottom: 1px solid var(--border-strong);
  padding-left: max(var(--layout-page-sidebar-inset), env(safe-area-inset-left, 0px));
  padding-right: max(var(--layout-page-sidebar-inset), env(safe-area-inset-right, 0px));
  box-sizing: border-box;
}

.header-toolbar-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  height: 36px;
  box-sizing: border-box;
  padding-inline: 0.5rem;
  border-radius: var(--radius-lg);
  flex-shrink: 0;
}

.page-filters .header-toolbar-item,
.my-bets-toolbar .header-toolbar-item {
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
}

.page-filters .header-toolbar-item::-webkit-scrollbar,
.my-bets-toolbar .header-toolbar-item::-webkit-scrollbar {
  display: none;
}

.page-filters .header-toolbar-item input[type="text"],
.my-bets-toolbar .header-toolbar-item input[type="text"],
.ref-values-toolbar input[type="text"] {
  height: 24px;
  padding-block: 0;
  padding-inline: 0.5rem;
  line-height: 24px;
  box-sizing: border-box;
  transition: background-color 0.15s ease, box-shadow 0.15s ease;
}

.ref-values-toolbar input[type="text"] {
  caret-color: var(--brand-main);
  outline: none;
}

.ref-values-toolbar input[type="text"]:hover:not(:focus),
input.bg-surface-container-lowest:hover:not(:focus) {
  background-color: var(--bg-surface-raised) !important;
}

input.bg-surface-container-lowest {
  transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.ref-values-toolbar input[type="text"]:focus {
  outline: none;
  --tw-ring-shadow: 0 0 #0000;
  --tw-ring-offset-shadow: 0 0 #0000;
  box-shadow: 0 0 0 1px var(--brand-main), 0 0 0 3px var(--brand-main-bg);
}

.page-filters--dashboard,
.page-filters--my-bets {
  margin-bottom: 1rem;
}

@media (max-width: 1023px) {

  .page-filters .header-date-popover,
  .my-bets-toolbar .header-date-popover {
    min-width: 14rem;
    max-width: calc(100vw - 1rem);
  }
}

#app-header .header-toolbar-item input[type="text"] {
  height: 24px;
  padding-block: 0;
  padding-inline: 0.5rem;
  line-height: 24px;
  box-sizing: border-box;
}

.header-ref-reset-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  flex-shrink: 0;
  height: 22px;
  padding-inline: 0.375rem;
  margin-left: 0.125rem;
  border: none;
  border-radius: calc(var(--radius-lg) - 4px);
  background: var(--bg-surface-raised);
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.15s ease, background-color 0.15s ease;
}

.header-ref-reset-btn .material-symbols-outlined {
  font-size: 14px;
  line-height: 1;
}

.header-ref-reset-label {
  font-size: 0.625rem;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.01em;
}

.header-ref-reset-btn:hover {
  background: color-mix(in srgb, var(--text-primary) 10%, var(--bg-surface-raised));
  color: var(--text-primary);
}

#app-header .header-toolbar-item .sidebar-theme-option {
  height: 28px;
  min-height: 28px;
  padding-block: 0;
}

#app-header #btn-import-bets.header-toolbar-item {
  padding-block: 0;
  padding-inline: 1rem;
}

.app-header-title-group {
  display: flex;
  align-items: center;
  gap: var(--spacing-6);
}

.app-header-title-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}

.header-configure-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  height: 36px;
  padding-inline: 0.625rem;
  border: none;
  border-radius: var(--radius-lg);
  background: var(--bg-surface-high);
  color: var(--text-primary);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.header-configure-btn:hover {
  background: color-mix(in srgb, var(--bg-surface-high), var(--text-primary) 8%);
}

.header-configure-icon {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
}

.app-header-title {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 600;
  line-height: 1.25;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

/* ── Header date range picker ─────────────────────────────────────────── */

.header-date-range {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}

.header-date-range__native {
  position: absolute;
  width: 0;
  height: 0;
  opacity: 0;
  pointer-events: none;
}

/* Shared page filter trigger — combobox + date range (dashboard, my bets, future pages). */
.page-filter-trigger,
.my-bets-filter-trigger,
.header-date-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 36px;
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-strong);
  background: var(--bg-surface);
  color: var(--text-primary);
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  white-space: nowrap;
  transition:
    border-color 0.15s ease,
    background-color 0.15s ease,
    color 0.15s ease;
}

.page-filter-trigger:hover,
.my-bets-filter-trigger:hover,
.header-date-trigger:hover {
  border-color: color-mix(in srgb, var(--border-strong) 55%, var(--accent-sky-bd));
  background: var(--bg-surface-raised);
}

.page-filter-icon,
.page-filter-chevron,
.my-bets-filter-icon,
.my-bets-filter-chevron {
  font-size: 1rem;
  line-height: 1;
  color: var(--text-muted);
  flex-shrink: 0;
}

.page-filter-chevron,
.my-bets-filter-chevron {
  font-size: 1.125rem;
  margin-left: 0.125rem;
}

.page-filter-label,
.header-date-label {
  font-weight: 500;
}

.header-date-popover {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  z-index: 500;
  min-width: 18rem;
  padding: 0.75rem;
  border-radius: var(--radius-xl);
  background: var(--bg-surface-overlay);
  border: 1px solid var(--border-default);
  box-shadow: var(--dropdown-shadow);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.header-date-popover__presets {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.25rem;
}

.header-date-preset {
  padding: 0.4rem 0.6rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-default);
  background: var(--bg-surface-raised);
  color: var(--text-primary);
  font-size: 0.7rem;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  transition: background-color 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}

.header-date-preset:hover {
  background: var(--bg-surface-high);
  border-color: var(--border-strong);
  color: var(--brand-main);
}

.header-date-preset[aria-pressed="true"] {
  background: var(--brand-main-fill);
  border-color: transparent;
  color: var(--brand-on-main);
}

.header-date-popover__divider {
  border: 0;
  border-top: 1px solid var(--border-default);
  margin: 0.25rem 0 0;
}

.header-date-popover__field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.header-date-popover__label {
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.header-date-popover__field input[type="date"] {
  height: 36px;
  padding-inline: 0.625rem;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  background: var(--bg-surface-raised);
  color: var(--text-primary);
  font-size: 0.875rem;
  font-weight: 500;
  transition: background-color 0.15s ease;
}

.header-date-popover__field input[type="date"]:hover:not(:focus) {
  background: var(--bg-surface-high);
}

.header-date-popover__actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.375rem;
  margin-top: 0.25rem;
}

.header-date-popover__btn {
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-default);
  background: transparent;
  color: var(--text-primary);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s ease, filter 0.15s ease;
}

.header-date-popover__btn:hover {
  background: var(--bg-surface-high);
}

.header-date-popover__btn--primary {
  background: var(--brand-main-fill);
  border-color: transparent;
  /* --brand-on-main is dark (#1a1505) in both themes; --text-on-brand is light
     in dark mode and gives illegible yellow-on-yellow. */
  color: var(--brand-on-main);
}

.header-date-popover__btn--primary:hover {
  background: var(--brand-main-hover);
  filter: none;
}

#dashboard-chart-tooltip {
  pointer-events: none;
  box-shadow: var(--chart-tooltip-shadow);
  opacity: 0;
  visibility: hidden;
  transform: translateY(4px) scale(0.98);
  transition:
    opacity 0.22s ease-out,
    transform 0.22s ease-out,
    visibility 0s linear 0.22s;
}

#dashboard-chart-tooltip.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  transition:
    opacity 0.22s ease-out,
    transform 0.22s ease-out,
    visibility 0s;
}

/* Chart annotations — grid, reference lines, axes, footers (shadcn / Cursor-style) */
.chart-plot-shell {
  position: relative;
  display: flex;
  min-height: 0;
  flex: 1;
  flex-direction: column;
}

.chart-plot-main {
  position: relative;
  display: flex;
  min-height: 0;
  flex: 1;
}

.chart-y-axis {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  flex-shrink: 0;
  width: 2.75rem;
  padding: 0.25rem 0.35rem 1.35rem 0;
  pointer-events: none;
}

.chart-y-axis-label {
  font-size: 9px;
  line-height: 1;
  color: var(--chart-grid-label);
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.chart-plot-canvas {
  position: relative;
  min-width: 0;
  flex: 1;
  min-height: 0;
}

.chart-x-axis {
  display: flex;
  justify-content: space-between;
  gap: 0.15rem;
  padding: 0.35rem 0 0;
  pointer-events: none;
}

.chart-x-axis-label {
  flex: 1;
  min-width: 0;
  font-size: 9px;
  line-height: 1.1;
  color: var(--chart-grid-label);
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.chart-ref-line {
  position: absolute;
  left: 0;
  right: 0;
  height: 0;
  margin: 0;
  padding: 0;
  border: none;
  border-top: 1px dashed color-mix(in srgb, var(--text-muted) 35%, transparent);
  pointer-events: none;
  overflow: visible;
}

.chart-ref-line--avg::after {
  content: attr(data-label);
  position: absolute;
  right: 0;
  top: -1.1rem;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: color-mix(in srgb, var(--bg-surface-raised) 88%, transparent);
  padding: 0 0.2rem;
}

.chart-ref-line--zero {
  border-top-color: color-mix(in srgb, var(--text-muted) 45%, transparent);
}

.chart-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  margin-top: 0.65rem;
  padding-top: 0.55rem;
  border-top: 1px solid color-mix(in srgb, var(--border-default) 65%, transparent);
  flex-shrink: 0;
}

.chart-stat {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}

.chart-stat-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.chart-stat-value {
  font-family: 'Geist', sans-serif;
  font-size: 11px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
}

.chart-stat-value.is-positive {
  color: var(--color-tertiary, #34d399);
}

.chart-stat-value.is-negative {
  color: var(--color-error, #f87171);
}

.chart-bar-plot {
  position: relative;
  display: flex;
  min-height: 0;
  flex: 1;
  flex-direction: column;
}

/* Vertical bar charts — bars in normal flex flow; dashed refs in overlay only. */
.chart-vbars-plot {
  position: relative;
  display: flex;
  flex: 1 1 0;
  flex-direction: column;
  min-height: 8rem;
  overflow: hidden;
}

.chart-vbars-bars {
  position: relative;
  z-index: 1;
  display: flex;
  flex: 1 1 0;
  align-items: stretch;
  gap: 0.25rem;
  min-height: 0;
}

.chart-vbars-bars--time {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.5rem;
}

.chart-vbars-refs {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

.chart-vbar-spacer {
  flex: 1 1 0;
  min-height: 0;
}

.daily-bar-col,
.time-bar-col {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 0;
  min-width: 0;
  height: 100%;
  cursor: pointer;
}

.daily-bar-col {
  flex: 1 1 0;
  min-width: 2px;
  /* Cap individual bar width so ultrawide screens with sparse data don't
     render absurdly wide columns. JS still controls bars-per-page. */
  max-width: 60px;
  border-radius: 0.375rem;
  border: 1px solid transparent;
  padding: 0 1px;
}

.time-bar-col {
  padding: 0.5rem;
  border-radius: 0.25rem;
  border: 1px solid transparent;
}

.daily-bar-col .chart-bar-fill,
.time-bar-col .chart-bar-fill {
  width: 100%;
  max-width: 26px;
  margin-left: auto;
  margin-right: auto;
  border-radius: 0.125rem;
  min-height: 6px;
  flex-shrink: 0;
}

.time-bar-col .chart-bar-fill {
  max-width: none;
}

#daily-bars-empty,
#time-interval-empty {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  text-align: center;
}

/* Vertical bars (daily / time interval) */
.chart-bar-fill,
.chart-bar-fill-h {
  position: relative;
  overflow: hidden;
}

.chart-bar-fill::after,
.chart-bar-fill-h::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  opacity: 0;
  transition: opacity 0.22s ease-out;
  pointer-events: none;
}

.chart-bar-fill.win {
  background: linear-gradient(180deg, var(--chart-win-gradient-from), var(--chart-win-gradient-to));
}

.chart-bar-fill.loss {
  background: linear-gradient(180deg, var(--chart-loss-gradient-from), var(--chart-loss-gradient-to));
}

.chart-bar-fill.lay {
  background: linear-gradient(180deg, var(--chart-lay-gradient-from), var(--chart-lay-gradient-to));
}

.chart-bar-fill.idle {
  background: var(--chart-idle-solid);
}

.chart-bar-fill.win::after {
  background: var(--chart-win-hover);
}

.chart-bar-fill.loss::after {
  background: var(--chart-loss-hover);
}

.chart-bar-fill.lay::after {
  background: var(--chart-lay-hover);
}

.chart-bar-fill.idle::after {
  background: color-mix(in srgb, var(--chart-idle-solid) 55%, var(--text-muted));
}

.daily-bar-col:hover .chart-bar-fill.win::after,
.time-bar-col:hover .chart-bar-fill.win::after,
.daily-bar-col:hover .chart-bar-fill.loss::after,
.time-bar-col:hover .chart-bar-fill.loss::after,
.daily-bar-col:hover .chart-bar-fill.lay::after,
.time-bar-col:hover .chart-bar-fill.lay::after,
.daily-bar-col:hover .chart-bar-fill.idle::after,
.time-bar-col:hover .chart-bar-fill.idle::after {
  opacity: 1;
}

/* Horizontal bars (market / team rows) */
.chart-bar-fill-h.win {
  background: linear-gradient(90deg, var(--chart-win-gradient-to), var(--chart-win-gradient-from));
}

.chart-bar-fill-h.loss {
  background: linear-gradient(90deg, var(--chart-loss-gradient-to), var(--chart-loss-gradient-from));
}

.chart-bar-fill-h.lay {
  background: linear-gradient(90deg, var(--chart-lay-gradient-to), var(--chart-lay-gradient-from));
}

.chart-bar-fill-h.idle {
  background: var(--chart-idle-solid);
  opacity: 0.6;
}

/* ============================================
   STAT STRIP — horizontal drag-to-scroll of summary cards
   ============================================ */
.stat-strip-wrap {
  position: relative;
  margin-bottom: 1.5rem;
  /* breathing room before the chart grid */
}

.stat-strip-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 4;
  width: 36px;
  height: 36px;
  border-radius: 9999px;
  border: 1px solid var(--border-default);
  background: var(--bg-surface-overlay);
  color: var(--text-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  transition: opacity 0.18s ease, transform 0.18s ease, background-color 0.15s ease, border-color 0.15s ease;
  opacity: 1;
}

.stat-strip-arrow:hover {
  background: var(--brand-main);
  color: var(--brand-on-main);
  border-color: var(--brand-main);
  transform: translateY(-50%) scale(1.06);
}

.stat-strip-arrow.hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateY(-50%) scale(0.85);
}

.stat-strip-arrow--prev {
  left: -10px;
}

.stat-strip-arrow--next {
  right: -10px;
}

.stat-strip-arrow .material-symbols-outlined {
  font-size: 22px;
}

/* Edge fade hints — soft mask that gradients into the page bg, signalling "more". */
.stat-strip-wrap::before,
.stat-strip-wrap::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  width: 32px;
  z-index: 3;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.18s ease;
}

.stat-strip-wrap::before {
  left: 0;
  background: linear-gradient(to right, var(--bg-base), transparent);
}

.stat-strip-wrap::after {
  right: 0;
  background: linear-gradient(to left, var(--bg-base), transparent);
}

.stat-strip-wrap.has-prev::before {
  opacity: 1;
}

.stat-strip-wrap.has-next::after {
  opacity: 1;
}

.stat-strip {
  display: flex;
  gap: 0.75rem;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  /* Firefox */
}

.stat-strip::-webkit-scrollbar {
  display: none;
}

/* Chrome/Safari */
.stat-strip__card {
  flex: 0 0 calc(25% - 0.5625rem);
  /* 4 cards visible by default on wide screens */
  min-width: 240px;
  scroll-snap-align: start;
}

@media (max-width: 900px) {
  .stat-strip__card {
    flex-basis: calc(50% - 0.375rem);
  }
}

@media (max-width: 600px) {
  .stat-strip__card {
    flex-basis: 85%;
  }
}

/* Stat card title row with info icon + custom tooltip popover. */
.stat-card-head {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 1rem;
}

.stat-card-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  cursor: help;
}

.stat-card-info {
  font-size: 14px !important;
  color: var(--text-muted);
  opacity: 0.5;
  cursor: help;
  transition: opacity 0.15s ease, color 0.15s ease;
}

.stat-card-head:hover .stat-card-info {
  opacity: 1;
  color: var(--brand-main);
}

/* Custom tooltip — opens below the title row. Instant feedback (no native
   700ms delay), styled to match the surface theme, escapes card padding via
   z-index so parent card padding/overflow doesn't clip it (cards with
   overflow-hidden are overridden via .stat-strip__card rule below). */
.stat-card-tooltip {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 50;
  width: max-content;
  max-width: 280px;
  padding: 0.55rem 0.75rem;
  background: var(--bg-surface-overlay);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-panel);
  font-size: 0.72rem;
  font-weight: 400;
  line-height: 1.45;
  text-transform: none;
  letter-spacing: 0;
  color: var(--text-primary);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity 0.12s ease, transform 0.12s ease, visibility 0s linear 0.12s;
  pointer-events: none;
}

.stat-card-head:hover .stat-card-tooltip,
.stat-card-head:focus-within .stat-card-tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  transition-delay: 0s, 0s, 0s;
}

/* Tooltip needs to escape the card bounds — disable overflow clipping on cards
   that have it (Total Profit had it from the original template). */
.stat-strip__card {
  overflow: visible !important;
}

/* Display-options block at the top of the Dashboard Design modal. */
.dash-design-options {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 0 1.25rem;
}

.dash-design-option {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.875rem;
  color: var(--text-primary);
  cursor: pointer;
  user-select: none;
}

.dash-design-option input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--brand-main);
  cursor: pointer;
}

.dash-design-divider {
  border: 0;
  border-top: 1px solid var(--border-strong);
  margin: 0.75rem 0 0.4rem;
}

.chart-bar-fill-h.win::after {
  background: var(--chart-win-hover);
}

.chart-bar-fill-h.loss::after {
  background: var(--chart-loss-hover);
}

.chart-bar-fill-h.lay::after {
  background: var(--chart-lay-hover);
}

.market-row:hover .chart-bar-fill-h.win::after,
.team-row:hover .chart-bar-fill-h.win::after,
.market-row:hover .chart-bar-fill-h.loss::after,
.team-row:hover .chart-bar-fill-h.loss::after,
.market-row:hover .chart-bar-fill-h.lay::after,
.team-row:hover .chart-bar-fill-h.lay::after {
  opacity: 1;
}

@media (prefers-reduced-motion: reduce) {

  .chart-bar-fill::after,
  .chart-bar-fill-h::after,
  #dashboard-chart-tooltip {
    transition: none;
  }

  #dashboard-chart-tooltip {
    transform: none;
  }

  #dashboard-chart-tooltip.is-visible {
    transform: none;
  }
}

.chart-bar-track-ref {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background: color-mix(in srgb, var(--text-muted) 28%, transparent);
  pointer-events: none;
  z-index: 3;
}

/* Exchange switcher — stack exchanges vertically (All / OddJusta / Oddrs),
   one per row, instead of the side-by-side preset grid. */
#exchange-popover {
  min-width: 200px;
}
#exchange-options {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
#exchange-options .header-date-preset {
  width: 100%;
  justify-content: flex-start;
  text-align: left;
}

.bank-chart-crosshair {
  stroke: color-mix(in srgb, var(--text-muted) 70%, transparent);
  stroke-width: 1;
  stroke-dasharray: 4 3;
  vector-effect: non-scaling-stroke;
  opacity: 0;
  transition: opacity 0.12s ease;
}

.bank-chart-crosshair.is-visible {
  opacity: 1;
}

.bank-chart-active-dot {
  fill: var(--chart-brand-marker);
  stroke: var(--bg-surface-raised);
  stroke-width: 2;
  filter: drop-shadow(0 0 6px var(--chart-brand-marker-glow));
  vector-effect: non-scaling-stroke;
  opacity: 0;
  transition: opacity 0.12s ease;
}

.bank-chart-active-dot.is-visible {
  opacity: 1;
}

#bank-chart-grid line {
  stroke: var(--chart-grid-line);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

#bank-chart-grid text,
#bank-chart-zero-label {
  fill: var(--chart-grid-label);
  font-size: 9px;
  font-family: inherit;
}

#bank-chart-zero-line {
  stroke: var(--chart-grid-axis);
  stroke-width: 1;
  stroke-dasharray: 5 4;
  vector-effect: non-scaling-stroke;
}

#bank-chart-path {
  stroke: url(#bank-chart-stroke-grad);
}

#bank-chart-area {
  fill: url(#bank-chart-area-grad);
}

.market-row .chart-bar-track,
.team-row .chart-bar-track {
  position: relative;
}

.market-row .chart-bar-track-ref,
.team-row .chart-bar-track-ref {
  top: 0;
  bottom: 0;
  height: 100%;
}

input[type="date"] {
  -webkit-appearance: none !important;
  appearance: none !important;
}

input[type="date"]::-webkit-calendar-picker-indicator {
  display: none !important;
  opacity: 0 !important;
  width: 0 !important;
  height: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  visibility: hidden !important;
}

input[type="date"]::-webkit-inner-spin-button,
input[type="date"]::-webkit-clear-button {
  display: none !important;
  width: 0 !important;
}

input[type="date"]::-moz-calendar-picker-indicator {
  display: none !important;
}

/* Checkboxes — custom (light + dark; evita accent azul do browser) */
input[type="checkbox"] {
  -webkit-appearance: none;
  appearance: none;
  background-color: var(--bg-surface-raised);
  border: 1px solid var(--border-strong);
  accent-color: transparent;
  cursor: pointer;
  flex-shrink: 0;
  vertical-align: middle;
}

input[type="checkbox"]:checked {
  border-color: var(--brand-main);
  background-color: var(--brand-main-fill);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none'%3E%3Cpath d='M2.5 6.2 5 8.7 9.5 3.8' stroke='%230e0d1a' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 70% 70%;
}

input[type="checkbox"]:indeterminate {
  border-color: var(--brand-main);
  background-color: var(--brand-main-fill);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none'%3E%3Cpath d='M2.5 6h7' stroke='%230e0d1a' stroke-width='1.75' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 70% 70%;
}

input[type="checkbox"]:focus-visible {
  outline: 2px solid var(--brand-main);
  outline-offset: 1px;
}

/* Modal column resize */
.modal-resizable-table {
  table-layout: fixed;
  min-width: 100%;
}

.modal-resizable-table th {
  position: relative;
  overflow: hidden;
  white-space: nowrap;
}

.modal-resizable-table td {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.modal-resizable-table .modal-col-game {
  overflow: visible;
  text-overflow: clip;
  white-space: nowrap;
}

#bar-bets-modal #bar-modal-table-wrap .modal-resizable-table thead th {
  position: sticky;
  top: 0;
  z-index: 10;
  background-color: var(--bg-surface-raised);
  box-shadow: 0 1px 0 var(--border-strong);
}

#bar-bets-modal .bar-bets-modal-header {
  border-bottom: 1px solid var(--border-strong);
}

.bar-bets-modal-toolbar {
  flex-shrink: 0;
}

.bar-bets-modal-search {
  margin-left: auto;
  max-width: 16rem;
  flex: 1 1 10rem;
  min-width: min(100%, 180px);
}

#bar-bets-modal .my-bets-filter-menu {
  z-index: 20;
}

#bar-bets-modal .modal-resizable-table tbody tr {
  border-bottom: 1px solid var(--border-strong);
}

#bar-bets-modal #bar-modal-title {
  color: var(--text-primary);
}

#assign-modal #assign-modal-title {
  color: var(--text-primary);
}

#bar-bets-modal #bar-modal-subtitle {
  color: var(--text-secondary);
}

#bar-bets-modal .modal-resizable-table thead th {
  color: var(--text-muted);
  font-size: 0.75rem;
}

.col-resize-handle {
  position: absolute;
  right: 0;
  top: 0;
  height: 100%;
  width: 5px;
  cursor: col-resize;
  user-select: none;
  z-index: 2;
  background: transparent;
  transition: background 0.15s;
}

.col-resize-handle:hover,
.col-resize-handle.dragging {
  background: color-mix(in srgb, var(--accent-sky) 35%, transparent);
}

/* View switching */
.view-panel {
  display: none;
  margin: 0;
  padding: 0;
}

.view-panel.active {
  display: block;
}

/* Bet row side tints */
.bet-back-row {
  background: var(--accent-sky-bg-subtle);
}

.bet-lay-row {
  background: var(--lay-bg-subtle);
}

/* Reusable pill */
.pill-badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 4px 12px;
  border-radius: 9999px;
  line-height: 1.6;
  white-space: nowrap;
}

.pill-side-back {
  background: var(--accent-sky-bg);
  color: var(--accent-sky);
}

.pill-side-lay {
  background: var(--lay-bg);
  color: var(--lay);
}

.text-lay {
  color: var(--lay);
}

.pill-method {
  background: var(--brand-main-bg);
  color: var(--brand-subtle);
}

.pill-tag {
  background: var(--accent-sky-bg);
  color: var(--accent-sky);
}

/* Methods & Tags — new item inputs */
#view-methods-tags input[type="text"] {
  caret-color: var(--brand-main);
  outline: none;
}

#view-methods-tags input[type="text"]:focus {
  outline: none;
  border-color: var(--brand-main);
  --tw-ring-shadow: 0 0 #0000;
  --tw-ring-offset-shadow: 0 0 #0000;
  box-shadow: 0 0 0 2px var(--brand-main-bg);
}

/* Methods & Tags list — delete on row hover */
.mt-item-row .btn-del-method,
.mt-item-row .btn-del-tag {
  opacity: 0;
  pointer-events: none;
  color: var(--text-primary);
  transition: opacity 0.15s ease, color 0.15s ease;
}

.mt-item-row:hover .btn-del-method,
.mt-item-row:hover .btn-del-tag {
  opacity: 1;
  pointer-events: auto;
}

.mt-item-row .btn-del-method:hover,
.mt-item-row .btn-del-tag:hover {
  color: var(--status-error);
}

.mt-del-icon {
  display: block;
  width: 1rem;
  height: 1rem;
}

.mt-del-icon svg {
  stroke: currentColor;
}

/* Modal backdrop */
.modal-backdrop {
  background: var(--modal-backdrop);
  backdrop-filter: blur(6px);
}

/* Modal panels — shared surface & borders */
.dash-design-panel,
.bar-bets-modal-panel,
#assign-modal .assign-modal-panel {
  background: var(--bg-surface-raised);
  border: 1px solid var(--border-strong);
}

#bar-bets-modal {
  padding: 1rem;
}

.bar-bets-modal-panel {
  width: min(var(--modal-width-lg), 100%);
  max-width: var(--modal-width-lg);
}

/* Modal body copy — 14px; table column headers stay 12px */
#assign-modal .assign-modal-panel,
#assign-modal #assign-modal-bet-info,
#assign-modal #assign-modal-list,
#bar-bets-modal #bar-modal-table-wrap,
#bar-bets-modal .modal-resizable-table {
  font-size: 0.875rem;
}

/* Team market combobox */
.ta-badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.55rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  padding: 1px 5px;
  border-radius: 9999px;
  background: color-mix(in srgb, var(--brand-main) 20%, transparent);
  color: var(--brand-subtle);
  cursor: help;
  line-height: 1.6;
  white-space: nowrap;
}

#team-market-dropdown {
  box-shadow: var(--dropdown-shadow);
}

/* My Bets — filter menus + search */
.my-bets-toolbar {
  flex-shrink: 0;
}

.my-bets-filter-menu {
  position: absolute;
  left: 0;
  top: calc(100% + 4px);
  z-index: 500;
  min-width: 10.5rem;
  padding: 0.35rem;
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-strong);
  background: var(--bg-surface);
  box-shadow: var(--dropdown-shadow);
}

.my-bets-filter-option {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.5rem 0.65rem;
  border: none;
  border-radius: var(--radius-lg);
  background: transparent;
  color: var(--text-primary);
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.my-bets-filter-option:hover {
  background: var(--overlay-subtle);
}

.my-bets-filter-option.is-active {
  background: var(--state-active-bg);
  color: var(--text-primary);
  font-weight: 600;
}

.my-bets-search {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1 1 12rem;
  min-width: min(100%, 220px);
  max-width: 22rem;
  margin-left: auto;
}

.my-bets-search-icon {
  position: absolute;
  left: 0.75rem;
  font-size: 1.125rem;
  line-height: 1;
  color: var(--text-muted);
  pointer-events: none;
}

.my-bets-search input {
  width: 100%;
  min-height: 36px;
  padding: 0.4rem 0.75rem 0.4rem 2.35rem;
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-strong);
  background: var(--bg-surface);
  color: var(--text-primary);
  caret-color: var(--brand-main);
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.25;
  box-sizing: border-box;
  outline: none;
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}

.my-bets-search input::placeholder {
  color: var(--text-muted);
  font-weight: 400;
}

.my-bets-search input:hover:not(:focus) {
  border-color: color-mix(in srgb, var(--border-strong) 55%, var(--accent-sky-bd));
  background: var(--bg-surface-raised);
}

.my-bets-search input:focus {
  border-color: var(--brand-main);
  box-shadow: 0 0 0 2px var(--brand-main-bg);
}

/* ============================================
   5. LOGIN — específico de index.html (login)
   ============================================ */
body.login-page {
  margin: 0;
  min-height: 100dvh;
  overflow-x: hidden;
}

.login-shell {
  display: grid;
  grid-template-columns: 1fr;
  min-height: 100dvh;
}

.login-panel--form {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--bg-surface);
  color: var(--text-primary);
  padding: calc(var(--spacing-6) + var(--spacing-5)) var(--spacing-6) var(--spacing-6);
  position: relative;
}

.login-panel--hero {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(to top, var(--bg-surface), var(--bg-surface-raised));
  border-top: 1px solid var(--border-strong);
  color: var(--text-primary);
  padding-top: calc(var(--spacing-6) + var(--spacing-5));
  padding-bottom: var(--spacing-6);
  padding-inline: clamp(1.75rem, 7vw, 2.5rem);
}

.login-brand {
  display: flex;
  justify-content: center;
  align-self: center;
  width: 100%;
  max-width: 22rem;
  margin-bottom: var(--spacing-6);
  flex-shrink: 0;
}

.login-brand img {
  height: 2rem;
  width: auto;
  max-width: min(100%, 220px);
}

.login-brand .app-brand-logo--light,
html.dark .login-brand .app-brand-logo--dark {
  display: block;
}

.login-main {
  flex: 0 1 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 22rem;
  margin: 0 auto;
  text-align: center;
  gap: var(--spacing-6);
}

.login-title {
  font-family: 'Manrope', sans-serif;
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 700;
  line-height: 1.15;
  margin: 0;
  color: var(--text-primary);
}

.login-error {
  width: 100%;
  padding: var(--spacing-3);
  border-radius: var(--radius-lg);
  background: var(--status-error-bg);
  border: 1px solid var(--accent-coral-bd);
  color: var(--status-error);
  font-size: 0.875rem;
  text-align: center;
}

.login-error.hidden {
  display: none;
}

.btn-brand {
  border: none;
  background: var(--brand-main-fill);
  color: var(--brand-on-main);
  font-family: 'Manrope', sans-serif;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
}

.btn-brand:hover {
  background: var(--brand-main-hover);
}

.btn-brand:active {
  transform: scale(0.98);
}

.btn-brand:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-secondary {
  border: 1px solid var(--border-strong);
  background: var(--bg-surface-high);
  color: var(--text-primary);
  font-family: 'Manrope', sans-serif;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}

.btn-secondary:hover {
  background: var(--bg-surface-raised);
  border-color: var(--border-strong);
}

.btn-secondary:active {
  transform: scale(0.98);
}

.btn-secondary:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.login-oauth-group {
  display: flex;
  flex-direction: column;
  width: 100%;
  gap: var(--spacing-3);
}

.login-btn-oauth {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-3);
  width: 100%;
  padding: 1rem 1.25rem;
  border-radius: var(--radius-xl);
  font-size: 1rem;
  line-height: 1.2;
}

.login-btn-oddjusta-icon {
  width: 1.25rem;
  height: auto;
  flex-shrink: 0;
  color: var(--brand-on-main);
}

.login-btn-oddrs-icon {
  width: 1rem;
  height: auto;
  flex-shrink: 0;
  color: var(--brand-on-main);
}

html.dark .login-btn-oddrs-icon {
  color: var(--text-primary);
}

.login-divider {
  width: 100%;
  height: 1px;
  background: var(--border-strong);
  margin: 0;
  border: none;
}

.login-dev-label {
  margin: 0;
  width: 100%;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.login-dev-form {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-3);
  width: 100%;
  text-align: left;
}

.login-dev-field {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-2);
}

.login-dev-field-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.login-dev-input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  background: var(--bg-surface-raised);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.9375rem;
  box-sizing: border-box;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.login-dev-input:hover:not(:focus) {
  background: var(--bg-surface-high);
}

.login-dev-input:focus {
  outline: 2px solid var(--brand-main);
  outline-offset: 1px;
  border-color: var(--brand-main);
}

.login-dev-btn {
  width: 100%;
  margin-top: var(--spacing-2);
  padding: 0.875rem 1.25rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xl);
  background: var(--bg-surface-raised);
  color: var(--text-primary);
  font-family: 'Manrope', sans-serif;
  font-size: 0.9375rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.login-dev-btn:hover:not(:disabled) {
  background: var(--bg-surface);
  border-color: var(--text-muted);
}

.login-dev-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.login-signup {
  margin: 0;
  font-size: 0.9375rem;
  color: var(--text-primary);
}

.login-signup a {
  color: var(--brand-main);
  font-weight: 600;
  text-decoration: none;
}

.login-signup a:hover {
  color: var(--brand-main-hover);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.login-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--spacing-4);
  margin-top: auto;
  padding-top: var(--spacing-6);
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

.login-footer-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0;
}

.login-footer-links a {
  color: var(--text-secondary);
  text-decoration: none;
  padding: 0 0.35rem;
}

.login-footer-links a:hover {
  color: var(--text-primary);
}

.login-footer-links a+a::before {
  content: '|';
  margin-right: 0.5rem;
  color: var(--text-muted);
  pointer-events: none;
}

.login-lang {
  position: relative;
  flex-shrink: 0;
}

.login-lang-trigger {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-2);
  padding: var(--spacing-1) var(--spacing-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--overlay-subtle);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.8125rem;
  line-height: 1.4;
  cursor: pointer;
  transition: background 0.15s ease;
}

.login-lang-trigger:hover {
  background: var(--overlay-medium);
}

.login-lang-icon,
.login-lang-chevron {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
  color: var(--text-secondary);
}

.login-lang-chevron {
  opacity: 0.75;
}

.login-lang-menu {
  position: absolute;
  right: 0;
  bottom: calc(100% + var(--spacing-2));
  z-index: 50;
  min-width: 9.5rem;
  margin: 0;
  padding: var(--spacing-1);
  list-style: none;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  background: var(--bg-surface-high);
  color: var(--text-primary);
  box-shadow: var(--shadow-panel);
}

.login-lang-menu.hidden {
  display: none;
}

.login-lang-menu [role='option'] {
  padding: var(--spacing-2) var(--spacing-3);
  border-radius: var(--radius-md);
  font-size: 0.8125rem;
  cursor: pointer;
}

.login-lang-menu [role='option']:hover,
.login-lang-menu [role='option'][aria-selected='true'] {
  background: var(--overlay-medium);
  color: var(--text-primary);
}

.login-hero-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  max-width: 28rem;
  padding-inline: var(--spacing-2);
  gap: var(--spacing-6);
}

.login-hero-symbol {
  width: clamp(3rem, 9.5vw, 4.35rem);
  height: auto;
}

.login-hero-headline {
  font-family: 'Manrope', sans-serif;
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700;
  line-height: 1.12;
  margin: 0;
  color: var(--text-primary);
}

.login-hero-headline em {
  font-style: normal;
  color: var(--brand-main);
}

.login-hero-subtitle {
  margin: 0;
  font-family: 'Manrope', sans-serif;
  font-size: 1.3rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-primary);
}

.login-hero-copy {
  margin: 0;
  font-size: 1rem;
  line-height: 1.55;
  color: var(--text-muted);
  text-align: center;
}

.login-hero-copy em {
  font-style: normal;
  color: var(--brand-main);
  font-weight: 600;
}

html:not(.dark) .login-panel--form {
  background: var(--bg-base);
}

html:not(.dark) .login-panel--hero {
  background: linear-gradient(to top, var(--bg-raised), var(--bg-surface-raised));
}

@media (min-width: 1024px) {
  .login-shell {
    grid-template-columns: 1fr 1fr;
  }

  .login-panel--form {
    align-items: stretch;
    padding: var(--spacing-6);
  }

  .login-brand {
    display: block;
    align-self: auto;
    width: auto;
    max-width: none;
    margin-bottom: 0;
  }

  .login-main {
    flex: 1;
  }

  .login-panel--hero {
    border-top: none;
    border-left: 1px solid var(--border-strong);
    padding: var(--spacing-6);
  }

  .login-hero-inner {
    max-width: 32rem;
    padding-inline: 0;
  }

  .login-hero-symbol {
    width: clamp(4.75rem, 12vw, 6.75rem);
  }
}

/* shadcn Skeleton — mirrors components/ui/skeleton (sizes via inline style; CDN Tailwind skips JS classes) */
.skeleton {
  display: block;
  border-radius: 0.375rem;
  background-color: color-mix(in srgb, var(--text-primary) 6%, var(--bg-muted));
  animation: skeleton-pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.skeleton-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.skeleton-chart-bars {
  display: flex;
  flex: 1 1 0;
  align-items: flex-end;
  align-self: stretch;
  width: 100%;
  min-height: 0;
  height: 100%;
  gap: 0.25rem;
}

.skeleton-chart-bar-col {
  display: flex;
  flex: 1 1 0;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-end;
  min-width: 0;
  height: 100%;
  align-self: stretch;
}

/* Bank Result — line-chart shaped skeleton (hidden via display, not Tailwind .hidden) */
.bank-chart-skeleton {
  display: none;
}

.bank-chart-skeleton.is-visible {
  display: block;
}

.bank-chart-skeleton-area {
  fill: var(--chart-brand-area-from);
  animation: skeleton-pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.bank-chart-skeleton-line {
  stroke: var(--chart-brand-stroke);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
  animation: skeleton-pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes skeleton-pulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.45;
  }
}

/* ============================================
   DASHBOARD DESIGN MODAL
   ============================================ */
.dash-design-modal {
  position: fixed;
  inset: 0;
  z-index: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.dash-design-modal.hidden {
  display: none;
}

.dash-design-backdrop {
  position: absolute;
  inset: 0;
  background: var(--modal-backdrop);
  backdrop-filter: blur(4px);
}

.dash-design-panel {
  position: relative;
  z-index: 1;
  width: min(var(--modal-width-md), 100%);
  max-height: min(80vh, 720px);
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-panel);
  overflow: hidden;
}

.dash-design-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-strong);
}

.dash-design-title {
  margin: 0;
  font-family: 'Manrope', sans-serif;
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-primary);
}

.dash-design-close {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-md);
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.dash-design-close:hover {
  background: var(--bg-surface-high);
  color: var(--text-primary);
}

.dash-design-hint {
  padding: 0.75rem 1.25rem;
  margin: 0;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.dash-design-list {
  list-style: none;
  margin: 0;
  padding: 0.25rem 0.75rem 0.75rem;
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.dash-design-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 0.7rem;
  background: var(--bg-surface-raised);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: grab;
  user-select: none;
  transition: background-color 0.15s ease, border-color 0.15s ease, opacity 0.15s ease;
}

.dash-design-item:hover {
  background: var(--bg-surface-high);
  border-color: var(--border-strong);
}

.dash-design-item.is-dragging {
  opacity: 0.4;
  cursor: grabbing;
}

.dash-design-item.is-drop-target {
  border-color: var(--brand-main);
  background: var(--state-hover-bg);
}

.dash-design-item.is-hidden {
  opacity: 0.55;
}

.dash-design-item.is-hidden .dash-design-name {
  text-decoration: line-through;
  color: var(--text-muted);
}

.dash-design-handle {
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1;
  flex-shrink: 0;
}

.dash-design-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dash-design-toggle {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-default);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.15s ease, color 0.15s ease;
  flex-shrink: 0;
}

.dash-design-toggle:hover {
  background: var(--bg-surface-high);
  color: var(--text-primary);
}

.dash-design-toggle .material-symbols-outlined {
  font-size: 16px;
}

.dash-design-footer {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  border-top: 1px solid var(--border-strong);
}

.dash-design-btn {
  padding: 0.5rem 0.95rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-default);
  background: transparent;
  color: var(--text-primary);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.dash-design-btn:hover {
  background: var(--bg-surface-high);
}

.dash-design-btn--primary {
  background: var(--brand-main-fill);
  border-color: transparent;
  color: var(--brand-on-main);
}

.dash-design-btn--primary:hover {
  background: var(--brand-main-hover);
}

/* ============================================
   ODDS CONFIG POPOVER (Intervals button on the Odds card)
   Mirrors the date popover styling so the surface is opaque and contrast holds in both themes.
   ============================================ */
.odds-config-popover {
  position: absolute;
  right: 0;
  top: 100%;
  margin-top: 0.25rem;
  z-index: 500;
  width: 18rem;
  padding: 0.85rem;
  border-radius: var(--radius-xl);
  background: var(--bg-surface-overlay);
  border: 1px solid var(--border-default);
  box-shadow: var(--dropdown-shadow);
  color: var(--text-primary);
}

.odds-config-popover.hidden {
  display: none;
}

.odds-config-label {
  display: block;
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: 0.3rem;
}

/* Chrome (and several other Chromium browsers) paint <input type="text"> with
   a white background in dark mode unless we explicitly opt out of the native
   widget. The date popover gets away without this because <input type="date">
   is treated as a custom widget already. !important defeats the UA stylesheet. */
.odds-config-input {
  width: 100%;
  height: 36px;
  padding-inline: 0.625rem;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  background-color: var(--bg-surface-raised) !important;
  color: var(--text-primary) !important;
  -webkit-text-fill-color: var(--text-primary);
  caret-color: var(--brand-main);
  font-size: 0.875rem;
  font-weight: 500;
  outline: none;
  appearance: none !important;
  -webkit-appearance: none !important;
  transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.odds-config-input:hover:not(:focus) {
  background-color: var(--bg-surface-high) !important;
}

.odds-config-input::placeholder {
  color: var(--text-muted);
  opacity: 1;
}

.odds-config-input:focus {
  border-color: var(--brand-main);
  box-shadow: 0 0 0 2px var(--brand-main-bg);
}

/* Override Chrome/Edge autofill: keep our bg + text colour instead of pale yellow. */
.odds-config-input:-webkit-autofill,
.odds-config-input:-webkit-autofill:hover,
.odds-config-input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--text-primary);
  -webkit-box-shadow: 0 0 0 1000px var(--bg-surface-raised) inset;
  caret-color: var(--brand-main);
}

.odds-config-input:-webkit-autofill:hover:not(:focus) {
  -webkit-box-shadow: 0 0 0 1000px var(--bg-surface-high) inset;
}

.odds-config-hint {
  margin: 0.4rem 0 0;
  font-size: 0.7rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.odds-config-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.odds-config-actions__right {
  display: flex;
  gap: 0.375rem;
}

/* ============================================
   P&L CALENDAR — full page view
   ============================================ */
#view-pl-calendar .dash-card {
  width: 100%;
  max-width: 56rem;
  margin-left: auto;
  margin-right: auto;
}

.pl-cal-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.pl-cal-monthnav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.pl-cal-month-label {
  font-family: 'Manrope', sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0;
  color: var(--text-primary);
  min-width: 9rem;
  text-align: center;
  text-transform: capitalize;
}

.pl-cal-nav-btn,
.pl-cal-today-btn {
  height: 32px;
  padding: 0 0.7rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-default);
  background: var(--bg-surface-raised);
  color: var(--text-primary);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
}

.pl-cal-nav-btn {
  width: 32px;
  padding: 0;
}

.pl-cal-nav-btn:hover,
.pl-cal-today-btn:hover {
  background: var(--bg-surface-high);
  border-color: var(--border-strong);
}

.pl-cal-nav-btn svg,
.pl-cal-nav-btn .lucide {
  width: 16px;
  height: 16px;
}

.pl-cal-mode {
  display: inline-flex;
  background: var(--bg-surface-raised);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: 2px;
  gap: 2px;
}

.pl-cal-mode-btn {
  padding: 0.35rem 0.7rem;
  border: 0;
  border-radius: calc(var(--radius-md) - 2px);
  background: transparent;
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.pl-cal-mode-btn:hover {
  color: var(--text-primary);
}

.pl-cal-mode-btn.is-active {
  background: var(--brand-main-fill);
  color: var(--brand-on-main);
}

.pl-cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.5rem;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  text-align: center;
  padding: 0 0.25rem;
}

.pl-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.5rem;
}

.pl-cal-day {
  position: relative;
  aspect-ratio: 6 / 5;
  border-radius: 0.875rem;
  padding: 0.45rem 0.6rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  transition: transform 0.12s ease, filter 0.12s ease;
  overflow: hidden;
  background: var(--bg-surface-raised);
  border: 1px solid var(--border-default);
}

.pl-cal-day:hover {
  transform: translateY(-1px);
  filter: brightness(1.08);
}

.pl-cal-day--out-of-month {
  opacity: 0.25;
  pointer-events: none;
}

.pl-cal-day__num {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  line-height: 1;
}

.pl-cal-day__val {
  font-family: 'Manrope', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.1;
  margin-top: auto;
  /* Keep value on one line — long numbers now use compact "k" suffix instead. */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Color states use existing chart tokens; intensity scales fill opacity
   (set inline via --pl-intensity 0–1) so larger absolute values render brighter. */
.pl-cal-day--win {
  background: color-mix(in srgb,
      var(--chart-win-gradient-to) calc(var(--pl-intensity, 1) * 100%),
      var(--bg-surface-raised));
  border-color: color-mix(in srgb, var(--chart-win-gradient-to) 60%, transparent);
  color: var(--text-primary);
}

.pl-cal-day--loss {
  background: color-mix(in srgb,
      var(--chart-loss-gradient-to) calc(var(--pl-intensity, 1) * 100%),
      var(--bg-surface-raised));
  border-color: color-mix(in srgb, var(--chart-loss-gradient-to) 60%, transparent);
  color: var(--text-primary);
}

.pl-cal-day--win .pl-cal-day__num,
.pl-cal-day--loss .pl-cal-day__num {
  color: var(--text-primary);
  opacity: 0.7;
}

.pl-cal-day--idle {
  /* No bets that day — show stakemonkey symbol watermark. */
  background-image: url('/assets/stakemonkey-symbol-dark.svg');
  background-position: center;
  background-repeat: no-repeat;
  background-size: 38% auto;
  opacity: 0.55;
}

html.dark .pl-cal-day--idle {
  background-image: url('/assets/stakemonkey-symbol-light.svg');
  opacity: 0.35;
}

.pl-cal-day--today {
  outline: 2px solid var(--brand-main);
  outline-offset: -2px;
}

.pl-cal-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-strong);
  font-size: 0.78rem;
}

.pl-cal-summary__item {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.pl-cal-summary__label {
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.pl-cal-summary__value {
  font-family: 'Manrope', sans-serif;
  font-weight: 700;
  color: var(--text-primary);
}

.pl-cal-summary__value.pos {
  color: var(--chart-win-hover);
}

.pl-cal-summary__value.neg {
  color: var(--chart-loss-hover);
}

@media (max-width: 600px) {
  .pl-cal-day {
    padding: 0.35rem 0.4rem;
    border-radius: 0.6rem;
  }

  .pl-cal-day__num {
    font-size: 0.6rem;
  }

  .pl-cal-day__val {
    font-size: 0.7rem;
  }
}