:root {
    --bg: #f6f7f9;
    --surface: #ffffff;
    --border: #e3e6ea;
    --text: #1b1f24;
    --muted: #697586;
    --accent: #1f5eff;
    --accent-dark: #1849c4;
    --danger: #c0352b;
    --ok: #1a7f52;
    --warn: #b06a00;
    --radius: 10px;
    --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 4px 12px rgba(16, 24, 40, .05);
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
    font: 15px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- Anmeldung ---------- */
.auth-wrap {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}

.auth-card {
    width: 100%;
    max-width: 400px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 32px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 4px;
}

.brand-mark {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: var(--accent);
    color: #fff;
    display: grid;
    place-items: center;
    font-weight: 700;
    font-size: 15px;
}

.brand-name { font-weight: 650; font-size: 16px; letter-spacing: -.01em; }
.auth-sub { color: var(--muted); font-size: 14px; margin: 0 0 24px; }

/* ---------- Form ---------- */
.field { margin-bottom: 16px; }
.field label {
    display: block;
    font-size: 13px;
    font-weight: 550;
    margin-bottom: 6px;
    color: #39414d;
}

.field input[type=email],
.field input[type=password],
.field input[type=text],
.field select {
    width: 100%;
    padding: 9px 11px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    background: #fff;
    color: var(--text);
    transition: border-color .12s, box-shadow .12s;
}

.field input:focus, .field select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(31, 94, 255, .12);
}

.check { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--muted); }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 10px 14px;
    border: 1px solid transparent;
    border-radius: 8px;
    background: var(--accent);
    color: #fff;
    font-size: 14.5px;
    font-weight: 550;
    cursor: pointer;
    transition: background .12s;
}

.btn:hover { background: var(--accent-dark); }

.btn-ghost {
    width: auto;
    background: transparent;
    color: var(--muted);
    border-color: var(--border);
}

