﻿
html {
    font-size: 14px; /* 默认：1rem = 14px */
}

.mud-main-content {
    height: 100%;
    min-height: 100vh;
    display: flex;
}

.mud-chip.mud-chip-size-medium {
    font-size: var(--mud-typography-default-size) !important;
}

.mud-chip.mud-chip-size-small {
    font-size: var(--mud-typography-body2-size) !important;
}

.mud-chip {
    font-size: var(--mud-typography-default-size);
}

.mud-tabs {
    background-color: var(--mud-palette-surface);
}

.mud-input-control-margin-dense .mud-input > input.mud-input-root,
.mud-input-control-margin-dense div.mud-input-slot.mud-input-root {
    font-size: 0.90em;
}

.mud-input-control > .mud-input-control-input-container > .mud-input-label-inputcontrol {
    font-size: var(--mud-typography-default-size) !important;
}


.mud-simple-table table * tr > td, .mud-simple-table table * tr th {
    font-size: var(--mud-typography-default-size) !important;
}

.mud-expand-panel .mud-expand-panel-header {
    font-size: var(--mud-typography-default-size) !important;
}

.mud-button-year {
    font-size: var(--mud-typography-default-size) !important;
}

.mud-table-cell {
    font-size: var(--mud-typography-default-size) !important;
}

.mud-table-dense .mud-table-cell {
    font-size: var(--mud-typography-body2-size) !important;
}


.mud-button-outlined-size-small {
    font-size: var(--mud-typography-body2-size);
}

.mud-grid.readonly-grid > .mud-grid-item {
    border-bottom: 1px solid var(--mud-palette-table-lines);
    padding-bottom: 2px;
}

.mud-nav-link {
    white-space: normal !important;
}

.user-button {
    text-transform: none;
    background: rgba(var(--mud-palette-primary-rgb), 0.1)
}

.side-menu .mud-chip.mud-chip-size-small {
    font-size: 0.625rem;
    height: 1.125rem;
}

.mud-table.mud-data-grid .mud-toolbar {
    height: auto !important;
    padding: 1rem
}


.mud-table.mud-data-grid .mud-toolbar-gutters {
    height: auto !important;
    padding: 1rem
}

.mud-table.mud-data-grid .mud-table-toolbar {
    height: auto !important;
    padding: 1rem
}

.mud-table.mud-data-grid .mud-table-pagination-toolbar {
    height: auto !important;
    padding: 0rem !important;
}


.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.g-recaptcha-wrapper {
    display: flex;
    justify-content: flex-start;
    margin-top: 5px;
    margin-bottom: 5px;
}

.g-recaptcha {
    transform: scale(0.85);
    transform-origin: left;
    margin-left: 0 !important;
    margin-right: 0 !important;
    width: auto !important;
    display: block;
}
/*add on shivani*/
.mud-expansion-panel .mud-expand-panel-header[aria-expanded="false"] {
    pointer-events: none !important;
}

.media-viewer-panel .mud-expansion-panel-content {
    display: block !important;
    max-height: none !important;
}
/* =========================================================
   TRAFFICSPHERE COMMAND CENTER THEME
   ========================================================= */

