:root {
    --primary: #0d6efd;
    --success: #198754;
    --info: #0dcaf0;
    --warning: #ffc107;
    --bg: #f5f7fa;
    --sidebar-width: 380px;
    --nav-height: 56px;
}
body { background: var(--bg); font-size: 14px; overflow-x: hidden; }
.navbar-brand { font-weight: 600; letter-spacing: 0.5px; }
.page-content { max-width: 1400px; margin: 0 auto; padding: 0 12px; }

/* ===== Navbar responsive ===== */
.navbar-nav { flex-wrap: wrap; }
.navbar-nav .nav-link { padding: 0.5rem 0.75rem; white-space: nowrap; }
.navbar-collapse { max-height: calc(100vh - var(--nav-height)); overflow-y: auto; }
@media (max-width: 992px) {
    .navbar-nav { flex-direction: row; flex-wrap: wrap; gap: 0; }
    .navbar-nav .nav-item { flex-shrink: 0; }
}

/* Stat cards */
.stat-card { border: none; border-radius: 12px; box-shadow: 0 2px 8px rgba(0,0,0,0.08); transition: transform 0.2s; }
.stat-card:hover { transform: translateY(-3px); }
.stat-card .card-body { display: flex; align-items: center; position: relative; }
.stat-icon { font-size: 2.5rem; opacity: 0.3; position: absolute; right: 15px; top: 50%; transform: translateY(-50%); }
.stat-value { font-size: 1.8rem; font-weight: 700; }
.stat-label { font-size: 0.85rem; opacity: 0.9; }

