/* WARDEN Support-Tool — Apple-clean, Light + Dark.
   Farben über CSS-Variablen, damit das Tool sich später an das Strides-Dashboard
   anpassen lässt. */

:root {
  --bg: #f5f5f7;
  --surface: #ffffff;
  --surface-2: #fbfbfd;
  --border: #e3e3e8;
  --text: #1d1d1f;
  --text-2: #6e6e73;
  --text-3: #8e8e93;
  --accent: #0071e3;
  --accent-soft: #e8f1fe;
  --green: #1f9d55; --green-soft: #e6f6ec;
  --amber: #b7791f; --amber-soft: #fdf3e2;
  --orange: #c2410c; --orange-soft: #fdeee6;
  --red: #c0362c; --red-soft: #fbeceb;
  --shadow: 0 1px 3px rgba(0,0,0,.06), 0 8px 24px rgba(0,0,0,.05);
  --radius: 16px;
}
[data-theme="dark"] {
  --bg: #000000;
  --surface: #1c1c1e;
  --surface-2: #161618;
  --border: #303034;
  --text: #f5f5f7;
  --text-2: #a1a1a6;
  --text-3: #7c7c80;
  --accent: #2997ff;
  --accent-soft: #14304d;
  --green: #34c759; --green-soft: #123021;
  --amber: #ffb340; --amber-soft: #332715;
  --orange: #ff9f0a; --orange-soft: #33240a;
  --red: #ff453a; --red-soft: #331b1a;
  --shadow: 0 1px 3px rgba(0,0,0,.4), 0 12px 30px rgba(0,0,0,.35);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

/* Accessibility: nur für Screenreader sichtbar + klare Tastatur-Fokus-Ringe */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
button:focus-visible, input:focus-visible, textarea:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 14px; line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

/* ---- Header ---- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 14px;
  padding: 12px 22px;
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand .logo {
  width: 34px; height: 34px; border-radius: 9px;
  background: linear-gradient(135deg, #0a84ff, #5e5ce6);
  display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 15px;
  box-shadow: 0 2px 8px rgba(10,132,255,.35);
}
.brand h1 { font-size: 15px; margin: 0; font-weight: 600; letter-spacing: -.01em; }
.brand .sub { font-size: 11.5px; color: var(--text-2); margin-top: 1px; }
.spacer { flex: 1; }
.pill {
  font-size: 11px; font-weight: 600; padding: 4px 10px; border-radius: 999px;
  border: 1px solid var(--border); color: var(--text-2); background: var(--surface-2);
  white-space: nowrap;
}
.pill.warn { color: var(--amber); border-color: color-mix(in srgb, var(--amber) 40%, var(--border)); background: var(--amber-soft); }
.pill.danger { color: var(--red); background: var(--red-soft); border-color: color-mix(in srgb, var(--red) 45%, var(--border)); }
.ksbtn { border-color: color-mix(in srgb, var(--red) 30%, var(--border)); }
.ksbtn:hover { color: var(--red); border-color: var(--red); }
.ksbtn.on { background: var(--red); color: #fff; border-color: var(--red); }
.ksbanner { max-width: 1240px; margin: 14px auto -4px; padding: 11px 18px; border-radius: 12px;
  background: var(--red-soft); color: var(--red); border: 1px solid color-mix(in srgb, var(--red) 40%, var(--border));
  font-size: 13px; font-weight: 600; }
.pill.ok { color: var(--green); background: var(--green-soft); border-color: color-mix(in srgb, var(--green) 35%, var(--border)); }
.usr { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-2); }
.iconbtn {
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text);
  width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; font-size: 15px;
}
.iconbtn:hover { background: var(--accent-soft); }
.ghost { border: 1px solid var(--border); background: var(--surface-2); color: var(--text-2);
  padding: 7px 12px; border-radius: 9px; font-size: 12.5px; font-weight: 600; }
.ghost:hover { color: var(--text); }

/* ---- Layout ---- */
.wrap { max-width: 1240px; margin: 22px auto; padding: 0 22px; display: grid;
  grid-template-columns: 300px 1fr; gap: 22px; align-items: start; }
@media (max-width: 900px) { .wrap { grid-template-columns: 1fr; } }

.card { background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow); }
.side { display: flex; flex-direction: column; gap: 18px; position: sticky; top: 78px; }
.sec-title { font-size: 12px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .04em; color: var(--text-3); margin: 0 0 10px; }

