﻿.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 .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: 230px;
    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: inherit;
    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;
}

/* Reiter der Abteilungen */
.mode-switch {
    display: flex;
    background: #eef1f4;
    border-radius: 10px;
    padding: 3px;
    gap: 2px;
    flex-wrap: wrap;
}

.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;
}

/* ---------- Wochenplan (wie die Excel-Vorlage) ---------- */
.plan-kopf {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 6px 36px;
    margin: 0 0 8px 2px;
    font-size: 0.95rem;
}

.plan-kopf .plan-titel {
    font-weight: 700;
    font-size: 1.05rem;
    min-width: 110px;
}

.tour-legende {
    margin: 0 0 8px 2px;
}

.plan-scroll {
    overflow-x: auto;
    padding-bottom: 4px;
}

.plan-table {
    border-collapse: collapse;
    width: 100%;
    min-width: 860px;
    table-layout: fixed;
    border: 2px solid #222;
    font-size: 0.9rem;
}

.plan-table th,
.plan-table td {
    border: 1px solid #222;
    padding: 0;
    text-align: center;
    vertical-align: middle;
}

.plan-table thead th {
    background: #ffffff;
    padding: 6px 4px;
    line-height: 1.2;
    border-bottom: 2px solid #222;
}

.plan-table thead th .wd {
    display: block;
    font-weight: 400;
    color: #777;
    font-size: 0.72rem;
}

.plan-table thead th.heute {
    box-shadow: inset 0 -4px 0 #2e7d5b;
}

.plan-table .label-col {
    width: 112px;
    text-align: left;
    padding: 4px 8px;
    font-weight: 600;
}

.plan-table .sum-col {
    width: 86px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.plan-table thead .label-col,
.plan-table thead .sum-col {
    font-weight: 700;
}

.plan-cell {
    height: 42px;
    cursor: pointer;
    position: relative;
    padding: 2px 3px !important;
    line-height: 1.15;
}

.plan-cell:hover {
    outline: 3px solid #5fb28c;
    outline-offset: -3px;
}

.plan-cell.leer:hover {
    background-color: #f1f9f5 !important;
}

.plan-cell .zusatz {
    display: block;
    font-size: 0.74rem;
    opacity: 0.85;
}

.plan-cell .person {
    display: block;
    font-size: 0.88rem;
}

.auch {
    position: absolute;
    top: 1px;
    right: 3px;
    font-size: 0.8rem;
    color: #8e5a00;
    font-weight: 700;
}

.legend .auch {
    position: static;
}

.sum-col.abweichung {
    background: #ffe3b8;
    color: #7a4b00;
}

.legend-swatch.abweichung-swatch {
    background: #ffe3b8;
}

.tour-block td {
    border-top: 1px solid #222;
}

.tour-block .tour-summe td {
    height: 30px;
    font-weight: 700;
    padding: 2px 6px;
    font-variant-numeric: tabular-nums;
}

.tour-block .tour-summe td.summe-gelb {
    background: #ffff00;
    color: #000;
    text-align: right;
}

.tour-block .tour-route td.label-col {
    font-weight: 700;
    text-align: center;
}

.route-cell {
    vertical-align: middle;
    padding: 6px 4px !important;
    height: 110px;
    cursor: pointer;
}

.route-cell:hover {
    outline: 3px solid #5fb28c;
    outline-offset: -3px;
}

.route-cell .rt-titel {
    font-weight: 700;
    font-size: 0.88rem;
    white-space: pre-line;
}

.route-cell .rt-titel.markiert {
    color: #c00000;
}

.route-cell .rt-detail {
    font-size: 0.72rem;
    margin-top: 3px;
    white-space: pre-line;
}

.plan-table tfoot td {
    background: #f7f8fa;
    font-weight: 600;
    height: 30px;
    font-variant-numeric: tabular-nums;
    border-top: 2px solid #222;
}

.plan-table tfoot .label-col {
    text-align: left;
}

/* 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.25);
}

.tour-legende .legend-item {
    padding: 3px 14px;
    border-radius: 4px;
}

/* ---------- 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;
    overflow-x: auto;
}

.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: 4px;
}

.dialog-sub {
    color: #777;
    font-size: 0.85rem;
    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;
    }

    .period-nav .period-label {
        min-width: 0;
    }
}

/* ---------- Druck: nur der Plan, quer, wie die Excel-Vorlage ---------- */
@page {
    size: A4 landscape;
    margin: 10mm;
}

@media print {
    .no-print,
    .web-topbar {
        display: none !important;
    }

    .board {
        padding: 0;
    }

    .plan-scroll {
        overflow: visible;
    }

    .plan-table {
        min-width: 0;
        font-size: 11px;
    }

    .plan-cell,
    .route-cell {
        cursor: default;
    }

    .plan-table,
    .plan-table th,
    .plan-table td,
    .legend-swatch,
    .tour-legende .legend-item {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .plan-cell:hover,
    .route-cell:hover {
        outline: none;
    }

    .auch {
        display: none;
    }

    .sum-col.abweichung {
        background: transparent !important;
        color: inherit;
    }

    tr {
        break-inside: avoid;
    }
}
