﻿/* Seiteninhalt bekommt links/rechts immer 16px Abstand zum Viewport-Rand (entspricht MudBlazors
   eigenem ".pa-4"). Seiten mit "DenseBody" (kompaktes Layout, kein automatisches ".pa-4" mehr auf
   .ps-page-content, siehe Page.razor in PS.Core) hatten dadurch bisher gar keinen horizontalen
   Abstand - Inhalt "klebte" am Rand. ".page-background" wird app-weit auf praktisch jeder Seite
   gesetzt (dense wie non-dense), daher hier zentral statt pro Seite. Gleicher Wert wie ".pa-4"
   (16px), damit auf non-dense Seiten (die ".pa-4" bereits haben) keine doppelte Polsterung entsteht. */
.page-background {
    background: var(--fc-workspace-background);
    padding-left: 16px;
    padding-right: 16px;
}

/* Seiten-Titelleiste/Fußzeile (Page.razor aus PS.Core, Klassen "sticky-header"/"sticky-footer" +
   "ps-surface") sollen weiß bleiben, auch wenn der Seiteninhalt jetzt grau ist (siehe
   .page-background oben). ".sticky-header"/".sticky-footer" setzen in PS.Core aber ebenfalls eine
   Hintergrundfarbe (--mud-palette-background, also grau) auf derselben Spezifitätsebene wie
   ".ps-surface" (weiß) - je nach Ladereihenfolge der Stylesheets gewinnt dort nicht zuverlässig
   Weiß. Bewusst hier als spezifischerer Override in SchadenPortal.App statt in PS.Core (geteilte
   Infrastruktur, würde alle Apps betreffen). */
.ps-page-header.ps-surface,
.ps-page-footer.ps-surface {
    background-color: var(--mud-palette-surface);
}

/* Titel und Aktionsleiste (Schließen/Speichern) der ViewBuilder-Dialoge (DialogRenderer aus
   PS.Core) bleiben immer sichtbar — nur der mittlere Inhaltsbereich scrollt. Bewusst hier in
   SchadenPortal.App statt in PS.Core (Rückmeldung: PS.Core ist geteilte Infrastruktur, eine
   Änderung dort würde alle Dialoge in allen Apps betreffen). Ohne das hier wächst der ganze
   Dialog über den Viewport hinaus, und man muss erst bis ganz nach unten scrollen, um an die
   Buttons zu kommen. */
