.targets-history-top-grid {
    align-items: stretch;
}

.targets-history-top-grid > .mud-grid-item {
    display: flex;
}

.targets-history-page-shell {
    --targets-history-border: rgba(15, 23, 42, 0.08);
    --targets-history-soft-border: rgba(148, 163, 184, 0.16);
    --targets-history-card-bg: linear-gradient(180deg, #ffffff 0%, #fbfcff 100%);
    --targets-history-control-bg: #ffffff;
    --targets-history-muted-bg: #f8fafc;
    --targets-history-table-bg: #ffffff;
    --targets-history-text-primary: #0f172a;
    --targets-history-text-secondary: #475569;
    --targets-history-row-success: #E5F1E1;
    --targets-history-row-cancel-driver: #F7D2D6;
    --targets-history-row-cancel-no-driver: #FDE4C3;
    --targets-history-row-unhandled: #C9D9F1;
    --targets-history-row-no-customer: #FF9999;
    background: #f4f5fa;
    border-radius: 24px;
}

.targets-rides-page-root {
    min-height: calc(100vh - 96px);
    min-height: calc(100dvh - 96px);
    box-sizing: border-box;
}

.targets-history-filter-card {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    padding: 10px;
    border-radius: 22px;
    border: 1px solid var(--targets-history-border);
    background: var(--targets-history-card-bg);
    box-shadow: 0 18px 36px rgba(15, 23, 42, 0.08);
}

.targets-live-filter-card {
    height: auto;
    align-items: flex-start;
    padding: 12px;
}

.targets-live-filter-actions {
    align-items: center;
}

.driver-statistics-filter-card {
    height: auto;
    align-items: center;
    padding: 12px;
}

.driver-statistics-filter-grid {
    align-items: center;
}

.driver-statistics-filter-actions {
    align-items: center;
}

.driver-statistics-export-button {
    border-color: var(--targets-history-soft-border);
    color: var(--targets-history-text-primary);
    background: transparent;
}

.driver-statistics-tabs-summary-row {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 36px;
    margin: 18px 0;
}

.driver-statistics-tabs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 28px;
    margin: 0;
}

.driver-statistics-tab {
    min-width: 102px;
    height: 34px;
    padding: 0 16px;
    border: 0;
    border-radius: 6px;
    background: #53565c;
    color: #ffffff;
    font-family: "Quicksand", sans-serif;
    font-size: 0.86rem;
    font-weight: 700;
    line-height: 34px;
    cursor: pointer;
    transition: background-color 0.16s ease, transform 0.16s ease;
}

.driver-statistics-tab:hover {
    transform: translateY(-1px);
}

.driver-statistics-tab--active {
    background: #ff4747;
}

.driver-statistics-empty-tab {
    min-height: 180px;
    border-radius: 16px;
    border: 1px dashed var(--targets-history-soft-border);
    background: var(--targets-history-card-bg);
}

.driver-statistics-summary-cards {
    display: grid;
    grid-template-columns: repeat(4, minmax(130px, 1fr));
    gap: 20px;
    flex: 0 1 740px;
    max-width: 740px;
}

.driver-statistics-summary-card {
    min-height: 54px;
    padding: 10px 14px;
    border-radius: 8px;
    background: var(--targets-history-card-bg);
    border: 1px solid var(--targets-history-soft-border);
    font-family: "Quicksand", sans-serif;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.04);
}

.driver-statistics-summary-card strong {
    display: block;
    font-size: 0.88rem;
    font-weight: 800;
    line-height: 1.1;
    color: var(--targets-history-text-primary);
}

.driver-statistics-summary-card span {
    display: block;
    margin-top: 3px;
    font-size: 0.68rem;
    font-weight: 700;
    line-height: 1.15;
    color: var(--targets-history-text-primary);
}

.driver-statistics-performance-table {
    font-family: "Quicksand", sans-serif;
}

.driver-statistics-performance-table .mud-table-head .mud-table-cell {
    font-family: "Quicksand", sans-serif;
    font-weight: 700;
    color: var(--targets-history-text-primary);
    background: var(--targets-history-table-bg);
}

