/* MobileMind — light mode, simpel. Keine Frameworks, keine Dark-Mode-Schalter. */
:root {
  --bg: #f7f8fa;
  --surface: #ffffff;
  --border: #e6e8ec;
  --text: #16181d;
  --muted: #6b7280;
  --accent: #2563eb;
  --accent-soft: #eff4ff;
  --ok: #15803d;
  --ok-soft: #ecfdf3;
  --warn: #b45309;
  --warn-soft: #fff7ed;
  --err: #b91c1c;
  --err-soft: #fef2f2;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 1px 3px rgba(16, 24, 40, 0.06);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; font-weight: 650; letter-spacing: -0.01em; }
h1 { font-size: 21px; }
h2 { font-size: 17px; }
h3 { font-size: 15px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.stack { display: grid; gap: 16px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }

/* ── Shell ─────────────────────────────────────────────────────────── */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 236px; flex: 0 0 236px; background: var(--surface);
  border-right: 1px solid var(--border); display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
}
.brand { display: flex; gap: 10px; align-items: center; padding: 18px 16px 14px; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 9px; background: var(--accent); color: #fff;
  display: grid; place-items: center; font-weight: 700; font-size: 13px; letter-spacing: .3px;
}
.brand-text { display: flex; flex-direction: column; font-weight: 650; font-size: 14.5px; }
.brand-text small { font-weight: 400; font-size: 11.5px; color: var(--muted); }
.sidebar nav { display: grid; gap: 2px; padding: 6px 10px; }
.nav-item {
  display: flex; gap: 10px; align-items: center; padding: 9px 10px; border-radius: 9px;
  color: #374151; font-size: 14.5px; text-decoration: none;
}
.nav-item:hover { background: #f3f4f6; text-decoration: none; }
.nav-item.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.nav-icon { width: 18px; text-align: center; opacity: .85; }
.sidebar-foot { margin-top: auto; padding: 12px; border-top: 1px solid var(--border); display: grid; gap: 10px; }
.user-chip { display: flex; gap: 9px; align-items: center; }
.user-chip > span {
  width: 30px; height: 30px; border-radius: 50%; background: #eef2f7; display: grid;
  place-items: center; font-weight: 650; color: #475569;
}
.user-chip div { display: flex; flex-direction: column; overflow: hidden; }
.user-chip strong { font-size: 13px; }
.user-chip small { font-size: 11.5px; color: var(--muted); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; gap: 14px; padding: 18px 26px 12px;
}
.topbar-actions { display: flex; gap: 8px; margin-left: auto; flex-wrap: wrap; }
.content { padding: 6px 26px 40px; display: grid; gap: 16px; align-content: start; }

/* ── Cards ─────────────────────────────────────────────────────────── */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden;
}
.card-head {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--border);
}
.card-head h2, .card-head h3 { margin: 0; }
.card-body { padding: 16px; }
.card-body.tight { padding: 0; overflow-x: auto; }
.grid { display: grid; gap: 14px; }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1050px) { .grid.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid.cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 780px) {
  .shell { flex-direction: column; }
  .sidebar { width: 100%; flex: none; height: auto; position: static; }
  .sidebar nav { grid-auto-flow: column; overflow-x: auto; }
  .sidebar-foot { display: none; }
  .grid.cols-2, .grid.cols-3, .grid.cols-4 { grid-template-columns: 1fr; }
  .content, .topbar { padding-left: 14px; padding-right: 14px; }
}

.kpi { padding: 16px; }
.kpi .label { font-size: 12.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.kpi .value { font-size: 26px; font-weight: 700; margin-top: 6px; }
.kpi .sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; }