.dialog-container.mud-dialog {
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

/* MudBlazor rendert zwischen .mud-dialog und .mud-dialog-content/.mud-dialog-actions noch ein
   form-Element mit Klasse mud-form (für die Validierung) — die beiden Wrapper-Divs dazwischen
   (mud-focus-trap/-child-container) haben display:contents und sind daher für Flex
   "unsichtbar", d.h. .mud-dialog-content ist effektiv ein direktes Flex-Child von .mud-form.
   Damit die Schrumpf-Kette bis zu .mud-dialog-content durchgereicht wird, muss auch dieses
   Formular selbst am Flex-Layout teilnehmen (sonst wächst es unbegrenzt auf seine
   Inhaltsgröße, und .mud-dialog scrollt am Ende als Ganzes statt nur der Inhalt). */
.dialog-container .mud-form {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
}

.dialog-container .mud-dialog-content {
    overflow-y: auto;
    flex: 1 1 auto;
    /* Ohne min-height:0 weigert sich ein Flex-Child per Default (min-height:auto), kleiner als
       sein eigener Inhalt zu werden. */
    min-height: 0;
}

.dialog-container .mud-dialog-actions {
    flex: 0 0 auto;
}

/* Auf iPad/Handy (Safari) sind Scrollbalken unsichtbar/Overlay, man sieht dem
   Dialog-Inhalt also nicht an, dass darunter noch etwas kommt (z.B. "Ergebnis der
   Kontaktaufnahme" beim Termin-Vereinbaren-Dialog). CSS-only Scroll-Schatten: zwei
   Gradienten hängen an der Scroll-Position (attachment:local) und heben sich mit den
   ortsfesten Schatten (attachment:scroll) gegenseitig auf, sobald man ganz oben/unten
   ist — dadurch ist der Schatten nur sichtbar, wenn in die jeweilige Richtung noch
   gescrollt werden kann. Bewusst kräftig (nicht nur ein dezenter Hauch), damit er auch
   auf einen kurzen Blick auffällt. */
.dialog-container .mud-dialog-content {
    position: relative;
    background:
        linear-gradient(var(--mud-palette-surface), var(--mud-palette-surface)) center top,
        linear-gradient(var(--mud-palette-surface), var(--mud-palette-surface)) center bottom,
        linear-gradient(to bottom, rgba(0, 0, 0, 0.35), rgba(0, 0, 0, 0)) center top,
        linear-gradient(to top, rgba(0, 0, 0, 0.35), rgba(0, 0, 0, 0)) center bottom;
    background-repeat: no-repeat;
    background-size: 100% 36px, 100% 36px, 100% 16px, 100% 16px;
    background-attachment: local, local, scroll, scroll;
}

/* Zusätzlich zum Schatten (der auf alle .dialog-container-Dialoge wirkt) ein expliziter
   Hinweistext + Pfeil NUR beim Termin-Vereinbaren-Dialog (Kontaktaufnahme) — bewusst nicht
   auf .dialog-container allgemein, da das viele kurze ViewBuilder-Dialoge treffen würde, die
   gar nicht scrollen. Sticky am unteren Rand des Inhaltsbereichs: bleibt sichtbar, solange
   noch etwas darunter folgt, und rückt erst an seine natürliche Stelle (= ganz am Ende), wenn
   man tatsächlich das Ende erreicht hat. Der Schatten allein wurde als zu unauffällig
   empfunden ("man erkennt nicht, dass man scrollen kann") — dieser Text macht es
   unmissverständlich. */
.kontaktaufnahme-dialog .mud-dialog-content::after {
    content: "▾ weiter scrollen";
    position: sticky;
    bottom: 0;
    display: block;
    margin-top: 8px;
    padding: 3px 0;
    text-align: center;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: var(--mud-palette-primary-text);
    background-color: var(--mud-palette-primary);
    border-radius: 8px;
    pointer-events: none;
}

/* JS (kontaktaufnahmeDialogScroll.js) setzt "scroll-at-end" auf .mud-dialog-content, sobald
   nicht mehr weiter nach unten gescrollt werden kann (inkl. dem Fall, dass der Inhalt von
   Anfang an ganz ohne Scrollen passt) — dann verschwindet der Hinweis komplett. Scrollt man
   wieder nach oben weg vom Ende, verschwindet die Klasse wieder und der Hinweis kommt zurück. */
.kontaktaufnahme-dialog .mud-dialog-content.scroll-at-end::after {
    display: none;
}

/* Kompaktere Abstände NUR in diesem Dialog und NUR unterhalb der Desktop-Breite (David: "Layout so
   verbessern, dass man nicht scrollen muss und alles in der Größe sieht", Zielgröße iPad Air — aber
   "normale Desktop-Größe soll so aussehen wie es vorhin ausgesehen hat"). 1279.98px = MudBlazor
   Breakpoint.Large-Start (siehe RowUnits in KontaktaufnahmeBuilder/KundenterminBuilder, dieselbe
   Grenze). Ab Large bleibt alles unverändert (kein max-width-Block greift). Die ViewBuilder-Klassen
   "grid-item"/"component-container-form" sind app-weit generisch — deshalb hier bewusst unter
   .kontaktaufnahme-dialog verschachtelt, damit kein anderer Dialog/View betroffen ist. */
@media (max-width: 1279.98px) {
    .kontaktaufnahme-dialog .mud-dialog-content {
        padding-top: 8px;
        padding-bottom: 8px;
    }

    .kontaktaufnahme-dialog .grid-item {
        padding-bottom: 4px !important;
    }

    .kontaktaufnahme-dialog .component-container-form {
        margin-bottom: 2px;
    }

    /* Ursprünglich mit ">" (Direktkind) — h6 liegt aber tatsächlich zwei Ebenen tiefer
       (component-container-layout > h6), der Selektor griff dadurch nie und die Titel blieben in
       voller Desktop-Größe (20px). Das war u.a. der Grund, warum "Ergebnis der Kontaktaufnahme" bei
       halber Spaltenbreite zweizeilig umbrach und dadurch unnötig Höhe kostete. */
    .kontaktaufnahme-dialog .component-container-form h6,
    .kontaktaufnahme-dialog .component-container-form .mud-typography-h6 {
        font-size: 0.8rem;
        line-height: 1.3;
        padding-bottom: 2px !important;
    }

    /* Der Titel-Zeile eines Outline(true)-Formulars liegt ein leerer .action-container bei (reserviert
       Platz für optionale Kopf-Aktionen, hier nie gesetzt) — durch align-items:stretch zieht dieser
       leere Container die ganze Titelzeile künstlich auf ca. 70px hoch, selbst wenn h6 nur eine Zeile
       braucht. Ungenutzt hier also auf 0 zurückgesetzt. */
    .kontaktaufnahme-dialog .action-container {
        min-height: 0;
    }
}

/* Gemeinsame Detailkarten; Radien, Konturen und weiche Tiefe zentral in facelift.css. */
.detail-card {
    border: 1px solid var(--fc-border);
    border-radius: var(--fc-radius-panel);
    box-shadow: var(--fc-shadow-panel);
}

/* Label/Wert-Zeilen in AuftragDetailGrid: Label gedämpft (Sekundärfarbe, Großbuchstaben) statt wie
   bisher fett+lila - der Wert ist die eigentlich relevante Information und soll das Auge zuerst
   auffangen, nicht das Label. Dünne Trennlinie zwischen den Zeilen (außer nach der letzten) statt
   der bisherigen Grid-Lücke ohne jede optische Gliederung. */
.detail-row-label {
    color: var(--mud-palette-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.detail-row-divided {
    border-bottom: 1px solid var(--fc-border-soft);
}

/* Wizard-Schritt-Leiste (MudStepper, aus WizardLayoutRenderer in PS.Core) überläuft bei
   schmaleren Bildschirmen (z.B. iPad Air 1180px) den Viewport, weil die umschließenden
   Flex-Container (component-container-layout) per CSS-Default min-width:auto haben und sich
   deshalb nicht unter die Inhaltsbreite der Schritt-Leiste zusammenschieben lassen — die Schritte
   ab ca. 7/8 werden dadurch abgeschnitten und sind nicht mehr erreichbar. .mud-stepper-nav hat
   bereits overflow-x:auto (siehe MudBlazor), das greift aber erst, wenn die Breite tatsächlich
   begrenzt wird. Bewusst hier in SchadenPortal.App statt in PS.Core (gleiche Begründung wie beim
   Dialog-Fix oben: PS.Core ist geteilte Infrastruktur, betrifft sonst alle Apps). :has() schränkt
   die min-width:0-Korrektur gezielt auf die Wrapper-Divs ein, die den Stepper enthalten, um keine
   Nebenwirkungen auf andere component-container-layout-Elemente im Rest der App zu haben. */
.mud-stepper,
.mud-stepper-nav {
    min-width: 0;
}

.component-container-layout:has(.mud-stepper) {
    min-width: 0;
}

/* Wunsch (David/Thomas): auf schmaleren Bildschirmen (iPad Air und ähnlich) statt zu scrollen
   oder auf die separate Mobile-Einzelschritt-Ansicht umzuschalten, bleibt die volle Schritt-Leiste
   sichtbar — nur der aktive Schritt zeigt Nummer + Text, alle anderen nur die Nummer. Das reduziert
   die benötigte Gesamtbreite so weit, dass alle Schritte nebeneinander passen. MudBlazor markiert
   den aktiven Schritt mit der Klasse ".active" auf ".mud-step" (siehe MudBlazor.min.css). Nur bis
   1399px aktiv (Xxl-Schwelle bei 1400px, siehe PS.Core Breakpoints-Enum) — ab echtem Desktop ist
   genug Platz für alle Labels, dort bleibt die bisherige Darstellung unverändert. */
@media (max-width: 1399px) {
    /* Ohne diese Transition springt die Button-Breite beim Aktivieren eines Schritts hart von
       schmal auf breit, genau während MudBlazors eigener Klick-Ripple-Effekt noch läuft (der
       innerhalb der ALTEN, schmalen Breite positioniert wurde). Das sah wie zwei separate,
       gegeneinander verschobene Animationen aus (Ripple auf der Nummer + harter Sprung über
       das ganze Feld). Mit einer sanften Breiten-Transition verschmilzt das zu einer einzigen,
       zusammenhängenden Bewegung. */
    .mud-stepper-nav .mud-step {
        flex: 0 0 auto;
        flex-basis: auto;
        padding-inline: 4px;
        transition: flex-basis 0.2s ease, padding-inline 0.2s ease;
    }

    .mud-stepper-nav .mud-step.active {
        flex-basis: 160px;
        padding-inline: 12px;
    }

    .mud-stepper-nav .mud-step:not(.active) .mud-step-label-content-title {
        display: none;
    }

    /* Nummern-Kreise verkleinern (24px → 18px) und den Abstand zwischen Kreis und Text
       reduzieren, damit noch mehr Schritte nebeneinander Platz finden. Wirkt auf alle Schritte
       (aktiv und inaktiv) — bei aktiv bleibt daneben weiterhin der volle Titeltext sichtbar. */
    .mud-stepper-nav .mud-step-label {
        gap: 4px;
    }

    .mud-stepper-nav .mud-step-label-icon {
        width: 18px;
        height: 18px;
        font-size: 9px;
    }

    /* Verbindungslinien zwischen den Schritten sollen bei Platzmangel auf 0 schrumpfen dürfen,
       statt eine Mindestbreite zu erzwingen (Standard: min-width:32px in der scrollbaren Variante). */
    .mud-stepper-nav .mud-stepper-nav-connector {
        min-width: 0;
    }
}

.dashboard-page-background {
    background: var(--fc-workspace-background);
}

.work-dashboard {
    width: 100%;
    max-width: 1480px;
    margin: 0 auto;
    padding: 14px 0 30px;
}

.dashboard-hero {
    position: relative;
    min-height: 156px;
    overflow: hidden;
    margin-bottom: 16px;
    padding: 24px 28px;
    border: 1px solid color-mix(in srgb, var(--mud-palette-primary) 24%, transparent);
    border-radius: 20px;
    background:
        radial-gradient(ellipse at 90% 0%, rgba(56, 153, 221, 0.16), transparent 55%),
        linear-gradient(122deg, #35204e 0%, var(--mud-palette-primary) 62%, #68409a 100%);
    box-shadow: 0 16px 38px -14px rgba(51, 31, 75, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.16);
    color: #fff;
}

.dashboard-hero-content {
    position: relative;
    z-index: 2;
    display: flex;
    height: 100%;
    min-height: 106px;
    align-items: flex-end;
    justify-content: space-between;
    gap: 32px;
}

.dashboard-hero-glow {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
}

.dashboard-hero-glow-one {
    width: 310px;
    height: 310px;
    top: -205px;
    right: 9%;
    background: rgba(255, 255, 255, 0.07);
}

.dashboard-hero-glow-two {
    width: 180px;
    height: 180px;
    right: -60px;
    bottom: -105px;
    border: 30px solid color-mix(in srgb, var(--mud-palette-tertiary) 13%, transparent);
}

.dashboard-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 8px;
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

.dashboard-hero-title.mud-typography {
    margin-bottom: 8px;
    color: #fff;
    font-size: clamp(1.75rem, 3vw, 2.45rem);
    font-weight: 750;
    letter-spacing: -0.035em;
    line-height: 1.05;
}

.dashboard-hero-dot {
    color: var(--mud-palette-tertiary);
}

.dashboard-hero-summary.mud-typography {
    max-width: 720px;
    color: rgba(255, 255, 255, 0.78);
    font-size: 0.98rem;
}

.dashboard-hero-meta {
    display: flex;
    flex: 0 0 auto;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
}

.dashboard-hero-meta .mud-button-root {
    color: rgba(255, 255, 255, 0.78);
    font-size: 0.72rem;
}

.dashboard-live-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 12px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.1);
    font-size: 0.75rem;
    font-weight: 650;
    backdrop-filter: blur(5px);
}

.dashboard-live-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--mud-palette-tertiary);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--mud-palette-tertiary) 15%, transparent);
}

