:root {
  --bg: #f6f7f9; --panel: #fff; --ink: #16181d; --mute: #646b78; --line: #e3e6eb; --line2: #eef0f3;
  --accent: #1f5eff; --accent-ink: #fff; --ok: #12805c; --okbg: #e7f6ef; --warn: #a45c00; --warnbg: #fff4e0;
  --bad: #c42b2b; --badbg: #fdecec; --info: #1f5eff; --infobg: #eaf0ff; --r: 8px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font-size: 14px; line-height: 1.45; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 20px; margin: 0 0 4px; font-weight: 650; letter-spacing: -0.01em; }
h2 { font-size: 15px; margin: 0 0 12px; font-weight: 650; }
h3 { font-size: 13px; margin: 0 0 8px; font-weight: 650; color: var(--mute); text-transform: uppercase; letter-spacing: .04em; }
.mute { color: var(--mute); } .small { font-size: 12px; } .right { text-align: right; } .nowrap { white-space: nowrap; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; }
.tnum { font-variant-numeric: tabular-nums; }

/* shell */
.shell { display: grid; grid-template-columns: 216px 1fr; min-height: 100vh; }
.side { background: #101318; color: #c9ced8; padding: 16px 10px; position: sticky; top: 0; height: 100vh; }
.brand { color: #fff; font-weight: 700; font-size: 16px; padding: 4px 10px 16px; letter-spacing: -0.01em; }
.brand span { color: #7aa2ff; }
.nav a { display: flex; justify-content: space-between; align-items: center; color: #c9ced8; padding: 7px 10px; border-radius: 6px; margin-bottom: 2px; }
.nav a:hover { background: #1b2029; text-decoration: none; color: #fff; }
.nav a.on { background: #232a36; color: #fff; }
.nav .count { background: #c42b2b; color: #fff; border-radius: 10px; font-size: 11px; padding: 0 7px; line-height: 18px; }
.side .me { position: absolute; bottom: 14px; left: 10px; right: 10px; font-size: 12px; padding: 0 10px; }
.side .me button { background: none; border: 0; color: #8f96a3; padding: 0; cursor: pointer; font-size: 12px; }
.main { padding: 22px 28px 60px; min-width: 0; }
.top { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }

/* blocks */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; margin-bottom: 16px; }
.panel.tight { padding: 0; overflow: hidden; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: 1fr 1fr; } .g3 { grid-template-columns: repeat(3, 1fr); } .g4 { grid-template-columns: repeat(4, 1fr); }
.g-side { grid-template-columns: minmax(0, 1fr) 340px; }
@media (max-width: 1100px) { .g-side, .g2, .g3 { grid-template-columns: 1fr; } .g4 { grid-template-columns: 1fr 1fr; } }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; }
.kpi .v { font-size: 22px; font-weight: 650; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.kpi .l { color: var(--mute); font-size: 12px; }
.kpi a { color: inherit; }

/* tables */
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-weight: 600; font-size: 12px; color: var(--mute); padding: 8px 10px; border-bottom: 1px solid var(--line); background: #fafbfc; white-space: nowrap; }
td { padding: 8px 10px; border-bottom: 1px solid var(--line2); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
tr.click:hover td { background: #f8faff; cursor: pointer; }
tr.dim td { opacity: .55; }

/* forms */
input, select, textarea { font: inherit; padding: 7px 9px; border: 1px solid #cfd4dc; border-radius: 6px; background: #fff; color: var(--ink); width: 100%; }
input:focus, select:focus, textarea:focus { outline: 2px solid #c9d8ff; border-color: var(--accent); }
input[type=checkbox] { width: auto; }
textarea { min-height: 90px; resize: vertical; }
label { display: block; font-size: 12px; color: var(--mute); margin-bottom: 3px; font-weight: 500; }
.field { margin-bottom: 10px; }
.fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 4px 12px; }
.inline { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.inline > * { width: auto; }
.btn { display: inline-flex; align-items: center; gap: 6px; font: inherit; font-weight: 550; padding: 7px 13px; border-radius: 6px; border: 1px solid #cfd4dc; background: #fff; color: var(--ink); cursor: pointer; white-space: nowrap; }
.btn:hover { background: #f3f5f8; text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: #164de0; }
.btn.danger { color: var(--bad); }
.btn.sm { padding: 3px 9px; font-size: 12px; }
.btn.link { border: 0; background: none; color: var(--accent); padding: 0; }
form.inline-form { display: inline; }

/* badges */
.badge { display: inline-block; font-size: 11.5px; font-weight: 600; padding: 1px 8px; border-radius: 10px; background: #eef0f3; color: #3a404b; white-space: nowrap; }
.badge.ok { background: var(--okbg); color: var(--ok); } .badge.warn { background: var(--warnbg); color: var(--warn); }
.badge.bad { background: var(--badbg); color: var(--bad); } .badge.info { background: var(--infobg); color: var(--info); }
.pos { color: var(--ok); } .neg { color: var(--bad); }

.flash { padding: 10px 14px; border-radius: var(--r); margin-bottom: 16px; font-weight: 500; }
.flash.ok { background: var(--okbg); color: var(--ok); } .flash.error { background: var(--badbg); color: var(--bad); }
.banner { padding: 12px 14px; border-radius: var(--r); margin-bottom: 16px; display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.banner.warn { background: var(--warnbg); border: 1px solid #f3d9a8; } .banner.info { background: var(--infobg); border: 1px solid #c9d8ff; } .banner.bad { background: var(--badbg); border: 1px solid #f3c2c2; }

/* stage tracker */
.stages { display: flex; gap: 3px; margin: 10px 0 18px; }
.stages div { flex: 1; font-size: 11px; text-align: center; padding: 6px 2px; background: #e9ecf1; color: var(--mute); border-radius: 4px; line-height: 1.2; }
.stages div.done { background: #cfe0ff; color: #26407a; } .stages div.cur { background: var(--accent); color: #fff; font-weight: 600; }

/* tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.tabs a { padding: 8px 12px; color: var(--mute); border-bottom: 2px solid transparent; margin-bottom: -1px; font-weight: 550; }
.tabs a.on { color: var(--ink); border-color: var(--accent); }
.tabs a:hover { text-decoration: none; color: var(--ink); }

.liftbox { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; margin-bottom: 16px; background: #fff; }
.liftbox > div { padding: 12px 14px; border-right: 1px solid var(--line); }
.liftbox > div:last-child { border-right: 0; background: #f4f8ff; }
.liftbox .v { font-size: 20px; font-weight: 650; font-variant-numeric: tabular-nums; }
.liftbox .l { font-size: 12px; color: var(--mute); }

.task { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-bottom: 1px solid var(--line2); }
.task:last-child { border-bottom: 0; }
.task .t { flex: 1; }
.task.done .t { text-decoration: line-through; color: var(--mute); }
.check { width: 18px; height: 18px; border-radius: 4px; border: 1.5px solid #aab1bd; background: #fff; cursor: pointer; padding: 0; flex: none; margin-top: 1px; }
.check:hover { border-color: var(--accent); background: var(--infobg); }
.check.on { background: var(--ok); border-color: var(--ok); }

.email { border: 1px solid var(--line); border-radius: var(--r); margin-bottom: 8px; background: #fff; }
.email summary { padding: 10px 12px; cursor: pointer; list-style: none; display: grid; grid-template-columns: 22px 1fr auto; gap: 8px; }
.email summary::-webkit-details-marker { display: none; }
.email .body { padding: 0 12px 12px 42px; white-space: pre-wrap; font-size: 13px; max-height: 420px; overflow: auto; }
.dir { font-size: 11px; font-weight: 700; color: var(--mute); }
.dir.in { color: var(--ok); }

.act { font-size: 13px; padding: 6px 0; border-bottom: 1px solid var(--line2); }
.act .when { color: var(--mute); font-size: 12px; }
.bar { height: 6px; background: #e9ecf1; border-radius: 3px; overflow: hidden; min-width: 60px; }
.bar > i { display: block; height: 100%; background: var(--accent); }
.bar.hot > i { background: var(--bad); }
.pager { display: flex; gap: 8px; align-items: center; justify-content: flex-end; padding: 10px; }
.auth { max-width: 380px; margin: 12vh auto; }
.score { font-weight: 650; font-variant-numeric: tabular-nums; }
.issues li { margin-bottom: 4px; }
