@font-face { font-family: "InterLocal"; src: url("fonts/inter-latin-400-normal.woff2") format("woff2"); font-weight: 400; }
@font-face { font-family: "InterLocal"; src: url("fonts/inter-latin-500-normal.woff2") format("woff2"); font-weight: 500; }
@font-face { font-family: "InterLocal"; src: url("fonts/inter-latin-600-normal.woff2") format("woff2"); font-weight: 600; }
@font-face { font-family: "InterLocal"; src: url("fonts/inter-latin-700-normal.woff2") format("woff2"); font-weight: 700; }

:root {
  --bg: hsl(214 32% 97%);
  --card: #fff;
  --fg: hsl(222 47% 13%);
  --muted: hsl(215 18% 46%);
  --muted-bg: hsl(214 32% 95%);
  --border: hsl(214 30% 90%);
  --primary: hsl(226 64% 44%);
  --primary-soft: hsl(226 80% 96%);
  --accent: hsl(263 66% 56%);
  --accent-soft: hsl(263 80% 96%);
  --red: hsl(0 72% 48%);
  --red-soft: hsl(0 80% 96%);
  --amber: hsl(32 90% 46%);
  --amber-soft: hsl(36 92% 94%);
  --green: hsl(152 52% 38%);
  --green-soft: hsl(152 56% 94%);
  --side: hsl(224 50% 14%);
  --side-fg: hsl(218 30% 78%);
  --radius: 12px;
  --shadow: 0 1px 2px hsl(222 47% 13% / .05), 0 1px 3px hsl(222 47% 13% / .06);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: "InterLocal", Inter, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg); color: var(--fg); font-size: 14px; line-height: 1.45;
  -webkit-font-smoothing: antialiased; font-feature-settings: "cv11";
}
a { color: var(--primary); text-decoration: none; }
button { font: inherit; cursor: pointer; }

/* Layout */
.app { display: grid; grid-template-columns: 236px 1fr; height: 100vh; }
.sidebar { background: var(--side); color: var(--side-fg); display: flex; flex-direction: column; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; padding: 18px 18px 14px; border-bottom: 1px solid hsl(224 40% 22%); }
.brand-mark { width: 34px; height: 34px; flex: none; }
.brand-text { line-height: 1.15; }
.brand-text b { color: #fff; font-size: 15px; font-weight: 700; letter-spacing: -.01em; display: block; }
.brand-text span { font-size: 11.5px; color: hsl(263 70% 78%); font-weight: 600; letter-spacing: .02em; }
.nav { padding: 8px 10px 16px; flex: 1; }
.nav-group { font-size: 10.5px; text-transform: uppercase; letter-spacing: .09em; color: hsl(218 20% 55%); padding: 14px 10px 6px; font-weight: 600; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; color: var(--side-fg); font-weight: 500; font-size: 13.5px; }
.nav a:hover { background: hsl(224 40% 20%); color: #fff; }
.nav a.active { background: hsl(226 64% 44% / .9); color: #fff; }
.nav svg { width: 17px; height: 17px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.side-foot { padding: 14px 18px; font-size: 11.5px; color: hsl(218 20% 58%); border-top: 1px solid hsl(224 40% 22%); }
.side-foot b { color: hsl(218 30% 82%); font-weight: 600; }

.main { display: flex; flex-direction: column; min-width: 0; height: 100vh; }
.topbar { height: 58px; flex: none; background: #fff; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 14px; padding: 0 26px; }
.tenant { display: flex; align-items: center; gap: 10px; }
.tenant-logo { width: 30px; height: 30px; border-radius: 8px; background: linear-gradient(135deg, hsl(196 70% 40%), hsl(226 64% 44%)); color: #fff; font-weight: 700; font-size: 13px; display: grid; place-items: center; }
.tenant b { font-size: 14px; font-weight: 600; }
.tenant small { display: block; color: var(--muted); font-size: 11.5px; }
.top-spacer { flex: 1; }
.badge-sample { font-size: 11.5px; font-weight: 600; color: hsl(32 80% 32%); background: var(--amber-soft); border: 1px solid hsl(36 80% 82%); padding: 4px 10px; border-radius: 999px; }
.top-meta { font-size: 12px; color: var(--muted); }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: 12px; display: grid; place-items: center; }

.content { flex: 1; overflow-y: auto; padding: 22px 26px 40px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.page-head h1 { margin: 0; font-size: 21px; font-weight: 700; letter-spacing: -.015em; }
.page-head p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.crumb { font-size: 11.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--primary); font-weight: 600; margin-bottom: 4px; }

/* Grid + cards */
.grid { display: grid; gap: 16px; }
.g-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-main { grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); }
.g-side { grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); }
.mt { margin-top: 16px; }
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; min-width: 0; }
.card h3 { margin: 0 0 2px; font-size: 14.5px; font-weight: 600; }
.card .sub { color: var(--muted); font-size: 12.5px; margin: 0 0 14px; }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }

.kpi { display: flex; flex-direction: column; gap: 4px; }
.kpi .label { color: var(--muted); font-size: 12.5px; font-weight: 500; }
.kpi .value { font-variant-numeric: tabular-nums; font-size: 28px; font-weight: 700; letter-spacing: -.02em; }
.kpi .foot { font-size: 12px; color: var(--muted); }
.kpi .ico { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; float: right; }
.kpi .ico svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }

/* Pills */
.pill { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 600; padding: 2px 9px; border-radius: 999px; white-space: nowrap; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.nodot::before { display: none; }
.p-red { color: var(--red); background: var(--red-soft); }
.p-amber { color: hsl(32 90% 38%); background: var(--amber-soft); }
.p-green { color: var(--green); background: var(--green-soft); }
.p-blue { color: var(--primary); background: var(--primary-soft); }
.p-violet { color: var(--accent); background: var(--accent-soft); }
.p-grey { color: var(--muted); background: var(--muted-bg); }

/* Tables */
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; font-weight: 600; color: var(--muted); font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; padding: 9px 10px; border-bottom: 1px solid var(--border); background: hsl(214 32% 98%); white-space: nowrap; }
td { padding: 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tr.click { cursor: pointer; }
tr.click:hover td { background: var(--primary-soft); }
tr.sel td { background: var(--primary-soft); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; }
.muted { color: var(--muted); }
.strong { font-weight: 600; }
.right { text-align: right; }
.center { text-align: center; }
.tbl-wrap { overflow-x: auto; margin: 0 -18px -18px; }
.tbl-wrap table th:first-child, .tbl-wrap table td:first-child { padding-left: 18px; }
.tbl-wrap table th:last-child, .tbl-wrap table td:last-child { padding-right: 18px; }

/* Lists */
.alert { display: flex; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--border); align-items: flex-start; }
.alert:last-child { border-bottom: 0; padding-bottom: 0; }
.alert .bar { width: 4px; align-self: stretch; border-radius: 4px; flex: none; }
.alert b { font-weight: 600; font-size: 13.5px; display: block; }
.alert small { color: var(--muted); font-size: 12.5px; }
.alert .go { margin-left: auto; font-size: 12px; font-weight: 600; white-space: nowrap; align-self: center; }