.dashboard-panel {
    overflow: hidden;
    border: 1px solid rgba(32, 37, 49, 0.09);
    border-radius: 16px;
    background: var(--mud-palette-surface);
    box-shadow: 0 7px 24px rgba(26, 32, 44, 0.055);
}

.dashboard-panel-heading {
    display: flex;
    min-height: 68px;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 15px 18px;
}

.dashboard-heading-line {
    display: flex;
    align-items: center;
    gap: 10px;
}

.dashboard-heading-icon {
    display: inline-flex;
    width: 35px;
    height: 35px;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: rgba(117, 25, 201, 0.09);
    color: var(--mud-palette-primary);
}

.dashboard-heading-icon-alert {
    background: rgba(239, 83, 80, 0.09);
    color: var(--mud-palette-error);
}

.dashboard-heading-icon-calendar {
    background: rgba(30, 118, 227, 0.09);
    color: var(--mud-palette-secondary);
}

.dashboard-section-title.mud-typography {
    font-weight: 700;
    letter-spacing: -0.018em;
}

.dashboard-work-panel {
    margin-bottom: 12px;
}

.dashboard-work-heading {
    min-height: 76px;
    padding: 16px 20px 13px;
}

.dashboard-work-metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    padding: 0 16px 16px;
}

.dashboard-work-metric {
    --metric-color: var(--mud-palette-primary);
    position: relative;
    display: flex;
    min-width: 0;
    min-height: 138px;
    overflow: hidden;
    flex-direction: column;
    align-items: flex-start;
    padding: 14px 16px;
    border: 1px solid rgba(32, 37, 49, 0.09);
    border-radius: 13px;
    background: linear-gradient(145deg, color-mix(in srgb, var(--metric-color) 5%, #fff), #fff 62%);
    color: var(--mud-palette-text-primary);
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.dashboard-work-metric::before {
    position: absolute;
    top: 0;
    left: 18px;
    width: 42px;
    height: 3px;
    border-radius: 0 0 4px 4px;
    background: var(--metric-color);
    content: "";
}

.dashboard-work-metric:hover,
.dashboard-work-metric:focus-visible {
    transform: translateY(-3px);
    border-color: color-mix(in srgb, var(--metric-color) 32%, transparent);
    box-shadow: 0 12px 26px color-mix(in srgb, var(--metric-color) 12%, transparent);
    outline: none;
}

.metric-blue { --metric-color: var(--mud-palette-secondary); }
.metric-green { --metric-color: var(--mud-palette-tertiary); }
.metric-danger { --metric-color: var(--mud-palette-error); }

.dashboard-work-metric-top {
    display: flex;
    width: 100%;
    align-items: center;
    color: var(--metric-color);
}

.dashboard-work-metric > strong {
    margin-top: 9px;
    font-size: 1.8rem;
    font-weight: 750;
    letter-spacing: -0.04em;
    line-height: 1;
}

.dashboard-work-metric > span:not(.dashboard-work-metric-top) {
    margin-top: 5px;
    font-size: 0.84rem;
    font-weight: 700;
}

.dashboard-work-metric > small {
    margin-top: 2px;
    color: var(--mud-palette-text-secondary);
    font-size: 0.68rem;
}

.dashboard-metric-arrow {
    position: absolute;
    right: 16px;
    bottom: 12px;
    color: color-mix(in srgb, var(--metric-color) 55%, transparent);
    opacity: 0;
    transform: translateX(-5px);
    transition: opacity 160ms ease, transform 160ms ease;
}

.dashboard-work-metric:hover .dashboard-metric-arrow,
.dashboard-work-metric:focus-visible .dashboard-metric-arrow {
    opacity: 1;
    transform: translateX(0);
}

.dashboard-work-detail-grid {
    display: grid;
    grid-template-columns: minmax(300px, 0.75fr) minmax(500px, 1.25fr);
    border-top: 1px solid var(--mud-palette-lines-default);
}

.dashboard-workflow-summary,
.dashboard-month-summary {
    padding: 14px 18px 16px;
}

.dashboard-workflow-summary {
    border-right: 1px solid var(--mud-palette-lines-default);
    background: #fcfcfd;
}

.dashboard-workflow-items {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    margin-top: 7px;
}

.dashboard-workflow-items > div {
    display: grid;
    grid-template-columns: 8px auto;
    align-items: center;
    column-gap: 7px;
}

.dashboard-workflow-items strong {
    font-size: 1.12rem;
}

.dashboard-workflow-items small {
    grid-column: 2;
    overflow: hidden;
    color: var(--mud-palette-text-secondary);
    font-size: 0.64rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.workflow-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
}

.workflow-purple { background: var(--mud-palette-primary); }
.workflow-blue { background: var(--mud-palette-secondary); }
.workflow-green { background: var(--mud-palette-tertiary); }
.workflow-orange { background: #e89a25; }

.dashboard-month-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.dashboard-month-metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-top: 7px;
}

.dashboard-month-metric {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    column-gap: 7px;
}

.dashboard-month-metric .mud-icon-root {
    color: var(--mud-palette-primary);
}

.dashboard-month-metric strong {
    font-size: 1.12rem;
}

.dashboard-month-metric span,
.dashboard-month-metric small {
    grid-column: 1 / -1;
}

.dashboard-month-metric span {
    margin-top: 3px;
    font-size: 0.7rem;
    font-weight: 700;
}

.dashboard-month-metric small {
    margin-top: 1px;
    color: var(--mud-palette-text-secondary);
    font-size: 0.61rem;
}

.dashboard-main-grid {
    margin-top: 0;
}

.dashboard-attention-panel,
.dashboard-appointments-panel {
    height: 100%;
}

.dashboard-list {
    padding: 0 14px 4px;
}

.dashboard-list-row {
    position: relative;
    display: flex;
    width: 100%;
    min-height: 62px;
    align-items: center;
    gap: 12px;
    padding: 8px 10px;
    border: 0;
    border-bottom: 1px solid var(--mud-palette-lines-default);
    border-radius: 9px;
    background: transparent;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition: background-color 150ms ease, transform 150ms ease;
}

.dashboard-list-row:last-child {
    border-bottom-color: transparent;
}

.dashboard-list-row:hover,
.dashboard-list-row:focus-visible {
    z-index: 1;
    background: rgba(117, 25, 201, 0.045);
    outline: none;
    transform: translateX(3px);
}

.dashboard-list-row-overdue {
    background: linear-gradient(90deg, rgba(239, 83, 80, 0.055), transparent 58%);
}

.dashboard-list-row-overdue::before,
.dashboard-list-row-current::before {
    position: absolute;
    top: 14px;
    bottom: 14px;
    left: 0;
    width: 3px;
    border-radius: 3px;
    background: var(--mud-palette-error);
    content: "";
}

.dashboard-list-row-current::before {
    background: var(--mud-palette-info);
}

.dashboard-list-icon {
    display: inline-flex;
    width: 38px;
    height: 38px;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    border-radius: 11px;
}

.dashboard-list-content {
    min-width: 0;
    flex: 1 1 auto;
}

.dashboard-task-title-line {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 8px;
}

.dashboard-list-title {
    overflow: hidden;
    font-weight: 650;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dashboard-status-badge {
    flex: 0 0 auto;
    padding: 2px 7px;
    border-radius: 999px;
    font-size: 0.58rem;
    font-weight: 750;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.status-overdue { background: rgba(239, 83, 80, 0.1); color: var(--mud-palette-error); }
.status-current { background: rgba(30, 118, 227, 0.1); color: var(--mud-palette-info); }
.status-planned { background: rgba(116, 197, 25, 0.11); color: #4e8610; }

.dashboard-list-due {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.dashboard-footer-link {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: flex-end;
    gap: 7px;
    padding: 10px 18px;
    border: 0;
    border-top: 1px solid var(--mud-palette-lines-default);
    background: linear-gradient(90deg, transparent, rgba(117, 25, 201, 0.035));
    color: var(--mud-palette-primary);
    font: inherit;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 150ms ease, gap 150ms ease;
}

.dashboard-footer-link:hover,
.dashboard-footer-link:focus-visible {
    gap: 10px;
    background-color: rgba(117, 25, 201, 0.055);
    outline: none;
}

.dashboard-empty-state {
    display: flex;
    min-height: 220px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 28px;
    text-align: center;
}

.dashboard-empty-icon {
    display: inline-flex;
    width: 66px;
    height: 66px;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    border-radius: 22px;
    background: linear-gradient(145deg, rgba(116, 197, 25, 0.16), rgba(117, 25, 201, 0.08));
    color: var(--mud-palette-tertiary);
}

/* Termine heute / nächste 7 Tage: zwei kleine Chips (Symbol, Zahl, Text) unter der Überschrift */
.dashboard-appointment-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 0 16px 10px;
}

.dashboard-appointment-stats > span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px 3px 8px;
    border: 1px solid rgba(30, 118, 227, 0.16);
    border-radius: 999px;
    background: rgba(30, 118, 227, 0.06);
    line-height: 1.3;
}

.dashboard-appointment-stats .mud-icon-root {
    font-size: 1rem;
    color: var(--mud-palette-secondary);
}

.dashboard-appointment-stats strong {
    color: var(--mud-palette-secondary);
    font-size: 0.9rem;
}

.dashboard-appointment-stats small {
    color: var(--mud-palette-text-secondary);
    font-size: 0.75rem;
    white-space: nowrap;
}

.dashboard-appointment-row {
    min-height: 74px;
}

.dashboard-next-appointment {
    margin-bottom: 5px;
    border: 1px solid rgba(30, 118, 227, 0.13);
    background: linear-gradient(105deg, rgba(30, 118, 227, 0.075), rgba(117, 25, 201, 0.025));
}

.dashboard-next-label {
    display: block;
    margin-bottom: 2px;
    color: var(--mud-palette-secondary);
    font-size: 0.56rem;
    font-weight: 800;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.dashboard-appointment-time.mud-typography {
    color: var(--mud-palette-secondary);
    font-weight: 650;
}

.dashboard-date-tile {
    display: inline-flex;
    width: 46px;
    height: 50px;
    flex: 0 0 auto;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(30, 118, 227, 0.14);
    border-radius: 10px;
    background: linear-gradient(150deg, rgba(30, 118, 227, 0.12), rgba(117, 25, 201, 0.05));
    color: var(--mud-palette-secondary);
    line-height: 1.05;
}

.dashboard-date-tile strong { font-size: 1.05rem; }
.dashboard-date-tile small { font-size: 0.6rem; font-weight: 750; }

.dashboard-empty-calendar .dashboard-empty-icon {
    background: linear-gradient(145deg, rgba(30, 118, 227, 0.13), rgba(117, 25, 201, 0.07));
    color: var(--mud-palette-secondary);
}

.dashboard-quick-actions {
    padding-bottom: 10px;
}

.dashboard-action-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
    padding: 0 14px;
}

.dashboard-action-tile {
    display: grid;
    min-width: 0;
    min-height: 70px;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 9px;
    padding: 10px;
    border: 1px solid rgba(32, 37, 49, 0.09);
    border-radius: 12px;
    background: #fcfcfd;
    color: var(--mud-palette-text-primary);
    text-decoration: none;
    transition: transform 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
}

.dashboard-action-tile:hover,
.dashboard-action-tile:focus-visible {
    transform: translateY(-2px);
    border-color: rgba(117, 25, 201, 0.28);
    box-shadow: 0 9px 20px rgba(52, 25, 78, 0.08);
    outline: none;
}

.dashboard-action-primary {
    border-color: rgba(117, 25, 201, 0.14);
    background: linear-gradient(145deg, rgba(117, 25, 201, 0.085), rgba(117, 25, 201, 0.025));
}

.dashboard-action-icon {
    display: inline-flex;
    width: 34px;
    height: 34px;
    align-items: center;
    justify-content: center;
    border-radius: 9px;
    background: rgba(117, 25, 201, 0.085);
    color: var(--mud-palette-primary);
}

.dashboard-action-tile > span:nth-child(2) {
    display: flex;
    min-width: 0;
    flex-direction: column;
}

.dashboard-action-tile strong {
    overflow: hidden;
    font-size: 0.75rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dashboard-action-tile small {
    overflow: hidden;
    color: var(--mud-palette-text-secondary);
    font-size: 0.62rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dashboard-action-tile > .mud-icon-root:last-child {
    color: var(--mud-palette-text-secondary);
    opacity: 0.55;
}

.dashboard-loading-panel {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 20px;
}

.dashboard-loading-metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.dashboard-load-error {
    margin-bottom: 16px;
}

@media (max-width: 1279.98px) {
    .dashboard-work-detail-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-workflow-summary {
        border-right: 0;
        border-bottom: 1px solid var(--mud-palette-lines-default);
    }
}

@media (max-width: 959.98px) {
    .dashboard-work-metrics,
    .dashboard-loading-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dashboard-hero-content {
        align-items: flex-start;
        flex-direction: column;
        gap: 20px;
    }

    .dashboard-hero-meta {
        width: 100%;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
}

@media (max-width: 599.98px) {
    .work-dashboard {
        padding: 10px 0 28px;
    }

    .dashboard-hero {
        min-height: 174px;
        margin-bottom: 14px;
        padding: 20px;
        border-radius: 16px;
    }

    .dashboard-hero-content {
        min-height: 132px;
    }

    .dashboard-hero-title.mud-typography {
        font-size: 1.75rem;
    }

    .dashboard-hero-summary.mud-typography {
        font-size: 0.84rem;
    }

    .dashboard-panel {
        border-radius: 13px;
    }

    .dashboard-panel-heading,
    .dashboard-work-heading {
        min-height: 64px;
        padding: 14px;
    }

    .dashboard-work-heading .mud-button-root {
        display: none;
    }

    .dashboard-work-metrics {
        gap: 8px;
        padding: 0 12px 14px;
    }

    .dashboard-work-metric {
        min-height: 134px;
        padding: 13px;
    }

    .dashboard-work-metric > strong {
        font-size: 1.75rem;
    }

    .dashboard-workflow-summary,
    .dashboard-month-summary {
        padding: 16px;
    }

    .dashboard-workflow-items,
    .dashboard-month-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        row-gap: 14px;
    }

    .dashboard-list {
        padding-inline: 6px;
    }

    .dashboard-list-row {
        padding-inline: 8px;
    }

    .dashboard-task-title-line {
        align-items: flex-start;
        flex-direction: column;
        gap: 2px;
    }

    .dashboard-list-due .mud-icon-root {
        display: none;
    }

    .dashboard-status-badge {
        display: none;
    }

    .dashboard-action-grid {
        grid-template-columns: 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {
    .dashboard-work-metric,
    .dashboard-metric-arrow,
    .dashboard-list-row,
    .dashboard-action-tile,
    .dashboard-footer-link {
        transition: none;
    }

    .dashboard-work-metric:hover,
    .dashboard-list-row:hover,
    .dashboard-action-tile:hover {
        transform: none;
    }
}

/* Appointment cockpit dialog shell is rendered by MudBlazor outside the component subtree. */
.appointment-outcome-dialog.mud-dialog {
    display: flex;
    flex-direction: column;
    width: min(100%, 960px);
    max-height: min(90dvh, 900px);
    box-sizing: border-box;
    overflow: hidden;
}

.appointment-outcome-dialog,
.appointment-outcome-dialog * {
    box-sizing: border-box;
    min-width: 0;
}

.appointment-outcome-dialog .mud-dialog-title {
    flex: 0 0 auto;
    overflow: hidden;
}

.appointment-outcome-dialog .mud-dialog-content {
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.appointment-outcome-dialog .mud-dialog-actions {
    flex: 0 0 auto;
    border-top: 1px solid var(--mud-palette-lines-default);
    background: var(--mud-palette-surface);
}

@media (max-width: 600px) {
    .appointment-outcome-dialog.mud-dialog {
        width: calc(100vw - 1rem);
        max-width: calc(100vw - 1rem);
        max-height: calc(100dvh - 1rem);
        margin: .5rem;
    }

    .appointment-outcome-dialog .mud-dialog-title {
        padding: .85rem 3rem .75rem .85rem;
    }

    .appointment-outcome-dialog .mud-dialog-content {
        padding: .85rem;
    }

    .appointment-outcome-dialog .mud-dialog-actions {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        gap: .5rem;
        padding: .65rem .85rem max(.65rem, env(safe-area-inset-bottom));
    }

    .appointment-outcome-dialog .mud-dialog-actions .mud-button-root {
        width: 100%;
        margin: 0;
        white-space: normal;
    }
}

@media (max-width: 400px) {
    .appointment-outcome-dialog .mud-dialog-actions {
        grid-template-columns: 1fr;
    }

    .appointment-outcome-dialog .mud-dialog-actions .mud-button-filled {
        order: -1;
    }
}

@media (max-width: 599.98px) {
    .dashboard-workflow-summary,
    .dashboard-month-summary {
        text-align: center;
    }

    .dashboard-month-heading {
        justify-content: center;
    }

    .dashboard-workflow-items > div,
    .dashboard-month-metric {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        justify-content: center;
        column-gap: 7px;
    }

    .dashboard-workflow-items small,
    .dashboard-month-metric span,
    .dashboard-month-metric small {
        flex-basis: 100%;
    }
}