/* DeskCapture – Webseite. Hell/Dunkel folgt der Systemeinstellung. */
:root {
  --accent: #E81123; --accent-hover: #C50F1F; --accent-text: #fff;
  --bg: #F3F4F7; --surface: #FFFFFF; --surface-2: #EEF0F4; --border: #DADDE5; --border-strong: #AEB3C2;
  --text: #1F2230; --muted: #6B7080; --link: #2563EB;
  --ok-bg: #E7F6EC; --ok-text: #166534; --warn-bg: #FEF3C7; --warn-text: #92400E; --err-bg: #FDE8EA; --err-text: #9F1239;
  --radius: 10px; --shadow: 0 1px 2px rgba(0,0,0,.04), 0 4px 16px rgba(0,0,0,.04);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --accent: #F0303F; --accent-hover: #FF4655;
    --bg: #1C1D22; --surface: #26282F; --surface-2: #30333B; --border: #3A3D47; --border-strong: #5A5E6B;
    --text: #ECEDF0; --muted: #9CA0AD; --link: #6EA0FF;
    --ok-bg: #12321F; --ok-text: #86EFAC; --warn-bg: #3B2A0A; --warn-text: #FCD34D; --err-bg: #3A1418; --err-text: #FDA4AF;
    --shadow: none; color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.55 "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  min-height: 100vh; display: flex; flex-direction: column;
}
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 26px; margin: 0 0 6px; line-height: 1.25; }
h2 { font-size: 18px; margin: 0 0 12px; }
h3 { font-size: 15px; margin: 18px 0 8px; }
p { margin: 0 0 12px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
code, .mono { font-family: "Cascadia Mono", Consolas, monospace; font-size: 13px; }

/* ── Kopfzeile ── */
.topbar { background: var(--surface); border-bottom: 1px solid var(--border); }
.topbar .inner { max-width: 1100px; margin: 0 auto; padding: 0 16px; height: 58px; display: flex; align-items: center; gap: 20px; }
.brand { font-weight: 700; font-size: 17px; color: var(--text); display: flex; align-items: center; gap: 8px; }
.brand:hover { text-decoration: none; }
.brand .dot { width: 14px; height: 14px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
.nav { display: flex; gap: 4px; flex: 1; flex-wrap: wrap; }
.nav a { color: var(--muted); padding: 6px 10px; border-radius: 6px; }
.nav a:hover, .nav a.active { background: var(--surface-2); color: var(--text); text-decoration: none; }
.userbox { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 14px; }
.userbox form { margin: 0; }

/* ── Inhalt ── */
main { flex: 1; width: 100%; max-width: 1100px; margin: 0 auto; padding: 28px 16px 48px; }
main.narrow { max-width: 460px; padding-top: 56px; }
main.medium { max-width: 760px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px 24px; box-shadow: var(--shadow); }
.card + .card { margin-top: 16px; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.stat .value { font-size: 26px; font-weight: 700; }
.stat .label { color: var(--muted); font-size: 13px; }

/* ── Formulare ── */
.field { margin-bottom: 16px; }
.field label { display: block; font-weight: 600; margin-bottom: 6px; font-size: 14px; }
.field .hint { color: var(--muted); font-size: 13px; margin-top: 5px; }
.row { display: grid; gap: 16px; grid-template-columns: 1fr 1fr; }
@media (max-width: 640px) { .row { grid-template-columns: 1fr; } }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=url], input[type=datetime-local], select, textarea {
  width: 100%; padding: 9px 11px; border: 1px solid var(--border); border-radius: 7px; background: var(--surface);
  color: var(--text); font: inherit;
}
input:focus, select:focus, textarea:focus { outline: 2px solid color-mix(in srgb, var(--accent) 45%, transparent); outline-offset: 0; border-color: var(--accent); }
.check { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 12px; }
.check input { margin-top: 4px; width: 16px; height: 16px; accent-color: var(--accent); }
.field-validation-error, .validation-summary-errors { color: var(--err-text); font-size: 13px; }
.validation-summary-errors ul { margin: 0 0 12px; padding-left: 18px; }
fieldset { border: 0; padding: 0; margin: 0; }
legend { font-weight: 700; font-size: 16px; margin-bottom: 12px; }
hr { border: 0; border-top: 1px solid var(--border); margin: 24px 0; }

/* ── Knöpfe ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 16px; border-radius: 7px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-weight: 600;
  cursor: pointer; text-decoration: none; white-space: nowrap;
}
.btn:hover { border-color: var(--border-strong); text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn.danger { color: var(--err-text); }
.btn.small { padding: 5px 10px; font-size: 13px; }
.btn.block { width: 100%; }
.btn.link { border: 0; background: none; color: var(--link); padding: 0; font-weight: 400; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 8px; }

/* ── Hinweise ── */
.alert { padding: 12px 14px; border-radius: 8px; margin-bottom: 16px; font-size: 14px; }
.alert.ok { background: var(--ok-bg); color: var(--ok-text); }
.alert.warn { background: var(--warn-bg); color: var(--warn-text); }
.alert.err { background: var(--err-bg); color: var(--err-text); }
.badge { display: inline-block; font-size: 12px; padding: 2px 8px; border-radius: 10px; background: var(--surface-2); color: var(--muted); }
.badge.ok { background: var(--ok-bg); color: var(--ok-text); }
.badge.warn { background: var(--warn-bg); color: var(--warn-text); }
.badge.err { background: var(--err-bg); color: var(--err-text); }

/* ── Tabellen ── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; color: var(--muted); font-weight: 600; font-size: 13px; }
th, td { padding: 10px 8px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
td form { display: inline; margin: 0; }

/* ── Seitenleiste im Admin-Bereich ── */
.with-side { display: grid; grid-template-columns: 200px 1fr; gap: 24px; }
@media (max-width: 760px) { .with-side { grid-template-columns: 1fr; } }
.side a { display: block; padding: 8px 12px; border-radius: 7px; color: var(--muted); }
.side a:hover, .side a.active { background: var(--surface); color: var(--text); text-decoration: none; }
.side a.active { box-shadow: inset 3px 0 0 var(--accent); }

.copy { display: flex; gap: 8px; }
.copy input { font-family: "Cascadia Mono", Consolas, monospace; font-size: 13px; }

.meter { height: 8px; border-radius: 4px; background: var(--surface-2); overflow: hidden; margin: 8px 0 4px; }
.meter > span { display: block; height: 100%; background: var(--accent); }

footer { color: var(--muted); font-size: 13px; text-align: center; padding: 20px 16px 28px; }
footer a { color: var(--muted); margin: 0 8px; }
