.app-shell {
    background: #ffffff;
    min-height: 100vh;
}

.board {
    background: #ffffff;
    padding: 12px;
}

/* Top bar */
.top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 4px 16px 4px;
    flex-wrap: wrap;
}

.top-bar .left-buttons,
.top-bar .right-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.top-bar .period-nav {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
}

.period-nav .period-label {
    min-width: 150px;
    text-align: center;
}

.period-nav button {
    border: none;
    background: #f0f0f0;
    border-radius: 8px;
    width: 32px;
    height: 32px;
    cursor: pointer;
}

.period-nav button:hover {
    background: #e0e0e0;
}

.btn-board {
    border: none;
    border-radius: 8px;
    padding: 8px 14px;
    background: #2e7d5b;
    color: #fff;
    cursor: pointer;
    font-weight: 500;
    text-decoration: none;
    display: inline-block;
}

.btn-board:hover {
    background: #266a4d;
    color: #fff;
}

.btn-board.secondary {
    background: #eef1f4;
    color: #333;
}

.btn-board.secondary:hover {
    background: #dfe4e8;
    color: #333;
}

.btn-board.danger {
    background: #c0392b;
}

.btn-board.danger:hover {
    background: #a93226;
}

.btn-board:disabled {
    opacity: 0.5;
    cursor: default;
}

/* Umschalter Monat / Jahr */
.mode-switch {
    display: flex;
    background: #eef1f4;
    border-radius: 10px;
    padding: 3px;
    gap: 2px;
}

.mode-switch a {
    padding: 6px 14px;
    border-radius: 8px;
    color: #444;
    text-decoration: none;
    font-weight: 500;
}

.mode-switch a.active {
    background: #2e7d5b;
    color: #fff;
}

.alert {
    padding: 10px 14px;
    border-radius: 8px;
    margin: 8px 0;
}

.alert-danger {
    background: #fdecea;
    color: #8e2a20;
}

.alert-success {
    background: #e6f4ea;
    color: #1e6b3a;
}

/* ---------- Planer-Raster (Mitarbeiter x Tage) ---------- */
.planer-scroll {
    overflow: auto;
    max-height: calc(100vh - 190px);
    border: 1px solid #e8e9ec;
    border-radius: 12px;
}

.planer-table {
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
    font-size: 0.8rem;
}

.planer-table th,
.planer-table td {
    border-right: 1px solid #f0f1f3;
    border-bottom: 1px solid #f0f1f3;
    text-align: center;
    padding: 0;
}

.planer-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #f7f8fa;
    padding: 4px 0;
    min-width: 32px;
    line-height: 1.15;
}

.planer-table thead th .wd {
    display: block;
    font-weight: 400;
    color: #888;
    font-size: 0.7rem;
}

.planer-table .name-col {
    position: sticky;
    left: 0;
    z-index: 1;
    background: #ffffff;
    min-width: 170px;
    max-width: 220px;
    text-align: left;
    padding: 0 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    border-right: 2px solid #e1e4e8;
}

.planer-table thead .name-col {
    z-index: 3;
    background: #f7f8fa;
}

.planer-table tbody tr:hover .name-col {
    background: #f4f9f6;
}

.day-cell {
    height: 30px;
    position: relative;
    cursor: pointer;
}

.day-cell:hover {
    outline: 2px solid #9fd4bb;
    outline-offset: -2px;
}

