.incident-statistics-chart-panel {
    --incident-statistics-color-1: #e85a32;
    --incident-statistics-color-2: #167ca5;
    --incident-statistics-color-3: #2f855a;
    --incident-statistics-color-4: #805ad5;
    --incident-statistics-color-5: #d69e2e;
    --incident-statistics-color-6: #c53030;
    --incident-statistics-color-7: #4a5568;
    --incident-statistics-color-8: #718096;
}

.incident-statistics-grid {
    display: grid;
    grid-template-columns:
        minmax(340px, 1.05fr)
        minmax(420px, 1fr);
    gap: 16px;
    align-items: start;
}

.incident-statistics-heading,
.incident-statistics-table-heading {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 20px;
}

.incident-statistics-heading h2,
.incident-statistics-table-heading h2 {
    margin: 0 0 5px;
}

.incident-statistics-heading p,
.incident-statistics-table-heading p {
    margin: 0;
    color: #627682;
}

.incident-statistics-total {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    flex: 0 0 auto;
}

.incident-statistics-total span {
    color: #627682;
    font-size: 12px;
}

.incident-statistics-total strong {
    color: #173f52;
    font-size: 30px;
    line-height: 1.1;
}

.incident-statistics-chart-layout {
    display: grid;
    grid-template-columns:
        minmax(220px, 340px)
        minmax(230px, 1fr);
    gap: 28px;
    align-items: center;
}

.incident-statistics-pie {
    width: 100%;
    max-width: 340px;
    aspect-ratio: 1;
    margin-inline: auto;
    border: 1px solid #d6e1e6;
    border-radius: 50%;
    background:
        var(--incident-statistics-gradient);
}

.incident-statistics-legend {
    display: grid;
    gap: 4px;
}

.incident-statistics-legend-row {
    display: grid;
    grid-template-columns:
        14px
        minmax(130px, 1fr)
        minmax(30px, auto)
        minmax(52px, auto);
    gap: 9px;
    align-items: center;
    min-height: 32px;
    padding: 5px 0;
    border-bottom: 1px solid #e4ebef;
}

.incident-statistics-legend-row:last-child {
    border-bottom: 0;
}

.incident-statistics-swatch {
    display: inline-block;
    width: 12px;
    height: 12px;
    margin-right: 7px;
    border-radius: 3px;
    vertical-align: -1px;
}

.incident-statistics-category {
    min-width: 0;
}

.incident-statistics-percentage {
    min-width: 50px;
    color: #627682;
    text-align: right;
}

.incident-statistics-note {
    margin: 20px 0 0;
    color: #627682;
    font-size: 12px;
}

.incident-statistics-color-1 {
    background: var(--incident-statistics-color-1);
}

.incident-statistics-color-2 {
    background: var(--incident-statistics-color-2);
}

.incident-statistics-color-3 {
    background: var(--incident-statistics-color-3);
}

.incident-statistics-color-4 {
    background: var(--incident-statistics-color-4);
}

.incident-statistics-color-5 {
    background: var(--incident-statistics-color-5);
}

.incident-statistics-color-6 {
    background: var(--incident-statistics-color-6);
}

.incident-statistics-color-7 {
    background: var(--incident-statistics-color-7);
}

.incident-statistics-color-8 {
    background: var(--incident-statistics-color-8);
}

@media (max-width: 1050px) {
    .incident-statistics-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 680px) {
    .incident-statistics-heading,
    .incident-statistics-table-heading {
        flex-direction: column;
    }

    .incident-statistics-total {
        align-items: flex-start;
    }

    .incident-statistics-chart-layout {
        grid-template-columns: 1fr;
    }

    .incident-statistics-pie {
        max-width: 280px;
    }
}

/* IGNIS_DASHBOARD_INSIGHTS_START */
.dashboard-insight-grid {
    display: grid;
    grid-template-columns:
        minmax(0, 1.15fr)
        minmax(360px, .85fr);
    gap: 16px;
    align-items: start;
    margin-bottom: 16px;
}

.dashboard-insight-panel {
    min-width: 0;
}

.dashboard-insight-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 18px;
}

.dashboard-insight-header h2 {
    margin: 0 0 4px;
}

.dashboard-insight-header p {
    margin: 0;
    color: #627682;
}

.dashboard-statistics-layout {
    display: grid;
    grid-template-columns:
        minmax(170px, 230px)
        minmax(210px, 1fr);
    gap: 22px;
    align-items: center;
}

.dashboard-statistics-pie {
    max-width: 230px;
}

.dashboard-statistics-total {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid #e4ebef;
}

