/* Design di riferimento: grigio caldo, inchiostro come unico colore d'azione,
   pillole, hairline al posto delle ombre. Scostamenti voluti: nessuna
   decorazione a gradiente (e' un tool operativo); verde/rosso/grigio muto
   scuriti di un gradino per il contrasto AA del testo su bianco. */

@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("fonts/inter-latin.woff2") format("woff2");
  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; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("fonts/inter-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Geist"; font-style: normal; font-weight: 400 600; font-display: swap;
  src: url("fonts/geist-latin.woff2") format("woff2");
  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; }
@font-face { font-family: "Geist"; font-style: normal; font-weight: 400 600; font-display: swap;
  src: url("fonts/geist-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  --font-display: "Geist", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  --bg: #F5F5F5; --surface: #FFFFFF; --surface-2: #F0EFED; --border: #E7E5E4; --border-strong: #D6D3D1;
  --text: #292524; --text-ink: #0C0A09; --text-muted: #6A645D;
  --accent: #292524; --accent-active: #0C0A09; --accent-fg: #FFFFFF; --accent-soft: #F0EFED;
  --positive: #15803D; --positive-soft: #E6F4EA; --negative: #B91C1C; --negative-soft: #FBE9E9;
  --warning: #92400E; --warning-soft: #FBF0DC;
  --shadow: none; --shadow-hover: 0 4px 16px rgba(0,0,0,.04);

  --tblr-font-sans-serif: var(--font-body);
  --tblr-body-font-family: var(--font-body);
  --tblr-body-bg: var(--bg); --tblr-body-color: var(--text);
  --tblr-bg-surface: var(--surface); --tblr-bg-surface-secondary: var(--surface-2);
  --tblr-bg-surface-tertiary: var(--surface-2); --tblr-bg-forms: var(--surface);
  --tblr-border-color: var(--border); --tblr-border-color-translucent: var(--border);
  --tblr-secondary: var(--text-muted); --tblr-secondary-color: var(--text-muted);
  --tblr-muted: var(--text-muted);
  --tblr-primary: #292524; --tblr-primary-rgb: 41,37,36; --tblr-primary-fg: #FFFFFF; --tblr-primary-darken: #0C0A09;
  --tblr-link-color: var(--text-ink); --tblr-link-color-rgb: 12,10,9;
  --tblr-link-hover-color: var(--text); --tblr-link-hover-color-rgb: 41,37,36;
  --tblr-border-radius: 8px; --tblr-border-radius-sm: 6px; --tblr-border-radius-lg: 16px;
  --tblr-border-radius-pill: 999px;
  --tblr-navbar-bg: var(--bg);
}
[data-bs-theme="dark"] {
  --bg: #0C0A09; --surface: #1C1917; --surface-2: #292524; --border: #2E2926; --border-strong: #44403C;
  --text: #E7E5E4; --text-ink: #FAFAF9; --text-muted: #A8A29E;
  --accent: #FAFAF9; --accent-active: #FFFFFF; --accent-fg: #0C0A09; --accent-soft: #292524;
  --positive: #4ADE80; --positive-soft: rgba(74,222,128,.12); --negative: #F87171; --negative-soft: rgba(248,113,113,.12);
  --warning: #E0B24A; --warning-soft: rgba(224,178,74,.12);
  --shadow: none; --shadow-hover: 0 4px 16px rgba(0,0,0,.35);

  --tblr-primary: #FAFAF9; --tblr-primary-rgb: 250,250,249; --tblr-primary-fg: #0C0A09; --tblr-primary-darken: #FFFFFF;
  --tblr-link-color: var(--text-ink); --tblr-link-color-rgb: 250,250,249;
  --tblr-link-hover-color: var(--text); --tblr-link-hover-color-rgb: 231,229,228;
}

body { font-family: var(--font-body); background: var(--bg); color: var(--text); letter-spacing: .01em; }
.navbar, .navbar-vertical { background: var(--bg); }
.navbar-vertical { box-shadow: inset -1px 0 0 0 var(--border); }
.navbar-vertical .navbar-nav .nav-link { justify-content: flex-start; text-align: left; font-weight: 500; font-size: 14px; color: var(--text); border-radius: 999px; margin: 1px 10px; padding-left: 12px; }
.navbar-vertical .navbar-nav .nav-link:hover { background: var(--surface-2); }
.navbar-vertical .navbar-nav .nav-item.active > .nav-link { background: var(--surface-2); color: var(--text-ink); }
.navbar-vertical .navbar-nav .nav-item.active::after { display: none; }
.navbar-brand a { color: var(--text-ink); font-weight: 500; }

.btn { border-radius: 999px; font-weight: 500; }
.btn-primary { --tblr-btn-bg: var(--accent); --tblr-btn-color: var(--accent-fg); --tblr-btn-hover-bg: var(--accent-active); --tblr-btn-hover-color: var(--accent-fg); --tblr-btn-active-bg: var(--accent-active); --tblr-btn-border-color: transparent; box-shadow: none; }
.btn-outline-primary, .btn-outline-secondary, .btn-secondary { --tblr-btn-bg: transparent; --tblr-btn-color: var(--text-ink); --tblr-btn-border-color: var(--border-strong); --tblr-btn-hover-bg: var(--surface-2); --tblr-btn-hover-color: var(--text-ink); --tblr-btn-hover-border-color: var(--border-strong); box-shadow: none; }
.form-control, .form-select { border-radius: 8px; background: var(--surface); border-color: var(--border-strong); color: var(--text); box-shadow: none; }
.form-control:focus, .form-select:focus { border-color: var(--text-ink); box-shadow: 0 0 0 1px var(--text-ink); }
.card { border-radius: 16px; border-color: var(--border); box-shadow: none; background: var(--surface); }
.card-link:hover, .card.card-link:hover { box-shadow: var(--shadow-hover); }
.dropdown-menu { border-radius: 12px; border: 1px solid var(--border); background: var(--surface); box-shadow: var(--shadow-hover); }
.page-title { font-family: var(--font-display); font-weight: 500; font-size: 28px; line-height: 1.15; letter-spacing: -.02em; color: var(--text-ink); }
a:focus-visible, button:focus-visible, .btn:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid var(--text-ink); outline-offset: 2px; }

