/* OnlineProject panel. The look of the BlockCrime panel (dark charcoal glass, bold capitals, money in green) with the red of
   the RED RUSSIA logo as the accent (game/source/ui.h kAccent). No external fonts or images. */
:root {
  --bg: #111214; --card: rgba(30, 31, 34, .86); --card-solid: #1c1d20; --card-2: #252629; --line: #3d3e43;
  --text: #f1f2f4; --muted: #b8bbc3; --soft: #8d9099;
  --accent: #C12638; --accent-hover: #D43A4B; --accent-dark: #8F1C2A; --accent-ink: #fff;
  --money: #89E879; --good: #5ad07a; --warn: #f2c94c; --bad: #ff6b6b; --info: #56c2e6;
  --c1: #e2485a; --c2: #56c2e6; --c3: #f2c94c; --c4: #9b7be8; --c5: #5ad07a; --c6: #f2994a;
  --font: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, Roboto, Arial, sans-serif;
  --radius: 14px; --sidebar: 280px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 400 15px/1.5 var(--font); }
body { min-height: 100dvh; }
a { color: var(--accent-hover); }
button, input, select, textarea { font: inherit; color: inherit; }
.boot { padding: 40px; color: var(--muted); }

/* The faint red city glow behind everything, drawn with CSS only. */
.root::before { content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(1200px 600px at 85% -10%, rgba(193, 38, 56, .16), transparent 60%),
              radial-gradient(900px 500px at -10% 110%, rgba(193, 38, 56, .08), transparent 60%); }

/* ---- login ---- */
.login { min-height: 100dvh; display: grid; place-items: center; padding: 16px; }
.login-card { width: min(420px, 100%); background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 32px;
  backdrop-filter: blur(14px); box-shadow: 0 20px 60px #0008; }
.login-card img { width: 84px; height: 84px; border-radius: 18px; display: block; margin-bottom: 18px; }
.login-card h1 { margin: 0 0 4px; font-size: 26px; font-weight: 900; text-transform: uppercase; letter-spacing: .02em; }
.login-card p { margin: 0 0 22px; color: var(--muted); }
.login-card label { display: block; margin: 12px 0 6px; color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: .06em; font-weight: 700; }
.field { width: 100%; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--line); background: #0d0e10; outline: none; }
.field:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(193, 38, 56, .25); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 8px 16px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--card-2); cursor: pointer; font-weight: 700; white-space: nowrap; }
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: var(--accent-hover); }
.btn.danger { border-color: var(--accent-dark); color: #ffb3bb; }
.btn.danger:hover { background: var(--accent-dark); color: #fff; }
.btn.small { min-height: 32px; padding: 4px 10px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: default; }
.login-card .btn { width: 100%; margin-top: 22px; min-height: 46px; font-size: 16px; text-transform: uppercase; }
.error { color: var(--bad); margin-top: 12px; min-height: 22px; }

/* ---- shell ---- */
.shell { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100dvh; }
.sidebar { position: sticky; top: 0; height: 100dvh; overflow-y: auto; padding: 22px 18px; border-right: 1px solid var(--line);
  background: rgba(17, 18, 20, .9); backdrop-filter: blur(14px); }
.brand { display: flex; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); margin-bottom: 22px; }
.brand img { width: 44px; height: 44px; border-radius: 10px; }
.brand b { display: block; font-size: 15px; }
.brand span { color: var(--muted); font-size: 13px; }
.brand .dot { margin-left: auto; width: 8px; height: 8px; border-radius: 50%; background: var(--good); box-shadow: 0 0 8px var(--good); }
.brand .dot.down { background: var(--bad); box-shadow: 0 0 8px var(--bad); }
.nav-group { margin: 18px 0 6px; padding: 0 12px; color: var(--soft); font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: var(--text); text-decoration: none;
  font-weight: 800; text-transform: uppercase; font-size: 14px; letter-spacing: .02em; }
.nav a:hover { background: var(--card-2); }
.nav a.active { background: var(--accent); color: var(--accent-ink); }
.nav svg { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.main { min-width: 0; padding: 0 32px 60px; }
.topbar { display: flex; align-items: center; gap: 12px; min-height: 72px; border-bottom: 1px solid var(--line); margin-bottom: 28px; }
.crumbs { color: var(--soft); font-size: 13px; }
.crumbs b { color: var(--text); }
.topbar .spacer { flex: 1; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.chip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--good); }
.chip.bad::before { background: var(--bad); }
.avatar { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line); display: grid; place-items: center; font-weight: 800; background: var(--card-2); cursor: pointer; }
.icon-btn.menu-toggle { display: none; }

