:root {
  --bg: #eef2f7;
  --card: #ffffff;
  --ink: #16242f;
  --muted: #6b7c8f;
  --line: #e3e9f0;
  --accent: #0aa5c4;
  --accent-ink: #057a92;
  --green: #22c55e;
  --yellow: #f5b50a;
  --red: #ef4444;
  --shadow: 0 1px 2px rgba(16,40,60,.06), 0 6px 20px rgba(16,40,60,.06);
  --radius: 16px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }

/* ---------- top bar ---------- */
.topbar {
  display: flex; align-items: center; gap: 24px;
  background: var(--card);
  padding: 0 24px; height: 60px;
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 16px; }
.brand .drop { width: 22px; height: 22px; }
.nav { display: flex; gap: 4px; }
.nav a {
  padding: 8px 14px; border-radius: 10px; color: var(--muted); font-weight: 600; font-size: 14px;
}
.nav a:hover { background: var(--bg); color: var(--ink); }
.nav a.active { background: rgba(10,165,196,.12); color: var(--accent-ink); }
.spacer { flex: 1; }
.userbox { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; }
.btn {
  border: 1px solid var(--line); background: var(--card); color: var(--ink);
  padding: 8px 14px; border-radius: 10px; font-weight: 600; font-size: 13px; cursor: pointer;
}
.btn:hover { background: var(--bg); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-ink); }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- layout ---------- */
.wrap { max-width: 1180px; margin: 0 auto; padding: 24px; }
.grid { display: grid; gap: 18px; }
.cards-3 { grid-template-columns: 1.4fr 1fr 1fr; }
@media (max-width: 900px) { .cards-3 { grid-template-columns: 1fr; } }

