/* Value bot — клиентский портал. Основа — панель ботов 1/2 («матовое стекло»),
   фон спокойнее: один мягкий градиент вместо четырёх насыщенных пятен. */
@font-face { font-family: "Geist"; font-weight: 400 700; font-display: swap; src: url(fonts/geist-cyrillic.woff2) format("woff2"); unicode-range: U+0400-045F, U+0490-0491, U+2116; }
@font-face { font-family: "Geist"; font-weight: 400 700; font-display: swap; src: url(fonts/geist-latin.woff2) format("woff2"); unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2212; }
@font-face { font-family: "Geist Mono"; font-weight: 500 600; font-display: swap; src: url(fonts/geistmono-latin.woff2) format("woff2"); unicode-range: U+0000-00FF, U+20AC, U+2212; }

:root {
  color-scheme: dark;
  --font: "Geist", -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "Geist Mono", ui-monospace, Menlo, monospace;
  --bg: #0d0f1c;
  --bg-tint-1: rgba(98, 112, 230, .13);
  --bg-tint-2: rgba(130, 110, 220, .07);
  --glass: rgba(255, 255, 255, .045);
  --glass-2: rgba(255, 255, 255, .075);
  --glass-3: rgba(255, 255, 255, .12);
  --glass-strong: rgba(22, 25, 44, .82);
  --line: rgba(255, 255, 255, .085);
  --line-2: rgba(255, 255, 255, .16);
  --hi: inset 0 1px 0 rgba(255, 255, 255, .06);
  --text: #f2f3fb; --text-2: #b4b8d4; --muted: #7e83a6;
  --accent: #7b8cff; --accent-soft: rgba(123, 140, 255, .15);
  --good: #4ade80; --good-ink: #6ee7a8; --crit: #f87171; --crit-ink: #ff9b9b; --warn: #fbbf24; --warn-ink: #fcd062;
  --s1: #7b8cff; --s2: #f59e6b; --s3: #4fd1a5; --s4: #f5c451; --s5: #f47fb4; --s6: #b39dff;
  --shadow: 0 18px 40px -22px rgba(0, 0, 0, .7);
  --r: 18px;
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f2f3f8;
  --bg-tint-1: rgba(110, 125, 240, .10);
  --bg-tint-2: rgba(160, 140, 240, .06);
  --glass: rgba(255, 255, 255, .7); --glass-2: rgba(255, 255, 255, .85); --glass-3: #fff;
  --glass-strong: rgba(255, 255, 255, .88);
  --line: rgba(30, 40, 100, .09); --line-2: rgba(30, 40, 100, .18);
  --hi: inset 0 1px 0 rgba(255, 255, 255, .9);
  --text: #15172e; --text-2: #4a4f72; --muted: #7c81a2;
  --accent: #5a63f0; --accent-soft: rgba(90, 99, 240, .12);
  --good: #16a34a; --good-ink: #15803d; --crit: #dc2626; --crit-ink: #b91c1c; --warn: #d97706; --warn-ink: #92400e;
  --s1: #5a63f0; --s2: #ea7b45; --s3: #1fa77a; --s4: #d39b14; --s5: #d9548f; --s6: #8b5cf6;
  --shadow: 0 14px 30px -22px rgba(30, 40, 100, .35);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background: var(--bg); color: var(--text); font: 14px/1.5 var(--font); letter-spacing: -.01em;
  -webkit-font-smoothing: antialiased;
}
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(90% 60% at 85% -10%, var(--bg-tint-1), transparent 70%),
              radial-gradient(70% 60% at -10% 110%, var(--bg-tint-2), transparent 70%);
}
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
.num { font-variant-numeric: tabular-nums; }
:focus-visible { outline: 2px solid color-mix(in srgb, var(--accent) 70%, transparent); outline-offset: 2px; }
svg.i { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; flex: none; }
[hidden] { display: none !important; }

