/* BackupHub – vollständig eigenes Design-System (kein Framework) */
:root {
  --bg: #0e1116;
  --surface: #161b22;
  --surface-2: #1e2530;
  --surface-3: #252e3a;
  --border: #2a323f;
  --text: #e6eaf0;
  --muted: #93a0b1;
  --accent: #3b82f6;
  --accent-2: #22d3ee;
  --ok: #2ecc71;
  --warn: #f1c40f;
  --err: #e74c3c;
  --run: #e67e22;
  --radius: 0.7rem;
}

* { box-sizing: border-box; }
html { font-size: 15px; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  line-height: 1.5; -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { color: var(--text); font-weight: 650; line-height: 1.25; }
h1 { font-size: 1.7rem; margin: 0 0 .2rem; }
h2 { font-size: 1.25rem; margin: 2rem 0 .8rem; }
h3 { font-size: 1.05rem; margin: 0 0 .6rem; }
p { margin: .4rem 0; }
a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }
small { font-size: .82rem; }
hr { border: none; border-top: 1px solid var(--border); margin: 1.5rem 0; }
.muted { color: var(--muted); }
code { font-family: ui-monospace, "SF Mono", Menlo, monospace; }
code.small { font-size: .8rem; color: var(--accent-2); background: var(--surface-2); padding: .1rem .35rem; border-radius: .3rem; }
pre { background: #0b0e13; border: 1px solid var(--border); border-radius: .5rem; padding: .9rem; overflow: auto; font-family: ui-monospace, Menlo, monospace; font-size: .85rem; }

/* ---- Layout ---- */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 235px; flex-shrink: 0; background: var(--surface);
  border-right: 1px solid var(--border); display: flex; flex-direction: column;
  padding: 1.25rem .85rem; position: sticky; top: 0; height: 100vh;
}
.sidebar .brand { font-size: 1.15rem; font-weight: 750; padding: .2rem .6rem 1.3rem; display: flex; align-items: center; gap: .55rem; }
.sidebar .brand .dot { width: 11px; height: 11px; border-radius: 50%; background: linear-gradient(135deg, var(--accent), var(--accent-2)); box-shadow: 0 0 12px var(--accent); }
.sidebar nav { display: flex; flex-direction: column; gap: .15rem; flex: 1; }
.sidebar nav a { display: flex; align-items: center; gap: .65rem; padding: .55rem .7rem; border-radius: .5rem; color: var(--muted); font-size: .92rem; transition: background .12s, color .12s; }
.sidebar nav a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.sidebar nav a.active { background: var(--accent); color: #fff; }
.sidebar nav a .ico { width: 1.2rem; text-align: center; font-size: .95rem; }
.sidebar .who { font-size: .8rem; color: var(--muted); padding: .7rem .6rem 0; border-top: 1px solid var(--border); margin-top: .5rem; }
.content { flex: 1; padding: 2rem 2.4rem; max-width: 1180px; width: 100%; }

@media (max-width: 820px) {
  .layout { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: static; }
  .sidebar nav { flex-direction: row; flex-wrap: wrap; }
  .content { padding: 1.2rem; }
}

/* ---- Karten ---- */
.cards { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(205px, 1fr)); margin: 1.3rem 0; }
.card, article { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.1rem 1.2rem; }
article { margin: 1rem 0; }
.card.stat .label { color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; }
.card.stat .value { font-size: 2rem; font-weight: 700; line-height: 1.1; margin-top: .15rem; }
.card.stat .sub { color: var(--muted); font-size: .8rem; margin-top: .3rem; }

.bar { height: 10px; border-radius: 6px; background: var(--surface-3); overflow: hidden; margin: .5rem 0; }
.bar > span { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.bar.warn > span { background: linear-gradient(90deg, var(--warn), var(--err)); }

/* ---- Badges ---- */
.badge { display: inline-block; padding: .14rem .6rem; border-radius: 999px; font-size: .74rem; font-weight: 600; }
.badge.muted { background: var(--surface-3); color: var(--muted); }
.badge.ok { background: rgba(46,204,113,.16); color: var(--ok); }
.badge.err { background: rgba(231,76,60,.16); color: var(--err); }
.badge.run { background: rgba(230,126,34,.16); color: var(--run); }
.badge.accent { background: rgba(59,130,246,.16); color: var(--accent); }

/* ---- Tabellen ---- */
figure { margin: 1rem 0; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
th, td { padding: .65rem .85rem; text-align: left; border-bottom: 1px solid var(--border); }
table.compact th, table.compact td { padding: .5rem .75rem; font-size: .9rem; }
thead th { background: var(--surface-2); color: var(--muted); font-size: .76rem; text-transform: uppercase; letter-spacing: .04em; font-weight: 600; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--surface-2); }

/* ---- Formulare ---- */
label { display: block; margin: .7rem 0; font-size: .9rem; font-weight: 500; }
input, select, textarea {
  width: 100%; margin-top: .3rem; padding: .55rem .7rem; font-size: .92rem; font-family: inherit;
  background: var(--surface-2); color: var(--text); border: 1px solid var(--border);
  border-radius: .5rem; outline: none; transition: border-color .12s, box-shadow .12s;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(59,130,246,.2); }
input[type=checkbox] { width: auto; margin-right: .4rem; vertical-align: middle; }
textarea { resize: vertical; }

button, [role=button], input[type=submit] {
  display: inline-block; cursor: pointer; font: inherit; font-weight: 600; font-size: .9rem;
  padding: .55rem 1.1rem; border-radius: .5rem; border: 1px solid transparent;
  background: var(--accent); color: #fff; transition: filter .12s, background .12s; text-align: center;
}
button:hover, [role=button]:hover { filter: brightness(1.08); text-decoration: none; }
.secondary { background: var(--surface-3); color: var(--text); }
.outline { background: transparent; border-color: var(--border); color: var(--text); }
.outline:hover { background: var(--surface-2); }
.contrast { background: var(--err); color: #fff; }
button:disabled { opacity: .5; cursor: not-allowed; }

/* ---- Grid-Utility (wie früher Pico .grid) ---- */
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 1rem; align-items: end; }

/* ---- Diverses ---- */
hgroup { margin-bottom: 1rem; }
hgroup h1 { margin-bottom: .1rem; }
hgroup p { margin-top: 0; }
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: .5rem; }
.btn-row { display: flex; gap: .5rem; flex-wrap: wrap; }
nav[aria-label=breadcrumb] ul { list-style: none; display: flex; flex-wrap: wrap; gap: .3rem; padding: 0; margin: .5rem 0; }
nav[aria-label=breadcrumb] li::after { content: "/"; color: var(--muted); margin-left: .3rem; }
nav[aria-label=breadcrumb] li:last-child::after { content: ""; }
details summary { cursor: pointer; }