.driver-statistics-performance-table .mud-table-body .mud-table-cell {
    font-family: "Quicksand", sans-serif;
    font-weight: 600;
    color: var(--targets-history-text-primary);
}

.driver-statistics-detail-bubbles {
    display: grid;
    grid-template-columns: repeat(7, minmax(94px, 1fr));
    gap: 28px;
    padding: 24px 30px;
    background: var(--targets-history-table-bg);
}

.driver-statistics-detail-bubble {
    min-height: 56px;
    padding: 10px 12px;
    border-radius: 8px;
    background: var(--targets-history-muted-bg);
    border: 1px solid var(--targets-history-soft-border);
    font-family: "Quicksand", sans-serif;
}

.driver-statistics-detail-bubble strong {
    display: block;
    font-size: 0.82rem;
    font-weight: 800;
    line-height: 1.1;
    color: var(--targets-history-text-primary);
}

.driver-statistics-detail-bubble span {
    display: block;
    margin-top: 3px;
    font-size: 0.66rem;
    font-weight: 700;
    line-height: 1.15;
    color: var(--targets-history-text-secondary);
}

@media (max-width: 1100px) {
    .driver-statistics-tabs-summary-row {
        flex-direction: column;
        align-items: stretch;
    }

    .driver-statistics-summary-cards {
        flex: 0 0 auto;
        max-width: none;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
        grid-auto-rows: auto;
    }
}

@media (max-width: 600px) {
    .driver-statistics-tabs-summary-row {
        gap: 14px;
        margin: 14px 0;
    }

    .driver-statistics-tabs {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px 18px;
        width: 100%;
    }

    .driver-statistics-tab {
        width: 100%;
        min-width: 0;
    }

    .driver-statistics-summary-cards {
        flex: 0 0 auto;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
        width: 100%;
        align-items: start;
        grid-auto-rows: max-content;
    }

    .driver-statistics-summary-card {
        min-height: 0;
        height: auto;
        padding: 10px 14px;
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
    }

    .driver-statistics-summary-card strong {
        font-size: 0.86rem;
    }

    .driver-statistics-summary-card span {
        font-size: 0.72rem;
        line-height: 1.2;
    }

    .driver-statistics-empty-tab {
        min-height: 120px;
    }

    .driver-statistics-detail-bubbles {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
        padding: 14px;
    }
}

.targets-history-kpi-card {
    width: 100%;
    height: 100%;
    padding: 14px;
    border-radius: 22px;
    border: 1px solid var(--targets-history-border);
    background: var(--targets-history-card-bg);
    box-shadow: 0 18px 36px rgba(15, 23, 42, 0.08);
}

.targets-history-kpi-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.targets-history-kpi-tile {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-height: 66px;
    padding: 10px 12px;
    border-radius: 16px;
    background: var(--targets-history-muted-bg);
    border: 1px solid var(--targets-history-soft-border);
}

.targets-history-kpi-tile--success .targets-history-kpi-value {
    color: #22c55e;
}

.targets-history-kpi-tile--cancel .targets-history-kpi-value {
    color: #ff4d4f;
}

.targets-history-kpi-tile--unhandled .targets-history-kpi-value {
    color: #3b82f6;
}

.targets-history-kpi-value {
    font-family: "Quicksand", sans-serif;
    font-size: 0.92rem;
    font-weight: 700;
    line-height: 1.2;
    color: var(--targets-history-text-primary);
}

.targets-history-kpi-label {
    font-family: "Quicksand", sans-serif;
    font-size: 0.76rem;
    font-weight: 600;
    line-height: 1.25;
    color: var(--targets-history-text-secondary);
}

.targets-history-status-strip {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 10px;
    margin-top: 2px;
}

.targets-history-status-pill {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-height: 58px;
    padding: 9px 11px;
    border-radius: 14px;
    border: 1px solid var(--targets-history-soft-border);
    background: var(--targets-history-card-bg);
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.06);
}