.trafficsphere-dashboard {
    background: var(--mud-palette-background);
    min-height: 100vh;
    padding: 12px 15px 15px;
    color: var(--mud-palette-text-primary);
}

    /* =========================================================
   KPI ROW
   ========================================================= */

    .trafficsphere-dashboard .kpi-row {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 12px;
        margin-bottom: 15px;
    }

    .trafficsphere-dashboard .kpi-card {
        background: var(--mud-palette-surface);
        color: var(--mud-palette-text-primary);
        border-radius: 12px;
        text-align: center;
        height: 104px;
        gap: 2px;
        padding: 12px 8px;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        border-left: 4px solid transparent;
        transition: border-color .3s ease;
    }

    .trafficsphere-dashboard .kpi-icon {
        font-size: 22px;
        opacity: .85;
        margin-bottom: 2px;
        line-height: 1;
    }

    .trafficsphere-dashboard .kpi-value {
        font-size: 28px;
        font-weight: 700;
        color: var(--mud-palette-text-primary);
        line-height: 1.1;
    }

    .trafficsphere-dashboard .kpi-label {
        opacity: .8;
        font-size: 10px;
        line-height: 1.2;
    }

    /* Static (non-tiered) card accent colors */
    .trafficsphere-dashboard .critical {
        border-left-color: #ef4444;
    }

    .trafficsphere-dashboard .speed {
        border-left-color: #f59e0b;
    }

    .trafficsphere-dashboard .ai {
        border-left-color: #8b5cf6;
    }

    /* =========================================================
   HEALTH TIERS (Corridor / Device Health / Devices Online)
   >=91 green | 71-90 orange | <71 yellow
   ========================================================= */

    .trafficsphere-dashboard .kpi-card.tier-high {
        border-left-color: #22c55e;
    }

    .trafficsphere-dashboard .kpi-card.tier-mid {
        border-left-color: #f59e0b;
    }

    .trafficsphere-dashboard .kpi-card.tier-low {
        border-left-color: #ef4444;
    }

    /* Tier-based VALUE TEXT colors — applies to 36, 55.4%, 55.4% etc. */
    .trafficsphere-dashboard .kpi-card.tier-high .kpi-value {
        color: #22c55e !important;
    }

    .trafficsphere-dashboard .kpi-card.tier-mid .kpi-value {
        color: #f59e0b !important;
    }

    .trafficsphere-dashboard .kpi-card.tier-low .kpi-value {
        color: #ef4444 !important;
    }

    .trafficsphere-dashboard .health-progress {
        width: 100%;
        height: 6px;
        border-radius: 4px;
        background: var(--mud-palette-table-lines);
        margin-top: 6px;
        overflow: hidden;
    }

    .trafficsphere-dashboard .health-progress-fill {
        height: 100%;
        border-radius: 4px;
        transition: width .4s ease, background-color .3s ease;
    }

        .trafficsphere-dashboard .health-progress-fill.tier-high {
            background: #22c55e;
        }

        .trafficsphere-dashboard .health-progress-fill.tier-mid {
            background: #f59e0b;
        }

        .trafficsphere-dashboard .health-progress-fill.tier-low {
            background: #ef4444;
        }

    /* =========================================================
   MAP + INCIDENTS
   ========================================================= */

    .trafficsphere-dashboard .command-center-layout {
        display: grid;
        grid-template-columns: 70% 30%;
        gap: 15px;
        margin-bottom: 15px;
    }

    .trafficsphere-dashboard .map-panel,
    .trafficsphere-dashboard .incident-panel {
        background: var(--mud-palette-surface);
        color: var(--mud-palette-text-primary);
        border-radius: 12px;
    }

    .trafficsphere-dashboard .panel-header {
        padding: 12px 15px;
        font-weight: 600;
        font-size: 20px;
        color: var(--mud-palette-text-primary);
        border-bottom: 1px solid var(--mud-palette-lines-default);
    }

    .trafficsphere-dashboard #map {
        height: 650px;
    }

    .trafficsphere-dashboard .incident-panel {
        overflow-y: auto;
        max-height: 700px;
        padding: 10px;
    }

    .trafficsphere-dashboard .incident-card-row {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 8px 12px;
    }

    .trafficsphere-dashboard .incident-card-action {
        display: flex;
        align-items: center;
        gap: 4px;
    }

    .trafficsphere-dashboard .incident-media-buttons {
        display: flex;
        gap: 2px;
    }

    .trafficsphere-dashboard .incident-card {
        background: var(--mud-palette-background-grey);
        margin-bottom: 10px;
        border-left: 4px solid #eab308;
        color: var(--mud-palette-text-primary);
    }
    .incident-title {
        display: flex;
        align-items: center;
        gap: 6px;
        flex-wrap: wrap;
    }

    /*.dispatch-text-btn {
        border-radius: 999px !important;
        min-width: 85px;
        height: 28px;
        font-size: 11px;
        font-weight: 700;
        text-transform: none;*/
        /*color: #dc2626 !important;*/
        /*background: rgba(220, 38, 38, 0.12) !important;
        border: 1px solid rgba(220, 38, 38, 0.25) !important;
        animation: dispatchBlink 1.2s infinite;
    }*/
