:root {
    --bg: #f5f6f8;
    --card: #ffffff;
    --text: #18202a;
    --muted: #667085;
    --border: #e4e7ec;
    --primary: #1d4ed8;
    --primary-hover: #1e40af;
    --danger: #b42318;
    --danger-bg: #fef3f2;
    --ok: #067647;
    --ok-bg: #ecfdf3;
    --off: #475467;
    --off-bg: #f2f4f7;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: var(--bg);
    color: var(--text);
}

.topbar {
    height: 68px;
    background: #111827;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
}

.brand {
    font-size: 20px;
    font-weight: 750;
}

.top-actions {
    display: flex;
    gap: 14px;
    align-items: center;
}

.user-badge {
    color: #d1d5db;
    font-size: 14px;
}

.container {
    max-width: 1250px;
    margin: 0 auto;
    padding: 32px 22px 60px;
}

h1 { margin: 0 0 6px; font-size: 30px; }
h2 { margin-top: 0; font-size: 20px; }
p { line-height: 1.55; }
.muted { color: var(--muted); margin-top: 0; }

.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 22px;
    box-shadow: 0 1px 2px rgba(16, 24, 40, .04);
}

.page-head, .section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 22px;
}

.stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}

.stat {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.stat strong { font-size: 28px; }
.stat span { color: var(--muted); }

.btn {
    border: 0;
    border-radius: 8px;
    padding: 10px 14px;
    cursor: pointer;
    font-weight: 650;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font: inherit;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
}
.btn-primary:hover { background: var(--primary-hover); }

.btn-secondary {
    background: #eef2f6;
    color: #344054;
}

.topbar .btn-secondary {
    background: #273244;
    color: #fff;
}

.btn-small {
    padding: 7px 10px;
    font-size: 13px;
}

.login-wrap {
    min-height: calc(100vh - 150px);
    display: grid;
    place-items: center;
}

.login-card {
    width: min(420px, 100%);
}

.narrow {
    max-width: 600px;
    margin: 30px auto;
}

.form-grid {
    display: grid;
    gap: 16px;
}

.form-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 34px;
}

.form-row-four {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

label {
    display: grid;
    gap: 7px;
    font-size: 14px;
    font-weight: 650;
}

input, select {
    width: 100%;
    border: 1px solid #d0d5dd;
    border-radius: 8px;
    padding: 10px 11px;
    font: inherit;
    color: var(--text);
    background: #fff;
}

input:focus, select:focus {
    outline: 2px solid rgba(29, 78, 216, .15);
    border-color: var(--primary);
}

.check {
    display: flex;
    align-items: center;
    gap: 9px;
    margin: 12px 0;
}

.check input {
    width: auto;
}

.hint {
    color: var(--muted);
    font-size: 13px;
    margin: -4px 0 0;
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 26px;
}

hr {
    border: 0;
    border-top: 1px solid var(--border);
    margin: 28px 0;
}

.alert {
    padding: 12px 14px;
    border-radius: 8px;
    margin-bottom: 18px;
}

.alert-error {
    color: var(--danger);
    background: var(--danger-bg);
    border: 1px solid #fecdca;
}

.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 12px 10px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    white-space: nowrap;
    font-size: 14px;
}

th {
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .03em;
}

tr.inactive td {
    color: #98a2b3;
}

.badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}

.badge.ok {
    background: var(--ok-bg);
    color: var(--ok);
}

.badge.off {
    background: var(--off-bg);
    color: var(--off);
}

.empty {
    padding: 30px;
    text-align: center;
    color: var(--muted);
}

.roadmap {
    margin-top: 20px;
}

.roadmap-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.roadmap-grid div {
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 14px;
}

.roadmap-grid span {
    display: inline-grid;
    place-items: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #e8eefc;
    color: var(--primary);
    font-weight: 800;
    margin-right: 5px;
}

.grid-two {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}

.detail-list {
    margin: 0;
}

.detail-list div {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    border-bottom: 1px solid var(--border);
    padding: 11px 0;
}