.btn-ghost:hover { background: #f1f3f6; color: var(--text); }

.alert {
    background: #fdf2f1;
    border: 1px solid #f3c9c5;
    color: var(--danger);
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 13.5px;
    margin-bottom: 18px;
}

/* ---------- Panel-Layout ---------- */
.shell { display: flex; min-height: 100vh; }

.sidebar {
    width: 232px;
    flex: 0 0 232px;
    background: var(--surface);
    border-right: 1px solid var(--border);
    padding: 18px 14px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.nav { display: flex; flex-direction: column; gap: 2px; }

.nav a, .nav span.soon {
    padding: 8px 10px;
    border-radius: 7px;
    font-size: 14px;
    color: #39414d;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav a:hover { background: #f1f3f6; text-decoration: none; }
.nav a.active { background: #eaf0ff; color: var(--accent-dark); font-weight: 550; }
.nav span.soon { color: #9aa4b2; cursor: default; }

.nav-tag {
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: #9aa4b2;
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 1px 4px;
}

.nav-group {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: #9aa4b2;
    padding: 8px 10px 4px;
    font-weight: 600;
}

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 12px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.topbar form { display: flex; align-items: center; gap: 8px; margin: 0; }
.topbar select { padding: 6px 9px; border: 1px solid var(--border); border-radius: 7px; font-size: 13.5px; }
.topbar .btn { width: auto; padding: 6px 12px; font-size: 13.5px; }

.content { padding: 24px; max-width: 1180px; }

h1 { font-size: 21px; margin: 0 0 4px; letter-spacing: -.015em; }
.page-sub { color: var(--muted); font-size: 14px; margin: 0 0 22px; }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-bottom: 24px; }

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 18px;
}

.card .k { font-size: 12.5px; color: var(--muted); margin-bottom: 6px; }
.card .v { font-size: 26px; font-weight: 600; letter-spacing: -.02em; }

.panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.panel-head {
    padding: 13px 18px;
    border-bottom: 1px solid var(--border);
    font-weight: 600;
    font-size: 14.5px;
}

.panel-body { padding: 18px; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 9px 18px; border-bottom: 1px solid var(--border); }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; }
tr:last-child td { border-bottom: none; }

.badge {
    display: inline-block;
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 20px;
    font-weight: 550;
}

.badge-ok { background: #e7f6ee; color: var(--ok); }
.badge-warn { background: #fdf3e2; color: var(--warn); }
.badge-muted { background: #f1f3f6; color: var(--muted); }

.empty { color: var(--muted); font-size: 14px; padding: 6px 0; }
.muted { color: var(--muted); }
.small { font-size: 12px; line-height: 1.5; margin-top: 2px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; }

@media (max-width: 760px) {
    .shell { flex-direction: column; }
    .sidebar { width: 100%; flex: none; border-right: none; border-bottom: 1px solid var(--border); }
}


/* ---------- Seitenkopf, Formulare, Tabellenaktionen (Phase C) ---------- */
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.page-head h1 { margin-bottom: 4px; }
.head-actions { display: flex; align-items: center; gap: 10px; }

.crumbs { font-size: 13px; color: var(--muted); margin-bottom: 14px; display: flex; gap: 6px; flex-wrap: wrap; }
.crumbs span { color: #b2bac6; }

.btn-inline { width: auto; }
.btn-sm { width: auto; padding: 5px 10px; font-size: 13px; }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; }
.form-grid .span2 { grid-column: 1 / -1; }
.form-grid .field { margin-bottom: 0; }

.field textarea {
    width: 100%;
    padding: 9px 11px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font: inherit;
    font-size: 14px;
    background: #fff;
    color: var(--text);
    resize: vertical;
}

.field textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(31, 94, 255, .12);
}

.hint { display: block; margin-top: 5px; font-size: 12.5px; color: var(--muted); line-height: 1.4; }

.form-actions { display: flex; gap: 10px; align-items: center; }
.form-actions form { margin: 0; }

/* Eingabefeld mit unmittelbar anschliessender Schaltflaeche. */
.field-row { display: flex; gap: 8px; align-items: stretch; }
.field-row input { flex: 1 1 auto; }
.field-row .btn { flex: 0 0 auto; }

.alert-ok { background: #e9f7ef; border-color: #bfe3cd; color: var(--ok); }

.panel-head-split { display: flex; align-items: center; justify-content: space-between; gap: 12px; }

.col-actions { text-align: right; white-space: nowrap; }

.status-form { margin: 0; }
.status-form select {
    padding: 4px 8px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 13px;
    background: #fff;
    color: var(--text);
}

td .badge { vertical-align: middle; }
td .badge-muted { margin-left: 6px; }

.pager { display: flex; align-items: center; gap: 10px; margin-top: 14px; font-size: 13.5px; }
.pager-btn {
    display: inline-grid;
    place-items: center;
    min-width: 30px;
    height: 30px;
    border: 1px solid var(--border);
    border-radius: 7px;
    background: var(--surface);
    color: var(--text);
}
.pager-btn:hover { background: #f1f3f6; text-decoration: none; }
.pager-btn.disabled { color: #c3cad4; background: #fafbfc; }
.pager-info { color: var(--muted); }

table th[scope], tbody th { font-size: 12.5px; text-transform: none; letter-spacing: 0; color: var(--muted); width: 210px; font-weight: 550; }

@media (max-width: 760px) {
    .form-grid { grid-template-columns: 1fr; }
    .page-head { flex-direction: column; }
}


/* ---------- Benutzer, Protokoll, Konto (Phase C2) ---------- */
.inline-form { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 0; }
.inline-form select {
    padding: 6px 9px;
    border: 1px solid var(--border);
    border-radius: 7px;
    font-size: 13.5px;
    background: #fff;
    color: var(--text);
}

.mship { font-size: 13.5px; line-height: 1.5; }
.mship + .mship { margin-top: 2px; }

.account-link { color: var(--muted); font-size: 13.5px; }
.account-link:hover { color: var(--text); text-decoration: none; }

.col-actions form { display: inline-block; margin: 0; }

.field select:disabled, .field input:disabled {
    background: #f5f6f8;
    color: var(--muted);
    cursor: not-allowed;
}
