/* RequestGuard backoffice */
:root {
  color-scheme: light;
  --page: #f9f9f7;
  --surface: #fcfcfb;
  --surface-2: #f3f2ee;
  --ink: #0b0b0b;
  --ink-2: #52514e;
  --muted: #898781;
  --grid: #e1e0d9;
  --axis: #c3c2b7;
  --line: rgba(11, 11, 11, 0.10);
  --accent: #2a78d6;
  --accent-ink: #ffffff;
  --series-1: #2a78d6;
  --series-2: #eb6834;
  --series-3: #1baf7a;
  --good: #0ca30c;
  --good-ink: #006300;
  --warning: #fab219;
  --serious: #ec835a;
  --critical: #d03b3b;
  --side: #121211;
  --side-ink: #c3c2b7;
  --side-on: #ffffff;
  --shadow: 0 1px 2px rgba(11, 11, 11, .04), 0 1px 1px rgba(11, 11, 11, .03);
  --radius: 10px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --page: #0d0d0d; --surface: #1a1a19; --surface-2: #232321; --ink: #ffffff; --ink-2: #c3c2b7; --muted: #898781;
    --grid: #2c2c2a; --axis: #383835; --line: rgba(255, 255, 255, 0.10); --accent: #3987e5;
    --series-1: #3987e5; --series-2: #d95926; --series-3: #199e70; --good-ink: #0ca30c; --side: #000000; --shadow: none;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #0d0d0d; --surface: #1a1a19; --surface-2: #232321; --ink: #ffffff; --ink-2: #c3c2b7; --muted: #898781;
  --grid: #2c2c2a; --axis: #383835; --line: rgba(255, 255, 255, 0.10); --accent: #3987e5;
  --series-1: #3987e5; --series-2: #d95926; --series-3: #199e70; --good-ink: #0ca30c; --side: #000000; --shadow: none;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--page); color: var(--ink);
  font: 14px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; }
.muted { color: var(--muted); }
.ic { width: 18px; height: 18px; flex: none; }

