:root {
    --bg: #07111f;
    --panel: #0d1b2e;
    --panel-2: #12233a;
    --text: #e8f1ff;
    --muted: #91a4bd;
    --border: rgba(255, 255, 255, .09);
    --accent: #24c6dc;
    --accent-2: #64f4ac;
    --danger: #ff5d73;
}

[data-theme="light"] {
    --bg: #f3f7fb;
    --panel: #ffffff;
    --panel-2: #eef4fb;
    --text: #142033;
    --muted: #65758b;
    --border: rgba(20, 32, 51, .12);
}

* { box-sizing: border-box; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
a { text-decoration: none; }
.login-body {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    background:
        radial-gradient(circle at 20% 20%, rgba(36, 198, 220, .25), transparent 32%),
        radial-gradient(circle at 80% 10%, rgba(100, 244, 172, .16), transparent 28%),
        #050b15;
}
.login-card {
    width: min(440px, 100%);
    padding: 34px;
    background: rgba(13, 27, 46, .88);
    border: 1px solid rgba(255, 255, 255, .11);
    border-radius: 8px;
    box-shadow: 0 28px 70px rgba(0, 0, 0, .45);
}
.login-mark {
    width: 54px;
    height: 54px;
    display: grid;
    place-items: center;
    color: #03121d;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    border-radius: 8px;
    font-size: 28px;
    margin-bottom: 18px;
}
.app-shell { display: flex; min-height: 100vh; }
.sidebar {
    width: 276px;
    flex: 0 0 276px;
    display: flex;
    flex-direction: column;
    background: #081426;
    border-right: 1px solid var(--border);
    padding: 18px 14px;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}
[data-theme="light"] .sidebar { background: #ffffff; }
.sidebar nav { flex: 1 0 auto; }
.brand {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 10px 10px 20px;
    color: var(--text);
    font-weight: 800;
}
.brand img { width: 36px; height: 36px; object-fit: contain; border-radius: 6px; }
.brand span { line-height: 1.1; }
.sidebar nav a {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 11px 12px;
    margin: 3px 0;
    color: var(--muted);
    border-radius: 8px;
    font-size: 14px;
}
.sidebar nav a:hover,
.sidebar nav a.active {
    color: var(--text);
    background: rgba(36, 198, 220, .12);
}
.main { flex: 1; min-width: 0; }
.topbar {
    min-height: 78px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 26px;
    border-bottom: 1px solid var(--border);
    background: rgba(7, 17, 31, .78);
    backdrop-filter: blur(16px);
    position: sticky;
    top: 0;
    z-index: 20;
}
[data-theme="light"] .topbar { background: rgba(255, 255, 255, .86); }
.topbar h1 { font-size: 24px; margin: 0; font-weight: 800; letter-spacing: 0; }
.eyebrow { color: var(--accent); font-size: 11px; font-weight: 800; text-transform: uppercase; }
.topbar-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.content { padding: 26px; }
.panel,
.stat-card,
.form-card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 18px 38px rgba(0, 0, 0, .14);
}
.panel { padding: 20px; }
.stat-card { padding: 18px; min-height: 128px; }
.stat-card .icon {
    width: 42px;
    height: 42px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    color: #03121d;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
}
.stat-value { font-size: 30px; font-weight: 900; margin: 12px 0 0; }
.stat-label { color: var(--muted); font-size: 13px; margin: 0; }
.btn-primary {
    --bs-btn-bg: #14a8bd;
    --bs-btn-border-color: #14a8bd;
    --bs-btn-hover-bg: #108ea0;
    --bs-btn-hover-border-color: #108ea0;
}
.btn-icon {
    width: 38px;
    height: 38px;
    display: inline-grid;
    place-items: center;
    padding: 0;
    color: var(--text);
    border: 1px solid var(--border);
    background: var(--panel-2);
}
.user-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--panel-2);
    font-size: 13px;
}
.form-control,
.form-select {
    color: var(--text);
    background-color: var(--panel-2);
    border-color: var(--border);
}
.form-control:focus,
.form-select:focus {
    color: var(--text);
    background-color: var(--panel-2);
    border-color: var(--accent);
    box-shadow: 0 0 0 .2rem rgba(36, 198, 220, .15);
}
[data-theme="light"] .form-control,
[data-theme="light"] .form-select {
    color: var(--text);
}
.table { --bs-table-bg: transparent; --bs-table-color: var(--text); --bs-table-border-color: var(--border); }
.table thead th { color: var(--muted); font-size: 12px; text-transform: uppercase; }
.dataTables_wrapper,
.dt-container { color: var(--text); }
.topbar-welcome {
    color: #cbd5e1;
    font-size: 14px;
    margin-top: 4px;
}
.topbar-clock {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: #cbd5e1;
    font-size: 13px;
    padding: 4px 2px;
}
.sidebar-status {
    margin: 28px 0 0;
    padding: 14px;
    border: 1px solid rgba(56, 189, 248, .18);
    border-radius: 8px;
    background:
        linear-gradient(135deg, rgba(15, 23, 42, .92), rgba(8, 28, 47, .8)),
        radial-gradient(circle at 100% 70%, rgba(34, 197, 94, .28), transparent 32%);
}
.sidebar-status div {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}
.sidebar-status i {
    width: 10px;
    height: 10px;
    display: inline-block;
    border-radius: 999px;
    background: #22c55e;
    box-shadow: 0 0 14px rgba(34, 197, 94, .85);
}
.sidebar-status p {
    margin: 8px 0;
    color: #5ee787;
    font-size: 13px;
}
.sidebar-status small {
    color: var(--muted);
    font-size: 12px;
}
.map-canvas {
    width: 100%;
    min-height: 680px;
    border-radius: 8px;
    border: 1px solid var(--border);
}
.map-page {
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-height: calc(100vh - 130px);
}
.map-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
}
.map-shell {
    position: relative;
    flex: 1;
    min-height: 620px;
}
.map-canvas-full {
    height: calc(100vh - 214px);
    min-height: 620px;
    background: var(--panel-2);
}
.map-tools {
    position: absolute;
    z-index: 900;
    top: 14px;
    left: 14px;
    width: min(380px, calc(100% - 28px));
    display: grid;
    gap: 10px;
}
.map-search,
.map-layer-filters {
    background: rgba(13, 27, 46, .92);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 16px 36px rgba(0, 0, 0, .25);
}
[data-theme="light"] .map-search,
[data-theme="light"] .map-layer-filters {
    background: rgba(255, 255, 255, .94);
}
.map-search { padding: 10px; position: relative; }
.map-search .input-group-text {
    color: var(--muted);
    background: var(--panel-2);
    border-color: var(--border);
}
.map-search-results {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 10px;
    right: 10px;
    max-height: 240px;
    overflow-y: auto;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 16px 36px rgba(0, 0, 0, .25);
}
.map-search-results.open { display: block; }
.map-search-results button {
    display: block;
    width: 100%;
    padding: 9px 11px;
    color: var(--text);
    text-align: left;
    background: transparent;
    border: 0;
    border-bottom: 1px solid var(--border);
}
.map-search-results button:hover { background: var(--panel-2); }
.map-layer-filters {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px 12px;
    padding: 11px;
}
.map-layer-filters label {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-width: 0;
    margin: 0;
    color: var(--text);
    font-size: 13px;
    white-space: nowrap;
}
.map-action-buttons {
    position: absolute;
    z-index: 901;
    top: 14px;
    right: 14px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
    max-width: min(520px, calc(100% - 28px));
}
.map-action-buttons button {
    min-height: 32px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 9px;
    color: var(--text);
    background: rgba(13, 27, 46, .92);
    border: 1px solid rgba(56, 189, 248, .28);
    border-radius: 8px;
    box-shadow: 0 10px 22px rgba(0,0,0,.22);
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
    cursor: pointer;
}
.map-action-buttons button:hover {
    color: #22d3ee;
    border-color: rgba(34, 211, 238, .72);
}
.map-action-buttons button.active {
    color: #07111f;
    background: #22d3ee;
    border-color: #22d3ee;
}
.map-action-buttons button[data-map-action="offline"].active {
    background: #ef4444;
    border-color: #ef4444;
    color: #fff;
}
.map-action-buttons button[data-map-action="online"].active {
    background: #22c55e;
    border-color: #22c55e;
    color: #03121d;
}
.is-live-traffic .leaflet-overlay-pane path {
    stroke-dasharray: 10 8;
    animation: liveTrafficPulse 1.25s linear infinite;
}
@keyframes liveTrafficPulse {
    0% { stroke-dashoffset: 0; filter: drop-shadow(0 0 2px rgba(34,211,238,.2)); }
    50% { filter: drop-shadow(0 0 8px rgba(34,211,238,.85)); }
    100% { stroke-dashoffset: -24; filter: drop-shadow(0 0 2px rgba(34,211,238,.2)); }
}
.dashboard-map-tools {
    top: 68px;
    left: 18px;
    width: min(430px, calc(100% - 36px));
}
.dashboard-layer-filters {
    position: absolute;
    z-index: 901;
    left: 18px;
    bottom: 76px;
    width: min(430px, calc(100% - 36px));
}
.map-layer-panel {
    position: absolute;
    z-index: 902;
    top: 56px;
    right: 14px;
    width: 240px;
    box-shadow: 0 16px 36px rgba(0,0,0,.36);
}
.map-layer-panel[hidden] {
    display: none !important;
}
.fiber-map-marker {
    background: transparent;
    border: 0;
}
.fiber-map-marker span {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    color: #ffffff;
    background: var(--marker-color);
    border: 2px solid #ffffff;
    border-radius: 999px;
    box-shadow: 0 8px 18px rgba(0, 0, 0, .32);
    font-size: 16px;
}
.map-popup {
    min-width: 230px;
    color: #142033;
}
.map-popup-title {
    margin-bottom: 7px;
    font-weight: 800;
}
.map-popup table {
    width: 100%;
    border-collapse: collapse;
}
.map-popup th,
.map-popup td {
    padding: 4px 0;
    vertical-align: top;
    border-top: 1px solid rgba(20, 32, 51, .12);
    font-size: 12px;
}
.map-popup th {
    width: 42%;
    padding-right: 10px;
    color: #65758b;
    font-weight: 700;
}
.mini-map { min-height: 420px; }
.tree {
    list-style: none;
    padding-left: 18px;
}
.tree li {
    margin: 8px 0;
    padding-left: 16px;
    border-left: 1px solid var(--border);
}
.tree-node {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    background: var(--panel-2);
    border: 1px solid var(--border);
    border-radius: 8px;
}
.search-result {
    display: grid;
    gap: 10px;
}
.topology-page {
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-height: calc(100vh - 130px);
}
.topology-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
}
.topology-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}
.topology-layout {
    display: grid;
    grid-template-columns: 280px minmax(420px, 1fr) 310px;
    gap: 14px;
    min-height: calc(100vh - 214px);
}
.topology-tree-panel,
.topology-graph-panel,
.topology-detail-panel {
    min-width: 0;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 18px 38px rgba(0, 0, 0, .14);
}
.topology-tree-panel,
.topology-detail-panel {
    padding: 14px;
    overflow: auto;
}
.topology-graph-panel {
    position: relative;
    overflow: hidden;
}
.topology-panel-title {
    margin-bottom: 11px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}
