﻿
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 {
    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;
}

.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);
}

    .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;
    }

    .trafficsphere-dashboard .critical {
        border-left-color: #ef4444;
    }

    .trafficsphere-dashboard .speed {
        border-left-color: #f59e0b;
    }

    .trafficsphere-dashboard .ai {
        border-left-color: #8b5cf6;
    }

    .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;
    }

    .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;
    font-size:16px;
    font-weight:500;
}
/* Use the same font as sidebar menu */
.tmcs-page {
    font-family: var(--mud-typography-default-family) !important;
}

    .tmcs-page .camera-card,
    .tmcs-page .mud-typography,
    .tmcs-page .mud-text,
    .tmcs-page .mud-button-label {
        font-family: var(--mud-typography-default-family) !important;
    }

.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;
    animation: dispatchBlink 1.2s infinite;
}

.tmcs-page .camera-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.1) !important;
    border-color: #3b82f6;
}

/* Status dot */
.tmcs-page .camera-status {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

    .tmcs-page .camera-status.online {
        background: linear-gradient(135deg, #10b981, #34d399);
        box-shadow: 0 0 0 3px rgba(16,185,129,0.2);
        animation: pulse 2s infinite;
    }

    .tmcs-page .camera-status.offline {
        background: linear-gradient(135deg, #ef4444, #f87171);
        box-shadow: 0 0 0 3px rgba(239,68,68,0.2);
    }

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(16,185,129,0.4);
    }

    70% {
        box-shadow: 0 0 0 8px rgba(16,185,129,0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(16,185,129,0);
    }
}
/* Camera details - ensure consistent font */
.tmcs-page .camera-details .mud-typography {
    font-family: var(--mud-typography-default-family) !important;
}

.mud-theme-light .dispatch-text-btn,
.mud-theme-light .dispatch-text-btn .mud-button-label {
    color: #dc2626 !important;
}

.mud-theme-dark .dispatch-text-btn,
.mud-theme-dark .dispatch-text-btn .mud-button-label {
    color: #ffffff !important;
    padding-bottom: 10px;
}

@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;
    font-size:16px;
}

.trafficsphere-dashboard .health-stats {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    font-size: 16px;
    font-weight: 600;
}

/* =========================================================
   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
   ========================================================= */

@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;
        }
}

@media (max-width: 1200px) {
    .trafficsphere-dashboard .command-center-layout {
        grid-template-columns: 1fr;
    }

    .trafficsphere-dashboard #map {
        height: 500px;
    }
}

/* =========================================================
   APPBAR / HEADER
   ========================================================= */

.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);
}

.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: var(--mud-typography-default-family) !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: var(--mud-typography-default-family) !important;
    color: var(--mud-palette-text-secondary);
    font-size: clamp(.75rem, .70vw, .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: var(--mud-typography-default-family) !important;
    white-space: nowrap;
}

.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-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    flex: 0 0 auto;
    white-space: nowrap;
    font-size: 9px;
}

/*.kpi-incident-legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 2px;
    flex-shrink: 0;
}*/
.kpi-incident-legend-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    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
   ========================================================= */

.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
   ========================================================= */

.kpi-incident-bar {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    margin-top: 8px;
    display: flex;
    overflow: hidden;
    gap: 8px;
}

/*.kpi-incident-seg {
    height: 100%;
    border-radius: 2px;
    min-width: 4px;
    transition: width .4s ease;
    flex-shrink: 0;
}*/
.kpi-incident-seg {
    width: 100%;
    height: 100%;
    cursor: pointer;
}
    .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;
}*/
.trafficsphere-dashboard .kpi-card.critical {
    height: 104px;
    padding: 8px 10px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 17px;
    overflow: hidden;
}

.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-incident-legend-top {
    display: flex;
    flex-wrap: wrap;
    gap: 2px 8px;
    font-size: 9px;
    line-height: 1.1;
    overflow: hidden;
}
/*.kpi-critical-main {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
}*/
.kpi-critical-main {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex-shrink: 0;
}

    /*  .kpi-critical-main .kpi-value {
        font-size: 24px;
    }*/
    .kpi-critical-main .kpi-value {
        font-size: 2rem;
        line-height: 1;
        font-weight: 700;
    }
    /* .kpi-critical-main .kpi-icon {
        margin-bottom: 0;
        font-size: 20px;
    }*/
    .kpi-critical-main .kpi-icon {
        font-size: 18px;
    }

.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-label {
    text-align: left;
    font-size: 13px;
    line-height: 1;
    margin-bottom: 2px;
}