.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px;
}
.card h3 { margin: 0 0 4px; font-size: 13px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.section-title { font-size: 15px; font-weight: 700; margin: 26px 4px 12px; }

/* ---------- big number (наливы сегодня) ---------- */
.bignum { font-size: 64px; font-weight: 800; line-height: 1; letter-spacing: -.02em; margin: 10px 0 6px; }
.bignum.blink { animation: blink 1s ease; }
@keyframes blink {
  0% { color: var(--ink); transform: scale(1); }
  18% { color: var(--accent); transform: scale(1.12); }
  100% { color: var(--ink); transform: scale(1); }
}
.compare { font-size: 14px; color: var(--muted); }
.delta { font-weight: 700; padding: 2px 8px; border-radius: 999px; font-size: 13px; margin-left: 6px; }
.delta.up { color: #0a7f3f; background: rgba(34,197,94,.14); }
.delta.down { color: #b42318; background: rgba(239,68,68,.12); }
.delta.flat { color: var(--muted); background: var(--bg); }
.updated { font-size: 12px; color: var(--muted); margin-top: 14px; }
.live-dot { display:inline-block; width:8px; height:8px; border-radius:50%; background: var(--green); margin-right:6px; vertical-align: middle; animation: pulse 2s infinite; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.3} }

/* ---------- top fountains ---------- */
.rank { list-style: none; margin: 8px 0 0; padding: 0; }
.rank li { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.rank li:last-child { border-bottom: 0; }
.medal { font-size: 20px; width: 26px; text-align: center; }
.rank .fname { font-weight: 600; }
.rank .fbar { flex: 1; height: 8px; background: var(--bg); border-radius: 999px; overflow: hidden; }
.rank .fbar > span { display: block; height: 100%; background: var(--accent); border-radius: 999px; }
.rank .fcount { font-weight: 700; min-width: 42px; text-align: right; }

/* ---------- soon card ---------- */
.soon { display: flex; flex-direction: column; gap: 6px; }
.soon .big { font-size: 30px; font-weight: 800; }
.badge-soon { align-self: flex-start; font-size: 11px; font-weight: 700; color: var(--accent-ink);
  background: rgba(10,165,196,.12); padding: 3px 9px; border-radius: 999px; text-transform: uppercase; letter-spacing: .04em; }
.muted { color: var(--muted); }

/* ---------- bot status ---------- */
.bots { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
@media (max-width: 900px) { .bots { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .bots { grid-template-columns: 1fr; } }
.bot { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 16px; box-shadow: var(--shadow); }
.bot .row1 { display: flex; align-items: center; gap: 9px; }
.dot { width: 11px; height: 11px; border-radius: 50%; flex: none; box-shadow: 0 0 0 4px rgba(0,0,0,.04); }
.dot.green { background: var(--green); }
.dot.yellow { background: var(--yellow); }
.dot.red { background: var(--red); }
.bot .bname { font-weight: 700; font-size: 14px; }
.tag { font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 6px; background: var(--bg); color: var(--muted); }
.bot .meta { margin-top: 10px; font-size: 13px; color: var(--muted); line-height: 1.5; }
.bot .meta b { color: var(--ink); }
.status-word { margin-left: auto; font-size: 12px; font-weight: 700; }
.status-word.green { color: #0a7f3f; }
.status-word.yellow { color: #9a6b00; }
.status-word.red { color: #b42318; }

/* ---------- reports ---------- */
.tabs { display: flex; gap: 6px; margin-bottom: 16px; }
.tab { padding: 9px 16px; border-radius: 10px; font-weight: 600; cursor: pointer; color: var(--muted); background: var(--card); border: 1px solid var(--line); }
.tab.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.filters { display: flex; flex-wrap: wrap; gap: 14px 18px; align-items: flex-end; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field label { font-size: 12px; font-weight: 700; color: var(--muted); }
.field input, .field select { padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; font-size: 14px; background: #fff; color: var(--ink); }
.presets { display: flex; gap: 6px; }
.presets .btn { padding: 6px 10px; font-size: 12px; }
.checks { display: flex; flex-wrap: wrap; gap: 8px; }
.check { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; padding: 6px 10px; border: 1px solid var(--line); border-radius: 999px; cursor: pointer; user-select: none; }
.check input { accent-color: var(--accent); }

.kpis { display: flex; gap: 14px; flex-wrap: wrap; margin: 18px 0; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px 18px; box-shadow: var(--shadow); min-width: 150px; }
.kpi .v { font-size: 28px; font-weight: 800; }
.kpi .l { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }

.chart { display: flex; align-items: flex-end; gap: 6px; height: 180px; padding: 10px 4px 0; overflow-x: auto; }
.chart .bar { flex: 1; min-width: 14px; display: flex; flex-direction: column; align-items: center; gap: 6px; justify-content: flex-end; }
.chart .bar > .b { width: 70%; min-height: 2px; background: var(--accent); border-radius: 6px 6px 0 0; transition: height .3s; }
.chart .bar > .x { font-size: 10px; color: var(--muted); white-space: nowrap; transform: rotate(-45deg); transform-origin: top left; height: 30px; }
.chart .bar .v { font-size: 11px; font-weight: 700; color: var(--accent-ink); }

table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
table.tbl th, table.tbl td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); }
table.tbl th { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
table.tbl td.num, table.tbl th.num { text-align: right; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 760px) { .split { grid-template-columns: 1fr; } }
.empty { color: var(--muted); padding: 30px; text-align: center; }

/* ---------- login ---------- */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.login-card { width: 100%; max-width: 380px; background: var(--card); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); padding: 32px; }
.login-card h1 { font-size: 20px; margin: 14px 0 4px; }
.login-card p.sub { margin: 0 0 22px; color: var(--muted); font-size: 14px; }
.login-card .field { margin-bottom: 14px; }
.login-card .field input { width: 100%; }
.login-card .btn.primary { width: 100%; padding: 12px; font-size: 15px; }
.login-logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 18px; }
.error { color: var(--red); font-size: 13px; font-weight: 600; margin: 0 0 12px; min-height: 16px; }
.loading { color: var(--muted); padding: 40px; text-align: center; }