.dispatch-text-btn {
    border-radius: 999px !important;
    min-width: 85px;
    height: 28px;
    font-size: 11px;
    font-weight: 700;
    text-transform: none;
    background: rgba(220, 38, 38, 0.12) !important;
    border: 1px solid rgba(220, 38, 38, 0.25) !important;
  /*  color: #dc2626 !important;*/
    animation: dispatchBlink 1.2s infinite;
}

    /* MudBlazor label */
  /*  .dispatch-text-btn .mud-button-label {
        color: #dc2626 !important;
    }*/

/* MudBlazor button root */
/*button.dispatch-text-btn {
    color: #dc2626 !important;
}*/
.mud-theme-light .dispatch-text-btn,
.mud-theme-light .dispatch-text-btn .mud-button-label {
    color: #dc2626 !important;
}

/* DARK MODE */
.mud-theme-dark .dispatch-text-btn,
.mud-theme-dark .dispatch-text-btn .mud-button-label {
    color: #ffffff !important;
}
@keyframes dispatchBlink {

    0% {
        background: rgba(220, 38, 38, 0.12);
        transform: scale(1);
    }

    50% {
        background: rgba(220, 38, 38, 0.35);
        transform: scale(1.08);
        box-shadow: 0 0 16px rgba(220, 38, 38, .9);
    }

    100% {
        background: rgba(220, 38, 38, 0.12);
        transform: scale(1);
    }
}
    /* =========================================================
   DEVICE HEALTH SECTION
   ========================================================= */

    .trafficsphere-dashboard .health-section {
        background: var(--mud-palette-surface);
        color: var(--mud-palette-text-primary);
        border-radius: 12px;
        padding: 15px;
        margin-bottom: 15px;
    }

    .trafficsphere-dashboard .health-cards-container {
        display: flex;
        flex-wrap: wrap;
        gap: 0;
        margin-top: 10px;
        align-items: flex-start;
    }

    .trafficsphere-dashboard .health-card {
        background: transparent;
        color: var(--mud-palette-text-primary);
        padding: 10px 12px;
        border-radius: 0;
        flex: 1 1 160px;
        min-width: 140px;
        box-sizing: border-box;
        border-right: 1px solid var(--mud-palette-divider);
    }

        .trafficsphere-dashboard .health-card:last-child {
            border-right: none;
        }

    .trafficsphere-dashboard .health-title {
        font-weight: 600;
        margin-bottom: 10px;
    }

    .trafficsphere-dashboard .health-stats {
        display: flex;
        justify-content: space-between;
        margin-top: 8px;
    }

/* =========================================================
   VERTICAL MAP CONTROLS
   ========================================================= */

.vertical-controls-container {
    border-radius: 12px;
    padding: 8px 6px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    max-width: 44px;
    background: var(--mud-palette-surface);
    color: var(--mud-palette-text-primary);
    backdrop-filter: blur(10px);
}

.control-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    width: 100%;
}

.section-title {
    font-size: 9px;
    font-weight: 700;
    color: var(--mud-palette-text-primary);
    text-shadow: 0 1px 3px rgba(0,0,0,.6);
    text-align: center;
    letter-spacing: .5px;
}

.icon-btn {
    width: 34px;
    height: 34px;
    border: none;
    border-radius: 8px;
    background: var(--mud-palette-background-grey);
    color: var(--mud-palette-text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: all 0.2s ease;
    padding: 0;
}

    .icon-btn:hover {
        background: var(--mud-palette-action-default-hover);
        transform: scale(1.05);
    }

    .icon-btn.active {
        background: #e3f2fd;
        border: 2px solid #1976d2;
    }

.control-divider {
    width: 80%;
    height: 1px;
    background: #dee2e6;
    margin: 4px 0;
}

/* =========================================================
   EVENTS GRID / TABLE
   ========================================================= */

.trafficsphere-dashboard .events-section {
    background: var(--mud-palette-surface);
    color: var(--mud-palette-text-primary);
    border-radius: 12px;
    padding: 15px;
}

.trafficsphere-dashboard .mud-table {
    background: var(--mud-palette-surface) !important;
    color: var(--mud-palette-text-primary) !important;
}

.trafficsphere-dashboard .mud-table-container {
    background: var(--mud-palette-surface) !important;
}

.trafficsphere-dashboard .mud-table-cell {
    color: var(--mud-palette-text-primary) !important;
}

.trafficsphere-dashboard .mud-table-head {
    background: var(--mud-palette-background-grey);
}

    .trafficsphere-dashboard .mud-table-head .mud-table-cell {
        font-weight: 600;
        color: var(--mud-palette-text-primary) !important;
    }

.trafficsphere-dashboard .mud-toolbar {
    background: var(--mud-palette-surface) !important;
}

/* =========================================================
   RESPONSIVE - LARGE SCREENS (xl / xxl / 3xl / 4xl)
   ========================================================= */

@media (min-width: 1920px) {
    .trafficsphere-dashboard {
        padding: 16px 24px 24px;
    }

        .trafficsphere-dashboard .kpi-value {
            font-size: 32px;
        }

        .trafficsphere-dashboard .kpi-label {
            font-size: 14px;
        }

        .trafficsphere-dashboard .kpi-icon {
            font-size: 26px;
        }

        .trafficsphere-dashboard .kpi-card {
            height: 116px;
        }

        .trafficsphere-dashboard #map {
            height: 720px;
        }

        .trafficsphere-dashboard .panel-header {
            font-size: 22px;
        }
}