.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-bar-single {
    display: flex;
    width: 100%;
    flex: 1 1 auto;
    align-self: stretch;
    height: 10px;
    margin-top: 6px;
    border-radius: 999px;
    overflow: hidden;
   

    gap: 2px; 
    box-sizing: border-box;
}*/
.kpi-incident-bar-single {
    display: flex;
    width: 100%;
    height: 10px;
    border-radius: 999px;
    overflow: hidden;
}
.kpi-incident-wrapper {
    flex-grow: 1;
    display: flex;
}
    .kpi-incident-wrapper .mud-tooltip-root {
        width: 100%;
        display: flex;
    }
.kpi-incident-seg:hover {
    filter: brightness(1.15);
    transform: scaleY(1.2);
}
.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
   ========================================================= */

.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;
}

.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-dashboard .dashboard-card-header {
        display: flex;
        align-items: center;
        gap: 8px;
        margin-bottom: 12px;
    }

    .vids-dashboard .avg-violation-content {
        flex: 1;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        height: 100%;
    }

    .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;
    }

    .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;
    }

/*    .vids-dashboard .vehicle-pie-with-details-no-scroll {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 20px;
        height: 240px;
    }*/
/*    .vids-dashboard .vehicle-pie-with-details-no-scroll {
        display: flex;
        align-items: flex-start;
        gap: 10px;
        height: 100%;
        min-height: 0; 
    }*/
    .vids-dashboard .vehicle-pie-with-details-no-scroll {
        display: flex;
        align-items: center;
        gap: 10px;
        height: 100%;
    }
    .vids-dashboard .vehicle-main-pie {
        /* display: flex;
        justify-content: center;
        align-items: center;*/
        flex-shrink: 0;
    }

    .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 .vehicle-compact-details-no-scroll {
        flex: 1;
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        grid-auto-rows: min-content;
        align-content: start;
        gap: 4px 10px;
        min-height: 0;
        max-height: 100%;
        overflow-y: auto;
        padding-right: 2px;
    }
/*    .vids-dashboard .detail-row-compact {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }*/
    .vids-dashboard .detail-row-compact {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 1px 0;
        line-height: 1.15;
    }
    .vids-dashboard .detail-label {
        display: flex;
        align-items: center;
        gap: 6px;
    }

    .vids-dashboard .detail-values {
        display: flex;
        gap: 6px;
    }

    .vids-dashboard .last-txn-details {
        width: 100%;
    }

    .vids-dashboard .detail-row {
        display: flex;
        flex-direction: column;
    }

/* =========================================================
   MAP POPUP TABS (multi-device same coordinates)
   ========================================================= */

.popup-tabs-row {
    display: flex;
    gap: 4px;
    overflow-x: auto;
    margin-bottom: 8px;
    border-bottom: 2px solid #e5e7eb;
    padding-bottom: 4px;
}

.popup-tab-btn {
    flex-shrink: 0;
    border: none;
    background: #f1f5f9;
    color: #475569;
    padding: 6px 12px;
    border-radius: 8px 8px 0 0;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    font-family: var(--ts-font-family);
}

    .popup-tab-btn.active {
        background: #0d6efd;
        color: #fff;
    }

/* =========================================================
   GLOBAL TYPOGRAPHY STANDARD — applies to every module
   NOTE: font-family now always resolves to MudBlazor's default
   application font, so every module (trafficsphere, vids, met,
   nms, tmcs) uses the SAME default font as the rest of the app.
   Only the responsive font-SIZE scaling is kept.
   ========================================================= */
:root {
    --ts-font-family: var(--mud-typography-default-family) !important;
    --ts-font-xs: clamp(10px, 0.6vw + 6px, 14px);
    --ts-font-sm: clamp(12px, 0.7vw + 7px, 16px);
    --ts-font-md: clamp(14px, 0.9vw + 8px, 18px);
    --ts-font-lg: clamp(18px, 1.2vw + 10px, 24px);
    --ts-font-xl: clamp(24px, 1.8vw + 12px, 34px);
    --ts-font-xxl: clamp(30px, 2.4vw + 14px, 46px);
}

.trafficsphere-dashboard, .vids-dashboard, .metn-page, .nms-page, .tmcs-page,
.trafficsphere-dashboard *, .vids-dashboard *, .metn-page *, .nms-page *, .tmcs-page * {
    font-family: var(--mud-typography-default-family) !important;
}

    .trafficsphere-dashboard .kpi-value,
    .metn-hero div[style*="font-size:4.2rem"] {
        font-size: var(--ts-font-xxl) !important;
    }

    .trafficsphere-dashboard .kpi-label,
    .metn-label {
        font-size: var(--ts-font-xs) !important;
    }

    .trafficsphere-dashboard .panel-header,
    .appbar-brand-title,
    .appbar-project-name {
        font-size: var(--ts-font-lg) !important;
    }

