/* ==========================================================================
   Dashboard (Startseite)
   Nutzt die M3-Farbtokens aus tokens.css/theme.css, damit die Widgets dieselbe
   Optik wie ContentPanel & Co. haben (16px Radius, Hintergrund-Token, Roboto).
   Die Pastellfarben für Kommen/Gehen/Sonstiges entsprechen den .pill-* Klassen
   aus app.css, die an anderen Stellen der App bereits verwendet werden.
   ========================================================================== */

:root {
    --dash-divider: color-mix(in srgb, var(--md-sys-color-outline-variant) 45%, transparent);
    --dash-in-bg: #e6f4ea;
    --dash-in-fg: #188038;
    --dash-out-bg: #fce8e6;
    --dash-out-fg: #b31412;
    --dash-other-bg: #e8f0fe;
    --dash-other-fg: #1967d2;
}

/* --------------------------------------------------------------------------
   Kopfbereich: Avatar, Begrüßung, Info-Chips, Datum
   -------------------------------------------------------------------------- */
.dash-header {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px 32px;
    padding: 16px 24px;
    border-radius: 16px;
    background-color: var(--md-sys-color-background);
}

.dash-header__identity {
    display: flex;
    align-items: center;
    gap: 16px;
    min-width: 0;
}

.dash-header__greeting {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.dash-header__greeting-small {
    font-size: 0.875rem;
    line-height: 1.25rem;
    color: var(--md-sys-color-on-surface-variant);
}

.dash-header__name {
    font-size: 1.375rem;
    line-height: 1.75rem;
    font-weight: 600;
    color: var(--md-sys-color-on-background);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dash-header__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    flex: 1 1 auto;
    min-width: 0;
}

.dash-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 32px;
    padding: 0 12px;
    border-radius: 8px;
    background-color: var(--md-sys-color-surface);
    border: 1px solid color-mix(in srgb, var(--md-sys-color-outline-variant) 60%, transparent);
    font-size: 0.8125rem;
    white-space: nowrap;
}

.dash-chip .mud-icon-root {
    font-size: 18px;
    width: 18px;
    height: 18px;
    color: var(--md-sys-color-outline);
}

.dash-chip__label {
    color: var(--md-sys-color-outline);
}

.dash-chip__value {
    color: var(--md-sys-color-on-background);
    font-weight: 500;
}

.dash-header__date {
    margin-left: auto;
    text-align: right;
}

.dash-header__date-label {
    font-size: 0.6875rem;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    color: var(--md-sys-color-outline);
}

.dash-header__date-value {
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--md-sys-color-on-background);
    white-space: nowrap;
}

/* --------------------------------------------------------------------------
   Listen innerhalb der ContentPanels (Tagesbuchungen, Salden, Fehler)
   -------------------------------------------------------------------------- */
