:root {
  --bg: #f5f6f8; --panel: #fff; --ink: #1c2430; --muted: #6a7482; --line: #e3e6eb;
  --brand: #1f5f8b; --brand-ink: #fff; --accent: #2f8f6b; --warn: #b4542d; --soft: #eef3f8;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 14px/1.5 -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
code { background: var(--soft); padding: 1px 5px; border-radius: 4px; font-size: 12px; }
.top { display: flex; align-items: center; gap: 24px; padding: 0 28px; height: 54px; background: #13293d; color: #fff; }
.top a { color: #d6e2ee; }
.brand { font-weight: 700; font-size: 17px; color: #fff !important; letter-spacing: .3px; }
.brand .mark { color: #6cc3a0; }
.top nav { display: flex; gap: 16px; flex: 1; flex-wrap: wrap; }
.top nav .sep { border-left: 1px solid #3b5268; }
.who { color: #9fb3c6; font-size: 13px; }
button.link { background: none; border: 0; color: #d6e2ee; cursor: pointer; font: inherit; }
main { max-width: 1280px; margin: 0 auto; padding: 24px 28px 48px; }
footer { text-align: center; color: var(--muted); font-size: 12px; padding: 18px; }
h1 { font-size: 22px; margin: 0 0 16px; }
h1 small, h2 small { color: var(--muted); font-weight: 400; font-size: 14px; margin-left: 6px; }
h2 { font-size: 16px; margin: 0 0 12px; }
h3 { font-size: 14px; margin: 18px 0 8px; color: #3a4554; }
.muted { color: var(--muted); }
.head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 18px 20px; margin-bottom: 18px; }
.card.narrow { max-width: 420px; margin: 40px auto; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); gap: 18px; }
.grid3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 18px; }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.kpi span { display: block; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .4px; }
.kpi b { font-size: 20px; font-variant-numeric: tabular-nums; }
.kpis.small .kpi b { font-size: 16px; }
.kpi.ok { border-color: #9fd3bd; background: #f1faf6; }
.kpi.bad { border-color: #e6a98f; background: #fdf3ef; }
table.data { width: 100%; border-collapse: collapse; background: var(--panel); }
table.data th, table.data td { padding: 7px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
table.data thead th { font-size: 12px; text-transform: uppercase; letter-spacing: .3px; color: var(--muted); background: #fafbfc; }
table.data tfoot th { background: #fafbfc; }
table.data.compact td, table.data.compact th { padding: 5px 8px; font-size: 13px; }
table.data tbody tr:hover { background: #f9fbfd; }
.num { text-align: right !important; font-variant-numeric: tabular-nums; white-space: nowrap; }
.scroll { overflow-x: auto; }
table.sched td, table.sched th { font-size: 12.5px; padding: 5px 8px; }
.tag { display: inline-block; font-size: 11px; padding: 1px 7px; border-radius: 10px; background: var(--soft); color: #2d4a63; }
.tag.big { font-size: 14px; padding: 3px 10px; background: #dff0e8; color: #1d5c44; }
.status { font-size: 12px; padding: 2px 8px; border-radius: 10px; }
.status.active, .status.locked { background: #dff0e8; color: #1d5c44; }
.status.draft, .status.open { background: #fdf0d8; color: #7a5410; }
.status.reviewed { background: #e2ecf7; color: #1f4f7a; }
.btn { display: inline-block; padding: 7px 14px; border: 1px solid #c6ccd5; background: #fff; border-radius: 7px; cursor: pointer; color: var(--ink); font: inherit; }
.btn:hover { background: #f2f4f7; text-decoration: none; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn.primary:hover { background: #184d72; }
.actions { display: flex; gap: 10px; align-items: center; margin-top: 14px; flex-wrap: wrap; }
.head .actions { margin-top: 0; }
input, select, textarea { font: inherit; padding: 6px 8px; border: 1px solid #c6ccd5; border-radius: 6px; background: #fff; max-width: 100%; }
table.form input, table.form select { width: 100%; min-width: 80px; }
table.form input[type=checkbox] { width: auto; min-width: 0; }
.formgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px 16px; margin-bottom: 16px; }
.formgrid label, form.inline label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
form.inline, .inline { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin-top: 12px; }
form.inline input, form.inline select { width: 140px; }
.filters { display: flex; gap: 10px; align-items: flex-end; margin-bottom: 16px; flex-wrap: wrap; }
.filters input[name=q] { width: 320px; }
.filters label { display: flex; flex-direction: column; font-size: 12px; color: var(--muted); }
.err { color: var(--warn); font-style: normal; font-size: 12px; }
.flash { padding: 10px 14px; border-radius: 8px; margin-bottom: 14px; background: #e2ecf7; border: 1px solid #c3d6ea; }
.flash.success { background: #e5f5ee; border-color: #b5dfcb; }
.flash.error { background: #fdeee8; border-color: #f0c2ae; color: #7a2f12; }
.steps { display: flex; list-style: none; padding: 0; margin: 0 0 18px; gap: 6px; }
.steps li { flex: 1; padding: 8px 12px; background: #e9ecf0; border-radius: 6px; color: var(--muted); font-size: 13px; }
.steps li.on { background: var(--brand); color: #fff; font-weight: 600; }
.reasons li { margin-bottom: 4px; }
.pre { white-space: pre-line; font-size: 12px; max-width: 420px; }
.chart { width: 100%; height: auto; }
.chart .grid { stroke: #eceff3; }
.chart .ylab { font-size: 10px; fill: var(--muted); text-anchor: end; dominant-baseline: middle; }
.chart .xlab { font-size: 10px; fill: var(--muted); text-anchor: middle; }
.chart polyline { fill: none; stroke-width: 2.4; stroke-linejoin: round; }
.chart .billing, .legend i.billing { stroke: #c27c2c; background: #c27c2c; }
.chart .revenue, .legend i.revenue { stroke: var(--brand); background: var(--brand); }
.legend { font-size: 12px; color: var(--muted); }
.legend i { display: inline-block; width: 14px; height: 3px; vertical-align: middle; margin: 0 4px 0 10px; }
.bars { display: flex; align-items: flex-end; gap: 6px; height: 180px; padding-top: 8px; }
.bar { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; height: 100%; text-align: center; }
.bar i { display: block; background: linear-gradient(#3a7fb0, var(--brand)); border-radius: 4px 4px 0 0; min-height: 2px; }
.bar span { font-size: 11px; color: var(--muted); margin-top: 4px; }
.pctcell { width: 40%; position: relative; font-size: 12px; color: var(--muted); }
.pctbar { display: inline-block; height: 8px; background: #9cc3df; border-radius: 4px; margin-right: 6px; vertical-align: middle; max-width: 70%; }
@media (max-width: 720px) {
  .top { flex-wrap: wrap; height: auto; padding: 10px 16px; gap: 8px; }
  main { padding: 16px; }
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .filters input[name=q] { width: 100%; }
}