/* каркас */
.shell { display: grid; grid-template-columns: 228px minmax(0, 1fr); min-height: 100vh; }
.side {
  position: sticky; top: 14px; height: calc(100vh - 28px); margin: 14px 0 14px 14px;
  display: flex; flex-direction: column; gap: 4px; padding: 16px 12px;
  background: var(--glass-strong); border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--hi), var(--shadow);
}
.brand { display: flex; align-items: center; gap: 11px; padding: 4px 8px 18px; font-weight: 650; font-size: 15px; }
.logo { width: 32px; height: 32px; border-radius: 9px; box-shadow: 0 0 0 1px var(--line); }
.logo.lt, :root[data-theme="light"] .logo.dk { display: none; }
:root[data-theme="light"] .logo.lt { display: block; }
.side a {
  display: flex; gap: 11px; align-items: center; padding: 9px 12px; border-radius: 13px; color: var(--text-2);
  cursor: pointer; font-weight: 500; border: 1px solid transparent; text-decoration: none;
}
.side a svg { color: var(--muted); }
.side a:hover { background: var(--glass); color: var(--text); }
.side a.on { background: var(--glass-2); border-color: var(--line); color: var(--text); font-weight: 600; box-shadow: var(--hi); }
.side a.on svg { color: var(--accent); }
.side-foot { margin-top: auto; padding-top: 10px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; }
.who { color: var(--muted); font-size: 12.5px; padding: 0 8px; overflow: hidden; text-overflow: ellipsis; }
main { padding: 14px 22px 64px; min-width: 0; }
.top {
  position: sticky; top: 14px; z-index: 10; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  flex-wrap: wrap; margin-bottom: 18px; padding: 9px 12px 9px 20px;
  background: var(--glass-strong); border: 1px solid var(--line); border-radius: 999px; box-shadow: var(--hi), var(--shadow);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.top h1 { font-size: 18px; margin: 0; font-weight: 650; letter-spacing: -.025em; }
.top-r { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* кнопки */
button {
  border: 1px solid var(--line); background: var(--glass); padding: 8px 16px; border-radius: 999px; cursor: pointer;
  font-weight: 500; box-shadow: var(--hi); display: inline-flex; align-items: center; gap: 7px;
}
button:hover { background: var(--glass-2); border-color: var(--line-2); }
button:disabled { opacity: .45; cursor: default; }
button.primary { background: var(--text); color: var(--bg); border-color: transparent; font-weight: 600; }
button.primary:hover { background: color-mix(in srgb, var(--text) 88%, var(--accent)); }
button.ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--text-2); }
button.ghost:hover { background: var(--glass); color: var(--text); }
button.danger { color: var(--crit-ink); }
button.sm { padding: 5px 12px; font-size: 12.5px; }
button svg.i { width: 15px; height: 15px; }
.seg { display: inline-flex; gap: 2px; padding: 3px; border-radius: 999px; background: var(--glass); border: 1px solid var(--line); }
.seg button { border: 0; background: transparent; box-shadow: none; padding: 5px 13px; font-size: 13px; color: var(--text-2); }
.seg button.on { background: var(--glass-3); color: var(--text); font-weight: 600; }

/* карточки */
.card { background: var(--glass); border: 1px solid var(--line); border-radius: var(--r); padding: 18px 20px; box-shadow: var(--hi), var(--shadow); }
.card h3 { margin: 0 0 12px; font-size: 14px; font-weight: 600; color: var(--text-2); }
.grid { display: grid; gap: 14px; }
.kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 14px; }
.kpi .lab { color: var(--muted); font-size: 12.5px; }
.kpi .val { font-size: 26px; font-weight: 650; letter-spacing: -.03em; margin-top: 2px; }
.kpi .hint { color: var(--muted); font-size: 12px; }
.pos { color: var(--good-ink); } .neg { color: var(--crit-ink); }
.chart { width: 100%; height: 240px; display: block; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--text-2); margin-top: 8px; }
.legend i { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 6px; }
.empty { color: var(--muted); text-align: center; padding: 34px 10px; }
.empty svg.i { width: 34px; height: 34px; color: var(--muted); margin-bottom: 6px; }