.targets-history-status-value {
    font-family: "Quicksand", sans-serif;
    font-size: 0.88rem;
    font-weight: 700;
    line-height: 1.1;
    color: var(--targets-history-text-primary);
}

.targets-history-status-label {
    font-family: "Quicksand", sans-serif;
    font-size: 0.7rem;
    font-weight: 700;
    line-height: 1.2;
    color: var(--targets-history-text-primary);
}

.targets-history-status-pill--success .targets-history-status-value {
    color: #22c55e;
}

.targets-history-status-pill--cancel-driver .targets-history-status-value {
    color: #ef4444;
}

.targets-history-status-pill--cancel-no-driver .targets-history-status-value {
    color: #f59e0b;
}

.targets-history-status-pill--unhandled .targets-history-status-value {
    color: #3b82f6;
}

.targets-history-status-pill--no-customer .targets-history-status-value {
    color: #ef4444;
}

.targets-live-status-strip {
    grid-template-columns: repeat(8, minmax(0, 1fr));
}

.targets-history-filter-grid {
    width: 100% !important;
    margin: 0 !important;
    align-items: stretch;
    --targets-history-control-radius: 8px;
}

.targets-history-filter-grid > .mud-grid-item {
    padding-top: 4px !important;
    padding-left: 4px !important;
    padding-right: 4px !important;
    padding-bottom: 4px !important;
}

.targets-history-filter-control {
    width: 100%;
    --mud-default-borderradius: var(--targets-history-control-radius);
}

.targets-history-filter-control.mud-input-control,
.targets-history-filter-control .mud-input-control {
    margin-top: 0;
    margin-bottom: 0;
    font-family: "Quicksand", sans-serif;
}

.targets-history-filter-control.mud-input-control .mud-input-control-root,
.targets-history-filter-control.mud-input-control .mud-input-control-input-container,
.targets-history-filter-control .mud-input-control-root,
.targets-history-filter-control .mud-input-control-input-container {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

.targets-history-filter-control.mud-input-control .mud-input,
.targets-history-filter-control.mud-input-control .mud-input-outlined,
.targets-history-filter-control.mud-input-control .mud-input-root,
.targets-history-filter-control.mud-input-control .mud-input-outlined-border,
.targets-history-filter-control .mud-input,
.targets-history-filter-control .mud-input-outlined,
.targets-history-filter-control .mud-input-root,
.targets-history-filter-control .mud-input-outlined-border {
    border-radius: var(--targets-history-control-radius) !important;
}

.targets-history-filter-control.mud-input-control .mud-input-outlined-border,
.targets-history-filter-control .mud-input-outlined-border {
    border-color: var(--targets-history-soft-border);
}

.targets-history-filter-control.mud-input-control .mud-input-slot,
.targets-history-filter-control .mud-input-slot {
    height: 32px;
    min-height: 32px;
    border-radius: var(--targets-history-control-radius);
    background: var(--targets-history-control-bg);
    align-items: center;
    padding-top: 0;
    padding-bottom: 0;
}

.targets-history-filter-control .mud-input-label {
    font-family: "Quicksand", sans-serif;
    font-weight: 600;
    width: 100%;
    text-align: center;
    color: var(--targets-history-text-primary);
}

.targets-history-filter-control .mud-input > input,
.targets-history-filter-control .mud-select-input {
    text-align: center;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    line-height: 32px;
    color: var(--targets-history-text-primary);
}

.targets-history-filter-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding-top: 0;
}

.targets-history-filter-button {
    min-width: 116px;
    height: 32px;
    border-radius: var(--targets-history-control-radius);
    font-family: "Quicksand", sans-serif;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    box-shadow: none;
}

