/* arbit design tokens and components — shared by every page */
:root {
  --bg: #0a0d12; --bg-2: #0d1117;
  --panel: #11161e; --panel-2: #161c26; --panel-3: #1c2330;
  --line: #1f2733; --line-2: #2a3341;
  --ink: #e8edf4; --ink-2: #c3ccd8; --dim: #8a96a8; --faint: #5c6879;
  --profit: #2fd18b; --profit-ink: #04170e; --profit-soft: rgba(47,209,139,.11); --profit-line: rgba(47,209,139,.38);
  --near: #f2b544; --near-soft: rgba(242,181,68,.11); --near-line: rgba(242,181,68,.35);
  --danger: #f2615c; --danger-soft: rgba(242,97,92,.11); --danger-line: rgba(242,97,92,.4);
  --accent: #5b9dff; --accent-soft: rgba(91,157,255,.13);
  --radius: 12px; --radius-sm: 8px; --ctl: 34px;
  --shadow: 0 10px 30px rgba(0,0,0,.35);
  --sans: "Inter", -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 14px/1.5 var(--sans); overflow-x: hidden; -webkit-font-smoothing: antialiased; font-feature-settings: "cv11", "tnum"; }
a { color: var(--accent); }
button, input, select, textarea { font: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
::selection { background: var(--accent-soft); }
.mono { font-family: var(--mono); }
.dim { color: var(--dim); }
.faint { color: var(--faint); }

/* top bar */
.top { display: flex; align-items: center; gap: 20px; padding: 0 24px; height: 60px; position: sticky; top: 0; z-index: 10;
       background: rgba(10,13,18,.86); backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-weight: 700; font-size: 16px; letter-spacing: -.015em; }
.brand .mark { width: 30px; height: 30px; border-radius: 9px; background: linear-gradient(140deg, #3be7a0, #129a63); display: grid; place-items: center; flex: none;
               box-shadow: 0 4px 16px rgba(47,209,139,.28), inset 0 1px 0 rgba(255,255,255,.25); }
.brand .mark svg { width: 17px; height: 17px; }
.nav { display: flex; gap: 4px; }
.nav a { color: var(--dim); text-decoration: none; padding: 6px 12px; border-radius: 8px; font-weight: 500; font-size: 13.5px; }
.nav a:hover { color: var(--ink); background: var(--panel-2); }
.nav a.on { color: var(--ink); background: var(--panel-3); }
.nav a { display: inline-flex; align-items: center; gap: 7px; }
.tabs a.tablink { display: inline-flex; align-items: center; gap: 7px; color: var(--dim); text-decoration: none; padding: 10px 14px; font-weight: 600; font-size: 13.5px; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a.tablink:hover { color: var(--ink); }
.nav .badge, .tabs .badge { min-width: 19px; height: 19px; padding: 0 6px; border-radius: 99px; background: var(--danger); color: #fff; font-size: 11px; font-weight: 700;
              display: inline-grid; place-items: center; line-height: 1; font-family: var(--mono); box-shadow: 0 0 0 2px var(--bg); }

/* scrolling lists with a search box */
.scroll { max-height: 62vh; overflow: auto; }
input.find { width: 230px; }
@media (max-width: 700px) { input.find { width: 100%; } }
.top .right { margin-left: auto; display: flex; align-items: center; gap: 10px; color: var(--dim); font-size: 13px; }
.status { display: inline-flex; align-items: center; gap: 8px; height: var(--ctl); padding: 0 12px; border: 1px solid var(--line); border-radius: 99px; background: var(--panel); font-size: 12px; font-weight: 500; white-space: nowrap; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--danger); flex: none; }
.dot.ok { background: var(--profit); box-shadow: 0 0 0 3px var(--profit-soft); animation: breathe 2.4s ease-in-out infinite; }
@keyframes breathe { 50% { box-shadow: 0 0 0 5px rgba(47,209,139,.05); } }
.bell { display: inline-flex; align-items: center; gap: 8px; height: var(--ctl); padding: 0 13px 0 11px; border: 1px solid var(--line); border-radius: 99px; background: var(--panel); color: var(--ink); cursor: pointer; font-size: 12.5px; font-weight: 500; white-space: nowrap; }
.bell:hover { border-color: var(--line-2); background: var(--panel-2); }
.bell svg { width: 16px; height: 16px; }
.bell .off, .bell.muted .on { display: none; }
.bell.muted { color: var(--dim); }
.bell.muted .off { display: inline; }
.bell.ring { color: var(--profit); border-color: var(--profit-line); background: var(--profit-soft); animation: ring .6s ease-in-out 2; }
@keyframes ring { 20% { transform: rotate(-8deg); } 40% { transform: rotate(8deg); } 60% { transform: rotate(-4deg); } 80% { transform: rotate(4deg); } }
@media (prefers-reduced-motion: reduce) { .bell.ring { animation: none; } }
.user { display: inline-flex; align-items: center; gap: 8px; height: var(--ctl); padding: 0 12px 0 3px; border: 1px solid var(--line); border-radius: 99px; background: var(--panel); color: var(--ink); text-decoration: none; font-weight: 500; font-size: 13px; }
.user:hover { border-color: var(--line-2); background: var(--panel-2); }
.avatar { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(140deg, #4f6bff, #2a3c9e); color: #fff; font-size: 12px; font-weight: 700; text-transform: uppercase; }

/* layout */
main { padding: 18px 24px 48px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.section { padding: 16px 18px; }
h2 { font-size: 15px; font-weight: 600; margin: 0 0 12px; letter-spacing: -.01em; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.spacer { flex: 1; }

/* KPIs */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 12px; }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px 15px; min-width: 0; }
.kpi.hl { border-color: var(--profit-line); background: linear-gradient(160deg, rgba(47,209,139,.09), transparent 55%), var(--panel); }
.kpi .l { color: var(--dim); font-size: 12px; font-weight: 500; }
.kpi .n { font-family: var(--mono); font-size: 26px; font-weight: 600; line-height: 1.15; margin-top: 6px; letter-spacing: -.02em; }
.kpi .n.win { color: var(--profit); }

/* controls */
.filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 14px 16px; padding: 14px 16px; margin-bottom: 12px; }
.fl { display: flex; flex-direction: column; gap: 6px; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); }
input[type=text], input[type=number], input[type=password], input[type=search], input[type=datetime-local], select, textarea {
  height: var(--ctl); background: var(--bg-2); color: var(--ink); border: 1px solid var(--line-2); border-radius: var(--radius-sm); padding: 0 10px; font-size: 13px; }
textarea { height: 70px; padding: 8px 10px; resize: vertical; }
input:hover, select:hover, textarea:hover { border-color: #374254; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input[type=number] { width: 92px; font-family: var(--mono); }
.seg { display: inline-flex; height: var(--ctl); padding: 3px; gap: 2px; background: var(--bg-2); border: 1px solid var(--line-2); border-radius: var(--radius-sm); }
.seg button { background: none; border: none; color: var(--dim); padding: 0 12px; border-radius: 6px; cursor: pointer; font-size: 13px; font-weight: 500; text-transform: none; letter-spacing: 0; white-space: nowrap; }
.seg button:hover { color: var(--ink); }
.seg button.on { background: var(--panel-3); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.35), inset 0 0 0 1px var(--line-2); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; text-transform: none; letter-spacing: 0; }
.chips button { display: inline-flex; align-items: center; gap: 7px; height: 30px; background: var(--bg-2); border: 1px solid var(--line-2); color: var(--ink-2); border-radius: 99px; padding: 0 12px 0 5px; cursor: pointer; font-size: 12.5px; font-weight: 500; text-transform: none; }
.chips button.plain { padding: 0 12px; }
.chips button:hover { border-color: #374254; color: var(--ink); }
.chips button.on { color: var(--ink); background: var(--accent-soft); border-color: var(--accent); }
.chips button.off { color: var(--faint); text-decoration: line-through; text-decoration-thickness: 2px; text-decoration-color: var(--danger); background: var(--bg-2); border-color: var(--line); }
.chips button.off .logo { opacity: .35; filter: grayscale(1); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: var(--ctl); padding: 0 14px; border-radius: var(--radius-sm); border: 1px solid var(--line-2);
       background: var(--panel-2); color: var(--ink); cursor: pointer; font-size: 13px; font-weight: 600; white-space: nowrap; text-decoration: none; }
.btn:hover:not(:disabled) { background: var(--panel-3); border-color: #374254; }
.btn:disabled { opacity: .5; cursor: default; }
.btn.primary { background: var(--profit); border-color: var(--profit); color: var(--profit-ink); }
.btn.primary:hover:not(:disabled) { background: #3fe39b; }
.btn.danger { color: var(--danger); border-color: var(--danger-line); background: none; }
.btn.danger:hover:not(:disabled) { background: var(--danger-soft); }
.btn.small { height: 28px; padding: 0 10px; font-size: 12px; }

/* tables */
.wrap { overflow-x: auto; }
table { width: 100%; border-collapse: separate; border-spacing: 0; }
thead th { position: sticky; top: 0; z-index: 1; background: var(--panel-2); color: var(--faint); font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
           text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
thead th[data-sort] { cursor: pointer; user-select: none; }
thead th[data-sort]:hover { color: var(--ink-2); }
tbody td { padding: 10px 14px; vertical-align: middle; border-bottom: 1px solid var(--line); }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: rgba(255,255,255,.018); }
td.num, th.num { text-align: right; font-family: var(--mono); }
.empty { text-align: center; color: var(--dim); padding: 40px 14px !important; }

/* board */
.pct { display: inline-flex; align-items: center; font-family: var(--mono); font-size: 16px; font-weight: 700; line-height: 1; padding: 6px 10px; border-radius: 8px;
       color: var(--profit); background: var(--profit-soft); box-shadow: inset 0 0 0 1px var(--profit-line); }
.match { font-weight: 600; line-height: 1.35; }
.match .vs { color: var(--faint); font-weight: 500; margin: 0 4px; }
.comp { color: var(--dim); font-size: 12px; margin-top: 2px; }
.comp .sport { text-transform: capitalize; color: var(--ink-2); }
.when, .age { font-family: var(--mono); font-size: 12.5px; color: var(--dim); white-space: nowrap; }
.legs { display: grid; grid-template-columns: minmax(7.5em, max-content) minmax(10.5em, max-content) minmax(4.2em, max-content) 3em; gap: 5px 12px; align-items: center; justify-content: start; }
.legs .odds { justify-self: end; }
.readage { font-family: var(--mono); font-size: 11.5px; white-space: nowrap; }
.readage.fresh { color: var(--profit); }
.readage.aging { color: var(--near); }
.readage.old { color: var(--danger); }
.legs .out { color: var(--dim); font-size: 12.5px; white-space: nowrap; }
.odds { font-family: var(--mono); font-weight: 700; font-size: 14px; }
a.golink { color: var(--ink); text-decoration: none; border-bottom: 1px dashed var(--line-2); white-space: nowrap; }
a.golink:hover { color: var(--accent); border-bottom-color: var(--accent); }
a.golink .go { font-size: 11px; margin-left: 3px; color: var(--accent); }
.book { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; white-space: nowrap; }
.logo { width: 22px; height: 22px; border-radius: 6px; display: inline-grid; place-items: center; flex: none; font-style: normal;
        font-size: 11px; font-weight: 700; color: #0a0d12; text-transform: uppercase; box-shadow: inset 0 -2px 0 rgba(0,0,0,.18); }
.chips .logo { width: 18px; height: 18px; border-radius: 50%; font-size: 9.5px; }
.livepill { display: inline-flex; align-items: center; gap: 6px; font-size: 10.5px; font-weight: 700; letter-spacing: .1em; color: #ff9b97;
            background: var(--danger-soft); border: 1px solid var(--danger-line); border-radius: 99px; padding: 2px 9px 2px 7px; }
.livepill i { width: 7px; height: 7px; border-radius: 50%; background: var(--danger); animation: pulse 1.6s ease-out infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(242,97,92,.6); } 70% { box-shadow: 0 0 0 6px rgba(242,97,92,0); } 100% { box-shadow: 0 0 0 0 rgba(242,97,92,0); } }
tr.fresh td { animation: flash 2.5s ease-out; }
@keyframes flash { from { background: var(--profit-soft); } }
tr.click { cursor: pointer; }
@media (prefers-reduced-motion: reduce) { .dot.ok, .livepill i, tr.fresh td { animation: none; } }

.openall { text-align: right; white-space: nowrap; }
.openlegs { font-family: var(--mono); gap: 3px; }
.openlegs .go { color: var(--accent); font-size: 12px; }
.restlegs { display: grid; gap: 8px; }
.restlegs .btn { justify-content: flex-start; height: 40px; gap: 9px; }
.restlegs .btn.done { opacity: .45; }
.restlegs .go { margin-left: auto; color: var(--accent); }

/* multi-select menu (the bet types): a control that opens a list of boxes */
.multi { position: relative; text-transform: none; letter-spacing: 0; font-weight: 500; }
.multi summary { list-style: none; display: flex; align-items: center; gap: 8px; height: var(--ctl); min-width: 190px; max-width: 320px; padding: 0 10px; background: var(--bg-2); color: var(--ink); border: 1px solid var(--line-2); border-radius: var(--radius-sm); font-size: 13px; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.multi summary::-webkit-details-marker { display: none; }
.multi summary::after { content: "▾"; margin-left: auto; color: var(--dim); }
.multi summary:hover { border-color: #374254; }
.multi[open] summary { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.multi .menu { position: absolute; z-index: 40; top: calc(100% + 6px); left: 0; min-width: 320px; max-height: 380px; overflow: auto; background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 10px; padding: 6px; box-shadow: var(--shadow); }
.multi .menu .head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 4px 8px 8px; margin-bottom: 4px; border-bottom: 1px solid var(--line); font-size: 12px; color: var(--dim); }
.multi .menu .head button { background: none; border: none; padding: 0; color: var(--accent); cursor: pointer; font-size: 12px; font-weight: 600; }
.multi .menu label { display: flex; align-items: center; gap: 9px; padding: 6px 8px; border-radius: 6px; font-size: 13px; color: var(--ink-2); cursor: pointer; }
.multi .menu label:hover { background: var(--panel-3); color: var(--ink); }
.multi .menu label input { margin: 0; accent-color: var(--accent); }
.multi .menu label .id { margin-left: auto; font-family: var(--mono); font-size: 11px; color: var(--faint); }

/* pager */
.pager { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-top: 1px solid var(--line); font-size: 12.5px; }
.pager select { height: 28px; padding: 0 6px; font-size: 12px; }

/* pills */
.pill { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: 11.5px; font-weight: 600; border: 1px solid var(--line-2); color: var(--dim); background: var(--panel-2); white-space: nowrap; }
.pill.ok { color: var(--profit); border-color: var(--profit-line); background: var(--profit-soft); }
.pill.warn { color: var(--near); border-color: var(--near-line); background: var(--near-soft); }
.pill.bad { color: var(--danger); border-color: var(--danger-line); background: var(--danger-soft); }

/* tabs */
.tabs { display: flex; gap: 4px; margin-bottom: 14px; border-bottom: 1px solid var(--line); }
.tabs button { background: none; border: none; border-bottom: 2px solid transparent; color: var(--dim); padding: 10px 14px; cursor: pointer; font-weight: 600; font-size: 13.5px; margin-bottom: -1px; }
.tabs button:hover { color: var(--ink); }
.tabs button.on { color: var(--ink); border-bottom-color: var(--profit); }

/* modal and drawer */
.overlay { position: fixed; inset: 0; z-index: 50; background: rgba(5,7,10,.65); display: grid; place-items: center; padding: 16px; }
.modal { width: 100%; max-width: 440px; max-height: calc(100vh - 32px); overflow: auto; background: var(--panel); border: 1px solid var(--line-2); border-radius: 14px; padding: 22px; box-shadow: var(--shadow); }
.modal.wide { max-width: 980px; }
.modal h3 { margin: 0 0 14px; font-size: 16px; }
.form label { display: block; font-size: 12.5px; font-weight: 500; color: var(--dim); margin: 12px 0 6px; }
.form input, .form select, .form textarea { width: 100%; }
.form .check { display: flex; align-items: center; gap: 8px; color: var(--ink); }
.form .check input { width: auto; }
.msg { min-height: 20px; margin-top: 12px; font-size: 13px; color: var(--danger); }
.msg.ok { color: var(--profit); }
.actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }

/* comparison grid */
.grid td.best { color: var(--profit); font-weight: 700; }
.grid td.leg { box-shadow: inset 0 0 0 1px var(--profit-line); background: var(--profit-soft); }
.grid .market td { background: var(--panel-2); font-weight: 600; color: var(--ink-2); }
.calc { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-top: 10px; }
.calc .cell { background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.calc .cell .l { color: var(--dim); font-size: 12px; }
.calc .cell .v { font-family: var(--mono); font-size: 16px; font-weight: 600; margin-top: 2px; }

/* notices */
.toast { position: fixed; right: 20px; bottom: 20px; z-index: 60; background: var(--panel-2); border: 1px solid var(--line-2); border-left: 4px solid var(--accent); border-radius: 10px; padding: 12px 16px; box-shadow: var(--shadow); font-size: 13px; max-width: 380px; }
.toast.err { border-left-color: var(--danger); }

@media (max-width: 860px) {
  .top { padding: 0 16px; gap: 12px; }
  main { padding: 14px 16px 40px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .nav a { padding: 6px 8px; }
  .status .txt { display: none; }
}