/* аккаунты */
.accs { grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); }
.acc { display: flex; flex-direction: column; gap: 12px; cursor: pointer; transition: border-color .15s, transform .1s; }
.acc:hover { border-color: var(--line-2); }
.acc-h { display: flex; align-items: center; gap: 10px; }
.acc-h b { font-size: 15px; font-weight: 600; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.book { font-size: 11.5px; font-weight: 600; padding: 2px 9px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); }
.st { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-2); }
.st::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.st.running::before { background: var(--good); box-shadow: 0 0 0 3px color-mix(in srgb, var(--good) 22%, transparent); }
.st.paused::before { background: var(--warn); }
.st.limited::before { background: var(--crit); }
.st.setup::before { background: var(--accent); }
.acc-n { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.acc-n div { background: var(--glass); border-radius: 12px; padding: 8px 10px; }
.acc-n small { display: block; color: var(--muted); font-size: 11.5px; }
.acc-n span { font-weight: 600; font-size: 15px; }
.add { display: grid; place-items: center; min-height: 168px; border-style: dashed; color: var(--text-2); cursor: pointer; background: transparent; box-shadow: none; }
.add:hover { color: var(--text); border-color: var(--line-2); background: var(--glass); }
.add svg.i { width: 28px; height: 28px; }

/* страница аккаунта */
.back { margin-bottom: 12px; }
.acc-top { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.acc-top h2 { margin: 0; font-size: 22px; letter-spacing: -.03em; }
.acc-top .sp { flex: 1; }
.tabs { display: flex; gap: 4px; margin-bottom: 14px; border-bottom: 1px solid var(--line); }
.tabs button { border: 0; background: none; box-shadow: none; border-radius: 0; padding: 9px 14px; color: var(--text-2); border-bottom: 2px solid transparent; }
.tabs button.on { color: var(--text); border-bottom-color: var(--accent); font-weight: 600; }

/* настройки: раскрывающиеся разделы */
.sects { display: flex; flex-direction: column; gap: 10px; max-width: 820px; }
.sect { padding: 0; overflow: hidden; }
.sect > summary {
  list-style: none; display: flex; align-items: center; gap: 14px; padding: 15px 18px; cursor: pointer; user-select: none;
}
.sect > summary::-webkit-details-marker { display: none; }
.sect .ico { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); flex: none; }
.sect .ico svg.i { width: 20px; height: 20px; }
.sect .tt { flex: 1; min-width: 0; }
.sect .tt b { display: block; font-weight: 600; font-size: 14.5px; }
.sect .tt small { color: var(--muted); font-size: 12.5px; }
.sect .sum { color: var(--text-2); font-size: 12.5px; text-align: right; max-width: 40%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sect .chev { color: var(--muted); transition: transform .2s; }
.sect[open] .chev { transform: rotate(180deg); }
.sect[open] > summary { border-bottom: 1px solid var(--line); }
.sect .body { padding: 16px 18px 18px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; }
.f { display: flex; flex-direction: column; gap: 6px; }
.f.wide { grid-column: 1 / -1; }
.f label { font-size: 12.5px; color: var(--text-2); font-weight: 500; }
.f .help { font-size: 12px; color: var(--muted); }
.inp { position: relative; display: flex; align-items: center; }
.inp .u { position: absolute; right: 12px; color: var(--muted); font-size: 13px; pointer-events: none; }
input[type=text], input[type=password], input[type=number], select, textarea {
  width: 100%; background: var(--glass); border: 1px solid var(--line); border-radius: 11px; padding: 9px 12px; outline: none;
}
input:focus, select:focus, textarea:focus { border-color: color-mix(in srgb, var(--accent) 60%, transparent); box-shadow: 0 0 0 3px var(--accent-soft); }
textarea { min-height: 84px; resize: vertical; font-family: var(--mono); font-size: 12.5px; }
.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chip { padding: 6px 13px; border-radius: 999px; border: 1px solid var(--line); background: var(--glass); cursor: pointer; font-size: 13px; user-select: none; color: var(--text-2); }
.chip.on { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 45%, transparent); color: var(--text); font-weight: 600; }
.sw { display: flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.sw input { display: none; }
.sw i { width: 38px; height: 22px; border-radius: 999px; background: var(--glass-3); position: relative; transition: background .15s; flex: none; }
.sw i::after { content: ""; position: absolute; left: 3px; top: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; }
.sw input:checked + i { background: var(--accent); }
.sw input:checked + i::after { transform: translateX(16px); }
.savebar {
  position: sticky; bottom: 14px; display: flex; align-items: center; gap: 12px; justify-content: flex-end; margin-top: 14px; max-width: 820px;
  padding: 10px 12px 10px 18px; border-radius: 999px; background: var(--glass-strong); border: 1px solid var(--line); box-shadow: var(--shadow);
}
.savebar span { flex: 1; color: var(--text-2); font-size: 13px; }

/* таблица ставок */
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { text-align: left; color: var(--muted); font-weight: 500; font-size: 12px; padding: 0 10px 8px; }
.tbl td { padding: 10px; border-top: 1px solid var(--line); vertical-align: top; }
.tbl td.r, .tbl th.r { text-align: right; }
.tbl small { color: var(--muted); display: block; font-size: 11.5px; }
.badge { font-size: 11.5px; font-weight: 600; padding: 2px 9px; border-radius: 999px; background: var(--glass-2); color: var(--text-2); white-space: nowrap; }
.badge.won { color: var(--good-ink); background: color-mix(in srgb, var(--good) 14%, transparent); }
.badge.lost { color: var(--crit-ink); background: color-mix(in srgb, var(--crit) 13%, transparent); }
.badge.open { color: var(--accent); background: var(--accent-soft); }
.filters { display: flex; gap: 10px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
.filters select { width: auto; min-width: 180px; }

/* модальное окно, тост */
.modal { position: fixed; inset: 0; background: rgba(5, 6, 15, .55); display: grid; place-items: center; z-index: 50; padding: 16px; }
.dialog { width: min(480px, 100%); background: var(--glass-strong); backdrop-filter: blur(20px); border: 1px solid var(--line-2); border-radius: 22px; padding: 22px; box-shadow: var(--shadow); max-height: 92vh; overflow: auto; }
.dialog h2 { margin: 0 0 4px; font-size: 18px; }
.dialog .sub { color: var(--muted); font-size: 13px; margin: 0 0 16px; }
.dialog .form { display: flex; flex-direction: column; gap: 14px; }
.dialog .act { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }
.books { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.bk { padding: 12px 8px; border-radius: 13px; border: 1px solid var(--line); background: var(--glass); text-align: center; cursor: pointer; font-weight: 600; }
.bk.on { border-color: var(--accent); background: var(--accent-soft); }
.bk.off { opacity: .45; cursor: not-allowed; }
.bk small { display: block; font-weight: 400; color: var(--muted); font-size: 11px; }
.note { font-size: 12.5px; color: var(--text-2); background: var(--glass); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; display: flex; gap: 9px; }
.note svg.i { width: 16px; height: 16px; color: var(--accent); margin-top: 2px; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--text); color: var(--bg); padding: 10px 18px; border-radius: 999px; font-weight: 500; z-index: 60; box-shadow: var(--shadow); }
.err { color: var(--crit-ink); font-size: 13px; min-height: 18px; }

/* вход */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.auth .card { width: min(400px, 100%); padding: 28px; }
.auth .brand { justify-content: center; padding: 0 0 6px; font-size: 18px; }
.auth p.sub { text-align: center; color: var(--muted); margin: 0 0 20px; font-size: 13px; }
.auth .form { display: flex; flex-direction: column; gap: 12px; }
.auth button.primary { justify-content: center; padding: 11px; margin-top: 4px; }
.auth .sw2 { text-align: center; margin-top: 14px; font-size: 13px; color: var(--muted); }
.auth .sw2 a { color: var(--accent); cursor: pointer; }

/* телефон */
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; z-index: 20; inset: auto 10px 10px 10px; top: auto; height: auto; margin: 0; flex-direction: row; justify-content: space-around; padding: 6px; border-radius: 20px; }
  .side .brand, .side-foot .who, .side-foot { display: none; }
  .side a { flex-direction: column; gap: 2px; font-size: 11px; padding: 6px 10px; }
  main { padding: 10px 16px 96px; }
  .top { position: static; border-radius: 18px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi .val { font-size: 21px; }
  .sect .body { grid-template-columns: 1fr; }
  .sect .sum { display: none; }
  .tbl .hm { display: none; }
}