.geko-logo-dark { display: none; }
.geko-logo-light { display: inline-block; }
[data-bs-theme="dark"] .geko-logo-dark { display: inline-block; }
[data-bs-theme="dark"] .geko-logo-light { display: none; }

code, .mono { font-family: "Cascadia Code", "SF Mono", Consolas, monospace; }
section { display: flex; flex-direction: column; gap: 10px; margin-bottom: 28px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.section-head h2 { margin: 0; font-family: var(--font-display); font-size: 19px; font-weight: 500; line-height: 1.25; letter-spacing: -.01em; color: var(--text-ink); }
.section-head .tag { font-size: 11px; font-weight: 500; color: var(--text-muted); background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; padding: 2px 9px; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow); overflow: hidden; }
.table-scroll { overflow-x: auto; max-height: 520px; overflow-y: auto; }
.panel table { width: 100%; border-collapse: collapse; font-size: 13px; }
.panel thead th { position: sticky; top: 0; text-align: left; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); font-weight: 600; padding: 10px 12px; background: var(--surface); border-bottom: 1px solid var(--border-strong); white-space: nowrap; }
.panel tbody td { padding: 8px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; font-variant-numeric: tabular-nums; }
.panel tbody tr:last-child td { border-bottom: none; }
.panel tbody tr:hover td { background: var(--bg); }
td.num, th.num { font-variant-numeric: tabular-nums; }
.exch { font-weight: 600; }
.exch.bybit { color: #A8730A; } .exch.binance { color: #8A6E00; } .exch.okx { color: #1B6FD1; }
[data-bs-theme="dark"] .exch.bybit { color: #F5B93D; } [data-bs-theme="dark"] .exch.binance { color: #E3C34A; } [data-bs-theme="dark"] .exch.okx { color: #5FA8F5; }
.badge-custom { display: inline-flex; font-weight: 600; font-size: 11.5px; padding: 2px 9px; border-radius: 999px; background: var(--positive-soft); color: var(--positive); font-variant-numeric: tabular-nums; }
.badge-custom.warn { background: var(--warning-soft); color: var(--warning); }
.badge-custom.off { background: var(--surface-2); color: var(--text-muted); }
.badge-custom.accent { background: var(--accent-soft); color: var(--text-ink); }
.muted { color: var(--text-muted); }
.empty { padding: 20px; color: var(--text-muted); font-size: 13px; text-align: center; }
.run-cycle-btn { background: var(--accent); color: var(--accent-fg); border: none; border-radius: 999px; padding: 10px 20px; font-size: 14px; font-weight: 500; cursor: pointer; white-space: nowrap; }
.run-cycle-btn:hover { background: var(--accent-active); }
.classify-form { display: flex; gap: 4px; align-items: center; flex-wrap: nowrap; }
.classify-form select, .classify-form input {
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: 8px;
  padding: 4px 8px; font-size: 12px; color: var(--text); font-family: inherit;
}
.classify-form input[name="specific_provider"] { width: 130px; }
.classify-form input[name="inferred_country"] { width: 48px; text-transform: uppercase; }
.classify-form button {
  background: var(--accent); color: var(--accent-fg); border: none; border-radius: 999px;
  padding: 4px 12px; font-size: 12px; font-weight: 500; cursor: pointer;
}
.classify-form button:hover { background: var(--accent-active); }
.retry-btn, .exclude-btn, .readmit-btn {
  background: transparent; border: 1px solid var(--border-strong); color: var(--text-ink);
  border-radius: 999px; padding: 4px 12px; font-size: 12px; font-weight: 500; cursor: pointer;
}
.retry-btn { color: var(--warning); border-color: var(--warning); }
.exclude-btn { color: var(--negative); border-color: var(--negative); }
.readmit-btn { color: var(--positive); border-color: var(--positive); }
.retry-btn:hover { background: var(--warning-soft); }
.exclude-btn:hover { background: var(--negative-soft); }
.readmit-btn:hover { background: var(--positive-soft); }
.grid-save-bar { padding: 12px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; }
input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; }
.exch-link { text-decoration: none; color: var(--text-ink); font-weight: 500; border-bottom: 1px solid var(--border-strong); }
.exch-link:hover { border-bottom-color: var(--text-ink); }

/* --- Condiviso con Arbitraggi (ex index.html) --- */
.live-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--positive); margin-right: 6px; }
.stat-strip { display: grid; grid-template-columns: repeat(7, 1fr); gap: 10px; margin-bottom: 20px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; box-shadow: var(--shadow); transition: box-shadow .15s; }
.stat:hover { box-shadow: var(--shadow-hover); }
.stat .label { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); font-weight: 600; }
.stat .value { font-family: var(--font-display); font-size: 28px; font-weight: 500; line-height: 1.15; letter-spacing: -.02em; margin-top: 4px; color: var(--text-ink); font-variant-numeric: lining-nums tabular-nums; }
.stat .value.accent { color: var(--text-ink); }
.stat .value.positive { color: var(--positive); }
.stat .value.negative { color: var(--negative); }
.stat .value.warn { color: var(--warning); }
@media (max-width: 900px) { .stat-strip { grid-template-columns: repeat(3, 1fr); } }

