:root {
  --bg: #f6f7f9; --card: #fff; --line: #e3e6eb; --text: #1d2330; --muted: #6b7280;
  --accent: #2f6fde; --accent-soft: #e8f0fd; --danger: #c43d3d; --ok: #1f8a5b; --warn: #b7791f;
  --r1: #d9534f; --r2: #ee9a5d; --r3: #c9ccd3; --r4: #7cc39a; --r5: #2e9a62;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.5; }
a { color: var(--accent); text-decoration: none; }
.top { display: flex; align-items: center; justify-content: space-between; padding: 12px 24px; background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.brand { font-weight: 650; color: var(--text); }
nav a, nav .link { margin-left: 18px; color: var(--muted); }
nav a:hover, nav .link:hover { color: var(--accent); }
main { max-width: 1180px; margin: 0 auto; padding: 24px; }
h1 { font-size: 22px; margin: 0 0 4px; } h2 { font-size: 17px; margin: 0 0 12px; } h3 { font-size: 15px; margin: 0 0 8px; }
.muted { color: var(--muted); } .small { font-size: 12px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 18px; margin-bottom: 16px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 860px) { .grid2 { grid-template-columns: 1fr; } }
label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.field { display: flex; flex-direction: column; min-width: 140px; flex: 1; }
input, select, textarea { font: inherit; padding: 7px 9px; border: 1px solid var(--line); border-radius: 7px; background: #fff; color: var(--text); width: 100%; }
textarea { min-height: 150px; font-family: ui-monospace, Menlo, monospace; font-size: 12.5px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
button { font: inherit; padding: 7px 14px; border-radius: 7px; border: 1px solid var(--line); background: #fff; cursor: pointer; color: var(--text); }
button:hover { border-color: var(--accent); }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
button.primary:hover { filter: brightness(1.07); }
button.danger { color: var(--danger); }
button.link { border: none; background: none; padding: 0; color: var(--accent); }
button:disabled { opacity: .5; cursor: not-allowed; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 16px 0; }
.tabs a { padding: 8px 14px; color: var(--muted); border-bottom: 2px solid transparent; }
.tabs a.on { color: var(--accent); border-color: var(--accent); font-weight: 600; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; color: var(--muted); font-weight: 600; }
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
@media (max-width: 860px) { .kpis { grid-template-columns: 1fr 1fr; } }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 14px; }
.kpi .v { font-size: 22px; font-weight: 650; } .kpi .l { font-size: 12px; color: var(--muted); }
.progress { height: 10px; background: var(--line); border-radius: 6px; overflow: hidden; }
.progress > div { height: 100%; background: var(--accent); transition: width .3s; }
.bars .bar-row { display: grid; grid-template-columns: 220px 1fr 130px; gap: 10px; align-items: center; margin: 7px 0; }
.bars .track { background: #eef0f3; border-radius: 5px; height: 20px; position: relative; }
.bars .fill { background: var(--accent); height: 100%; border-radius: 5px; }
.stack { display: flex; height: 20px; border-radius: 5px; overflow: hidden; }
.stack span { display: block; height: 100%; }
.legend span { display: inline-flex; align-items: center; gap: 4px; margin-right: 12px; font-size: 12px; color: var(--muted); }
.legend i { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }
.heat td { text-align: center; font-variant-numeric: tabular-nums; }
.heat td:first-child { text-align: left; }
.heat .n { display: block; font-size: 11px; color: var(--muted); }
.heat .few { opacity: .45; }
.quote { border-left: 3px solid var(--line); padding: 6px 12px; margin: 10px 0; }
.badge { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 12px; font-weight: 600; color: #fff; margin-right: 6px; }
.warn { background: #fff7e6; border: 1px solid #f3d9a4; color: #7a5310; padding: 10px 12px; border-radius: 8px; margin: 10px 0; }
.err { background: #fdeeee; border: 1px solid #f2c4c4; color: #8a2a2a; padding: 10px 12px; border-radius: 8px; margin: 10px 0; }
.okbox { background: #eaf7f0; border: 1px solid #bfe5cf; color: #1d5e3f; padding: 10px 12px; border-radius: 8px; margin: 10px 0; }
#toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: #1d2330; color: #fff; padding: 9px 16px; border-radius: 8px; z-index: 50; }
.login { max-width: 360px; margin: 80px auto; }
.inline { display: inline-flex; gap: 8px; align-items: center; }
pre.persona { white-space: pre-wrap; font-size: 12px; background: #f6f7f9; padding: 10px; border-radius: 8px; }
.help li { margin-bottom: 6px; }