.dashboard-appointment-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 14px;
    color: #627682;
    font-size: 12px;
}

.dashboard-appointment-legend > span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.dashboard-calendar-icon {
    display: inline-flex;
    width: 24px;
    height: 24px;
    align-items: center;
    justify-content: center;
    flex: 0 0 24px;
}

.dashboard-calendar-icon svg {
    width: 21px;
    height: 21px;
    fill: currentColor;
}

.dashboard-calendar-icon.is-hu {
    color: #167ca5;
}

.dashboard-calendar-icon.is-repair {
    color: #c53030;
}

.dashboard-appointment-list {
    display: grid;
}

.dashboard-appointment-row {
    display: grid;
    grid-template-columns:
        26px
        84px
        minmax(0, 1fr);
    gap: 9px;
    align-items: center;
    min-height: 58px;
    padding: 8px 2px;
    color: inherit;
    text-decoration: none;
    border-bottom: 1px solid #e4ebef;
}

.dashboard-appointment-row:last-child {
    border-bottom: 0;
}

.dashboard-appointment-row:hover {
    background: #f5f8fa;
}

.dashboard-appointment-date {
    font-weight: 700;
    white-space: nowrap;
}

.dashboard-appointment-content {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 2px;
}

.dashboard-appointment-content strong,
.dashboard-appointment-content small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dashboard-appointment-content small {
    color: #627682;
}

.dashboard-deadline-panel {
    margin-top: 16px;
}

.dashboard-deadline-count {
    display: inline-flex;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: #edf3f6;
    color: #334e5c;
    font-weight: 800;
}

.dashboard-deadline-list {
    display: grid;
    max-height: 640px;
    overflow-y: auto;
    scrollbar-gutter: stable;
}

.dashboard-deadline-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 18px;
    margin: -4px 0 14px;
    color: #4f6875;
    font-size: 12px;
}

.dashboard-deadline-legend > span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.dashboard-traffic-light {
    display: inline-block;
    width: 12px;
    height: 12px;
    flex: 0 0 12px;
    border: 1px solid rgba(0, 0, 0, .12);
    border-radius: 50%;
    background: #d9e2e7;
}

.dashboard-traffic-light.is-valid {
    background: #2f9e44;
}

.dashboard-traffic-light.is-warning {
    background: #f2c94c;
}

.dashboard-traffic-light.is-critical {
    background: #ed8936;
}

.dashboard-traffic-light.is-expired {
    background: #d64545;
}

.dashboard-deadline-group {
    display: grid;
}

.dashboard-deadline-group + .dashboard-deadline-group {
    margin-top: 10px;
}

.dashboard-deadline-group-heading {
    position: sticky;
    z-index: 2;
    top: 0;
    display: flex;
    min-height: 38px;
    padding: 7px 10px;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border-bottom: 1px solid #d8e2e7;
    background: #f5f8fa;
    color: #334e5c;
}

.dashboard-deadline-group-heading > span {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 13px;
    font-weight: 800;
}

.dashboard-deadline-group-heading > strong {
    display: inline-flex;
    min-width: 28px;
    height: 24px;
    padding: 0 7px;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: #ffffff;
    font-size: 12px;
}

.dashboard-deadline-row {
    display: grid;
    grid-template-columns:
        minmax(132px, auto)
        92px
        130px
        minmax(220px, 1fr)
        28px;
    gap: 12px;
    align-items: center;
    min-height: 62px;
    padding: 9px 4px;
    border-bottom: 1px solid #e4ebef;
    color: inherit;
    text-decoration: none;
}

.dashboard-deadline-row:last-child {
    border-bottom: 0;
}

.dashboard-deadline-row:hover {
    background: #f5f8fa;
}

.dashboard-deadline-status {
    display: inline-flex;
    width: fit-content;
    padding: 5px 8px;
    border-radius: 999px;
    background: #fff5d9;
    color: #7a5200;
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}

.dashboard-deadline-status.is-valid {
    background: #e1f4e5;
    color: #246b32;
}

.dashboard-deadline-status.is-warning {
    background: #fff5c2;
    color: #735c00;
}

.dashboard-deadline-status.is-critical,
.dashboard-deadline-status.is-today {
    background: #ffead8;
    color: #93440a;
}

.dashboard-deadline-status.is-expired {
    background: #fde3e3;
    color: #a62424;
}

.dashboard-deadline-date {
    font-weight: 750;
    white-space: nowrap;
}

.dashboard-deadline-category {
    color: #4f6875;
    font-size: 13px;
    font-weight: 700;
}

.dashboard-deadline-content {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 2px;
}

