/* Spezefic Admin: light, neutral office look. One accent colour, hairline borders, no effects. */
:root {
  --bg: #f6f7f9; --panel: #fff; --line: #e3e6ea; --line-strong: #cfd4da;
  --text: #1c2430; --muted: #5f6b7a; --faint: #8a95a3;
  --accent: #0f766e; --accent-ink: #fff; --accent-soft: #e6f2f1;
  --ok: #1f7a4d; --ok-bg: #e7f4ec; --warn: #9a6200; --warn-bg: #fdf3e1; --bad: #b42318; --bad-bg: #fdecea; --info: #1d5fae; --info-bg: #e8f0fb;
  --radius: 8px; --font: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: 14px/1.5 var(--font); color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
.hidden { display: none !important; }
h1 { font-size: 20px; font-weight: 600; margin: 0; }
h2 { font-size: 15px; font-weight: 600; margin: 0 0 12px; }
.muted { color: var(--muted); margin: 2px 0 0; }
.error { color: var(--bad); min-height: 20px; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code, .mono { font-family: Consolas, "SFMono-Regular", Menlo, monospace; font-size: 12.5px; }

/* brand */
.brand { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 16px; }
.brand em { font-style: normal; font-weight: 500; color: var(--muted); font-size: 13px; border-left: 1px solid var(--line-strong); padding-left: 8px; }

/* login */
.login { min-height: 100%; display: grid; place-items: center; padding: 24px; }
.login-card { width: 100%; max-width: 380px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 32px; }
.login-card h1 { margin: 28px 0 4px; }
.login-card .btn { margin-top: 24px; }

/* shell */
.shell { display: grid; grid-template-columns: 232px 1fr; min-height: 100%; }
.side { background: var(--panel); border-right: 1px solid var(--line); padding: 18px 12px; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.side .brand { padding: 4px 10px 18px; }
nav { display: flex; flex-direction: column; gap: 2px; }
nav a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 6px; color: var(--text); font-weight: 500; }
nav a:hover { background: var(--bg); text-decoration: none; }
nav a.on { background: var(--accent-soft); color: var(--accent); }
nav svg { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.side-foot { margin-top: auto; border-top: 1px solid var(--line); padding: 14px 10px 0; }
.me { font-size: 13px; margin-bottom: 8px; word-break: break-all; }
.me small { display: block; color: var(--muted); }
main { padding: 24px 32px 48px; min-width: 0; }
.top { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 20px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* cards & grid */
.grid { display: grid; gap: 16px; }
.kpis { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); margin-bottom: 20px; }
.two { grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; min-width: 0; }
.card.flush { padding: 0; }
.card.flush > h2 { padding: 16px 18px 0; }
.kpi .label { color: var(--muted); font-size: 12.5px; }
.kpi .value { font-size: 24px; font-weight: 600; margin-top: 4px; font-variant-numeric: tabular-nums; }
.kpi .note { color: var(--faint); font-size: 12px; margin-top: 2px; }
dl.facts { display: grid; grid-template-columns: 150px 1fr; gap: 8px 12px; margin: 0; }
dl.facts dt { color: var(--muted); }
dl.facts dd { margin: 0; word-break: break-word; }

/* tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; white-space: nowrap; }
th { font-size: 12px; font-weight: 600; color: var(--muted); background: #fafbfc; text-transform: uppercase; letter-spacing: .03em; }
tbody tr:hover { background: #fafbfc; }
tbody tr.link { cursor: pointer; }
td.wrap { white-space: normal; min-width: 180px; }
td.num, th.num { text-align: right; }
.empty { padding: 28px; text-align: center; color: var(--muted); }

/* badges */
.badge { display: inline-block; padding: 1px 8px; border-radius: 4px; font-size: 12px; font-weight: 600; border: 1px solid transparent; }
.badge.ok { color: var(--ok); background: var(--ok-bg); }
.badge.warn { color: var(--warn); background: var(--warn-bg); }
.badge.bad { color: var(--bad); background: var(--bad-bg); }
.badge.info { color: var(--info); background: var(--info-bg); }
.badge.neutral { color: var(--muted); background: #eef0f3; }

/* forms & buttons */
.btn { font: inherit; font-weight: 500; border-radius: 6px; padding: 8px 14px; border: 1px solid var(--line-strong); background: var(--panel); color: var(--text); cursor: pointer; }
.btn:hover { background: #f1f3f5; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: #0c625b; }
.btn.danger { color: var(--bad); border-color: #efc1bc; }
.btn.danger:hover { background: var(--bad-bg); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--muted); }
.btn.small { padding: 4px 10px; font-size: 13px; }
.btn.wide { width: 100%; padding: 10px; }
.btn:disabled { opacity: .55; cursor: default; }
.toolbar { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
input, select, textarea { font: inherit; color: var(--text); background: var(--panel); border: 1px solid var(--line-strong); border-radius: 6px; padding: 7px 10px; }
input:focus, select:focus, textarea:focus, .btn:focus-visible, nav a:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
input[type=search] { min-width: 260px; }
label.field { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); margin-bottom: 12px; }
label.field input, label.field select, label.field textarea { color: var(--text); width: 100%; }
label.check { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; }
.row { display: flex; gap: 12px; }
.row > * { flex: 1; }

/* banner, dialog, toast */
.banner { border: 1px solid; border-radius: var(--radius); padding: 10px 14px; margin-bottom: 16px; }
.banner.warn { background: var(--warn-bg); border-color: #f1d8a8; color: #6b4500; }
.banner.info { background: var(--info-bg); border-color: #c7d9f3; color: #18487f; }
dialog { border: 1px solid var(--line); border-radius: 10px; padding: 0; width: min(480px, 94vw); color: var(--text); }
dialog::backdrop { background: rgba(20, 28, 38, .35); }
dialog form { padding: 22px; margin: 0; }
dialog h2 { font-size: 17px; }
dialog .foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: #1c2430; color: #fff; padding: 10px 16px; border-radius: 6px; opacity: 0; pointer-events: none; transition: opacity .15s; }
.toast.show { opacity: 1; }
.loading { color: var(--muted); padding: 24px 0; }
.durations td input { width: 90px; }

@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; }
  nav { flex-direction: row; flex-wrap: wrap; }
  .side-foot { display: none; }
  main { padding: 16px; }
}
