/* Holzquadrat: Anthrazit, Sand, Weiss, Gold-Akzent – abgestimmt auf den Kapazitaetsplaner */
* { box-sizing: border-box; }
:root {
    --anthracite: #1f1d1b; --ink: #1f1d1b; --ink-2: #4a443e; --muted: #8a7e78;
    --bg: #f5f2ed; --surface: #ffffff; --sand: #efe8dd; --sand-2: #e6ddcf;
    --line: #e4ddd2; --line-2: #d4c9b9; --gold: #d2a850; --gold-ink: #94722b;
    --ok: #4c7a4f; --ok-bg: #e5eee1; --caution: #9a6a14; --caution-bg: #f6ebd3;
    --conflict: #a6402e; --conflict-bg: #f6e1da;
    --radius: 10px; --shadow: 0 1px 2px rgba(31,29,27,.06), 0 4px 14px rgba(31,29,27,.04);
}
body { margin: 0; font-family: "Inter", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
       background: var(--bg); color: var(--ink); font-size: 14px; -webkit-font-smoothing: antialiased; }
a { color: inherit; }
h1 { margin: 0; font-size: 22px; font-weight: 650; letter-spacing: -.01em; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
h2 { font-size: 16px; font-weight: 650; margin: 26px 0 10px; }

.topbar { background: var(--anthracite); color: #fff; padding: 0 28px; display: flex; align-items: stretch; gap: 36px;
          position: sticky; top: 0; z-index: 30; min-height: 68px; box-shadow: 0 6px 18px rgba(0,0,0,.12); }
.brand { display: flex; flex-direction: column; justify-content: center; line-height: 1.15; text-decoration: none; }
.brand strong { font-size: 17px; letter-spacing: .22em; font-weight: 700; }
.brand span { color: var(--gold); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; }
.tabs { display: flex; gap: 6px; align-items: stretch; }
.tab { display: flex; align-items: center; padding: 0 24px; color: #cfc7bd; text-decoration: none; font-weight: 600;
       font-size: 16px; border-bottom: 3px solid transparent; border-top: 3px solid transparent; }
.tab:hover { color: #fff; background: rgba(255,255,255,.05); }
.tab.active { color: #fff; border-bottom-color: var(--gold); background: rgba(210,168,80,.10); }
.userbox { margin-left: auto; display: flex; align-items: center; gap: 14px; color: #cfc7bd; font-size: 13px; }
.userbox form { margin: 0; }
.link-light { color: #cfc7bd; }
.link-light:hover { color: #fff; }

main { padding: 20px 28px 40px; max-width: 1500px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px;
         box-shadow: var(--shadow); margin-bottom: 18px; }
.panel.narrow, form.narrow { max-width: 760px; }
.panel.login { max-width: 420px; margin: 8vh auto; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin-bottom: 14px; flex-wrap: wrap; }
.facts { display: flex; gap: 18px; color: var(--ink-2); flex-wrap: wrap; }
.back { margin: 0 0 12px; } .back a { color: var(--muted); text-decoration: none; } .back a:hover { color: var(--ink); }
.hint { color: var(--muted); font-size: 13px; margin: 0; }
.muted { color: var(--muted); }
.code { font-size: 12px; font-weight: 700; letter-spacing: .08em; color: var(--gold-ink); background: #f7efdc;
        border-radius: 5px; padding: 2px 6px; }
code { font-size: 12px; background: var(--sand); padding: 1px 5px; border-radius: 4px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid transparent;
       border-radius: 8px; padding: 9px 16px; font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; white-space: nowrap; }
.btn.primary { background: var(--anthracite); color: #fff; } .btn.primary:hover { background: #3a3632; }
.btn.secondary { background: var(--surface); color: var(--ink); border-color: var(--line-2); } .btn.secondary:hover { background: var(--sand); }
.btn.ghost { background: transparent; color: #cfc7bd; border-color: #4a443e; padding: 6px 12px; }
.btn.ghost:hover { color: #fff; border-color: var(--gold); }
.btn.small { padding: 5px 11px; font-size: 13px; }
.btn.big { padding: 12px 20px; font-size: 15px; }

.flash { border-radius: 8px; padding: 10px 14px; margin-bottom: 14px; border: 1px solid var(--line); border-left-width: 4px; }
.flash ul { margin: 6px 0 0; padding-left: 18px; }
.flash.ok { background: var(--ok-bg); border-color: #cddcc6; border-left-color: var(--ok); color: #2f5432; }
.flash.error { background: var(--conflict-bg); border-color: #e8c3b8; border-left-color: var(--conflict); color: var(--conflict); }
.flash.warn { background: var(--caution-bg); border-color: #ead7ad; border-left-color: var(--gold); color: var(--caution); }

.badge { display: inline-block; border: 1px solid var(--line); background: var(--bg); border-radius: 20px; padding: 2px 9px;
         font-size: 11px; font-weight: 600; white-space: nowrap; color: var(--ink-2); vertical-align: middle; }
.badge.ok { background: var(--ok-bg); border-color: #cddcc6; color: var(--ok); }
.badge.off { background: var(--sand-2); color: var(--muted); }
.badge.warn { background: var(--conflict-bg); border-color: #e8c3b8; color: var(--conflict); }
.badge.plan { background: #f7efdc; border-color: #ead7ad; color: var(--gold-ink); }

.seg-group { display: inline-flex; background: var(--sand); border-radius: 8px; padding: 3px; gap: 2px; }
.seg-btn { padding: 6px 12px; border-radius: 6px; text-decoration: none; font: inherit; font-size: 13px; font-weight: 600;
           color: var(--muted); background: transparent; border: 0; cursor: pointer; }
.seg-btn:hover { color: var(--ink); }
.seg-btn.active { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.08); }

.subtabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 4px 0 18px; overflow-x: auto; }
.subtab { padding: 10px 16px; text-decoration: none; color: var(--muted); font-weight: 600; border-bottom: 3px solid transparent; white-space: nowrap; }
.subtab:hover { color: var(--ink); }
.subtab.active { color: var(--ink); border-bottom-color: var(--gold); }

.filters { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.filters input[type=search] { min-width: 260px; }
input, select { font: inherit; padding: 9px 11px; border: 1px solid var(--line-2); border-radius: 8px; background: #fff; color: var(--ink); width: 100%; }
input:focus, select:focus { outline: 2px solid var(--gold); outline-offset: 0; border-color: var(--gold); }
input[readonly] { background: var(--bg); }
label { display: flex; flex-direction: column; gap: 5px; font-weight: 600; font-size: 13px; color: var(--ink-2); }
label.check { flex-direction: row; align-items: flex-start; gap: 10px; font-weight: 500; }
label.check input { width: auto; margin-top: 3px; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 18px; align-items: end; }
.hours-row, .share-inputs { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; align-items: end; }
.share-inputs { grid-template-columns: repeat(4, minmax(0, 120px)) auto; }
.sum { font-size: 14px; color: var(--ink-2); padding-bottom: 8px; }
.sum strong.bad { color: var(--conflict); } .sum strong.good { color: var(--ok); }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
.cols h2:first-child { margin-top: 0; }
.perm-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.facts-list { display: grid; grid-template-columns: 140px 1fr; gap: 8px 16px; margin: 0 0 14px; }
.facts-list dt { color: var(--muted); } .facts-list dd { margin: 0; font-weight: 600; }

.table-wrap { overflow-x: auto; }
table.list { width: 100%; border-collapse: collapse; }
table.list th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted);
                font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--line-2); white-space: nowrap; }
table.list td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.list tbody tr:hover { background: #fbf9f6; }
table.list td a { text-decoration: none; }
table.list .num { text-align: right; white-space: nowrap; }
table.list .center { text-align: center; }
table.list .actions { text-align: right; }
table.list .small { font-size: 12px; }
table.list.compact td { padding: 7px 10px; }
table.list tr.current td { background: #fbf6ea; }
table.list tr.inactive td { color: var(--muted); }
td.share.primary { font-weight: 700; color: var(--gold-ink); }
table.matrix input { width: 18px; height: 18px; }

@media (max-width: 900px) {
    main { padding: 14px 12px 28px; }
    .topbar { padding: 0 12px; gap: 12px; flex-wrap: wrap; }
    .brand span, .userbox .who { display: none; }
    .tab { padding: 0 12px; font-size: 15px; }
    .grid2, .grid3, .cols { grid-template-columns: 1fr; }
    .hours-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .share-inputs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .filters input[type=search] { min-width: 0; flex: 1; }
}

/* --- V1-Finalisierung: ruhigere Tabellen --- */
table.list td, table.list th { line-height: 1.35; }
table.list td strong { font-weight: 650; }
.panel-head h1 { line-height: 1.2; }
.filters { align-items: center; }
.planer-ok { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px;
             border-radius: 50%; background: var(--ok-bg); color: var(--ok); font-weight: 700; font-size: 13px; cursor: help; }
.hint.footnote { margin-top: 14px; max-width: 900px; }
table.res-grid td:nth-child(3) { min-width: 180px; }
table.list tr.inactive td strong { color: var(--muted); }

@media (max-width: 700px) {
    .panel { padding: 16px 14px; }
    h1 { font-size: 19px; }
    table.list th, table.list td { padding: 8px 6px; }
    table.list .btn.small { padding: 5px 9px; }
    .filters .seg-group { width: 100%; }
    .filters .seg-btn { flex: 1; }
    .facts-list { grid-template-columns: 1fr; gap: 2px 0; }
    .facts-list dd { margin-bottom: 8px; }
}

/* --- Allgemein (Mitarbeiterseite, kleine Helfer) --- */
.spaced { margin-top: 12px; }
.hidden { display: none !important; }
.perm-group-title { font-size: 14px; margin: 14px 0 6px; }
/* Kopfleiste: Reiter duerfen schrumpfen und scrollen in sich, statt die Seite zu verbreitern */
.topbar .tabs { min-width: 0; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.topbar .userbox { flex: none; }


/* --- Admin-Konsole: Kennzahlen, Hinweise, Prüfbericht --- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat { display: flex; flex-direction: column; gap: 4px; background: var(--surface); border: 1px solid var(--line);
        border-radius: var(--radius); padding: 14px 16px; text-decoration: none; color: var(--ink); }
a.stat:hover { border-color: var(--line-2); background: #fbf9f6; }
.stat-value { font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.1; }
.stat-label { font-size: 13px; color: var(--ink-2); }
.stat.attn { border-left: 4px solid var(--gold); }
.stat.bad { border-left: 4px solid var(--conflict); }
.stat.bad .stat-value { color: var(--conflict); }
.notice { border: 1px dashed var(--line-2); border-radius: var(--radius); padding: 12px 16px; color: var(--ink-2);
          background: #fbf9f6; margin-bottom: 16px; }
.notice strong { color: var(--ink); }
.badge.dec-loeschen, .badge.dec-anonymisieren { background: var(--conflict-bg); border-color: #e8c3b8; color: var(--conflict); }
.badge.dec-aufbewahren, .badge.dec-legal_hold { background: #f7efdc; border-color: #ead7ad; color: var(--gold-ink); }
.badge.dec-klaeren { background: var(--caution-bg); border-color: #ead7ad; color: var(--caution); }
.badge.dec-keine_daten { background: var(--sand-2); color: var(--muted); }
.inline-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 6px 0 0; }
.inline-form input[type=text], .inline-form input[type=password] { width: auto; flex: 1; min-width: 160px; padding: 6px 9px; }
.inline-form select { width: auto; padding: 6px 9px; }
.danger-zone { border: 1px solid #e8c3b8; border-left: 4px solid var(--conflict); border-radius: var(--radius);
               padding: 16px 18px; background: #fdf6f3; }
.danger-zone h2 { margin-top: 0; }
.pre { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 12px; color: var(--ink-2); }
details.form-box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
                   padding: 12px 18px; margin-bottom: 18px; }
details.form-box summary { cursor: pointer; font-weight: 650; }
details.form-box[open] summary { margin-bottom: 14px; }
.report h2 { border-bottom: 1px solid var(--line); padding-bottom: 6px; }
.report .facts-list { grid-template-columns: 220px 1fr; }
@media print {
    .topbar, .subtabs, .no-print, .flash { display: none !important; }
    body { background: #fff; font-size: 11pt; }
    main { padding: 0; max-width: none; }
    .panel { box-shadow: none; border: 0; padding: 0; }
    table.list td, table.list th { padding: 4px 6px; }
    a { text-decoration: none; }
}
.plain-fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
/* Verbesserungen */
.fb-status { flex-wrap: wrap; }
.fb-list td:nth-child(4) { min-width: 240px; }
.fb-text { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.5; margin: 0 0 8px; }
textarea { font: inherit; padding: 9px 11px; border: 1px solid var(--line-2); border-radius: 8px; background: #fff; color: var(--ink); width: 100%; box-sizing: border-box; resize: vertical; }
textarea:focus { outline: 2px solid var(--gold); outline-offset: 0; border-color: var(--gold); }
.filters select { width: auto; }
/* Fuenf Hauptreiter + "Verbesserung melden": etwas schmalere Reiter, damit nichts abgeschnitten wird */
.tab { padding: 0 18px; }
/* Benutzer & Rollen */
h2.first { margin-top: 0; }
.perm-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.perm-group { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.perm-group h3 { margin: 0 0 10px; font-size: 15px; font-weight: 650; }
.perm-group ul { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; }
.perm-group label.check { margin-bottom: 10px; font-weight: 600; color: var(--ink); }
.perm-group label.check .hint { font-weight: 400; }
.role-seg { flex-wrap: wrap; }