.targets-history-filter-button--primary {
    background: linear-gradient(180deg, #ff5f5f 0%, #ff4343 100%);
}

.targets-history-filter-button--secondary {
    border-color: #ff5f5f;
    color: #ff5f5f;
    background: transparent;
}

.targets-history-filter-card .dashboard-period-picker--compact {
    width: 100%;
}

.targets-history-filter-card .dashboard-period-picker--compact .home-period-summary {
    display: flex;
    width: 100%;
    border-radius: var(--targets-history-control-radius);
    border: 1px solid var(--targets-history-soft-border);
    box-shadow: none;
}

.targets-history-filter-card .dashboard-period-picker--compact .home-period-label {
    width: 100%;
    min-height: 32px;
    gap: 6px;
    padding: 0 6px;
    border-radius: var(--targets-history-control-radius);
    font-family: "Quicksand", sans-serif;
    font-size: 0.86rem;
    font-weight: 600;
    justify-content: center;
    text-align: center;
    white-space: normal;
    color: var(--targets-history-text-primary);
}

.targets-history-filter-card .dashboard-period-picker--compact .home-period-label span {
    min-width: 0;
    line-height: 1.15;
    overflow: visible;
    text-overflow: clip;
    overflow-wrap: anywhere;
}

.targets-history-filter-card .dashboard-period-picker--compact .home-period-label .mud-icon-root {
    flex: 0 0 auto;
    font-size: 1.02rem;
}

.targets-history-filter-card .dashboard-period-picker--compact .home-period-label--trigger:hover {
    box-shadow: none;
}

.targets-history-table {
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid var(--targets-history-border);
    background: var(--targets-history-table-bg);
    box-shadow: 0 18px 36px rgba(15, 23, 42, 0.06);
}

.targets-history-table .mud-table-container,
.targets-history-table .mud-data-grid {
    border-radius: 20px;
}

.targets-preorder-grid.mud-data-grid,
.targets-preorder-grid .mud-data-grid,
.targets-preorder-grid .mud-table-container {
    background: var(--targets-history-table-bg) !important;
}

.targets-history-table .mud-table-container {
    overflow-x: auto;
    overflow-y: hidden;
}

.targets-history-table .targets-history-amount-header,
.targets-history-table .targets-history-amount-cell {
    min-width: 118px;
    width: 118px;
    text-align: right;
    vertical-align: middle;
}

.targets-history-table .targets-history-actions-header,
.targets-history-table .targets-history-actions-cell {
    width: 92px;
    min-width: 92px;
    max-width: 92px;
    padding-left: 8px !important;
    padding-right: 10px !important;
    vertical-align: middle;
}

.targets-history-table .targets-history-actions-header--wide,
.targets-history-table .targets-history-actions-cell--wide {
    width: 132px;
    min-width: 132px;
    max-width: 132px;
}

.targets-history-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    min-height: 42px;
    width: 100%;
}

.targets-history-action-icon {
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
    padding: 0 !important;
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.04);
}

.targets-history-action-icon--invoice {
    color: #ff5f5f;
    background: rgba(255, 95, 95, 0.12);
}

.targets-new-history-detail-row {
    position: relative;
}

.targets-new-history-note-action {
    flex: 0 0 auto;
}

.targets-new-history-note-action--add {
    display: flex;
    justify-content: flex-start;
}

.targets-new-history-note-action .mud-button-root {
    min-width: 118px;
    height: 34px;
    border-radius: 10px;
    font-family: "Quicksand", sans-serif;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: none;
}

.targets-new-history-note-preview {
    width: min(520px, 100%);
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid var(--targets-history-soft-border);
    background: color-mix(in srgb, var(--targets-history-control-bg) 88%, rgba(34, 197, 94, 0.08));
}

.targets-new-history-note-preview-row {
    display: flex;
    align-items: stretch;
    gap: 12px;
    width: min(660px, 100%);
}

.targets-new-history-note-preview-row .targets-new-history-note-preview {
    flex: 1 1 auto;
    width: auto;
}

.targets-new-history-note-editor {
    width: min(520px, 100%);
}

.targets-new-history-note-editor-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    width: min(520px, 100%);
    margin-top: 10px;
}

.targets-new-history-note-preview__label {
    margin-bottom: 4px;
    font-family: "Quicksand", sans-serif;
    font-size: 0.76rem;
    font-weight: 700;
    color: var(--targets-history-text-secondary);
}