/* ---- hero ---- */
.hero { position: relative; overflow: hidden; border: 1px solid var(--line); border-radius: 18px; padding: 34px 30px; margin-bottom: 26px;
  background: linear-gradient(110deg, rgba(193, 38, 56, .28), rgba(28, 29, 32, .9) 55%), var(--card-solid);
  display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.hero::after { content: ""; position: absolute; right: -40px; top: -60px; width: 340px; height: 340px; background: url(/icon.png) center/contain no-repeat; opacity: .12; pointer-events: none; }
.hero .kicker { color: var(--accent-hover); font-size: 12px; font-weight: 900; letter-spacing: .16em; text-transform: uppercase; }
.hero h1 { margin: 6px 0 4px; font-size: 38px; font-weight: 900; text-transform: uppercase; line-height: 1.05; }
.hero p { margin: 0; color: var(--muted); max-width: 640px; }
.hero .grow { flex: 1; min-width: 240px; position: relative; z-index: 1; }
.seg { position: relative; z-index: 1; display: inline-flex; padding: 4px; border-radius: 12px; border: 1px solid var(--line); background: rgba(17, 18, 20, .7); gap: 2px; flex-wrap: wrap; }
.seg button { border: 0; background: transparent; padding: 8px 14px; border-radius: 9px; cursor: pointer; font-weight: 800; color: var(--muted); }
.seg button.on { background: var(--accent); color: #fff; }
.icon-btn { position: relative; z-index: 1; width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--line); background: rgba(17, 18, 20, .7); cursor: pointer; display: grid; place-items: center; }
.icon-btn svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2; }