@media (min-width: 2560px) {
    .trafficsphere-dashboard .kpi-row {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
        gap: 16px;
    }

    .trafficsphere-dashboard .kpi-value {
        font-size: 38px;
    }

    .trafficsphere-dashboard .kpi-label {
        font-size: 16px;
    }

    .trafficsphere-dashboard .kpi-icon {
        font-size: 30px;
    }

    .trafficsphere-dashboard .kpi-card {
        height: 130px;
    }

    .trafficsphere-dashboard #map {
        height: 850px;
    }

    .trafficsphere-dashboard .panel-header {
        font-size: 24px;
    }
}

@media (min-width: 3840px) {
    .trafficsphere-dashboard {
        padding: 24px 36px 36px;
    }

        .trafficsphere-dashboard .kpi-row {
            grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
            gap: 22px;
        }

        .trafficsphere-dashboard .kpi-value {
            font-size: 48px;
        }

        .trafficsphere-dashboard .kpi-label {
            font-size: 20px;
        }

        .trafficsphere-dashboard .kpi-icon {
            font-size: 38px;
        }

        .trafficsphere-dashboard .kpi-card {
            height: 160px;
        }

        .trafficsphere-dashboard #map {
            height: 1100px;
        }

        .trafficsphere-dashboard .panel-header {
            font-size: 28px;
        }
}

/* =========================================================
   RESPONSIVE - SMALLER SCREENS
   ========================================================= */

@media (max-width: 1200px) {
    .trafficsphere-dashboard .command-center-layout {
        grid-template-columns: 1fr;
    }

    .trafficsphere-dashboard #map {
        height: 500px;
    }
}
/* =========================================================
   APPBAR / HEADER STYLES  (moved from HeaderMenu.razor)
   ========================================================= */

.custom-appbar {
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    background-color: var(--mud-palette-surface);
    transition: background-color 0.3s ease;
}

.mud-theme-dark .custom-appbar {
    background-color: var(--mud-palette-background);
}

.center-header {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
}

.right-section {
    display: flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
}

.plaza-title {
    color: var(--mud-palette-text-primary);
}

.custom-appbar .mud-icon-root {
    color: var(--mud-palette-text-primary);
}

/* ===== Brand: Title + Subtitle + Project Name — all one row ===== */
.appbar-brand {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 20px;
    flex-shrink: 0;
    margin-left: 8px;
    white-space: nowrap;
}

.mud-app-bar {
    border-bottom: 2px solid var(--mud-palette-primary) !important;
}

.appbar-brand-text {
    display: flex;
    flex-direction: column;
    justify-content: center;
    line-height: 1.1;
}

.appbar-brand-title {
    margin: 0 !important;
    font-weight: 600;
    letter-spacing: -.3px;
    font-family: 'Segoe UI', 'Inter', system-ui, sans-serif !important;
    color: var(--mud-palette-text-primary);
    font-size: clamp(1.1rem, 1.4vw, 1.7rem);
    white-space: nowrap;
}

