@font-face {
  font-family: "Schibsted Grotesk";
  src: url("/assets/SchibstedGrotesk-normal-400-900.woff2") format("woff2");
  font-weight: 400 900;
  font-display: swap;
}

:root {
  --bg: #FFF;
  --soft: #F6F6F4;
  --ink: #111;
  --ink2: #3C3C3A;
  --muted: #6E6E6A;
  --line: #E4E4E0;
  --accent: #1D4ED8;
  --ok: #1F7A4D;
  --warn: #9A6200;
  --no: #B42318;
  font-family: "Schibsted Grotesk", sans-serif;
  color: var(--ink);
  background: var(--bg);
  font-synthesis: none;
}

* { box-sizing: border-box; }
html, body, #app { width: 100%; max-width: 100%; }
body { margin: 0; min-width: 320px; }
button, input, select { font: inherit; }
button { cursor: pointer; }
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: var(--soft); }
.login-card { width: min(100%, 380px); padding: 32px; border: 1px solid var(--line); border-radius: 14px; background: var(--bg); }
.brand-mark { width: 32px; height: 32px; }
.login h1 { font-size: 24px; margin: 22px 0 6px; }
.login form, .stack { display: grid; gap: 16px; }
.link-button { display: block; margin: 14px auto 0; border: 0; color: var(--muted); background: transparent; }
label { display: grid; gap: 7px; color: var(--ink2); font-size: 13px; }
input, select { min-height: 42px; width: 100%; border: 1px solid var(--line); border-radius: 7px; padding: 9px 11px; color: var(--ink); background: var(--bg); }
button, .button { min-height: 40px; border: 1px solid var(--line); border-radius: 7px; padding: 8px 13px; color: var(--ink); background: var(--bg); font-weight: 600; text-decoration: none; }
button.primary { border-color: var(--ink); color: var(--bg); background: var(--ink); }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.shell { width: 100%; min-height: 100vh; display: grid; grid-template-columns: 244px minmax(0, 1fr); }
.sidebar { display: flex; flex-direction: column; gap: 28px; border-right: 1px solid var(--line); padding: 24px 16px; }
.identity { display: flex; align-items: center; gap: 11px; padding: 0 8px; }
.identity strong { display: block; font-size: 18px; }
.identity span { color: var(--muted); font-size: 12px; }
.identity select { min-height: 28px; border: 0; padding: 2px 0; color: var(--muted); font-size: 12px; }
.nav { display: grid; gap: 4px; }
.nav button { min-height: 40px; text-align: left; border: 0; padding-left: 11px; color: var(--ink2); font-weight: 500; }
.nav button.active { color: var(--ink); background: var(--soft); font-weight: 700; }
.sidebar-bottom { margin-top: auto; }
.content { min-width: 0; max-width: 100%; padding: 42px clamp(20px, 5vw, 72px); }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 34px; }
.topbar-user { display: flex; align-items: center; gap: 12px; min-width: 0; }
.topbar-user select { width: auto; max-width: 180px; }
.licence-note { margin: -18px 0 24px; color: var(--muted); font-size: 13px; }
h1 { margin: 0; font-size: clamp(25px, 3vw, 34px); letter-spacing: -0.04em; }
h2 { margin: 0; font-size: 18px; }
.grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 28px; }
.metric, .panel { border: 1px solid var(--line); border-radius: 10px; background: var(--bg); }
.metric { min-height: 112px; padding: 17px; }
.metric span { display: block; color: var(--muted); font-size: 13px; }
.metric strong { display: block; margin-top: 15px; font-size: 27px; }
.panel { min-width: 0; max-width: 100%; overflow: hidden; margin-bottom: 20px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 17px 18px; border-bottom: 1px solid var(--line); }
.panel-body { padding: 18px; }
.table-wrap { width: 100%; min-width: 0; max-width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th, td { padding: 13px 15px; border-bottom: 1px solid var(--line); vertical-align: middle; font-size: 13px; }
th { color: var(--muted); font-weight: 600; }
tr:last-child td { border-bottom: 0; }
.status { display: inline-flex; align-items: center; gap: 7px; font-weight: 600; }
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.status.ok { color: var(--ok); }
.status.ok::before { background: var(--ok); }
.status.mask { color: var(--accent); }
.status.mask::before { background: var(--accent); }
.status.warn { color: var(--warn); }
.status.warn::before { background: var(--warn); }
.status.no { color: var(--no); }
.status.no::before { background: var(--no); }
.pill { display: inline-flex; max-width: 220px; align-items: center; border-radius: 999px; padding: 5px 9px; font-size: 12px; font-weight: 700; white-space: normal; }
.pill.ok { color: var(--ok); background: color-mix(in srgb, var(--ok) 12%, white); }
.pill.mask { color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, white); }
.pill.no { color: var(--no); background: color-mix(in srgb, var(--no) 12%, white); }
.muted { color: var(--muted); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.form-row { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; }
.form-row label { min-width: 180px; flex: 1; }
.form-row button { flex: none; }
.provider-url, .model-row, code { overflow-wrap: anywhere; }
.model-row { justify-content: space-between; }
.model-location-heading { margin: 0; color: var(--muted); font-size: 14px; }
.model-location-group { gap: 10px; }
.model-filter { max-width: 420px; }
.panel-disclosure > summary { list-style: none; }
.panel-disclosure > summary::-webkit-details-marker { display: none; }
.panel-disclosure:not([open]) > summary { border-bottom: 0; }
.field-label { display: block; margin-bottom: 7px; color: var(--ink2); font-size: 13px; }
.gateway-key-body { display: flex; align-items: center; gap: 8px; }
.gateway-key-value { display: block; min-width: 0; max-width: 100%; overflow-wrap: anywhere; }
.check-row { display: flex; align-items: center; gap: 8px; }
.check-row input { width: 18px; min-height: 18px; }
[hidden] { display: none !important; }
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.toolbar select, .toolbar input { width: auto; min-width: 150px; }
.rule-table select { min-width: 140px; }
.inline { display: flex; align-items: center; gap: 9px; }
.switch { width: 42px; height: 24px; accent-color: var(--ok); }
.dialog { width: min(500px, calc(100vw - 28px)); border: 1px solid var(--line); border-radius: 12px; padding: 0; }
.dialog::backdrop { background: rgb(17 17 17 / 35%); }
.dialog-inner { padding: 22px; }
.dialog-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.notice { padding: 12px 14px; border-radius: 8px; background: var(--soft); color: var(--ink2); }
.notice.success { color: var(--ok); }
.notice.error { color: var(--no); }
.empty { padding: 22px; color: var(--muted); }
.history-row { display: grid; grid-template-columns: auto minmax(100px, 1fr) minmax(100px, 1fr) minmax(120px, 2fr) auto auto; align-items: center; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.history-row:last-child { border-bottom: 0; }
details summary { cursor: pointer; font-weight: 600; }
details dl { min-width: 220px; margin: 10px 0 4px; }
details dl div { display: grid; grid-template-columns: 85px minmax(0, 1fr); gap: 8px; padding: 4px 0; }
details dt { color: var(--muted); }
details dd { min-width: 0; margin: 0; overflow-wrap: anywhere; }
.report-data { min-width: 0; padding: 18px; }
.report-data .grid { margin-bottom: 18px; }
.report-data .panel { margin-bottom: 14px; }
.report-data .panel-body { padding: 0; }
pre { max-width: 100%; margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; font: inherit; font-size: 13px; }
.mobile-brand, .menu-toggle { display: none; }

@media (max-width: 900px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .content { padding: 30px 24px; }
}
@media (max-width: 600px) {
  .shell { display: block; }
  .sidebar { display: none; }
  .sidebar.open { display: flex; position: absolute; z-index: 5; inset: 0 auto 0 0; width: min(82vw, 280px); background: var(--bg); box-shadow: 10px 0 30px rgb(17 17 17 / 10%); }
  .menu-toggle { display: inline-flex; }
  .mobile-brand { display: flex; align-items: center; gap: 8px; }
  .topbar { flex-wrap: wrap; margin-bottom: 24px; }
  .topbar h1 { order: 2; width: 100%; }
  .topbar-user { order: 3; width: 100%; justify-content: space-between; flex-wrap: wrap; }
  .topbar-user > .muted { max-width: 100%; overflow-wrap: anywhere; }
  .content { padding: 20px 15px 28px; }
  #page-content, .panel-body, .toolbar { min-width: 0; max-width: 100%; }
  .panel-head { align-items: flex-start; flex-wrap: wrap; }
  .form-row { display: grid; grid-template-columns: minmax(0, 1fr); }
  .form-row label { min-width: 0; }
  .topbar-user select { max-width: 100%; }
  .licence-note { margin-top: -10px; }
  .gateway-key-body { flex-direction: column; align-items: flex-start; }
  .grid { gap: 8px; }
  .metric { min-height: 98px; padding: 12px; }
  .metric strong { font-size: 23px; }
  th, td { padding: 11px 12px; }
  .table-wrap table { min-width: 620px; }
  .toolbar { align-items: stretch; }
  .toolbar select, .toolbar input { min-width: 0; flex: 1; }
  .history-row { grid-template-columns: 1fr; align-items: start; }
  .report-data .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
