/* ── Fehlzeiten-Modul ────────────────────────────────────────────────────── */

.fz-wrap {
    display: flex;
    flex-direction: column;
    height: 100%;
    gap: 12px;
    padding: 16px;
    box-sizing: border-box;
}

/* Toolbar */
.fz-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}
.fz-toolbar-left,
.fz-toolbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.fz-nav-btn {
    padding: 6px 10px !important;
    min-width: 32px;
}
.fz-period-label {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
    min-width: 140px;
    text-align: center;
}
.fz-view-toggle {
    display: flex;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}
.fz-view-toggle .btn {
    border-radius: 0 !important;
    border: none !important;
    margin: 0;
    padding: 5px 14px;
    font-size: .83rem;
}

/* Legende */
.fz-legend {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    font-size: .78rem;
}
.fz-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 20px;
    font-weight: 500;
    white-space: nowrap;
}

/* Grid-Wrapper mit horizontalem Scroll */
.fz-grid-wrap {
    flex: 1;
    overflow: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: white;
}

/* Tabelle */
.fz-grid {
    border-collapse: collapse;
    min-width: 100%;
    font-size: .8rem;
}

/* Header */
.fz-grid thead tr {
    background: #f8fafc;
    position: sticky;
    top: 0;
    z-index: 2;
}
.fz-th-res {
    min-width: 150px;
    max-width: 200px;
    padding: 6px 10px;
    text-align: left;
    border-right: 2px solid var(--border);
    border-bottom: 1px solid var(--border);
    font-weight: 600;
    font-size: .78rem;
    color: var(--text-muted);
    position: sticky;
    left: 0;
    background: #f8fafc;
    z-index: 3;
}
.fz-th-day {
    min-width: 28px;
    max-width: 36px;
    padding: 4px 3px;
    text-align: center;
    border-right: 1px solid #f1f5f9;
    border-bottom: 1px solid var(--border);
    vertical-align: bottom;
    font-weight: 500;
}
.fz-th-day.fz-weekend {
    background: #f9fafb;
}
.fz-th-day-num {
    font-size: .8rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1;
}
.fz-th-day-name {
    font-size: .65rem;
    color: var(--text-muted);
    line-height: 1.4;
}

/* Mitarbeiter-Spalte (sticky) */
.fz-td-res {
    position: sticky;
    left: 0;
    background: white;
    z-index: 1;
    padding: 4px 10px;
    border-right: 2px solid var(--border);
    border-bottom: 1px solid #f1f5f9;
    min-width: 150px;
    max-width: 200px;
    white-space: nowrap;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
}
.fz-res-name {
    font-size: .83rem;
    font-weight: 600;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
}
.fz-res-total {
    font-size: .72rem;
    color: #2563eb;
    font-weight: 700;
    background: #dbeafe;
    padding: 1px 6px;
    border-radius: 10px;
    flex-shrink: 0;
}

/* Tages-Zellen */
.fz-cell {
    width: 30px;
    min-width: 26px;
    height: 28px;
    border-right: 1px solid #f1f5f9;
    border-bottom: 1px solid #f1f5f9;
    text-align: center;
    vertical-align: middle;
    cursor: pointer;
    transition: filter .1s;
    position: relative;
}
.fz-cell:hover {
    filter: brightness(.93);
}
.fz-cell.fz-weekend {
    background: #f9fafb;
}
.fz-cell.fz-has-entry {
    cursor: pointer;
}
.fz-cell-label {
    font-size: .72rem;
    font-weight: 800;
    line-height: 28px;
    display: block;
}

/* ── Dialog ─────────────────────────────────────────────────────────────── */
.fz-dialog-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15,23,42,.45);
    z-index: 9000;
    display: flex;
    align-items: center;
    justify-content: center;
}
.fz-dialog-overlay.hidden {
    display: none;
}
.fz-dialog {
    background: white;
    border-radius: 10px;
    box-shadow: 0 20px 60px rgba(0,0,0,.18);
    width: min(500px, 96vw);
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}
.fz-dialog-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px 14px;
    border-bottom: 1px solid var(--border);
}
.fz-dialog-header h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
}
.fz-dialog-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}
.fz-dialog-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    padding: 14px 20px;
    border-top: 1px solid var(--border);
}

/* Typ-Buttons */
.fz-typ-btns {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 4px;
}
.fz-typ-btn {
    padding: 5px 12px;
    border-radius: 20px;
    border: 1px solid var(--fz-btn-color, #2563eb);
    background: white;
    color: var(--fz-btn-color, #2563eb);
    font-size: .82rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .12s, color .12s;
}
.fz-typ-btn:hover,
.fz-typ-btn.active {
    background: var(--fz-btn-bg, #dbeafe);
}
.fz-typ-btn.active {
    border-width: 2px;
}