.mud-table-cell, .mud-chip, .metn-val {
    font-size: var(--ts-font-sm) !important;
}

/* =========================================================
   NMS DEVICE CARDS — status color kept, type icon + label added
   ========================================================= */

.device-card-compact {
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    background: var(--mud-palette-surface);
    color: var(--mud-palette-text-primary);
}

.device-type-icon-badge-solid {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.20);
    color: #fff;
    flex-shrink: 0;
}

.device-type-label {
    font-size: var(--ts-font-xs);
    font-weight: 700;
    text-transform: uppercase;
    opacity: .85;
    color: #fff;
}

.device-name-label {
    font-size: var(--ts-font-sm);
    font-weight: 700;
    color: #fff;
}

.device-info-row {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: var(--ts-font-xs);
    padding: 2px 0;
    white-space: normal;
    word-break: break-word;
    color: #fff;
}

.device-card-compact.is-offline {
    opacity: 1;
}

/* =========================================================
   TMCS PAGE — standard typography via Typo classes
   ========================================================= */

/*.tmcs-page .mud-typography-h5 {
    font-size: var(--ts-font-lg) !important;
}

.tmcs-page .mud-typography-subtitle2 {
    font-size: var(--ts-font-sm) !important;
}

.tmcs-page .mud-typography-body1,
.tmcs-page .mud-typography-body2 {
    font-size: var(--ts-font-sm) !important;
}

.tmcs-page .mud-typography-caption {
    font-size: var(--ts-font-xs) !important;
}*/

.tmcs-page .camera-card {
    font-family: var(--mud-typography-default-family) !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid #e2e8f0;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.tmcs-page .camera-actions {
    margin-top: auto;
    padding-top: 8px;
}

.tmcs-page .info-item span {
    font-size: var(--ts-font-sm) !important;
}

.tmcs-page .modal-title span {
    font-size: var(--ts-font-lg) !important;
}
/* =========================================================
   MET PAGE — moved from met.razor inline <style>, responsive
   ========================================================= */

:root {
    --ts-font-card-val: clamp(20px, 1.6vw + 14px, 36px);
    --ts-font-card-label: clamp(11px, 0.7vw + 7px, 15px);
    --ts-font-card-unit: clamp(11px, 0.6vw + 7px, 16px);
    --ts-font-hero-val: clamp(32px, 3vw + 16px, 56px);
}

.metn-page {
    min-height: 100vh;
}

.metn-hero {
    background: linear-gradient(135deg, #1e3a8a 0%, #1d4ed8 60%, #3b82f6 100%);
    border-radius: 20px;
    padding: 20px 28px;
    color: white;
    position: relative;
    overflow: hidden;
    margin-bottom: 16px;
}

    .metn-hero::before {
        content: '';
        position: absolute;
        top: -80px;
        right: -80px;
        width: 280px;
        height: 280px;
        border-radius: 50%;
        background: rgba(255,255,255,0.06);
    }

/* Big hero temperature — scales with viewport instead of fixed 4.2rem */
.metn-hero-temp-value {
    font-size: var(--ts-font-hero-val) !important;
    font-weight: 900;
    line-height: 1;
    letter-spacing: -2px;
}

.metn-card {
    border-radius: 14px;
    height: 100%;
    padding: 14px 16px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    border: 1px solid #e8f0fe;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: transform .15s, box-shadow .15s;
}

    .metn-card:hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 20px rgba(0,0,0,0.1);
    }

.metn-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
}

.metn-val {
    font-size: var(--ts-font-card-val) !important;
    font-weight: 800;
    line-height: 1.1;
}

.metn-label {
    font-size: var(--ts-font-card-label) !important;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .6px;
    color: var(--mud-palette-text-secondary);
}

.metn-unit {
    font-size: var(--ts-font-card-unit) !important;
    font-weight: 500;
    opacity: 0.7;
}

.metn-bar-bg {
    height: 5px;
    border-radius: 3px;
    background: #f1f5f9;
    margin-top: 8px;
    overflow: hidden;
}

.metn-bar {
    height: 100%;
    border-radius: 3px;
}

.metn-src-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 9px;
    border-radius: 20px;
    font-size: var(--ts-font-xs);
    font-weight: 600;
}

