/* ==========================================================================
   Zeiterfassung – Corporate Design
   Farben & Schriften kommen als CSS-Variablen aus App:Branding (App.razor).
   ========================================================================== */

html, body {
    font-family: var(--brand-body-font);
    background: var(--brand-bg);
    color: #2b3540;
}

h1, h2, h3, .page-title, .mud-typography-h4, .mud-typography-h5, .mud-typography-h6 {
    font-family: var(--brand-heading-font) !important;
    font-weight: 600 !important;
    letter-spacing: .01em;
}

.text-small { font-size: .8rem; }
.num { text-align: right !important; font-variant-numeric: tabular-nums; }
.cursor-pointer { cursor: pointer; }
.inactive { opacity: .5; }

/* ---------- Kopfzeile & Navigation ---------- */
.brand-appbar {
    border-bottom: 3px solid var(--brand-primary);
}
.brand-home {
    display: flex;
    align-items: center;
    gap: 14px;
    color: #fff;
    text-decoration: none;
    margin-left: 8px;
}
.brand-logo { height: 30px; width: auto; display: block; }
.brand-appname {
    font-family: var(--brand-heading-font);
    font-weight: 500;
    font-size: 1.05rem;
    padding-left: 14px;
    border-left: 1px solid rgba(255, 255, 255, .3);
    opacity: .9;
}
.user-chip { color: #fff !important; }
.brand-drawer { border-right: 1px solid #e3e7eb; }
.nav-section { color: #8a96a3; letter-spacing: .12em; }
.mud-nav-link.active { font-weight: 600; }

.brand-main { background: var(--brand-bg); min-height: 100vh; }

/* ---------- Seitenkopf ---------- */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 24px;
}
.page-title { color: var(--brand-dark); }
.page-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* Mitlaufende Spalte nur, wenn sie ganz ins Fenster passt (data-fit setzt zeitStickyCols) – keine eigene Scrollfläche */
.sticky-col[data-fit] { position: sticky; top: 88px; }
@media (max-width: 959px) { .sticky-col[data-fit] { position: static; } }
.brand-number { font-family: var(--brand-heading-font) !important; color: var(--brand-dark); }
.summary-tile { border-top: 3px solid var(--brand-primary); }

/* ---------- Erfassung ---------- */
.entry-card { border-top: 3px solid var(--brand-primary); }
.quick-hours { display: flex; flex-wrap: wrap; gap: 2px; margin-top: 4px; }

.day-card { overflow: hidden; background: #fff; }
.day-today { border-color: var(--brand-primary) !important; box-shadow: 0 0 0 1px var(--brand-primary); }
.day-holiday { background: color-mix(in srgb, var(--brand-secondary) 5%, #fff); }
.day-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px 8px 16px;
    background: #f8fafb;
    border-bottom: 1px solid #edf0f2;
}
.day-name { font-family: var(--brand-heading-font); font-weight: 600; color: var(--brand-dark); }
.day-date { color: #7a8794; margin-left: 6px; }
.day-total { font-weight: 600; font-variant-numeric: tabular-nums; margin-right: 4px; }

.entry-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px 8px 16px;
    border-bottom: 1px solid #f1f3f5;
}
.entry-row:last-child { border-bottom: 0; }
.entry-row:hover { background: #fafbfc; }
.entry-active { background: color-mix(in srgb, var(--brand-primary) 8%, white) !important; }
.entry-hours {
    min-width: 56px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--brand-dark);
}
.entry-main { flex: 1; min-width: 0; }
.entry-project { font-weight: 600; }
.entry-desc { color: #6b7783; font-size: .875rem; white-space: pre-line; }
.entry-reject { color: #c62828; font-size: .8rem; }
.entry-actions { display: flex; white-space: nowrap; }

/* ---------- Genehmigungen ---------- */
.approval-group { overflow: hidden; }
.approval-head {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px 10px 4px;
    border-bottom: 1px solid #edf0f2;
    border-left: 4px solid var(--brand-primary);
}
.row-selected { background: color-mix(in srgb, var(--brand-primary) 7%, white); }
.action-bar {
    position: sticky;
    bottom: 16px;
    z-index: 10;
    margin-top: 16px;
}
.reject-reason { min-width: 240px; flex: 1; }

/* ---------- Anmeldung (statisch, ohne MudBlazor) ---------- */
.account-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background:
        radial-gradient(ellipse at top right, color-mix(in srgb, var(--brand-primary) 35%, transparent), transparent 60%),
        var(--brand-dark);
}
.login-wrap { width: 100%; max-width: 400px; }
.login-brand { text-align: center; margin-bottom: 24px; }
.login-logo { height: 48px; width: auto; }
.login-claim {
    color: rgba(255, 255, 255, .75);
    font-family: var(--brand-heading-font);
    letter-spacing: .08em;
    text-transform: uppercase;
    font-size: .75rem;
    margin-top: 10px;
}
.login-card {
    background: #fff;
    border-radius: 6px;
    padding: 32px;
    border-top: 4px solid var(--brand-primary);
    box-shadow: 0 20px 50px rgba(0, 0, 0, .35);
}
.login-card h1 { margin: 0 0 4px; font-size: 1.5rem; color: var(--brand-dark); }
.login-sub { color: #6b7783; margin: 0 0 24px; }
.login-card label { display: block; font-size: .85rem; font-weight: 600; margin: 14px 0 6px; }
.login-card input[type=email], .login-card input[type=password] {
    width: 100%;
    box-sizing: border-box;
    padding: 11px 12px;
    border: 1px solid #cfd6dd;
    border-radius: 4px;
    font: inherit;
}
.login-card input:focus { outline: 2px solid var(--brand-primary); border-color: transparent; }
.login-card .login-remember { display: flex; align-items: center; gap: 8px; font-weight: 400; margin: 16px 0 20px; }
.btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 12px 16px;
    border-radius: 4px;
    font: 600 .95rem var(--brand-body-font);
    text-decoration: none;
    cursor: pointer;
    border: 1px solid transparent;
    box-sizing: border-box;
}
.btn-primary { background: var(--brand-primary); color: #fff; }
.btn-primary:hover { filter: brightness(.93); }
.btn-microsoft { background: #fff; color: #2f2f2f; border-color: #8c8c8c; }
.btn-microsoft:hover { background: #f3f3f3; }
.login-divider { display: flex; align-items: center; gap: 12px; color: #8a96a3; font-size: .8rem; margin: 22px 0 6px; }
.login-divider::before, .login-divider::after { content: ""; flex: 1; border-top: 1px solid #e3e7eb; }
.login-error {
    background: #fdecea;
    color: #b71c1c;
    border-radius: 4px;
    padding: 10px 12px;
    margin-bottom: 18px;
    font-size: .9rem;
}
.login-footer { text-align: center; color: rgba(255, 255, 255, .5); font-size: .8rem; margin-top: 20px; }

/* ---------- Fehler-UI ---------- */
#blazor-error-ui {
    background: #fff3cd;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, .2);
    display: none;
    left: 0;
    padding: .6rem 1.25rem .7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 2000;
}
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: .75rem; top: .5rem; }

/* ---------- Druck (Report als PDF) ---------- */
.print-only { display: none; }
@media print {
    .no-print, .mud-appbar, .mud-drawer, .mud-table-pagination, #blazor-error-ui { display: none !important; }
    .print-only { display: block; }
    .mud-main-content { padding: 0 !important; margin: 0 !important; }
    body, .brand-main { background: #fff !important; }
    .mud-paper { box-shadow: none !important; }
    @page { margin: 12mm 10mm; }
}

/* Berichtskopf (Druck) */
.print-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 6px; }
.print-head h2 { margin: 0 0 2px; font-size: 15pt; }
.print-logo { max-height: 42px; max-width: 200px; width: auto; }
/* Invertiert: hell ↔ dunkel tauschen, Farbtöne bleiben erhalten (weißes Logo wird schwarz) */
.print-logo-inverted { filter: invert(1) hue-rotate(180deg); }
.print-id { font-size: 8pt; color: #5a6773; margin: 2px 0 10px; border-top: 1px solid #d5dbe1; padding-top: 3px; }
.print-id-missing { color: #b3261e; font-weight: 600; }

.report-logo-preview { display: inline-flex; background: #fff; border: 1px solid #d5dbe1; border-radius: 6px; padding: 12px 16px; }

/* Kompakte Drucktabelle (Report) */
.print-table { width: 100%; border-collapse: collapse; font-size: 8.5pt; line-height: 1.25; }
.print-table th, .print-table td { border-bottom: 1px solid #d5dbe1; padding: 2px 5px; text-align: left; vertical-align: top; }
.print-table thead th { background: #e8ecf0 !important; font-weight: 600; border-bottom: 1.5px solid #8a96a3;
    -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.print-table thead { display: table-header-group; }   /* Kopfzeile auf jeder Seite wiederholen */
.print-table tr { break-inside: avoid; page-break-inside: avoid; }
.print-table tfoot td { font-weight: 600; border-top: 1.5px solid #8a96a3; border-bottom: none; }
.print-table .num { text-align: right; white-space: nowrap; }
.print-table .nowrap { white-space: nowrap; }
.print-table .print-muted td { color: #6b7782; }
.print-table .print-note { font-size: 7.5pt; color: #b3261e; }

/* ---------- Setup-Assistent ---------- */
.setup-shell { min-height: 100vh; background: var(--brand-bg); }
.setup-top {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 24px;
    background: var(--brand-dark);
    color: #fff;
    border-bottom: 3px solid var(--brand-primary);
}
.setup-main { max-width: 1100px; margin: 0 auto; padding: 32px 16px; }
.setup-grid { display: grid; grid-template-columns: 230px 1fr; gap: 24px; align-items: start; }
.setup-card { border-top: 3px solid var(--brand-primary); min-width: 0; }
.setup-steps { position: sticky; top: 24px; }
.setup-step {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 4px;
    color: #8a96a3;
    font-size: .92rem;
}
.setup-step-num {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: .8rem;
    font-weight: 700;
    border: 2px solid #cfd6dd;
    background: #fff;
}
.setup-step.active { color: var(--brand-dark); font-weight: 600; }
.setup-step.active .setup-step-num { border-color: var(--brand-primary); color: var(--brand-primary); }
.setup-step.done { color: #4b5763; }
.setup-step.done .setup-step-num { background: var(--brand-primary); border-color: var(--brand-primary); color: #fff; }
@media (max-width: 800px) {
    .setup-grid { grid-template-columns: 1fr; }
    .setup-steps { position: static; display: none; }
}

.copy-row { display: flex; align-items: center; gap: 8px; }
.copy-row > :first-child { flex: 1; min-width: 0; }
.code-box {
    margin: 0;
    padding: 10px 12px;
    background: #1e262f;
    color: #e6edf3;
    border-radius: 4px;
    font-size: .8rem;
    white-space: pre-wrap;
    word-break: break-all;
}

.color-field { display: flex; align-items: center; gap: 8px; }
.color-swatch { width: 40px; height: 40px; padding: 0; border: 1px solid #cfd6dd; border-radius: 4px; background: none; cursor: pointer; flex-shrink: 0; }

.brand-preview {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 18px;
    border-radius: 4px;
    border-bottom: 3px solid;
    color: #fff;
}
.brand-preview-btn { margin-left: auto; padding: 6px 14px; border-radius: 4px; font-size: .85rem; font-weight: 600; }

/* Datei-Upload im Stil eines MudBlazor-Outlined-Buttons */
.file-button {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    border: 1px solid var(--brand-primary);
    border-radius: 4px;
    color: var(--brand-primary);
    font: 500 .875rem var(--brand-body-font);
    text-transform: uppercase;
    letter-spacing: .02857em;
    cursor: pointer;
    user-select: none;
}
.file-button:hover { background: color-mix(in srgb, var(--brand-primary) 8%, transparent); }
.file-button.disabled { opacity: .6; pointer-events: none; }
.file-button input[type=file] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    width: 100%;
}

/* ---------- Tageskalender ---------- */
.cal { background: #fff; border: 1px solid #e3e7eb; border-radius: 6px; overflow: hidden; }
.cal-toolbar {
    display: flex; align-items: center; gap: 4px; flex-wrap: wrap;
    padding: 6px 12px; background: #f8fafb; border-bottom: 1px solid #edf0f2;
}
.cal-date {
    display: flex; align-items: center; justify-content: center; gap: 6px; font-weight: 600; color: var(--brand-dark);
    width: 13.5em; flex-shrink: 0; white-space: nowrap; font-variant-numeric: tabular-nums;
}
@media (max-width: 420px) { .cal-date { width: 7.5em; flex-direction: column; gap: 0; line-height: 1.15; } }
.cal-weekday { font-family: var(--brand-heading-font); }
.cal-total { font-weight: 700; font-variant-numeric: tabular-nums; color: var(--brand-dark); }

.cal-body { display: grid; grid-template-columns: minmax(0, 1fr) 260px; }
@media (max-width: 960px) { .cal-body { grid-template-columns: 1fr; } }

.cal-grid {
    --slot-h: 24px;
    position: relative;
    user-select: none;
    border-right: 1px solid #edf0f2;
    padding-left: 56px;
}
.cal-slot {
    height: var(--slot-h);
    border-top: 1px solid #f1f3f5;
    position: relative;
    cursor: crosshair;
}
.cal-slot.hour { border-top-color: #e3e7eb; }
.cal-slot:hover { background: color-mix(in srgb, var(--brand-primary) 6%, transparent); }
.cal-slot.selecting { background: color-mix(in srgb, var(--brand-primary) 22%, transparent); }
.cal-time {
    position: absolute; left: -52px; top: -8px; width: 44px; text-align: right;
    font-size: .72rem; color: #8a96a3; font-variant-numeric: tabular-nums;
}

.cal-block {
    position: absolute; /* left/width je nach Überlappung inline */
    margin-top: 1px;
    border-radius: 4px;
    background: color-mix(in srgb, var(--block-color) 16%, #fff);
    border: 1px solid color-mix(in srgb, var(--block-color) 55%, #fff);
    border-left: 4px solid var(--block-color);
    padding: 2px 8px;
    overflow: hidden;
    cursor: pointer;
    font-size: .8rem;
    display: flex; flex-direction: column; gap: 2px;
    transition: box-shadow .1s;
}
.cal-block.draft { border-style: dashed; border-left-style: solid; background: #fafbfc; }
.cal-block.selected { box-shadow: 0 0 0 2px var(--brand-primary); }
.cal-block.drop-target { box-shadow: 0 0 0 2px var(--brand-secondary); background: color-mix(in srgb, var(--brand-secondary) 12%, #fff); }
.cal-block.locked { cursor: default; opacity: .85; }
.cal-block.rejected { border-color: #c62828; }
.cal-block.saving { opacity: .6; }
.cal-block-head { display: flex; align-items: center; gap: 6px; min-height: 18px; }
.cal-block-time { font-variant-numeric: tabular-nums; color: #4b5763; white-space: nowrap; }
.cal-block-desc { color: #6b7783; font-size: .75rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-x {
    margin-left: auto; border: 0; background: none; cursor: pointer;
    font-size: 1rem; line-height: 1; color: #8a96a3; padding: 0 2px;
}
.cal-x:hover { color: #c62828; }
.cal-tag {
    align-self: flex-start;
    color: #fff; border-radius: 10px; padding: 1px 10px;
    font-weight: 600; font-size: .75rem;
    max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    cursor: grab;
}
.cal-tag[draggable=false] { cursor: default; }
.cal-tag.empty { background: #e8ecf0; color: #6b7783; font-weight: 400; cursor: default; }

.cal-side { padding: 12px; background: #fcfdfd; }
.cal-palette {
    display: flex; flex-direction: column; gap: 4px;
    border-radius: 6px; padding: 2px;
    transition: background .1s;
}
.cal-palette.drop-hint { background: #fdecea; outline: 2px dashed #e57373; }
.cal-drop-remove { font-size: .75rem; color: #c62828; text-align: center; padding: 6px; }
.cal-project {
    display: flex; align-items: center; gap: 8px;
    padding: 6px 10px;
    border: 1px solid #e3e7eb; border-left: 4px solid; border-radius: 4px;
    background: #fff; cursor: grab; font-size: .85rem;
    user-select: none;
}
.cal-project:hover { background: #f5f7f9; }
.cal-project.active { background: color-mix(in srgb, var(--brand-primary) 10%, #fff); border-color: var(--brand-primary); font-weight: 600; }
.cal-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.cal-untimed { display: flex; align-items: center; gap: 8px; font-size: .85rem; padding: 4px 0; border-bottom: 1px solid #f1f3f5; }
.entry-time { font-weight: 400; color: #6b7783; font-size: .8rem; margin-left: 6px; font-variant-numeric: tabular-nums; }

/* Kalender: Aufteilung & Überlappung */
.cal-grid.is-selecting .cal-block { pointer-events: none; opacity: .75; }
.cal-grid::after {
    /* freier Streifen rechts: hier lassen sich jederzeit neue (auch überlappende) Zeiträume markieren */
    content: ""; position: absolute; top: 0; bottom: 0; right: 0; width: 34px;
    background: repeating-linear-gradient(135deg, transparent 0 6px, rgba(0,0,0,.025) 6px 12px);
    pointer-events: none;
}
.cal-tags { display: flex; flex-wrap: wrap; gap: 3px; }
.cal-tag.rejected { outline: 2px solid #c62828; outline-offset: 1px; }

/* Kalender: Kontextmenü */
.cal-grid:focus { outline: none; }
.cal-block { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
.cal-ctx-backdrop { position: fixed; inset: 0; z-index: 1400; }
.cal-ctx {
    position: fixed; z-index: 1401; min-width: 200px;
    background: #fff; border-radius: 6px; padding: 4px;
    box-shadow: 0 6px 24px rgba(0, 0, 0, .18), 0 1px 3px rgba(0, 0, 0, .12);
}
.cal-ctx-item {
    display: flex; align-items: center; gap: 10px; width: 100%;
    padding: 8px 12px; border: 0; background: none; border-radius: 4px;
    font: inherit; font-size: .9rem; text-align: left; cursor: pointer; color: #2b3540;
}
.cal-ctx-item:hover:not(:disabled) { background: #f1f4f7; }
.cal-ctx-item.danger { color: #c62828; }
.cal-ctx-item:disabled { opacity: .5; cursor: default; }
.cal-ctx-note { font-size: .75rem; color: #8a96a3; padding: 4px 12px 6px; }
/* Einträge einheitlich linksbündig (Buttons zentrieren Inhalt sonst je nach Browser/Theme) */
.cal-ctx-item { justify-content: flex-start; }
.cal-ctx-label { flex: 1 1 auto; text-align: left; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-ctx-sub .cal-ctx-item .cal-dot { flex: none; }

/* ---------- Arbeitszeitregeln: Hinweise/Warnungen/Verstöße ---------- */
.issue-list { display: flex; flex-direction: column; gap: 6px; }
.issue {
    display: flex; align-items: flex-start; gap: 8px; padding: 6px 10px; border-radius: 6px;
    font-size: .82rem; line-height: 1.35; border-left: 3px solid;
}
.issue .mud-icon-root { font-size: 1.05rem; margin-top: 1px; flex-shrink: 0; }
.issue-verstoss { background: #fdecea; border-left-color: #c62828; color: #7f1d1d; }
.issue-verstoss .mud-icon-root { color: #c62828; }
.issue-warnung { background: #fff4e5; border-left-color: #ef8a00; color: #6b3d00; }
.issue-warnung .mud-icon-root { color: #ef8a00; }
.issue-hinweis { background: #eef6fb; border-left-color: var(--brand-primary); color: #23465a; }
.issue-hinweis .mud-icon-root { color: var(--brand-primary); }
.issue-label { font-weight: 700; margin-right: 4px; }
.issue-law { display: block; font-size: .72rem; opacity: .75; margin-top: 2px; }

/* Wochen-/Monatskarte */
.summary-grid { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; font-size: .88rem; margin-top: 6px; }
.summary-grid strong { font-variant-numeric: tabular-nums; text-align: right; }
.summary-grid .pos { color: #2e7d32; }
.summary-grid .neg { color: #c62828; }
.entry-row.entry-pause { opacity: .7; }

/* Tageskalender: Warnungen, Pausen, Verschieben */
.cal-issues { padding: 8px 12px; border-bottom: 1px solid #eef1f4; }
.cal-block.pause {
    background: repeating-linear-gradient(135deg, #f6f7f8, #f6f7f8 6px, #eceff2 6px, #eceff2 12px);
    border-left-color: #9aa5b1;
}
.cal-block[data-move] { cursor: grab; touch-action: pan-y; }
.cal-block.move-armed { box-shadow: 0 0 0 2px var(--brand-secondary); }
.cal-block.moving {
    cursor: grabbing; z-index: 30; opacity: .92; transition: none;
    box-shadow: 0 6px 18px rgba(0, 0, 0, .18), 0 0 0 2px var(--brand-primary);
}
.cal-block.moving::after {
    content: attr(data-move-label);
    position: absolute; right: 6px; top: 4px; padding: 1px 6px; border-radius: 4px;
    background: var(--brand-dark, #1d2b36); color: #fff; font-size: .72rem; font-weight: 600;
}
.cal-palette-sep {
    font-size: .7rem; text-transform: uppercase; letter-spacing: .04em; color: #8a96a3;
    margin: 8px 2px 2px;
}

/* Tageskalender: Anfasser zum Ändern von Beginn/Ende */
.cal-resize {
    position: absolute; left: 0; right: 0; height: 8px; z-index: 2;
    cursor: ns-resize; touch-action: none;
}
.cal-resize.top { top: -2px; }
.cal-resize.bottom { bottom: -2px; }
.cal-resize::after {
    content: ""; position: absolute; left: 50%; width: 28px; height: 4px; margin-left: -14px; border-radius: 2px;
    background: var(--block-color, #9aa5b1); opacity: 0; transition: opacity .12s;
}
.cal-resize.top::after { top: 2px; }
.cal-resize.bottom::after { bottom: 2px; }
.cal-block:hover .cal-resize::after, .cal-block.selected .cal-resize::after, .cal-block.resizing .cal-resize::after { opacity: .9; }
@media (pointer: coarse) {
    .cal-resize { height: 14px; }
    .cal-block.selected .cal-resize::after { opacity: 1; }
}
.cal-block.resizing {
    z-index: 30; transition: none;
    box-shadow: 0 6px 18px rgba(0, 0, 0, .18), 0 0 0 2px var(--brand-primary);
}
.cal-block.resizing::after {
    content: attr(data-move-label);
    position: absolute; right: 6px; top: 4px; padding: 1px 6px; border-radius: 4px;
    background: var(--brand-dark, #1d2b36); color: #fff; font-size: .72rem; font-weight: 600;
}

/* Kontextmenü: Teilen & Tätigkeit zuweisen */
.cal-ctx { max-height: calc(100vh - 16px); overflow-y: auto; min-width: 220px; }
.cal-ctx-row { display: flex; align-items: center; gap: 6px; padding: 6px 12px; font-size: .875rem; }
.cal-ctx-chip {
    min-width: 30px; height: 26px; border-radius: 6px; border: 1px solid #d5dbe1; background: #fff;
    font-weight: 600; cursor: pointer; font-family: inherit;
}
.cal-ctx-chip:hover:not(:disabled) { border-color: var(--brand-primary); color: var(--brand-primary); }
.cal-ctx-chip:disabled { opacity: .4; cursor: default; }
.cal-ctx-caret { color: #8a96a3; font-size: .8rem; }
.cal-ctx-sub { max-height: 280px; overflow-y: auto; padding-bottom: 4px; background: #fafbfc; }
.cal-ctx-sub .cal-ctx-item { padding-left: 22px; }
.cal-ctx-group {
    font-size: .68rem; text-transform: uppercase; letter-spacing: .04em; color: #8a96a3; padding: 8px 12px 2px;
}
.cal-ctx-sep { height: 1px; background: #eef1f4; margin: 4px 0; }

/* Wochen-Navigation "Meine Zeiten" */
.week-nav { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.week-nav-label { text-transform: uppercase; letter-spacing: .06em; color: #8a96a3; }
.week-nav .mud-button-root { white-space: nowrap; }
.week-nav .week-nav-current { min-width: 176px; text-transform: none; padding-top: 3px; padding-bottom: 3px; }
.week-nav-stack { display: flex; flex-direction: column; align-items: center; line-height: 1.15; }
.week-nav-kw { font-weight: 600; letter-spacing: .01em; }
.week-nav-hint { font-size: .7rem; opacity: .85; font-weight: 400; }

/* Schnelloptionen: Vorschau "Tag übernehmen" */
.copy-preview { max-height: 180px; overflow-y: auto; border: 1px solid #eef1f4; border-radius: 6px; }
.copy-preview-row { display: flex; gap: 8px; align-items: center; padding: 4px 8px; font-size: .82rem; border-bottom: 1px solid #f3f5f7; }
.copy-preview-row:last-child { border-bottom: none; }

/* Rufbereitschaft: dezent schraffiert, Einsätze (Arbeit) liegen daneben */
.cal-block.standby {
    background: repeating-linear-gradient(135deg, #eef6fb, #eef6fb 6px, #e1eef7 6px, #e1eef7 12px);
    border-style: dashed; border-left-style: solid;
}

/* Lohnvorschau */
.payslip-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.payslip-table th { text-align: left; font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: #8a96a3; padding: 14px 6px 4px; font-weight: 600; }
.payslip-table thead:first-child th { padding-top: 0; }
.payslip-table td { padding: 4px 6px; border-bottom: 1px solid #f1f3f5; vertical-align: top; }
.payslip-table td.num, .payslip-table th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.payslip-table td:nth-child(2) { font-size: .78rem; }
.payslip-table tr.sum td { font-weight: 700; border-top: 1px solid #d5dbe1; }
.payslip-table tr.total td { font-weight: 700; font-size: 1.05rem; color: var(--brand-dark); background: color-mix(in srgb, var(--brand-primary) 7%, #fff); }
.settings-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px 14px; }

/* Buchen für andere */
.onbehalf-bar { border-left: 4px solid #ef8a00; }

/* Gruppen: Mitgliederliste */
.group-members { max-height: 340px; overflow-y: auto; border: 1px solid var(--mud-palette-lines-default); border-radius: 6px; padding: 2px 6px; }
.group-members .mud-input-control { margin: 0; }

/* ---------- Report-Druck: Abschnitte und Fußzeile ---------- */
.print-section-title { font-size: 11pt; margin: 6px 0 4px; }
.print-table .print-subtotal td { font-weight: 600; border-top: 1px solid #8a96a3; background: #f3f5f7 !important;
    -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.print-table .print-total td { font-weight: 700; border-top: 1.5px solid #333; border-bottom: none; }
.print-table tfoot.print-footer-space td { height: 11mm; border: none !important; padding: 0 !important; }
@media print {
    /* Jede Woche bzw. jeder Monat beginnt auf einer neuen Seite */
    .print-section + .print-section { break-before: page; page-break-before: always; }
    /* Fußzeile mit Bericht-ID auf jeder Seite */
    .print-only.print-footer {
        display: flex; justify-content: space-between; gap: 12px;
        position: fixed; left: 8mm; right: 8mm; bottom: 2mm;
        font-size: 7.5pt; color: #5a6773; background: #fff;
        border-top: 1px solid #d5dbe1; padding: 3px 2mm 0;
    }
}

/* Feedback-Button in der Kopfzeile: auf schmalen Bildschirmen nur das Symbol */
@media (max-width: 600px) {
    .feedback-btn .mud-button-label { font-size: 0; }
    .feedback-btn .mud-button-icon-start { margin: 0; }
}

/* Feedback (Administration) */
.feedback-message, .feedback-text { white-space: pre-wrap; word-break: break-word; }
.feedback-message { background: #f6f8fa; border-left: 3px solid var(--mud-palette-primary); padding: 10px 14px; border-radius: 4px; }
.feedback-reply { border-left: 3px solid #c8d1da; padding: 4px 12px; }

/* ---------- Systemmeldungen (Banner in der Kopfzeile) ---------- */
.system-banner {
    display: flex; align-items: center; gap: 8px; max-width: min(640px, 46vw); min-width: 0;
    padding: 4px 14px; border-radius: 999px;
    background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .25);
    color: #fff; font-size: .9rem; overflow: hidden;
}
.system-banner-icon { flex: none; color: var(--mud-palette-secondary); }
.system-banner-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; animation: banner-in .45s ease-out; }
.system-banner-count { flex: none; font-size: .72rem; opacity: .7; }
@keyframes banner-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (max-width: 760px) { .system-banner { display: none; } }

/* ---------- Benachrichtigungen ---------- */
.msg-unread .msg-title { font-weight: 700; }
.msg-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--mud-palette-secondary); flex: none; }
.msg-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Verschiebbare Blöcke auf "Meine Zeiten" ---------- */
.widget-col { display: flex; flex-direction: column; gap: 16px; min-height: 40px; }
.widgets-editing .widget-col { border: 2px dashed transparent; border-radius: 8px; padding: 4px; min-height: 120px; }
.widgets-editing .widget-col.drop-col { border-color: var(--mud-palette-primary); }
.widget-handle {
    display: none; align-items: center; gap: 6px; padding: 4px 8px; margin-bottom: 4px;
    background: var(--mud-palette-primary); color: #fff; border-radius: 6px; cursor: grab; user-select: none;
}
.widget-handle .widget-title { flex: 1; font-weight: 600; font-size: .9rem; }
.widget-handle .mud-icon-button { color: #fff; }
.widgets-editing .widget-handle { display: flex; }
.widgets-editing .widget { cursor: grab; }
/* Im Anordnen-Modus: Inhalte als kompakte Vorschau, nicht bedienbar */
.widgets-editing .widget-body { pointer-events: none; max-height: 160px; overflow: hidden; opacity: .55;
    -webkit-mask-image: linear-gradient(to bottom, #000 60%, transparent); mask-image: linear-gradient(to bottom, #000 60%, transparent); }
.widgets-editing .widget-col.sticky-col { position: static; }
.widget.widget-dragging { opacity: .35; }
.widget.drop-before { box-shadow: 0 -4px 0 0 var(--mud-palette-primary); }
.widget.drop-after { box-shadow: 0 4px 0 0 var(--mud-palette-primary); }
.widget-empty { color: var(--mud-palette-text-secondary); text-align: center; padding: 32px 8px; font-size: .9rem; }

/* Blöcke auf „Meine Zeiten“ – Rahmen, einstellbar unter System › Organisation & Design */
.widgets { --wf-radius: 10px; --wf-line: rgba(15, 30, 45, .09); }
.widget-card { border-radius: var(--wf-radius) !important; background: var(--mud-palette-surface, #fff); }
.wf-subtle .widget-card { border: 1px solid var(--wf-line); box-shadow: 0 1px 2px rgba(15, 30, 45, .04); }
.wf-line .widget-card { border: 1px solid rgba(15, 30, 45, .2); box-shadow: none; }
.wf-shadow .widget-card { border: none; box-shadow: 0 1px 2px rgba(15, 30, 45, .06), 0 3px 10px rgba(15, 30, 45, .07); }
.wf-accent .widget-card { border: 1px solid var(--wf-line); border-top: 3px solid var(--brand-primary); box-shadow: 0 1px 2px rgba(15, 30, 45, .04); }
.wf-none .widget-card { border: none; box-shadow: none; }
/* Vorschau in den Admin-Einstellungen */
.wf-preview { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; padding: 16px;
    background: var(--mud-palette-background, #f5f7fa); border-radius: 8px; }
.wf-preview .widget-card { padding: 14px 16px; min-height: 84px; }
.wf-preview-line { height: 8px; border-radius: 4px; background: #e8ecf0; margin-top: 8px; }

/* Stempeln */
.clock-running { display: flex; align-items: center; gap: 14px; }
.clock-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--mud-palette-success, #2e7d32); flex: none;
    box-shadow: 0 0 0 0 rgba(46, 125, 50, .5); animation: clock-pulse 1.8s ease-out infinite; }
@keyframes clock-pulse { 0% { box-shadow: 0 0 0 0 rgba(46, 125, 50, .45); } 70% { box-shadow: 0 0 0 10px rgba(46, 125, 50, 0); } 100% { box-shadow: 0 0 0 0 rgba(46, 125, 50, 0); } }
@media (prefers-reduced-motion: reduce) { .clock-dot { animation: none; } }
.clock-elapsed { font-size: 2rem; font-weight: 600; line-height: 1.1; font-variant-numeric: tabular-nums; letter-spacing: .02em; color: var(--brand-dark); }
.cal-block.running { background-image: repeating-linear-gradient(135deg, transparent 0 8px, rgba(255, 255, 255, .18) 8px 16px); }
.cal-block.running .cal-block-time::before { content: "● "; color: #43a047; }

/* System › Betrieb */
.ops-grid { display: grid; grid-template-columns: auto 1fr; gap: 4px 16px; font-size: .875rem; }
.ops-grid > span { color: var(--mud-palette-text-secondary); }
.ops-grid > strong { font-weight: 500; min-width: 0; overflow-wrap: anywhere; }
.ops-path { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .8rem; overflow-wrap: anywhere; }
.ops-table td.num, .ops-table th.num { text-align: right; white-space: nowrap; }
.ops-log { max-height: 360px; overflow: auto; background: #1f2933; color: #e4e7eb; padding: 10px 12px; border-radius: 6px;
    font-size: .75rem; line-height: 1.45; white-space: pre-wrap; word-break: break-all; margin: 0; }
