/* Inter is self-hosted so apps render the same in air-gapped installs. */
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url("fonts/inter-latin.woff2") format("woff2"); }
:root {
  --ink: #0C0C0C; --slate: #282D33; --muted: #5F6773; --line: #E3E6EB;
  --bg: #F7F8FA; --purple: #7A76FF; --tint: #F1F0FF; --alert: #B42318;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--slate); font-family: Inter, system-ui, sans-serif; font-size: 14px; }
a { color: #4B47D6; text-decoration: none; }
a:hover { text-decoration: underline; }

.topbar { display: flex; align-items: center; gap: 28px; padding: 0 28px; height: 56px; background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark { width: 22px; height: 22px; border-radius: 6px; background: linear-gradient(135deg, #7A76FF 0%, #3479F3 100%); }
.brand-co { font-weight: 700; color: var(--ink); }
.brand-app { color: var(--muted); padding-left: 10px; border-left: 1px solid var(--line); }
.nav { display: flex; gap: 4px; flex: 1; }
.nav-link { color: var(--slate); padding: 8px 12px; border-radius: 8px; font-weight: 500; }
.nav-link:hover { background: var(--tint); text-decoration: none; }
.user { color: var(--muted); font-size: 13px; }

.main { max-width: 1280px; margin: 0 auto; padding: 24px 28px 48px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap; margin-bottom: 18px; }
h1 { margin: 0; font-size: 26px; color: var(--ink); font-weight: 600; letter-spacing: -0.01em; }
.sub { margin: 6px 0 0; color: var(--muted); }
.crumbs { color: var(--muted); font-size: 13px; margin-bottom: 8px; }

.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.dd { min-width: 170px; font-size: 13px; }
.dd-channel { min-width: 250px; }
.dd-views { min-width: 170px; }
.input { width: 160px; height: 36px; border: 1px solid #ccc; border-radius: 4px; padding: 0 10px; font: inherit; }
.btn { height: 36px; padding: 0 14px; border: 0; border-radius: 8px; background: var(--purple); color: var(--ink); font-weight: 600; cursor: pointer; font: inherit; font-weight: 600; }
.btn:hover { filter: brightness(1.05); }
.btn-ghost { background: #fff; border: 1px solid var(--line); }
.toast { color: #1F7A4D; font-size: 13px; min-height: 18px; margin-bottom: 6px; }

.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; }
.kpi-label { color: var(--muted); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }
.kpi-value { font-size: 28px; font-weight: 600; color: var(--ink); margin-top: 6px; letter-spacing: -0.01em; }
.kpi-note { color: var(--muted); font-size: 12px; margin-top: 2px; }
.kpi-alert { border-color: #F3C4C0; background: #FFF8F7; }
.kpi-alert .kpi-value { color: var(--alert); }

.card { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; margin-bottom: 16px; }
.card-title { margin: 2px 0 10px; font-size: 14px; color: var(--ink); font-weight: 600; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid-2-1 { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; }
.grid-2 > .card, .grid-2-1 > .card { margin-bottom: 16px; }

.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.table td { padding: 10px; border-bottom: 1px solid #F0F1F4; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }

.pills { display: flex; gap: 6px; flex-wrap: wrap; }
.pill { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: #fff; color: var(--slate); font-weight: 500; }
.pill-on { background: var(--ink); color: #fff; border-color: var(--ink); }
.pill:hover { text-decoration: none; border-color: var(--purple); }

.report-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.report-card { display: block; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 18px; color: var(--slate); }
.report-card:hover { border-color: var(--purple); text-decoration: none; box-shadow: 0 4px 16px rgba(122,118,255,0.12); }
.report-card h3 { margin: 6px 0 8px; color: var(--ink); font-size: 17px; }
.report-card p { margin: 0 0 12px; line-height: 1.5; }
.report-date { font-size: 12px; color: var(--purple); font-weight: 600; }
.report-meta { font-size: 12px; color: var(--muted); }
.prose { line-height: 1.6; }
.prose p:first-child { font-weight: 600; color: var(--ink); margin-top: 0; }
.muted { color: var(--muted); font-size: 13px; }

.status { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.ag-theme-quartz { --ag-font-family: Inter, system-ui, sans-serif; --ag-font-size: 13px; }
.status-pending { color: #9A6700; font-weight: 600; }
.status-approved { color: #1F7A4D; font-weight: 600; }
.status-rejected { color: #B42318; font-weight: 600; }
.status-info { color: #3479F3; font-weight: 600; }
.field { margin-bottom: 18px; }
.field-label { display: block; font-weight: 600; color: var(--ink); margin-bottom: 8px; }
.field-help { color: var(--muted); font-size: 12px; margin-top: 6px; }
.field-error { color: var(--alert); font-size: 13px; margin-top: 6px; min-height: 0; }
.field-error:not(:empty) { font-weight: 500; }
.radios label { display: inline-flex; align-items: center; gap: 8px; margin-right: 18px; padding: 8px 14px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; }
.radio-input { accent-color: var(--purple); }
.textarea { width: 100%; min-height: 110px; border: 1px solid #ccc; border-radius: 8px; padding: 10px 12px; font: inherit; resize: vertical; }
.form-actions { display: flex; gap: 10px; align-items: center; margin-top: 4px; }
.link-btn { display: inline-flex; align-items: center; color: var(--slate); text-decoration: none !important; }
.btn:disabled { opacity: 0.6; cursor: progress; }
.alert { margin-top: 14px; padding: 10px 14px; border-radius: 8px; font-weight: 500; }
.alert-ok { background: #ECFDF3; color: #1F7A4D; border: 1px solid #ABEFC6; }
.alert-error { background: #FEF3F2; color: var(--alert); border: 1px solid #FECDCA; }
.facts { display: grid; grid-template-columns: 160px 1fr; gap: 8px 12px; margin: 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; color: var(--ink); font-weight: 500; }
.timeline { margin: 0; padding-left: 18px; line-height: 1.6; }
