:root {
  --bg: #f6f4ef; --surface: #ffffff; --ink: #1d2433; --muted: #6b7385; --line: #e6e2d8;
  --side: #17352d; --side-ink: #cfe3da; --accent: #e8590c; --accent-soft: #fdeadc; --good: #2b8a6e; --bad: #c2255c;
  --radius: 12px;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); font-size: 15px; line-height: 1.45; }
h1 { font-size: 1.6rem; margin: 0; letter-spacing: -0.01em; }
h2 { font-size: 0.95rem; margin: 0; font-weight: 650; }
.muted { color: var(--muted); } .small { font-size: 0.8rem; }
.shell { display: grid; grid-template-columns: 208px 1fr; min-height: 100vh; }
.side { background: var(--side); padding: 18px 12px; display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 700; padding: 4px 10px 18px; font-size: 1.05rem; }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; background: var(--accent); color: #fff; }
.nav { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 9px; color: var(--side-ink); text-decoration: none; font-weight: 550; }
.nav svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.nav:hover { background: rgba(255,255,255,.07); }
.nav.active { background: rgba(255,255,255,.14); color: #fff; box-shadow: inset 3px 0 0 var(--accent); }
.main { padding: 28px 32px 60px; min-width: 0; }
.page { max-width: 1280px; display: flex; flex-direction: column; gap: 18px; }
.pagehead { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; }
.pagehead p { margin: 4px 0 0; }
.updated { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 0.82rem; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--good); animation: pulse 1.6s ease-out 1; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(43,138,110,.6); } 100% { box-shadow: 0 0 0 10px rgba(43,138,110,0); } }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.kpi-label { color: var(--muted); font-size: 0.78rem; text-transform: uppercase; letter-spacing: .05em; font-weight: 600; }
.kpi-value { font-size: 1.9rem; font-weight: 700; letter-spacing: -0.02em; margin-top: 2px; }
.kpi-note { color: var(--muted); font-size: 0.8rem; min-height: 1.1em; }
.grid { display: grid; gap: 14px; }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); }
.grid.three { grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); }
.grid.four { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px 16px; min-width: 0; overflow-x: auto; }
.panel > header { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; gap: 8px; }
.hint { color: var(--muted); font-size: 0.78rem; }
.barlist { display: flex; flex-direction: column; gap: 8px; }
.bar-row { display: grid; grid-template-columns: minmax(80px, 38%) 1fr 36px; align-items: center; gap: 10px; }
.bar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.86rem; }
.bar-track { display: block; height: 14px; background: #efece4; border-radius: 7px; overflow: hidden; }
.bar-fill { display: block; height: 100%; border-radius: 7px; }
.bar-value { text-align: right; font-variant-numeric: tabular-nums; font-size: 0.86rem; font-weight: 600; }
table.list { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
table.list th { text-align: left; color: var(--muted); font-weight: 600; font-size: 0.74rem; text-transform: uppercase; letter-spacing: .04em; padding: 6px 10px 6px 0; border-bottom: 1px solid var(--line); }
table.list td { padding: 9px 10px 9px 0; border-bottom: 1px solid #f0ede5; vertical-align: top; }
table.list tr:last-child td { border-bottom: 0; }
.num { text-align: right !important; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pill { display: inline-block; padding: 1px 9px; border-radius: 999px; font-size: 0.74rem; font-weight: 600; color: var(--c); background: color-mix(in srgb, var(--c) 13%, white); margin-top: 3px; }
.late { color: var(--bad); font-weight: 600; }
.latetag { margin-left: 6px; font-size: 0.7rem; background: #fde4ec; color: var(--bad); padding: 1px 6px; border-radius: 6px; font-weight: 650; }
.empty { color: var(--muted); padding: 18px 0; text-align: center; }
.loading { color: var(--muted); padding: 24px 0; } .loading.small { padding: 4px 0; font-size: .8rem; }
.alert { background: #fde4ec; color: #8a1237; border: 1px solid #f6b9cd; border-radius: 10px; padding: 10px 14px; }
.pager { display: flex; gap: 8px; justify-content: flex-end; margin-top: 10px; }
.btn { border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 6px 12px; font: inherit; cursor: pointer; }
.btn:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); } .btn:disabled { opacity: .4; cursor: default; }
.typeahead { position: relative; margin-bottom: 12px; max-width: 560px; }
.ta-box { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 10px; padding: 0 10px; background: #fff; }
.ta-box:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.ta-icon { width: 18px; height: 18px; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; flex: none; }
.ta-input { flex: 1; border: 0; outline: 0; padding: 10px 0; font: inherit; background: transparent; min-width: 0; }
.chip { border: 0; background: var(--accent-soft); color: #9c3d06; border-radius: 999px; padding: 3px 10px; font: inherit; font-size: .8rem; font-weight: 600; cursor: pointer; white-space: nowrap; }
.ta-list { position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% + 4px); background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 30px rgba(20,30,40,.14); list-style: none; margin: 0; padding: 6px; max-height: 320px; overflow: auto; }
.ta-group { font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 6px 8px 2px; font-weight: 650; }
.ta-item { display: flex; justify-content: space-between; gap: 12px; padding: 7px 8px; border-radius: 7px; cursor: pointer; }
.ta-item:hover { background: var(--accent-soft); }
.ta-count { color: var(--muted); font-variant-numeric: tabular-nums; font-size: .82rem; }
.toasts { position: fixed; right: 18px; bottom: 18px; display: flex; flex-direction: column-reverse; gap: 8px; z-index: 50; width: min(380px, calc(100vw - 36px)); pointer-events: none; }
.toast { background: #1d2433; color: #fff; border-radius: 10px; padding: 10px 14px; box-shadow: 0 8px 24px rgba(0,0,0,.25); animation: slidein .25s ease-out; }
.toast-head { display: flex; gap: 10px; align-items: baseline; }
.toast-op { font-size: .68rem; text-transform: uppercase; letter-spacing: .06em; font-weight: 700; padding: 1px 7px; border-radius: 5px; background: #3a4560; }
.op-created { background: #2b8a6e; } .op-updated { background: #c9780a; } .op-deleted { background: #c2255c; }
.toast-changes { color: #c7cedd; font-size: .8rem; margin-top: 4px; }
@keyframes slidein { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (max-width: 760px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: static; height: auto; flex-direction: row; overflow-x: auto; padding: 8px; }
  .brand-text, .nav span { display: none; } .brand { padding: 4px 8px; }
  .main { padding: 18px 14px 60px; }
}