.badge-db {
    background: #dcfce7;
    color: #166534;
}

.badge-api {
    background: #fef9c3;
    color: #854d0e;
}

@media (min-width: 1920px) {
    .metn-val {
        font-size: 40px !important;
    }

    .metn-label {
        font-size: 16px !important;
    }

    .metn-hero-temp-value {
        font-size: 62px !important;
    }
}

@media (min-width: 2560px) {
    .metn-val {
        font-size: 48px !important;
    }

    .metn-label {
        font-size: 18px !important;
    }

    .metn-hero-temp-value {
        font-size: 72px !important;
    }
}

@media (min-width: 3840px) {
    .metn-val {
        font-size: 60px !important;
    }

    .metn-label {
        font-size: 22px !important;
    }

    .metn-hero-temp-value {
        font-size: 90px !important;
    }
}
/* =========================================================
   MET / VIDS / NMS RESPONSIVE
   ========================================================= */

@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;
    }
}

@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;
        }
}

@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;
        }
}

@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;
        }
}

@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;
    }
}

@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;
    }
}

@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 .vehicle-compact-details-no-scroll {
        grid-template-columns: repeat(2, 1fr); 
        max-height: 150px;
        overflow-y: auto;
    }

    .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;
    }
}

/* =========================================================
   NMS COMMAND-CENTER STYLE LIVE STATUS PAGE
   (matches the ITMP "Live Status" dashboard layout, fully
   data-driven — no hardcoded device names/counts in CSS)
   ========================================================= */

.nms-page {
    background: var(--mud-palette-background);
    min-height: 100vh;
}

    .nms-page .nms-header-card {
        border-radius: 14px;
    }

    .nms-page .nms-header-icon-wrap {
        width: 52px;
        height: 52px;
        border-radius: 12px;
        display: flex;
        align-items: center;
        justify-content: center;
        background: rgba(var(--mud-palette-primary-rgb), 0.10);
        color: var(--mud-palette-primary);
        flex-shrink: 0;
    }

/*    .nms-page .nms-header-title {
        font-weight: 700;
        line-height: 1.2;
    }*/

   /* .nms-page .nms-header-subtitle {
        color: var(--mud-palette-text-secondary);
    }*/

    /* KPI summary row */
    .nms-page .nms-kpi-row {
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 14px;
        margin: 16px 0;
    }

@media (max-width: 960px) {
    .nms-page .nms-kpi-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 600px) {
    .nms-page .nms-kpi-row {
        grid-template-columns: 1fr;
    }
}