.targets-new-history-note-preview__text {
    white-space: pre-wrap;
    word-break: break-word;
    font-family: "Quicksand", sans-serif;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--targets-history-text-primary);
}

body.mud-theme-dark .targets-history-page-shell,
body.mud-theme-dark .targets-rides-page-root,
.mud-theme-dark .targets-history-page-shell,
.mud-theme-dark .targets-rides-page-root {
    --targets-history-border: rgba(148, 163, 184, 0.18);
    --targets-history-soft-border: rgba(148, 163, 184, 0.22);
    --targets-history-card-bg: linear-gradient(180deg, #30313c 0%, #292a34 100%);
    --targets-history-control-bg: #2a2b35;
    --targets-history-muted-bg: #252631;
    --targets-history-table-bg: #2a2b35;
    --targets-history-text-primary: var(--mud-palette-text-primary);
    --targets-history-text-secondary: var(--mud-palette-text-secondary);
    --targets-history-row-success: #233a2e;
    --targets-history-row-cancel-driver: #432b33;
    --targets-history-row-cancel-no-driver: #453626;
    --targets-history-row-unhandled: #24364d;
    --targets-history-row-no-customer: #4b2b32;
    background: var(--mud-palette-background);
    color: var(--targets-history-text-primary);
}

body.mud-theme-dark .targets-history-filter-card,
.mud-theme-dark .targets-history-filter-card,
body.mud-theme-dark .targets-history-kpi-card,
.mud-theme-dark .targets-history-kpi-card {
    border-color: var(--targets-history-border);
    background: var(--targets-history-card-bg);
    box-shadow: 0 16px 34px rgba(0, 0, 0, 0.24);
}

body.mud-theme-dark .targets-history-filter-control .mud-input-slot,
.mud-theme-dark .targets-history-filter-control .mud-input-slot,
body.mud-theme-dark .targets-history-kpi-tile,
.mud-theme-dark .targets-history-kpi-tile,
body.mud-theme-dark .targets-history-status-pill,
.mud-theme-dark .targets-history-status-pill,
body.mud-theme-dark .targets-history-filter-card .dashboard-period-picker--compact .home-period-summary,
.mud-theme-dark .targets-history-filter-card .dashboard-period-picker--compact .home-period-summary {
    background: var(--targets-history-control-bg);
    border-color: var(--targets-history-soft-border);
}

body.mud-theme-dark .targets-history-filter-control .mud-input-outlined-border,
.mud-theme-dark .targets-history-filter-control .mud-input-outlined-border {
    border-color: var(--targets-history-soft-border);
}

body.mud-theme-dark .targets-history-filter-control .mud-input-label,
body.mud-theme-dark .targets-history-filter-control .mud-input > input,
body.mud-theme-dark .targets-history-filter-control .mud-select-input,
body.mud-theme-dark .targets-history-filter-control .mud-input-adornment,
body.mud-theme-dark .targets-history-filter-control .mud-icon-root,
body.mud-theme-dark .targets-history-filter-card .dashboard-period-picker--compact .home-period-label,
body.mud-theme-dark .targets-history-filter-card .dashboard-period-picker--compact .home-period-label .mud-icon-root,
.mud-theme-dark .targets-history-filter-control .mud-input-label,
.mud-theme-dark .targets-history-filter-control .mud-input > input,
.mud-theme-dark .targets-history-filter-control .mud-select-input,
.mud-theme-dark .targets-history-filter-control .mud-input-adornment,
.mud-theme-dark .targets-history-filter-control .mud-icon-root,
.mud-theme-dark .targets-history-filter-card .dashboard-period-picker--compact .home-period-label,
.mud-theme-dark .targets-history-filter-card .dashboard-period-picker--compact .home-period-label .mud-icon-root {
    color: var(--targets-history-text-primary);
}

body.mud-theme-dark .targets-history-filter-control .mud-input > input::placeholder,
.mud-theme-dark .targets-history-filter-control .mud-input > input::placeholder {
    color: var(--targets-history-text-secondary);
    opacity: 1;
}

body.mud-theme-dark .targets-history-table,
.mud-theme-dark .targets-history-table,
body.mud-theme-dark .targets-history-table .mud-table-container,
.mud-theme-dark .targets-history-table .mud-table-container,
body.mud-theme-dark .targets-history-table .mud-data-grid,
.mud-theme-dark .targets-history-table .mud-data-grid {
    border-color: var(--targets-history-border);
    background: var(--targets-history-table-bg);
    color: var(--targets-history-text-primary);
}

body.mud-theme-dark .targets-history-table .mud-table-head,
body.mud-theme-dark .targets-history-table .mud-table-cell,
body.mud-theme-dark .targets-history-table .mud-data-grid-header,
body.mud-theme-dark .targets-history-table .mud-data-grid-header-cell,
body.mud-theme-dark .targets-history-table .mud-data-grid-cell,
.mud-theme-dark .targets-history-table .mud-table-head,
.mud-theme-dark .targets-history-table .mud-table-cell,
.mud-theme-dark .targets-history-table .mud-data-grid-header,
.mud-theme-dark .targets-history-table .mud-data-grid-header-cell,
.mud-theme-dark .targets-history-table .mud-data-grid-cell {
    border-color: var(--targets-history-border);
    color: var(--targets-history-text-primary);
}

body.mud-theme-dark .targets-history-table .mud-table-row:hover,
body.mud-theme-dark .targets-history-table .mud-data-grid-row:hover,
.mud-theme-dark .targets-history-table .mud-table-row:hover,
.mud-theme-dark .targets-history-table .mud-data-grid-row:hover {
    filter: brightness(1.08);
}

body.mud-theme-dark .live-rides-grid .mud-table-body .mud-table-cell:not(.targets-history-actions-cell),
body.mud-theme-dark .live-rides-grid .mud-table-body .mud-table-cell:not(.targets-history-actions-cell) *,
body.mud-theme-dark .live-rides-grid tbody .mud-table-cell:not(.targets-history-actions-cell),
body.mud-theme-dark .live-rides-grid tbody .mud-table-cell:not(.targets-history-actions-cell) *,
.mud-theme-dark .live-rides-grid .mud-table-body .mud-table-cell:not(.targets-history-actions-cell),
.mud-theme-dark .live-rides-grid .mud-table-body .mud-table-cell:not(.targets-history-actions-cell) *,
.mud-theme-dark .live-rides-grid tbody .mud-table-cell:not(.targets-history-actions-cell),
.mud-theme-dark .live-rides-grid tbody .mud-table-cell:not(.targets-history-actions-cell) *,
.dashboard-dark-mode .live-rides-grid .mud-table-body .mud-table-cell:not(.targets-history-actions-cell),
.dashboard-dark-mode .live-rides-grid .mud-table-body .mud-table-cell:not(.targets-history-actions-cell) *,
.dashboard-dark-mode .live-rides-grid tbody .mud-table-cell:not(.targets-history-actions-cell),
.dashboard-dark-mode .live-rides-grid tbody .mud-table-cell:not(.targets-history-actions-cell) * {
    color: #111827 !important;
    -webkit-text-fill-color: #111827 !important;
}

body.mud-theme-dark .targets-history-action-icon,
.mud-theme-dark .targets-history-action-icon {
    background: rgba(148, 163, 184, 0.14);
    color: var(--targets-history-text-primary);
}

body.mud-theme-dark .targets-history-action-icon--invoice,
.mud-theme-dark .targets-history-action-icon--invoice {
    background: rgba(255, 95, 95, 0.2);
    color: #fb7185;
}

body.mud-theme-dark .targets-history-kpi-value,
.mud-theme-dark .targets-history-kpi-value {
    color: var(--targets-history-text-primary);
}

body.mud-theme-dark .targets-history-kpi-label,
.mud-theme-dark .targets-history-kpi-label,
body.mud-theme-dark .targets-history-status-label,
.mud-theme-dark .targets-history-status-label {
    color: var(--targets-history-text-secondary);
}

body.mud-theme-dark .targets-history-status-value,
.mud-theme-dark .targets-history-status-value {
    color: var(--targets-history-text-primary);
}

body.mud-theme-dark .targets-history-kpi-tile--success .targets-history-kpi-value,
.mud-theme-dark .targets-history-kpi-tile--success .targets-history-kpi-value {
    color: #4ade80;
}

body.mud-theme-dark .targets-history-kpi-tile--cancel .targets-history-kpi-value,
.mud-theme-dark .targets-history-kpi-tile--cancel .targets-history-kpi-value {
    color: #f87171;
}

body.mud-theme-dark .targets-history-kpi-tile--unhandled .targets-history-kpi-value,
.mud-theme-dark .targets-history-kpi-tile--unhandled .targets-history-kpi-value {
    color: #60a5fa;
}

body.mud-theme-dark .targets-history-status-pill--success .targets-history-status-value,
.mud-theme-dark .targets-history-status-pill--success .targets-history-status-value {
    color: #4ade80;
}

body.mud-theme-dark .targets-history-status-pill--cancel-driver .targets-history-status-value,
.mud-theme-dark .targets-history-status-pill--cancel-driver .targets-history-status-value {
    color: #f87171;
}

body.mud-theme-dark .targets-history-status-pill--cancel-no-driver .targets-history-status-value,
.mud-theme-dark .targets-history-status-pill--cancel-no-driver .targets-history-status-value {
    color: #fbbf24;
}

body.mud-theme-dark .targets-history-status-pill--unhandled .targets-history-status-value,
.mud-theme-dark .targets-history-status-pill--unhandled .targets-history-status-value {
    color: #60a5fa;
}

.dashboard-dark-mode .targets-history-page-shell,
.dashboard-dark-mode .targets-rides-page-root {
    --targets-history-border: rgba(148, 163, 184, 0.18);
    --targets-history-soft-border: rgba(148, 163, 184, 0.22);
    --targets-history-card-bg: linear-gradient(180deg, #30313c 0%, #292a34 100%);
    --targets-history-control-bg: #2a2b35;
    --targets-history-muted-bg: #252631;
    --targets-history-table-bg: #2a2b35;
    --targets-history-text-primary: var(--mud-palette-text-primary);
    --targets-history-text-secondary: var(--mud-palette-text-secondary);
    --targets-history-row-success: #233a2e;
    --targets-history-row-cancel-driver: #432b33;
    --targets-history-row-cancel-no-driver: #453626;
    --targets-history-row-unhandled: #24364d;
    --targets-history-row-no-customer: #4b2b32;
    background: var(--mud-palette-background);
    color: var(--targets-history-text-primary);
}

.dashboard-dark-mode .targets-history-filter-card,
.dashboard-dark-mode .targets-history-kpi-card {
    border-color: var(--targets-history-border);
    background: var(--targets-history-card-bg);
    box-shadow: 0 16px 34px rgba(0, 0, 0, 0.24);
}

.dashboard-dark-mode .targets-history-filter-control .mud-input-slot,
.dashboard-dark-mode .targets-history-kpi-tile,
.dashboard-dark-mode .targets-history-status-pill,
.dashboard-dark-mode .targets-history-filter-card .dashboard-period-picker--compact .home-period-summary {
    background: var(--targets-history-control-bg);
    border-color: var(--targets-history-soft-border);
}

.dashboard-dark-mode .targets-history-filter-control .mud-input-outlined-border {
    border-color: var(--targets-history-soft-border);
}

.dashboard-dark-mode .targets-history-filter-control .mud-input-label,
.dashboard-dark-mode .targets-history-filter-control .mud-input > input,
.dashboard-dark-mode .targets-history-filter-control .mud-select-input,
.dashboard-dark-mode .targets-history-filter-control .mud-input-adornment,
.dashboard-dark-mode .targets-history-filter-control .mud-icon-root,
.dashboard-dark-mode .targets-history-filter-card .dashboard-period-picker--compact .home-period-label,
.dashboard-dark-mode .targets-history-filter-card .dashboard-period-picker--compact .home-period-label .mud-icon-root,
.dashboard-dark-mode .targets-history-kpi-value,
.dashboard-dark-mode .targets-history-status-value {
    color: var(--targets-history-text-primary);
}

.dashboard-dark-mode .targets-history-filter-control .mud-input > input::placeholder,
.dashboard-dark-mode .targets-history-kpi-label,
.dashboard-dark-mode .targets-history-status-label {
    color: var(--targets-history-text-secondary);
    opacity: 1;
}

.dashboard-dark-mode .targets-history-table,
.dashboard-dark-mode .targets-history-table .mud-table-container,
.dashboard-dark-mode .targets-history-table .mud-data-grid {
    border-color: var(--targets-history-border);
    background: var(--targets-history-table-bg);
    color: var(--targets-history-text-primary);
}

.dashboard-dark-mode .targets-history-table .mud-table-head,
.dashboard-dark-mode .targets-history-table .mud-table-cell,
.dashboard-dark-mode .targets-history-table .mud-data-grid-header,
.dashboard-dark-mode .targets-history-table .mud-data-grid-header-cell,
.dashboard-dark-mode .targets-history-table .mud-data-grid-cell {
    border-color: var(--targets-history-border);
    color: var(--targets-history-text-primary);
}

.dashboard-dark-mode .targets-history-table .mud-table-row:hover,
.dashboard-dark-mode .targets-history-table .mud-data-grid-row:hover {
    filter: brightness(1.08);
}

.dashboard-dark-mode .targets-history-action-icon {
    background: rgba(148, 163, 184, 0.14);
    color: var(--targets-history-text-primary);
}

.dashboard-dark-mode .targets-history-action-icon--invoice {
    background: rgba(255, 95, 95, 0.2);
    color: #fb7185;
}

.dashboard-dark-mode .targets-history-kpi-tile--success .targets-history-kpi-value,
.dashboard-dark-mode .targets-history-status-pill--success .targets-history-status-value {
    color: #4ade80;
}

.dashboard-dark-mode .targets-history-kpi-tile--cancel .targets-history-kpi-value,
.dashboard-dark-mode .targets-history-status-pill--cancel-driver .targets-history-status-value,
.dashboard-dark-mode .targets-history-status-pill--no-customer .targets-history-status-value {
    color: #f87171;
}

.dashboard-dark-mode .targets-history-kpi-tile--unhandled .targets-history-kpi-value,
.dashboard-dark-mode .targets-history-status-pill--unhandled .targets-history-status-value {
    color: #60a5fa;
}

.dashboard-dark-mode .targets-history-status-pill--cancel-no-driver .targets-history-status-value {
    color: #fbbf24;
}

@media (max-width: 959.98px) {
    .targets-history-filter-card .dashboard-period-picker--compact .home-period-label {
        font-size: clamp(0.68rem, 2.6vw, 0.78rem);
        min-height: 38px;
    }

    .targets-history-filter-card .dashboard-period-picker--compact .home-period-label .mud-icon-root {
        font-size: 0.95rem;
    }

    .targets-history-filter-card {
        padding: 16px;
        border-radius: 18px;
    }

    .targets-history-kpi-card {
        padding: 16px;
        border-radius: 18px;
    }

    .targets-history-kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    .targets-history-kpi-tile {
        min-height: 72px;
        padding: 11px 12px;
    }

    .targets-history-status-strip {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    .targets-live-status-strip {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .targets-history-status-pill {
        min-height: 62px;
        padding: 10px 12px;
    }

    .targets-history-filter-button {
        flex: 1 1 0;
        min-width: 0;
    }

    .targets-new-history-detail-row {
        padding-right: 16px !important;
    }

    .targets-new-history-note-preview-row {
        flex-direction: column;
    }

    .targets-new-history-note-action,
    .targets-new-history-note-action--add {
        display: flex;
        justify-content: flex-start;
    }
}
