:root { --bg: #0f0f0f; --card: #1c1c1c; --line: #2c2c2c; --txt: #f1f1f1;
  --mut: #aaa; --acc: #ff4e45; --gold: #ffd700; --green: #3ea6ff; --ok: #2ba640; --bad: #e02424; }
* { box-sizing: border-box; }
body { background: var(--bg); color: var(--txt); font-family: system-ui, -apple-system, sans-serif;
  margin: 0; padding: 0 16px 60px; }
a { color: var(--green); }
header.top { display: flex; align-items: center; gap: 16px; padding: 14px 0;
  border-bottom: 1px solid var(--line); margin-bottom: 18px; flex-wrap: wrap; }
header.top h1 { font-size: 20px; margin: 0; }
header.top h1 span { color: var(--acc); }
header.top nav { margin-left: auto; display: flex; gap: 12px; align-items: center; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 16px; margin-bottom: 16px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.kpi .v { font-size: 26px; font-weight: 700; }
.kpi .l { color: var(--mut); font-size: 13px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; }
th { color: var(--mut); cursor: pointer; user-select: none; white-space: nowrap; }
tr:hover td { background: #222; }
.pill { display: inline-block; padding: 2px 8px; border-radius: 20px; font-size: 12px; }
.pill.top { background: #0d3; color: #041; }
.pill.flop { background: #e02424; color: #fff; }
.pill.mid { background: #333; color: #ccc; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 900px) { .grid2 { grid-template-columns: 1fr; } }
button, .btn { background: var(--acc); color: #fff; border: 0; border-radius: 8px;
  padding: 9px 16px; font-size: 14px; cursor: pointer; text-decoration: none; display: inline-block; }
button.sec { background: #333; }
input[type=password], select { padding: 9px 12px; border-radius: 8px; border: 1px solid var(--line);
  background: #111; color: var(--txt); font-size: 15px; }
body.login { display: flex; height: 100vh; align-items: center; justify-content: center; }
body.login .card { width: 320px; text-align: center; }
body.login input { width: 100%; margin: 10px 0; }
body.login button { width: 100%; }
.err { color: var(--bad); }
.mut { color: var(--mut); font-size: 13px; }
.bar { height: 8px; background: #333; border-radius: 4px; overflow: hidden; margin-top: 6px; }
.bar > div { height: 100%; background: var(--gold); }
.kv { display: flex; justify-content: space-between; padding: 5px 0; border-bottom: 1px dashed var(--line); }
.kv b:last-child { text-align: right; }
.good { color: #4caf50; } .bad { color: var(--bad); }
#ai-out h3 { margin: 14px 0 6px; }
#ai-out ul { margin: 4px 0 10px; padding-left: 20px; }
.spin { display: inline-block; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
canvas { max-height: 320px; }