/* ---- Persona ---- */
.persona { padding: 18px; }
.persona .row { display: flex; align-items: center; gap: 12px; }
.avatar { width: 46px; height: 46px; border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #ff8fb1, #d6336c);
  display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 18px;
  box-shadow: 0 2px 10px rgba(214,51,108,.4); flex: none; }
.persona .name { font-weight: 650; font-size: 15px; }
.persona .role { font-size: 11.5px; color: var(--text-2); }
.persona p { color: var(--text-2); font-size: 12.5px; margin: 12px 0 8px; }
.pmeta { font-size: 11.5px; color: var(--text-2); background: var(--surface-2);
  border: 1px solid var(--border); border-radius: 8px; padding: 6px 10px; }
.pmeta b { color: var(--text); }
.namechips { display: flex; flex-wrap: wrap; gap: 6px; }
.namechips span { font-size: 11.5px; padding: 3px 9px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent); font-weight: 600; }

/* ---- Outlet (Ordner) ---- */
.outlet { padding: 16px 12px; }
.folder { display: flex; align-items: center; gap: 10px; padding: 8px 10px;
  border-radius: 10px; cursor: default; }
.folder:hover { background: var(--surface-2); }
.folder .fi { width: 22px; text-align: center; opacity: .8; }
.folder .fn { flex: 1; font-size: 13px; }
.folder .fc { font-size: 11.5px; color: var(--text-2); font-variant-numeric: tabular-nums;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; padding: 1px 8px; }

/* ---- Stats / Automatisierungsgrad ---- */
.stats { padding: 18px; }
.gauge { display: flex; align-items: center; gap: 16px; margin-bottom: 14px; }
.donut { --p: 0; width: 74px; height: 74px; border-radius: 50%; flex: none;
  background: conic-gradient(var(--accent) calc(var(--p)*1%), var(--surface-2) 0);
  display: grid; place-items: center; }
.donut .hole { width: 56px; height: 56px; border-radius: 50%; background: var(--surface);
  display: grid; place-items: center; font-weight: 700; font-size: 16px; }