.appbar-brand-subtitle {
    margin: 0 !important;
    font-weight: 400;
    font-family: 'Segoe UI', 'Inter', system-ui, sans-serif !important;
    color: var(--mud-palette-text-secondary);
    font-size: clamp(.65rem, .65vw, .85rem);
    white-space: nowrap;
    text-align: center;
    width: 100%;
}

.appbar-divider-dot {
    color: var(--mud-palette-divider);
    font-size: 1.6rem;
    align-self: center;
    margin: 0;
    font-weight: 300;
}

.appbar-project-name {
    color: var(--mud-palette-text-primary);
    font-size: clamp(1.1rem, 1.4vw, 1.7rem);
    font-weight: 500;
    font-family: 'Segoe UI', 'Inter', system-ui, sans-serif !important;
    white-space: nowrap;
}
/* =========================================================
   INCIDENT KPI LEGEND
   ========================================================= */

.kpi-incident-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 5px 10px;
    margin-top: 6px;
    width: 100%;
}

.kpi-incident-legend-item {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    color: var(--mud-palette-text-secondary);
    white-space: nowrap;
}

.kpi-incident-legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 2px;
    flex-shrink: 0;
}

@media (min-width: 1920px) {
    .appbar-brand-title {
        font-size: 1.7rem;
    }

    .appbar-brand-subtitle {
        font-size: .9rem;
    }

    .appbar-project-name {
        font-size: 1.7rem;
    }
}

@media (min-width: 2560px) {
    .appbar-brand-title {
        font-size: 2.1rem;
    }

    .appbar-brand-subtitle {
        font-size: 1.05rem;
    }

    .appbar-project-name {
        font-size: 2.1rem;
    }
}

@media (min-width: 3840px) {
    .appbar-brand-title {
        font-size: 2.8rem;
    }

    .appbar-brand-subtitle {
        font-size: 1.4rem;
    }

    .appbar-project-name {
        font-size: 2.8rem;
    }
}

@media (max-width: 600px) {
    .appbar-brand-subtitle {
        display: none;
    }

    .appbar-divider-dot {
        display: none;
    }
}

/* =========================================================
   KPI HEALTH PROGRESS BAR — green (online) + red (offline)
   ========================================================= */

.kpi-health-bar {
    width: 100%;
    height: 6px;
    border-radius: 4px;
    background: #ef4444;
    margin-top: 6px;
    overflow: hidden;
    position: relative;
}

.kpi-health-bar-fill {
    height: 100%;
    border-radius: 4px;
    background: #22c55e;
    transition: width .4s ease;
    position: absolute;
    left: 0;
    top: 0;
}

/* =========================================================
   ACTIVE INCIDENTS KPI — single segmented bar
   ========================================================= */

.kpi-incident-bar {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    margin-top: 8px;
    display: flex;
    overflow: hidden;
    gap: 2px;
}

.kpi-incident-seg {
    height: 100%;
    border-radius: 2px;
    min-width: 4px;
    transition: width .4s ease;
    flex-shrink: 0;
}

    .kpi-incident-seg.seg-red {
        background: #dc2626;
    }

    .kpi-incident-seg.seg-blue {
        background: #2563eb;
    }

    .kpi-incident-seg.seg-amber {
        background: #d97706;
    }

    .kpi-incident-seg.seg-violet {
        background: #7c3aed;
    }

.trafficsphere-dashboard .kpi-card.critical {
    height: 104px;
    padding: 8px 10px;
    flex-direction: column;
    align-items: stretch;
    justify-content: space-between;
    text-align: left;
    gap: 4px;
}

.kpi-incidents-header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
    width: 100%;
}

.kpi-corner-legend {
    position: absolute;
    top: 8px;
    right: 10px;
    display: flex;
    gap: 4px;
}

.kpi-incident-seg-v {
    width: 100%;
    border-radius: 2px;
    min-height: 4px;
    flex-shrink: 0;
    transition: height .4s ease;
}

.kpi-incident-text-legend {
    display: flex;
    flex-direction: column;
    gap: 3px;
    font-size: 10px;
    line-height: 1.2;
    color: var(--mud-palette-text-secondary);
    white-space: nowrap;
}

.kpi-incident-legend-top {
    display: flex;
    flex-wrap: wrap;
    gap: 2px 8px;
    font-size: 9px;
    line-height: 1.2;
}