.detail-list dt { color: var(--muted); }
.detail-list dd { margin: 0; font-weight: 650; }

.placeholder {
    min-height: 320px;
}

.deadline {
    margin-top: 30px;
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 16px;
    display: flex;
    justify-content: space-between;
}

@media (max-width: 850px) {
    .stats,
    .form-columns,
    .form-row-four,
    .grid-two,
    .roadmap-grid {
        grid-template-columns: 1fr;
    }

    .page-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .topbar {
        padding: 0 15px;
    }

    .user-badge {
        display: none;
    }
}

/* Version 0.2 – Verfügbarkeit */
.brand a {
    color: inherit;
    text-decoration: none;
}

.top-link {
    color: #d1d5db;
    text-decoration: none;
    font-size: 14px;
    font-weight: 650;
}

.top-link:hover { color: #fff; }

.stats-four {
    grid-template-columns: repeat(4, 1fr);
}

.availability-summary {
    margin-bottom: 20px;
}

.deadline-box {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    padding: 15px;
    border-radius: 10px;
    border: 1px solid var(--border);
    margin: 16px 0 20px;
}

.deadline-box > div {
    display: grid;
    gap: 4px;
}

.deadline-box strong { font-size: 13px; }
.deadline-box span { color: var(--muted); font-size: 14px; }
.deadline-box.open { background: #f0fdf4; border-color: #bbf7d0; }
.deadline-box.locked { background: #fff7ed; border-color: #fed7aa; }

.info-box {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 10px;
    padding: 14px 16px;
    margin-bottom: 20px;
    line-height: 1.5;
}

.availability-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.day-card {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    background: #fbfcfe;
    display: grid;
    gap: 13px;
}

.day-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding-bottom: 9px;
    border-bottom: 1px solid var(--border);
}

.day-head strong { font-size: 17px; }
.day-head span { color: var(--muted); font-size: 13px; }

.time-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.alert-success {
    color: #067647;
    background: #ecfdf3;
    border: 1px solid #abefc6;
}

.alert-warning {
    color: #93370d;
    background: #fffaeb;
    border: 1px solid #fedf89;
}

.badge.warn {
    background: #fffaeb;
    color: #93370d;
}

.availability-table th {
    vertical-align: bottom;
}

.availability-table th span {
    font-size: 11px;
    text-transform: none;
    letter-spacing: 0;
}

.availability-cell {
    min-width: 118px;
    white-space: normal;
    vertical-align: top;
}

.availability-cell small {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    line-height: 1.3;
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.status-dot {
    display: inline-block;
    font-size: 12px;
    font-weight: 750;
    padding: 4px 7px;
    border-radius: 7px;
}

.status-dot.available,
.status-dot.preferred {
    background: #ecfdf3;
    color: #067647;
}

.status-dot.unavailable,
.status-dot.offwish {
    background: #fef3f2;
    color: #b42318;
}

.status-dot.neutral {
    background: #f2f4f7;
    color: #475467;
}

.roadmap-grid .done {
    background: #ecfdf3;
    border-color: #abefc6;
}

@media (max-width: 1000px) {
    .stats-four { grid-template-columns: repeat(2, 1fr); }
    .availability-grid { grid-template-columns: 1fr; }
}

@media (max-width: 700px) {
    .deadline-box,
    .stats-four { grid-template-columns: 1fr; }
    .top-link { display: none; }
}


.alert-success {
    color: #067647;
    background: #ecfdf3;
    border: 1px solid #abefc6;
}

.notice {
    background: #fffaeb;
    border: 1px solid #fedf89;
    color: #7a2e0e;
    border-radius: 10px;
    padding: 14px 16px;
    margin-bottom: 20px;
}

.location-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.location-card {
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 16px;
    display: grid;
    gap: 12px;
}

.staffing-location {
    margin-top: 20px;
}

.staffing-days {
    display: grid;
    gap: 18px;
}

.staffing-day {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
}

.staffing-day-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.staffing-day-head h3 {
    margin: 0;
}

.rule-row {
    display: grid;
    grid-template-columns: 180px 85px 85px 85px minmax(160px, 1fr) 65px auto;
    gap: 10px;
    align-items: end;
    padding: 10px 0 4px;
    border-top: 1px solid var(--border);
}

.rule-time {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.rule-row label,
.rule-new label {
    font-size: 12px;
}

.rule-total {
    text-align: center;
    padding-bottom: 7px;
}

.rule-total strong {
    display: block;
    font-size: 20px;
}

.rule-total span {
    color: var(--muted);
    font-size: 11px;
}

.delete-inline {
    display: flex;
    justify-content: flex-end;
}

.link-danger {
    border: 0;
    background: transparent;
    color: #b42318;
    cursor: pointer;
    padding: 3px 0 8px;
    font-size: 12px;
}

.add-rule {
    margin-top: 10px;
}

.add-rule summary {
    cursor: pointer;
    color: var(--primary);
    font-weight: 650;
    padding: 6px 0;
}

.rule-new {
    display: grid;
    grid-template-columns: 110px 110px 85px 85px 85px minmax(160px, 1fr) auto;
    gap: 10px;
    align-items: end;
    padding-top: 12px;
}

.special-create {
    display: grid;
    grid-template-columns: 160px 180px 1fr auto;
    gap: 12px;
    align-items: end;
}

.special-table {
    margin-top: 22px;
}

.special-title {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
    align-items: end;
}

.special-rule-wrap {
    border-bottom: 1px solid var(--border);
    padding-bottom: 6px;
}

.danger-zone {
    margin-top: 20px;
    padding: 18px;
    border: 1px solid #fecdca;
    background: #fef3f2;
    border-radius: 12px;
}

.btn-danger {
    background: #b42318;
    color: white;
}

@media (max-width: 1000px) {
    .rule-row,
    .rule-new,
    .special-create {
        grid-template-columns: 1fr 1fr;
    }

    .rule-note {
        grid-column: 1 / -1;
    }
}

@media (max-width: 700px) {
    .location-grid,
    .rule-row,
    .rule-new,
    .special-create,
    .special-title {
        grid-template-columns: 1fr;
    }

    .rule-time {
        grid-template-columns: 1fr 1fr;
    }
}


.btn-success { background: #067647; color: #fff; }
.schedule-head-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.schedule-status-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 20px; }
.warning-card { margin-bottom: 20px; border-color: #fedf89; }
.warning-list { display: grid; gap: 10px; }
.warning-list > div { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.warning-list span { color: #7a2e0e; }
.plain-warning-list { margin: 0; padding-left: 20px; }
.plain-warning-list li { margin: 8px 0; }
.schedule-days { display: grid; gap: 20px; }
.schedule-day-card { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.schedule-day-title { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; background: #f8fafc; border-bottom: 1px solid var(--border); }
.schedule-day-title h3 { margin: 0; }
.schedule-day-title span { color: var(--muted); }
.schedule-locations { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.schedule-location-column { padding: 14px; min-width: 0; }
.schedule-location-column + .schedule-location-column { border-left: 1px solid var(--border); }
.schedule-location-column h4 { margin: 0 0 10px; }
.shift-editor { border: 1px solid var(--border); border-radius: 10px; padding: 10px; margin-bottom: 10px; background: #fff; }
.shift-edit-form { display: grid; grid-template-columns: minmax(160px, 1.4fr) 170px 120px minmax(130px, 1fr) auto; gap: 9px; align-items: end; }
.shift-edit-form label { font-size: 11px; }
.time-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.no-shifts { color: var(--muted); padding: 14px 0; font-size: 14px; }
.manual-shift-form { display: grid; grid-template-columns: 1.3fr 1fr 1fr .8fr .8fr 1fr; gap: 10px; align-items: end; }
.manual-note { grid-column: 1 / -2; }
.employee-plan-card { margin-top: 18px; }
.employee-schedule-list { display: grid; gap: 10px; }
.employee-shift { display: grid; grid-template-columns: 1fr 180px 120px; align-items: center; gap: 12px; padding: 15px; border: 1px solid var(--border); border-radius: 10px; }
.employee-shift > div:first-child { display: grid; gap: 3px; }
.employee-shift > div:first-child span { color: var(--muted); }
.employee-shift-time { font-size: 18px; font-weight: 750; }
.empty-plan { text-align: center; padding: 38px; }

@media (max-width: 1000px) {
    .schedule-status-grid { grid-template-columns: repeat(2, 1fr); }
    .shift-edit-form, .manual-shift-form { grid-template-columns: 1fr 1fr; }
    .manual-note { grid-column: 1 / -1; }
}
@media (max-width: 700px) {
    .schedule-status-grid, .schedule-locations, .shift-edit-form, .manual-shift-form, .employee-shift { grid-template-columns: 1fr; }
    .schedule-location-column + .schedule-location-column { border-left: 0; border-top: 1px solid var(--border); }
    .warning-list > div { flex-direction: column; }
}

.info-notice {
    background: #eff8ff;
    border-color: #b2ddff;
    color: #175cd3;
}


/* v0.5 – kompakte Wochenübersicht, Fixierungen und Stundenkonto */
.schedule-status-grid {
    grid-template-columns: repeat(5, 1fr);
}

.week-board-scroll {
    overflow-x: auto;
    padding-bottom: 6px;
}

.week-board {
    min-width: 1180px;
    display: grid;
    grid-template-columns: repeat(7, minmax(155px, 1fr));
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
}

.week-board-day {
    min-width: 0;
    background: #fff;
}

.week-board-day + .week-board-day {
    border-left: 1px solid var(--border);
}

.week-board-head {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    padding: 11px 10px;
    background: #f8fafc;
    border-bottom: 1px solid var(--border);
}

.week-board-head span {
    color: var(--muted);
    font-size: 12px;
}

.week-board-location {
    padding: 10px 8px;
    min-height: 86px;
}

.week-board-location + .week-board-location {
    border-top: 1px solid var(--border);
}

.week-board-location h4 {
    margin: 0 0 7px;
    font-size: 12px;
    color: var(--muted);
}

.compact-shift {
    padding: 7px 8px;
    margin: 5px 0;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 11px;
    line-height: 1.35;
    background: #fff;
}

.compact-shift > div {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.compact-shift > span {
    color: var(--muted);
}

.compact-shift.is-locked {
    background: #fffaeb;
    border-color: #fedf89;
}

.compact-empty {
    color: var(--muted);
    padding: 5px 0;
}

.shift-locked {
    border-color: #fedf89;
    background: #fffdf5;
}

.shift-meta {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 8px;
}

.locked-badge {
    background: #fffaeb;
    color: #93370d;
}

.auto-badge {
    background: #eff8ff;
    color: #175cd3;
}

.source-label,
.tiny-muted {
    color: var(--muted);
    font-size: 11px;
}

.shift-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-top: 7px;
}

.hours-open {
    font-weight: 700;
}

.hours-over {
    font-weight: 700;
    color: #b42318;
}

@media (max-width: 1000px) {
    .schedule-status-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}


.experience-inline-form {
    display: flex;
    align-items: end;
    gap: 6px;
}
.experience-inline-form label {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
}
.experience-inline-form select {
    width: 52px;
    padding: 6px;
}
.experience-badge {
    display: inline-block;
    margin-left: 6px;
    font-size: 11px;
    font-weight: 700;
    color: var(--muted);
    white-space: nowrap;
}


.employee-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.employee-actions form {
    margin: 0;
}

.read-only-box {
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #f8fafc;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.read-only-box span {
    color: var(--muted);
    font-size: 12px;
}


/* v0.5.7 – Schichteditor sauber innerhalb jeder Laden-Spalte */
.shift-edit-form {
    display: grid;
    grid-template-columns: minmax(165px, 1.5fr) minmax(180px, .95fr) minmax(115px, .8fr);
    gap: 9px;
    align-items: end;
    width: 100%;
    min-width: 0;
}

.shift-edit-form > label,
.shift-edit-form > .time-pair {
    min-width: 0;
}

.shift-edit-form input,
.shift-edit-form select {
    width: 100%;
    min-width: 0;
    max-width: 100%;
}

.shift-edit-form .time-pair {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.shift-note-field {
    grid-column: 1 / 3;
}

.shift-save-button {
    grid-column: 3;
    width: 100%;
    min-height: 40px;
}

.schedule-location-column,
.shift-editor {
    overflow: hidden;
}

@media (max-width: 1150px) {
    .schedule-locations {
        grid-template-columns: 1fr;
    }

    .schedule-location-column + .schedule-location-column {
        border-left: 0;
        border-top: 1px solid var(--border);
    }
}

@media (max-width: 700px) {
    .shift-edit-form {
        grid-template-columns: 1fr 1fr;
    }

    .shift-edit-form > label:first-child {
        grid-column: 1 / -1;
    }

    .shift-edit-form > .time-pair {
        grid-column: 1 / -1;
    }

    .shift-note-field {
        grid-column: 1 / -1;
    }

    .shift-save-button {
        grid-column: 1 / -1;
    }
}


/* v0.5.8 – gefilterte Mitarbeiterwahl + manuelle Schicht direkt pro Tag/Standort */
.inline-manual-add {
    margin-top: 12px;
    border-top: 1px dashed var(--border);
    padding-top: 10px;
}

.inline-manual-add summary {
    cursor: pointer;
    color: var(--primary);
    font-weight: 700;
    font-size: 13px;
    padding: 4px 0;
}

.inline-manual-shift-form {
    display: grid;
    grid-template-columns: minmax(165px, 1.5fr) minmax(180px, .95fr) minmax(115px, .8fr);
    gap: 9px;
    align-items: end;
    margin-top: 10px;
    padding: 12px;
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 10px;
}

.inline-manual-shift-form > label,
.inline-manual-shift-form > .time-pair {
    min-width: 0;
}

.inline-manual-shift-form input,
.inline-manual-shift-form select {
    width: 100%;
    min-width: 0;
}

.inline-manual-shift-form .time-pair {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.inline-manual-shift-form .manual-note {
    grid-column: 1 / 3;
}

.inline-manual-shift-form > button {
    grid-column: 3;
    width: 100%;
    min-height: 40px;
}

.candidate-help {
    grid-column: 1 / -1;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.45;
}

@media (max-width: 700px) {
    .inline-manual-shift-form {
        grid-template-columns: 1fr;
    }
    .inline-manual-shift-form .manual-note,
    .inline-manual-shift-form > button,
    .candidate-help {
        grid-column: 1;
    }
}


/* v0.6 – Stammschichten, Urlaub und mobile Bedienung */
.employee-config-section {
    margin-top: 20px;
}

.recurring-list,
.vacation-list {
    display: grid;
    gap: 10px;
    margin-bottom: 18px;
}

.recurring-item,
.vacation-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 13px 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fbfcfe;
}

.recurring-main {
    display: grid;
    gap: 3px;
}

.recurring-main span,
.recurring-main small,
.vacation-item span {
    color: var(--muted);
}

.recurring-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.recurring-form {
    display: grid;
    grid-template-columns: 1.15fr 1.15fr .8fr .8fr 1fr;
    gap: 12px;
    align-items: end;
    padding-top: 14px;
}

.recurring-lock,
.recurring-note {
    grid-column: span 2;
}

.vacation-form {
    display: grid;
    grid-template-columns: 170px 170px 1fr auto;
    gap: 12px;
    align-items: end;
}

.config-add summary {
    cursor: pointer;
    color: var(--primary);
    font-weight: 700;
    padding: 8px 0;
}

.recurring-badge {
    background: #eff6ff;
    color: #1d4ed8;
}

.mobile-nav {
    display: none;
}

/* Touch-Ziele */
@media (max-width: 760px) {
    body {
        padding-bottom: 76px;
    }

    .container {
        padding: 20px 12px 34px;
    }

    .topbar {
        min-height: 58px;
        height: auto;
        padding: 8px 12px;
        gap: 10px;
    }

    .brand {
        font-size: 17px;
        white-space: nowrap;
    }

    .top-actions {
        margin-left: auto;
        gap: 7px;
    }

    .topbar .btn {
        padding: 9px 10px;
        min-height: 40px;
    }

    h1 {
        font-size: 24px;
        line-height: 1.15;
    }

    h2 {
        font-size: 19px;
    }

    .card {
        padding: 15px;
        border-radius: 12px;
    }

    input,
    select,
    textarea,
    button {
        font-size: 16px;
    }

    input,
    select {
        min-height: 46px;
    }

    .btn {
        min-height: 44px;
    }

    .form-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .form-actions .btn {
        width: 100%;
    }

    .deadline {
        margin-top: 16px;
        gap: 10px;
        flex-direction: column;
    }

    .availability-grid {
        gap: 10px;
    }

    .day-card {
        padding: 14px;
        gap: 11px;
    }

    .day-head strong {
        font-size: 18px;
    }

    .time-row {
        grid-template-columns: 1fr 1fr;
    }

    .employee-shift {
        padding: 14px;
        gap: 8px;
    }

    .employee-shift-time {
        font-size: 21px;
    }

    .schedule-day-title {
        padding: 12px;
    }

    .schedule-location-column {
        padding: 11px;
    }

    .shift-editor {
        padding: 10px;
    }

    .shift-actions {
        align-items: stretch;
    }

    .shift-actions form,
    .shift-actions .btn {
        width: 100%;
    }

    .recurring-item,
    .vacation-item {
        align-items: flex-start;
        flex-direction: column;
    }

    .recurring-meta {
        width: 100%;
        justify-content: space-between;
    }

    .recurring-form,
    .vacation-form {
        grid-template-columns: 1fr;
    }

    .recurring-lock,
    .recurring-note,
    .vacation-note {
        grid-column: 1;
    }

    .mobile-nav {
        position: fixed;
        z-index: 1000;
        display: grid;
        grid-auto-flow: column;
        grid-auto-columns: 1fr;
        left: 0;
        right: 0;
        bottom: 0;
        min-height: 64px;
        padding: 6px max(8px, env(safe-area-inset-right)) calc(6px + env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
        background: rgba(17, 24, 39, .97);
        border-top: 1px solid #334155;
        box-shadow: 0 -5px 18px rgba(15, 23, 42, .16);
    }

    .mobile-nav a {
        color: #e5e7eb;
        text-decoration: none;
        min-width: 0;
        min-height: 52px;
        display: grid;
        place-items: center;
        align-content: center;
        gap: 2px;
        border-radius: 9px;
        padding: 4px;
    }

    .mobile-nav a:active {
        background: #273244;
    }

    .mobile-nav span {
        font-size: 20px;
        line-height: 1;
    }

    .mobile-nav small {
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        font-size: 10px;
    }

    .table-wrap {
        margin-left: -3px;
        margin-right: -3px;
    }
}

@media (max-width: 390px) {
    .time-row {
        grid-template-columns: 1fr;
    }

    .brand {
        max-width: 190px;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}


/* v0.7 – Matrix, Druckansicht und Passwortreset */
.schedule-matrix-section { margin-top: 20px; }

.matrix-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.schedule-matrix {
    width: 100%;
    min-width: 900px;
    table-layout: fixed;
    border-collapse: collapse;
}

.schedule-matrix th,
.schedule-matrix td {
    border: 1px solid #d0d5dd;
    padding: 7px 5px;
    text-align: center;
    vertical-align: middle;
    white-space: normal;
}

.schedule-matrix thead th {
    background: #eaf7fc;
    color: #1f2937;
}

.schedule-matrix thead th:first-child { width: 170px; }

.schedule-matrix thead th span,
.schedule-matrix thead th small { display: block; }

.schedule-matrix thead th small {
    margin-top: 2px;
    color: var(--muted);
    font-weight: 500;
}

.matrix-employee {
    position: sticky;
    left: 0;
    z-index: 2;
    background: #fff;
    text-align: left !important;
    white-space: nowrap !important;
}

.matrix-work { background: #fbfdff; }
.matrix-vacation { background: #f2f4f7; font-weight: 800; }

.matrix-shift {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    justify-content: center;
    margin: 1px 2px;
}

.role-marker {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    border-radius: 999px;
    background: #eef4ff;
    color: #3448a8;
    font-size: 10px;
    line-height: 1;
    font-weight: 900;
}

.role-marker.role-override {
    background: #fff4e5;
    color: #9a3412;
    box-shadow: inset 0 0 0 1px #fed7aa;
}

.matrix-shift small {
    font-size: 9px;
    line-height: 1;
    padding: 2px 4px;
    border-radius: 999px;
    background: #e8eefc;
    color: #1d4ed8;
    font-weight: 800;
}

.matrix-empty { color: #98a2b3; }

.password-reset-form {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 12px;
    align-items: end;
}

.schedule-update-alert { margin-bottom: 16px; }

.schedule-published-note {
    color: var(--muted);
    font-size: 13px;
    margin-bottom: 12px;
}

@media (max-width: 760px) {
    .schedule-matrix { min-width: 760px; }

    .schedule-matrix th,
    .schedule-matrix td {
        padding: 7px 4px;
        font-size: 12px;
    }

    .schedule-matrix thead th:first-child { width: 125px; }

    .matrix-employee {
        max-width: 125px;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .password-reset-form { grid-template-columns: 1fr; }

    .schedule-head-actions {
        width: 100%;
        display: grid;
        gap: 8px;
    }

    .schedule-head-actions > *,
    .schedule-head-actions .btn {
        width: 100%;
    }
}

/* v0.8 – Admin-Verfügbarkeit und feste wöchentliche Verfügbarkeit */
.page-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.badge.recurring {
    background: #eff6ff;
    color: #1d4ed8;
    margin-left: 6px;
    padding: 3px 7px;
    font-size: 10px;
}

.fixed-toggle {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 13px;
    font-weight: 700;
    color: #344054;
}

.fixed-toggle input {
    width: 18px;
    height: 18px;
    margin: 0;
}

.fields-disabled {
    opacity: .45;
}

.recurring-day .day-head {
    align-items: center;
}

@media (max-width: 760px) {
    .page-actions {
        width: 100%;
        display: grid;
        grid-template-columns: 1fr;
    }

    .page-actions .btn { width: 100%; }
}

/* v0.9 – Wochenhistorie, Sicherungen und Änderungsprotokoll */
.week-nav {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.chip {
    display: inline-flex;
    align-items: center;
    padding: 7px 10px;
    border-radius: 999px;
    background: #fff7ed;
    color: #9a3412;
    border: 1px solid #fed7aa;
    text-decoration: none;
    font-size: 13px;
    font-weight: 700;
}

.missing-availability-card,
.system-audit-card {
    margin-top: 20px;
}

.dashboard-quick-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin: 20px 0;
}

.quick-card {
    text-decoration: none;
    color: inherit;
    display: grid;
    gap: 5px;
}

.quick-card strong { font-size: 18px; }
.quick-card span { color: var(--muted); font-size: 14px; }

.restore-form {
    display: grid;
    grid-template-columns: minmax(160px, 1fr) auto;
    gap: 8px;
    align-items: center;
    min-width: 330px;
}

.audit-detail {
    white-space: normal;
    min-width: 220px;
}

@media (max-width: 760px) {
    .week-nav {
        width: 100%;
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .week-nav .btn { width: 100%; }
    .dashboard-quick-grid { grid-template-columns: 1fr; }
    .restore-form { min-width: 280px; }
}

/* v0.9.1 – Vier-Wochen-Planung */
.four-week-action-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    margin-bottom: 20px;
}

.four-week-action-card h2 { margin: 0 0 5px; }
.four-week-action-card p { margin: 0; }

.four-week-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.four-week-card {
    display: grid;
    gap: 16px;
}

.four-week-card-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.four-week-card-head h2 { margin: 3px 0; }
.four-week-card-head p { margin: 0; }

.four-week-number {
    display: inline-block;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--muted);
}

.four-week-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
}

.four-week-stats > div {
    display: grid;
    gap: 2px;
    padding: 10px;
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 9px;
    text-align: center;
}

.four-week-stats strong { font-size: 18px; }
.four-week-stats span { color: var(--muted); font-size: 11px; }

.four-week-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.four-week-missing summary {
    cursor: pointer;
    color: #9a3412;
    font-weight: 750;
    margin-bottom: 10px;
}

.four-week-ready {
    color: #067647;
    font-weight: 750;
}

.four-week-warning {
    color: #9a3412;
    font-size: 13px;
    font-weight: 700;
}

.published-badge { background: #ecfdf3; color: #067647; border-color: #abefc6; }
.draft-badge { background: #eff8ff; color: #175cd3; border-color: #b2ddff; }

@media (max-width: 900px) {
    .four-week-grid { grid-template-columns: 1fr; }
}

@media (max-width: 650px) {
    .four-week-action-card { align-items: stretch; flex-direction: column; }
    .four-week-action-card .btn { width: 100%; }
    .four-week-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .four-week-card-actions { display: grid; grid-template-columns: 1fr; }
    .four-week-card-actions .btn { width: 100%; }
}

/* v0.9.2 – Vier-Wochen-Verfügbarkeit für Mitarbeiter */
.employee-four-week-grid {
    display: grid;
    gap: 16px;
}

.employee-four-week-card {
    padding: 0;
    overflow: hidden;
}

.employee-four-week-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    padding: 18px 20px;
    cursor: pointer;
    list-style: none;
}

.employee-four-week-summary::-webkit-details-marker { display: none; }
.employee-four-week-summary::after {
    content: "▾";
    color: var(--muted);
    font-size: 18px;
    transition: transform .15s ease;
}

.employee-four-week-card[open] > .employee-four-week-summary::after { transform: rotate(180deg); }

.employee-four-week-summary > div:first-child {
    display: flex;
    align-items: baseline;
    gap: 8px;
    flex-wrap: wrap;
}

.employee-four-week-summary-status {
    margin-left: auto;
}

.employee-four-week-body {
    border-top: 1px solid var(--border);
    padding: 18px 20px 20px;
}

@media (max-width: 650px) {
    .employee-four-week-summary {
        align-items: flex-start;
        padding: 15px;
    }
    .employee-four-week-summary-status { margin-left: 0; }
    .employee-four-week-summary > div:first-child { display: grid; gap: 2px; }
    .employee-four-week-body { padding: 15px; }
}

/* v0.9.5: kompakter Uhrzeit-Tausch im Schichteditor */
.swap-time-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.swap-time-form select { min-width: 180px; max-width: 280px; }
@media (max-width: 700px) {
    .swap-time-form { width: 100%; }
    .swap-time-form select, .swap-time-form .btn { width: 100%; max-width: none; }
}

/* v0.9.7: persönliches Wochenmaximum direkt in der Verfügbarkeit */
.availability-week-options {
    margin: 0 0 16px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: rgba(127, 127, 127, 0.06);
}
.availability-week-options label {
    display: grid;
    gap: 7px;
    font-weight: 700;
}
.availability-week-options select {
    max-width: 320px;
}
.availability-week-options .hint {
    margin: 8px 0 0;
}

/* v0.9.8: Urlaub/Krank und harte Nichtverfügbarkeit */
.absence-self-service { margin-bottom: 18px; }
.absence-self-service .vacation-form select { min-width: 150px; }
.matrix-vacation strong { letter-spacing: .02em; }