.gauge .lbl { font-size: 12.5px; color: var(--text-2); }
.gauge .lbl b { color: var(--text); font-size: 13px; }
.statgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.stat { background: var(--surface-2); border: 1px solid var(--border); border-radius: 11px; padding: 9px 11px; }
.stat .v { font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat .k { font-size: 11px; color: var(--text-2); margin-top: 1px; }

/* ---- WARDEN Runs ---- */
.runs { padding: 16px 16px 14px; }
.sparkline { display: flex; align-items: flex-end; gap: 4px; height: 46px; padding: 4px 2px 0;
  border-bottom: 1px solid var(--border); margin-bottom: 10px; }
.rbar { flex: 1; background: linear-gradient(var(--accent), color-mix(in srgb, var(--accent) 55%, transparent));
  border-radius: 3px 3px 0 0; min-height: 6px; }
.runrow { display: flex; align-items: center; gap: 10px; padding: 5px 2px; font-size: 12px; }
.runrow .rt { color: var(--text-2); flex: 1; }
.runrow .rp { font-weight: 700; font-variant-numeric: tabular-nums; }
.rdots { display: flex; gap: 4px; }
.rdots .d { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.rdots .d-review { background: var(--accent); }
.rdots .d-hg { background: var(--amber); }
.rdots .d-hu { background: var(--orange); }
.rdots .d-de { background: var(--red); }

/* ---- Queue ---- */
.main { display: flex; flex-direction: column; gap: 16px; }
.queuehead { display: flex; align-items: baseline; gap: 10px; padding: 2px 4px; }
.queuehead h2 { font-size: 19px; margin: 0; letter-spacing: -.02em; }
.queuehead .count { color: var(--text-2); font-size: 13px; }
.filters { display: flex; gap: 6px; margin-left: auto; flex-wrap: wrap; }
.chip { border: 1px solid var(--border); background: var(--surface); color: var(--text-2);
  padding: 5px 11px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.chip.active { background: var(--text); color: var(--surface); border-color: var(--text); }
.chip .cnt { margin-left: 6px; font-size: 11px; opacity: .7; font-variant-numeric: tabular-nums; }
.chip.active .cnt { opacity: .9; }

.empty { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 44px 24px; text-align: center; }
.empty-ico { width: 46px; height: 46px; margin: 0 auto 14px; border-radius: 50%;
  background: var(--green-soft); color: var(--green); display: grid; place-items: center;
  font-size: 22px; font-weight: 700; }
.empty-t { font-size: 15px; font-weight: 650; }
.empty-s { font-size: 13px; color: var(--text-2); margin-top: 5px; }

.ticket { padding: 16px 18px; }
.ticket.done { opacity: .58; }
.tkhead { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.tktitle { font-weight: 650; font-size: 14.5px; letter-spacing: -.01em; }
.badge { font-size: 10.5px; font-weight: 700; padding: 3px 9px; border-radius: 999px;
  text-transform: uppercase; letter-spacing: .03em; white-space: nowrap; }
.b-review { color: var(--accent); background: var(--accent-soft); }
.b-human_gate { color: var(--amber); background: var(--amber-soft); }
.b-human { color: var(--orange); background: var(--orange-soft); }
.b-delete { color: var(--red); background: var(--red-soft); }
.b-auto { color: var(--green); background: var(--green-soft); }
.tkmeta { display: flex; gap: 12px; flex-wrap: wrap; margin: 8px 0 0;
  font-size: 11.5px; color: var(--text-2); }
.tkmeta b { color: var(--text); font-weight: 600; }

.tabs { display: flex; gap: 6px; margin: 14px 0 0; }
.tab { border: 1px solid var(--border); background: var(--surface-2); color: var(--text-2);
  padding: 5px 12px; border-radius: 9px 9px 0 0; font-size: 12px; font-weight: 600; }
.tab.active { background: var(--surface); color: var(--text); border-bottom-color: var(--surface); }
.draftbox { border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2);
  padding: 14px 16px; margin-top: 12px; white-space: pre-wrap; font-size: 13px; line-height: 1.6;
  font-family: -apple-system, "SF Pro Text", system-ui, sans-serif; }
.reco { margin-top: 10px; font-size: 12.5px; color: var(--text); background: var(--accent-soft);
  border-left: 3px solid var(--accent); border-radius: 8px; padding: 9px 12px; }
.note { margin-top: 10px; font-size: 12.5px; color: var(--text); background: var(--amber-soft);
  border-left: 3px solid var(--amber); border-radius: 8px; padding: 9px 12px; }
.note .lab, .reco .lab, .vwarn .lab { font-weight: 700; text-transform: uppercase; font-size: 10px;
  letter-spacing: .04em; opacity: .8; display: block; margin-bottom: 3px; }
.vwarn { margin-top: 10px; font-size: 12px; color: var(--text-2); background: var(--card-2, transparent);
  border: 1px solid var(--border); border-left: 3px solid var(--amber); border-radius: 8px; padding: 8px 12px; }
.vwarn.bad { color: var(--text); border-left-color: var(--bad, #d33); background: var(--bad-soft, rgba(211,51,51,.08)); }
.escbox { margin-top: 12px; padding: 12px 14px; border: 1px dashed var(--border);
  border-radius: 12px; color: var(--text-2); font-size: 12.5px; text-align: center; }
.sources { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.src { font-size: 10.5px; color: var(--text-3); background: var(--surface-2);
  border: 1px solid var(--border); border-radius: 6px; padding: 2px 7px; font-family: ui-monospace, monospace; }

.actions { display: flex; align-items: center; gap: 8px; margin-top: 14px; }
.btn { border: none; border-radius: 10px; padding: 8px 16px; font-size: 13px; font-weight: 650; }
.btn.approve { background: var(--accent); color: #fff; }
.btn.approve:hover { filter: brightness(1.06); }
.btn.reject { background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border); }
.btn.reject:hover { color: var(--red); border-color: color-mix(in srgb, var(--red) 40%, var(--border)); }
.conf { margin-left: auto; display: flex; align-items: center; gap: 8px; font-size: 11px; color: var(--text-2); }
.confbar { width: 70px; height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; border: 1px solid var(--border); }
.confbar i { display: block; height: 100%; background: var(--green); }
.confbar i.cok { background: var(--green); }
.confbar i.cwarn { background: var(--amber); }
.confbar i.cbad { background: var(--red); }
.btn.edit { background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border); }
.btn.edit:hover { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); }
.btn.sm { padding: 6px 12px; font-size: 12px; }
.editbox { width: 100%; min-height: 180px; margin-top: 12px; padding: 14px 16px; border: 1px solid var(--accent);
  border-radius: 12px; background: var(--surface); color: var(--text); font-size: 13px; line-height: 1.6;
  font-family: -apple-system, "SF Pro Text", system-ui, sans-serif; resize: vertical; box-sizing: border-box; }
.editbox:focus { outline: 2px solid var(--accent); border-color: transparent; }
.charcount { font-size: 11px; color: var(--text-3); margin-top: 5px; text-align: right; font-variant-numeric: tabular-nums; }
.editrow { display: flex; gap: 8px; margin-top: 10px; }
.editedtag { font-size: 10.5px; font-weight: 700; color: var(--amber); background: var(--amber-soft);
  padding: 3px 9px; border-radius: 999px; }
.learnrow { margin-top: 12px; font-size: 11.5px; color: var(--text-2); background: var(--surface-2);
  border: 1px solid var(--border); border-radius: 10px; padding: 8px 11px; }
.learnrow b { color: var(--accent); }
.ribbon { font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 999px; }
.ribbon.approved { color: var(--green); background: var(--green-soft); }
.ribbon.rejected { color: var(--red); background: var(--red-soft); }

/* ---- Login ---- */
.login { min-height: 82vh; display: grid; place-items: center; }
.logincard { width: 340px; padding: 30px 28px; text-align: center; }
.logincard .logo { margin: 0 auto 14px; }
.logincard h2 { margin: 6px 0 2px; font-size: 19px; }
.logincard p { color: var(--text-2); font-size: 12.5px; margin: 0 0 20px; }
.field { text-align: left; margin-bottom: 12px; }
.field label { display: block; font-size: 12px; color: var(--text-2); margin-bottom: 5px; }
.field input { width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface-2); color: var(--text); font-size: 14px; }
.field input:focus { outline: 2px solid var(--accent); border-color: transparent; }
.btn.full { width: 100%; justify-content: center; padding: 11px; margin-top: 4px; }
.err { color: var(--red); font-size: 12px; min-height: 16px; margin-top: 8px; }
.hint { margin-top: 16px; font-size: 11px; color: var(--text-3); }

/* ---- Admin: Nutzerverwaltung ---- */
.users { padding: 18px; }
.utable { width: 100%; border-collapse: collapse; margin-top: 8px; }
.utable td, .utable th { text-align: left; padding: 7px 8px; font-size: 12.5px; border-bottom: 1px solid var(--border); }
.utable th { color: var(--text-3); font-weight: 600; font-size: 11px; text-transform: uppercase; }
.rolechip { font-size: 10.5px; font-weight: 700; padding: 2px 8px; border-radius: 999px; }
.rolechip.admin { color: var(--accent); background: var(--accent-soft); }
.rolechip.agent { color: var(--text-2); background: var(--surface-2); border: 1px solid var(--border); }