/*.kpi-critical-main {
    display: flex;
    align-items: center;
    gap: 8px;
}*/
.kpi-critical-main {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
}
    .kpi-critical-main .kpi-value {
        font-size: 24px;
    }

    .kpi-critical-main .kpi-icon {
        margin-bottom: 0;
        font-size: 20px;
    }

.kpi-incident-text-legend-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.kpi-incident-text-legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 2px;
    flex-shrink: 0;
}

.kpi-incident-bar-vertical {
    width: 8px;
    height: 80%;
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    gap: 2px;
}

.kpi-incidents-total {
    font-size: 26px;
    font-weight: 700;
    line-height: 1;
}

.kpi-corner-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.kpi-incidents-label {
    font-size: 11px;
    opacity: .75;
    line-height: 1.2;
}

.kpi-incident-group {
    width: 100%;
    margin-bottom: 4px;
}

.kpi-critical-main .kpi-label {
    font-size: 10px;
    opacity: .8;
}

.kpi-incident-group-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 10.5px;
    margin-bottom: 2px;
    opacity: .9;
}

.kpi-incident-group-bar {
    width: 100%;
    height: 4px;
    border-radius: 3px;
    background: rgba(239, 68, 68, 0.15);
    overflow: hidden;
}

.kpi-incident-bar-single {
    width: 100%;
    height: 6px;
    border-radius: 4px;
    display: flex;
    overflow: hidden;
    gap: 2px;
}

.kpi-incident-group-fill {
    height: 100%;
    border-radius: 3px;
    background: #ef4444;
    transition: width .4s ease;
}

.kpi-critical-left {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
}

.kpi-critical-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    height: 100%;
    padding-left: 8px;
}

/* =========================================================
   LIVE INCIDENT FEED CARDS — colors by event type
   (single consolidated block — light + dark mode)
   ========================================================= */

/* ---- LIGHT MODE ---- */

.trafficsphere-dashboard .incident-card.incident-accident,
.trafficsphere-dashboard .incident-card.incident-stopped {
    border-left-color: #dc2626;
    border-left-width: 6px;
    background: rgba(220, 38, 38, 0.10) !important;
}

.trafficsphere-dashboard .incident-card.incident-wrong {
    border-left-color: #2563eb;
    border-left-width: 6px;
    background: rgba(37, 99, 235, 0.10) !important;
}

.trafficsphere-dashboard .incident-card.incident-person {
    border-left-color: #d97706;
    border-left-width: 6px;
    background: rgba(217, 119, 6, 0.10) !important;
}

.trafficsphere-dashboard .incident-card.incident-default {
    border-left-color: #7c3aed;
    border-left-width: 6px;
    background: rgba(124, 58, 237, 0.08) !important;
}

/* ---- DARK MODE — stronger contrast ---- */

.mud-theme-dark .trafficsphere-dashboard .incident-card.incident-accident,
.mud-theme-dark .trafficsphere-dashboard .incident-card.incident-stopped {
    border-left-color: #f87171;
    border-left-width: 6px;
    background: rgba(220, 38, 38, 0.55) !important;
}

.mud-theme-dark .trafficsphere-dashboard .incident-card.incident-wrong {
    border-left-color: #60a5fa;
    border-left-width: 6px;
    background: rgba(37, 99, 235, 0.45) !important;
}

.mud-theme-dark .trafficsphere-dashboard .incident-card.incident-person {
    border-left-color: #fbbf24;
    border-left-width: 6px;
    background: rgba(180, 83, 9, 0.45) !important;
}

.mud-theme-dark .trafficsphere-dashboard .incident-card.incident-default {
    border-left-color: #c084fc;
    border-left-width: 6px;
    background: rgba(124, 58, 237, 0.45) !important;
}


/* =========================================================
   VIDS DASHBOARD
   ========================================================= */

