html, body {
    margin: 0;
    min-height: 100%;
    font-family: Inter, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: #F4F7FA;
    color: #1E293B;
}

body {
    color-scheme: light only;
}

h1:focus {
    outline: none;
}

a, .btn-link {
    color: #145DA0;
}

.btn-primary,
.corporate-button-primary {
    background: #145DA0;
    color: #FFFFFF;
    border-radius: 12px;
    padding: 10px 18px;
    font-weight: 600;
    border: none;
}

.btn-primary:hover,
.corporate-button-primary:hover {
    background: #0B4F8A;
    color: #FFFFFF;
}

.btn-secondary,
.corporate-button-secondary {
    background: #EAF4FB;
    color: #145DA0;
    border-radius: 12px;
    padding: 10px 18px;
    font-weight: 600;
    border: 1px solid #B8DDF2;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
    box-shadow: 0 0 0 3px rgba(46, 139, 192, 0.15);
}

.form-control {
    border: 1px solid #DDE5EE;
    border-radius: 12px;
    padding: 11px 14px;
    background: #FFFFFF;
    color: #1E293B;
}

.form-control:focus {
    border-color: #2E8BC0;
}

code {
    color: #c02d76;
}

.card-surface,
.table-wrapper {
    background: #FFFFFF;
    border: 1px solid #DDE5EE;
    border-radius: 18px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

.dashboard-page {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.dashboard-page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.dashboard-page-header__title h2 {
    margin: 0;
    font-size: 1.75rem;
    font-weight: 700;
    color: #0B1F3A;
}

.dashboard-page-header__title p {
    margin: 0.5rem 0 0;
    color: #64748B;
}

.dashboard-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.dashboard-filter-bar {
    position: sticky;
    top: 88px;
    z-index: 5;
}

.dashboard-filter-card {
    padding: 1.25rem;
}

.dashboard-filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    border-radius: 999px;
    padding: 6px 12px;
    background: #EAF4FB;
    color: #145DA0;
    font-size: 0.875rem;
    font-weight: 600;
    border: 1px solid #B8DDF2;
}

.kpi-card {
    padding: 1.25rem;
    height: 100%;
}

.kpi-card__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.kpi-card__icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: #EAF4FB;
    color: #145DA0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.kpi-card__label {
    font-size: 14px;
    color: #64748B;
    margin-bottom: 0.4rem;
}

.kpi-card__value {
    font-size: 32px;
    font-weight: 700;
    color: #0B1F3A;
    line-height: 1.1;
}

.kpi-breakdown-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.65rem;
}

.kpi-breakdown-tile {
    border: 1px solid #D9E5F4;
    border-radius: 10px;
    background: #F8FBFF;
    padding: 0.6rem;
    min-height: 88px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.kpi-breakdown-tile__title {
    color: #145DA0;
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1.2;
}

.kpi-breakdown-tile__value {
    color: #0B1F3A;
    font-size: 1.4rem;
    font-weight: 700;
    line-height: 1.1;
}

.kpi-breakdown-tile__caption {
    color: #64748B;
    font-size: 0.72rem;
    line-height: 1.2;
}

@media (max-width: 767.98px) {
    .kpi-breakdown-grid {
        grid-template-columns: 1fr;
    }
}

.kpi-card__support {
    margin-top: 0.5rem;
    color: #64748B;
    font-size: 0.875rem;
}

.section-card {
    padding: 1.25rem;
}

.section-card__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.section-card__title {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: #0B1F3A;
}

.section-card__subtitle {
    margin: 0.35rem 0 0;
    color: #64748B;
    font-size: 0.925rem;
}

.badge {
    border-radius: 999px;
    padding: 5px 10px;
    font-size: 12px;
    font-weight: 600;
}

.badge-success {
    background: #DCFCE7;
    color: #166534;
}

.badge-warning {
    background: #FEF3C7;
    color: #92400E;
}

.badge-danger {
    background: #FEE2E2;
    color: #991B1B;
}

.badge-info {
    background: #DBEAFE;
    color: #1D4ED8;
}

.table-wrapper {
    overflow: hidden;
}

.map-placeholder {
    min-height: 320px;
    border-radius: 18px;
    border: 1px dashed #B8DDF2;
    background: linear-gradient(135deg, rgba(234, 244, 251, 0.9), rgba(255, 255, 255, 0.98));
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.map-placeholder__grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
}

.map-placeholder__cell {
    min-height: 72px;
    border-radius: 16px;
    background: rgba(20, 93, 160, 0.08);
    border: 1px solid rgba(20, 93, 160, 0.12);
}

.report-list {
    display: grid;
    gap: 1rem;
}

.report-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.1rem;
    border-radius: 16px;
    border: 1px solid #DDE5EE;
    background: #FFFFFF;
}

.report-item__meta {
    color: #64748B;
    font-size: 0.9rem;
}

.empty-state {
    padding: 2rem;
    text-align: center;
    color: #64748B;
}

.trip-detail-map {
    min-height: 360px;
    height: 48vh;
    border-radius: 14px;
    border: 1px solid #DDE5EE;
    overflow: hidden;
}

.trip-detail-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.trip-detail-legend__item {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: #475569;
    font-size: 0.875rem;
}

.trip-detail-legend__dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    display: inline-block;
}

.trip-detail-legend__dot--visit {
    background: #3B82F6;
}

.trip-detail-legend__dot--start {
    background: #22C55E;
}

.trip-detail-legend__dot--end {
    background: #EF4444;
}

#blazor-error-ui {
    color-scheme: light only;
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

.blazor-error-boundary {
    background: #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

.blazor-error-boundary::after {
    content: "An error has occurred.";
}

.loading-progress {
    position: absolute;
    display: block;
    width: 8rem;
    height: 8rem;
    inset: 20vh 0 auto 0;
    margin: 0 auto;
}

.loading-progress circle {
    fill: none;
    stroke: #e0e0e0;
    stroke-width: 0.6rem;
    transform-origin: 50% 50%;
    transform: rotate(-90deg);
}

.loading-progress circle:last-child {
    stroke: #145DA0;
    stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
    transition: stroke-dasharray 0.05s ease-in-out;
}

.loading-progress-text {
    position: absolute;
    text-align: center;
    font-weight: bold;
    inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
}

.loading-progress-text:after {
    content: var(--blazor-load-percentage-text, "Loading");
}

@media (max-width: 991.98px) {
    .dashboard-filter-bar {
        top: 0;
    }
}

@media (max-width: 767.98px) {
    .dashboard-page-header,
    .section-card__header,
    .report-item {
        flex-direction: column;
        align-items: stretch;
    }

    .map-placeholder__grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 575.98px) {
    .map-placeholder__grid {
        grid-template-columns: 1fr;
    }
}