/* ── Tabellen ──────────────────────────────────────────────────────── */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th {
  text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .04em;
  color: var(--muted); font-weight: 600; padding: 10px 16px; background: #fbfcfd; border-bottom: 1px solid var(--border);
}
td { padding: 11px 16px; border-bottom: 1px solid #f1f3f6; vertical-align: top; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #fcfdff; }
td.actions { white-space: nowrap; text-align: right; }
td.actions form { display: inline-flex; gap: 6px; align-items: center; justify-content: flex-end; flex-wrap: nowrap; }
td.actions .btn-danger { margin-top: 6px; }
.break { word-break: break-all; }

/* ── Formulare ─────────────────────────────────────────────────────── */
label { display: block; font-size: 12.5px; font-weight: 600; color: #374151; margin-bottom: 5px; }
input, select, textarea, button { font: inherit; }
input[type="text"], input[type="email"], input[type="password"], input[type="number"],
input[type="url"], input[type="search"], select, textarea {
  width: 100%; padding: 9px 11px; border: 1px solid #d5d9e0; border-radius: 9px; background: #fff;
  color: var(--text); outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37, 99, 235, .12); }
textarea { min-height: 110px; resize: vertical; }
.field { display: grid; gap: 0; }
.form-grid { display: grid; gap: 13px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 780px) { .form-grid { grid-template-columns: 1fr; } }
.check { display: flex; align-items: center; gap: 8px; font-size: 13.5px; }
.check input { width: auto; }
.hint { font-size: 12px; color: var(--muted); margin-top: 4px; }

.btn {
  display: inline-flex; align-items: center; gap: 7px; padding: 8px 13px; border-radius: 9px;
  border: 1px solid #d5d9e0; background: #fff; color: #1f2937; cursor: pointer; font-size: 14px;
  text-decoration: none; line-height: 1.2;
}
.btn:hover { background: #f8fafc; text-decoration: none; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: #1d4ed8; }
.btn-danger { color: var(--err); border-color: #f3c9c9; }
.btn-danger:hover { background: var(--err-soft); }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-sm { padding: 5px 9px; font-size: 12.5px; border-radius: 7px; }
.btn-block { width: 100%; justify-content: center; }
.btn[disabled] { opacity: .55; cursor: default; }

/* ── Badges / Flash ────────────────────────────────────────────────── */
.badge {
  display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 600;
  background: #f1f3f6; color: #4b5563;
}
.badge-ok { background: var(--ok-soft); color: var(--ok); }
.badge-err { background: var(--err-soft); color: var(--err); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-info { background: var(--accent-soft); color: var(--accent); }
.badge-muted { background: #f1f3f6; color: #6b7280; }
.stars { color: #f59e0b; letter-spacing: 1px; }
.flash { margin: 0 26px; padding: 11px 14px; border-radius: 10px; font-size: 14px; }
.flash-info { background: var(--accent-soft); color: #1e40af; }
.flash-ok { background: var(--ok-soft); color: var(--ok); }
.flash-error { background: var(--err-soft); color: var(--err); }

/* ── Login ─────────────────────────────────────────────────────────── */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: var(--bg); }
.login-card {
  width: 100%; max-width: 380px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 16px; box-shadow: var(--shadow); padding: 28px;
}
.login-card .brand { padding: 0 0 18px; }
.login-card h1 { font-size: 19px; margin-bottom: 4px; }

.toast {
  position: fixed; right: 20px; bottom: 20px; background: #111827; color: #fff; padding: 11px 15px;
  border-radius: 10px; font-size: 14px; box-shadow: 0 8px 24px rgba(0, 0, 0, .18); z-index: 50; max-width: 380px;
}
.toast.err { background: var(--err); }
.toast.ok { background: var(--ok); }

.empty { padding: 30px 16px; text-align: center; color: var(--muted); font-size: 14px; }
.truncate { max-width: 300px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pill-list { display: flex; gap: 6px; flex-wrap: wrap; }
details summary { cursor: pointer; font-size: 13.5px; color: var(--accent); }
pre.log {
  background: #0f172a; color: #e2e8f0; padding: 12px; border-radius: 10px; overflow: auto;
  font-size: 12px; max-height: 260px; margin: 0;
}
.shot { max-width: 100%; border: 1px solid var(--border); border-radius: 10px; }
.split { display: grid; grid-template-columns: minmax(0, 1.9fr) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 1050px) { .split { grid-template-columns: 1fr; } }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tab { padding: 6px 11px; border-radius: 999px; border: 1px solid var(--border); background: #fff; font-size: 13px; color: #374151; }
.tab.active { background: var(--accent); border-color: var(--accent); color: #fff; }