.dash-list {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.dash-list__header {
    display: grid;
    align-items: center;
    gap: 12px;
    padding: 0 12px 8px;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    color: var(--md-sys-color-outline);
    border-bottom: 1px solid var(--dash-divider);
    flex-shrink: 0;
}

.dash-row {
    display: grid;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    min-height: 52px;
    border-bottom: 1px solid var(--dash-divider);
    font-size: 0.9375rem;
    color: var(--md-sys-color-on-background);
}

.dash-row:last-child {
    border-bottom: none;
}

.dash-cols--bookings {
    grid-template-columns: minmax(0, 1.4fr) 64px minmax(0, 1fr);
}

.dash-cols--errors {
    grid-template-columns: 104px minmax(0, 1fr);
}

.dash-action {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.dash-action__text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dash-time {
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.dash-muted {
    color: var(--md-sys-color-on-surface-variant);
    font-size: 0.875rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dash-badge {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.dash-badge .mud-icon-root {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

.dash-badge--in {
    background-color: var(--dash-in-bg);
    color: var(--dash-in-fg);
}

.dash-badge--out {
    background-color: var(--dash-out-bg);
    color: var(--dash-out-fg);
}

.dash-badge--other {
    background-color: var(--dash-other-bg);
    color: var(--dash-other-fg);
}

.dash-date {
    display: inline-flex;
    align-items: center;
    height: 26px;
    padding: 0 10px;
    border-radius: 8px;
    background-color: var(--md-sys-color-surface);
    font-size: 0.8125rem;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
    color: var(--md-sys-color-on-surface-variant);
    width: fit-content;
}

.dash-error__message {
    font-size: 0.875rem;
    line-height: 1.25rem;
    color: var(--md-sys-color-on-background);
    overflow-wrap: anywhere;
}

/* Zähler im Panel-Kopf */
.dash-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 8px;
    margin-right: 4px;
    border-radius: 11px;
    font-size: 0.75rem;
    font-weight: 600;
    background-color: var(--md-sys-color-surface);
    color: var(--md-sys-color-on-surface-variant);
}

.dash-count--error {
    background-color: var(--dash-out-bg);
    color: var(--dash-out-fg);
}

/* --------------------------------------------------------------------------
   Salden
   -------------------------------------------------------------------------- */
.dash-balance {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px;
    min-height: 52px;
    border-bottom: 1px solid var(--dash-divider);
}

.dash-balance:last-child {
    border-bottom: none;
}

.dash-balance__name {
    font-size: 0.9375rem;
    color: var(--md-sys-color-on-background);
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dash-balance__value {
    display: flex;
    align-items: baseline;
    gap: 6px;
    flex-shrink: 0;
}

.dash-balance__number {
    font-size: 1.0625rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: var(--md-sys-color-on-background);
}

.dash-balance__number--negative {
    color: var(--md-sys-color-error);
}

.dash-balance__unit {
    font-size: 0.8125rem;
    color: var(--md-sys-color-on-surface-variant);
}

/* --------------------------------------------------------------------------
   Buchungs-Buttons + Statuskarte
   -------------------------------------------------------------------------- */
.dash-booking-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 0 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 2px 0;
}

.dash-booking-button.mud-button {
    height: 48px;
    width: 100%;
    padding: 0 14px;
    border-radius: 12px;
    justify-content: flex-start;
    text-transform: none;
    box-shadow: none;
    flex-shrink: 0;
}

.dash-booking-button.mud-button:not(.mud-disabled):hover {
    filter: brightness(0.96);
}

.dash-booking-button .mud-button-label {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    min-width: 0;
}

.dash-booking-button__icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background-color: color-mix(in srgb, currentColor 14%, transparent);
}

.dash-booking-button__icon .mud-icon-root {
    font-size: 20px;
    width: 20px;
    height: 20px;
}

/* Die App-Icons bringen teils ein festes fill="#5f6368" mit; hier folgt das Icon der Textfarbe des Buttons. */
.dash-booking-button__icon svg svg {
    fill: currentColor;
}

.dash-booking-button__text {
    font-size: 0.9375rem;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dash-status {
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 12px;
    background-color: var(--md-sys-color-surface);
    flex-shrink: 0;
}

.dash-status__label {
    font-size: 0.6875rem;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    color: var(--md-sys-color-outline);
}

.dash-status__value {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 2px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--md-sys-color-on-background);
}

.dash-status__info {
    font-size: 0.8125rem;
    color: var(--md-sys-color-on-surface-variant);
    text-align: right;
}

.dash-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: var(--md-sys-color-outline);
    flex-shrink: 0;
}

.dash-dot--present {
    background-color: var(--dash-in-fg);
    box-shadow: 0 0 0 3px var(--dash-in-bg);
}

/* --------------------------------------------------------------------------
   Leer- und Ladezustände
   -------------------------------------------------------------------------- */
.dash-empty {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 32px 24px;
    text-align: center;
    color: var(--md-sys-color-on-surface-variant);
}

.dash-empty__icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
    background-color: var(--md-sys-color-surface);
    color: var(--md-sys-color-outline);
}

.dash-empty__icon--success {
    background-color: var(--dash-in-bg);
    color: var(--dash-in-fg);
}

.dash-empty__icon .mud-icon-root {
    font-size: 28px;
    width: 28px;
    height: 28px;
}

.dash-empty__title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--md-sys-color-on-background);
}

.dash-empty__subtitle {
    font-size: 0.8125rem;
}

.dash-skeleton-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 4px 0;
}

.dash-skeleton-list .mud-skeleton {
    border-radius: 12px;
    background-color: color-mix(in srgb, var(--md-sys-color-on-background) 6%, transparent);
}

.dash-progress {
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
}