/* Charts */
.bar-row { display: flex; align-items: center; margin-bottom: 6px; }
.bar-label { width: 100px; text-align: right; padding-right: 10px; font-size: 0.85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-track { flex: 1; background: #e9ecef; border-radius: 4px; height: 24px; position: relative; }
.bar-fill { height: 100%; border-radius: 4px; display: flex; align-items: center; padding-left: 8px; color: white; font-size: 0.75rem; font-weight: 600; transition: width 0.5s; min-width: 2px; }

/* Coverage bars */
.coverage-item { margin-bottom: 10px; }
.coverage-label { display: flex; justify-content: space-between; font-size: 0.85rem; margin-bottom: 3px; }
.coverage-track { background: #e9ecef; border-radius: 4px; height: 8px; }
.coverage-fill { height: 100%; border-radius: 4px; }

/* Table */
.table { background: white; border-radius: 8px; overflow: hidden; box-shadow: 0 1px 4px rgba(0,0,0,0.06); }
.table th { white-space: nowrap; font-size: 0.8rem; }
.table td { font-size: 0.85rem; }
.station-link { color: var(--primary); cursor: pointer; font-weight: 500; text-decoration: none; }
.station-link:hover { text-decoration: underline; }

/* Pagination */
.pagination { justify-content: center; }

/* Detail modal */
.modal-xl { max-width: 1100px; }
.detail-tabs { border-bottom: 2px solid #dee2e6; margin-bottom: 15px; }
.detail-tab { padding: 8px 16px; cursor: pointer; border: none; background: none; font-size: 0.9rem; color: #6c757d; border-bottom: 2px solid transparent; margin-bottom: -2px; }
.detail-tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
.detail-tab:hover { color: var(--primary); }
.detail-section { display: none; }
.detail-section.active { display: block; }
.detail-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px 20px; }
.detail-parallel { display: flex; gap: 20px; align-items: flex-start; }
.detail-parallel-col { flex: 1 1 0; min-width: 0; }
@media (max-width: 768px) { .detail-parallel { flex-direction: column; gap: 16px; } }
.detail-item { display: flex; border-bottom: 1px solid #f0f0f0; padding: 4px 0; }
.detail-label { width: 120px; color: #6c757d; font-size: 0.8rem; flex-shrink: 0; }
.detail-value { font-size: 0.85rem; font-weight: 500; word-break: break-all; }
.detail-table { width: 100%; font-size: 0.8rem; }
.detail-table th { background: #f8f9fa; }
.location-coordinate-value { flex: 1 1 auto; min-width: 0; }
.location-coordinate-value .form-control { width: 100%; min-width: 0; height: 30px; font-size: 0.8rem; }
.location-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.location-photo-upload { width: 132px; height: 92px; border-style: dashed; gap: 3px; font-size: 0.75rem; }
.location-photo-entry { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.location-photo-thumb { width: 132px; height: 104px; flex: 0 0 auto; }
.location-photo-thumb > img { width: 100%; height: 100%; object-fit: cover; cursor: pointer; }
.location-photo-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.location-photo-panel { min-width: 0; padding: 8px; border: 1px solid #e2e8f0; border-radius: 6px; background: #fafbfc; }

@media (max-width: 767.98px) {
    .location-actions .btn { flex: 1 1 calc(50% - 4px); }
    .location-photo-entry { align-items: flex-start; }
    .location-photo-grid { grid-template-columns: 1fr; }
}

/* Photo gallery */
.photo-card { position: relative; overflow: hidden; border-radius: 8px; cursor: pointer; aspect-ratio: 1; background: #f0f0f0; }
.photo-card img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s; }
.photo-card:hover img { transform: scale(1.08); }
.photo-overlay { position: absolute; bottom: 0; left: 0; right: 0; background: linear-gradient(transparent, rgba(0,0,0,0.7)); color: white; padding: 20px 8px 6px; font-size: 0.7rem; }
.photo-badge { position: absolute; top: 4px; left: 4px; }

/* Lightbox */
.lightbox { display: none; position: fixed; inset: 0; width: 100%; height: 100%; background: rgba(5,13,20,0.94); z-index: 9999; justify-content: center; align-items: center; padding: 64px 88px 58px; }
.lightbox.show { display: flex; }
.lightbox img { max-width: 100%; max-height: 100%; border-radius: 6px; object-fit: contain; box-shadow: 0 18px 60px rgba(0,0,0,0.42); }
.lightbox iframe { display: none; width: min(1180px, 100%); height: 100%; border: 0; border-radius: 6px; background: #fff; box-shadow: 0 18px 60px rgba(0,0,0,0.42); }
.lightbox-close,
.lightbox-nav { position: absolute; display: flex; align-items: center; justify-content: center; border: 1px solid rgba(255,255,255,0.22); background: rgba(13,27,37,0.78); color: #fff; cursor: pointer; transition: background-color 0.15s, border-color 0.15s; }
.lightbox-close:hover,
.lightbox-nav:hover { background: rgba(35,72,91,0.95); border-color: rgba(255,255,255,0.52); }
.lightbox-close { top: 16px; right: 20px; width: 40px; height: 40px; border-radius: 6px; font-size: 1.25rem; }
.lightbox-nav { top: 50%; width: 48px; height: 64px; margin-top: -32px; border-radius: 6px; font-size: 1.65rem; }
.lightbox-prev { left: 22px; }
.lightbox-next { right: 22px; }
.lightbox-caption { position: absolute; left: 50%; bottom: 17px; transform: translateX(-50%); color: #f8fafc; font-size: 0.85rem; line-height: 1; padding: 8px 12px; border-radius: 4px; background: rgba(13,27,37,0.78); }

@media (max-width: 767.98px) {
    .lightbox { padding: 60px 52px 54px; }
    .lightbox-nav { width: 40px; height: 54px; font-size: 1.35rem; }
    .lightbox-prev { left: 6px; }
    .lightbox-next { right: 6px; }
    .lightbox-close { top: 10px; right: 10px; }
}

/* Loading */
.loading-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(255,255,255,0.8); z-index: 9998; display: flex; justify-content: center; align-items: center; flex-direction: column; }
.loading-overlay .spinner-border { width: 3rem; height: 3rem; }

/* Badge colors */
.badge-勘察 { background: #0d6efd; }
.badge-设计 { background: #6f42c1; }
.badge-并网 { background: #198754; }
.badge-工程 { background: #fd7e14; }
.badge-档案 { background: #6c757d; }

/* Modal */
.modal { position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: 1050; overflow: auto; background: rgba(0,0,0,0.5); padding: 20px; }
.modal.show { display: block !important; }
.modal-dialog { max-width: 1100px; margin: 20px auto; }
.modal-content { border: none; border-radius: 12px; box-shadow: 0 8px 32px rgba(0,0,0,0.2); }
@media (max-width: 768px) {
    .modal { padding: 0; }
    .modal-dialog { margin: 0; max-width: 100%; }
    .modal-content { border-radius: 0; min-height: 100vh; }
    .modal-dialog-scrollable .modal-body { max-height: calc(100vh - 120px); }
    .modal-header, .modal-footer { padding: 0.5rem 0.75rem; }
}

/* ===== Loading skeleton ===== */
.skeleton { background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%); background-size: 200% 100%; animation: skeletonShimmer 1.5s infinite; border-radius: 4px; }
@keyframes skeletonShimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.skeleton-row { height: 32px; margin-bottom: 8px; }

/* ===== Empty state ===== */
.empty-state { text-align: center; padding: 3rem 1rem; color: #adb5bd; }
.empty-state i { font-size: 3rem; }
.empty-state p { margin-top: 0.5rem; font-size: 0.9rem; }

/* ===== Page transition animation ===== */
.page-content { animation: pageFadeIn 0.2s ease; }
@keyframes pageFadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }

/* ===== Operations page collapsible cards ===== */
.ops-card-toggle { cursor: pointer; user-select: none; transition: filter 0.15s; }
.ops-card-toggle:hover { filter: brightness(1.08); }
.ops-card-toggle:active { filter: brightness(0.95); }
.ops-chevron { transition: transform 0.25s ease; font-size: 0.9rem; margin-top: 2px; }
.ops-card-toggle .bi-chevron-down { transform: rotate(0deg); }
.ops-card-toggle .bi-chevron-up { transform: rotate(0deg); }

@media (max-width: 768px) {
    .detail-grid { grid-template-columns: 1fr; }
    .stat-value { font-size: 1.3rem; }
    .stat-icon { font-size: 2rem; }
    .page-content { padding: 0 8px; }
    .table { font-size: 0.78rem; }
    .table th, .table td { padding: 0.3rem 0.4rem; }
    .btn-sm { padding: 0.2rem 0.5rem; font-size: 0.78rem; }
}

/* ===== Work Order Styles ===== */
.detail-grid-edit { display: grid; grid-template-columns: repeat(2, 1fr); gap: 4px 16px; }
@media (max-width: 768px) { .detail-grid-edit { grid-template-columns: 1fr; } }

/* Timeline */
.timeline { position: relative; padding-left: 24px; }
.timeline::before { content: ''; position: absolute; left: 7px; top: 4px; bottom: 4px; width: 2px; background: #dee2e6; }
.timeline-item { position: relative; margin-bottom: 16px; }
.timeline-dot { position: absolute; left: -24px; top: 4px; width: 14px; height: 14px; border-radius: 50%; border: 2px solid #dee2e6; z-index: 1; }
.timeline-content { background: #f8f9fa; border-radius: 8px; padding: 8px 12px; }

/* WO badges */
.wo-priority-urgent { color: #dc3545; }
.wo-priority-high { color: #fd7e14; }

/* Edit form highlight */
.detail-grid-edit input:focus, .detail-grid-edit textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 0.15rem rgba(13, 110, 253, 0.15);
}

/* Modal scroll fix */
.modal-dialog-scrollable .modal-body { max-height: calc(100vh - 200px); overflow-y: auto; }

/* Toast */
.toast-container { z-index: 11000; }

/* ===== Operations Page Styles ===== */
.ops-section { animation: fadeIn 0.3s ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* Video in lightbox */
#lightbox video { border-radius: 8px; box-shadow: 0 4px 20px rgba(0,0,0,0.3); }

/* Video thumbnail in forms */
video.img-thumbnail { object-fit: cover; background: #000; }

/* Role badge in nav */
.navbar .badge { font-size: 0.75rem; }

/* Operations section headers */
.ops-section .card-header { font-weight: 600; }

/* Media preview grid */
#inspMediaPreview video { background: #000; }

/* ===== Report Center Styles ===== */
.tab-bar { display: flex; gap: 0; border-bottom: 2px solid #e0e0e0; margin-bottom: 15px; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.tab-bar .tab-item { padding: 10px 24px; cursor: pointer; border-bottom: 3px solid transparent; font-weight: 500; color: #666; transition: all 0.2s; white-space: nowrap; flex-shrink: 0; }
.tab-bar .tab-item:hover { color: #0d6efd; }
.tab-bar .tab-item.active { color: #0d6efd; border-bottom-color: #0d6efd; }
@media (max-width: 576px) {
    .tab-bar .tab-item { padding: 8px 14px; font-size: 0.85rem; }
}

.rc-upload-area { border: 2px dashed #adb5bd; border-radius: 10px; padding: 30px; text-align: center; cursor: pointer; transition: all 0.2s; }
.rc-upload-area:hover { border-color: #0d6efd; background: #f0f6ff; }
.rc-upload-area.dragover { border-color: #198754; background: #e8f5e9; }

.rc-tab-content { animation: fadeIn 0.3s ease; }

/* Performance metric cards */
.metric-card { transition: box-shadow 0.2s; }
.metric-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.1); }

#rcChart { max-height: 320px; }

/* Report center stat cards */
#page-report-center .card-body { padding: 0.75rem 1rem; }

/* Stats table compact */
#rcStatsTable { font-size: 0.875rem; }
#rcStatsTable th { background: #f8f9fa; }

/* ===== Dashboard Map & Charts ===== */
.donut-ring { width: 140px; height: 140px; position: relative; display: inline-block; }
.donut-ring canvas { width: 100% !important; height: 100% !important; }
.donut-center { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); text-align: center; pointer-events: none; }
.donut-num { font-size: 1.8rem; font-weight: 700; line-height: 1; color: #333; }
.donut-label { font-size: 0.75rem; color: #888; margin-top: 2px; }

.donut-legend-item { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; font-size: 0.82rem; }
.donut-legend-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.donut-legend-num { margin-left: auto; font-weight: 600; }

/* Weather cards */
.weather-province-card { border: 1px solid #e0e0e0; border-radius: 10px; padding: 10px 12px; text-align: center; transition: all 0.2s; background: #fff; }
.weather-province-card:hover { box-shadow: 0 2px 12px rgba(0,0,0,0.1); transform: translateY(-2px); }
.weather-province-name { font-size: 0.85rem; font-weight: 600; color: #555; }
.weather-province-icon { font-size: 2rem; margin: 4px 0; }
.weather-province-temp { font-size: 1.3rem; font-weight: 700; }
.weather-province-desc { font-size: 0.72rem; color: #888; }
.weather-province-extra { font-size: 0.7rem; color: #aaa; margin-top: 2px; }

/* Map tooltip */
.china-map-tooltip { max-height: 300px; overflow-y: auto; }
.china-map-tooltip .tooltip-city-row { display: flex; justify-content: space-between; padding: 2px 0; font-size: 0.8rem; }
.china-map-tooltip .tooltip-city-name { color: #8ab4d9; }
.china-map-tooltip .tooltip-city-count { font-weight: 600; color: #00d4ff; }

/* Dashboard map tooltip dark background already set via ECharts options */

/* ===== Comprehensive Query (综合查询) ===== */
.cq-field-group { border: 1px solid #e0e0e0; border-radius: 8px; padding: 12px 14px; margin-bottom: 12px; background: #fff; }
.cq-field-group-title { font-weight: 600; color: #0d6efd; margin-bottom: 8px; font-size: 0.9rem; border-bottom: 1px dashed #e0e0e0; padding-bottom: 6px; }
.cq-field-group-title .bi { margin-right: 4px; }
.cq-field-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px; }
@media (max-width: 768px) { .cq-field-cols { grid-template-columns: 1fr; } }
.cq-field-item { display: flex; align-items: center; gap: 6px; padding: 2px 0; font-size: 0.85rem; cursor: pointer; }
.cq-field-item:hover { color: #0d6efd; }
.cq-field-item input[type="checkbox"] { cursor: pointer; }
.cq-field-name { flex: 1; }
.cq-field-key { font-size: 0.7rem; color: #999; margin-left: 4px; }

#cqTable thead th { white-space: nowrap; position: sticky; top: 0; background: #f8f9fa; z-index: 2; font-size: 0.8rem; }
#cqTable tbody td { font-size: 0.82rem; vertical-align: middle; max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#cqTable tbody tr:hover { background: #f0f8ff !important; }
.cq-tag-pill { display: inline-block; background: #e7f1ff; color: #0d6efd; border: 1px solid #b6d4fe; border-radius: 10px; padding: 1px 8px; font-size: 0.7rem; margin: 1px; }
.cq-tag-pill.muted { background: #f1f3f5; color: #6c757d; border-color: #dee2e6; }
.cq-tag-empty { color: #999; font-style: italic; font-size: 0.78rem; }
.cq-perm-banner { background: #fff3cd; border: 1px solid #ffe69c; border-radius: 6px; padding: 6px 12px; font-size: 0.85rem; color: #856404; margin-bottom: 10px; }
.cq-perm-banner .bi { margin-right: 4px; }

/* ===== Floating draggable CF modal (over station detail) ===== */
.modal.cf-floating {
    background: transparent !important;
    z-index: 1070;
    padding: 0 !important;
    pointer-events: none;
    overflow: visible;
}
.modal.cf-floating .modal-dialog {
    pointer-events: auto;
    position: fixed !important;
    top: 60px;
    left: auto;
    right: 30px;
    margin: 0;
    max-width: 600px;
    width: 600px;
    box-shadow: 0 12px 48px rgba(0,0,0,0.3);
    animation: cfFloatIn 0.2s ease-out;
}
.modal.cf-floating .modal-header {
    cursor: move;
    user-select: none;
}
.modal.cf-floating .modal-header:active {
    cursor: grabbing;
}
@keyframes cfFloatIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ===== Wide detail modal with sidebar layout ===== */
.detail-dialog-wide {
    max-width: 95vw !important;
}
.detail-layout {
    display: flex;
    flex-direction: row;
    gap: 0;
    padding: 0 !important;
    height: calc(100vh - 140px);
    max-height: 750px;
    min-height: 500px;
}
.detail-main {
    flex: 1 1 65%;
    min-width: 0;
    padding: 16px 20px;
    overflow-y: auto;
}
.detail-sidebar {
    flex: 0 0 var(--sidebar-width);
    width: var(--sidebar-width);
    border-left: 1px solid #dee2e6;
    background: #f8f9fa;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.detail-sidebar.hidden {
    display: none;
}

/* ===== Mobile: stack sidebar below main ===== */
@media (max-width: 992px) {
    .detail-layout {
        flex-direction: column;
        height: auto;
        max-height: none;
        min-height: auto;
    }
    .detail-main {
        flex: 1 1 auto;
        max-height: 60vh;
        padding: 12px 14px;
    }
    .detail-sidebar {
        flex: 0 0 auto;
        width: 100%;
        border-left: none;
        border-top: 1px solid #dee2e6;
        max-height: 40vh;
    }
    .detail-dialog-wide {
        max-width: 100vw !important;
    }
}
@media (max-width: 576px) {
    .detail-main { max-height: 55vh; padding: 10px; }
    .detail-sidebar { max-height: 45vh; }
    .detail-tabs { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .detail-tab { padding: 6px 10px; font-size: 0.82rem; white-space: nowrap; }
}
.detail-sidebar .sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: #fff;
    border-bottom: 1px solid #dee2e6;
    flex-shrink: 0;
}
.detail-sidebar .sidebar-title {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 600;
    color: #343a40;
}
.detail-sidebar .sidebar-close {
    font-size: 1rem;
    padding: 0 6px;
    line-height: 1.3;
    border: none;
    background: none;
    color: #6c757d;
    cursor: pointer;
}
.detail-sidebar .sidebar-close:hover {
    color: #dc3545;
}
#sidebarContent {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 10px 14px;
}
#sidebarContent::-webkit-scrollbar { width: 4px; }
#sidebarContent::-webkit-scrollbar-thumb { background: #c1c9d0; border-radius: 4px; }

/* Sidebar type tabs */
.sidebar-type-tabs {
    display: flex;
    border-bottom: 1px solid #dee2e6;
    background: #fff;
    flex-shrink: 0;
    overflow-x: auto;
}
.sidebar-tab {
    padding: 6px 10px;
    border: none;
    background: none;
    font-size: 0.75rem;
    color: #6c757d;
    cursor: pointer;
    white-space: nowrap;
    border-bottom: 2px solid transparent;
    transition: all 0.15s;
}
.sidebar-tab:hover { color: #0d6efd; }
.sidebar-tab.active {
    color: #0d6efd;
    border-bottom-color: #0d6efd;
    font-weight: 600;
}

/* Sidebar record cards (shared across CF/Fault/Inspection/Dispatch) */
.sidebar-record-card {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 8px 10px;
    margin-bottom: 8px;
    font-size: 0.78rem;
    transition: box-shadow 0.15s;
    cursor: pointer;
}
.sidebar-record-card:hover {
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
    border-color: #b6d4fe;
}
.sidebar-record-card .rec-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
    gap: 4px;
    flex-wrap: wrap;
}
.sidebar-record-card .rec-detail {
    color: #495057;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 3px;
}
.sidebar-record-card .rec-footer {
    font-size: 0.72rem;
    color: #868e96;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.sidebar-record-card .rec-badge {
    font-size: 0.65rem;
    padding: 1px 6px;
    border-radius: 3px;
}

/* Inspection sidebar: keep historical fields readable instead of mixing them in one block. */
.inspection-record-overview {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 8px;
    padding: 7px 8px;
    border: 1px solid #dbe4ec;
    border-radius: 6px;
    background: #f8fafc;
    color: #334155;
}
.inspection-record-overview > div:first-child { display: flex; flex-direction: column; gap: 2px; }
.inspection-record-overview > div:first-child span { color: #64748b; font-size: 0.7rem; }
.inspection-status-summary { display: flex; gap: 5px; flex-wrap: wrap; justify-content: flex-end; }
.inspection-status-summary-item { display: inline-flex; align-items: center; gap: 3px; color: #475569; font-size: 0.72rem; }
.inspection-status-summary-item .badge { font-size: 0.62rem; padding: 2px 5px; }
.inspection-record-section { margin-bottom: 12px; }
.inspection-record-section-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin: 6px 0;
    padding: 6px 8px;
    border-left: 3px solid #3b82f6;
    background: #eef5ff;
    color: #173b63;
}
.inspection-record-section-special .inspection-record-section-heading { border-left-color: #7c3aed; background: #f4efff; color: #4c1d95; }
.inspection-record-section-other .inspection-record-section-heading { border-left-color: #64748b; background: #f1f5f9; color: #334155; }
.inspection-record-section-heading div { display: flex; flex-direction: column; gap: 1px; }
.inspection-record-section-heading strong { font-size: 0.8rem; }
.inspection-record-section-heading span { font-size: 0.67rem; color: #64748b; }
.inspection-record-section-heading > .badge { font-size: 0.65rem; font-weight: 500; }
.inspection-detail-group { margin: 6px 0 4px; padding: 6px; border: 1px solid #e2e8f0; border-radius: 5px; background: #f8fafc; }
.inspection-detail-group h6 { margin: 0 0 4px; font-size: 0.7rem; font-weight: 700; color: #475569; }
.inspection-detail-routine { background: #f5f9ff; border-color: #cfe0f7; }
.inspection-detail-routine h6 { color: #1d4ed8; }
.inspection-detail-special { background: #fbf8ff; border-color: #e5d8fa; }
.inspection-detail-special h6 { color: #6d28d9; }
.inspection-detail-measure { background: #f8fafc; }
.inspection-field-box { min-height: 32px; padding: 5px 7px; border: 1px solid #d9e1e8; border-radius: 5px; background: #fff; color: #27364a; line-height: 1.35; word-break: break-word; }
.inspection-field-label { display: block; margin-bottom: 1px; color: #64748b; font-size: 0.67rem; }
.inspection-detail-group + .rec-footer { margin-top: 6px; }

/* Sidebar form styles (shared) */
.sidebar-record-form .form-label {
    font-size: 0.78rem;
    margin-bottom: 2px;
    font-weight: 500;
}
.sidebar-record-form .form-control,
.sidebar-record-form .form-select {
    font-size: 0.8rem;
    padding: 5px 8px;
    border-radius: 4px;
}
.sidebar-record-form textarea.form-control {
    font-size: 0.8rem;
    padding: 5px 8px;
}
.sidebar-record-form .row { --bs-gutter-y: 0.4rem; }
.sidebar-record-form .btn { font-size: 0.78rem; }

/* Sidebar action bar */
.sidebar-action-bar {
    display: flex;
    gap: 6px;
    margin-bottom: 10px;
    flex-shrink: 0;
}

/* Station detail: compact cross-record dispatch decision summary. */
.station-history-summary {
    margin: 0 0 10px;
    padding: 9px 10px;
    border: 1px solid #cbd5e1;
    border-left: 4px solid #64748b;
    border-radius: 6px;
    background: #f8fafc;
}
.station-history-summary-risk { border-left-color: #dc3545; background: #fff7f7; }
.station-history-summary-recommend { border-left-color: #f59f00; background: #fffaf0; }
.station-history-summary-duplicate { border-left-color: #0d6efd; background: #f4f8ff; }
.station-history-summary-clear { border-left-color: #198754; background: #f4fbf7; }
.station-summary-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.station-summary-head > div { display: flex; flex-direction: column; gap: 1px; }
.station-summary-head strong { color: #243447; font-size: .8rem; }
.station-summary-head strong i { margin-right: 3px; }
.station-summary-head span { color: #64748b; font-size: .66rem; }
.station-summary-decision { display: inline-flex; align-items: center; gap: 3px; color: #334155 !important; font-size: .7rem !important; font-weight: 600; text-align: right; }
.station-history-summary-risk .station-summary-decision { color: #b42318 !important; }
.station-history-summary-recommend .station-summary-decision { color: #a15c00 !important; }
.station-history-summary-duplicate .station-summary-decision { color: #1554ad !important; }
.station-history-summary-clear .station-summary-decision { color: #137333 !important; }
.station-summary-metrics { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; margin-top: 8px; }
.station-summary-metric { min-width: 0; padding: 4px 2px; border: 1px solid #e2e8f0; border-radius: 4px; background: #fff; color: #475569; cursor: pointer; text-align: center; }
.station-summary-metric:hover { border-color: #93c5fd; background: #f8fbff; }
.station-summary-metric strong, .station-summary-metric span { display: block; }
.station-summary-metric strong { font-size: .9rem; line-height: 1.1; color: #334155; }
.station-summary-metric span { margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .62rem; }
.station-summary-metric.metric-warning strong { color: #b26a00; }
.station-summary-metric.metric-danger strong { color: #c92a2a; }
.station-summary-metric.metric-info strong { color: #1769aa; }
.station-summary-detail { display: flex; flex-wrap: wrap; gap: 4px 9px; margin-top: 7px; padding-top: 6px; border-top: 1px solid rgba(100,116,139,.18); color: #64748b; font-size: .64rem; }
.station-summary-detail i { margin-right: 2px; }
@media (max-width: 520px) {
    .station-summary-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .station-summary-head { flex-direction: column; }
    .station-summary-decision { text-align: left; }
}

/* ===== Call feedback records embedded in station detail (tab view) ===== */
.cf-detail-list {
    max-height: calc(100vh - 280px);
    overflow-y: auto;
    padding-right: 4px;
}
.cf-detail-card {
    background: #fff;
    font-size: 0.85rem;
    transition: box-shadow 0.15s;
}
.cf-detail-card:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.cf-detail-card strong {
    color: #495057;
    font-weight: 600;
}

/* ===== Work Order Management (天枢风格) ===== */
.wo-search-card { border-radius: 8px; border: none; box-shadow: 0 1px 4px rgba(0,0,0,0.06); }
.wo-search-row .form-control, .wo-search-row .form-select { border-radius: 4px; }
.wo-category-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    background: #fff;
    padding: 10px 12px;
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.wo-cat-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border: 1px solid #e9ecef;
    background: #fff;
    border-radius: 20px;
    font-size: 0.85rem;
    color: #495057;
    cursor: pointer;
    transition: all 0.15s;
}
.wo-cat-btn:hover { background: #f8f9fa; border-color: #dee2e6; }
.wo-cat-btn.active { background: #e6f9f3; border-color: #20c997; color: #0d6efd; font-weight: 600; }
.wo-cat-count {
    display: inline-block;
    min-width: 20px;
    padding: 1px 6px;
    background: #f1f3f5;
    border-radius: 10px;
    font-size: 0.75rem;
    color: #6c757d;
}
.wo-cat-btn.active .wo-cat-count { background: #20c997; color: #fff; }
.wo-status-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    background: #fff;
    padding: 12px;
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

/* Local work-order analysis: compact, filterable and independent of AI services. */
.wo-analysis-panel { padding: 12px; border: 1px solid #dbe4ec; border-radius: 8px; background: #fbfdff; }
.wo-analysis-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.wo-analysis-header > div { display: flex; flex-direction: column; gap: 2px; }
.wo-analysis-header strong { color: #1e3a56; font-size: .92rem; }
.wo-analysis-header strong i { margin-right: 4px; }
.wo-analysis-header span { color: #64748b; font-size: .72rem; }
.wo-analysis-filters { display: grid; grid-template-columns: repeat(4, minmax(130px, 1fr)) 1.5fr auto; gap: 6px; margin-top: 10px; }
.wo-analysis-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; margin-top: 10px; }
.wo-analysis-metrics > div { padding: 8px; border: 1px solid #e2e8f0; border-radius: 6px; background: #fff; text-align: center; }
.wo-analysis-metrics strong, .wo-analysis-metrics span { display: block; }
.wo-analysis-metrics strong { color: #1769aa; font-size: 1.15rem; line-height: 1.1; }
.wo-analysis-metrics span { color: #64748b; font-size: .68rem; margin-top: 3px; }
.wo-analysis-columns { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 10px; }
.wo-analysis-columns section { min-width: 0; padding: 8px; border: 1px solid #e2e8f0; border-radius: 6px; background: #fff; }
.wo-analysis-columns h6 { margin: 0 0 5px; color: #334155; font-size: .75rem; }
.wo-analysis-list-row { display: flex; justify-content: space-between; gap: 8px; padding: 4px 0; border-bottom: 1px solid #f1f5f9; color: #475569; font-size: .72rem; }
.wo-analysis-list-row:last-child { border-bottom: 0; }
.wo-analysis-list-row span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wo-analysis-list-row strong { color: #1769aa; }
@media (max-width: 900px) {
    .wo-analysis-filters { grid-template-columns: repeat(2, minmax(130px, 1fr)); }
    .wo-analysis-filters .btn { grid-column: span 2; }
    .wo-analysis-columns { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
    .wo-analysis-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .wo-analysis-filters { grid-template-columns: 1fr; }
    .wo-analysis-filters .btn { grid-column: auto; }
}
.wo-status-item {
    flex: 1 1 auto;
    min-width: 90px;
    text-align: center;
    padding: 8px;
    border-right: 1px solid #f0f0f0;
}
.wo-status-item:last-child { border-right: none; }
.wo-status-value { font-size: 1.4rem; font-weight: 700; line-height: 1; }
.wo-status-label { font-size: 0.75rem; color: #6c757d; margin-top: 4px; }
.wo-table-wrap { background: #fff; border-radius: 8px; box-shadow: 0 1px 4px rgba(0,0,0,0.06); padding: 0 12px; }
.wo-table thead th { background: #f8f9fa; font-weight: 600; font-size: 0.8rem; color: #495057; border-bottom: 2px solid #e9ecef; }
.wo-table tbody td { font-size: 0.85rem; vertical-align: middle; }
.wo-warn-badge { font-size: 0.75rem; }

/* ===== Work Order Import Drop Zone ===== */
.wo-import-dropzone {
    border: 2px dashed #adb5bd;
    border-radius: 12px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.25s ease;
    background: #f8f9fa;
}
.wo-import-dropzone:hover {
    border-color: #198754;
    background: #e8f5e9;
}
.wo-import-dropzone.dragover {
    border-color: #198754;
    background: #d4edda;
    transform: scale(1.01);
}
.wo-import-dropzone-inner { pointer-events: none; }
.wo-import-preview {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #dee2e6;
    border-radius: 8px;
}
.wo-import-preview table {
    width: 100%;
    font-size: 0.8rem;
    margin: 0;
}
.wo-import-preview thead th {
    background: #e9ecef;
    position: sticky;
    top: 0;
    z-index: 1;
    white-space: nowrap;
}
.wo-import-preview tbody td {
    white-space: nowrap;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
}
.wo-import-img-preview {
    max-width: 100%;
    max-height: 350px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.wo-import-map-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    font-size: 0.85rem;
}
.wo-import-map-row select {
    max-width: 200px;
}
.wo-import-stat {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

/* ===== Work Order Progress Bar ===== */
.wo-progress { display: flex; justify-content: space-between; position: relative; margin: 20px 0; }
.wo-progress::before {
    content: '';
    position: absolute;
    top: 14px;
    left: 5%;
    right: 5%;
    height: 3px;
    background: #e9ecef;
    z-index: 0;
}
.wo-step { position: relative; z-index: 1; text-align: center; flex: 1; }
.wo-step-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #e9ecef;
    color: #adb5bd;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    margin-bottom: 6px;
}
.wo-step.done .wo-step-icon { background: #20c997; color: #fff; }
.wo-step.active .wo-step-icon { background: #0d6efd; color: #fff; box-shadow: 0 0 0 3px rgba(13,110,253,0.15); }
.wo-step-label { font-size: 0.75rem; color: #6c757d; }
.wo-step-time { font-size: 0.7rem; color: #adb5bd; margin-top: 2px; }

@media (max-width: 768px) {
    .wo-category-tabs { gap: 6px; }
    .wo-cat-btn { padding: 5px 10px; font-size: 0.8rem; }
    .wo-status-item { min-width: 70px; padding: 6px 4px; }
    .wo-status-value { font-size: 1.1rem; }
    .wo-step-label { font-size: 0.65rem; }
}

/* ===== Mobile responsive filter bars ===== */
@media (max-width: 768px) {
    /* Filter rows: stack on mobile */
    #page-workorders .row.g-2.align-items-end > div,
    #page-operations .row.g-2 > div,
    #page-special-maintenance .row.g-2.align-items-end > div,
    #page-report-center .row.g-2 > div {
        margin-bottom: 0.4rem;
    }
    /* Donut ring smaller on mobile */
    .donut-ring { width: 110px; height: 110px; }
    .donut-num { font-size: 1.4rem; }
    /* Weather cards: 2 per row on mobile */
    .weather-province-card { padding: 6px 8px; }
    .weather-province-icon { font-size: 1.5rem; }
    .weather-province-temp { font-size: 1.1rem; }
    /* China map height */
    #chinaMap { height: 350px !important; }
    /* Floating CF modal: full width on mobile */
    .modal.cf-floating .modal-dialog {
        right: 0 !important;
        left: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        top: auto !important;
        bottom: 0 !important;
    }
    /* Report center stat cards */
    #page-report-center .card-body { padding: 0.5rem 0.75rem; }
    /* Pagination: compact */
    .pagination .page-link { padding: 0.3rem 0.6rem; }
    /* Toast: full width on mobile */
    .toast-container { left: 0; right: 0; }
    .toast-container .toast { min-width: auto; }
}

/* ===== Touch-friendly improvements ===== */
@media (max-width: 992px) {
    .station-link, .btn-sm, .nav-link { min-height: 36px; }
    .form-control, .form-select { min-height: 38px; }
    .sidebar-tab { padding: 8px 12px; font-size: 0.8rem; }
}

/* ===== Smooth scrollbar ===== */
.table-responsive { -webkit-overflow-scrolling: touch; }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #f1f1f1; }
::-webkit-scrollbar-thumb { background: #c1c9d0; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #a1a9b0; }

/* ===== Card improvements ===== */
.card { border: none; box-shadow: 0 1px 4px rgba(0,0,0,0.06); border-radius: 10px; }
.card-header { border-radius: 10px 10px 0 0 !important; font-weight: 600; }

/* ===== Badge sizing ===== */
.badge { font-size: 0.72rem; padding: 0.3em 0.6em; }

/* ===== Search input with icon ===== */
.input-group .form-control:focus { box-shadow: 0 0 0 0.15rem rgba(13, 110, 253, 0.15); }

/* =========================================================
   Operations Dashboard (dark large-screen style)
   ========================================================= */
.ops-dashboard-page {
    background: linear-gradient(180deg, #030b1e 0%, #061536 100%);
    min-height: 100vh;
    padding: 0;
    color: #c8d6f0;
    font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
}
.ops-dashboard-page .ops-loading { color: #5d7b84; }
.ops-dashboard-page .ops-spinner {
    border-color: rgba(47, 127, 143, 0.18);
    border-top-color: #2f7f8f;
}
.ops-dashboard-page .china-map-tooltip .tooltip-city-name { color: #607783; }
.ops-dashboard-page .china-map-tooltip .tooltip-city-count { color: #176d73; }
.ops-dashboard-page #app { padding-top: 0; }

.ops-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 80vh;
    color: #6fa8dc;
}
.ops-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(111, 168, 220, 0.2);
    border-top-color: #00d4ff;
    border-radius: 50%;
    animation: opsSpin 1s linear infinite;
}
@keyframes opsSpin { to { transform: rotate(360deg); } }

/* Cloud sync button spin animation */
.bi.spin {
    animation: opsSpin 0.8s linear infinite;
    display: inline-block;
}
#cloudSyncBtn .sync-label {
    font-size: 0.75rem;
}

/* Header */
.ops-header {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 24px;
    background: linear-gradient(90deg, rgba(0,150,255,0.08) 0%, rgba(0,212,255,0.15) 50%, rgba(0,150,255,0.08) 100%);
    border-bottom: 1px solid rgba(0, 212, 255, 0.25);
    box-shadow: 0 0 20px rgba(0, 150, 255, 0.15);
}
.ops-header-left, .ops-header-right {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1;
}
.ops-header-right { justify-content: flex-end; }
.ops-header-title {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    margin: 0;
    font-size: 1.9rem;
    font-weight: 700;
    letter-spacing: 4px;
    color: #fff;
    text-shadow: 0 0 12px rgba(0, 212, 255, 0.6);
}
.ops-date-range {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 12px;
    background: rgba(0, 150, 255, 0.12);
    border: 1px solid rgba(0, 212, 255, 0.3);
    border-radius: 4px;
    font-size: 0.85rem;
}
.ops-btn-text {
    background: rgba(0, 212, 255, 0.15);
    border: 1px solid rgba(0, 212, 255, 0.4);
    color: #00d4ff;
    padding: 2px 8px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.75rem;
}
.ops-btn-text:hover { background: rgba(0, 212, 255, 0.3); }
.ops-weather { color: #a8d0ff; font-size: 0.9rem; }
.ops-fullscreen {
    color: #00d4ff;
    cursor: pointer;
    font-size: 1.1rem;
    padding: 4px;
}
.ops-fullscreen:hover { color: #fff; }

/* Grid */
.ops-grid {
    display: grid;
    grid-template-columns: 1.05fr 1.9fr 1.05fr;
    gap: 14px;
    padding: 14px 16px 0;
}
.ops-col { display: flex; flex-direction: column; gap: 14px; }
.ops-col-center { min-height: 520px; }

/* Panel */
.ops-panel {
    background: linear-gradient(135deg, rgba(8, 28, 68, 0.9) 0%, rgba(5, 18, 45, 0.95) 100%);
    border: 1px solid rgba(0, 150, 255, 0.22);
    border-radius: 8px;
    padding: 12px 14px;
    box-shadow: 0 0 14px rgba(0, 100, 200, 0.12), inset 0 0 20px rgba(0, 100, 200, 0.04);
    position: relative;
    overflow: hidden;
}
.ops-panel::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, #00d4ff, transparent);
    opacity: 0.7;
}
.ops-panel-header {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #fff;
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 10px;
    padding-left: 8px;
    border-left: 3px solid #00d4ff;
}
.ops-panel-header i { color: #00d4ff; font-size: 1rem; }

/* Gauges */
.ops-gauge-row { display: flex; justify-content: space-around; gap: 8px; }
.ops-gauge { width: 100%; height: 120px; }

/* KPI list */
.ops-kpi-list { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.ops-kpi-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    background: rgba(0, 100, 200, 0.1);
    border-radius: 6px;
    border-left: 2px solid #0096ff;
}
.ops-kpi-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 150, 255, 0.15);
    border-radius: 6px;
    color: #00d4ff;
    font-size: 1rem;
}
.ops-kpi-info { flex: 1; }
.ops-kpi-label { font-size: 0.78rem; color: #8ab4d9; }
.ops-kpi-value { font-size: 1.15rem; font-weight: 700; color: #00d4ff; }
.ops-kpi-value span { font-size: 0.7rem; color: #6fa8dc; margin-left: 2px; }

/* Donut charts */
.ops-donut-chart { width: 100%; height: 170px; }
.ops-donut-legend {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px 16px;
    font-size: 0.75rem;
    margin-top: -10px;
}
.ops-donut-legend-item { display: flex; align-items: center; gap: 5px; }
.ops-donut-legend-dot { width: 8px; height: 8px; border-radius: 50%; }

/* Map panel */
.ops-map-panel { height: 100%; min-height: 520px; display: flex; flex-direction: column; padding: 8px; }
.ops-map { flex: 1; width: 100%; min-height: 480px; }
.ops-map-info {
    position: absolute;
    top: 55%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 260px;
    background: rgba(4, 18, 45, 0.92);
    border: 1px solid rgba(0, 212, 255, 0.35);
    border-radius: 8px;
    padding: 14px;
    pointer-events: none;
    box-shadow: 0 0 20px rgba(0, 150, 255, 0.25);
    z-index: 10;
}
.ops-map-info-title {
    text-align: center;
    color: #00d4ff;
    font-weight: 700;
    font-size: 0.95rem;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(0, 212, 255, 0.2);
}
.ops-map-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
    text-align: center;
}
.ops-map-info-label { display: block; font-size: 0.68rem; color: #8ab4d9; }
.ops-map-info-value { display: block; font-size: 1rem; font-weight: 700; color: #fff; margin-top: 2px; }

/* Progress rings */
.ops-progress-row { display: flex; justify-content: space-around; gap: 6px; }
.ops-progress-ring { width: 100%; height: 110px; }

/* Time donut */
.ops-time-donut-wrap { display: flex; align-items: center; gap: 10px; }
.ops-time-donut { width: 55%; height: 150px; }
.ops-time-legend { flex: 1; font-size: 0.72rem; display: flex; flex-direction: column; gap: 5px; }
.ops-time-legend-item { display: flex; align-items: center; gap: 5px; }
.ops-time-legend-dot { width: 8px; height: 8px; border-radius: 2px; }

/* Bar chart */
.ops-bar-chart { width: 100%; height: 180px; }

/* Alert table */
.ops-alert-panel { margin: 14px 16px; }
.ops-wo-warn-panel { margin: 14px 16px; }
.ops-wo-warn-panel .ops-table-wrap { max-height: 240px; }
.ops-table-wrap { max-height: 200px; overflow-y: auto; }
.ops-table {
    width: 100%;
    color: #c8d6f0;
    font-size: 0.82rem;
    border-collapse: collapse;
}
.ops-table thead { position: sticky; top: 0; z-index: 2; }
.ops-table th {
    background: rgba(0, 100, 180, 0.35);
    color: #a8d0ff;
    font-weight: 600;
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid rgba(0, 150, 255, 0.25);
}
.ops-table td {
    padding: 10px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.ops-table tbody tr:hover { background: rgba(0, 150, 255, 0.08); }
.ops-alert-tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 3px;
    background: rgba(255, 170, 0, 0.15);
    color: #ffaa00;
    border: 1px solid rgba(255, 170, 0, 0.3);
    font-size: 0.72rem;
}
.ops-alert-status {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 3px;
    background: rgba(255, 70, 70, 0.15);
    color: #ff5e5e;
    border: 1px solid rgba(255, 70, 70, 0.3);
    font-size: 0.72rem;
}

/* Dark dashboard badge overrides for assessment warnings */
.ops-wo-warn-panel .badge { font-size: 0.7rem; padding: 3px 7px; border: none; }
.ops-wo-warn-panel .badge.bg-danger { background: rgba(255, 70, 70, 0.25) !important; color: #ff6b6b; }
.ops-wo-warn-panel .badge.bg-warning { background: rgba(255, 200, 0, 0.25) !important; color: #ffd43b; }
.ops-wo-warn-panel .badge.bg-success { background: rgba(80, 200, 100, 0.25) !important; color: #51cf66; }
.ops-wo-warn-panel .badge.bg-secondary { background: rgba(150, 150, 150, 0.25) !important; color: #adb5bd; }

/* Scrollbar dark */
.ops-dashboard-page ::-webkit-scrollbar { width: 5px; height: 5px; }
.ops-dashboard-page ::-webkit-scrollbar-track { background: rgba(0,0,0,0.2); }
.ops-dashboard-page ::-webkit-scrollbar-thumb { background: rgba(0, 150, 255, 0.35); border-radius: 3px; }
.ops-dashboard-page ::-webkit-scrollbar-thumb:hover { background: rgba(0, 212, 255, 0.5); }

/* Responsive */
@media (max-width: 1200px) {
    .ops-grid { grid-template-columns: 1fr; }
    .ops-col-center { min-height: 420px; }
    .ops-map { min-height: 400px; }
    .ops-map-info { width: 220px; padding: 10px; }
    .ops-header-title { position: static; transform: none; font-size: 1.3rem; }
    .ops-header { flex-wrap: wrap; gap: 8px; }
}
@media (max-width: 768px) {
    .ops-header { padding: 10px; flex-direction: column; align-items: stretch; }
    .ops-header-left, .ops-header-right { justify-content: center; flex: none; }
    .ops-header-title { font-size: 1.1rem; letter-spacing: 2px; margin: 8px 0; }
    .ops-grid { padding: 10px; gap: 10px; }
    .ops-map-info { display: none; }
    .ops-progress-row { flex-wrap: wrap; }
    .ops-progress-ring { height: 100px; }
}

/* Fullscreen helper */
.ops-dashboard-page:fullscreen {
    width: 100vw;
    height: 100vh;
    overflow-y: auto;
}
.ops-dashboard-page:-webkit-full-screen {
    width: 100vw;
    height: 100vh;
    overflow-y: auto;
}

/* Hide normal nav on dashboard (optional visual polish) */
.ops-dashboard-page ~ nav.navbar,
.ops-dashboard-page ~ .navbar { border-bottom-color: rgba(0,150,255,0.2); }

/* Override app container background when dashboard active */
body:has(#page-dashboard:not([style*="display: none"])) {
    background: #030b1e;
}

/* =========================================================
   Dashboard enterprise refresh
   ========================================================= */
body:has(#page-dashboard:not([style*="display: none"])) .navbar {
    background: #223d4b !important;
    border-bottom: 1px solid #1a3340 !important;
    box-shadow: 0 2px 10px rgba(24, 47, 59, 0.16);
}
body:has(#page-dashboard:not([style*="display: none"])) .navbar-brand,
body:has(#page-dashboard:not([style*="display: none"])) .navbar .nav-link {
    color: #e6f0f3 !important;
}
body:has(#page-dashboard:not([style*="display: none"])) .navbar .nav-link:hover,
body:has(#page-dashboard:not([style*="display: none"])) .navbar .nav-link.active {
    color: #c6d8c8 !important;
}

.ops-dashboard-page {
    --ops-ink: #20343f;
    --ops-muted: #73818a;
    --ops-border: #d7e0e4;
    --ops-accent: #3b6377;
    --ops-accent-soft: #e9eff2;
    max-width: none;
    margin: 0;
    padding: 0;
    background: #eef2f4;
    color: var(--ops-ink);
    font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
}
.ops-dashboard-page #dashboardContent {
    max-width: 1680px;
    margin: 0 auto;
    padding: 0 18px 24px;
}
.ops-header {
    padding: 12px 6px;
    background: #fff;
    border-bottom: 1px solid var(--ops-border);
    box-shadow: none;
}
.ops-header-title {
    font-size: 1.35rem;
    font-weight: 650;
    letter-spacing: 1px;
    color: var(--ops-ink);
    text-shadow: none;
}
.ops-header-left, .ops-header-right { gap: 12px; }
.ops-header-right { color: var(--ops-muted); font-size: 0.78rem; }
.ops-date-range {
    padding: 4px 9px;
    background: #f7fafb;
    border: 1px solid var(--ops-border);
    border-radius: 5px;
    color: #405964;
    font-size: 0.76rem;
}
.ops-btn-text {
    background: var(--ops-accent-soft);
    border: 1px solid #b9deda;
    color: #3b6377;
    padding: 2px 7px;
    border-radius: 4px;
    font-size: 0.72rem;
}
.ops-btn-text:hover { background: #dce6ea; }
.ops-weather { color: #667983; font-size: 0.78rem; }
.ops-fullscreen { color: #526d7a; font-size: 1rem; }

.ops-grid {
    grid-template-columns: 1.05fr 1.9fr 1.05fr;
    gap: 12px;
    padding: 14px 0 0;
}
.ops-col { gap: 12px; }
.ops-col-center { min-height: 500px; }
.ops-panel {
    background: #fff;
    border: 1px solid var(--ops-border);
    border-radius: 7px;
    padding: 12px 14px;
    box-shadow: 0 2px 8px rgba(30, 61, 72, 0.05);
}
.ops-panel::before { display: none; }
.ops-panel-header {
    gap: 7px;
    color: var(--ops-ink);
    font-size: 0.86rem;
    font-weight: 650;
    margin-bottom: 9px;
    padding-left: 8px;
    border-left: 3px solid var(--ops-accent);
}
.ops-panel-header i { color: var(--ops-accent); font-size: 0.9rem; }
.ops-gauge-row { gap: 5px; }
.ops-gauge { height: 104px; }
.ops-kpi-list { gap: 6px; margin-top: 5px; }
.ops-kpi-item {
    gap: 9px;
    padding: 7px 9px;
    background: #f6f9fa;
    border: 1px solid #e5edf0;
    border-left: 2px solid #6f9ba7;
    border-radius: 5px;
}
.ops-kpi-icon {
    width: 28px;
    height: 28px;
    background: var(--ops-accent-soft);
    border-radius: 5px;
    color: var(--ops-accent);
    font-size: 0.88rem;
}
.ops-kpi-label { font-size: 0.72rem; color: var(--ops-muted); }
.ops-kpi-value { font-size: 1rem; font-weight: 650; color: #3b6377; }
.ops-kpi-value span { font-size: 0.66rem; color: var(--ops-muted); }
.ops-donut-chart { height: 150px; }
.ops-donut-legend { gap: 6px 12px; font-size: 0.7rem; margin-top: -7px; color: #556b75; }
.ops-map-panel { min-height: 500px; padding: 6px; background: #f9fbfc; }
.ops-map { min-height: 462px; }
.ops-map-info {
    top: 55%;
    width: 246px;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid #c9dce1;
    border-radius: 6px;
    padding: 12px;
    box-shadow: 0 8px 24px rgba(35, 76, 88, 0.14);
}
.ops-map-info-title {
    color: #3b6377;
    font-size: 0.86rem;
    margin-bottom: 8px;
    padding-bottom: 7px;
    border-bottom: 1px solid #dce8eb;
}
.ops-map-info-grid { gap: 7px; }
.ops-map-info-label { font-size: 0.64rem; color: #72858d; }
.ops-map-info-value { font-size: 0.92rem; color: #1f3642; }
.ops-progress-row { gap: 4px; }
.ops-progress-ring { height: 94px; }
.ops-time-donut-wrap { gap: 8px; }
.ops-time-donut { height: 136px; }
.ops-time-legend { font-size: 0.68rem; gap: 4px; color: #5c7079; }
.ops-bar-chart { height: 164px; }
.ops-alert-panel, .ops-wo-warn-panel { margin: 12px 0; }
.ops-table { color: #49616c; font-size: 0.75rem; }
.ops-table th {
    background: #eef4f6;
    color: #49616c;
    padding: 8px 10px;
    border-bottom: 1px solid #d7e2e7;
}
.ops-table td { padding: 8px 10px; border-bottom: 1px solid #edf2f4; }
.ops-table tbody tr:hover { background: #f5faf9; }
.ops-alert-tag { background: #fff5df; color: #a56a08; border: 1px solid #f1d9a1; font-size: 0.68rem; }
.ops-alert-status { background: #fbeaea; color: #b34f51; border: 1px solid #edc7c8; font-size: 0.68rem; }
.ops-wo-warn-panel .badge { font-size: 0.66rem; padding: 3px 6px; }
.ops-dashboard-page ::-webkit-scrollbar-track { background: #edf2f4; }
.ops-dashboard-page ::-webkit-scrollbar-thumb { background: #b7cbd1; }
.ops-dashboard-page ::-webkit-scrollbar-thumb:hover { background: #8eafb7; }

/* =========================================================
   Operations command dashboard v2
   ========================================================= */
.ops-dashboard-v2 {
    --cmd-bg: #071522;
    --cmd-surface: #0d2030;
    --cmd-surface-2: #102a3d;
    --cmd-line: #1e4058;
    --cmd-ink: #e5f1f4;
    --cmd-muted: #8fa8b7;
    --cmd-cyan: #23c5c7;
    --cmd-amber: #f2b45d;
    --cmd-coral: #e87373;
    --cmd-violet: #8b7cf6;
    background: var(--cmd-bg);
    color: var(--cmd-ink);
    font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
}
body:has(#page-dashboard.ops-dashboard-v2:not([style*="display: none"])) { background: var(--cmd-bg); }
body:has(#page-dashboard.ops-dashboard-v2:not([style*="display: none"])) .navbar { background: #091d2d !important; border-bottom-color: #17384f !important; }
.ops-dashboard-v2 #dashboardContent { max-width: 1720px; padding: 0 24px 32px; }
.ops-command-header { display:flex; justify-content:space-between; align-items:flex-end; gap:24px; padding:26px 4px 22px; border-bottom:1px solid var(--cmd-line); }
.ops-command-kicker { color:var(--cmd-cyan); font-size:10px; letter-spacing:2.4px; font-weight:600; }
.ops-command-kicker span, .ops-live-mark span { display:inline-block; width:7px; height:7px; margin-right:7px; border-radius:50%; background:var(--cmd-cyan); box-shadow:0 0 12px var(--cmd-cyan); }
.ops-command-header h1 { margin:7px 0 3px; color:var(--cmd-ink); font-size:26px; font-weight:500; letter-spacing:.4px; }
.ops-command-header p { margin:0; color:var(--cmd-muted); font-size:12px; }
.ops-command-tools { display:flex; align-items:center; gap:16px; }
.ops-command-tools .ops-date-range { display:flex; align-items:center; gap:8px; padding:8px 11px; background:var(--cmd-surface); border:1px solid var(--cmd-line); border-radius:4px; color:var(--cmd-muted); font-size:11px; }
.ops-command-tools .ops-date-range i { color:var(--cmd-cyan); }
.ops-command-tools .ops-btn-text { padding:0 0 0 8px; border:0; border-left:1px solid var(--cmd-line); border-radius:0; background:transparent; color:var(--cmd-cyan); font-size:11px; }
.ops-command-clock { display:flex; flex-direction:column; gap:4px; text-align:right; color:var(--cmd-muted); font-size:11px; }
.ops-command-clock .ops-weather { color:var(--cmd-amber); font-size:11px; }
.ops-icon-btn { width:34px; height:34px; border:1px solid var(--cmd-line); background:var(--cmd-surface); color:var(--cmd-muted); border-radius:4px; }
.ops-icon-btn:hover { color:var(--cmd-cyan); border-color:var(--cmd-cyan); }
.ops-kpi-strip { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:10px; padding:16px 0; }
.ops-metric { min-height:116px; padding:15px 17px; background:var(--cmd-surface); border:1px solid var(--cmd-line); border-radius:5px; position:relative; overflow:hidden; }
.ops-metric::after { content:''; position:absolute; right:-20px; bottom:-38px; width:100px; height:100px; border:1px solid rgba(35,197,199,.16); border-radius:50%; }
.ops-metric-primary { background:var(--cmd-surface-2); border-color:#2b6171; }
.ops-metric-warning { border-color:#604d37; }
.ops-metric-top { display:flex; justify-content:space-between; align-items:center; color:var(--cmd-muted); font-size:12px; }
.ops-metric-top i { color:var(--cmd-cyan); font-size:15px; }
.ops-metric-warning .ops-metric-top i { color:var(--cmd-amber); }
.ops-metric strong { display:inline-block; margin-top:11px; color:var(--cmd-ink); font-size:30px; line-height:1; font-weight:500; letter-spacing:1px; }
.ops-metric small { margin-left:5px; color:var(--cmd-muted); font-size:11px; }
.ops-metric-note { margin-top:8px; color:#6f899a; font-size:10px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.ops-metric-progress { height:3px; margin-top:12px; background:#18384c; border-radius:3px; overflow:hidden; }
.ops-metric-progress span { display:block; height:100%; width:0; background:var(--cmd-cyan); transition:width .6s ease; }
.ops-command-grid { display:grid; grid-template-columns:minmax(0,1.75fr) minmax(360px,.85fr); gap:12px; align-items:stretch; }
.ops-surface { background:var(--cmd-surface); border:1px solid var(--cmd-line); border-radius:5px; padding:16px; }
.ops-surface-header { display:flex; align-items:flex-start; justify-content:space-between; gap:12px; margin-bottom:13px; }
.ops-surface-header > div:first-child { display:flex; gap:10px; align-items:flex-start; }
.ops-section-index { display:inline-flex; align-items:center; justify-content:center; width:28px; height:20px; color:var(--cmd-cyan); border-bottom:1px solid var(--cmd-cyan); font-size:10px; letter-spacing:1px; }
.ops-surface h2 { margin:0; color:var(--cmd-ink); font-size:15px; font-weight:500; }
.ops-surface p { margin:3px 0 0; color:var(--cmd-muted); font-size:10px; }
.ops-live-mark { color:var(--cmd-cyan); font-size:10px; letter-spacing:1px; padding-top:3px; white-space:nowrap; }
.ops-map-stage { min-height:620px; position:relative; display:grid; grid-template-rows:auto minmax(420px,1fr) auto; overflow:hidden; padding-bottom:14px; }
.ops-map-stage .ops-map { min-height:420px; height:100%; }
.ops-dashboard-v2 .ops-map { background:transparent; }
.ops-region-ledger { display:flex; min-height:104px; flex-direction:column; gap:5px; padding:9px 4px 0; border-top:1px solid var(--cmd-line); overflow:hidden; }
.ops-region-row { display:grid; grid-template-columns:22px 58px minmax(50px,1fr) 55px 38px; align-items:center; gap:7px; min-height:18px; color:var(--cmd-muted); font-size:10px; }
.ops-region-rank { color:#56758a; font-variant-numeric:tabular-nums; }
.ops-region-name { color:#b7cad5; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.ops-region-bar { height:5px; background:#17364b; border-radius:4px; overflow:hidden; }
.ops-region-bar i { display:block; height:100%; background:var(--cmd-cyan); border-radius:4px; }
.ops-region-row strong { color:var(--cmd-ink); font-weight:500; text-align:right; }
.ops-region-row small { color:#698597; text-align:right; }
.ops-side-stack { display:flex; flex-direction:column; gap:12px; }
.ops-side-stack .ops-surface { flex:1; }
.ops-pipeline { display:flex; flex-direction:column; gap:11px; }
.ops-pipeline-row { display:grid; grid-template-columns:116px 1fr 42px; gap:9px; align-items:center; }
.ops-pipeline-label { display:flex; align-items:center; gap:7px; color:var(--cmd-muted); font-size:11px; }
.ops-pipeline-label i { width:14px; color:var(--cmd-cyan); }
.ops-pipeline-label strong { margin-left:auto; color:var(--cmd-ink); font-weight:500; }
.ops-pipeline-track { height:6px; overflow:hidden; background:#17364b; border-radius:6px; }
.ops-pipeline-fill { display:block; height:100%; border-radius:6px; transition:width .6s ease; }
.stage-pending { background:var(--cmd-coral); }.stage-assigned { background:var(--cmd-amber); }.stage-processing { background:var(--cmd-cyan); }.stage-reviewing { background:var(--cmd-violet); }.stage-completed { background:#6e9d8e; }
.ops-pipeline-row > small { color:#718c9c; text-align:right; font-size:10px; }
.ops-health-list { display:flex; flex-direction:column; gap:2px; }
.ops-health-row { display:grid; grid-template-columns:25px 1fr auto; align-items:center; gap:8px; min-height:39px; border-bottom:1px solid rgba(30,64,88,.65); }
.ops-health-row:last-child { border-bottom:0; }.ops-health-row > i { color:var(--cmd-cyan); font-size:14px; }.ops-health-row div { display:flex; flex-direction:column; gap:2px; }.ops-health-row span { color:#c6d5dc; font-size:11px; }.ops-health-row small { color:#6e8899; font-size:9px; }.ops-health-row strong { color:var(--cmd-ink); font-size:16px; font-weight:500; }
.ops-focus-list { display:flex; flex-direction:column; gap:7px; }.ops-focus-row { display:grid; grid-template-columns:25px 1fr 16px; gap:8px; align-items:center; min-height:35px; }.ops-focus-level { display:inline-flex; width:21px; height:21px; align-items:center; justify-content:center; border-radius:3px; font-size:10px; font-weight:500; }.ops-focus-level.danger { color:#ffb2ad; background:rgba(232,115,115,.15); }.ops-focus-level.warning { color:#ffd597; background:rgba(242,180,93,.15); }.ops-focus-row div { display:flex; flex-direction:column; gap:2px; }.ops-focus-row strong { color:#c9d9df; font-size:11px; font-weight:500; }.ops-focus-row small { color:#6e8899; font-size:9px; }.ops-focus-row > i { color:#5b7b8f; }.ops-focus-empty { display:flex; align-items:center; gap:8px; min-height:68px; color:#7793a3; font-size:11px; }.ops-focus-empty i { color:#6e9d8e; font-size:18px; }
.ops-analysis-grid { display:grid; grid-template-columns:minmax(0,1.45fr) minmax(250px,.75fr) minmax(250px,.75fr); gap:12px; margin-top:12px; }.ops-analysis-wide { min-width:0; }.ops-chart-lg { height:220px; }.ops-chart-md { height:200px; }.ops-time-layout { display:grid; grid-template-columns:1fr 104px; align-items:center; gap:2px; }.ops-time-layout .ops-chart-md { height:180px; }.ops-time-legend { display:flex; flex-direction:column; gap:8px; color:var(--cmd-muted); font-size:10px; }.ops-time-legend-item { display:flex; align-items:center; gap:5px; }.ops-time-legend-dot { width:7px; height:7px; border-radius:2px; }.ops-chart-empty { display:flex; align-items:center; justify-content:center; flex-direction:column; gap:8px; height:100%; color:#6c8899; font-size:11px; }.ops-chart-empty i { color:#2c5d72; font-size:22px; }.ops-empty { color:#6c8899; font-size:10px; }
.ops-table-grid { display:grid; grid-template-columns:1fr 1fr; gap:12px; margin-top:12px; }.ops-dashboard-v2 .ops-alert-panel, .ops-dashboard-v2 .ops-wo-warn-panel { margin:0; }.ops-dashboard-v2 .ops-table-wrap { max-height:260px; }.ops-dashboard-v2 .ops-table { color:#aec1cc; font-size:11px; }.ops-dashboard-v2 .ops-table th { background:#102a3d; color:#8fa8b7; border-bottom:1px solid var(--cmd-line); font-weight:500; }.ops-dashboard-v2 .ops-table td { border-bottom:1px solid rgba(30,64,88,.65); }.ops-dashboard-v2 .ops-table tbody tr:hover { background:#123047; }.ops-dashboard-v2 .ops-alert-tag { background:rgba(242,180,93,.12); color:#f4c982; border-color:rgba(242,180,93,.25); }.ops-dashboard-v2 .ops-alert-status { background:rgba(232,115,115,.12); color:#ffaaa5; border-color:rgba(232,115,115,.25); }
@media (max-width:1200px) { .ops-dashboard-v2 #dashboardContent { padding:0 14px 24px; }.ops-kpi-strip { grid-template-columns:repeat(3,1fr); }.ops-command-grid { grid-template-columns:1fr; }.ops-map-stage { min-height:600px; }.ops-side-stack { display:grid; grid-template-columns:repeat(3,1fr); }.ops-analysis-grid { grid-template-columns:1fr 1fr; }.ops-analysis-wide { grid-column:1/-1; }.ops-table-grid { grid-template-columns:1fr; } }
@media (max-width:700px) { .ops-dashboard-v2 #dashboardContent { padding:0 8px 16px; }.ops-command-header { flex-direction:column; align-items:stretch; padding:18px 0; }.ops-command-header h1 { font-size:21px; }.ops-command-tools { flex-wrap:wrap; }.ops-command-clock { text-align:left; }.ops-kpi-strip { grid-template-columns:repeat(2,1fr); }.ops-metric { min-height:105px; padding:12px; }.ops-metric strong { font-size:24px; }.ops-side-stack { display:flex; }.ops-analysis-grid { grid-template-columns:1fr; }.ops-analysis-wide { grid-column:auto; }.ops-table-grid { grid-template-columns:1fr; }.ops-region-row { grid-template-columns:20px 55px 1fr 45px; }.ops-region-row small { display:none; }.ops-pipeline-row { grid-template-columns:100px 1fr 35px; } }

@media (max-width: 1200px) {
    .ops-dashboard-page #dashboardContent { padding: 0 12px 18px; }
    .ops-header-title { font-size: 1.15rem; }
}
@media (max-width: 768px) {
    .ops-dashboard-page #dashboardContent { padding: 0 8px 14px; }
    .ops-header { padding: 9px 0; }
    .ops-header-title { font-size: 1rem; letter-spacing: 0.5px; }
    .ops-map-panel { min-height: 410px; }
    .ops-map { min-height: 370px; }
}

/* =========================================================
   Unified enterprise theme
   ========================================================= */
:root {
    --primary: #3b6377;
    --success: #6b8c7d;
    --info: #4f8290;
    --warning: #b48449;
    --danger: #b26368;
    --bg: #eef2f4;
    --bs-primary: #3b6377;
    --bs-primary-rgb: 59, 99, 119;
    --bs-success: #6b8c7d;
    --bs-success-rgb: 107, 140, 125;
    --bs-info: #4f8290;
    --bs-info-rgb: 79, 130, 144;
    --bs-warning: #b48449;
    --bs-warning-rgb: 180, 132, 73;
    --bs-danger: #b26368;
    --bs-danger-rgb: 178, 99, 104;
    --bs-link-color: #3b6377;
    --bs-link-hover-color: #294c5d;
}
body {
    background: #eef2f4;
    color: #263944;
}
body:has(#page-dashboard:not([style*="display: none"])) { background: #eef2f4; }
.navbar.bg-primary,
.navbar.navbar-dark.bg-primary {
    background: #223d4b !important;
    border-bottom: 1px solid #1a3340;
    box-shadow: 0 2px 10px rgba(24, 47, 59, 0.14);
}
.navbar-brand { color: #f5f8f9 !important; letter-spacing: 0.25px; }
.navbar .nav-link,
.navbar .navbar-text { color: #dce8eb !important; }
.navbar .nav-link:hover,
.navbar .nav-link:focus,
.navbar .nav-link.active { color: #c6d8c8 !important; }
.navbar .navbar-toggler { border-color: rgba(220, 232, 235, 0.35); }
.navbar .navbar-toggler-icon { filter: brightness(1.5); }

/* Keep the current module visibly selected after page navigation. */
#navMenu .nav-link {
    position: relative;
    border-radius: 4px;
    transition: background-color 0.16s ease, color 0.16s ease, box-shadow 0.16s ease, transform 0.08s ease;
}
#navMenu .nav-link:hover,
#navMenu .nav-link:focus-visible {
    color: #fff !important;
    background: rgba(255, 255, 255, 0.1);
}
#navMenu .nav-link.active,
body:has(#page-dashboard:not([style*="display: none"])) #navMenu .nav-link.active {
    color: #fff !important;
    background: rgba(255, 255, 255, 0.17);
    box-shadow: inset 0 -3px 0 #8fc2ce;
    font-weight: 600;
}
#navMenu .nav-link:active {
    transform: translateY(1px);
    background: rgba(255, 255, 255, 0.24);
}

a, .station-link { color: #3b6377; }
a:hover, .station-link:hover { color: #294c5d; }
.btn-primary, .bg-primary { background-color: #3b6377 !important; border-color: #3b6377 !important; }
.btn-primary:hover, .btn-primary:focus { background-color: #294c5d !important; border-color: #294c5d !important; }
.btn-success, .bg-success { background-color: #6b8c7d !important; border-color: #6b8c7d !important; }
.btn-info, .bg-info { background-color: #4f8290 !important; border-color: #4f8290 !important; }
.btn-warning, .bg-warning { background-color: #b48449 !important; border-color: #b48449 !important; color: #fff !important; }
.btn-danger, .bg-danger { background-color: #b26368 !important; border-color: #b26368 !important; }
.btn-outline-primary { color: #3b6377 !important; border-color: #3b6377 !important; }
.btn-outline-primary:hover { color: #fff !important; background: #3b6377 !important; }
.btn-outline-success { color: #5d7f70 !important; border-color: #6b8c7d !important; }
.btn-outline-info { color: #3e7180 !important; border-color: #4f8290 !important; }
.text-primary { color: #3b6377 !important; }
.text-success { color: #5d7f70 !important; }
.text-info { color: #3e7180 !important; }
.text-warning { color: #9b6f38 !important; }
.text-danger { color: #a55359 !important; }
.border-primary { border-color: #3b6377 !important; }

.card, .table, .modal-content {
    border-color: #d7e0e4;
    box-shadow: 0 2px 8px rgba(34, 61, 75, 0.06);
}
.card { border-radius: 8px; }
.card-header {
    background: #f1f5f6;
    color: #2c424d;
    border-bottom: 1px solid #dce5e8;
}
.table { background: #fff; }
.table th {
    background: #edf2f4;
    color: #526872;
    border-color: #dce5e8;
}
.table td { border-color: #e8eef0; }
.table-hover > tbody > tr:hover > * { background: #f5f8f9; }
.form-control, .form-select {
    border-color: #cbd8dd;
    color: #2b414c;
}
.form-control:focus, .form-select:focus {
    border-color: #6f9ba7;
    box-shadow: 0 0 0 0.15rem rgba(79, 130, 144, 0.18);
}
.input-group-text { background: #f1f5f6; border-color: #cbd8dd; color: #607680; }
.detail-tabs { border-color: #d7e0e4; }
.detail-tab { color: #72828a; }
.detail-tab.active, .detail-tab:hover { color: #3b6377; border-bottom-color: #3b6377; }
.pagination .page-link { color: #3b6377; border-color: #d7e0e4; }
.pagination .page-item.active .page-link { background: #3b6377; border-color: #3b6377; }
.progress { background: #e3eaed; }
.progress-bar { background: #3b6377; }
.alert-info { color: #315f6c; background: #e8f1f3; border-color: #c6dce1; }
.alert-warning { color: #795728; background: #fbf3e7; border-color: #ead3af; }
.alert-danger { color: #85494e; background: #faeded; border-color: #e8c8ca; }
.badge-勘察 { background: #4f8290 !important; }
.badge-设计 { background: #77788d !important; }
.badge-并网 { background: #6b8c7d !important; }
.badge-工程 { background: #b48449 !important; }
.badge-档案 { background: #73818a !important; }
#bootLoading { background: #eef2f4 !important; }
#bootLoading .spinner-border { color: #3b6377 !important; }

/* Make station detail entry points discoverable */
.station-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 30px;
    padding: 3px 8px;
    border: 1px solid #a9c3cc;
    border-radius: 5px;
    color: #274f62 !important;
    background: #e7eff2;
    font-weight: 650;
    text-decoration-line: underline;
    text-decoration-style: solid;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(34, 61, 75, 0.08);
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.station-link:hover,
.station-link:focus-visible {
    color: #fff !important;
    background: #3b6377;
    border-color: #3b6377;
    box-shadow: 0 2px 6px rgba(34, 61, 75, 0.22);
    transform: translateY(-1px);
    outline: 2px solid rgba(79, 130, 144, 0.28);
    outline-offset: 1px;
}
.station-link-icon { font-size: 0.72rem; text-decoration: none; }
.station-detail-hint {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 10px;
    padding: 8px 12px;
    color: #274f62;
    background: #e7eff2;
    border-left: 4px solid #3b6377;
    font-size: 0.875rem;
}
.station-detail-hint i { color: #3b6377; font-size: 1rem; }
.station-heading-tip {
    color: #3b6377;
    font-size: 0.72rem;
    font-weight: 600;
}
.station-action-heading { min-width: 92px; color: #274f62 !important; }
.station-detail-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-width: 82px;
    height: 30px;
    padding: 0 9px;
    color: #fff !important;
    background: #3b6377 !important;
    border: 1px solid #3b6377 !important;
    border-radius: 5px;
    box-shadow: 0 1px 3px rgba(34, 61, 75, 0.16);
    transition: background-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.station-detail-btn:hover,
.station-detail-btn:focus-visible {
    color: #fff !important;
    background: #294c5d !important;
    border-color: #294c5d !important;
    box-shadow: 0 2px 6px rgba(34, 61, 75, 0.24);
    transform: translateY(-1px);
}
.station-detail-btn:focus-visible { outline: 2px solid rgba(79, 130, 144, 0.36); outline-offset: 2px; }
.station-delete-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-width: 34px;
    height: 30px;
    padding: 0 8px;
    margin-left: 4px;
    color: #fff !important;
    background: #b02a37 !important;
    border: 1px solid #b02a37 !important;
    border-radius: 5px;
    box-shadow: 0 1px 3px rgba(120, 28, 36, 0.18);
    transition: background-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.station-delete-btn:hover,
.station-delete-btn:focus-visible {
    color: #fff !important;
    background: #8c2029 !important;
    border-color: #8c2029 !important;
    box-shadow: 0 2px 6px rgba(120, 28, 36, 0.28);
    transform: translateY(-1px);
}
.station-delete-btn:focus-visible { outline: 2px solid rgba(176, 42, 55, 0.36); outline-offset: 2px; }