.nms-page .nms-kpi-card {
    background: var(--mud-palette-surface);
    border-radius: 14px;
    padding: 16px 18px;
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.nms-page .nms-kpi-icon-wrap {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #fff;
}

    .nms-page .nms-kpi-icon-wrap.online {
        background: linear-gradient(135deg, #22c55e, #16a34a);
    }

    .nms-page .nms-kpi-icon-wrap.offline {
        background: linear-gradient(135deg, #ef4444, #dc2626);
    }

    .nms-page .nms-kpi-icon-wrap.total {
        background: linear-gradient(135deg, #3b82f6, #2563eb);
    }

    .nms-page .nms-kpi-icon-wrap.uptime {
        background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    }

.nms-page .nms-kpi-text .nms-kpi-label {
    font-size: var(--ts-font-xs);
    font-weight: 600;
    color: var(--mud-palette-text-secondary);
    line-height: 1.3;
}

.nms-page .nms-kpi-text .nms-kpi-value {
    font-size: var(--ts-font-xl);
    font-weight: 800;
    line-height: 1.15;
}

.nms-page .nms-kpi-text .nms-kpi-sub {
    font-size: var(--ts-font-xs);
    color: var(--mud-palette-text-secondary);
}

.nms-page .nms-kpi-card.online .nms-kpi-sub {
    color: #16a34a;
}

.nms-page .nms-kpi-card.offline .nms-kpi-sub {
    color: #dc2626;
}

/* Filter toolbar */
.nms-page .nms-toolbar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 16px;
}

.nms-page .nms-filter-chips {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.nms-page .nms-search {
    margin-left: auto;
    min-width: 260px;
    flex: 0 1 320px;
}

@media (max-width: 700px) {
    .nms-page .nms-search {
        margin-left: 0;
        flex: 1 1 100%;
    }
}

.nms-page .nms-view-toggle {
    display: flex;
    gap: 4px;
}

/* Device card grid */
.nms-page .nms-device-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
}

.nms-page .device-card-compact {
    border-radius: 14px;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    overflow: hidden;
}

    .nms-page .device-card-compact:hover {
        transform: translateY(-4px);
        box-shadow: 0 12px 28px rgba(0,0,0,0.18);
        cursor: pointer;
    }

.nms-page .device-card-header-strip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    color: #fff;
}

    .nms-page .device-card-header-strip.status-online {
        background: linear-gradient(135deg, #16a34a, #22c55e);
    }

    .nms-page .device-card-header-strip.status-offline {
        background: linear-gradient(135deg, #dc2626, #ef4444);
    }

.nms-page .device-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.nms-page .device-header-icon {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: rgba(255,255,255,0.22);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.nms-page .device-header-text {
    min-width: 0;
    line-height: 1.15;
}

.nms-page .device-header-type {
    font-size: var(--ts-font-xs);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .4px;
    opacity: .9;
}

.nms-page .device-header-km {
    font-size: var(--ts-font-md);
    font-weight: 800;
}

.nms-page .device-status-pill {
    font-size: var(--ts-font-xs);
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 999px;
    background: rgba(255,255,255,0.25);
    white-space: nowrap;
    flex-shrink: 0;
}

    .nms-page .device-status-pill.status-online {
        animation: nmsBlink 1.4s infinite;
    }

@keyframes nmsBlink {
    0%, 100% {
        opacity: 1;
    }

    50% {
        opacity: .55;
    }
}

.nms-page .device-card-body {
    padding: 10px 14px 14px;
    background: var(--mud-palette-surface);
    color: var(--mud-palette-text-primary);
}

.nms-page .device-info-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 3px 0;
    font-size: var(--ts-font-xs);
    color: var(--mud-palette-text-primary);
    white-space: normal;
    word-break: break-word;
}

    .nms-page .device-info-row .mud-icon-root {
        color: var(--mud-palette-text-secondary);
        flex-shrink: 0;
    }

/* List view row */
.nms-page .nms-device-list-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 16px;
    border-radius: 10px;
    background: var(--mud-palette-surface);
    margin-bottom: 8px;
}

    .nms-page .nms-device-list-row .device-status-dot {
        width: 10px;
        height: 10px;
        border-radius: 50%;
        flex-shrink: 0;
    }

        .nms-page .nms-device-list-row .device-status-dot.status-online {
            background: #22c55e;
            box-shadow: 0 0 0 3px rgba(34,197,94,0.2);
        }

        .nms-page .nms-device-list-row .device-status-dot.status-offline {
            background: #ef4444;
            box-shadow: 0 0 0 3px rgba(239,68,68,0.2);
        }

/* =========================================================
   NMS — HEADER ROW (title + 3 KPI cards + search) MERGED
   Matches "single strip" layout: title/subtitle left,
   compact KPI cards middle, search right.
   ========================================================= */

.nms-page .nms-header-row {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.nms-page .nms-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.nms-page .nms-header-kpi-row {
    display: flex;
    align-items: stretch;
    gap: 12px;
    flex: 1 1 auto;
    flex-wrap: wrap;
}

.nms-page .nms-header-kpi-card {
    background: var(--mud-palette-background-grey);
    border-radius: 10px;
    padding: 8px 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1 1 160px;
    min-width: 150px;
}

    .nms-page .nms-header-kpi-card .nms-kpi-icon-wrap {
        width: 34px;
        height: 34px;
    }

    .nms-page .nms-header-kpi-card .nms-kpi-text .nms-kpi-label {
        font-size: var(--ts-font-xs);
        font-weight: 600;
        color: var(--mud-palette-text-secondary);
        line-height: 1.2;
    }

    .nms-page .nms-header-kpi-card .nms-kpi-text .nms-kpi-value {
        font-size: var(--ts-font-md);
        font-weight: 800;
        line-height: 1.15;
    }

    .nms-page .nms-header-kpi-card .nms-kpi-text .nms-kpi-sub {
        font-size: var(--ts-font-xs);
        color: var(--mud-palette-text-secondary);
    }

    .nms-page .nms-header-kpi-card.online .nms-kpi-sub {
        color: #16a34a;
    }

    .nms-page .nms-header-kpi-card.offline .nms-kpi-sub {
        color: #dc2626;
    }

.nms-page .nms-header-row .nms-search {
    flex: 0 0 260px;
    margin-left: auto;
}

@media (max-width: 1200px) {
    .nms-page .nms-header-row .nms-search {
        flex: 1 1 100%;
        margin-left: 0;
    }
}
/* =========================================================
   ATCC HEADER - Simple clean style matching NMS
   ========================================================= */
.atcc-header-simple {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
}

.atcc-header-left {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-shrink: 0;
}

.atcc-header-icon-wrap {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 14px rgba(99, 102, 241, .35);
}

.atcc-header-title {
    font-weight: 600 !important;
    line-height: 1.2;
    font-size: var(--ts-font-md) !important;
    font-family: var(--mud-typography-default-family) !important;
}

.atcc-header-subtitle {
    color: var(--mud-palette-text-secondary);
    font-size: var(--ts-font-sm) !important;
    font-family: var(--mud-typography-default-family) !important;
}

.atcc-header-kpis {
    display: flex;
    align-items: stretch;
    gap: 14px;
    flex-wrap: wrap;
    flex: 1 1 auto;
    justify-content: flex-end;
}

.atcc-header-kpi {
    background: var(--mud-palette-background-grey);
    border-radius: 10px;
    padding: 10px 18px;
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 160px;
    flex: 0 1 auto;
    font-family: var(--mud-typography-default-family) !important;
}

.atcc-kpi-content {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.atcc-kpi-icon {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.atcc-kpi-label {
    font-size: var(--ts-font-xs) !important;
    font-weight: 600;
    color: var(--mud-palette-text-secondary);
    line-height: 1.2;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-family: var(--mud-typography-default-family) !important;
}

.atcc-kpi-value {
    font-size: var(--ts-font-xl) !important;
    font-weight: 800;
    line-height: 1.15;
    color: var(--mud-palette-text-primary);
    font-family: var(--mud-typography-default-family) !important;
}

.atcc-kpi-sub {
    font-size: var(--ts-font-xs) !important;
    color: var(--mud-palette-text-secondary);
    font-weight: 500;
    font-family: var(--mud-typography-default-family) !important;
}

/* =========================================================
   ATCC CHARTS
   ========================================================= */
.atcc-dashboard .chart-card {
    border-radius: 14px !important;
    transition: box-shadow .2s;
    font-family: var(--mud-typography-default-family) !important;
}

    .atcc-dashboard .chart-card:hover {
        box-shadow: 0 4px 18px rgba(0, 0, 0, 0.09) !important;
    }

.atcc-dashboard .chart-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 16px !important;
    font-weight: 600;
    color: var(--mud-palette-text-primary);
    font-family: var(--mud-typography-default-family) !important;
}

/* =========================================================
   DEVICE STATUS - Simple style matching NMS
   ========================================================= */
.device-status-simple {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 4px 0;
    font-family: var(--mud-typography-default-family) !important;
}

.device-status-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    border-radius: 8px;
    background: var(--mud-palette-background-grey);
    transition: background 0.2s;
    font-family: var(--mud-typography-default-family) !important;
}

    .device-status-row:hover {
        background: var(--mud-palette-action-default-hover);
    }

    .device-status-row.total-row {
        background: var(--mud-palette-surface);
        border: 1px solid var(--mud-palette-lines-default);
    }

.device-status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

    .device-status-dot.online-dot {
        background: #22c55e;
        box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.2);
    }

    .device-status-dot.offline-dot {
        background: #ef4444;
        box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2);
    }

    .device-status-dot.total-dot {
        background: #6366f1;
        box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
    }

.device-status-label {
    flex: 1;
    font-size: var(--ts-font-sm) !important;
    font-weight: 600;
    color: var(--mud-palette-text-primary);
    font-family: var(--mud-typography-default-family) !important;
}

.device-status-count {
    font-size: var(--ts-font-md) !important;
    font-weight: 800;
    color: var(--mud-palette-text-primary);
    min-width: 28px;
    text-align: right;
    font-family: var(--mud-typography-default-family) !important;
}

.device-status-percent {
    font-size: var(--ts-font-xs) !important;
    font-weight: 600;
    color: var(--mud-palette-text-secondary);
    min-width: 40px;
    text-align: right;
    font-family: var(--mud-typography-default-family) !important;
}

.device-status-progress {
    margin-top: 16px;
    padding: 0 4px;
}

.device-status-bar {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    display: flex;
    overflow: hidden;
    background: var(--mud-palette-table-lines);
}

.device-status-bar-online {
    height: 100%;
    background: linear-gradient(90deg, #22c55e, #16a34a);
    border-radius: 4px 0 0 4px;
    transition: width 0.5s ease;
}

.device-status-bar-offline {
    height: 100%;
    background: linear-gradient(90deg, #ef4444, #dc2626);
    border-radius: 0 4px 4px 0;
    transition: width 0.5s ease;
}

/* Dark mode adjustments */
.mud-theme-dark .device-status-row {
    background: rgba(255, 255, 255, 0.05);
}

    .mud-theme-dark .device-status-row.total-row {
        background: rgba(255, 255, 255, 0.08);
        border-color: rgba(255, 255, 255, 0.1);
    }

.vehicle-distribution-clean {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 22px;
    height: 205px;
}

/*.distribution-donut-clean {
    position: relative;
    width: 150px;
    min-width: 130px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.distribution-center {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.distribution-total {
    font-size: 20px;
    font-weight: 500;
    line-height: 1;
}

.distribution-label {
    font-size: 13px;
    color: #777;
}*/
.distribution-donut-clean {
    position: relative;
    width: 140px;
    height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.distribution-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 70px;
    height: 70px;
    text-align: center;
}

.distribution-total {
    font-size: 17px;
    font-weight: 700;
    line-height: 1;
}

.distribution-label {
    font-size: 14px;
    color: #666;
    line-height: 1.2;
}
.distribution-list-clean {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 8px;
    overflow: hidden; /* scrollbar hatao */
    max-height: none;
    margin-top: -55px;
}

.distribution-item-clean {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.distribution-left-clean {
    display: flex;
    align-items: center;
    gap: 8px;
}

.distribution-name-clean {
    font-size: 15px;
}

.distribution-right-clean {
    display: flex;
    align-items: center;
    gap: 8px;
}

.distribution-count-clean {
    font-size: 16px;
    font-weight: 700;
    width: 55px;
    text-align: right;
}

.distribution-percent-clean {
    width: 45px;
    text-align: right;
    color: #808080;
    font-size: 14px;
}




/* =========================================================
   ATCC RESPONSIVE
   ========================================================= */
@media (max-width: 1200px) {
    .atcc-header-simple {
        flex-direction: column;
        align-items: stretch;
    }

    .atcc-header-left {
        flex: 1 1 auto;
    }

    .atcc-header-kpis {
        justify-content: flex-start;
        flex: 1 1 100%;
    }

    .atcc-header-kpi {
        flex: 1 1 140px;
        min-width: 120px;
        padding: 8px 12px;
    }
}

@media (max-width: 768px) {
    .atcc-header-kpis {
        flex-direction: column;
    }

    .atcc-header-kpi {
        flex: 1 1 auto;
        min-width: unset;
        padding: 8px 14px;
    }

    .device-status-row {
        padding: 6px 10px;
        gap: 8px;
    }

    .device-status-label {
        font-size: 11px !important;
    }

    .device-status-count {
        font-size: 14px !important;
        min-width: 20px;
    }

    .device-status-percent {
        font-size: 10px !important;
        min-width: 32px;
    }
}

.kpi-incident-legend-scroll {
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 10px;
    scrollbar-width: thin;
    scrollbar-color: #3b82f6 transparent;
    padding-bottom: 2px;
}

    /* Chrome */
    .kpi-incident-legend-scroll::-webkit-scrollbar {
        height: 4px;
    }

    .kpi-incident-legend-scroll::-webkit-scrollbar-thumb {
        background: #3b82f6;
        border-radius: 20px;
    }

    .kpi-incident-legend-scroll::-webkit-scrollbar-track {
        background: transparent;
    }
/* =========================================================
   VIDS DASHBOARD - Typography matching NMS
   ========================================================= */
.vids-dashboard {
    font-family: var(--mud-typography-default-family) !important;
}

    /*.vids-dashboard .vids-lbl {
        display: flex;
        font-size: var(--ts-font-sm) !important;*/
    /*    font-weight: 600;*/
    /*color: var(--mud-palette-text-primary);
        font-family: var(--mud-typography-default-family) !important;
    }*/
    .vids-dashboard .vids-lbl {
        display: flex;
        font-size: var(--ts-font-md) !important;
        /*font-weight: 600;*/
        color: var(--mud-palette-text-primary);
        font-family: var(--mud-typography-default-family) !important;
    }




    .vids-dashboard .vids-val-sm {
        font-size: var(--ts-font-sm) !important;
        /*font-weight: 700;*/
        display: flex;
        font-family: var(--mud-typography-default-family) !important;
    }

    .vids-dashboard .vids-val-md {
        font-size: var(--ts-font-md) !important;
        /* font-weight: 800;*/
        font-family: var(--mud-typography-default-family) !important;
    }

    .vids-dashboard .vids-val-lg {
        font-size: var(--ts-font-lg) !important;
        /* font-weight: 800;*/
        font-family: var(--mud-typography-default-family) !important;
    }

    .vids-dashboard .vids-val-xl {
        font-size: var(--ts-font-xl) !important;
        font-weight: 800;
        font-family: var(--mud-typography-default-family) !important;
    }

    .vids-dashboard .dashboard-card-header {
        display: flex;
        align-items: center;
        gap: 8px;
        margin-bottom: 12px;
    }

        .vids-dashboard .dashboard-card-header .mud-typography {
            font-family: var(--mud-typography-default-family) !important;
        }

    .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 .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: 34px !important;
        }

    .vids-dashboard .traffic-chip-compact {
        font-weight: 600;
        min-width: 70px;
        justify-content: center;
        background: linear-gradient(135deg, #2196f3, #1976d2);
        color: white;
        border: none;
    }

    .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;
    }

    .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;
    }

    /*.vids-dashboard .vehicle-pie-with-details-no-scroll {*/
        /*  display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 20px;
        height: 240px;*/
        /*display: flex;
        align-items: flex-start;
        gap: 10px;
        height: 100%;
    }*/
    .vids-dashboard .vehicle-compact-details-no-scroll {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-self: flex-start;
        gap: 3px;
        min-height: 0;
        max-height: 100%;
        overflow-y: auto;
        padding-right: 2px;
    }
    .vids-dashboard .vehicle-compact-details-no-scroll {
        flex: 1;
        display: flex;
        flex-direction: column;
        gap: 3px;
        min-height: 0;
        max-height: 100%;
        overflow-y: auto;
        padding-right: 2px;
    }

    .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;
    }

    .vids-dashboard .detail-name {
        font-size: var(--ts-font-xs) !important;
        font-weight: 600;
        font-family: var(--mud-typography-default-family) !important;
    }

    .vids-dashboard .detail-count {
        font-size: var(--ts-font-sm) !important;
        font-weight: 700;
        font-family: var(--mud-typography-default-family) !important;
    }

    .vids-dashboard .detail-percent {
        font-size: var(--ts-font-xs) !important;
        color: var(--mud-palette-text-secondary);
        font-family: var(--mud-typography-default-family) !important;
    }
    .vids-dashboard .detail-row .mud-typography-caption {
        font-size: var(--ts-font-sm) !important; /* pehle xs tha, ab thoda bada */
        font-weight: 600;
        flex-shrink: 0;
    }
    .vids-dashboard .last-txn-details {
        width: 100%;
    }

    /*.vids-dashboard .detail-row {
        display: flex;
        flex-direction: column;
    }*/
    .vids-dashboard .detail-row {
        display: flex;
        flex-direction: row;
        justify-content: flex-start; 
        align-items: center;
        gap: 8px;
        white-space: nowrap;
    }
        .vids-dashboard .detail-row .mud-typography-body2,
        .vids-dashboard .detail-row .mud-chip {
            font-size: var(--ts-font-sm) !important;
        }
/* Dark mode adjustments */
.mud-theme-dark .vids-dashboard .compact-traffic-item {
    background: linear-gradient(135deg, rgba(255,255,255,.05), rgba(255,255,255,.08));
}

.mud-theme-dark .vids-dashboard .online-circle-compact {
    border-color: #22c55e;
}

.mud-theme-dark .vids-dashboard .offline-circle-compact {
    border-color: #ef4444;
}

/* Responsive */
@media (max-width: 1366px) {
    .vids-dashboard .status-circle-compact {
        width: 90px !important;
        height: 90px !important;
    }

    .vids-dashboard .devices-center-wrap {
        gap: 18px;
    }
}

@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;
    }
}

/*@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;
    }
}*/
@media (max-width: 600px) {
    .vids-dashboard .status-circle-compact {
        width: 70px !important;
        height: 70px !important;
    }
}
.total-chip {
    font-size: 26px !important;
    font-weight: 700 !important;
    height: 40px !important;
    min-height: 40px !important;
    padding: 0 18px !important;
    border-radius: 25px !important;
    display: flex;
    align-items: center;
    justify-content: center;
}
/* =========================================================
   AUDIT DASHBOARD - Device / Vehicle Type column responsive
   ========================================================= */
.audit-device-row {
    display: flex;
    align-items: center;
    white-space: nowrap; 
    margin-bottom: 3px;
    font-size: var(--ts-font-sm);
}

@media (max-width: 960px) {
    .audit-device-row {
        font-size: var(--ts-font-xs);
    }
}

@media (max-width: 600px) {
    .audit-device-row {
        font-size: 10px;
    }
}