/* Readiness strip */
.ready { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.ready-item { border: 1px solid var(--border); border-radius: 10px; padding: 12px; background: #fff; }
.ready-item b { font-size: 13px; font-weight: 600; display: block; }
.ready-item small { color: var(--muted); font-size: 11.5px; display: block; margin: 2px 0 8px; min-height: 16px; }
.meter { height: 7px; border-radius: 99px; background: var(--muted-bg); overflow: hidden; }
.meter > i { display: block; height: 100%; border-radius: 99px; }
.ready-item .pct { font-size: 12px; font-weight: 700; margin-top: 6px; display: flex; justify-content: space-between; }

/* Buttons + inputs */
.btn { white-space: nowrap; border: 1px solid var(--border); background: #fff; color: var(--fg); padding: 7px 13px; border-radius: 8px; font-weight: 600; font-size: 13px; display: inline-flex; gap: 7px; align-items: center; }
.btn:hover { border-color: hsl(226 40% 75%); }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.primary:hover { background: hsl(226 64% 38%); }
.btn svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.seg { display: inline-flex; background: var(--muted-bg); border-radius: 9px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: transparent; padding: 5px 11px; border-radius: 7px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.seg button.on { background: #fff; color: var(--fg); box-shadow: var(--shadow); }
.filters { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
textarea { width: 100%; min-height: 150px; resize: vertical; border: 1px solid var(--border); border-radius: 10px; padding: 12px; font: 13px/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: var(--fg); background: #fff; }
textarea:focus { outline: 2px solid hsl(226 70% 55% / .35); border-color: var(--primary); }
.out { min-height: 150px; border: 1px solid var(--border); border-radius: 10px; padding: 12px; font: 13px/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; background: hsl(214 32% 98%); white-space: pre-wrap; word-break: break-word; }
.tok { background: var(--accent-soft); color: var(--accent); border-radius: 4px; padding: 0 3px; font-weight: 600; }
.inj { background: var(--red-soft); color: var(--red); border-radius: 4px; padding: 0 3px; font-weight: 600; text-decoration: line-through; }
.verdict { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 10px; font-weight: 600; margin-top: 12px; }
.verdict.block { background: var(--red-soft); color: var(--red); }
.verdict.allow { background: var(--green-soft); color: var(--green); }
.verdict.warn { background: var(--amber-soft); color: hsl(32 90% 34%); }
.verdict big { font-size: 15px; font-weight: 800; letter-spacing: .04em; }
.verdict span { font-weight: 500; color: var(--fg); font-size: 13px; }
.det-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }

/* Drawer */
.drawer-bg { position: fixed; inset: 0; background: hsl(222 47% 13% / .35); z-index: 40; opacity: 0; pointer-events: none; transition: opacity .18s; }
.drawer-bg.open { opacity: 1; pointer-events: auto; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(680px, 92vw); background: var(--bg); z-index: 50; transform: translateX(100%); transition: transform .22s ease; display: flex; flex-direction: column; box-shadow: -12px 0 40px hsl(222 47% 13% / .18); }
.drawer:not(.open) { box-shadow: none; visibility: hidden; transition: transform .22s ease, visibility 0s .22s; }
.drawer.open { transform: none; }
.drawer-head { background: #fff; padding: 18px 22px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.drawer-head h2 { margin: 2px 0 6px; font-size: 18px; }
.drawer-body { padding: 18px 22px 30px; overflow-y: auto; display: grid; gap: 14px; }
.x { border: 0; background: var(--muted-bg); width: 32px; height: 32px; border-radius: 8px; font-size: 18px; color: var(--muted); flex: none; }
.kv { display: grid; grid-template-columns: 150px 1fr; gap: 7px 12px; font-size: 13px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 500; }
pre.json { margin: 0; background: hsl(224 50% 12%); color: hsl(214 40% 88%); border-radius: 10px; padding: 14px; font-size: 11.5px; line-height: 1.55; overflow: auto; max-height: 300px; }
pre.json .k { color: hsl(199 85% 72%); }
pre.json .s { color: hsl(95 50% 70%); }
pre.json .n { color: hsl(35 90% 70%); }
.check { display: flex; align-items: center; gap: 9px; padding: 7px 0; border-bottom: 1px dashed var(--border); font-size: 13px; }
.check:last-child { border-bottom: 0; }
.ck { width: 20px; height: 20px; border-radius: 6px; display: grid; place-items: center; font-size: 12px; font-weight: 800; flex: none; }
.ck.y { background: var(--green-soft); color: var(--green); }
.ck.n { background: var(--red-soft); color: var(--red); }
.ck.p { background: var(--amber-soft); color: hsl(32 90% 38%); }
.ck.na { background: var(--muted-bg); color: var(--muted); }

/* Partners */
.partner { display: flex; flex-direction: column; gap: 10px; cursor: pointer; transition: border-color .15s, transform .15s; }
.partner:hover { border-color: hsl(226 50% 70%); transform: translateY(-1px); }
.partner.sel { border-color: var(--primary); box-shadow: 0 0 0 3px hsl(226 64% 44% / .12); }
.partner-top { display: flex; align-items: center; gap: 12px; }
.partner-top b { font-size: 14px; display: block; }
.partner-top small { color: var(--muted); font-size: 11.5px; }
.ev-row { display: flex; gap: 4px; flex-wrap: wrap; }

/* Matrix */
.matrix td, .matrix th { text-align: center; }
.matrix td:first-child, .matrix th:first-child { text-align: left; }
.dot { width: 14px; height: 14px; border-radius: 50%; display: inline-block; vertical-align: middle; }
.dot.full { background: var(--primary); }
.dot.part { background: conic-gradient(var(--primary) 0 50%, hsl(226 40% 88%) 50% 100%); }
.dot.none { background: var(--muted-bg); border: 1px solid var(--border); }
.legend { display: flex; gap: 16px; font-size: 12px; color: var(--muted); align-items: center; flex-wrap: wrap; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }

.note { font-size: 12px; color: var(--muted); margin-top: 10px; }
.callout { background: var(--primary-soft); border: 1px solid hsl(226 70% 88%); color: hsl(226 50% 28%); border-radius: 10px; padding: 12px 14px; font-size: 13px; }
.callout.red { background: var(--red-soft); border-color: hsl(0 70% 88%); color: hsl(0 60% 30%); }
.callout b { font-weight: 700; }
.foot-brand { margin-top: 18px; font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.foot-brand b { color: var(--accent); }

.toast { position: fixed; bottom: 24px; left: 50%; transform: translate(-50%, 20px); background: var(--side); color: #fff; padding: 11px 18px; border-radius: 10px; font-size: 13px; font-weight: 500; opacity: 0; transition: all .2s; z-index: 80; pointer-events: none; box-shadow: 0 10px 30px hsl(222 47% 13% / .3); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

svg text { font-family: inherit; }
.chart-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-top: 8px; }
.chart-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }

@media (max-width: 1400px) {
  .content { padding: 18px 20px 32px; }
  .kpi .value { font-size: 25px; }
  .ready { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
}
@media (max-width: 1100px) {
  .app { grid-template-columns: 70px 1fr; }
  .brand-text, .nav-group, .nav a span, .side-foot { display: none; }
  .g-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-main, .g-side, .g-3 { grid-template-columns: 1fr; }
  .ready { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
