/* Systrova Deploy – schlichtes Business-Design, helle Arbeitsfläche */
:root {
  --bg: #f4f6f9;
  --surface: #ffffff;
  --line: #dfe4ec;
  --text: #1b2430;
  --muted: #5d6878;
  --brand: #1f4fd8;
  --brand-dark: #173da8;
  --side: #17202e;
  --side-text: #c9d2e0;
  --ok: #157f3c;      --ok-bg: #e2f5e8;
  --warn: #8a5a00;    --warn-bg: #fdf1cf;
  --info: #1b53b5;    --info-bg: #e1ebfd;
  --err: #b3261e;     --err-bg: #fbe4e2;
  --radius: 8px;
}
* { box-sizing: border-box; }
html { font-size: 15px; }
body {
  margin: 0; color: var(--text); background: var(--bg);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; line-height: 1.5;
}
a { color: var(--brand); }
h1 { font-size: 1.45rem; margin: 0 0 .75rem; line-height: 1.25; }
h2 { font-size: 1.1rem; margin: 0 0 .75rem; }
h3 { font-size: 1rem; margin: 1rem 0 .4rem; }
p { margin: 0 0 .9rem; }
code { font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; font-size: .93em; }

/* Grundaufbau */
body.app { display: grid; grid-template-columns: 220px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  background: var(--side); color: var(--side-text); padding: 1.1rem .8rem;
  display: flex; flex-direction: column; gap: 1.2rem; position: sticky; top: 0; height: 100vh;
}
.brand { display: flex; align-items: center; gap: .6rem; color: #fff; font-weight: 650; text-decoration: none; padding: 0 .4rem; }
.brand-mark {
  display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 7px;
  background: var(--brand); color: #fff; font-weight: 700;
}
.brand-auth { color: var(--text); padding: 0; margin-bottom: 1.2rem; }
.sidebar nav { display: flex; flex-direction: column; gap: 2px; }
.sidebar nav a {
  color: var(--side-text); text-decoration: none; padding: .55rem .7rem; border-radius: 6px;
}
.sidebar nav a:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.sidebar nav a.active { background: var(--brand); color: #fff; }
.logout { margin-top: auto; display: flex; flex-direction: column; gap: .4rem; padding: 0 .4rem; }
.who { font-size: .85rem; overflow-wrap: anywhere; }
.content { padding: 1.5rem 2rem 3rem; min-width: 0; }
.center { min-height: 100vh; display: grid; place-content: center; padding: 1rem; grid-template-columns: minmax(0, 420px); }
.center:has(.wide) { grid-template-columns: minmax(0, 560px); }

/* Flächen */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.2rem 1.3rem; margin-bottom: 1.2rem;
}
.card.narrow { max-width: 620px; }
.card.auth { padding: 1.8rem; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.page-head h1 { margin: 0; }
.sub { color: var(--muted); margin: -.4rem 0 1rem; }
.grid { display: grid; gap: 1.2rem; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid > .card { margin-bottom: 0; }
.grid + .card, .grid + .grid { margin-top: 1.2rem; }
.empty { color: var(--muted); margin: 0; }
.hint { color: var(--muted); font-size: .88rem; margin: .9rem 0 0; }
.label { display: block; color: var(--muted); font-size: .82rem; }

/* Kennzahlen */
.stats { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); margin-bottom: 1.2rem; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: .8rem 1rem; }
.stat .value { font-size: 1.25rem; font-weight: 650; display: block; }
.stat .label { margin-bottom: .1rem; }
.stat meter { width: 100%; height: .55rem; margin-top: .35rem; }

/* Tabellen */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: .6rem .7rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .8rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .03em; white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #f8fafc; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
tfoot td { font-weight: 650; border-top: 2px solid var(--line); border-bottom: 0; }
.nowrap { white-space: nowrap; }

/* Status-Pills */
.pill {
  display: inline-flex; align-items: center; gap: .35rem; padding: .12rem .6rem; border-radius: 999px;
  font-size: .82rem; font-weight: 600; white-space: nowrap;
}
.pill::before { content: ""; width: .5rem; height: .5rem; border-radius: 50%; background: currentColor; }
.pill-ok { color: var(--ok); background: var(--ok-bg); }
.pill-warn { color: var(--warn); background: var(--warn-bg); }
.pill-info { color: var(--info); background: var(--info-bg); }
.pill-err { color: var(--err); background: var(--err-bg); }
.pill-off { color: var(--muted); background: #e9edf2; }

/* Hinweise */
.notice { border-radius: var(--radius); padding: .7rem .9rem; margin-bottom: 1rem; border: 1px solid transparent; }
.notice-ok { background: var(--ok-bg); color: #0d5527; border-color: #b9e3c6; }
.notice-warn { background: var(--warn-bg); color: #5f3e00; border-color: #f0d98d; }
.notice-error { background: var(--err-bg); color: #7c1a14; border-color: #f1bdb8; }
.notice-info { background: var(--info-bg); color: #123a80; border-color: #bcd0f7; }
.notice ul { margin: .3rem 0 0; padding-left: 1.2rem; }

/* Formulare */
label { display: block; font-weight: 600; font-size: .9rem; margin: .8rem 0 .25rem; }
input[type=text], input[type=password], input[type=email], input[type=number], input[type=file], select, textarea {
  width: 100%; padding: .5rem .65rem; border: 1px solid #c3cbd8; border-radius: 6px;
  font: inherit; color: inherit; background: #fff;
}
textarea { min-height: 9rem; font-family: ui-monospace, Consolas, monospace; font-size: .9rem; }
input:focus-visible, select:focus-visible, textarea:focus-visible, .btn:focus-visible, a:focus-visible {
  outline: 2px solid var(--brand); outline-offset: 2px;
}
.form-grid { display: grid; gap: 0 1rem; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.check { display: flex; align-items: flex-start; gap: .5rem; font-weight: 400; }
.check input { margin-top: .25rem; }
.field-help { color: var(--muted); font-size: .85rem; margin: .25rem 0 0; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: .4rem 1rem 1rem; margin: 1rem 0; }
legend { font-weight: 650; padding: 0 .4rem; }

/* Schaltflächen */
.btn {
  display: inline-block; padding: .5rem .95rem; border-radius: 6px; border: 1px solid #c3cbd8;
  background: #fff; color: var(--text); font: inherit; font-weight: 600; text-decoration: none; cursor: pointer;
}
.btn:hover { background: #f1f4f8; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); }
.btn-danger { background: #fff; border-color: #e3aaa5; color: var(--err); }
.btn-danger:hover { background: var(--err-bg); }
.btn-quiet { background: transparent; border-color: rgba(255, 255, 255, .25); color: var(--side-text); }
.btn-quiet:hover { background: rgba(255, 255, 255, .08); }
.btn-small { padding: .25rem .6rem; font-size: .85rem; }
.btn-block { display: block; width: 100%; margin-top: 1.1rem; text-align: center; }
.btn[disabled] { opacity: .6; cursor: progress; }
.actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; margin-top: 1rem; }
.actions form { margin: 0; }
.inline { display: inline; }

/* Einzelteile */
.steps { padding-left: 1.2rem; margin: 0 0 1rem; }
.qr { display: flex; gap: 1.2rem; align-items: center; flex-wrap: wrap; margin-bottom: 1rem; }
.qr img { border: 1px solid var(--line); border-radius: 6px; }
.secret { display: block; margin-top: .3rem; padding: .4rem .6rem; background: var(--bg); border-radius: 6px; overflow-wrap: anywhere; }
.codes { list-style: none; padding: 0; margin: 0 0 1.2rem; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .4rem; }
.codes code { display: block; padding: .4rem .6rem; background: var(--bg); border-radius: 6px; text-align: center; }
dl.facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: .35rem 1rem; margin: 0; }
dl.facts dt { color: var(--muted); }
dl.facts dd { margin: 0; overflow-wrap: anywhere; }
pre.log {
  background: #111927; color: #d7e0ee; padding: .9rem 1rem; border-radius: var(--radius);
  overflow: auto; max-height: 26rem; font-size: .82rem; margin: 0; white-space: pre-wrap; overflow-wrap: anywhere;
}
.tabs { display: flex; gap: .3rem; flex-wrap: wrap; margin-bottom: 1rem; }
.muted { color: var(--muted); }
.checklist { list-style: none; margin: 0; padding: 0; }
.checklist li { display: flex; justify-content: space-between; gap: 1rem; align-items: center; padding: .4rem 0; border-bottom: 1px solid var(--line); }
.checklist li:last-child { border-bottom: 0; }
.checklist select { width: auto; }

@media (max-width: 800px) {
  body.app { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: .6rem; }
  .sidebar nav { flex-direction: row; flex-wrap: wrap; }
  .logout { margin: 0 0 0 auto; flex-direction: row; align-items: center; }
  .content { padding: 1rem; }
}
