/* Werkstatt-Portal – moderner Werkstatt-Look (dunkel/hell) */
:root, [data-theme="dark"] {
  --bg: #16181b;
  --bg-2: #1d2024;
  --panel: #23272c;
  --panel-2: #2b3036;
  --line: #3a4048;
  --text: #e8eaed;
  --muted: #9aa3ad;
  --accent: #f28c28;         /* Signal-Orange */
  --accent-ink: #1b1204;
  --ok: #3fb46b;
  --warn: #e6b422;
  --err: #e5534b;
  --info: #4a9fe0;
  --shadow: 0 1px 0 rgba(255,255,255,.04) inset, 0 6px 18px rgba(0,0,0,.35);
  --plate: repeating-linear-gradient(135deg, rgba(255,255,255,.025) 0 2px, transparent 2px 9px);
  --hazard: repeating-linear-gradient(135deg, var(--accent) 0 10px, #1b1b1b 10px 20px);
}
[data-theme="light"] {
  --bg: #eceef1;
  --bg-2: #e2e5e9;
  --panel: #ffffff;
  --panel-2: #f4f5f7;
  --line: #cfd4da;
  --text: #1c2025;
  --muted: #5d6670;
  --accent: #d9700f;
  --accent-ink: #ffffff;
  --ok: #1f8a4c;
  --warn: #a87a00;
  --err: #c33a32;
  --info: #1f6fb2;
  --shadow: 0 1px 2px rgba(0,0,0,.08), 0 4px 14px rgba(0,0,0,.06);
  --plate: repeating-linear-gradient(135deg, rgba(0,0,0,.025) 0 2px, transparent 2px 9px);
}

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  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 { font-family: "Bahnschrift", "DIN Alternate", "Barlow Condensed", "Arial Narrow", system-ui, sans-serif;
         letter-spacing: .02em; margin: 0 0 .4em; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.15rem; text-transform: uppercase; color: var(--muted); }
code { background: var(--panel-2); padding: 1px 5px; border-radius: 4px; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.inline { display: inline; margin: 0; }
.ico { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8;
       stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ---- Kopfzeile ---- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  height: 56px; padding: 0 16px;
  background: var(--plate), var(--bg-2);
  border-bottom: 3px solid transparent;
  border-image: var(--hazard) 1;
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 8px;
              background: var(--accent); color: var(--accent-ink); }
.brand-mark.big { width: 56px; height: 56px; border-radius: 12px; margin: 0 auto 10px; }
.brand-mark.big .ico { width: 32px; height: 32px; }
.brand-text, .login-head h1 { font-family: "Bahnschrift", "DIN Alternate", "Arial Narrow", system-ui, sans-serif;
              font-weight: 700; letter-spacing: .12em; font-size: 1.05rem; }
.brand-text span, .login-head h1 span { color: var(--accent); margin-left: .35em; }
.topbar-right { display: flex; align-items: center; gap: 6px; }
.icon-btn { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 8px;
            border: 1px solid var(--line); background: var(--panel); color: var(--text); cursor: pointer; }
.icon-btn:hover { border-color: var(--accent); color: var(--accent); }
.user-chip { display: flex; align-items: center; gap: 6px; padding: 0 12px; height: 38px;
             border-radius: 8px; border: 1px solid var(--line); background: var(--panel); color: var(--text); }
.user-chip:hover { border-color: var(--accent); text-decoration: none; }

/* ---- Layout / Navigation ---- */
.layout { display: grid; grid-template-columns: 220px 1fr; min-height: calc(100vh - 56px); }
.sidenav { background: var(--bg-2); border-right: 1px solid var(--line); padding: 14px 10px;
           display: flex; flex-direction: column; gap: 2px; }
.sidenav a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 8px;
             color: var(--text); border-left: 3px solid transparent; }
.sidenav a:hover { background: var(--panel); text-decoration: none; }
.sidenav a.active { background: var(--panel); border-left-color: var(--accent); color: var(--accent); }
.sidenav a.soon { color: var(--muted); }
.sidenav a em { margin-left: auto; font-style: normal; font-size: .7rem; text-transform: uppercase;
                border: 1px solid var(--line); border-radius: 4px; padding: 0 5px; }
.nav-sep { margin: 14px 12px 4px; font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.content { padding: 22px; max-width: 1200px; width: 100%; }
.footer { margin-top: 30px; color: var(--muted); font-size: .8rem; text-align: right; }

/* ---- Bausteine ---- */
.plate { background: var(--plate), var(--panel); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); }
.panel { padding: 18px; margin-bottom: 18px; }
.panel.narrow { max-width: 560px; }
.page-head { margin-bottom: 16px; }
.page-head.row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 18px; }
.grid-2 .panel { margin-bottom: 0; }
.grid-2 + .panel { margin-top: 18px; }

.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; margin-bottom: 18px; }
.tile { display: flex; gap: 14px; padding: 16px; border-left: 4px solid var(--accent); }
.tile.warn { border-left-color: var(--warn); }
.tile-ico { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 10px;
            background: var(--panel-2); color: var(--accent); }
.tile.warn .tile-ico { color: var(--warn); }
.tile-value { font-family: "Bahnschrift", "DIN Alternate", system-ui, sans-serif; font-size: 1.7rem; font-weight: 700; line-height: 1.1; }
.tile-label { font-weight: 600; }
.tile-note { font-size: .75rem; color: var(--muted); }

.roadmap { margin: 0; padding-left: 1.2em; }
.roadmap li { padding: 3px 0; color: var(--muted); }
.roadmap li.done { color: var(--ok); }
.roadmap li b { color: var(--text); margin-right: 6px; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 600; word-break: break-all; }