/* ---- cards ---- */
.grid { display: grid; gap: 18px; margin-bottom: 18px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; backdrop-filter: blur(14px); min-width: 0; }
.card h2 { margin: 0 0 4px; font-size: 20px; font-weight: 900; text-transform: uppercase; letter-spacing: .01em; }
.card h3 { margin: 0 0 12px; font-size: 14px; font-weight: 900; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.card .sub { color: var(--soft); font-size: 13px; margin-bottom: 14px; }
.stat { position: relative; border-left: 3px solid var(--accent); }
.stat .label { font-size: 13px; font-weight: 900; text-transform: uppercase; letter-spacing: .04em; color: var(--text); }
.stat .value { margin: 10px 0 4px; font-size: 38px; font-weight: 900; line-height: 1.05; letter-spacing: -.01em; }
.stat .value.money { color: var(--money); text-shadow: 0 0 12px rgba(137, 232, 121, .35); }
.stat .value.red { color: var(--accent-hover); }
.stat .delta { font-size: 13px; }
.stat .note { margin-top: 6px; color: var(--soft); font-size: 12px; }
.up { color: var(--good); } .down { color: var(--bad); } .flat { color: var(--soft); }
.muted { color: var(--muted); } .soft { color: var(--soft); }
.tabs { display: inline-flex; gap: 2px; padding: 4px; border: 1px solid var(--line); border-radius: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.tabs button { border: 0; background: transparent; padding: 6px 12px; border-radius: 9px; cursor: pointer; font-weight: 800; color: var(--muted); }
.tabs button.on { background: var(--card-2); color: var(--text); box-shadow: inset 0 -2px 0 var(--accent); }
.empty { color: var(--soft); padding: 28px 0; text-align: center; }
.badge { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12px; font-weight: 800; border: 1px solid var(--line); }
.badge.good { color: var(--good); border-color: #2d6b3c; } .badge.bad { color: var(--bad); border-color: var(--accent-dark); }
.badge.warn { color: var(--warn); border-color: #6b5a22; } .badge.red { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ---- tables ---- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; color: var(--soft); font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 8px 10px; border-bottom: 1px solid rgba(61, 62, 67, .55); vertical-align: top; }
td:first-child { white-space: nowrap; }
tr.click { cursor: pointer; } tr.click:hover td { background: rgba(255, 255, 255, .03); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.bar-cell { position: relative; }
.bar-cell i { position: absolute; left: 0; top: 6px; bottom: 6px; background: rgba(193, 38, 56, .28); border-radius: 4px; }
.bar-cell span { position: relative; }
.heat { text-align: center; font-variant-numeric: tabular-nums; border-radius: 6px; }

/* ---- charts ---- */
.chart { width: 100%; min-height: 120px; display: block; }
.chart svg { display: block; width: 100%; height: auto; }
.chart text { fill: var(--soft); font-size: 11px; font-family: var(--font); }
.chart .grid-line { stroke: rgba(255, 255, 255, .07); }
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 13px; color: var(--muted); margin-top: 8px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.tip { position: fixed; z-index: 50; pointer-events: none; background: #0d0e10; border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; font-size: 12px; white-space: nowrap; box-shadow: 0 8px 24px #0009; }
.funnel-row { display: grid; grid-template-columns: 200px 1fr 120px; gap: 14px; align-items: center; padding: 8px 0; }
.funnel-row .track { height: 28px; background: var(--card-2); border-radius: 8px; overflow: hidden; }
.funnel-row .fill { height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-hover)); border-radius: 8px; }
.hbar { display: grid; grid-template-columns: minmax(120px, 38%) 1fr 64px; gap: 10px; align-items: center; padding: 4px 0; font-size: 14px; }
.hbar .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar .track { height: 10px; background: var(--card-2); border-radius: 5px; overflow: hidden; }
.hbar .fill { height: 100%; background: var(--accent); border-radius: 5px; }

/* ---- forms, toolbars, logs ---- */
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
.toolbar .field { width: auto; min-width: 200px; padding: 8px 12px; }
select.field { padding-right: 30px; }
.log { background: #0b0c0d; border: 1px solid var(--line); border-radius: 10px; padding: 12px; font: 12px/1.55 Consolas, "Cascadia Mono", monospace; white-space: pre-wrap; word-break: break-all; max-height: 70vh; overflow: auto; }
.log .l-ERROR { color: var(--bad); } .log .l-WARN { color: var(--warn); } .log .l-JOIN { color: var(--good); }
.log .l-LEAVE { color: #e6a07a; } .log .l-CHAT { color: var(--info); } .log .l-CMD { color: #c9a7ff; } .log .l-DEBUG { color: var(--soft); }
.kv { display: grid; grid-template-columns: minmax(120px, 200px) 1fr; gap: 6px 14px; font-size: 14px; }
.kv dt { color: var(--soft); } .kv dd { margin: 0; overflow-wrap: anywhere; }
pre.json { background: #0b0c0d; border: 1px solid var(--line); border-radius: 10px; padding: 12px; font: 12px/1.5 Consolas, monospace; max-height: 420px; overflow: auto; white-space: pre-wrap; word-break: break-all; }
.dialog-back { position: fixed; inset: 0; z-index: 40; background: rgba(0, 0, 0, .6); display: grid; place-items: center; padding: 16px; }
.dialog { width: min(720px, 100%); max-height: 92dvh; overflow: auto; background: var(--card-solid); border: 1px solid var(--line); border-radius: 18px; padding: 24px; }
.dialog h2 { margin: 0 0 6px; text-transform: uppercase; font-weight: 900; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; margin: 12px 0; }
.form-grid label { font-size: 12px; color: var(--soft); text-transform: uppercase; font-weight: 800; letter-spacing: .05em; }
.form-grid .field { margin-top: 4px; padding: 9px 12px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.toast { position: fixed; right: 20px; bottom: 20px; z-index: 60; background: var(--card-solid); border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 10px; padding: 12px 16px; max-width: 420px; box-shadow: 0 12px 40px #000a; }
.svc { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.svc .state { font-weight: 900; text-transform: uppercase; }
.notice { border: 1px dashed var(--line); border-radius: 12px; padding: 14px 16px; color: var(--muted); font-size: 14px; margin-bottom: 18px; }

@media (max-width: 1200px) { .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; z-index: 30; left: 0; top: 0; width: min(300px, 86vw); transform: translateX(-100%); transition: transform .2s; }
  .shell.open .sidebar { transform: none; box-shadow: 0 0 60px #000; }
  .icon-btn.menu-toggle { display: grid; }
  .main { padding: 0 16px 40px; }
  .g2, .g3, .g4 { grid-template-columns: minmax(0, 1fr); }
  .hero { padding: 24px 18px; } .hero h1 { font-size: 30px; }
  .funnel-row { grid-template-columns: 1fr; gap: 4px; }
  .stat .value { font-size: 32px; }
}
