:root {
  --blue: #0d3b91; --blue-2: #1656c9; --orange: #f7931e; --ink: #16233f; --muted: #5d6b88; --line: #dde6f5;
  --card: #fff; --tint: #eef4ff; --bg: #f3f6fc; --ok: #137a3a; --ok-bg: #e5f6eb; --warn: #9a5b00; --warn-bg: #fff4e0;
  --bad: #b42318; --bad-bg: #fdecea; --radius: 14px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; } /* .row / .btn display rules must not un-hide */
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif; }
a { color: var(--blue-2); }
button, input, select, textarea { font: inherit; color: inherit; }
.top { background: linear-gradient(135deg, var(--blue), var(--blue-2)); color: #fff; padding: 12px 16px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.top .brand { font-weight: 800; font-size: 18px; letter-spacing: .2px; }
.top .brand span { color: var(--orange); }
.top .grow { flex: 1; }
.top select { background: rgba(255,255,255,.15); color: #fff; border: 1px solid rgba(255,255,255,.35); border-radius: 8px; padding: 5px 8px; max-width: 260px; }
.top select option { color: var(--ink); }
.top .who { font-size: 13px; opacity: .9; }
main { max-width: 1180px; margin: 0 auto; padding: 16px; }
h1 { font-size: 22px; margin: 4px 0 12px; }
h2 { font-size: 17px; margin: 0 0 10px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: 0 4px 14px rgba(13,59,145,.06); margin-bottom: 14px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.between { justify-content: space-between; }
.grid { display: grid; gap: 12px; }
.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)); }
label.f { display: block; font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .3px; }
label.f > input, label.f > select, label.f > textarea { display: block; width: 100%; margin-top: 4px; text-transform: none; letter-spacing: 0; font-weight: 400; font-size: 15px; color: var(--ink); }
input[type=text], input[type=number], input[type=date], input[type=time], input[type=datetime-local], input[type=search], select, textarea {
  border: 1px solid var(--line); border-radius: 9px; padding: 8px 10px; background: #fff; min-width: 0; }
textarea { min-height: 70px; resize: vertical; }
.check { display: inline-flex; gap: 6px; align-items: center; font-size: 14px; }
.btn { border: 1px solid var(--line); background: #fff; border-radius: 9px; padding: 8px 14px; cursor: pointer; font-weight: 600; }
.btn:hover { border-color: var(--blue-2); }
.btn.primary { background: var(--blue-2); color: #fff; border-color: var(--blue-2); }
.btn.accent { background: var(--orange); color: #fff; border-color: var(--orange); }
.btn.danger { color: var(--bad); }
.btn.small { padding: 4px 10px; font-size: 13px; }
.btn:disabled { opacity: .55; cursor: default; }
.pill { display: inline-block; font-size: 12px; font-weight: 700; border-radius: 999px; padding: 2px 10px; background: var(--tint); color: var(--blue); text-transform: capitalize; }
.pill.draft { background: #eef0f4; color: #4a5568; }
.pill.published, .pill.active { background: var(--tint); color: var(--blue); }
.pill.ongoing, .pill.yes { background: var(--ok-bg); color: var(--ok); }
.pill.completed { background: #e9e6ff; color: #4b38b3; }
.pill.cancelled, .pill.no { background: var(--bad-bg); color: var(--bad); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 14px; overflow-x: auto; }
.tabs a { padding: 9px 14px; text-decoration: none; color: var(--muted); font-weight: 600; border-bottom: 3px solid transparent; white-space: nowrap; }
.tabs a.on { color: var(--blue); border-color: var(--blue-2); }
table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
table.t th { text-align: left; font-size: 12px; text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--line); padding: 8px; position: sticky; top: 0; background: #fff; }
table.t td { border-bottom: 1px solid var(--line); padding: 8px; vertical-align: top; }
table.t td.n, table.t th.n { text-align: right; font-variant-numeric: tabular-nums; }
table.t tr.total td { font-weight: 800; background: var(--tint); }
.scroll { overflow-x: auto; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.kpi .v { font-size: 26px; font-weight: 800; font-variant-numeric: tabular-nums; }
.kpi .l { font-size: 12px; color: var(--muted); text-transform: uppercase; font-weight: 700; }
.kpi.main { background: var(--blue); color: #fff; border-color: var(--blue); }
.kpi.main .l { color: #dbe6ff; }
.bars { display: grid; gap: 6px; }
.bar { display: grid; grid-template-columns: 56px 1fr 60px; gap: 8px; align-items: center; font-size: 13px; }
.bar i { display: block; height: 14px; background: var(--blue-2); border-radius: 4px; min-width: 2px; }
.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 10px; z-index: 50; max-width: 90vw; box-shadow: 0 6px 20px rgba(0,0,0,.2); }
.toast.bad { background: var(--bad); }
.empty { text-align: center; color: var(--muted); padding: 30px 10px; }
.classes { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; max-height: 320px; overflow: auto; border: 1px solid var(--line); border-radius: 10px; padding: 10px; }
.classes .cls { border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { background: var(--tint); color: var(--blue); border-radius: 999px; padding: 3px 10px; font-size: 13px; display: inline-flex; gap: 6px; align-items: center; }
.chip button { border: 0; background: none; cursor: pointer; color: var(--bad); padding: 0; }
.notice { border-radius: 10px; padding: 10px 12px; margin-bottom: 12px; }
.notice.ok { background: var(--ok-bg); color: var(--ok); }
.notice.warn { background: var(--warn-bg); color: var(--warn); }
.notice.bad { background: var(--bad-bg); color: var(--bad); }
@media (max-width: 760px) {
  .g2, .g3, .g4 { grid-template-columns: minmax(0, 1fr); }
  main { padding: 12px; }
}
@media print {
  .top, .tabs, .noprint, .btn { display: none !important; }
  body { background: #fff; }
  .card { box-shadow: none; border: 0; padding: 0; }
}