.vids-dashboard {
    width: 100%;
}

    .vids-dashboard .compact-traffic-list {
        display: flex;
        flex-direction: column;
        gap: 4px;
        max-height: 140px;
        overflow-y: auto;
        padding-right: 5px;
    }

    .vids-dashboard .compact-traffic-item {
        padding: 0px 12px;
        background: linear-gradient( 135deg, rgba(248,249,250,.8), rgba(240,242,245,.8) );
        border-radius: 8px;
        border-left: 3px solid #6a1b9a;
        transition: all .3s ease;
        box-shadow: 0 1px 3px rgba(0,0,0,.05);
    }

    .vids-dashboard .dashboard-section-header {
        display: flex;
        align-items: center;
        gap: 6px;
        line-height: 1;
    }

    .vids-dashboard .traffic-header-content {
        display: flex;
        align-items: center;
        gap: 10px;
    }

    .vids-dashboard .traffic-total {
        margin: 0;
        line-height: 1;
    }

    .vids-dashboard .traffic-avatar {
        width: 34px !important;
        height: 34px !important;
        min-width: 34px !important;
        min-height: 34px !important;
        background: rgba(255,255,255,.06);
    }

        .vids-dashboard .traffic-avatar .mud-icon-root {
            font-size: 18px !important;
        }

    .vids-dashboard .traffic-chip-compact {
        font-family: 'Roboto Mono', monospace;
        font-weight: 600;
        min-width: 70px;
        justify-content: center;
        background: linear-gradient(135deg,#2196f3,#1976d2);
        color: white;
        border: none;
    }
    /* =========================================
   VIDS CARD HEADER
   ========================================= */

    .vids-dashboard .dashboard-card-header {
        display: flex;
        align-items: center;
        gap: 8px;
        margin-bottom: 12px;
    }

    /* =========================================
   AVG VIOLATION
   ========================================= */

    .vids-dashboard .avg-violation-content {
        flex: 1;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        height: 100%;
    }

    /* =========================================
   DEVICE STATUS
   ========================================= */

  /*  .vids-dashboard .devices-center-wrap {
        display: flex;
        justify-content: center;
        align-items: center;
        gap: 30px;
        height: 180px;
    }*/
    .vids-dashboard .devices-center-wrap {
        display: flex;
        justify-content: center;
        align-items: flex-start;
        gap: 30px;
        height: 180px;
        padding-top: 10px;
    }
    .vids-dashboard .status-circle-compact {
        width: 110px;
        height: 110px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .vids-dashboard .online-circle-compact {
        border: 6px solid #22c55e;
    }

    .vids-dashboard .offline-circle-compact {
        border: 6px solid #ef4444;
    }

    .vids-dashboard .circle-content-compact {
        text-align: center;
    }

    /* =========================================
   VIOLATION
   ========================================= */

    .vids-dashboard .violation-analysis-compact {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .vids-dashboard .violation-circle-chart-compact {
        position: relative;
        width: 120px;
        height: 120px;
    }

    .vids-dashboard .violation-center-compact {
        position: absolute;
        inset: 0;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
    }

    /* =========================================
   VEHICLE DISTRIBUTION
   ========================================= */

    .vids-dashboard .vehicle-pie-with-details-no-scroll {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 20px;
        height: 240px;
    }

    .vids-dashboard .vehicle-main-pie {
        display: flex;
        justify-content: center;
        align-items: center;
    }

    .vids-dashboard .pie-chart-large {
        position: relative;
        width: 100px;
        height: 100px;
    }

    .vids-dashboard .pie-center-large {
        position: absolute;
        inset: 0;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
    }

    .vids-dashboard .total-large {
        font-weight: 700;
        font-size: 18px;
    }

    .vids-dashboard .total-label-large {
        font-size: 11px;
    }

    .vids-dashboard .vehicle-compact-details-no-scroll {
        flex: 1;
        display: grid;
        grid-template-columns: repeat(2,1fr);
        gap: 8px;
    }

    .vids-dashboard .detail-row-compact {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .vids-dashboard .detail-label {
        display: flex;
        align-items: center;
        gap: 6px;
    }

    .vids-dashboard .detail-values {
        display: flex;
        gap: 6px;
    }

    /* =========================================
   LAST TRANSACTION
   ========================================= */

    .vids-dashboard .last-txn-details {
        width: 100%;
    }

    .vids-dashboard .detail-row {
        display: flex;
        flex-direction: column;
    }
/* =========================================================
   VIDS DASHBOARD RESPONSIVE
   ========================================================= */

/* XL */
@media (min-width: 1920px) {

    .vids-dashboard .dashboard-card-header .mud-typography {
        font-size: 1rem !important;
    }

    .vids-dashboard .traffic-total {
        font-size: 1.5rem !important;
    }

    .vids-dashboard .status-circle-compact {
        width: 130px !important;
        height: 130px !important;
    }

    .vids-dashboard .violation-circle-chart-compact {
        width: 140px;
        height: 140px;
    }

    .vids-dashboard .pie-chart-large {
        width: 110px;
        height: 110px;
    }

    .vids-dashboard .detail-name {
        font-size: 0.85rem;
    }

    .vids-dashboard .detail-count {
        font-size: 0.9rem;
    }

    .vids-dashboard .mud-table-cell {
        font-size: 0.95rem !important;
    }
}

/* 2K */
@media (min-width: 2560px) {

    .vids-dashboard {
        zoom: 1.08;
    }

        .vids-dashboard .traffic-total {
            font-size: 1.8rem !important;
        }

        .vids-dashboard .status-circle-compact {
            width: 150px !important;
            height: 150px !important;
        }

        .vids-dashboard .violation-circle-chart-compact {
            width: 160px;
            height: 160px;
        }

        .vids-dashboard .pie-chart-large {
            width: 130px;
            height: 130px;
        }

        .vids-dashboard .dashboard-card-header .mud-typography {
            font-size: 1.1rem !important;
        }

        .vids-dashboard .mud-table-cell {
            font-size: 1rem !important;
        }

        .vids-dashboard .detail-name {
            font-size: 0.95rem;
        }

        .vids-dashboard .detail-count {
            font-size: 1rem;
        }
}

/* 4K */
@media (min-width: 3840px) {

    .vids-dashboard {
        zoom: 1.3;
    }

        .vids-dashboard .traffic-total {
            font-size: 2.2rem !important;
        }

        .vids-dashboard .status-circle-compact {
            width: 180px !important;
            height: 180px !important;
        }

        .vids-dashboard .violation-circle-chart-compact {
            width: 190px;
            height: 190px;
        }

        .vids-dashboard .pie-chart-large {
            width: 160px;
            height: 160px;
        }

        .vids-dashboard .dashboard-card-header .mud-typography {
            font-size: 1.3rem !important;
        }

        .vids-dashboard .mud-table-cell {
            font-size: 1.15rem !important;
        }

        .vids-dashboard .detail-name {
            font-size: 1.1rem;
        }

        .vids-dashboard .detail-count {
            font-size: 1.15rem;
        }
}

/* 5K / Video Wall */
@media (min-width: 5120px) {

    .vids-dashboard {
        zoom: 1.6;
    }

        .vids-dashboard .traffic-total {
            font-size: 2.8rem !important;
        }

        .vids-dashboard .mud-table-cell {
            font-size: 1.4rem !important;
        }

        .vids-dashboard .dashboard-card-header .mud-typography {
            font-size: 1.5rem !important;
        }
}

/* Laptop */
@media (max-width: 1366px) {

    .vids-dashboard .status-circle-compact {
        width: 90px !important;
        height: 90px !important;
    }

    .vids-dashboard .devices-center-wrap {
        gap: 18px;
    }

    .vids-dashboard .traffic-total {
        font-size: 1.1rem !important;
    }
}

/* Tablet */
@media (max-width: 960px) {

    .vids-dashboard .vehicle-pie-with-details-no-scroll {
        flex-direction: column;
        height: auto;
    }

    .vids-dashboard .vehicle-compact-details-no-scroll {
        grid-template-columns: repeat(2,1fr);
        grid-template-rows: auto;
    }

    .vids-dashboard .devices-center-wrap {
        flex-direction: row;
    }
}

/* Mobile */
@media (max-width: 600px) {

    .vids-dashboard .vehicle-compact-details-no-scroll {
        grid-template-columns: 1fr;
    }

    .vids-dashboard .status-circle-compact {
        width: 70px !important;
        height: 70px !important;
    }

    .vids-dashboard .traffic-total {
        font-size: 1rem !important;
    }

    .vids-dashboard .dashboard-card-header .mud-typography {
        font-size: 0.8rem !important;
    }

    .vids-dashboard .mud-table-cell {
        font-size: 0.75rem !important;
    }
}