.topology-graph {
    width: 100%;
    height: 100%;
    min-height: 680px;
    background:
        linear-gradient(rgba(255, 255, 255, .035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, .035) 1px, transparent 1px),
        var(--panel-2);
    background-size: 32px 32px;
}
.topology-legend {
    position: absolute;
    left: 14px;
    bottom: 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    padding: 8px 10px;
    color: var(--text);
    background: rgba(13, 27, 46, .92);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 12px;
}
[data-theme="light"] .topology-legend { background: rgba(255, 255, 255, .94); }
.status-dot {
    width: 10px;
    height: 10px;
    display: inline-block;
    flex: 0 0 10px;
    border-radius: 999px;
    background: #16a34a;
    box-shadow: 0 0 0 3px rgba(22, 163, 74, .16);
}
.status-dot.offline {
    background: #dc2626;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, .16);
}
.status-dot.warning {
    background: #facc15;
    box-shadow: 0 0 0 3px rgba(250, 204, 21, .16);
}
.status-dot.maintenance {
    background: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .16);
}
.topology-tabs {
    border-color: var(--border);
}
.topology-tabs .nav-link {
    color: var(--muted);
    border-color: transparent;
}
.topology-tabs .nav-link.active {
    color: var(--text);
    background: var(--panel);
    border-color: var(--border) var(--border) var(--panel);
}
.topology-admin-grid {
    display: grid;
    grid-template-columns: minmax(320px, 520px) minmax(420px, 1fr);
    gap: 14px;
    align-items: start;
    margin-top: 14px;
}
.topology-form {
    position: sticky;
    top: 96px;
}
.topology-tree ul {
    list-style: none;
    margin: 0;
    padding-left: 16px;
}
.topology-tree > ul { padding-left: 0; }
.topology-tree li {
    position: relative;
    margin: 7px 0;
}
.topology-tree li::before {
    content: "";
    position: absolute;
    left: -10px;
    top: 0;
    bottom: -7px;
    border-left: 1px solid var(--border);
}
.topology-tree > ul > li::before { display: none; }
.topology-tree button {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 9px;
    color: var(--text);
    text-align: left;
    background: var(--panel-2);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 13px;
}
.topology-tree button:hover {
    border-color: rgba(36, 198, 220, .42);
}
.topology-detail-heading {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 14px;
}
.topology-detail-heading h3 {
    margin: 0;
    font-size: 18px;
}
.topology-detail-heading p {
    margin: 2px 0 0;
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
}
.topology-detail-table {
    width: 100%;
    border-collapse: collapse;
}
.topology-detail-table th,
.topology-detail-table td {
    padding: 8px 0;
    vertical-align: top;
    border-top: 1px solid var(--border);
    font-size: 13px;
}
.topology-detail-table th {
    width: 44%;
    padding-right: 10px;
    color: var(--muted);
    font-weight: 700;
}
.topology-layout:fullscreen {
    padding: 14px;
    background: var(--bg);
}
.topology-layout:fullscreen .topology-graph {
    min-height: calc(100vh - 30px);
}
.physical-topology-shell {
    position: relative;
    height: calc(100vh - 120px);
    min-height: 620px;
    margin-top: 14px;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
}
.physical-toolbar {
    position: absolute;
    z-index: 12;
    left: 14px;
    top: 12px;
    padding: 7px 10px;
    background: rgba(13, 27, 46, .88);
    border: 1px solid var(--border);
    border-radius: 8px;
}
.physical-topology {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 620px;
    overflow: scroll;
    scrollbar-gutter: stable both-edges;
    cursor: grab;
    background:
        linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px),
        #081426;
    background-size: 34px 34px;
    scroll-behavior: auto;
}
.physical-topology.is-panning { cursor: grabbing; }
.physical-topology.is-layout-locked {
    cursor: not-allowed;
}
.physical-topology.is-link-mode {
    cursor: crosshair;
}
.topology-cables,
.topology-devices {
    position: absolute;
    inset: 0;
    width: 5000px;
    height: 3000px;
    transform-origin: 0 0;
}
.topology-cables {
    z-index: 1;
    pointer-events: auto;
}
.topology-cable {
    fill: none;
    stroke-width: 3;
    opacity: .88;
    cursor: pointer;
    pointer-events: stroke;
    filter: drop-shadow(0 0 4px rgba(0,0,0,.35));
}
.topology-cable:hover {
    stroke-width: 5;
    opacity: 1;
}
.topology-cable.is-selected,
.pon-tree-line.is-selected {
    stroke: #22d3ee !important;
    stroke-width: 6;
    opacity: 1;
    filter: drop-shadow(0 0 10px rgba(34, 211, 238, .9));
}
.topology-cable.offline { stroke-dasharray: 9 7; opacity: .72; }
.topology-cable.warning { stroke-dasharray: 4 5; }
.topology-cable.maintenance { opacity: .55; }
.topology-devices { z-index: 2; }
.topology-empty-message {
    position: absolute;
    left: 420px;
    top: 220px;
    max-width: 420px;
    padding: 18px 20px;
    color: var(--text);
    background: rgba(13, 27, 46, .94);
    border: 1px solid rgba(36,198,220,.32);
    border-radius: 8px;
    box-shadow: 0 16px 34px rgba(0,0,0,.28);
    font-weight: 700;
}
.physical-upstream {
    position: absolute;
    width: 360px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    color: var(--text);
    background: #0f233d;
    border: 1px solid rgba(56, 189, 248, .45);
    border-radius: 8px;
    box-shadow: 0 16px 36px rgba(0,0,0,.24);
    user-select: none;
    touch-action: none;
}
.upstream-port {
    display: inline-flex;
    margin-top: 7px;
    padding: 4px 8px;
    color: #dff6ff;
    background: rgba(56, 189, 248, .14);
    border: 1px solid rgba(56, 189, 248, .45);
    border-radius: 6px;
    font-size: 11px;
}
.physical-device {
    position: absolute;
    min-width: 250px;
    max-width: 360px;
    color: var(--text);
    user-select: none;
    touch-action: none;
    cursor: pointer;
}
.physical-topology.is-layout-locked .physical-device,
.physical-topology.is-layout-locked .physical-upstream,
.physical-topology.is-layout-locked .physical-extra-node,
.physical-topology.is-layout-locked .physical-port {
    cursor: not-allowed;
}
.physical-device.mikrotik-router { width: 420px; }
.physical-device.olt { width: 370px; }
.physical-device.server,
.physical-device.ftp-server,
.physical-device.tv-server,
.physical-device.cache-server,
.physical-device.nvr,
.physical-device.cctv,
.physical-device.telephone,
.physical-device.core-switch,
.physical-device.access-switch {
    width: 280px;
}
.physical-device-body {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 8px;
    align-items: stretch;
}
.physical-device-main {
    width: 100%;
    min-height: 112px;
    display: grid;
    grid-template-columns: 54px 1fr;
    grid-template-rows: auto auto;
    align-items: center;
    gap: 3px 12px;
    padding: 14px;
    color: var(--text);
    text-align: left;
    background: linear-gradient(180deg, #12233a, #0b1729);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 16px 34px rgba(0,0,0,.28);
    cursor: pointer;
}
.physical-device-main:hover { border-color: rgba(36,198,220,.5); }
.physical-device.is-selected .physical-device-main,
.physical-extra-node.is-selected .physical-extra-main,
.pon-physical-node.is-selected .pon-node-card {
    border-color: #22d3ee;
    box-shadow: 0 0 0 2px rgba(34, 211, 238, .75), 0 0 30px rgba(34, 211, 238, .25);
}
.physical-device-icon {
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    grid-row: span 2;
    color: #dff6ff;
    background: rgba(36,198,220,.14);
    border: 1px solid rgba(36,198,220,.3);
    border-radius: 8px;
    font-size: 24px;
}
.physical-device-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.physical-device-name {
    min-width: 0;
    font-weight: 800;
    line-height: 1.15;
}
.physical-device-meta {
    min-width: 0;
    color: var(--muted);
    font-size: 12px;
}
.physical-port-bank {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
    justify-content: center;
    padding: 5px;
}
.port-left,
.port-right {
    width: 72px;
    flex-direction: column;
    align-items: stretch;
}
.physical-port {
    min-width: 42px;
    min-height: 24px;
    padding: 3px 5px;
    color: #fff;
    background: #16a34a;
    border: 1px solid rgba(255,255,255,.26);
    border-radius: 5px;
    font-size: 10px;
    line-height: 1.05;
    cursor: pointer;
    touch-action: none;
}
.physical-port.is-selected {
    outline: 2px solid #22d3ee;
    outline-offset: 3px;
    box-shadow: 0 0 20px rgba(34, 211, 238, .72), inset 0 -3px 0 rgba(255,255,255,.42);
}
.physical-port.free-port {
    position: absolute;
    z-index: 8;
    box-shadow: 0 9px 18px rgba(0,0,0,.32);
}
.physical-port.link-source {
    outline: 2px solid #24c6dc;
    outline-offset: 3px;
    filter: drop-shadow(0 0 8px rgba(36,198,220,.65));
}
.physical-port.offline { background: #dc2626; }
.physical-port.warning { background: #facc15; color: #1f2937; }
.physical-port.maintenance { background: #6b7280; }
.physical-port.sfp-10g,
.physical-port.uplink { box-shadow: inset 0 -3px 0 rgba(56,189,248,.8); }
.physical-port.pon { box-shadow: inset 0 -3px 0 rgba(250,204,21,.9); }
.physical-port.ethernet { box-shadow: inset 0 -3px 0 rgba(34,197,94,.75); }
.physical-port.free-port.ethernet { box-shadow: inset 0 -3px 0 rgba(34,197,94,.75), 0 9px 18px rgba(0,0,0,.32); }
.physical-port.free-port.pon { box-shadow: inset 0 -3px 0 rgba(250,204,21,.9), 0 9px 18px rgba(0,0,0,.32); }
.physical-port.free-port.sfp-10g,
.physical-port.free-port.uplink { box-shadow: inset 0 -3px 0 rgba(56,189,248,.8), 0 9px 18px rgba(0,0,0,.32); }
.physical-extra-node {
    position: absolute;
    min-width: 185px;
    color: var(--text);
    user-select: none;
    touch-action: none;
    cursor: pointer;
}
.physical-extra-main {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    color: var(--text);
    text-align: left;
    background: linear-gradient(180deg, #112338, #0b1729);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 12px 26px rgba(0,0,0,.25);
    cursor: pointer;
}
.physical-extra-main strong,
.physical-extra-main small {
    display: block;
    line-height: 1.2;
}
.physical-extra-main small {
    color: var(--muted);
    font-size: 11px;
}
.physical-extra-node.online .physical-extra-main { border-color: rgba(34,197,94,.42); }
.physical-extra-node.offline .physical-extra-main { border-color: rgba(220,38,38,.5); }
.physical-extra-node.warning .physical-extra-main { border-color: rgba(250,204,21,.55); }
.physical-extra-node.maintenance .physical-extra-main { border-color: rgba(59,130,246,.55); }
.topology-actions .btn.active {
    color: #071426;
    background: #24c6dc;
    border-color: #24c6dc;
}
.topology-context-menu {
    position: absolute;
    z-index: 40;
    min-width: 170px;
    padding: 6px;
    background: rgba(8, 20, 38, .98);
    border: 1px solid rgba(36,198,220,.32);
    border-radius: 8px;
    box-shadow: 0 18px 42px rgba(0,0,0,.38);
}
.topology-context-menu button {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 9px;
    color: var(--text);
    text-align: left;
    background: transparent;
    border: 0;
    border-radius: 6px;
}
.topology-context-menu button:hover {
    background: rgba(36,198,220,.14);
}
.topology-link-editor {
    position: absolute;
    z-index: 35;
    left: 14px;
    bottom: 14px;
    width: min(360px, calc(100% - 28px));
    max-height: calc(100% - 42px);
    overflow: auto;
    padding: 14px;
    color: var(--text);
    background: rgba(13, 27, 46, .96);
    border: 1px solid rgba(36,198,220,.34);
    border-radius: 8px;
    box-shadow: 0 18px 42px rgba(0,0,0,.35);
}
.topology-link-summary {
    margin-bottom: 10px;
    padding: 8px;
    color: #dff6ff;
    background: rgba(36,198,220,.1);
    border: 1px solid rgba(36,198,220,.22);
    border-radius: 6px;
    font-size: 12px;
}
.topology-link-editor label {
    display: block;
    margin-bottom: 9px;
    color: var(--muted);
    font-size: 12px;
}
.topology-link-editor input,
.topology-link-editor select {
    width: 100%;
    margin-top: 4px;
    padding: 7px 8px;
    color: var(--text);
    background: #081426;
    border: 1px solid var(--border);
    border-radius: 6px;
}
.topology-link-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.physical-detail-panel {
    position: absolute;
    z-index: 14;
    right: 14px;
    top: 14px;
    width: 320px;
    max-height: calc(100% - 28px);
    overflow: auto;
    padding: 14px;
    background: rgba(13, 27, 46, .94);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 18px 38px rgba(0,0,0,.24);
}
.physical-detail-icon {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    color: #dff6ff;
    background: rgba(36,198,220,.14);
    border-radius: 8px;
}
.physical-topology-shell:fullscreen {
    background: var(--bg);
}
.physical-topology-shell:fullscreen .physical-topology {
    min-height: 100vh;
    height: 100vh;
}
.pon-tree-page {
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-height: calc(100vh - 130px);
}
.pon-tree-filters {
    display: grid;
    grid-template-columns: 170px 170px 170px 190px minmax(240px, 1fr);
    gap: 10px;
    padding: 12px;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 8px;
}
.pon-tree-shell {
    position: relative;
    height: calc(100vh - 120px);
    min-height: 620px;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
}
.pon-tree-canvas {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 620px;
    overflow: scroll;
    scrollbar-gutter: stable both-edges;
    cursor: grab;
    background:
        linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px),
        #081426;
    background-size: 34px 34px;
}
.pon-tree-canvas.is-panning { cursor: grabbing; }
.pon-tree-lines,
.pon-tree-nodes {
    position: absolute;
    inset: 0;
    width: 5000px;
    height: 3000px;
    transform-origin: 0 0;
}
.pon-tree-lines {
    z-index: 1;
    pointer-events: auto;
}
.pon-tree-line {
    pointer-events: stroke;
}
.pon-tree-line {
    fill: none;
    stroke: #24c6dc;
    stroke-width: 3;
    opacity: .88;
    pointer-events: stroke;
    cursor: pointer;
    filter: drop-shadow(0 0 4px rgba(0,0,0,.35));
}
.pon-tree-nodes {
    z-index: 2;
}
.pon-physical-node {
    position: absolute;
    width: 260px;
    user-select: none;
    touch-action: none;
    cursor: pointer;
}
.pon-physical-node.olt { width: 330px; }
.pon-physical-node.splitter { width: 230px; }
.pon-physical-node.onu { width: 250px; }
.pon-physical-node.pole,
.pon-physical-node.joint_box,
.pon-physical-node.fiber_core,
.pon-physical-node.fiber_route { width: 245px; }
.pon-node-card {
    width: 100%;
    min-height: 104px;
    display: grid;
    grid-template-columns: 48px 1fr;
    grid-template-rows: auto auto;
    align-items: center;
    gap: 4px 11px;
    padding: 13px;
    color: var(--text);
    text-align: left;
    background: linear-gradient(180deg, #12233a, #0b1729);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 16px 34px rgba(0,0,0,.28);
    cursor: pointer;
}
.pon-node-card:hover {
    border-color: rgba(36,198,220,.5);
}
.pon-node-icon {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    grid-row: span 2;
    color: #dff6ff;
    background: rgba(36,198,220,.14);
    border: 1px solid rgba(36,198,220,.3);
    border-radius: 8px;
    font-size: 22px;
}
.pon-node-title {
    min-width: 0;
    font-weight: 800;
    line-height: 1.15;
}
.pon-physical-port {
    width: max-content;
    max-width: 100%;
    display: inline-flex;
    padding: 4px 8px;
    color: #dff6ff;
    background: rgba(36,198,220,.14);
    border: 1px solid rgba(36,198,220,.35);
    border-radius: 6px;
    font-size: 11px;
}
.pon-physical-node.pon .pon-physical-port { background: rgba(34,197,94,.18); border-color: rgba(34,197,94,.4); }
.pon-physical-node.splitter .pon-physical-port { background: rgba(250,204,21,.18); border-color: rgba(250,204,21,.45); color: #fef9c3; }
.pon-physical-node.onu .pon-physical-port { background: rgba(100,244,172,.16); border-color: rgba(100,244,172,.36); }
.pon-physical-node.pole .pon-physical-port { background: rgba(180,120,60,.18); border-color: rgba(180,120,60,.42); }
.pon-physical-node.joint_box .pon-physical-port { background: rgba(168,85,247,.18); border-color: rgba(168,85,247,.45); }
.pon-physical-node.fiber_core .pon-physical-port { background: rgba(6,182,212,.18); border-color: rgba(6,182,212,.45); }
.pon-physical-node.fiber_route .pon-physical-port { background: rgba(249,115,22,.18); border-color: rgba(249,115,22,.45); }
.pon-tree-line.fiber_route {
    stroke: #f97316;
    stroke-dasharray: 8 6;
}
.pon-tree-line.fiber_core {
    stroke: #06b6d4;
}
.pon-tree-shell:fullscreen {
    background: var(--bg);
}
.pon-tree-shell:fullscreen .pon-tree-canvas {
    min-height: 100vh;
    height: 100vh;
}
.diagram-minimap {
    position: absolute;
    right: 14px;
    bottom: 14px;
    z-index: 16;
    width: 190px;
    height: 114px;
    background: rgba(8, 20, 38, .9);
    border: 1px solid rgba(36,198,220,.32);
    border-radius: 8px;
    box-shadow: 0 12px 26px rgba(0,0,0,.28);
    pointer-events: none;
}
.diagram-minimap-dot {
    position: absolute;
    width: 4px;
    height: 4px;
    background: #24c6dc;
    border-radius: 50%;
}
.diagram-minimap-view {
    position: absolute;
    border: 1px solid #facc15;
    background: rgba(250,204,21,.08);
}
.dashboard-noc {
    display: flex;
    flex-direction: column;
    gap: 18px;
}
.dashboard-kpi-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(150px, 1fr));
    gap: 18px;
}
.dashboard-secondary-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(150px, 1fr));
    gap: 18px;
}
.dashboard-main-grid {
    display: grid;
    grid-template-columns: minmax(520px, 1.15fr) minmax(420px, .85fr);
    gap: 18px;
    align-items: stretch;
}
.dashboard-side-stack {
    display: grid;
    grid-template-rows: 1fr 1fr;
    gap: 18px;
}
.dashboard-bottom-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(170px, 1fr));
    gap: 18px;
}
.noc-card {
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(56, 189, 248, .16);
    border-radius: 8px;
    background:
        linear-gradient(145deg, rgba(14, 28, 52, .96), rgba(8, 18, 35, .96)),
        radial-gradient(circle at 0 0, rgba(56, 189, 248, .14), transparent 42%);
    box-shadow: 0 18px 44px rgba(0, 0, 0, .26), inset 0 1px 0 rgba(255, 255, 255, .035);
}
.noc-card::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(90deg, rgba(255,255,255,.035), transparent 38%, rgba(255,255,255,.025));
}
.kpi-card {
    min-height: 136px;
    padding: 18px 18px 14px;
}
.kpi-head,
.mini-kpi,
.health-card {
    display: flex;
    align-items: center;
    gap: 16px;
}
.kpi-head strong,
.mini-kpi strong,
.health-card strong {
    display: block;
    color: #f8fafc;
    font-size: 26px;
    line-height: 1.05;
    font-weight: 900;
}
.kpi-head p,
.mini-kpi p,
.health-card p,
.health-card span {
    margin: 5px 0 0;
    color: #cbd5e1;
    font-size: 13px;
}
.noc-icon,
.health-icon {
    flex: 0 0 auto;
    width: 56px;
    height: 56px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    font-size: 28px;
    color: #dff9ff;
    border: 1px solid currentColor;
    background: rgba(15, 23, 42, .58);
    box-shadow: 0 0 28px rgba(56, 189, 248, .2);
}
.kpi-sub {
    margin-top: 22px;
    color: #38bdf8;
    font-weight: 800;
}
.sparkline {
    position: absolute;
    left: 18px;
    right: 18px;
    bottom: 14px;
    width: calc(100% - 36px);
    height: 34px;
}
.sparkline polyline {
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    vector-effect: non-scaling-stroke;
}
.glow-blue { color: #3b82f6; border-color: rgba(59, 130, 246, .32); }
.glow-green { color: #22c55e; border-color: rgba(34, 197, 94, .32); }
.glow-purple { color: #a855f7; border-color: rgba(168, 85, 247, .34); }
.glow-amber { color: #f59e0b; border-color: rgba(245, 158, 11, .34); }
.glow-cyan { color: #22d3ee; border-color: rgba(34, 211, 238, .32); }
.glow-pink { color: #ec4899; border-color: rgba(236, 72, 153, .34); }
.glow-teal { color: #2dd4bf; border-color: rgba(45, 212, 191, .32); }
.glow-red { color: #ef4444; border-color: rgba(239, 68, 68, .34); }
.mini-kpi {
    min-height: 82px;
    padding: 17px 20px;
}
.map-widget {
    min-height: 446px;
    padding: 14px;
}
.panel-title-row {
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}
.panel-title-row h2 {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0;
    color: #f8fafc;
    font-size: 18px;
    font-weight: 850;
}
.panel-title-row h2 i { color: #38bdf8; }
.noc-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 34px;
    padding: 7px 12px;
    border: 1px solid rgba(56, 189, 248, .5);
    border-radius: 8px;
    color: #38d8ff;
    background: rgba(14, 165, 233, .08);
    font-size: 13px;
    font-weight: 800;
}
.noc-btn:hover { color: #e0f2fe; background: rgba(14, 165, 233, .16); }
.noc-btn.danger { color: #fb7185; border-color: rgba(244, 63, 94, .62); background: rgba(244, 63, 94, .08); }
.noc-btn.success { color: #34d399; border-color: rgba(16, 185, 129, .58); background: rgba(16, 185, 129, .08); }
.dashboard-map {
    position: relative;
    z-index: 1;
    height: 560px;
    min-height: 500px;
    border-color: rgba(56, 189, 248, .26);
    background: #0f172a;
}
.dashboard-live-map {
    min-height: 620px;
}
.dashboard-issue-grid {
    grid-template-columns: 1fr;
}
.dashboard-issue-grid .dashboard-side-stack {
    grid-template-columns: repeat(2, minmax(320px, 1fr));
    grid-template-rows: auto;
}
.map-legend-bar {
    position: absolute;
    z-index: 500;
    left: 26px;
    bottom: 28px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 18px;
    padding: 10px 16px;
    border: 1px solid rgba(148, 163, 184, .22);
    border-radius: 8px;
    color: #e2e8f0;
    background: rgba(15, 23, 42, .88);
    box-shadow: 0 12px 28px rgba(0, 0, 0, .32);
    font-size: 13px;
}
.dot,
.line {
    display: inline-block;
    vertical-align: middle;
    margin-right: 7px;
}
.dot {
    width: 11px;
    height: 11px;
    border-radius: 999px;
}
.line {
    width: 18px;
    height: 3px;
    border-radius: 999px;
}
.blue { background: #3b82f6; }
.green { background: #22c55e; }
.red { background: #ef4444; }
.yellow { background: #facc15; }
.gray { background: #64748b; }
.pink { background: #e879f9; }
.amber { background: #fb923c; }
.cyan { background: #22d3ee; }
.purple { background: #a855f7; }
.issue-card {
    min-height: 212px;
    padding: 20px;
}
.noc-table {
    position: relative;
    z-index: 1;
    margin: 0;
}
.noc-table thead th {
    color: #cbd5e1;
    font-size: 12px;
    font-weight: 800;
}
.noc-table tbody td {
    color: #e5edf8;
    font-size: 13px;
}
.empty-cell {
    height: 116px;
    text-align: center;
    color: #cbd5e1 !important;
}
.empty-cell i {
    display: grid;
    place-items: center;
    width: 58px;
    height: 58px;
    margin: 8px auto 12px;
    border-radius: 50%;
    color: currentColor;
    background: rgba(236, 72, 153, .18);
    border: 1px solid rgba(236, 72, 153, .25);
    font-size: 28px;
}
.empty-cell span { display: block; }
.health-card {
    min-height: 108px;
    padding: 18px 20px;
}
.health-card strong { font-size: 22px; }
.health-card .health-icon {
    width: 50px;
    height: 50px;
    font-size: 26px;
}
.print-only { display: none; }
@media print {
    .sidebar, .topbar, .no-print { display: none !important; }
    .content { padding: 0; }
    body { background: #fff; color: #111; }
    .panel { box-shadow: none; border: none; }
    .print-only { display: block; }
}
@media (max-width: 991px) {
    .sidebar {
        position: fixed;
        z-index: 40;
        transform: translateX(-100%);
        transition: transform .2s ease;
    }
    .sidebar.open { transform: translateX(0); }
    .topbar { align-items: flex-start; }
    .content { padding: 18px; }
    .map-canvas-full { height: calc(100vh - 238px); }
    .topology-layout {
        grid-template-columns: 1fr;
        min-height: auto;
    }
    .topology-admin-grid {
        grid-template-columns: 1fr;
    }
    .topology-form {
        position: static;
    }
    .topology-tree-panel,
    .topology-detail-panel {
        max-height: 320px;
    }
    .topology-graph { min-height: 560px; }
    .physical-detail-panel {
        position: static;
        width: auto;
        max-height: none;
        margin: 12px;
    }
    .dashboard-kpi-grid { grid-template-columns: repeat(3, minmax(160px, 1fr)); }
    .dashboard-secondary-grid,
    .dashboard-bottom-grid { grid-template-columns: repeat(2, minmax(180px, 1fr)); }
    .dashboard-main-grid { grid-template-columns: 1fr; }
    .dashboard-map { height: 360px; min-height: 360px; }
    .dashboard-live-map { min-height: 430px; }
    .dashboard-issue-grid .dashboard-side-stack { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
    .topbar { flex-direction: column; }
    .topbar-actions { width: 100%; justify-content: flex-start; }
    .stat-value { font-size: 25px; }
    .login-card { padding: 24px; }
    .map-header { align-items: flex-start; }
    .map-shell,
    .map-canvas-full {
        min-height: 560px;
    }
    .map-canvas-full { height: calc(100vh - 288px); }
    .map-tools {
        left: 10px;
        right: 10px;
        width: auto;
    }
    .map-layer-filters { grid-template-columns: 1fr; }
    .topology-toolbar { align-items: flex-start; }
    .topology-actions { justify-content: flex-start; }
    .topology-graph { min-height: 520px; }
    .pon-tree-filters { grid-template-columns: 1fr; }
    .dashboard-kpi-grid,
    .dashboard-secondary-grid,
    .dashboard-bottom-grid { grid-template-columns: 1fr; }
    .map-legend-bar {
        position: static;
        margin-top: 12px;
    }
    .dashboard-map { height: 320px; min-height: 320px; }
    .dashboard-layer-filters,
    .dashboard-map-tools {
        position: static;
        width: auto;
        margin-top: 12px;
    }
    .map-action-buttons {
        top: 70px;
        right: 10px;
    }
    .kpi-card { min-height: 126px; }
}

/* Compact NOC dashboard */
.sidebar {
    width: 208px;
    flex-basis: 208px;
    padding: 14px 10px;
}
.brand { padding: 8px 8px 14px; }
.sidebar nav a {
    min-height: 36px;
    padding: 8px 10px;
    gap: 10px;
    font-size: 12px;
}
.sidebar nav a i {
    width: 18px;
    text-align: center;
    font-size: 14px;
}
.sidebar-status {
    padding: 12px;
    margin-top: 18px;
}
body.sidebar-collapsed .sidebar {
    width: 68px;
    flex-basis: 68px;
    overflow-x: hidden;
}
body.sidebar-collapsed .brand span,
body.sidebar-collapsed .sidebar nav a span,
body.sidebar-collapsed .sidebar-status {
    display: none;
}
body.sidebar-collapsed .brand,
body.sidebar-collapsed .sidebar nav a {
    justify-content: center;
}
.topbar {
    min-height: 70px;
    padding: 12px 18px;
}
.topbar h1 { font-size: 22px; }
.topbar-welcome { font-size: 12px; }
.content:has(.dashboard-noc) {
    padding: 12px;
}
.dashboard-noc {
    gap: 12px;
}
.dashboard-control-strip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.auto-refresh-indicator {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 32px;
    padding: 6px 10px;
    color: #cbd5e1;
    border: 1px solid rgba(56, 189, 248, .24);
    border-radius: 12px;
    background: rgba(13, 27, 46, .84);
    font-size: 12px;
}
.auto-refresh-indicator span {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 12px rgba(34, 197, 94, .85);
}
.auto-refresh-indicator.is-refreshing span {
    animation: refreshPulse .9s ease;
}
@keyframes refreshPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.75); }
}
.dashboard-view-toggle {
    display: inline-flex;
    padding: 3px;
    border: 1px solid rgba(56, 189, 248, .24);
    border-radius: 12px;
    background: rgba(13, 27, 46, .84);
}
.dashboard-view-toggle button {
    min-height: 28px;
    padding: 4px 10px;
    color: #cbd5e1;
    background: transparent;
    border: 0;
    border-radius: 9px;
    font-size: 12px;
    font-weight: 800;
}
.dashboard-view-toggle button.active {
    color: #06111f;
    background: #22d3ee;
}
.dashboard-noc .noc-card {
    border-radius: 12px;
}
.dashboard-noc .dashboard-kpi-grid {
    grid-template-columns: repeat(9, minmax(0, 1fr));
    gap: 12px;
}
.dashboard-noc .kpi-card {
    min-height: 95px;
    height: 95px;
    padding: 12px;
}
.dashboard-noc .kpi-head {
    gap: 10px;
}
.dashboard-noc .noc-icon {
    width: 42px;
    height: 42px;
    font-size: 21px;
}
.dashboard-noc .kpi-head strong {
    font-size: 32px;
}
.dashboard-noc .kpi-head p {
    font-size: 14px;
    margin-top: 3px;
}
.dashboard-noc .map-widget {
    padding: 12px;
}
.dashboard-noc .dashboard-live-map {
    min-height: 340px;
}
.dashboard-noc .dashboard-map {
    height: 280px;
    min-height: 280px;
}
.dashboard-noc .panel-title-row {
    margin-bottom: 8px;
}
.dashboard-noc .panel-title-row h2 {
    font-size: 16px;
}
.dashboard-noc .dashboard-issue-grid,
.dashboard-noc .dashboard-side-stack,
.dashboard-noc .dashboard-bottom-grid {
    gap: 12px;
}
.dashboard-noc .dashboard-issue-grid .dashboard-side-stack {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}
.dashboard-noc .issue-card {
    height: 280px;
    min-height: 280px;
    padding: 14px;
    overflow: auto;
}
.dashboard-noc .empty-cell {
    height: 155px;
}
.dashboard-noc .dashboard-bottom-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}
.dashboard-noc .health-card {
    height: 100px;
    min-height: 100px;
    padding: 14px;
}
.dashboard-noc .health-icon {
    width: 42px;
    height: 42px;
    font-size: 21px;
}
.dashboard-noc .health-card strong {
    font-size: 20px;
}
.dashboard-noc .health-card p,
.dashboard-noc .health-card span {
    font-size: 12px;
}
.dashboard-noc .map-legend-bar {
    left: 22px;
    bottom: 22px;
    gap: 10px;
    padding: 7px 10px;
    font-size: 11px;
}
.dashboard-noc .dashboard-map-tools {
    top: 54px;
    left: 14px;
    width: min(360px, calc(100% - 28px));
}
.dashboard-noc .dashboard-layer-filters {
    left: 14px;
    bottom: 60px;
    width: min(360px, calc(100% - 28px));
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 8px;
}
.dashboard-noc .map-action-buttons {
    top: 54px;
    right: 14px;
    max-width: min(430px, calc(100% - 28px));
    gap: 6px;
}
.dashboard-noc .map-action-buttons button {
    min-height: 28px;
    padding: 4px 7px;
    font-size: 11px;
}
.dashboard-noc.is-normal .dashboard-kpi-grid {
    grid-template-columns: repeat(6, minmax(150px, 1fr));
}
.dashboard-noc.is-normal .kpi-card {
    height: 128px;
    min-height: 128px;
    padding: 18px;
}
.dashboard-noc.is-normal .dashboard-map {
    height: 420px;
    min-height: 420px;
}
.dashboard-noc.is-normal .dashboard-live-map {
    min-height: 500px;
}
@media (max-width: 1400px) {
    .dashboard-noc .dashboard-kpi-grid {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }
}
@media (max-width: 991px) {
    body.sidebar-collapsed .sidebar {
        width: 220px;
        flex-basis: 220px;
    }
    body.sidebar-collapsed .brand span,
    body.sidebar-collapsed .sidebar nav a span,
    body.sidebar-collapsed .sidebar-status {
        display: block;
    }
    .dashboard-noc .dashboard-kpi-grid,
    .dashboard-noc.is-normal .dashboard-kpi-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
    .dashboard-noc .dashboard-issue-grid .dashboard-side-stack,
    .dashboard-noc .dashboard-bottom-grid {
        grid-template-columns: 1fr;
    }
}
@media (max-width: 640px) {
    .dashboard-control-strip {
        align-items: stretch;
        flex-direction: column;
    }
    .dashboard-noc .dashboard-kpi-grid,
    .dashboard-noc.is-normal .dashboard-kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .dashboard-noc .dashboard-map {
        height: 300px;
        min-height: 300px;
    }
    .dashboard-noc .issue-card,
    .dashboard-noc .health-card {
        height: auto;
        min-height: 100px;
    }
}

/* Professional ISP NOC dashboard rows */
.noc-professional {
    gap: 12px;
}
.noc-professional .dashboard-kpi-grid {
    grid-template-columns: repeat(9, minmax(0, 1fr));
}
.noc-professional .dashboard-row-two {
    display: grid;
    grid-template-columns: minmax(0, 7fr) minmax(320px, 3fr);
    gap: 12px;
    align-items: stretch;
}
.noc-professional .dashboard-row-three {
    display: grid;
    grid-template-columns: minmax(320px, 3fr) repeat(3, minmax(180px, 1fr));
    gap: 12px;
    align-items: stretch;
}
.noc-professional .dashboard-live-map,
.noc-professional .dashboard-low-rx {
    min-height: 360px;
    height: 360px;
}
.noc-professional .dashboard-map {
    height: 305px;
    min-height: 305px;
}
.noc-professional .dashboard-full-pon,
.noc-professional .dashboard-row-three .health-card {
    height: 180px;
    min-height: 180px;
}
.noc-professional .issue-card,
.noc-professional .health-card {
    padding: 12px;
}
.noc-professional .panel-title-row {
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(148, 163, 184, .14);
}
.noc-professional .noc-table thead th {
    padding-top: 5px;
    padding-bottom: 5px;
    font-size: 11px;
}
.noc-professional .noc-table tbody td {
    padding-top: 5px;
    padding-bottom: 5px;
    font-size: 12px;
}
.noc-professional .empty-cell {
    height: 92px;
}
.noc-professional .empty-cell i {
    width: 42px;
    height: 42px;
    margin: 4px auto 8px;
    font-size: 22px;
}
.noc-professional .health-card {
    align-items: center;
}
.noc-professional .health-card strong {
    font-size: 24px;
}
.noc-professional .health-card p {
    color: #94a3b8;
    text-transform: uppercase;
    font-size: 11px;
    font-weight: 800;
}
.noc-professional .health-card span {
    font-size: 12px;
}
.noc-professional .dashboard-map-tools {
    width: min(330px, calc(100% - 28px));
}
.noc-professional .map-layer-panel {
    top: 92px;
    right: 14px;
    left: auto;
    bottom: auto;
}
.noc-professional .map-action-buttons button span {
    display: none;
}
.noc-professional .map-action-buttons button {
    width: 30px;
    justify-content: center;
    padding: 4px;
}
@media (max-width: 1500px) {
    .noc-professional .dashboard-kpi-grid {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }
}
@media (max-width: 1100px) {
    .noc-professional .dashboard-row-two,
    .noc-professional .dashboard-row-three {
        grid-template-columns: 1fr;
    }
    .noc-professional .dashboard-live-map,
    .noc-professional .dashboard-low-rx,
    .noc-professional .dashboard-full-pon,
    .noc-professional .dashboard-row-three .health-card {
        height: auto;
        min-height: 180px;
    }
    .noc-professional .dashboard-map {
        height: 320px;
        min-height: 320px;
    }
}
@media (max-width: 640px) {
    .noc-professional .dashboard-kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Dashboard header refinement */
body.dashboard-page .topbar {
    min-height: 70px;
    height: 70px;
    display: grid;
    grid-template-columns: 40px minmax(260px, 1fr) auto;
    align-items: center;
    gap: 14px;
    padding-top: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(0, 212, 255, .15);
}
body.dashboard-page .topbar > div:not(.topbar-actions) {
    align-self: center;
    text-align: center;
    line-height: 1;
}
body.dashboard-page .eyebrow {
    color: #00d4ff;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 2px;
    line-height: 1;
}
body.dashboard-page .topbar h1 {
    position: relative;
    display: inline-block;
    margin: 1px 0 0;
    color: #fff;
    font-size: 34px;
    font-weight: 800;
    line-height: .92;
    text-shadow: 0 0 18px rgba(0, 212, 255, .28);
}
body.dashboard-page .topbar h1::after {
    content: "";
    position: absolute;
    left: 12%;
    right: 12%;
    bottom: -6px;
    height: 9px;
    border-radius: 999px;
    background: rgba(0, 212, 255, .28);
    filter: blur(12px);
    pointer-events: none;
}
body.dashboard-page .topbar-welcome {
    margin-top: 3px;
    color: rgba(255,255,255,.65);
    font-size: 14px;
    line-height: 1;
}
body.dashboard-page .topbar-actions {
    flex-wrap: nowrap;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}
body.dashboard-page #sidebarToggle {
    width: 40px;
    height: 40px;
    min-width: 40px;
    padding: 0;
    place-self: center start;
}
body.dashboard-page .btn-icon {
    width: 40px;
    height: 40px;
}
body.dashboard-page .user-pill,
body.dashboard-page .topbar-clock {
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
}
body.dashboard-page .btn-outline-danger {
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
@media (max-width: 1200px) {
    body.dashboard-page .topbar {
        height: auto;
        min-height: 70px;
        grid-template-columns: 40px 1fr;
    }
    body.dashboard-page .topbar-actions {
        grid-column: 1 / -1;
        justify-content: center;
        overflow-x: auto;
        padding-bottom: 2px;
    }
}
@media (max-width: 640px) {
    body.dashboard-page .topbar {
        grid-template-columns: 40px 1fr;
        gap: 10px;
    }
    body.dashboard-page .topbar > div:not(.topbar-actions) {
        text-align: left;
    }
    body.dashboard-page .topbar h1 {
        font-size: 28px;
    }
    body.dashboard-page .eyebrow {
        font-size: 10px;
        letter-spacing: 1.4px;
    }
    body.dashboard-page .topbar-welcome {
        font-size: 12px;
    }
}

/* Screenshot-style full-screen NOC dashboard */
body.dashboard-page {
    overflow: hidden;
}
body.dashboard-page.sidebar-collapsed .sidebar {
    width: 208px;
    flex-basis: 208px;
}
body.dashboard-page.sidebar-collapsed .brand span,
body.dashboard-page.sidebar-collapsed .sidebar nav a span,
body.dashboard-page.sidebar-collapsed .sidebar-status {
    display: block;
}
body.dashboard-page.sidebar-collapsed .brand,
body.dashboard-page.sidebar-collapsed .sidebar nav a {
    justify-content: flex-start;
}
body.dashboard-page .content {
    height: calc(100vh - 70px);
    overflow: auto;
}
.noc-screen {
    gap: 12px;
    min-height: calc(100vh - 94px);
    display: flex;
    flex-direction: column;
}
.noc-screen .dashboard-control-strip {
    position: absolute;
    top: 83px;
    right: 20px;
    z-index: 5;
}
.noc-screen .dashboard-view-toggle {
    display: none;
}
.noc-screen .auto-refresh-indicator {
    min-height: 28px;
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 12px;
}
.noc-screen .noc-kpi-row {
    display: grid;
    grid-template-columns: repeat(9, minmax(0, 1fr));
    gap: 8px;
    margin-top: 18px;
}
.noc-screen .kpi-card {
    position: relative;
    height: 86px;
    min-height: 86px;
    padding: 14px 12px;
}
.noc-screen .kpi-card {
    display: grid;
    grid-template-columns: 42px 1fr;
    align-items: center;
    gap: 10px;
}
.noc-screen .noc-icon {
    width: 36px;
    height: 36px;
    font-size: 17px;
    border-radius: 8px;
}
.noc-kpi-copy p {
    margin: 0 0 3px;
    color: #a8d4ff;
    font-size: 10px;
    font-weight: 800;
}
.noc-kpi-copy strong {
    display: block;
    color: #fff;
    font-size: 26px;
    line-height: 1;
    font-weight: 900;
}
.noc-kpi-copy small {
    display: block;
    margin-top: 2px;
    color: #cbd5e1;
    font-size: 11px;
}
.noc-kpi-copy em {
    display: block;
    margin-top: 7px;
    color: #22c55e;
    font-size: 11px;
    font-style: normal;
    font-weight: 800;
}
.kpi-sparkline {
    position: absolute;
    right: 10px;
    bottom: 10px;
    width: 58px;
    height: 20px;
    color: currentColor;
}
.kpi-sparkline path {
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    vector-effect: non-scaling-stroke;
    filter: drop-shadow(0 0 4px currentColor);
}
.noc-screen .noc-main-row {
    display: grid;
    grid-template-columns: minmax(0, 2.1fr) minmax(320px, 1fr) minmax(320px, 1fr);
    gap: 12px;
}
.noc-screen .noc-bottom-row {
    display: grid;
    grid-template-columns: minmax(360px, 1.25fr) minmax(300px, .95fr) minmax(260px, .9fr) minmax(320px, 1.2fr);
    gap: 12px;
}
.noc-screen .dashboard-live-map,
.noc-screen .issue-card,
.noc-screen .summary-card {
    height: 340px;
    min-height: 340px;
}
.noc-screen .dashboard-map {
    height: 290px;
    min-height: 290px;
    filter: saturate(.85) brightness(.78);
}
.noc-screen .dashboard-map::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: rgba(4, 18, 39, .2);
}
.noc-screen .panel-title-row {
    min-height: 28px;
    margin-bottom: 8px;
    padding-bottom: 7px;
    border-bottom: 1px solid rgba(148, 163, 184, .13);
}
.noc-screen .panel-title-row h2 {
    font-size: 14px;
}
.noc-screen .noc-btn {
    min-height: 28px;
    padding: 4px 9px;
    font-size: 11px;
}
.noc-screen .noc-table thead th {
    padding: 5px 6px;
    color: #9fb4cf;
    font-size: 10px;
}
.noc-screen .noc-table tbody td {
    padding: 5px 6px;
    font-size: 11px;
}
.noc-screen .badge {
    font-size: 10px;
}
.rx-bars {
    height: 58px;
    display: flex;
    align-items: end;
    gap: 8px;
    padding: 0 8px 4px;
    border-top: 1px solid rgba(148, 163, 184, .12);
}
.rx-bars span {
    flex: 1;
    min-width: 8px;
    border-radius: 5px 5px 2px 2px;
    background: linear-gradient(180deg, #8b5cf6, #4c1d95);
    box-shadow: 0 0 12px rgba(139,92,246,.32);
}
.summary-card {
    display: flex;
    flex-direction: column;
}
.summary-card .panel-title-row {
    flex: 0 0 auto;
}
.summary-body {
    flex: 1;
    display: grid;
    grid-template-columns: 150px 1fr;
    align-items: center;
    gap: 18px;
    min-height: 0;
}
.summary-donut {
    width: 138px;
    height: 138px;
    place-self: center;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background:
        conic-gradient(
            #22c55e 0 calc(var(--online) * 1%),
            #ef4444 0 calc((var(--online) + var(--offline)) * 1%),
            #f59e0b 0 calc((var(--online) + var(--offline) + var(--warning)) * 1%),
            #3b82f6 0 calc((var(--online) + var(--offline) + var(--warning) + var(--maintenance)) * 1%),
            #64748b 0 100%
        );
    box-shadow: 0 0 26px rgba(34,197,94,.18);
}
.summary-donut > div {
    width: 78px;
    height: 78px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #071426;
}
.summary-donut span {
    color: #9fb4cf;
    font-size: 11px;
}
.summary-donut strong {
    color: #fff;
    font-size: 19px;
}
.summary-list {
    display: grid;
    gap: 0;
    margin: 0;
    padding: 0;
    list-style: none;
}
.summary-list li {
    display: grid;
    grid-template-columns: 14px 1fr auto;
    align-items: center;
    gap: 8px;
    min-height: 34px;
    border-bottom: 1px solid rgba(148,163,184,.1);
    color: #cbd5e1;
    font-size: 11px;
}
.summary-list li strong {
    color: #e5edf8;
    font-weight: 700;
    white-space: nowrap;
}
.traffic-card,
.alarms-card,
.mini-stat-grid,
.noc-bottom-row > .issue-card {
    height: 270px;
    min-height: 270px;
}
.usage-bar {
    position: relative;
    display: block;
    height: 16px;
    overflow: hidden;
    border-radius: 4px;
    background: rgba(148,163,184,.14);
}
.usage-bar i {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, #22c55e, #06b6d4);
}
.usage-bar b {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: #fff;
    font-size: 10px;
}
.traffic-values {
    display: flex;
    justify-content: space-between;
    color: #fff;
    margin: 4px 10px 4px 28px;
}
.traffic-values div {
    display: grid;
    gap: 3px;
}
.traffic-values span {
    color: #9fb4cf;
    font-size: 11px;
}
.traffic-values strong {
    color: #fff;
    font-size: 20px;
    line-height: 1;
    font-weight: 900;
}
.traffic-values em {
    color: #cbd5e1;
    font-size: 11px;
    font-style: normal;
}
.traffic-chart {
    position: relative;
    height: 158px;
    margin: 6px 8px 0;
    padding-left: 54px;
}
.traffic-chart svg {
    width: 100%;
    height: 132px;
    overflow: visible;
}
.traffic-chart line {
    stroke: rgba(148,163,184,.13);
    stroke-width: 1;
}
.traffic-line {
    fill: none;
    stroke-width: 3;
    filter: drop-shadow(0 0 5px currentColor);
}
.traffic-line.download {
    color: #0ea5e9;
    stroke: #0ea5e9;
}
.traffic-line.upload {
    color: #22c55e;
    stroke: #22c55e;
}
.traffic-fill {
    opacity: .2;
}
.traffic-fill.download {
    fill: #0ea5e9;
}
.traffic-fill.upload {
    fill: #22c55e;
}
.traffic-y-axis {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 24px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    color: #cbd5e1;
    font-size: 10px;
}
.traffic-x-axis {
    display: flex;
    justify-content: space-between;
    color: #cbd5e1;
    font-size: 10px;
    margin-top: 1px;
}
.mini-stat-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 10px;
    background: transparent;
    border: 0;
    box-shadow: none;
}
.mini-stat {
    display: grid;
    place-items: center;
    align-content: center;
    gap: 5px;
    min-height: 92px;
    padding: 10px;
    border: 1px solid rgba(56,189,248,.16);
    border-radius: 8px;
    background: linear-gradient(145deg, rgba(14,28,52,.96), rgba(8,18,35,.96));
}
.mini-stat i {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: rgba(255,255,255,.06);
    font-size: 16px;
}
.mini-stat span {
    color: #9fb4cf;
    font-size: 10px;
}
.mini-stat strong {
    color: #fff;
    font-size: 17px;
}
.mini-stat small {
    color: #cbd5e1;
    font-size: 10px;
}
.mini-stat-wide {
    grid-column: span 2;
}
.mini-stat-wide strong {
    font-size: 15px;
}
.alarm-row {
    display: grid;
    grid-template-columns: 34px 1fr auto;
    gap: 10px;
    align-items: center;
    padding: 9px 10px;
    border-bottom: 1px solid rgba(148,163,184,.12);
    border-radius: 8px;
    background: rgba(15, 27, 48, .72);
    margin-bottom: 7px;
}
.alarm-row i {
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    border-radius: 7px;
    background: rgba(239,68,68,.16);
    color: #ef4444;
}
.alarm-row span strong,
.alarm-row span small {
    display: block;
}
.alarm-row span strong {
    color: #e5edf8;
    font-size: 12px;
}
.alarm-row span small,
.alarm-row em {
    color: #94a3b8;
    font-size: 11px;
    font-style: normal;
}
.alarm-row.amber i,
.alarm-row.yellow i {
    color: #f59e0b;
    background: rgba(245,158,11,.16);
}
body.dashboard-page .alarms-card .alarm-row.red {
    border-left: 3px solid #ef4444;
}
body.dashboard-page .alarms-card .alarm-row.amber,
body.dashboard-page .alarms-card .alarm-row.yellow {
    border-left: 3px solid #f59e0b;
}
body.dashboard-page .topbar {
    grid-template-columns: 40px minmax(260px, 340px) minmax(320px, 1fr) auto;
}
body.dashboard-page .topbar > div:not(.topbar-actions) {
    text-align: left;
}
body.dashboard-page .topbar > div:not(.topbar-actions)::before {
    content: "ISP ODN / PON NOC";
    display: block;
    color: #00d4ff;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1.5px;
}
body.dashboard-page .topbar > div:not(.topbar-actions)::after {
    content: "Dashboard";
    display: block;
    color: #fff;
    font-size: 24px;
    line-height: 1;
    font-weight: 900;
}
body.dashboard-page .topbar-welcome {
    margin-top: 3px;
    font-size: 12px;
}
body.dashboard-page .topbar-actions::before {
    content: "";
    width: min(440px, 32vw);
    height: 38px;
    border: 1px solid rgba(56,189,248,.18);
    border-radius: 8px;
    background: rgba(15,23,42,.76);
}
@media (max-width: 1500px) {
    .noc-screen .noc-kpi-row {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }
    body.dashboard-page {
        overflow: auto;
    }
}
@media (max-width: 1200px) {
    .noc-screen .noc-main-row,
    .noc-screen .noc-bottom-row {
        grid-template-columns: 1fr;
    }
    .noc-screen .dashboard-live-map,
    .noc-screen .issue-card,
    .noc-screen .summary-card,
    .traffic-card,
    .alarms-card,
    .mini-stat-grid,
    .noc-bottom-row > .issue-card {
        height: auto;
        min-height: 220px;
    }
    body.dashboard-page .topbar {
        grid-template-columns: 40px 1fr;
    }
    body.dashboard-page .topbar-actions::before {
        display: none;
    }
}

/* Final screenshot alignment pass */
body.dashboard-page .topbar {
    height: 78px;
    min-height: 78px;
    grid-template-columns: 42px 360px minmax(360px, 1fr) auto;
    gap: 14px;
    padding: 12px 18px;
    background: rgba(4, 13, 29, .94);
    border-bottom: 1px solid rgba(0, 212, 255, .14);
}
body.dashboard-page .topbar > div:not(.topbar-actions)::before,
body.dashboard-page .topbar > div:not(.topbar-actions)::after {
    content: none;
}
.dashboard-title-block {
    text-align: left !important;
}
.dashboard-title-block .eyebrow {
    color: #00d4ff;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .6px;
    line-height: 1;
}
.dashboard-title-line {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 3px;
}
body.dashboard-page .dashboard-title-line h1 {
    margin: 0;
    color: #fff;
    font-size: 23px;
    line-height: 1;
    font-weight: 900;
    text-shadow: 0 0 18px rgba(0, 212, 255, .2);
}
body.dashboard-page .dashboard-title-line h1::after {
    content: none;
}
.live-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 8px;
    color: #34d399;
    border: 1px solid rgba(34,197,94,.24);
    border-radius: 7px;
    background: rgba(34,197,94,.12);
    font-size: 11px;
    font-weight: 800;
}
.live-badge i {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 10px rgba(34,197,94,.85);
}
body.dashboard-page .topbar-welcome {
    margin-top: 7px;
    color: rgba(255,255,255,.72);
    font-size: 13px;
}
.dashboard-global-search {
    width: min(420px, 100%);
    height: 42px;
    justify-self: center;
    display: grid;
    grid-template-columns: 34px 1fr auto;
    align-items: center;
    padding: 0 10px;
    border: 1px solid rgba(56,189,248,.17);
    border-radius: 8px;
    background: rgba(12, 25, 47, .92);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.03);
}
.dashboard-global-search i {
    color: #94a3b8;
}
.dashboard-global-search input {
    width: 100%;
    color: #e2e8f0;
    background: transparent;
    border: 0;
    outline: 0;
    font-size: 13px;
}
.dashboard-global-search kbd {
    color: #94a3b8;
    background: rgba(15,23,42,.9);
    border: 1px solid rgba(148,163,184,.12);
    border-radius: 6px;
    font-size: 11px;
}
body.dashboard-page .topbar-actions {
    gap: 8px;
}
body.dashboard-page .topbar-actions::before {
    content: none;
}
.dashboard-bell {
    position: relative;
}
.dashboard-bell span {
    position: absolute;
    right: -5px;
    top: -6px;
    min-width: 18px;
    height: 18px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: #fff;
    background: #e11d48;
    font-size: 10px;
    font-weight: 900;
}
body.dashboard-page .topbar-clock {
    min-height: 36px;
    padding: 0 4px;
    color: #cbd5e1;
    font-size: 13px;
}
body.dashboard-page .content {
    height: calc(100vh - 78px);
    padding: 12px;
}
.noc-screen {
    min-height: calc(100vh - 102px);
}
.noc-screen .dashboard-control-strip {
    top: 92px;
    right: 18px;
}
.noc-screen .noc-kpi-row {
    margin-top: 14px;
    gap: 8px;
}
.noc-screen .kpi-card {
    height: 86px;
    min-height: 86px;
    border-radius: 8px;
}
.noc-screen .noc-main-row {
    grid-template-columns: minmax(0, 1.8fr) minmax(330px, .85fr) minmax(330px, .85fr);
}
.noc-screen .dashboard-live-map,
.noc-screen .issue-card,
.noc-screen .summary-card {
    height: 350px;
    min-height: 350px;
}
.noc-screen .dashboard-map {
    height: 300px;
    min-height: 300px;
}
.noc-screen .noc-bottom-row {
    grid-template-columns: minmax(380px, 1.2fr) minmax(320px, .95fr) minmax(320px, .95fr) minmax(360px, 1.15fr);
}
.traffic-card,
.alarms-card,
.mini-stat-grid,
.noc-bottom-row > .issue-card {
    height: 276px;
    min-height: 276px;
}
.noc-status-strip {
    height: 48px;
    display: grid;
    grid-template-columns: 1.2fr repeat(6, 1fr);
    align-items: center;
    gap: 14px;
    padding: 0 18px;
    margin: 0 -12px -12px;
    color: #a8b7cc;
    background: rgba(4, 13, 29, .95);
    border-top: 1px solid rgba(56,189,248,.12);
    font-size: 12px;
    margin-top: auto;
}
.noc-status-strip span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    white-space: nowrap;
}
.noc-status-strip b {
    color: #22c55e;
    font-weight: 800;
}
.noc-status-strip meter {
    width: 70px;
    height: 6px;
}
@media (max-width: 1500px) {
    body.dashboard-page {
        overflow: auto;
    }
    body.dashboard-page .topbar {
        grid-template-columns: 42px 320px 1fr;
        height: auto;
    }
    .dashboard-global-search {
        display: none;
    }
    .noc-status-strip {
        grid-template-columns: repeat(2, 1fr);
        height: auto;
        padding: 10px 18px;
    }
}

/* Premium NOC screenshot match */
body.dashboard-page {
    overflow: hidden;
    background:
        radial-gradient(circle at 72% 8%, rgba(37, 99, 235, .08), transparent 28%),
        linear-gradient(180deg, #071224 0%, #06101f 100%);
}
body.dashboard-page .app-shell {
    height: 100vh;
    overflow: hidden;
}
body.dashboard-page .sidebar {
    width: 210px;
    flex: 0 0 210px;
    padding: 18px 10px 12px;
    background: linear-gradient(180deg, rgba(7,17,34,.98), rgba(5,15,29,.98));
    border-right: 1px solid rgba(56,189,248,.13);
    box-shadow: inset -1px 0 0 rgba(255,255,255,.02);
}
body.dashboard-page.sidebar-collapsed .sidebar {
    width: 210px;
    flex-basis: 210px;
}
body.dashboard-page .brand {
    min-height: 42px;
    padding: 0 8px 14px;
    font-size: 18px;
}
body.dashboard-page .sidebar nav {
    gap: 6px;
    overflow: hidden;
}
body.dashboard-page .sidebar nav a,
body.dashboard-page.sidebar-collapsed .sidebar nav a {
    min-height: 37px;
    justify-content: flex-start;
    padding: 0 12px;
    gap: 12px;
    border-radius: 8px;
    font-size: 12px;
}
body.dashboard-page .sidebar nav a i,
body.dashboard-page.sidebar-collapsed .sidebar nav a i {
    width: 17px;
    font-size: 14px;
}
body.dashboard-page.sidebar-collapsed .sidebar nav a span,
body.dashboard-page.sidebar-collapsed .brand span,
body.dashboard-page.sidebar-collapsed .sidebar-status {
    display: initial;
}
body.dashboard-page .sidebar-status {
    margin-top: auto;
    padding: 13px;
    border-radius: 10px;
}
body.dashboard-page .topbar {
    height: 76px;
    min-height: 76px;
    grid-template-columns: 42px 390px minmax(320px, 1fr) auto;
    padding: 10px 18px;
}
body.dashboard-page .dashboard-title-line h1 {
    font-size: 22px;
}
body.dashboard-page .topbar-welcome {
    margin-top: 5px;
    font-size: 12px;
}
body.dashboard-page .dashboard-global-search {
    width: min(390px, 100%);
    height: 39px;
}
body.dashboard-page .topbar-actions .btn-icon,
body.dashboard-page #sidebarToggle {
    width: 38px;
    height: 38px;
}
body.dashboard-page .user-pill,
body.dashboard-page .topbar .btn-outline-danger {
    height: 38px;
    display: inline-flex;
    align-items: center;
}
body.dashboard-page .content {
    height: calc(100vh - 76px);
    padding: 12px 16px 0;
    overflow: hidden;
}
.noc-screen {
    height: 100%;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.noc-screen .dashboard-control-strip {
    position: absolute;
    top: 88px;
    right: 16px;
    z-index: 20;
    margin: 0;
}
.noc-screen .dashboard-view-toggle {
    display: none;
}
.noc-screen .noc-kpi-row {
    display: grid;
    grid-template-columns: repeat(9, minmax(0, 1fr));
    gap: 10px;
    margin: 20px 0 0;
}
.noc-screen .kpi-card {
    height: 92px;
    min-height: 92px;
    padding: 14px 13px;
    border-radius: 9px;
}
.noc-screen .kpi-card .noc-icon {
    width: 36px;
    height: 36px;
    font-size: 18px;
}
.noc-screen .noc-kpi-copy {
    left: 62px;
    top: 13px;
}
.noc-screen .noc-kpi-copy p {
    font-size: 10px;
    letter-spacing: .5px;
}
.noc-screen .noc-kpi-copy strong {
    font-size: 25px;
    line-height: 1;
}
.noc-screen .noc-kpi-copy small,
.noc-screen .noc-kpi-copy em {
    font-size: 11px;
}
.noc-screen .kpi-sparkline {
    width: 70px;
    height: 22px;
    right: 12px;
    bottom: 10px;
}
.noc-screen .noc-main-row {
    grid-template-columns: minmax(560px, 1.45fr) minmax(340px, .72fr) minmax(340px, .72fr);
    gap: 12px;
}
.noc-screen .dashboard-live-map,
.noc-screen .issue-card,
.noc-screen .summary-card {
    height: 322px;
    min-height: 322px;
    border-radius: 10px;
}
.noc-screen .dashboard-map {
    height: 264px;
    min-height: 264px;
}
.noc-screen .panel-title-row {
    min-height: 34px;
    padding-bottom: 9px;
}
.noc-screen .panel-title-row h2 {
    font-size: 15px;
}
.noc-screen .noc-btn {
    height: 30px;
    padding: 0 12px;
    font-size: 12px;
}
.dashboard-map .map-search-control {
    left: 12px;
    top: 12px;
    width: 350px;
    max-width: calc(100% - 24px);
}
.dashboard-map .map-floating-actions {
    right: 10px;
    top: 10px;
    gap: 6px;
}
.dashboard-map .map-floating-actions button {
    min-height: 27px;
    padding: 0 9px;
    font-size: 11px;
}
.noc-screen .map-legend-bar {
    left: 14px;
    bottom: 14px;
    padding: 8px 11px;
    gap: 13px;
    border-radius: 7px;
    font-size: 11px;
}
.noc-screen .noc-table thead th,
.noc-screen .noc-table tbody td {
    font-size: 11px;
    padding: 8px 7px;
}
.rx-bars {
    height: 66px;
    margin-top: auto;
}
.summary-body {
    grid-template-columns: 1fr 1fr;
    gap: 22px;
    padding: 8px 4px 0;
}
.summary-donut {
    width: 165px;
    height: 165px;
}
.summary-donut > div {
    width: 78px;
    height: 78px;
}
.summary-list {
    align-self: center;
}
.summary-list li {
    min-height: 32px;
    font-size: 12px;
}
.noc-screen .noc-bottom-row {
    grid-template-columns: minmax(360px, 1.05fr) minmax(360px, .9fr) minmax(330px, .8fr) minmax(350px, .98fr);
    gap: 12px;
}
.traffic-card,
.alarms-card,
.mini-stat-grid,
.noc-bottom-row > .issue-card {
    height: 244px;
    min-height: 244px;
    border-radius: 10px;
}
.traffic-values {
    padding: 2px 16px 8px;
}
.traffic-values strong {
    font-size: 19px;
}
.traffic-chart {
    height: 157px;
    margin: 0 8px;
}
.traffic-chart svg {
    height: 122px;
}
.mini-stat-grid {
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: 1fr 1fr;
    gap: 10px;
    padding: 0;
    background: transparent;
    border: 0;
}
.mini-stat {
    border: 1px solid rgba(56,189,248,.13);
    background: rgba(10,25,47,.84);
    border-radius: 9px;
    gap: 5px;
}
.mini-stat i {
    width: 32px;
    height: 32px;
}
.mini-stat strong {
    font-size: 18px;
}
.mini-stat small {
    color: #9fb4cf;
}
.mini-stat-wide {
    grid-column: span 2;
}
.alarm-row {
    min-height: 42px;
    padding: 8px 10px;
}
.noc-status-strip {
    height: 44px;
    min-height: 44px;
    margin: auto -16px 0;
    padding: 0 24px;
    grid-template-columns: 1.2fr repeat(6, minmax(120px, 1fr));
}
@media (min-width: 1800px) {
    body.dashboard-page .sidebar {
        width: 220px;
        flex-basis: 220px;
    }
    body.dashboard-page.sidebar-collapsed .sidebar {
        width: 220px;
        flex-basis: 220px;
    }
    body.dashboard-page .content {
        padding-left: 18px;
        padding-right: 18px;
    }
    .noc-screen .noc-main-row {
        grid-template-columns: minmax(720px, 1.58fr) minmax(390px, .78fr) minmax(390px, .78fr);
    }
    .noc-screen .noc-bottom-row {
        grid-template-columns: minmax(470px, 1.1fr) minmax(420px, .95fr) minmax(430px, .9fr) minmax(430px, 1fr);
    }
}
@media (max-width: 1700px) {
    body.dashboard-page {
        overflow: auto;
    }
    body.dashboard-page .app-shell,
    body.dashboard-page .content {
        height: auto;
        min-height: 100vh;
        overflow: visible;
    }
    .noc-screen .noc-kpi-row {
        grid-template-columns: repeat(3, 1fr);
    }
    .noc-screen .noc-main-row,
    .noc-screen .noc-bottom-row {
        grid-template-columns: 1fr;
    }
    .noc-screen .dashboard-live-map,
    .noc-screen .issue-card,
    .noc-screen .summary-card,
    .traffic-card,
    .alarms-card,
    .mini-stat-grid,
    .noc-bottom-row > .issue-card {
        height: auto;
        min-height: 260px;
    }
}

/* Dashboard viewport correction for the NOC reference layout */
@media (min-width: 1200px) {
    body.dashboard-page .app-shell {
        display: grid;
        grid-template-columns: 220px minmax(0, 1fr);
        width: 100vw;
        height: 100vh;
        overflow: hidden;
    }
    body.dashboard-page .sidebar,
    body.dashboard-page.sidebar-collapsed .sidebar {
        position: relative !important;
        z-index: 2;
        transform: none !important;
        display: flex !important;
        width: 220px !important;
        min-width: 220px !important;
        max-width: 220px !important;
        flex: 0 0 220px !important;
        height: 100vh;
        overflow: hidden;
    }
    body.dashboard-page .main {
        min-width: 0;
        height: 100vh;
        overflow: hidden;
    }
    body.dashboard-page .topbar {
        height: 74px;
        min-height: 74px;
    }
    body.dashboard-page .content {
        height: calc(100vh - 74px);
        min-height: 0;
        overflow: hidden;
    }
    .noc-screen .noc-kpi-row {
        grid-template-columns: repeat(9, minmax(0, 1fr));
    }
    .noc-screen .noc-main-row {
        grid-template-columns: minmax(0, 1.5fr) minmax(330px, .72fr) minmax(330px, .72fr);
    }
    .noc-screen .noc-bottom-row {
        grid-template-columns: minmax(330px, 1fr) minmax(330px, .9fr) minmax(330px, .9fr) minmax(330px, 1fr);
    }
}

/* Dashboard UI polish: balanced, centered, no-overlap cards */
@media (min-width: 1200px) {
    .dashboard-grid.noc-screen {
        align-items: stretch;
        justify-items: stretch;
    }
    .dashboard-grid .noc-card {
        position: relative;
        display: flex;
        flex-direction: column;
        min-width: 0;
        min-height: 0;
        padding: 14px;
        border-radius: 12px;
    }
    .dashboard-grid .panel-title-row {
        flex: 0 0 36px;
        min-height: 36px;
        margin: 0;
        padding: 0 0 10px;
    }
    .dashboard-grid .panel-title-row h2 {
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .dashboard-grid .noc-kpi-row .kpi-card {
        display: grid;
        grid-template-columns: 42px minmax(0, 1fr);
        grid-template-rows: 1fr;
        align-items: center;
        column-gap: 10px;
        padding: 12px;
    }
    .dashboard-grid .kpi-card .noc-icon {
        position: static;
        grid-column: 1;
        justify-self: center;
        align-self: center;
    }
    .dashboard-grid .noc-kpi-copy {
        position: static;
        grid-column: 2;
        display: grid;
        justify-items: center;
        align-content: center;
        text-align: center;
        min-width: 0;
    }
    .dashboard-grid .noc-kpi-copy p,
    .dashboard-grid .noc-kpi-copy strong,
    .dashboard-grid .noc-kpi-copy small,
    .dashboard-grid .noc-kpi-copy em {
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .dashboard-grid .noc-kpi-copy strong {
        line-height: 1.05;
    }
    .dashboard-grid .kpi-sparkline {
        right: 8px;
        bottom: 7px;
        width: min(58px, 36%);
        height: 18px;
        opacity: .82;
    }
    .dashboard-grid .dashboard-live-map,
    .dashboard-grid .noc-main-row > .issue-card,
    .dashboard-grid .summary-card,
    .dashboard-grid .noc-bottom-row > .issue-card,
    .dashboard-grid .traffic-card,
    .dashboard-grid .alarms-card {
        padding: 14px;
    }
    .dashboard-grid .dashboard-map {
        flex: 1 1 auto;
        height: auto;
        min-height: 0;
    }
    .dashboard-grid .map-legend-bar {
        max-width: calc(100% - 28px);
        overflow: hidden;
    }
    .dashboard-grid .map-legend-bar span {
        white-space: nowrap;
    }
    .dashboard-grid .noc-table {
        table-layout: fixed;
        width: 100%;
    }
    .dashboard-grid .noc-table th,
    .dashboard-grid .noc-table td {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .dashboard-grid .rx-bars {
        flex: 0 0 70px;
        width: 100%;
        min-height: 0;
        margin-top: auto;
    }
    .dashboard-grid .summary-body {
        flex: 1 1 auto;
        height: auto;
        min-height: 0;
        overflow: hidden;
    }
    .dashboard-grid .summary-donut {
        width: clamp(128px, 9vw, 168px);
        height: clamp(128px, 9vw, 168px);
        min-width: 0;
        min-height: 0;
    }
    .dashboard-grid .summary-donut > div {
        width: 58%;
        height: 58%;
    }
    .dashboard-grid .summary-list {
        min-width: 0;
        overflow: hidden;
    }
    .dashboard-grid .summary-list li {
        min-width: 0;
        grid-template-columns: 12px minmax(0, 1fr) auto;
        gap: 7px;
    }
    .dashboard-grid .summary-list li span {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .dashboard-grid .traffic-values {
        flex: 0 0 auto;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }
    .dashboard-grid .traffic-chart {
        flex: 1 1 auto;
        min-height: 0;
        margin: 0;
        padding-left: 54px;
        overflow: hidden;
    }
    .dashboard-grid .traffic-chart svg {
        display: block;
        width: 100%;
        height: calc(100% - 22px);
        min-height: 110px;
    }
    .dashboard-grid .traffic-y-axis,
    .dashboard-grid .traffic-x-axis {
        font-size: 10px;
    }
    .dashboard-grid .mini-stat-grid {
        align-items: stretch;
    }
    .dashboard-grid .mini-stat {
        display: grid;
        grid-template-rows: auto auto 1fr auto;
        place-items: center;
        align-content: center;
        text-align: center;
        overflow: hidden;
    }
    .dashboard-grid .mini-stat span,
    .dashboard-grid .mini-stat strong,
    .dashboard-grid .mini-stat small {
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .dashboard-grid .alarms-card {
        gap: 0;
    }
    .dashboard-grid .alarm-row {
        min-width: 0;
    }
    .dashboard-grid .alarm-row span,
    .dashboard-grid .alarm-row strong,
    .dashboard-grid .alarm-row small {
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .dashboard-grid .noc-status-strip {
        overflow: hidden;
        padding: 0 16px;
    }
    .dashboard-grid .noc-status-strip span {
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}
@media (min-width: 1200px) and (max-height: 820px) {
    .dashboard-grid .noc-card {
        padding: 12px;
    }
    .dashboard-grid .panel-title-row {
        flex-basis: 32px;
        min-height: 32px;
        padding-bottom: 8px;
    }
    .dashboard-grid .rx-bars {
        flex-basis: 54px;
    }
    .dashboard-grid .summary-donut {
        width: clamp(108px, 8vw, 136px);
        height: clamp(108px, 8vw, 136px);
    }
    .dashboard-grid .summary-list li {
        min-height: 25px;
        font-size: 11px;
    }
    .dashboard-grid .traffic-values strong {
        font-size: 17px;
    }
}

/* Dashboard simplified widget layout */
@media (min-width: 1200px) {
    .dashboard-grid.noc-screen {
        grid-template-columns: repeat(12, minmax(0, 1fr));
        grid-template-rows: 96px minmax(300px, 1.45fr) minmax(170px, .85fr) minmax(120px, .55fr) 42px;
        gap: 16px;
    }
    .dashboard-grid .noc-kpi-row {
        grid-column: 1 / -1;
        grid-row: 1;
        display: grid;
        grid-template-columns: repeat(9, minmax(0, 1fr));
        gap: 16px;
    }
    .dashboard-grid .noc-main-row {
        grid-column: 1 / -1;
        grid-row: 2;
        display: grid;
        grid-template-columns: 1fr;
        gap: 0;
        min-height: 0;
    }
    .dashboard-grid .dashboard-live-map {
        grid-column: 1;
        grid-row: 1;
        height: 100%;
        min-height: 0;
    }
    .dashboard-grid .dashboard-map {
        height: calc(100% - 43px);
    }
    .dashboard-grid .noc-bottom-row {
        grid-column: 1 / -1;
        grid-row: 3;
        display: grid;
        grid-template-columns: 3fr 1.25fr 1.25fr 1.25fr 2.25fr;
        gap: 16px;
        min-height: 0;
    }
    .dashboard-grid .noc-bottom-row > .issue-card {
        grid-column: 1;
        height: 100%;
    }
    .dashboard-grid .noc-bottom-row > .mini-stat-grid {
        display: contents;
    }
    .dashboard-grid .noc-bottom-row > .mini-stat-grid .mini-stat {
        height: 100%;
        min-height: 0;
        border-radius: 12px;
    }
    .dashboard-grid .noc-bottom-row > .mini-stat-grid .mini-stat:nth-child(1) {
        grid-column: 2;
    }
    .dashboard-grid .noc-bottom-row > .mini-stat-grid .mini-stat:nth-child(2) {
        grid-column: 3;
    }
    .dashboard-grid .noc-bottom-row > .mini-stat-grid .mini-stat:nth-child(3) {
        grid-column: 4;
    }
    .dashboard-grid .alarms-card {
        grid-column: 5;
        height: 100%;
        min-height: 0;
    }
    .dashboard-grid .noc-metrics-row {
        grid-column: 1 / -1;
        grid-row: 4;
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 16px;
        min-height: 0;
    }
    .dashboard-grid .noc-metrics-row .mini-stat {
        height: 100%;
        min-height: 0;
    }
    .dashboard-grid .noc-status-strip {
        grid-column: 1 / -1;
        grid-row: 5;
        height: 42px;
        min-height: 42px;
    }
}
@media (min-width: 1200px) and (max-height: 820px) {
    .dashboard-grid.noc-screen {
        grid-template-rows: 82px minmax(260px, 1.3fr) minmax(150px, .8fr) minmax(96px, .45fr) 42px;
        gap: 12px;
    }
    .dashboard-grid .noc-kpi-row,
    .dashboard-grid .noc-bottom-row,
    .dashboard-grid .noc-metrics-row {
        gap: 12px;
    }
}
@media (min-width: 1200px) and (max-width: 1450px) {
    .dashboard-grid.noc-screen {
        grid-template-rows: 82px minmax(240px, 1.2fr) minmax(145px, .8fr) minmax(92px, .45fr) 42px;
        gap: 12px;
    }
    .dashboard-grid .noc-kpi-row {
        gap: 8px;
    }
    .dashboard-grid .noc-bottom-row {
        grid-template-columns: 2.6fr 1fr 1fr 1fr 1.8fr;
        gap: 12px;
    }
    .dashboard-grid .noc-metrics-row {
        gap: 12px;
    }
}

/* Fix Network Statistics card text overlap */
@media (min-width: 1200px) {
    .dashboard-grid.noc-screen {
        grid-template-rows: 96px 430px 330px 42px !important;
        min-height: calc(96px + 430px + 330px + 42px + 48px) !important;
    }
    .dashboard-grid .noc-bottom-row,
    .dashboard-grid .noc-bottom-row > .pon-card,
    .dashboard-grid .noc-bottom-row > .stats-card {
        height: 330px !important;
        min-height: 330px !important;
    }
    .dashboard-grid .noc-bottom-row > .stats-card {
        grid-template-rows: repeat(3, minmax(98px, 1fr)) !important;
    }
    .dashboard-grid .stats-card > .mini-stat {
        display: grid !important;
        grid-template-rows: 34px 16px 24px 16px !important;
        align-content: center !important;
        justify-items: center !important;
        gap: 4px !important;
        padding: 10px 8px !important;
        text-align: center !important;
        line-height: 1.1 !important;
    }
    .dashboard-grid .stats-card > .mini-stat i {
        grid-row: 1 !important;
        width: 30px !important;
        height: 30px !important;
        margin: 0 !important;
        position: static !important;
    }
    .dashboard-grid .stats-card > .mini-stat span,
    .dashboard-grid .stats-card > .mini-stat strong,
    .dashboard-grid .stats-card > .mini-stat small {
        position: static !important;
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
        line-height: 1.1 !important;
    }
    .dashboard-grid .stats-card > .mini-stat span {
        grid-row: 2 !important;
        font-size: 11px !important;
    }
    .dashboard-grid .stats-card > .mini-stat strong {
        grid-row: 3 !important;
        font-size: 19px !important;
    }
    .dashboard-grid .stats-card > .mini-stat small {
        grid-row: 4 !important;
        font-size: 10px !important;
    }
}
@media (min-width: 1200px) and (max-width: 1450px) {
    .dashboard-grid.noc-screen {
        grid-template-rows: 84px 360px 300px 42px !important;
        min-height: calc(84px + 360px + 300px + 42px + 36px) !important;
    }
    .dashboard-grid .noc-bottom-row,
    .dashboard-grid .noc-bottom-row > .pon-card,
    .dashboard-grid .noc-bottom-row > .stats-card {
        height: 300px !important;
        min-height: 300px !important;
    }
    .dashboard-grid .noc-bottom-row > .stats-card {
        grid-template-rows: repeat(3, minmax(88px, 1fr)) !important;
    }
    .dashboard-grid .stats-card > .mini-stat strong {
        font-size: 17px !important;
    }
}
@media (max-width: 1199px) {
    .dashboard-grid .noc-metrics-row {
        display: grid;
        grid-template-columns: 1fr;
        gap: 16px;
    }
}

/* Full-width Live Fiber Map layout */
@media (min-width: 1200px) {
    .dashboard-grid.noc-screen {
        grid-template-rows: 96px 500px minmax(170px, 1fr) minmax(118px, .55fr) 42px;
    }
    .dashboard-grid .noc-main-row,
    .dashboard-grid .dashboard-live-map {
        grid-column: 1 / -1;
        grid-row: 2;
        width: 100%;
        height: 500px;
        min-height: 500px;
    }
    .dashboard-grid .dashboard-live-map {
        display: flex;
        flex-direction: column;
    }
    .dashboard-grid .dashboard-map {
        flex: 1 1 auto;
        height: auto;
        min-height: 0;
    }
    .dashboard-grid .noc-bottom-row {
        grid-row: 3;
        grid-template-columns: 3fr 1.15fr 1.15fr 1.15fr 2fr;
        align-items: stretch;
    }
    .dashboard-grid .noc-bottom-row > .issue-card,
    .dashboard-grid .noc-bottom-row > .mini-stat-grid .mini-stat,
    .dashboard-grid .alarms-card {
        height: 100%;
    }
}
@media (min-width: 1200px) and (max-height: 900px) {
    .dashboard-grid.noc-screen {
        grid-template-rows: 82px 500px minmax(150px, 1fr) minmax(96px, .45fr) 42px;
    }
    body.dashboard-page .content {
        overflow: auto;
    }
    body.dashboard-page .main {
        overflow: hidden;
    }
    .dashboard-grid.noc-screen {
        height: auto;
        min-height: calc(82px + 500px + 150px + 96px + 42px + 48px);
    }
}

/* Rebuilt dashboard grid after widget cleanup */
body.dashboard-page .content {
    width: 100%;
}
body.dashboard-page .dashboard-control-strip {
    display: none !important;
    position: static !important;
}
@media (min-width: 1200px) {
    body.dashboard-page .content {
        height: calc(100vh - 72px);
        padding: 16px;
        overflow: hidden;
    }
    .dashboard-grid.noc-screen {
        display: grid !important;
        grid-template-columns: repeat(12, minmax(0, 1fr));
        grid-template-rows: 96px minmax(360px, 1.35fr) minmax(240px, .85fr) 42px;
        gap: 16px;
        width: 100%;
        height: 100%;
        min-height: 0;
        align-items: stretch;
    }
    .dashboard-grid .noc-kpi-row {
        grid-column: 1 / -1 !important;
        grid-row: 1 !important;
        display: grid !important;
        grid-template-columns: repeat(9, minmax(0, 1fr));
        gap: 16px;
        width: 100%;
        height: 100%;
        min-height: 0;
        margin: 0;
    }
    .dashboard-grid .noc-kpi-row .kpi-card {
        grid-column: auto !important;
        grid-row: auto !important;
        width: 100%;
        height: 100%;
        min-height: 0;
    }
    .dashboard-grid .noc-main-row {
        grid-column: 1 / -1 !important;
        grid-row: 2 !important;
        display: grid !important;
        grid-template-columns: repeat(12, minmax(0, 1fr));
        gap: 16px;
        width: 100%;
        height: 100%;
        min-height: 0;
    }
    .dashboard-grid .map-card {
        grid-column: span 9 !important;
        grid-row: auto !important;
        height: 100%;
        min-height: 0;
    }
    .dashboard-grid .alarm-card {
        grid-column: span 3 !important;
        grid-row: auto !important;
        height: 100%;
        min-height: 0;
    }
    .dashboard-grid .noc-bottom-row {
        grid-column: 1 / -1 !important;
        grid-row: 3 !important;
        display: grid !important;
        grid-template-columns: repeat(12, minmax(0, 1fr));
        gap: 16px;
        width: 100%;
        height: 100%;
        min-height: 0;
    }
    .dashboard-grid .pon-card {
        grid-column: span 6 !important;
        grid-row: auto !important;
        height: 100%;
        min-height: 0;
    }
    .dashboard-grid .stats-card {
        grid-column: span 6 !important;
        grid-row: auto !important;
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-template-rows: repeat(3, minmax(0, 1fr));
        gap: 16px;
        height: 100%;
        min-height: 0;
        padding: 0;
        border: 0;
        background: transparent;
        box-shadow: none;
        overflow: visible;
    }
    .dashboard-grid .stats-card .mini-stat {
        height: 100%;
        min-height: 0;
        border-radius: 12px;
        border: 1px solid rgba(56,189,248,.16);
        background:
            radial-gradient(circle at 50% 0%, rgba(56,189,248,.12), transparent 42%),
            linear-gradient(180deg, rgba(15,31,55,.92), rgba(8,21,39,.94));
        box-shadow: inset 0 1px 0 rgba(255,255,255,.035), 0 18px 42px rgba(0,0,0,.18);
    }
    .dashboard-grid .noc-status-strip {
        grid-column: 1 / -1 !important;
        grid-row: 4 !important;
        height: 42px;
        min-height: 42px;
        margin: 0;
        border-radius: 12px 12px 0 0;
    }
    .dashboard-grid .noc-card {
        min-width: 0;
        overflow: hidden;
    }
    .dashboard-grid .dashboard-live-map,
    .dashboard-grid .alarms-card,
    .dashboard-grid .pon-card {
        display: flex;
        flex-direction: column;
    }
    .dashboard-grid .dashboard-map {
        flex: 1 1 auto;
        height: auto !important;
        min-height: 0;
    }
    .dashboard-grid .alarms-card {
        gap: 0;
    }
    .dashboard-grid .alarm-row {
        flex: 1 1 0;
        min-height: 0;
    }
    .dashboard-grid .pon-card .noc-table {
        flex: 1 1 auto;
        min-height: 0;
    }
}
@media (min-width: 1200px) and (max-height: 820px) {
    body.dashboard-page .content {
        padding: 12px;
        overflow: auto;
    }
    .dashboard-grid.noc-screen {
        grid-template-rows: 82px 320px 190px 42px;
        gap: 12px;
        height: auto;
        min-height: calc(82px + 320px + 190px + 42px + 36px);
    }
    .dashboard-grid .noc-kpi-row,
    .dashboard-grid .noc-main-row,
    .dashboard-grid .noc-bottom-row,
    .dashboard-grid .stats-card {
        gap: 12px;
    }
}
@media (max-width: 1199px) {
    body.dashboard-page .content {
        overflow: visible;
    }
    .dashboard-grid.noc-screen,
    .dashboard-grid .noc-kpi-row,
    .dashboard-grid .noc-main-row,
    .dashboard-grid .noc-bottom-row,
    .dashboard-grid .stats-card {
        display: grid !important;
        grid-template-columns: 1fr;
        gap: 16px;
        height: auto;
    }
    .dashboard-grid .noc-status-strip {
        height: auto;
        min-height: 42px;
    }
}

/* Premium clean dashboard design */
body.dashboard-page {
    background:
        radial-gradient(circle at 18% 8%, rgba(0, 212, 255, .10), transparent 32%),
        radial-gradient(circle at 80% 0%, rgba(34, 197, 94, .08), transparent 26%),
        linear-gradient(180deg, #050d1a 0%, #071426 48%, #040a14 100%);
}
body.dashboard-page .topbar {
    background: rgba(5, 14, 28, .88);
    border-bottom: 1px solid rgba(0, 212, 255, .14);
    box-shadow: 0 10px 34px rgba(0, 0, 0, .18);
}
body.dashboard-page .sidebar {
    background:
        radial-gradient(circle at 0 0, rgba(0, 212, 255, .11), transparent 34%),
        linear-gradient(180deg, rgba(8, 20, 39, .98), rgba(4, 11, 23, .98));
}
body.dashboard-page .sidebar nav a {
    border: 1px solid transparent;
}
body.dashboard-page .sidebar nav a:hover {
    color: #fff;
    background: rgba(14, 165, 233, .08);
    border-color: rgba(56, 189, 248, .16);
}
body.dashboard-page .sidebar nav a.active {
    background: linear-gradient(135deg, #0f62fe, #0891b2);
    border-color: rgba(125, 211, 252, .36);
    box-shadow: 0 12px 28px rgba(14, 165, 233, .22);
}
@media (min-width: 1200px) {
    .dashboard-grid.noc-screen {
        grid-template-rows: 98px minmax(380px, 1.35fr) minmax(250px, .82fr) 42px;
        gap: 16px;
    }
    .dashboard-grid .noc-card,
    .dashboard-grid .stats-card .mini-stat {
        border-radius: 14px;
        border: 1px solid rgba(56, 189, 248, .18);
        background:
            linear-gradient(180deg, rgba(16, 33, 59, .88), rgba(8, 20, 38, .94));
        box-shadow:
            inset 0 1px 0 rgba(255, 255, 255, .045),
            0 18px 44px rgba(0, 0, 0, .20);
    }
    .dashboard-grid .noc-card::before,
    .dashboard-grid .stats-card .mini-stat::before {
        content: "";
        position: absolute;
        inset: 0;
        pointer-events: none;
        border-radius: inherit;
        background:
            linear-gradient(135deg, rgba(255,255,255,.055), transparent 32%),
            radial-gradient(circle at 100% 0%, rgba(0,212,255,.08), transparent 38%);
    }
    .dashboard-grid .noc-kpi-row .kpi-card {
        padding: 13px 12px;
        border-radius: 14px;
        background:
            radial-gradient(circle at 100% 100%, currentColor, transparent 46%),
            linear-gradient(180deg, rgba(18, 36, 64, .92), rgba(8, 20, 38, .95));
        background-blend-mode: soft-light, normal;
    }
    .dashboard-grid .kpi-card .noc-icon {
        width: 40px;
        height: 40px;
        border-radius: 10px;
        background: rgba(2, 8, 23, .38);
        box-shadow: inset 0 1px 0 rgba(255,255,255,.08);
    }
    .dashboard-grid .noc-kpi-copy p {
        color: #a9d7ff;
        font-size: 10px;
        letter-spacing: .6px;
    }
    .dashboard-grid .noc-kpi-copy strong {
        font-size: 28px;
        letter-spacing: 0;
        text-shadow: 0 0 18px rgba(125, 211, 252, .16);
    }
    .dashboard-grid .noc-kpi-copy small {
        color: rgba(226, 232, 240, .74);
    }
    .dashboard-grid .noc-kpi-copy em {
        color: #22c55e;
    }
    .dashboard-grid .panel-title-row {
        flex-basis: 38px;
        min-height: 38px;
        border-bottom: 1px solid rgba(148, 163, 184, .10);
    }
    .dashboard-grid .panel-title-row h2 {
        color: #fff;
        font-size: 16px;
        font-weight: 900;
    }
    .dashboard-grid .panel-title-row h2 i {
        color: #38bdf8;
    }
    .dashboard-grid .noc-btn {
        color: #67e8f9;
        background: rgba(14, 165, 233, .10);
        border-color: rgba(56, 189, 248, .24);
    }
    .dashboard-grid .noc-btn:hover {
        color: #fff;
        background: rgba(14, 165, 233, .20);
    }
    .dashboard-grid .dashboard-live-map {
        padding: 14px;
    }
    .dashboard-grid .dashboard-map {
        border: 1px solid rgba(56, 189, 248, .14);
        border-radius: 12px;
        overflow: hidden;
    }
    .dashboard-grid .map-legend-bar {
        left: 18px;
        bottom: 18px;
        padding: 9px 12px;
        border-radius: 10px;
        background: rgba(3, 10, 22, .82);
        border: 1px solid rgba(56, 189, 248, .16);
        backdrop-filter: blur(10px);
    }
    .dashboard-map .map-search-control {
        top: 16px;
        left: 16px;
        border-radius: 10px;
        background: rgba(3, 10, 22, .84);
        backdrop-filter: blur(10px);
    }
    .dashboard-map .map-floating-actions {
        top: 16px;
        right: 16px;
    }
    .dashboard-map .map-floating-actions button {
        border-radius: 9px;
        background: rgba(3, 10, 22, .84);
        backdrop-filter: blur(10px);
    }
    .dashboard-grid .alarms-card {
        gap: 10px;
    }
    .dashboard-grid .alarm-row {
        border-radius: 12px;
        border: 1px solid rgba(148, 163, 184, .10);
        background: rgba(15, 31, 55, .58);
    }
    .dashboard-grid .alarm-row i {
        width: 32px;
        height: 32px;
        display: grid;
        place-items: center;
        border-radius: 9px;
        background: rgba(255,255,255,.06);
    }
    .dashboard-grid .pon-card .noc-table thead th {
        color: #a9d7ff;
        font-size: 11px;
        letter-spacing: .5px;
    }
    .dashboard-grid .pon-card .noc-table tbody td {
        color: rgba(226, 232, 240, .88);
        font-size: 12px;
    }
    .dashboard-grid .stats-card {
        gap: 16px;
    }
    .dashboard-grid .stats-card .mini-stat {
        position: relative;
        padding: 12px;
        overflow: hidden;
    }
    .dashboard-grid .stats-card .mini-stat i {
        width: 36px;
        height: 36px;
        border-radius: 50%;
        background: rgba(56, 189, 248, .10);
    }
    .dashboard-grid .stats-card .mini-stat span {
        color: #a9d7ff;
        font-weight: 700;
    }
    .dashboard-grid .stats-card .mini-stat strong {
        color: #fff;
        font-size: clamp(18px, 1.25vw, 24px);
    }
    .dashboard-grid .stats-card .mini-stat small {
        color: rgba(226, 232, 240, .66);
    }
    .dashboard-grid .noc-status-strip {
        color: rgba(226, 232, 240, .78);
        background: rgba(3, 10, 22, .88);
        border: 1px solid rgba(56, 189, 248, .12);
        border-bottom: 0;
        box-shadow: inset 0 1px 0 rgba(255,255,255,.035);
    }
    .dashboard-grid .noc-status-strip b {
        color: #22c55e;
    }
}
@media (min-width: 1200px) and (max-width: 1450px) {
    .dashboard-grid.noc-screen {
        grid-template-rows: 86px 320px 210px 42px;
        gap: 12px;
    }
    .dashboard-grid .noc-kpi-row,
    .dashboard-grid .noc-main-row,
    .dashboard-grid .noc-bottom-row,
    .dashboard-grid .stats-card {
        gap: 12px;
    }
    .dashboard-grid .noc-kpi-copy strong {
        font-size: 22px;
    }
    .dashboard-grid .kpi-card .noc-icon {
        width: 34px;
        height: 34px;
    }
}

/* Absolute final fix for dashboard Network Statistics cards */
@media (min-width: 1200px) {
    .dashboard-grid .stats-card > .mini-stat {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 6px !important;
        padding: 12px 10px !important;
        text-align: center !important;
        overflow: hidden !important;
        line-height: 1.1 !important;
    }
    .dashboard-grid .stats-card > .mini-stat i {
        position: static !important;
        display: grid !important;
        place-items: center !important;
        flex: 0 0 28px !important;
        width: 28px !important;
        height: 28px !important;
        min-width: 28px !important;
        min-height: 28px !important;
        margin: 0 !important;
        transform: none !important;
        font-size: 14px !important;
        line-height: 1 !important;
    }
    .dashboard-grid .stats-card > .mini-stat span,
    .dashboard-grid .stats-card > .mini-stat strong,
    .dashboard-grid .stats-card > .mini-stat small {
        position: static !important;
        display: block !important;
        flex: 0 0 auto !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        line-height: 1.15 !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
        transform: none !important;
    }
    .dashboard-grid .stats-card > .mini-stat span {
        font-size: 11px !important;
        font-weight: 800 !important;
    }
    .dashboard-grid .stats-card > .mini-stat strong {
        font-size: 18px !important;
        font-weight: 900 !important;
    }
    .dashboard-grid .stats-card > .mini-stat small {
        font-size: 10px !important;
        opacity: .78 !important;
    }
}

/* LAST RULE 2: fix clipped KPI and statistics content */
@media (min-width: 1200px) {
    .dashboard-grid.noc-screen {
        grid-template-rows: 112px 430px 360px 42px !important;
        min-height: calc(112px + 430px + 360px + 42px + 48px) !important;
    }
    .dashboard-grid .noc-kpi-row {
        height: 112px !important;
        min-height: 112px !important;
    }
    .dashboard-grid .noc-kpi-row .kpi-card {
        height: 112px !important;
        min-height: 112px !important;
        grid-template-columns: 46px minmax(0, 1fr) !important;
        align-items: center !important;
        padding: 14px 12px !important;
        overflow: hidden !important;
    }
    .dashboard-grid .kpi-card .noc-icon {
        width: 38px !important;
        height: 38px !important;
        min-width: 38px !important;
        min-height: 38px !important;
    }
    .dashboard-grid .noc-kpi-copy {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 2px !important;
        min-width: 0 !important;
        line-height: 1.05 !important;
    }
    .dashboard-grid .noc-kpi-copy p,
    .dashboard-grid .noc-kpi-copy strong,
    .dashboard-grid .noc-kpi-copy small,
    .dashboard-grid .noc-kpi-copy em {
        position: static !important;
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        line-height: 1.08 !important;
        text-align: center !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }
    .dashboard-grid .noc-kpi-copy strong {
        font-size: 27px !important;
    }
    .dashboard-grid .noc-kpi-copy small,
    .dashboard-grid .noc-kpi-copy em {
        font-size: 11px !important;
    }
    .dashboard-grid .kpi-sparkline {
        right: 8px !important;
        bottom: 6px !important;
        width: 54px !important;
        height: 16px !important;
        opacity: .45 !important;
        pointer-events: none !important;
    }
    .dashboard-grid .noc-bottom-row,
    .dashboard-grid .noc-bottom-row > .pon-card,
    .dashboard-grid .noc-bottom-row > .stats-card {
        height: 360px !important;
        min-height: 360px !important;
    }
    .dashboard-grid .noc-bottom-row > .stats-card {
        grid-template-rows: repeat(3, minmax(108px, 1fr)) !important;
    }
    .dashboard-grid .stats-card > .mini-stat {
        min-height: 108px !important;
        gap: 5px !important;
        padding: 14px 10px !important;
    }
}
@media (min-width: 1200px) and (max-width: 1450px) {
    .dashboard-grid.noc-screen {
        grid-template-rows: 96px 360px 330px 42px !important;
        min-height: calc(96px + 360px + 330px + 42px + 36px) !important;
    }
    .dashboard-grid .noc-kpi-row,
    .dashboard-grid .noc-kpi-row .kpi-card {
        height: 96px !important;
        min-height: 96px !important;
    }
    .dashboard-grid .noc-kpi-copy strong {
        font-size: 23px !important;
    }
    .dashboard-grid .noc-kpi-copy small,
    .dashboard-grid .noc-kpi-copy em {
        font-size: 10px !important;
    }
    .dashboard-grid .noc-bottom-row,
    .dashboard-grid .noc-bottom-row > .pon-card,
    .dashboard-grid .noc-bottom-row > .stats-card {
        height: 330px !important;
        min-height: 330px !important;
    }
    .dashboard-grid .noc-bottom-row > .stats-card {
        grid-template-rows: repeat(3, minmax(100px, 1fr)) !important;
    }
    .dashboard-grid .stats-card > .mini-stat {
        min-height: 100px !important;
    }
}

/* LAST RULE 2: fix clipped KPI and statistics content */
@media (min-width: 1200px) {
    .dashboard-grid.noc-screen {
        grid-template-rows: 112px 430px 360px 42px !important;
        min-height: calc(112px + 430px + 360px + 42px + 48px) !important;
    }
    .dashboard-grid .noc-kpi-row {
        height: 112px !important;
        min-height: 112px !important;
    }
    .dashboard-grid .noc-kpi-row .kpi-card {
        height: 112px !important;
        min-height: 112px !important;
        grid-template-columns: 46px minmax(0, 1fr) !important;
        align-items: center !important;
        padding: 14px 12px !important;
        overflow: hidden !important;
    }
    .dashboard-grid .kpi-card .noc-icon {
        width: 38px !important;
        height: 38px !important;
        min-width: 38px !important;
        min-height: 38px !important;
    }
    .dashboard-grid .noc-kpi-copy {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 2px !important;
        min-width: 0 !important;
        line-height: 1.05 !important;
    }
    .dashboard-grid .noc-kpi-copy p,
    .dashboard-grid .noc-kpi-copy strong,
    .dashboard-grid .noc-kpi-copy small,
    .dashboard-grid .noc-kpi-copy em {
        position: static !important;
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        line-height: 1.08 !important;
        text-align: center !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }
    .dashboard-grid .noc-kpi-copy p {
        font-size: 10px !important;
    }
    .dashboard-grid .noc-kpi-copy strong {
        font-size: 27px !important;
    }
    .dashboard-grid .noc-kpi-copy small,
    .dashboard-grid .noc-kpi-copy em {
        font-size: 11px !important;
    }
    .dashboard-grid .kpi-sparkline {
        right: 8px !important;
        bottom: 6px !important;
        width: 54px !important;
        height: 16px !important;
        opacity: .55 !important;
        z-index: 0 !important;
        pointer-events: none !important;
    }
    .dashboard-grid .noc-bottom-row,
    .dashboard-grid .noc-bottom-row > .pon-card,
    .dashboard-grid .noc-bottom-row > .stats-card {
        height: 360px !important;
        min-height: 360px !important;
    }
    .dashboard-grid .noc-bottom-row > .stats-card {
        grid-template-rows: repeat(3, minmax(108px, 1fr)) !important;
    }
    .dashboard-grid .stats-card > .mini-stat {
        min-height: 108px !important;
        gap: 5px !important;
        padding: 14px 10px !important;
    }
    .dashboard-grid .stats-card > .mini-stat i {
        flex-basis: 30px !important;
        width: 30px !important;
        height: 30px !important;
        min-width: 30px !important;
        min-height: 30px !important;
    }
    .dashboard-grid .stats-card > .mini-stat strong {
        font-size: 18px !important;
    }
}
@media (min-width: 1200px) and (max-width: 1450px) {
    .dashboard-grid.noc-screen {
        grid-template-rows: 96px 360px 330px 42px !important;
        min-height: calc(96px + 360px + 330px + 42px + 36px) !important;
    }
    .dashboard-grid .noc-kpi-row,
    .dashboard-grid .noc-kpi-row .kpi-card {
        height: 96px !important;
        min-height: 96px !important;
    }
    .dashboard-grid .noc-kpi-copy strong {
        font-size: 23px !important;
    }
    .dashboard-grid .noc-kpi-copy small,
    .dashboard-grid .noc-kpi-copy em {
        font-size: 10px !important;
    }
    .dashboard-grid .noc-bottom-row,
    .dashboard-grid .noc-bottom-row > .pon-card,
    .dashboard-grid .noc-bottom-row > .stats-card {
        height: 330px !important;
        min-height: 330px !important;
    }
    .dashboard-grid .noc-bottom-row > .stats-card {
        grid-template-rows: repeat(3, minmax(100px, 1fr)) !important;
    }
    .dashboard-grid .stats-card > .mini-stat {
        min-height: 100px !important;
    }
}

/* Final dashboard layout reset: prevents old widget CSS from breaking the grid */
body.dashboard-page .main {
    min-width: 0;
}
body.dashboard-page .content {
    width: 100%;
}
body.dashboard-page .dashboard-control-strip {
    display: none !important;
}
@media (min-width: 1200px) {
    body.dashboard-page,
    body.dashboard-page .app-shell,
    body.dashboard-page .main {
        min-height: 100vh;
        overflow: hidden;
    }
    body.dashboard-page .content {
        height: calc(100vh - 72px) !important;
        padding: 16px !important;
        overflow: auto !important;
    }
    .dashboard-grid.noc-screen {
        display: grid !important;
        grid-template-columns: repeat(12, minmax(0, 1fr)) !important;
        grid-template-rows: 96px 430px 270px 42px !important;
        gap: 16px !important;
        width: 100% !important;
        height: auto !important;
        min-height: calc(96px + 430px + 270px + 42px + 48px) !important;
        align-items: stretch !important;
        overflow: visible !important;
    }
    .dashboard-grid .noc-kpi-row {
        grid-column: 1 / -1 !important;
        grid-row: 1 !important;
        display: grid !important;
        grid-template-columns: repeat(9, minmax(0, 1fr)) !important;
        gap: 16px !important;
        width: 100% !important;
        height: 96px !important;
        min-height: 96px !important;
        margin: 0 !important;
    }
    .dashboard-grid .noc-kpi-row .kpi-card {
        grid-column: auto !important;
        grid-row: auto !important;
        height: 96px !important;
        min-height: 96px !important;
        width: 100% !important;
    }
    .dashboard-grid .noc-main-row {
        grid-column: 1 / -1 !important;
        grid-row: 2 !important;
        display: grid !important;
        grid-template-columns: repeat(12, minmax(0, 1fr)) !important;
        gap: 16px !important;
        width: 100% !important;
        height: 430px !important;
        min-height: 430px !important;
    }
    .dashboard-grid .noc-main-row > .map-card {
        grid-column: span 9 !important;
        grid-row: 1 !important;
        height: 430px !important;
        min-height: 430px !important;
        width: 100% !important;
        display: flex !important;
        flex-direction: column !important;
    }
    .dashboard-grid .noc-main-row > .alarm-card {
        grid-column: span 3 !important;
        grid-row: 1 !important;
        height: 430px !important;
        min-height: 430px !important;
        width: 100% !important;
        display: flex !important;
        flex-direction: column !important;
    }
    .dashboard-grid .dashboard-map {
        flex: 1 1 auto !important;
        height: auto !important;
        min-height: 0 !important;
    }
    .dashboard-grid .noc-bottom-row {
        grid-column: 1 / -1 !important;
        grid-row: 3 !important;
        display: grid !important;
        grid-template-columns: repeat(12, minmax(0, 1fr)) !important;
        gap: 16px !important;
        width: 100% !important;
        height: 270px !important;
        min-height: 270px !important;
    }
    .dashboard-grid .noc-bottom-row > .pon-card {
        grid-column: span 6 !important;
        grid-row: 1 !important;
        height: 270px !important;
        min-height: 270px !important;
        width: 100% !important;
    }
    .dashboard-grid .noc-bottom-row > .stats-card {
        grid-column: span 6 !important;
        grid-row: 1 !important;
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        grid-template-rows: repeat(3, minmax(0, 1fr)) !important;
        gap: 16px !important;
        height: 270px !important;
        min-height: 270px !important;
        width: 100% !important;
        padding: 0 !important;
        border: 0 !important;
        background: transparent !important;
        box-shadow: none !important;
        overflow: visible !important;
    }
    .dashboard-grid .stats-card > .mini-stat {
        grid-column: auto !important;
        grid-row: auto !important;
        height: 100% !important;
        min-height: 0 !important;
        width: 100% !important;
        padding: 10px !important;
        overflow: hidden !important;
    }
    .dashboard-grid .stats-card > .mini-stat i {
        width: 30px !important;
        height: 30px !important;
    }
    .dashboard-grid .stats-card > .mini-stat strong {
        font-size: 18px !important;
        line-height: 1.1 !important;
    }
    .dashboard-grid .noc-status-strip {
        grid-column: 1 / -1 !important;
        grid-row: 4 !important;
        height: 42px !important;
        min-height: 42px !important;
        margin: 0 !important;
        width: 100% !important;
    }
    .dashboard-grid .alarms-card {
        gap: 8px !important;
    }
    .dashboard-grid .alarm-row {
        flex: 1 1 0 !important;
        min-height: 0 !important;
        max-height: none !important;
    }
}
@media (min-width: 1200px) and (max-width: 1450px) {
    body.dashboard-page .content {
        padding: 12px !important;
    }
    .dashboard-grid.noc-screen {
        grid-template-rows: 84px 360px 240px 42px !important;
        gap: 12px !important;
        min-height: calc(84px + 360px + 240px + 42px + 36px) !important;
    }
    .dashboard-grid .noc-kpi-row,
    .dashboard-grid .noc-kpi-row .kpi-card {
        height: 84px !important;
        min-height: 84px !important;
    }
    .dashboard-grid .noc-main-row,
    .dashboard-grid .noc-main-row > .map-card,
    .dashboard-grid .noc-main-row > .alarm-card {
        height: 360px !important;
        min-height: 360px !important;
    }
    .dashboard-grid .noc-bottom-row,
    .dashboard-grid .noc-bottom-row > .pon-card,
    .dashboard-grid .noc-bottom-row > .stats-card {
        height: 240px !important;
        min-height: 240px !important;
    }
    .dashboard-grid .noc-kpi-row,
    .dashboard-grid .noc-main-row,
    .dashboard-grid .noc-bottom-row,
    .dashboard-grid .noc-bottom-row > .stats-card {
        gap: 12px !important;
    }
}
@media (min-width: 1200px) and (max-width: 1799px) {
    body.dashboard-page .app-shell {
        grid-template-columns: 190px minmax(0, 1fr);
    }
    body.dashboard-page .sidebar,
    body.dashboard-page.sidebar-collapsed .sidebar {
        width: 190px !important;
        min-width: 190px !important;
        max-width: 190px !important;
        flex-basis: 190px !important;
        padding: 14px 8px 10px;
    }
    body.dashboard-page .brand {
        min-height: 36px;
        padding-bottom: 10px;
        font-size: 16px;
    }
    body.dashboard-page .sidebar nav {
        gap: 4px;
    }
    body.dashboard-page .sidebar nav a,
    body.dashboard-page.sidebar-collapsed .sidebar nav a {
        min-height: 31px;
        padding: 0 10px;
        gap: 10px;
        font-size: 11px;
    }
    body.dashboard-page .sidebar-status {
        padding: 10px;
    }
    body.dashboard-page .topbar {
        grid-template-columns: 40px 350px minmax(280px, 1fr) auto;
        gap: 10px;
        padding: 8px 14px;
    }
    body.dashboard-page .dashboard-global-search {
        width: min(390px, 100%);
    }
    body.dashboard-page .topbar-actions {
        gap: 6px;
    }
    body.dashboard-page .topbar-clock {
        font-size: 12px;
    }
    body.dashboard-page .content {
        padding: 10px 12px 0;
    }
    .noc-screen {
        gap: 10px;
    }
    .noc-screen .dashboard-control-strip {
        top: 84px;
        right: 12px;
    }
    .noc-screen .noc-kpi-row {
        gap: 8px;
        margin-top: 18px;
    }
    .noc-screen .kpi-card {
        height: 86px;
        min-height: 86px;
        padding: 12px 10px;
    }
    .noc-screen .noc-kpi-copy {
        left: 56px;
    }
    .noc-screen .noc-kpi-copy strong {
        font-size: 23px;
    }
    .noc-screen .kpi-sparkline {
        width: 62px;
    }
    .noc-screen .dashboard-live-map,
    .noc-screen .issue-card,
    .noc-screen .summary-card {
        height: 330px;
        min-height: 330px;
    }
    .noc-screen .dashboard-map {
        height: 272px;
        min-height: 272px;
    }
    .traffic-card,
    .alarms-card,
    .mini-stat-grid,
    .noc-bottom-row > .issue-card {
        height: 272px;
        min-height: 272px;
    }
    .noc-status-strip {
        height: 42px;
        min-height: 42px;
        margin-left: -12px;
        margin-right: -12px;
    }
}

/* Clean premium dashboard finish */
@media (min-width: 1200px) {
    body.dashboard-page {
        color: #eaf4ff;
        background:
            radial-gradient(circle at 18% 0%, rgba(0, 212, 255, .10), transparent 30%),
            radial-gradient(circle at 88% 8%, rgba(34, 197, 94, .08), transparent 26%),
            linear-gradient(180deg, #061121 0%, #030a15 100%);
    }
    body.dashboard-page .app-shell {
        grid-template-columns: 224px minmax(0, 1fr);
    }
    body.dashboard-page .sidebar,
    body.dashboard-page.sidebar-collapsed .sidebar {
        width: 224px !important;
        min-width: 224px !important;
        max-width: 224px !important;
        padding: 16px 10px 12px;
        background:
            linear-gradient(180deg, rgba(9, 21, 41, .98), rgba(4, 12, 24, .98)),
            radial-gradient(circle at 30% 0%, rgba(0, 212, 255, .12), transparent 35%);
    }
    body.dashboard-page .brand {
        height: 44px;
        padding: 0 10px 12px;
        margin-bottom: 2px;
        color: #f8fbff;
        border-bottom: 1px solid rgba(148, 163, 184, .10);
    }
    body.dashboard-page .sidebar nav a,
    body.dashboard-page.sidebar-collapsed .sidebar nav a {
        min-height: 34px;
        padding: 0 12px;
        color: rgba(226, 232, 240, .82);
        border: 1px solid transparent;
    }
    body.dashboard-page .sidebar nav a:hover {
        color: #fff;
        background: rgba(56, 189, 248, .08);
        border-color: rgba(56, 189, 248, .14);
    }
    body.dashboard-page .sidebar nav a.active {
        color: #fff;
        background: linear-gradient(135deg, rgba(37, 99, 235, .92), rgba(14, 165, 233, .62));
        border-color: rgba(125, 211, 252, .35);
        box-shadow: 0 10px 28px rgba(14, 165, 233, .18);
    }
    body.dashboard-page .sidebar-status {
        padding: 12px;
        background:
            linear-gradient(180deg, rgba(15, 34, 60, .92), rgba(7, 21, 40, .92)),
            radial-gradient(circle at 100% 100%, rgba(34, 197, 94, .18), transparent 38%);
        border: 1px solid rgba(56, 189, 248, .16);
    }
    body.dashboard-page .topbar {
        height: 72px;
        min-height: 72px;
        padding: 8px 18px;
        grid-template-columns: 40px 380px minmax(300px, 1fr) auto;
        background: rgba(4, 13, 28, .86);
        backdrop-filter: blur(18px);
    }
    body.dashboard-page .dashboard-title-block .eyebrow {
        font-size: 11px;
        letter-spacing: 2px;
    }
    body.dashboard-page .dashboard-title-line h1 {
        font-size: 24px;
        letter-spacing: 0;
    }
    body.dashboard-page .topbar-welcome {
        font-size: 12px;
        color: rgba(226, 232, 240, .68);
    }
    body.dashboard-page .dashboard-global-search {
        width: min(460px, 100%);
        height: 40px;
        border-color: rgba(56, 189, 248, .22);
        background: rgba(11, 25, 47, .88);
    }
    body.dashboard-page .content {
        height: calc(100vh - 72px);
        padding: 12px 14px 0;
    }
    .noc-screen {
        height: 100%;
        display: grid;
        grid-template-rows: 96px minmax(320px, 36vh) minmax(270px, 1fr) 46px;
        gap: 12px;
        min-height: 0;
    }
    .noc-screen .dashboard-control-strip {
        top: 84px;
        right: 14px;
    }
    .noc-screen .auto-refresh-indicator {
        height: 30px;
        padding: 0 12px;
        background: rgba(8, 24, 44, .92);
        border-color: rgba(34, 197, 94, .22);
    }
    .noc-card {
        background:
            linear-gradient(180deg, rgba(15, 31, 55, .92), rgba(8, 21, 39, .94));
        border: 1px solid rgba(56, 189, 248, .16);
        box-shadow:
            inset 0 1px 0 rgba(255, 255, 255, .035),
            0 18px 42px rgba(0, 0, 0, .18);
    }
    .noc-screen .noc-kpi-row {
        height: 96px;
        margin: 0;
        gap: 10px;
    }
    .noc-screen .kpi-card {
        height: 96px;
        min-height: 96px;
        padding: 13px 12px;
        overflow: hidden;
    }
    .noc-screen .kpi-card::after {
        content: "";
        position: absolute;
        inset: auto -20px -35px 42%;
        height: 70px;
        border-radius: 50%;
        background: currentColor;
        opacity: .08;
        filter: blur(18px);
    }
    .noc-screen .kpi-card .noc-icon {
        width: 38px;
        height: 38px;
        border-radius: 8px;
        background: rgba(2, 8, 23, .42);
        border-color: rgba(226, 232, 240, .55);
    }
    .noc-screen .noc-kpi-copy {
        left: 62px;
        top: 13px;
    }
    .noc-screen .noc-kpi-copy p {
        margin-bottom: 3px;
        color: #b8dcff;
        font-size: 10px;
        font-weight: 900;
        text-transform: uppercase;
    }
    .noc-screen .noc-kpi-copy strong {
        color: #fff;
        font-size: 27px;
        text-shadow: 0 0 18px rgba(125, 211, 252, .12);
    }
    .noc-screen .noc-kpi-copy small {
        color: rgba(226, 232, 240, .78);
    }
    .noc-screen .noc-kpi-copy em {
        margin-top: 5px;
        font-style: normal;
        font-weight: 900;
    }
    .noc-screen .kpi-sparkline {
        right: 10px;
        bottom: 8px;
        width: 72px;
        height: 24px;
        opacity: .95;
    }
    .noc-screen .noc-main-row,
    .noc-screen .noc-bottom-row {
        min-height: 0;
    }
    .noc-screen .noc-main-row {
        grid-template-columns: minmax(520px, 1.62fr) minmax(330px, .78fr) minmax(330px, .78fr);
        gap: 12px;
    }
    .noc-screen .dashboard-live-map,
    .noc-screen .issue-card,
    .noc-screen .summary-card,
    .traffic-card,
    .alarms-card,
    .mini-stat-grid,
    .noc-bottom-row > .issue-card {
        height: 100%;
        min-height: 0;
    }
    .noc-screen .dashboard-map {
        height: calc(100% - 44px);
        min-height: 0;
        border-radius: 9px;
        filter: saturate(.82) contrast(1.02);
    }
    .noc-screen .dashboard-map::after {
        pointer-events: none;
        background: linear-gradient(180deg, rgba(6, 17, 33, .12), rgba(6, 17, 33, .30));
    }
    .dashboard-map .map-search-control {
        top: 12px;
        left: 12px;
        height: 36px;
        width: min(360px, calc(100% - 170px));
        background: rgba(5, 16, 32, .90);
        border: 1px solid rgba(56, 189, 248, .20);
    }
    .dashboard-map .map-search-control button {
        background: linear-gradient(135deg, #0ea5e9, #0284c7);
    }
    .dashboard-map .map-floating-actions button {
        border-color: rgba(125, 211, 252, .20);
        background: rgba(5, 16, 32, .88);
    }
    .noc-screen .map-legend-bar {
        max-width: calc(100% - 28px);
        flex-wrap: wrap;
        background: rgba(4, 13, 28, .86);
        border-color: rgba(56, 189, 248, .16);
    }
    .noc-screen .panel-title-row {
        min-height: 38px;
        padding-bottom: 10px;
        border-bottom: 1px solid rgba(148, 163, 184, .10);
    }
    .noc-screen .panel-title-row h2 {
        font-size: 15px;
        letter-spacing: .1px;
    }
    .noc-screen .noc-btn {
        border-radius: 7px;
        background: rgba(14, 165, 233, .10);
    }
    .noc-screen .noc-table {
        margin-bottom: 0;
    }
    .noc-screen .noc-table thead th {
        color: #b8dcff;
        border-bottom-color: rgba(148, 163, 184, .16);
    }
    .noc-screen .noc-table tbody td {
        color: rgba(226, 232, 240, .86);
        border-bottom-color: rgba(148, 163, 184, .08);
    }
    .rx-bars {
        height: 76px;
        padding: 0 8px 8px;
    }
    .rx-bars span {
        background: linear-gradient(180deg, #a78bfa, #6d28d9);
        box-shadow: 0 0 22px rgba(139, 92, 246, .26);
    }
    .summary-body {
        height: calc(100% - 48px);
        grid-template-columns: minmax(150px, .9fr) minmax(170px, 1fr);
        gap: 16px;
        align-items: center;
    }
    .summary-donut {
        width: min(175px, 14vw);
        height: min(175px, 14vw);
        min-width: 142px;
        min-height: 142px;
        filter: drop-shadow(0 0 24px rgba(34, 197, 94, .14));
    }
    .summary-list li {
        min-height: 31px;
        border-bottom-color: rgba(148, 163, 184, .10);
    }
    .noc-screen .noc-bottom-row {
        grid-template-columns: minmax(340px, 1.08fr) minmax(360px, .96fr) minmax(310px, .82fr) minmax(330px, .95fr);
        gap: 12px;
    }
    .traffic-values {
        padding: 6px 16px 5px;
    }
    .traffic-chart {
        height: calc(100% - 78px);
        min-height: 150px;
        padding-left: 56px;
    }
    .traffic-chart svg {
        height: calc(100% - 22px);
    }
    .traffic-line.download {
        stroke: #0ea5e9;
    }
    .traffic-line.upload {
        stroke: #22c55e;
    }
    .mini-stat-grid {
        gap: 10px;
    }
    .mini-stat {
        min-height: 0;
        padding: 12px 8px;
        background:
            radial-gradient(circle at 50% 10%, rgba(56, 189, 248, .10), transparent 44%),
            rgba(10, 25, 47, .84);
    }
    .mini-stat span {
        color: #b8dcff;
        font-size: 10px;
    }
    .mini-stat strong {
        font-size: clamp(16px, 1.15vw, 22px);
    }
    .mini-stat-wide strong {
        font-size: clamp(14px, .95vw, 18px);
    }
    .alarms-card {
        overflow: hidden;
    }
    .alarm-row {
        grid-template-columns: 34px 1fr auto;
        border-left-width: 3px;
        background: rgba(15, 31, 55, .52);
    }
    .noc-status-strip {
        height: 46px;
        min-height: 46px;
        margin: 0 -14px;
        background: rgba(3, 10, 21, .94);
        border-top-color: rgba(56, 189, 248, .12);
    }
}
@media (min-width: 1200px) and (max-width: 1600px) {
    body.dashboard-page .app-shell {
        grid-template-columns: 206px minmax(0, 1fr);
    }
    body.dashboard-page .sidebar,
    body.dashboard-page.sidebar-collapsed .sidebar {
        width: 206px !important;
        min-width: 206px !important;
        max-width: 206px !important;
    }
    body.dashboard-page .topbar {
        grid-template-columns: 40px 320px minmax(220px, 1fr) auto;
    }
    body.dashboard-page .topbar-clock {
        display: none;
    }
    .noc-screen .noc-kpi-copy strong {
        font-size: 23px;
    }
    .noc-screen .kpi-sparkline {
        width: 56px;
    }
    .summary-list li strong {
        max-width: 74px;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}
@media (max-width: 1199px) {
    body.dashboard-page .content {
        overflow: visible;
    }
    .noc-screen {
        display: block;
    }
    .noc-screen .noc-kpi-row,
    .noc-screen .noc-main-row,
    .noc-screen .noc-bottom-row {
        grid-template-columns: 1fr;
        margin-bottom: 12px;
    }
    .noc-screen .dashboard-live-map,
    .noc-screen .issue-card,
    .noc-screen .summary-card,
    .traffic-card,
    .alarms-card,
    .mini-stat-grid,
    .noc-bottom-row > .issue-card {
        height: auto;
        min-height: 280px;
    }
}

/* Row-level exact alignment overrides */
@media (min-width: 1200px) {
    .dashboard-grid .noc-kpi-row {
        grid-column: 1 / -1;
        grid-row: 1;
        display: grid;
        grid-template-columns: repeat(9, minmax(0, 1fr));
        gap: var(--noc-gap);
        width: 100%;
        height: 100%;
        margin: 0;
    }
    .dashboard-grid .noc-kpi-row .kpi-card {
        grid-column: auto !important;
        grid-row: auto !important;
        width: 100%;
    }
    .dashboard-grid .noc-main-row {
        grid-column: 1 / -1;
        grid-row: 2;
        display: grid;
        grid-template-columns: 2fr 1fr 1fr;
        gap: var(--noc-gap);
        width: 100%;
        height: 100%;
        min-height: 0;
    }
    .dashboard-grid .dashboard-live-map,
    .dashboard-grid .noc-main-row > .issue-card,
    .dashboard-grid .summary-card {
        grid-column: auto;
        grid-row: auto;
    }
    .dashboard-grid .noc-bottom-row {
        grid-column: 1 / -1;
        grid-row: 3;
        display: grid;
        grid-template-columns: 3fr 3fr 2fr 2fr;
        gap: var(--noc-gap);
        width: 100%;
        height: 100%;
        min-height: 0;
    }
    .dashboard-grid .noc-bottom-row > .issue-card,
    .dashboard-grid .traffic-card,
    .dashboard-grid .mini-stat-grid,
    .dashboard-grid .alarms-card {
        grid-column: auto;
        grid-row: auto;
    }
}

/* Dashboard layout positioning fix: 12-column grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 16px;
    width: 100%;
}
@media (min-width: 1200px) {
    :root {
        --noc-gap: 16px;
        --noc-radius: 12px;
        --noc-row-2: 340px;
        --noc-row-3: minmax(230px, 1fr);
        --noc-footer: 42px;
    }
    body.dashboard-page .content {
        padding: 16px;
        height: calc(100vh - 72px);
        overflow: hidden;
    }
    .dashboard-grid.noc-screen {
        display: grid;
        grid-template-columns: repeat(12, minmax(0, 1fr));
        grid-template-rows: 96px var(--noc-row-2) var(--noc-row-3) var(--noc-footer);
        gap: var(--noc-gap);
        width: 100%;
        height: 100%;
        min-height: 0;
    }
    .dashboard-grid .dashboard-control-strip {
        position: absolute;
        top: 86px;
        right: 16px;
        margin: 0;
    }
    .dashboard-grid .noc-kpi-row,
    .dashboard-grid .noc-main-row,
    .dashboard-grid .noc-bottom-row {
        display: contents;
    }
    .dashboard-grid .noc-kpi-row .kpi-card {
        min-width: 0;
        height: 96px;
        min-height: 96px;
        border-radius: var(--noc-radius);
    }
    .dashboard-grid .noc-kpi-row .kpi-card:nth-child(1) { grid-column: 1 / span 1; grid-row: 1; }
    .dashboard-grid .noc-kpi-row .kpi-card:nth-child(2) { grid-column: 2 / span 1; grid-row: 1; }
    .dashboard-grid .noc-kpi-row .kpi-card:nth-child(3) { grid-column: 3 / span 2; grid-row: 1; }
    .dashboard-grid .noc-kpi-row .kpi-card:nth-child(4) { grid-column: 5 / span 1; grid-row: 1; }
    .dashboard-grid .noc-kpi-row .kpi-card:nth-child(5) { grid-column: 6 / span 2; grid-row: 1; }
    .dashboard-grid .noc-kpi-row .kpi-card:nth-child(6) { grid-column: 8 / span 1; grid-row: 1; }
    .dashboard-grid .noc-kpi-row .kpi-card:nth-child(7) { grid-column: 9 / span 1; grid-row: 1; }
    .dashboard-grid .noc-kpi-row .kpi-card:nth-child(8) { grid-column: 10 / span 2; grid-row: 1; }
    .dashboard-grid .noc-kpi-row .kpi-card:nth-child(9) { grid-column: 12 / span 1; grid-row: 1; }
    .dashboard-grid .dashboard-live-map {
        grid-column: 1 / span 6;
        grid-row: 2;
    }
    .dashboard-grid .noc-main-row > .issue-card {
        grid-column: 7 / span 3;
        grid-row: 2;
    }
    .dashboard-grid .summary-card {
        grid-column: 10 / span 3;
        grid-row: 2;
    }
    .dashboard-grid .noc-bottom-row > .issue-card {
        grid-column: 1 / span 4;
        grid-row: 3;
    }
    .dashboard-grid .traffic-card {
        grid-column: 5 / span 4;
        grid-row: 3;
    }
    .dashboard-grid .mini-stat-grid {
        grid-column: 9 / span 2;
        grid-row: 3;
    }
    .dashboard-grid .alarms-card {
        grid-column: 11 / span 2;
        grid-row: 3;
    }
    .dashboard-grid .noc-status-strip {
        grid-column: 1 / -1;
        grid-row: 4;
    }
    .dashboard-grid .noc-card,
    .dashboard-grid .dashboard-live-map,
    .dashboard-grid .issue-card,
    .dashboard-grid .summary-card,
    .dashboard-grid .traffic-card,
    .dashboard-grid .alarms-card {
        width: 100%;
        height: 100%;
        min-height: 0;
        border-radius: var(--noc-radius);
        overflow: hidden;
    }
    .dashboard-grid .dashboard-map {
        height: calc(100% - 43px);
        min-height: 0;
    }
    .dashboard-grid .summary-body {
        height: calc(100% - 45px);
    }
    .dashboard-grid .traffic-card {
        display: flex;
        flex-direction: column;
    }
    .dashboard-grid .traffic-chart {
        flex: 1;
        min-height: 0;
        height: auto;
    }
    .dashboard-grid .mini-stat-grid {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-template-rows: repeat(3, minmax(0, 1fr));
        gap: 16px;
        padding: 0;
        background: transparent;
        border: 0;
        box-shadow: none;
    }
    .dashboard-grid .mini-stat,
    .dashboard-grid .mini-stat-wide {
        grid-column: auto;
        min-width: 0;
        min-height: 0;
        height: 100%;
        border-radius: var(--noc-radius);
    }
    .dashboard-grid .alarms-card {
        display: flex;
        flex-direction: column;
    }
    .dashboard-grid .alarm-row {
        flex: 1 1 0;
        min-height: 0;
    }
    .dashboard-grid .noc-status-strip {
        height: var(--noc-footer);
        min-height: var(--noc-footer);
        margin: 0;
        border-radius: var(--noc-radius) var(--noc-radius) 0 0;
        display: grid;
        grid-template-columns: 1.1fr repeat(6, minmax(0, 1fr));
        gap: 16px;
        align-items: center;
    }
}
@media (min-width: 1200px) and (max-height: 820px) {
    :root {
        --noc-gap: 12px;
        --noc-row-2: 300px;
        --noc-footer: 42px;
    }
    body.dashboard-page .content {
        padding: 12px;
    }
    .dashboard-grid.noc-screen {
        grid-template-rows: 84px var(--noc-row-2) minmax(220px, 1fr) var(--noc-footer);
        gap: var(--noc-gap);
    }
    .dashboard-grid .noc-kpi-row .kpi-card {
        height: 84px;
        min-height: 84px;
        padding: 10px;
    }
    .dashboard-grid .noc-kpi-copy strong {
        font-size: 22px;
    }
    .dashboard-grid .noc-kpi-copy em,
    .dashboard-grid .kpi-sparkline {
        display: none;
    }
    .dashboard-grid .dashboard-map {
        height: calc(100% - 40px);
    }
    .dashboard-grid .mini-stat-grid {
        gap: var(--noc-gap);
    }
    .dashboard-grid .mini-stat {
        padding: 8px 6px;
        gap: 3px;
    }
    .dashboard-grid .mini-stat i {
        width: 26px;
        height: 26px;
    }
}
@media (min-width: 1200px) and (max-width: 1450px) {
    body.dashboard-page .app-shell {
        grid-template-columns: 76px minmax(0, 1fr);
    }
    body.dashboard-page .sidebar,
    body.dashboard-page.sidebar-collapsed .sidebar {
        width: 76px !important;
        min-width: 76px !important;
        max-width: 76px !important;
        padding: 12px 8px;
    }
    body.dashboard-page .brand span,
    body.dashboard-page .sidebar nav a span,
    body.dashboard-page .sidebar-status {
        display: none !important;
    }
    body.dashboard-page .sidebar nav a,
    body.dashboard-page.sidebar-collapsed .sidebar nav a {
        justify-content: center;
        padding: 0;
    }
    body.dashboard-page .topbar {
        grid-template-columns: 40px 270px minmax(200px, 1fr) auto;
    }
    body.dashboard-page .user-pill {
        max-width: 138px;
        overflow: hidden;
    }
    .dashboard-grid .summary-list li {
        grid-template-columns: 12px 1fr;
    }
    .dashboard-grid .summary-list li strong {
        display: none;
    }
}
@media (max-width: 1199px) {
    .dashboard-grid {
        display: grid;
        grid-template-columns: 1fr;
        gap: 16px;
    }
    .dashboard-grid .noc-kpi-row,
    .dashboard-grid .noc-main-row,
    .dashboard-grid .noc-bottom-row {
        display: grid;
        grid-template-columns: 1fr;
        gap: 16px;
    }
}

/* LAST RULE: dashboard Network Statistics cards must never overlap */
@media (min-width: 1200px) {
    .dashboard-grid.noc-screen {
        grid-template-rows: 112px 430px 360px 42px !important;
        min-height: calc(112px + 430px + 360px + 42px + 48px) !important;
    }
    .dashboard-grid .noc-kpi-row,
    .dashboard-grid .noc-kpi-row .kpi-card {
        height: 112px !important;
        min-height: 112px !important;
    }
    .dashboard-grid .noc-kpi-row .kpi-card {
        grid-template-columns: 46px minmax(0, 1fr) !important;
        align-items: center !important;
        padding: 14px 12px !important;
    }
    .dashboard-grid .kpi-card .noc-icon {
        width: 38px !important;
        height: 38px !important;
        min-width: 38px !important;
        min-height: 38px !important;
    }
    .dashboard-grid .noc-kpi-copy {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 2px !important;
        min-width: 0 !important;
        line-height: 1.05 !important;
    }
    .dashboard-grid .noc-kpi-copy p,
    .dashboard-grid .noc-kpi-copy strong,
    .dashboard-grid .noc-kpi-copy small,
    .dashboard-grid .noc-kpi-copy em {
        position: static !important;
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        line-height: 1.08 !important;
        text-align: center !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }
    .dashboard-grid .noc-kpi-copy strong {
        font-size: 27px !important;
    }
    .dashboard-grid .noc-kpi-copy small,
    .dashboard-grid .noc-kpi-copy em {
        font-size: 11px !important;
    }
    .dashboard-grid .kpi-sparkline {
        right: 8px !important;
        bottom: 6px !important;
        width: 54px !important;
        height: 16px !important;
        opacity: .45 !important;
    }
    .dashboard-grid .noc-bottom-row,
    .dashboard-grid .noc-bottom-row > .pon-card,
    .dashboard-grid .noc-bottom-row > .stats-card {
        height: 360px !important;
        min-height: 360px !important;
    }
    .dashboard-grid .noc-bottom-row > .stats-card {
        grid-template-rows: repeat(3, minmax(108px, 1fr)) !important;
    }
    .dashboard-grid .stats-card > .mini-stat {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 6px !important;
        padding: 12px 10px !important;
        text-align: center !important;
        overflow: hidden !important;
        line-height: 1.1 !important;
    }
    .dashboard-grid .stats-card > .mini-stat i {
        position: static !important;
        display: grid !important;
        place-items: center !important;
        flex: 0 0 28px !important;
        width: 28px !important;
        height: 28px !important;
        min-width: 28px !important;
        min-height: 28px !important;
        margin: 0 !important;
        transform: none !important;
        font-size: 14px !important;
        line-height: 1 !important;
    }
    .dashboard-grid .stats-card > .mini-stat span,
    .dashboard-grid .stats-card > .mini-stat strong,
    .dashboard-grid .stats-card > .mini-stat small {
        position: static !important;
        display: block !important;
        flex: 0 0 auto !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        line-height: 1.15 !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
        transform: none !important;
    }
    .dashboard-grid .stats-card > .mini-stat span {
        font-size: 11px !important;
        font-weight: 800 !important;
    }
    .dashboard-grid .stats-card > .mini-stat strong {
        font-size: 18px !important;
        font-weight: 900 !important;
    }
    .dashboard-grid .stats-card > .mini-stat small {
        font-size: 10px !important;
        opacity: .78 !important;
    }
}
@media (min-width: 1200px) and (max-width: 1450px) {
    .dashboard-grid.noc-screen {
        grid-template-rows: 96px 360px 330px 42px !important;
        min-height: calc(96px + 360px + 330px + 42px + 36px) !important;
    }
    .dashboard-grid .noc-kpi-row,
    .dashboard-grid .noc-kpi-row .kpi-card {
        height: 96px !important;
        min-height: 96px !important;
    }
    .dashboard-grid .noc-kpi-copy strong {
        font-size: 23px !important;
    }
    .dashboard-grid .noc-kpi-copy small,
    .dashboard-grid .noc-kpi-copy em {
        font-size: 10px !important;
    }
    .dashboard-grid .noc-bottom-row,
    .dashboard-grid .noc-bottom-row > .pon-card,
    .dashboard-grid .noc-bottom-row > .stats-card {
        height: 330px !important;
        min-height: 330px !important;
    }
    .dashboard-grid .noc-bottom-row > .stats-card {
        grid-template-rows: repeat(3, minmax(100px, 1fr)) !important;
    }
}

/* LAST RULE 3: fit dashboard inside fullscreen viewport */
@media (min-width: 1200px) {
    body.dashboard-page .content {
        height: calc(100vh - 72px) !important;
        padding: 14px !important;
        overflow: hidden !important;
    }
    .dashboard-grid.noc-screen {
        grid-template-rows: 100px minmax(340px, 1.25fr) minmax(260px, .8fr) 42px !important;
        gap: 14px !important;
        height: 100% !important;
        min-height: 0 !important;
    }
    .dashboard-grid .noc-kpi-row,
    .dashboard-grid .noc-kpi-row .kpi-card {
        height: 100px !important;
        min-height: 0 !important;
    }
    .dashboard-grid .noc-main-row,
    .dashboard-grid .noc-main-row > .map-card,
    .dashboard-grid .noc-main-row > .alarm-card {
        height: 100% !important;
        min-height: 0 !important;
    }
    .dashboard-grid .noc-bottom-row,
    .dashboard-grid .noc-bottom-row > .pon-card,
    .dashboard-grid .noc-bottom-row > .stats-card {
        height: 100% !important;
        min-height: 0 !important;
    }
    .dashboard-grid .noc-bottom-row > .stats-card {
        grid-template-rows: repeat(3, minmax(0, 1fr)) !important;
        gap: 14px !important;
    }
    .dashboard-grid .stats-card > .mini-stat {
        min-height: 0 !important;
        padding: 10px 8px !important;
    }
}
@media (min-width: 1200px) and (max-height: 850px) {
    body.dashboard-page .topbar {
        height: 66px !important;
        min-height: 66px !important;
        padding-top: 6px !important;
        padding-bottom: 6px !important;
    }
    body.dashboard-page .content {
        height: calc(100vh - 66px) !important;
        padding: 10px !important;
    }
    .dashboard-grid.noc-screen {
        grid-template-rows: 78px minmax(250px, 1.22fr) minmax(205px, .78fr) 38px !important;
        gap: 10px !important;
    }
    .dashboard-grid .noc-kpi-row {
        gap: 8px !important;
    }
    .dashboard-grid .noc-kpi-row .kpi-card {
        height: 78px !important;
        padding: 8px !important;
        grid-template-columns: 34px minmax(0, 1fr) !important;
    }
    .dashboard-grid .kpi-card .noc-icon {
        width: 30px !important;
        height: 30px !important;
        min-width: 30px !important;
        min-height: 30px !important;
    }
    .dashboard-grid .noc-kpi-copy p {
        font-size: 9px !important;
    }
    .dashboard-grid .noc-kpi-copy strong {
        font-size: 20px !important;
    }
    .dashboard-grid .noc-kpi-copy small,
    .dashboard-grid .noc-kpi-copy em,
    .dashboard-grid .kpi-sparkline {
        display: none !important;
    }
    .dashboard-grid .noc-main-row,
    .dashboard-grid .noc-bottom-row,
    .dashboard-grid .noc-bottom-row > .stats-card {
        gap: 10px !important;
    }
    .dashboard-grid .panel-title-row {
        flex-basis: 30px !important;
        min-height: 30px !important;
        padding-bottom: 7px !important;
    }
    .dashboard-grid .panel-title-row h2 {
        font-size: 13px !important;
    }
    .dashboard-grid .stats-card > .mini-stat {
        gap: 3px !important;
        padding: 7px 6px !important;
    }
    .dashboard-grid .stats-card > .mini-stat i {
        flex-basis: 24px !important;
        width: 24px !important;
        height: 24px !important;
        min-width: 24px !important;
        min-height: 24px !important;
    }
    .dashboard-grid .stats-card > .mini-stat span,
    .dashboard-grid .stats-card > .mini-stat small {
        font-size: 9px !important;
    }
    .dashboard-grid .stats-card > .mini-stat strong {
        font-size: 15px !important;
    }
    .dashboard-grid .noc-status-strip {
        height: 38px !important;
        min-height: 38px !important;
        font-size: 11px !important;
    }
}

/* LAST RULE 4: compact statistics cards without clipped text */
@media (min-width: 1200px) {
    .dashboard-grid .stats-card > .mini-stat {
        justify-content: center !important;
        gap: 5px !important;
        padding: 10px 8px !important;
        overflow: hidden !important;
    }
    .dashboard-grid .stats-card > .mini-stat i {
        flex: 0 0 24px !important;
        width: 24px !important;
        height: 24px !important;
        min-width: 24px !important;
        min-height: 24px !important;
        font-size: 13px !important;
    }
    .dashboard-grid .stats-card > .mini-stat span {
        font-size: 11px !important;
        line-height: 1.1 !important;
    }
    .dashboard-grid .stats-card > .mini-stat strong {
        font-size: 18px !important;
        line-height: 1.1 !important;
    }
    .dashboard-grid .stats-card > .mini-stat small {
        display: none !important;
    }
}
@media (min-width: 1200px) and (max-height: 850px) {
    .dashboard-grid .stats-card > .mini-stat {
        gap: 4px !important;
        padding: 8px 6px !important;
    }
    .dashboard-grid .stats-card > .mini-stat i {
        flex-basis: 22px !important;
        width: 22px !important;
        height: 22px !important;
        min-width: 22px !important;
        min-height: 22px !important;
    }
    .dashboard-grid .stats-card > .mini-stat strong {
        font-size: 16px !important;
    }
}

/* Live Fiber Map header search */
.dashboard-map-header-search {
    position: relative;
    display: grid;
    grid-template-columns: 36px minmax(180px, 1fr) auto;
    align-items: center;
    width: min(420px, 44vw);
    height: 34px;
    margin-left: 14px;
    color: #dbeafe;
    background: rgba(5, 16, 32, .88);
    border: 1px solid rgba(56, 189, 248, .18);
    border-radius: 8px;
    overflow: visible;
}
.dashboard-map-header-search span {
    display: grid;
    place-items: center;
    color: #93c5fd;
    border-right: 1px solid rgba(56, 189, 248, .12);
}
.dashboard-map-header-search input {
    min-width: 0;
    height: 100%;
    padding: 0 10px;
    color: #e5f3ff;
    background: transparent;
    border: 0;
    outline: 0;
    font-size: 12px;
}
.dashboard-map-header-search button {
    height: 100%;
    padding: 0 13px;
    color: #fff;
    background: #0891b2;
    border: 0;
    border-radius: 0 7px 7px 0;
    font-weight: 700;
}
.dashboard-map-header-search .map-search-results {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    z-index: 1000;
}
.dashboard-live-map .map-tools.dashboard-map-tools {
    display: none !important;
}
@media (max-width: 1450px) {
    .dashboard-map-header-search {
        width: min(340px, 38vw);
        height: 30px;
        grid-template-columns: 30px minmax(120px, 1fr) auto;
    }
    .dashboard-map-header-search button {
        padding: 0 10px;
    }
}
@media (max-width: 900px) {
    .dashboard-map-header-search {
        order: 3;
        width: 100%;
        margin: 8px 0 0;
    }
}

/* Network Map header search */
.network-map-header-search {
    position: relative;
    display: grid;
    grid-template-columns: 38px minmax(180px, 1fr) auto;
    align-items: center;
    width: min(430px, 42vw);
    height: 40px;
    color: #dbeafe;
    background: rgba(5, 16, 32, .88);
    border: 1px solid rgba(56, 189, 248, .18);
    border-radius: 8px;
    overflow: visible;
}
.network-map-header-search span {
    display: grid;
    place-items: center;
    color: #93c5fd;
    border-right: 1px solid rgba(56, 189, 248, .12);
}
.network-map-header-search input {
    min-width: 0;
    height: 100%;
    padding: 0 10px;
    color: #e5f3ff;
    background: transparent;
    border: 0;
    outline: 0;
}
.network-map-header-search button {
    height: 100%;
    padding: 0 14px;
    color: #fff;
    background: #0891b2;
    border: 0;
    border-radius: 0 7px 7px 0;
    font-weight: 700;
}
.network-map-header-search .map-search-results {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    z-index: 1000;
}
@media (max-width: 900px) {
    .network-map-header-search {
        order: 3;
        width: 100%;
    }
}

/* Final sidebar toggle behavior */
#sidebarToggle {
    display: inline-grid !important;
    place-items: center;
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
}

body.sidebar-collapsed .sidebar,
body.dashboard-page.sidebar-collapsed .sidebar {
    width: 68px !important;
    flex: 0 0 68px !important;
    padding-left: 8px !important;
    padding-right: 8px !important;
    overflow-x: hidden;
}

body.sidebar-collapsed .brand span,
body.sidebar-collapsed .sidebar nav a span,
body.sidebar-collapsed .sidebar-status,
body.dashboard-page.sidebar-collapsed .brand span,
body.dashboard-page.sidebar-collapsed .sidebar nav a span,
body.dashboard-page.sidebar-collapsed .sidebar-status {
    display: none !important;
}

body.sidebar-collapsed .brand,
body.sidebar-collapsed .sidebar nav a,
body.dashboard-page.sidebar-collapsed .brand,
body.dashboard-page.sidebar-collapsed .sidebar nav a {
    justify-content: center !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
}

body.sidebar-collapsed .sidebar nav a i,
body.dashboard-page.sidebar-collapsed .sidebar nav a i {
    margin: 0 !important;
}

.noc-status-strip b.status-online {
    color: #22c55e !important;
}

.noc-status-strip b.status-warning {
    color: #facc15 !important;
}

.noc-status-strip b.status-offline {
    color: #fb7185 !important;
}

/* Backup / Restore */
.backup-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.backup-action-card {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    min-height: 180px;
}

.backup-card-icon {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    flex: 0 0 48px;
    border: 1px solid rgba(56, 189, 248, .2);
    border-radius: 8px;
    background: rgba(56, 189, 248, .08);
    font-size: 22px;
}

.backup-row-actions {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.backup-row-actions .btn {
    display: inline-grid;
    place-items: center;
    width: 34px;
    height: 34px;
    padding: 0;
}

/* Role permissions */
.role-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.role-selector {
    width: min(280px, 100%);
}

.role-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 16px;
    align-items: start;
}

.role-permission-table th:not(:first-child),
.role-permission-table td:not(:first-child) {
    width: 76px;
}

.role-permission-table .permission-check {
    width: 19px;
    height: 19px;
    cursor: pointer;
}

.role-create-panel {
    position: sticky;
    top: 88px;
}

/* Excel import / export */
.excel-page-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(280px, .7fr);
    gap: 16px;
}

.excel-file-icon {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    flex: 0 0 48px;
    color: #34d399;
    background: rgba(16, 185, 129, .1);
    border: 1px solid rgba(52, 211, 153, .25);
    border-radius: 8px;
    font-size: 23px;
}

.excel-download-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}

.excel-column-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.excel-column-list span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 9px;
    border: 1px solid rgba(56, 189, 248, .15);
    border-radius: 6px;
    background: rgba(6, 20, 38, .55);
}

.excel-column-list b { color: #fb7185; }
.excel-error-list { max-height: 300px; overflow: auto; }

@media (max-width: 1000px) {
    .excel-page-grid { grid-template-columns: 1fr; }
}

@media (max-width: 1100px) {
    .role-layout { grid-template-columns: 1fr; }
    .role-create-panel { position: static; }
}

@media (max-width: 700px) {
    .role-toolbar { align-items: stretch; flex-direction: column; }
    .role-selector { width: 100%; }
}

@media (max-width: 900px) {
    .backup-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 991px) {
    .sidebar,
    body.dashboard-page .sidebar,
    body.sidebar-collapsed .sidebar,
    body.dashboard-page.sidebar-collapsed .sidebar {
        position: fixed !important;
        z-index: 1050;
        inset: 0 auto 0 0;
        width: 240px !important;
        flex-basis: 240px !important;
        transform: translateX(-104%);
        transition: transform .22s ease;
    }

    .sidebar.open,
    body.dashboard-page .sidebar.open {
        transform: translateX(0);
    }

    body.sidebar-collapsed .brand span,
    body.sidebar-collapsed .sidebar nav a span,
    body.dashboard-page.sidebar-collapsed .brand span,
    body.dashboard-page.sidebar-collapsed .sidebar nav a span {
        display: inline !important;
    }

    body.sidebar-collapsed .sidebar-status,
    body.dashboard-page.sidebar-collapsed .sidebar-status {
        display: block !important;
    }
}

/* PON Management filters */
.pon-filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}
.pon-filter-bar .form-select {
    width: 170px;
    min-height: 40px;
    color: #eef7ff;
    background-color: rgba(15, 31, 55, .92);
    border-color: rgba(56, 189, 248, .18);
    border-radius: 6px;
}
.pon-filter-bar .form-select:focus {
    border-color: rgba(0, 212, 255, .75);
    box-shadow: 0 0 0 .2rem rgba(0, 212, 255, .12);
}
@media (max-width: 640px) {
.pon-filter-bar .form-select,
    .pon-filter-bar .btn {
        width: 100%;
    }
}

/* Header search removed */
body.dashboard-page .topbar {
    grid-template-columns: 40px minmax(260px, 1fr) auto !important;
}
body.dashboard-page .topbar-actions {
    justify-self: end;
}


/* Auto Service Settings tabs */
.auto-service-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px;
}
.auto-service-tab-button {
    min-height: 40px;
}
.auto-service-tab-button.active {
    box-shadow: 0 0 0 1px rgba(0, 212, 255, .25), 0 0 16px rgba(0, 212, 255, .12);
}
.auto-service-tab-panel[hidden] {
    display: none !important;
}
@media (max-width: 575.98px) {
    .auto-service-tabs {
        align-items: stretch;
    }
    .auto-service-tab-button {
        flex: 1 1 100%;
        width: 100%;
    }
    .auto-service-tab-panel code {
        white-space: normal;
        overflow-wrap: anywhere;
    }
}

/* Global sidebar viewport and scrolling */
.sidebar,
body.dashboard-page .sidebar,
body.sidebar-collapsed .sidebar,
body.dashboard-page.sidebar-collapsed .sidebar {
    position: sticky !important;
    top: 0;
    height: 100vh !important;
    max-height: 100vh !important;
    overflow: hidden !important;
}

.sidebar .brand,
.sidebar .sidebar-status {
    flex: 0 0 auto;
}

.sidebar nav,
body.dashboard-page .sidebar nav,
body.sidebar-collapsed .sidebar nav,
body.dashboard-page.sidebar-collapsed .sidebar nav {
    display: flex;
    flex: 1 1 auto !important;
    flex-direction: column;
    min-height: 0 !important;
    max-height: calc(100vh - 72px) !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
    scrollbar-width: thin;
    scrollbar-color: rgba(56, 189, 248, .45) rgba(8, 20, 38, .35);
    -webkit-overflow-scrolling: touch;
}

.sidebar nav::-webkit-scrollbar {
    width: 7px;
}

.sidebar nav::-webkit-scrollbar-track {
    background: rgba(8, 20, 38, .35);
}

.sidebar nav::-webkit-scrollbar-thumb {
    background: rgba(56, 189, 248, .45);
    border-radius: 6px;
}

.sidebar nav::-webkit-scrollbar-thumb:hover {
    background: rgba(56, 189, 248, .68);
}

@media (max-width: 991px) {
    .sidebar,
    body.dashboard-page .sidebar,
    body.sidebar-collapsed .sidebar,
    body.dashboard-page.sidebar-collapsed .sidebar {
        position: fixed !important;
        height: 100vh !important;
        height: 100dvh !important;
        max-height: 100vh !important;
        max-height: 100dvh !important;
    }

    .sidebar nav,
    body.dashboard-page .sidebar nav,
    body.sidebar-collapsed .sidebar nav,
    body.dashboard-page.sidebar-collapsed .sidebar nav {
        max-height: calc(100vh - 72px) !important;
        max-height: calc(100dvh - 72px) !important;
        touch-action: pan-y;
    }
}
/* Network Analytics OLT monitoring dashboard */
.analytics-noc {
    --analytics-bg: #15191f;
    --analytics-card: #171c23;
    --analytics-card-2: #1d232c;
    --analytics-border: #2a3340;
    --analytics-line: #303946;
    --analytics-text: #f8fbff;
    --analytics-muted: #8fa3bd;
    --analytics-blue: #2f83ff;
    --analytics-cyan: #00d4ff;
    --analytics-green: #00d68f;
    --analytics-red: #ff3d55;
    --analytics-orange: #ff9f1a;
    background: var(--analytics-bg);
    color: var(--analytics-text);
    min-height: calc(100vh - 120px);
    margin: -6px;
    padding: 0;
    font-size: 12px;
}
.analytics-top-card,
.analytics-panel,
.olt-monitor-card {
    background: linear-gradient(180deg, rgba(31, 38, 48, .98), rgba(21, 26, 33, .98));
    border: 1px solid var(--analytics-border);
    border-radius: 7px;
    box-shadow: 0 14px 32px rgba(0, 0, 0, .18);
}
.analytics-top-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    min-height: 66px;
    padding: 14px 18px;
    margin-bottom: 22px;
}
.analytics-top-card h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 800;
    letter-spacing: 0;
}
.analytics-top-card p {
    margin: 5px 0 0;
    color: var(--analytics-muted);
    font-size: 11px;
}
.analytics-status-strip {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
}
.analytics-pill,
.mini-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 28px;
    padding: 0 12px;
    border: 1px solid #334052;
    border-radius: 5px;
    background: #18202a;
    color: #b9c7d7;
    font-weight: 700;
    white-space: nowrap;
}
.analytics-pill i {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: var(--analytics-green);
    box-shadow: 0 0 14px rgba(0, 214, 143, .7);
}
.analytics-pill strong,
.mini-badge strong { color: #fff; }
.analytics-pill.success,
.mini-badge.success { color: var(--analytics-green); border-color: rgba(0, 214, 143, .28); }
.analytics-pill.danger,
.mini-badge.danger { color: var(--analytics-red); border-color: rgba(255, 61, 85, .32); }
.mini-badge.neutral { color: #fff; }
.analytics-global-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 26px;
    margin-bottom: 26px;
}
.analytics-panel {
    min-height: 104px;
    overflow: hidden;
}
.analytics-panel h3 {
    margin: 0;
    padding: 15px 18px;
    font-size: 14px;
    font-weight: 800;
    border-bottom: 1px solid var(--analytics-line);
    color: #fff;
}
.rx-chip-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    padding: 16px 18px;
}
.rx-chip-row.compact {
    padding: 0;
    gap: 9px;
}
.rx-chip {
    display: inline-grid;
    place-items: center;
    min-width: 54px;
    height: 45px;
    padding: 4px 9px;
    border: 1px solid #394455;
    border-radius: 7px;
    background: #202733;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .03);
}
.rx-chip strong {
    font-size: 15px;
    line-height: 1;
    font-weight: 900;
}
.rx-chip small {
    margin-top: 4px;
    color: #bfd2ea;
    font-size: 9px;
    font-weight: 800;
    text-transform: uppercase;
}
.rx-chip.success { border-bottom-color: var(--analytics-green); color: var(--analytics-green); }
.rx-chip.warning { border-bottom-color: var(--analytics-orange); color: var(--analytics-orange); }
.rx-chip.danger { border-bottom-color: var(--analytics-red); color: var(--analytics-red); }
.olt-monitor-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(280px, 1fr));
    gap: 26px;
    align-items: start;
}
.olt-monitor-card {
    min-height: 294px;
    padding: 0 18px 18px;
}
.olt-monitor-card header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    min-height: 52px;
    border-bottom: 1px solid var(--analytics-line);
}
.olt-title {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
}
.olt-title i { color: var(--analytics-blue); font-size: 16px; }
.olt-title strong {
    color: #fff;
    font-size: 15px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.olt-badges {
    display: flex;
    gap: 7px;
    align-items: center;
}
.mini-badge {
    min-height: 24px;
    padding: 0 8px;
    font-size: 11px;
}
.capacity-box {
    margin: 18px 0 16px;
    padding: 13px 14px;
    border: 1px solid var(--analytics-border);
    border-radius: 6px;
    background: var(--analytics-card-2);
}
.capacity-box > div:first-child,
.pon-line > div:first-child {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}
.capacity-box span,
.pon-line span {
    color: #a9bad1;
    font-size: 10px;
    font-weight: 700;
}
.capacity-box strong,
.pon-line strong {
    color: #dceaff;
    font-size: 10px;
    font-weight: 900;
}
.analytics-progress {
    width: 100%;
    height: 5px;
    border-radius: 999px;
    background: #2a303a;
    overflow: hidden;
}
.analytics-progress.tiny { height: 4px; }
.analytics-progress span {
    display: block;
    height: 100%;
    border-radius: inherit;
    min-width: 2px;
}
.analytics-progress .info { background: var(--analytics-blue); }
.analytics-progress .warning { background: var(--analytics-orange); }
.analytics-progress .danger { background: var(--analytics-red); }
.section-label {
    margin: 0 0 12px;
    color: #6380a4;
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .08em;
}
.pon-interface-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px 18px;
    padding-bottom: 22px;
    border-bottom: 1px solid var(--analytics-line);
}
.pon-line em {
    color: var(--analytics-green);
    font-style: normal;
}
.pon-line:has(.danger) em { color: var(--analytics-red); }
.pon-line:has(.warning) em { color: var(--analytics-orange); }
.rx-block {
    margin-top: 20px;
}
.analytics-empty,
.analytics-empty-panel {
    color: #74869d;
    font-size: 12px;
    font-weight: 700;
}
.analytics-empty-panel {
    padding: 24px;
}
@media (max-width: 1500px) {
    .olt-monitor-grid { grid-template-columns: repeat(2, minmax(280px, 1fr)); }
}
@media (max-width: 1100px) {
    .analytics-global-grid,
    .olt-monitor-grid { grid-template-columns: 1fr; }
    .analytics-top-card { align-items: flex-start; flex-direction: column; }
    .analytics-status-strip { justify-content: flex-start; }
}
@media (max-width: 640px) {
    .analytics-noc { margin: 0; }
    .analytics-top-card,
    .analytics-global-grid,
    .olt-monitor-grid { gap: 14px; margin-bottom: 14px; }
    .pon-interface-grid { grid-template-columns: 1fr; }
    .olt-monitor-card header { align-items: flex-start; flex-direction: column; padding: 14px 0; }
    .olt-badges { flex-wrap: wrap; }
}

/* Network Analytics interactive RX filters */
.analytics-noc a.rx-chip {
    color: inherit;
    text-decoration: none;
}
.analytics-noc .rx-chip.is-clickable {
    cursor: pointer;
    transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease, background .16s ease;
}
.analytics-noc .rx-chip.is-clickable:hover,
.analytics-noc .rx-chip.is-active {
    border-color: var(--analytics-cyan);
    box-shadow: 0 0 0 1px rgba(0, 212, 255, .35), 0 0 18px rgba(0, 212, 255, .2);
    transform: translateY(-1px);
    background: #243040;
}
.analytics-rx-results {
    margin-bottom: 26px;
    min-height: 0;
}
.analytics-results-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border-bottom: 1px solid var(--analytics-line);
}
.analytics-results-head h3 {
    border-bottom: 0;
}
.analytics-clear-link {
    margin-right: 16px;
    color: var(--analytics-cyan);
    font-size: 11px;
    font-weight: 900;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: .06em;
}
.analytics-clear-link:hover {
    color: #fff;
}
.analytics-table {
    width: 100%;
    border-collapse: collapse;
    color: #dceaff;
    font-size: 11px;
}
.analytics-table th,
.analytics-table td {
    padding: 10px 12px;
    border-bottom: 1px solid rgba(48, 57, 70, .88);
    white-space: nowrap;
}
.analytics-table th {
    color: #8eb5e8;
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .08em;
    background: rgba(20, 27, 36, .65);
}
.analytics-table tbody tr:hover {
    background: rgba(47, 131, 255, .08);
}
.analytics-table .rx-value {
    color: var(--analytics-orange);
    font-weight: 900;
}
@media (max-width: 640px) {
    .analytics-results-head {
        align-items: flex-start;
        flex-direction: column;
        padding-bottom: 12px;
    }
    .analytics-clear-link {
        margin: 0 0 0 18px;
    }
}