.filter-bar {
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px;
  padding: 14px 18px; box-shadow: var(--shadow); margin-bottom: 20px;
  display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap;
}
.filter-field { display: flex; flex-direction: column; gap: 4px; }
.filter-field label { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); font-weight: 600; }
.filter-field select, .filter-field input {
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: 8px;
  padding: 7px 10px; font-size: 13.5px; color: var(--text); min-width: 110px;
  font-family: inherit;
}
.filter-bar button.apply-btn {
  background: var(--accent); color: var(--accent-fg); border: none; border-radius: 999px;
  padding: 9px 20px; font-size: 14px; font-weight: 500; cursor: pointer;
}
.filter-bar button.apply-btn:hover { background: var(--accent-active); }
.filter-bar a.reset { font-size: 12.5px; color: var(--text-muted); text-decoration: none; padding-bottom: 8px; }
.filter-bar a.reset:hover { text-decoration: underline; }
.checkbox-field {
  display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text);
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: 8px;
  padding: 7px 10px; cursor: pointer; white-space: nowrap;
}

.group-row td { background: var(--surface-2); font-weight: 600; font-size: 11px; letter-spacing: .06em; padding: 6px 12px; }
.side-buy { color: var(--positive); font-weight: 600; font-size: 11px; letter-spacing: .04em; }
.side-sell { color: var(--negative); font-weight: 600; font-size: 11px; letter-spacing: .04em; }
/* max-width 2026-09-15: senza un tetto, un singolo evento con un
   elenco lungo di paesi/metodi (es. Wise su molte regioni, o un
   annuncio 'generic' che accetta molti metodi) allargava l'INTERA
   colonna in ogni riga della tabella (table-layout:auto la dimensiona
   sul contenuto più largo trovato) — Arbitraggi (fino a 150 righe)
   soffriva più di Home (solo le prime 8) semplicemente per probabilità
   di incontrare un caso estremo. Col tetto, il testo va a capo invece
   di allargare la colonna, stessa larghezza ovunque usi questa classe. */
.leg { display: flex; flex-direction: column; gap: 1px; white-space: normal; min-width: 170px; max-width: 260px; }
.pm { font-size: 11px; color: var(--text-muted); }

/* Colonne a larghezza fissa (2026-09-14) — quando più tabelle indipendenti
   con le stesse colonne sono impilate (es. Nations "Top 3 chiuse", una
   tabella per finestra 24h/7gg/30gg), il layout automatico calcola le
   larghezze in base al SOLO contenuto di ciascuna tabella: una "Durata"
   molto più lunga in una finestra (es. "368h 54m" vs "11h 5m") sposta le
   colonne Spread/Picco a posizioni diverse da un pannello all'altro. Con
   larghezze fisse coerenti, le percentuali restano allineate verticalmente
   tra i pannelli. */
.fixed-cols { table-layout: fixed; }
.fixed-cols th:nth-child(1), .fixed-cols td:nth-child(1) { width: 16%; }
.fixed-cols th:nth-child(2), .fixed-cols td:nth-child(2) { width: 22%; }
.fixed-cols th:nth-child(3), .fixed-cols td:nth-child(3) { width: 18%; }
.fixed-cols th:nth-child(4), .fixed-cols td:nth-child(4) { width: 18%; }
.fixed-cols th:nth-child(5), .fixed-cols td:nth-child(5) { width: 26%; }
.country { font-size: 11px; color: var(--text-muted); font-weight: 600; }
.status-open { color: var(--positive); font-weight: 600; font-size: 11px; letter-spacing: .04em; }
.status-closed { color: var(--text-muted); font-weight: 600; font-size: 11px; letter-spacing: .04em; }
.merchant-badge {
  display: inline-flex; align-items: center; font-size: 10px; font-weight: 600;
  padding: 1px 7px; border-radius: 999px; margin-left: 4px;
  background: var(--positive-soft); color: var(--positive);
}