/* Shell */
.shell { display: flex; min-height: 100vh; }
.side {
  width: 228px; flex: none; background: var(--side); color: var(--side-ink);
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; padding: 18px 12px;
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--side-on); font-weight: 700; font-size: 16px; padding: 4px 10px 18px; letter-spacing: -.01em; }
.brand:hover { text-decoration: none; }
.logo { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: var(--accent); color: #fff; }
.side nav { display: flex; flex-direction: column; gap: 2px; }
.side nav a, .side-foot a {
  display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: 8px; color: var(--side-ink); font-weight: 500;
}
.side nav a:hover, .side-foot a:hover { background: rgba(255, 255, 255, .06); color: var(--side-on); text-decoration: none; }
.side nav a.on { background: rgba(255, 255, 255, .10); color: var(--side-on); }
.side nav a span { flex: 1; }
.pill { background: var(--critical); color: #fff; font-size: 11px; border-radius: 99px; padding: 1px 7px; font-weight: 700; }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.linkish { background: none; border: 0; color: var(--side-ink); text-align: left; padding: 8px 10px; cursor: pointer; font: inherit; border-radius: 8px; }
.linkish:hover { background: rgba(255, 255, 255, .06); color: var(--side-on); }

.main { flex: 1; min-width: 0; }
.top {
  display: flex; align-items: center; gap: 14px; padding: 18px 28px; border-bottom: 1px solid var(--line);
  background: var(--surface); position: sticky; top: 0; z-index: 5;
}
.top h1 { font-size: 19px; margin: 0; flex: 1; letter-spacing: -.01em; }
.burger { display: none; background: none; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); font-size: 18px; padding: 2px 10px; cursor: pointer; }
.filters { display: flex; gap: 8px; }
.content { padding: 24px 28px 60px; max-width: 1440px; }

/* Controls */
input[type=text], input[type=password], input[type=email], input[type=url], input[type=number], input[type=search], select, textarea {
  font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 8px;
  padding: 7px 10px; min-height: 36px; max-width: 100%;
}
textarea { width: 100%; min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
label { display: block; font-weight: 600; margin: 0 0 4px; font-size: 13px; }
.field { margin-bottom: 14px; }
.field .hint { font-weight: 400; color: var(--muted); font-size: 12.5px; margin-top: 3px; }
.check { display: flex; gap: 8px; align-items: flex-start; font-weight: 500; }
.check input { margin-top: 3px; }
.btn {
  display: inline-flex; align-items: center; gap: 6px; font: inherit; font-weight: 600; cursor: pointer;
  border-radius: 8px; padding: 7px 14px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); min-height: 36px;
}
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent); filter: brightness(1.08); }
.btn-danger { color: var(--critical); }
.btn { white-space: nowrap; }
td.mono { white-space: nowrap; }
.btn-xs { padding: 2px 9px; min-height: 26px; font-size: 12px; border-radius: 6px; }
.inline { display: inline; margin: 0; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.row > .field { margin-bottom: 0; }

/* Cards & grid */
.grid { display: grid; gap: 16px; }
.g-kpi { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-21 { grid-template-columns: 2fr 1fr; }
.mt { margin-top: 16px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); min-width: 0; }
.card-h { display: flex; align-items: center; gap: 10px; padding: 14px 18px 0; }
.card-h h2 { font-size: 14px; margin: 0; flex: 1; }
.card-h .sub { color: var(--muted); font-size: 12.5px; }
.card-b { padding: 14px 18px 18px; }
.card-b.flush { padding: 8px 0 4px; }

.kpi { padding: 14px 16px; }
.kpi .k { color: var(--ink-2); font-size: 12.5px; font-weight: 500; }
.kpi .v { font-size: 26px; font-weight: 700; letter-spacing: -.02em; margin-top: 2px; }
.kpi .d { font-size: 12px; color: var(--muted); }
.kpi .d .up-bad, .kpi .d .down-bad { color: var(--critical); font-weight: 600; }
.kpi .d .up-good, .kpi .d .down-good { color: var(--good-ink); font-weight: 600; }

.chart-box { position: relative; height: 240px; }
.legend { display: flex; gap: 16px; font-size: 12.5px; color: var(--ink-2); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }

/* Tables */
.tbl-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 8px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: none; white-space: nowrap; }
td { font-size: 13px; }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tbody tr:hover { background: var(--surface-2); }
tr.click { cursor: pointer; }
.trunc { max-width: 420px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trunc-s { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-b.flush th:first-child, .card-b.flush td:first-child { padding-left: 18px; }
.card-b.flush th:last-child, .card-b.flush td:last-child { padding-right: 18px; }

/* Bars inside tables (share-of-total) */
.bar { position: relative; height: 6px; background: var(--surface-2); border-radius: 3px; min-width: 60px; }
.bar > span { position: absolute; inset: 0 auto 0 0; background: var(--series-1); border-radius: 3px; }

/* Badges */
.sev { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; color: var(--ink); white-space: nowrap; }
.sev i { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }
.sev-critical i { background: var(--critical); }
.sev-serious i { background: var(--serious); }
.sev-warning i { background: var(--warning); }
.sev-info i { background: var(--series-1); border-radius: 50%; }
.sev-none i { background: var(--axis); }
.score { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.code { font-family: ui-monospace, Menlo, monospace; font-size: 12px; font-weight: 600; padding: 1px 6px; border-radius: 5px; background: var(--surface-2); }
.code.s4 { box-shadow: inset 2px 0 0 var(--serious); }
.code.s5 { box-shadow: inset 2px 0 0 var(--critical); }
.tag { display: inline-block; font-size: 11.5px; padding: 1px 7px; border-radius: 99px; border: 1px solid var(--line); margin: 1px 4px 1px 0; color: var(--ink-2); white-space: nowrap; }
.method { font-family: ui-monospace, Menlo, monospace; font-size: 11.5px; font-weight: 700; color: var(--ink-2); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; }
.dot.on { background: var(--good); }
.dot.off { background: var(--critical); }
.dot.idle { background: var(--axis); }
.flag { margin-right: 5px; }
.blocked-tag { font-size: 11px; font-weight: 700; color: var(--critical); border: 1px solid var(--critical); border-radius: 4px; padding: 0 5px; }

.flash { margin: 16px 28px 0; padding: 10px 14px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); }
.flash-ok { box-shadow: inset 3px 0 0 var(--good); }
.flash-err { box-shadow: inset 3px 0 0 var(--critical); }

.pager { display: flex; gap: 16px; align-items: center; justify-content: flex-end; padding: 12px 18px; font-size: 13px; color: var(--muted); }
.empty { padding: 28px 18px; text-align: center; color: var(--muted); }
.kv { display: grid; grid-template-columns: 160px 1fr; gap: 6px 16px; font-size: 13px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; word-break: break-all; }
pre.json { background: var(--surface-2); border-radius: 8px; padding: 12px; overflow: auto; font-size: 12px; max-height: 360px; margin: 0; white-space: pre-wrap; word-break: break-all; }
.codebox { display: flex; gap: 8px; align-items: stretch; }
.codebox input { flex: 1; font-family: ui-monospace, Menlo, monospace; font-size: 12px; }
details.site-edit summary { cursor: pointer; color: var(--accent); font-weight: 600; font-size: 13px; }
.alert-row.unread td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
.alert-msg { white-space: pre-wrap; color: var(--ink-2); font-size: 12.5px; margin-top: 2px; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 14px; }
.toolbar .field { margin: 0; }
.section-title { font-size: 15px; margin: 28px 0 10px; }
.notice { padding: 12px 14px; border-radius: 8px; background: var(--surface-2); color: var(--ink-2); font-size: 13px; }

/* Auth pages */
@font-face { font-family: "Sora"; font-weight: 700; font-style: normal; font-display: swap; src: url("sora-700.woff2") format("woff2"); }
.login-logo { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 4px 0 18px; margin-bottom: 18px; border-bottom: 1px solid var(--line); }
.login-logo img { width: 96px; height: 96px; border-radius: 21px; box-shadow: 0 0 0 1px rgba(255, 255, 255, .08); }
.wordmark { font-family: "Sora", system-ui, sans-serif; font-weight: 700; font-size: 30px; letter-spacing: -0.03em; line-height: 1.1; color: #ffffff; }
.wordmark span { color: #2fbf71; }
.tagline { color: var(--ink-2); font-size: 13.5px; }
.auth { background: #0b0b0a; min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.auth .card { width: 100%; max-width: 420px; padding: 28px; }
.auth h1 { font-size: 20px; margin: 10px 0 4px; }
.auth .brand { color: var(--ink); padding: 0; }
.auth.wide .card { max-width: 620px; }

@media (max-width: 1200px) { .g-kpi { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 960px) {
  .g-2, .g-3, .g-21 { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; left: -240px; z-index: 20; transition: left .2s; }
  .side.open { left: 0; }
  .burger { display: block; }
}
@media (max-width: 640px) {
  .top { flex-wrap: wrap; padding: 12px 16px; }
  .filters { width: 100%; }
  .filters select { flex: 1; }
  .content { padding: 16px 16px 40px; }
  .g-kpi { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .flash { margin: 12px 16px 0; }
  .kv { grid-template-columns: 1fr; }
}

/* Platform additions */
.brand-logo { width: 32px; height: 32px; border-radius: 8px; box-shadow: 0 0 0 1px rgba(255, 255, 255, .1); }
.wordmark-sm { font-family: "Sora", system-ui, sans-serif; font-weight: 700; letter-spacing: -.02em; color: #fff; }
.wordmark-sm span { color: #2fbf71; }
.area-tag { margin: -10px 10px 14px 52px; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #2fbf71; }
.dot.warn { background: var(--serious); }
.steps { margin: 0; padding-left: 22px; display: grid; gap: 14px; }
.steps li { padding-left: 4px; }
.pay-methods { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.pay-btn { display: flex; flex-direction: column; gap: 3px; text-align: left; padding: 14px 16px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; font: inherit; min-height: 64px; }
.pay-btn strong { font-size: 15px; }
.pay-btn span { font-size: 12.5px; color: var(--ink-2); }
.pay-btn:hover { border-color: var(--accent); }
.pay-btn.pay-zahls { border-color: #000; background: #000; color: #fff; }
.pay-btn.pay-zahls span { color: #c3c2b7; }
.pay-btn.pay-revolut { border-color: #191c1f; }