.dashboard-deadline-content strong,
.dashboard-deadline-content small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dashboard-deadline-content small {
    color: #627682;
}

.dashboard-deadline-action {
    color: #167ca5;
    font-size: 22px;
    font-weight: 800;
    text-align: center;
}

@media (max-width: 1100px) {
    .dashboard-insight-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-deadline-row {
        grid-template-columns:
            minmax(132px, auto)
            92px
            minmax(0, 1fr)
            28px;
    }

    .dashboard-deadline-category {
        display: none;
    }
}

@media (max-width: 680px) {
    .dashboard-statistics-layout {
        grid-template-columns: 1fr;
    }

    .dashboard-statistics-pie {
        max-width: 250px;
    }

    .dashboard-appointment-row {
        grid-template-columns:
            24px
            78px
            minmax(0, 1fr);
    }

    .dashboard-deadline-row {
        grid-template-columns:
            minmax(0, 1fr)
            28px;
        gap: 4px 10px;
        padding: 12px 4px;
    }

    .dashboard-deadline-status {
        grid-column: 1;
        grid-row: 1;
    }

    .dashboard-deadline-date {
        grid-column: 1;
        grid-row: 2;
        font-size: 13px;
    }

    .dashboard-deadline-content {
        grid-column: 1;
        grid-row: 3;
        margin-top: 3px;
    }

    .dashboard-deadline-action {
        grid-column: 2;
        grid-row: 1 / span 3;
    }
}
/* IGNIS_DASHBOARD_INSIGHTS_END */

/* IGNIS_DASHBOARD_SPACING_START */

/*
 * Abstand der Dashboard-Inhalte zum Seitenrand.
 */
.dashboard-overview-content {
    padding: 16px;
}

/*
 * Das Grid selbst benötigt keinen zusätzlichen Außenabstand,
 * da dieser jetzt vom Wrapper übernommen wird.
 */
.dashboard-overview-content .dashboard-insight-grid {
    margin: 0;
}

/*
 * Beide Dashboard-Bereiche erhalten einen einheitlichen,
 * klar sichtbaren Rahmen.
 */
.dashboard-overview-content .dashboard-insight-panel {
    border: 1px solid #d6e1e6;
    background: #ffffff;
    box-shadow: none;
}

/*
 * Etwas mehr Innenabstand innerhalb der beiden Bereiche.
 */
.dashboard-overview-content .ui-panel {
    padding: 16px;
}

@media (max-width: 680px) {
    .dashboard-overview-content {
        padding: 8px;
    }

    .dashboard-overview-content .ui-panel {
        padding: 12px;
    }
}

/* IGNIS_DASHBOARD_SPACING_END */

/* IGNIS_STATISTICS_PAGE_SPACING_START */

.incident-statistics-page {
    padding: 16px;
}

.incident-statistics-page
    > .incident-statistics-grid {
    margin: 0;
}

.incident-statistics-page
    > .ui-panel {
    margin: 0;
}

@media (max-width: 680px) {
    .incident-statistics-page {
        padding: 8px;
    }
}

/* IGNIS_STATISTICS_PAGE_SPACING_END */

/* IGNIS_STATISTICS_PANEL_PADDING_START */

/*
 * Innenabstand der Boxen auf der eigenständigen
 * Seite Einsatzstatistik.
 */
.incident-statistics-page .ui-panel {
    padding: 18px;
}

/*
 * Tabelleninhalt ebenfalls mit Abstand zum Rahmen.
 */
.incident-statistics-page .ui-table-wrapper {
    margin-top: 4px;
}

/*
 * Überschriften nicht direkt am oberen Boxrand.
 */
.incident-statistics-page
    .incident-statistics-heading,
.incident-statistics-page
    .incident-statistics-table-heading {
    margin-top: 0;
}

@media (max-width: 680px) {
    .incident-statistics-page .ui-panel {
        padding: 12px;
    }
}

/* IGNIS_STATISTICS_PANEL_PADDING_END */

/* IGNIS_STATISTICS_PIE_SIZE_START */

.incident-statistics-page
    .incident-statistics-chart-layout {
    grid-template-columns:
        minmax(260px, 300px)
        minmax(230px, 1fr);
}

.incident-statistics-page
    .incident-statistics-pie {
    width: 290px;
    max-width: 100%;
}

@media (max-width: 680px) {
    .incident-statistics-page
        .incident-statistics-chart-layout {
        grid-template-columns: 1fr;
    }

    .incident-statistics-page
        .incident-statistics-pie {
        width: 260px;
    }
}

/* IGNIS_STATISTICS_PIE_SIZE_END */