/* ---- Formulare & Buttons ---- */
.form { display: flex; flex-direction: column; gap: 14px; }
.form label { display: flex; flex-direction: column; gap: 5px; font-weight: 600; font-size: .9rem; }
.form label.check { flex-direction: row; align-items: center; gap: 8px; font-weight: 500; }
fieldset { border: 1px dashed var(--line); border-radius: 8px; padding: 12px; display: flex; flex-direction: column; gap: 12px; }
legend { padding: 0 6px; font-weight: 600; }
input, select { font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--line);
                border-radius: 8px; padding: 10px 12px; min-height: 44px; }
input[type=checkbox] { min-height: 0; width: 20px; height: 20px; accent-color: var(--accent); }
input:focus, select:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 42px; padding: 0 16px;
       border-radius: 8px; border: 1px solid var(--line); background: var(--panel-2); color: var(--text);
       font: inherit; font-weight: 600; cursor: pointer; }
.btn:hover { border-color: var(--accent); text-decoration: none; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { filter: brightness(1.08); }
.btn-small { min-height: 34px; padding: 0 12px; font-size: .9rem; }
.btn-block { width: 100%; }

.flash { padding: 10px 14px; border-radius: 8px; margin-bottom: 14px; border: 1px solid; }
.flash-ok { border-color: var(--ok); color: var(--ok); background: color-mix(in srgb, var(--ok) 10%, transparent); }
.flash-warn { border-color: var(--warn); color: var(--warn); background: color-mix(in srgb, var(--warn) 10%, transparent); }
.flash-err { border-color: var(--err); color: var(--err); background: color-mix(in srgb, var(--err) 10%, transparent); }

.badge { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: .78rem; font-weight: 600;
         border: 1px solid var(--line); color: var(--muted); }
.badge-ok { border-color: var(--ok); color: var(--ok); }
.badge-warn { border-color: var(--warn); color: var(--warn); }
.badge-err { border-color: var(--err); color: var(--err); }
.badge-accent { border-color: var(--accent); color: var(--accent); }

.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted);
            border-bottom: 2px solid var(--line); padding: 8px; }
.table td { border-bottom: 1px solid var(--line); padding: 10px 8px; vertical-align: middle; }
.table tr.dim td { opacity: .55; }

/* ---- Anmeldung ---- */
.login-page { background: var(--plate), var(--bg); }
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login-card { position: relative; overflow: hidden; width: 100%; max-width: 380px; padding: 34px 24px 28px; }
.login-card::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 6px; background: var(--hazard); }
.login-head { text-align: center; margin-bottom: 18px; }
.login-head h1 { font-size: 1.4rem; margin: 0; }
.login-foot { text-align: center; margin: 14px 0 0; font-size: .8rem; }

/* ---- Smartphone ---- */
@media (max-width: 800px) {
  .layout { grid-template-columns: 1fr; }
  .sidenav { position: fixed; bottom: 0; left: 0; right: 0; z-index: 30; flex-direction: row; overflow-x: auto;
             padding: 6px; gap: 4px; border-right: 0; border-top: 1px solid var(--line); }
  .sidenav a { flex-direction: column; gap: 2px; min-width: 72px; padding: 6px 4px; font-size: .7rem;
               border-left: 0; border-top: 3px solid transparent; text-align: center; }
  .sidenav a.active { border-top-color: var(--accent); }
  .sidenav a em, .nav-sep { display: none; }
  .content { padding: 14px 16px 90px; }
  .user-chip span { display: none; }
  .brand-text { font-size: .9rem; }
  .table thead { display: none; }
  .table tr { display: block; border-bottom: 1px solid var(--line); padding: 8px 0; }
  .table td { display: flex; justify-content: space-between; gap: 10px; border: 0; padding: 4px 0; }
  .table td[data-l]::before { content: attr(data-l); color: var(--muted); font-size: .8rem; }
}

/* ---- Zugangsanfragen (0.1.1) ---- */
.login-card.wide { max-width: 440px; }
.login-alt { text-align: center; margin: 16px 0 0; }
.hp { position: absolute !important; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.count { margin-left: auto; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; display: grid; place-items: center;
         background: var(--accent); color: var(--accent-ink); font-size: .75rem; font-weight: 700; }
.notice { display: flex; align-items: center; gap: 12px; padding: 14px 16px; margin-bottom: 16px; color: var(--text);
          border-left: 4px solid var(--warn); }
.notice .ico { color: var(--warn); }
.notice:hover { text-decoration: none; border-color: var(--accent); }
.notice-go { margin-left: auto; color: var(--accent); font-weight: 600; white-space: nowrap; }
.panel-warn { border-left: 4px solid var(--warn); }
.actions { display: flex; flex-wrap: wrap; gap: 6px; }
.inline-form { display: inline-flex; gap: 6px; align-items: center; margin: 0; }
.inline-form select { min-height: 34px; padding: 4px 8px; font-size: .9rem; }
.btn-ok { border-color: var(--ok); color: var(--ok); }
.btn-ok:hover { background: var(--ok); color: #fff; }
.btn-danger { border-color: var(--err); color: var(--err); }
.btn-danger:hover { background: var(--err); color: #fff; }
.table tr.dim-soft td { opacity: .75; }
@media (max-width: 800px) {
  .sidenav .count { position: absolute; margin: 0 0 0 26px; top: 2px; }
  .sidenav a { position: relative; }
  .notice { flex-wrap: wrap; }
  .table td.actions { justify-content: flex-start; }
}