th.weekend, td.weekend { background: #f1f3f5; }
th.ft-schweiz, td.ft-schweiz { background: #fde4e4; }
th.ft-katholisch, td.ft-katholisch { background: #ebe0f8; }
th.ft-eigene, td.ft-eigene { background: #fff0cc; }
td.ft-markierung { box-shadow: inset 0 -3px 0 #f0b429; }

th.heute {
    box-shadow: inset 0 -3px 0 #2e7d5b;
    color: #2e7d5b;
}

.abs {
    position: absolute;
    top: 3px;
    bottom: 3px;
    left: 2px;
    right: 2px;
    border-radius: 6px;
}

.abs.half-am { right: 50%; border-top-right-radius: 0; border-bottom-right-radius: 0; left: 2px; }
.abs.half-pm { left: 50%; border-top-left-radius: 0; border-bottom-left-radius: 0; right: 2px; }

/* noch nicht genehmigt: schraffiert */
.abs.geplant {
    background-image: repeating-linear-gradient(135deg, rgba(255,255,255,0.65) 0 4px, rgba(255,255,255,0) 4px 8px);
    border: 2px dashed rgba(0,0,0,0.35);
}

.planer-table tfoot td {
    position: sticky;
    bottom: 0;
    z-index: 2;
    background: #f7f8fa;
    font-weight: 600;
    height: 28px;
    color: #444;
    cursor: default;
}

.planer-table tfoot .name-col {
    z-index: 3;
    background: #f7f8fa;
    font-weight: 600;
}

.count-1 { background: #e3f1ea !important; }
.count-2 { background: #c6e4d5 !important; }
.count-3 { background: #f6d9a6 !important; }
.count-4 { background: #f2b6a0 !important; }

/* Legende */
.legend {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 18px;
    margin-top: 12px;
    font-size: 0.82rem;
    color: #555;
}

.legend-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.legend-swatch {
    width: 14px;
    height: 14px;
    border-radius: 4px;
    display: inline-block;
    border: 1px solid rgba(0,0,0,0.12);
}

.legend-swatch.geplant {
    background: repeating-linear-gradient(135deg, #ccc 0 3px, #fff 3px 6px);
    border: 1px dashed #666;
}

.legend-swatch.ft-schweiz { background: #fde4e4; }
.legend-swatch.ft-katholisch { background: #ebe0f8; }
.legend-swatch.ft-eigene { background: #fff0cc; }
.legend-swatch.weekend { background: #f1f3f5; }

.feiertag-liste {
    margin-top: 14px;
    font-size: 0.85rem;
    color: #444;
}

.feiertag-liste ul {
    list-style: none;
    padding: 0;
    margin: 4px 0 0 0;
    display: flex;
    flex-wrap: wrap;
    gap: 4px 10px;
}

.feiertag-liste li {
    padding: 2px 10px;
    border-radius: 12px;
}

.feiertag-liste li.ft-schweiz { background: #fde4e4; }
.feiertag-liste li.ft-katholisch { background: #ebe0f8; }
.feiertag-liste li.ft-eigene { background: #fff0cc; }

.badge-kat {
    display: inline-block;
    padding: 1px 9px;
    border-radius: 10px;
    font-size: 0.75rem;
}

.badge-kat.ft-schweiz { background: #fde4e4; }
.badge-kat.ft-katholisch { background: #ebe0f8; }
.badge-kat.ft-eigene { background: #fff0cc; }

/* ---------- Jahresuebersicht ---------- */
.jahr-table {
    border-collapse: collapse;
    width: 100%;
    font-size: 0.85rem;
}

.jahr-table th {
    text-align: right;
    font-size: 0.75rem;
    color: #777;
    padding: 6px 8px;
    border-bottom: 2px solid #eee;
    white-space: nowrap;
}

.jahr-table th:first-child,
.jahr-table td:first-child {
    text-align: left;
}

.jahr-table td {
    text-align: right;
    padding: 6px 8px;
    border-bottom: 1px solid #f2f2f2;
    font-variant-numeric: tabular-nums;
}

.jahr-table td.zero { color: #c3c7cc; }
.jahr-table td.rest-neg { color: #c0392b; font-weight: 600; }
.jahr-table td.rest { font-weight: 600; }

.jahr-table input[type="number"] {
    width: 70px;
    text-align: right;
    padding: 3px 6px;
    border-radius: 6px;
    border: 1px solid #ccc;
}

.jahr-table input.override {
    border-color: #2e7d5b;
    background: #f1f9f5;
}

.jahr-table .sep {
    border-left: 2px solid #eee;
}

/* ---------- Stammdaten ---------- */
.sub-nav {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin: 8px 0 18px 0;
}

.sub-nav a {
    padding: 6px 14px;
    border-radius: 18px;
    background: #eef1f4;
    color: #333;
    text-decoration: none;
}

.sub-nav a.active {
    background: #2e7d5b;
    color: #fff;
}

.admin-actions {
    white-space: nowrap;
}

.admin-actions .btn-board + .btn-board {
    margin-left: 6px;
}

.admin-section {
    margin-bottom: 32px;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 8px;
}

.admin-table th {
    text-align: left;
    font-size: 0.8rem;
    color: #777;
    padding: 4px 8px;
    border-bottom: 2px solid #eee;
}

.admin-table td {
    padding: 4px 8px;
    border-bottom: 1px solid #f2f2f2;
}

.admin-table input[type="text"],
.admin-table input[type="number"],
.admin-table input[type="date"],
.admin-table input:not([type]),
.admin-table select {
    width: 100%;
    padding: 5px 7px;
    border-radius: 8px;
    border: 1px solid #ccc;
}

.admin-table input[type="color"] {
    width: 44px;
    height: 30px;
    padding: 0;
    border: 1px solid #ccc;
    border-radius: 6px;
}

.form-hint {
    display: block;
    font-size: 0.75rem;
    color: #888;
    margin-top: 4px;
}

/* ---------- Dialoge ---------- */
.dialog-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3000;
}

.dialog-box {
    background: #fff;
    border-radius: 16px;
    padding: 20px 24px;
    width: 460px;
    max-width: 92vw;
    max-height: 88vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0,0,0,0.25);
}

.dialog-box h4 {
    margin-bottom: 16px;
}

.dialog-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 18px;
}

.dialog-actions .spacer {
    flex: 1 1 auto;
}

.form-field {
    margin-bottom: 12px;
}

.form-field label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 4px;
    color: #555;
}

.form-field input, .form-field select, .form-field textarea {
    width: 100%;
    padding: 6px 8px;
    border-radius: 8px;
    border: 1px solid #ccc;
}

.form-field.form-check label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    margin-bottom: 0;
    cursor: pointer;
}

.form-field.form-check input {
    width: auto;
}

.form-row {
    display: flex;
    gap: 12px;
}

.form-row .form-field {
    flex: 1 1 0;
    min-width: 0;
}

.dialog-info {
    background: #f1f9f5;
    border-radius: 10px;
    padding: 8px 12px;
    font-size: 0.85rem;
    color: #25513c;
    margin-bottom: 12px;
}

.dialog-info.warn {
    background: #fff4e0;
    color: #7a4b00;
}

@media (max-width: 700px) {
    .form-row {
        flex-direction: column;
        gap: 0;
    }

    .planer-table .name-col {
        min-width: 110px;
    }
}
