/* IbitsMK Pulse — quiet, high-contrast control-room presentation */
:root {
    color-scheme: dark;
}
[data-theme="light"] { color-scheme: light; }

html { scroll-behavior: smooth; }
body {
    min-height: 100vh;
    font-family: "Jost", "Segoe UI", sans-serif !important;
    font-size: 15px;
    line-height: 1.5;
    background:
        radial-gradient(ellipse 78rem 48rem at 100% 0%, rgba(196, 82, 27, .24), transparent 70%),
        var(--bg-body) !important;
    color: var(--text-primary) !important;
    -webkit-font-smoothing: antialiased;
}
[data-theme="light"] body {
    background:
        radial-gradient(ellipse at 92% 0%, rgba(22, 127, 135, .055), transparent 35rem),
        var(--bg-body) !important;
}

.container-fluid {
    width: 100%;
    max-width: none;
    padding-left: clamp(1rem, 2.5vw, 2.5rem) !important;
    padding-right: clamp(1rem, 2.5vw, 2.5rem) !important;
}

nav {
    min-height: 68px;
    padding: .45rem 0 .9rem;
    border-bottom: 1px solid var(--border-color);
}
nav img[alt="IbitsMK"] {
    width: auto;
    max-width: 180px;
    height: 40px;
    object-fit: contain;
    mix-blend-mode: screen;
}
[data-theme="light"] nav img[alt="IbitsMK"] { mix-blend-mode: multiply; }
nav .dropdown { flex-shrink: 0; }

h1, h2, h3, h4, h5, h6 {
    color: var(--text-heading);
    letter-spacing: -.025em;
}
h1 { font-size: clamp(1.75rem, 3vw, 2.5rem); }
h5 { font-size: 1.05rem; }
p { color: var(--text-secondary); }
.text-muted, .text-dim { color: var(--text-muted) !important; }
.text-bright { color: var(--text-heading) !important; }
a { color: var(--link-color); }
a:hover { color: var(--accent); }
code {
    padding: .1rem .35rem;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    background: var(--surface-raised);
    color: var(--signal);
}

.card {
    border: 1px solid var(--border-color) !important;
    border-radius: 12px !important;
    background: var(--bg-card) !important;
    color: var(--text-primary) !important;
    box-shadow: 0 5px 18px rgba(12, 31, 39, .055);
}
[data-theme="dark"] .card { box-shadow: 0 8px 22px rgba(3, 12, 17, .14); }
.card.p-4, .card.p-3 { padding: clamp(1rem, 1.8vw, 1.45rem) !important; }
.card.shadow-lg { box-shadow: 0 9px 26px rgba(9, 27, 34, .09) !important; }

.btn {
    border-radius: 7px;
    font-weight: 600;
    letter-spacing: .005em;
    transition: background-color .16s ease, border-color .16s ease, color .16s ease, transform .16s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary, .btn-add, .btn-save {
    color: #fff !important;
    background: var(--accent) !important;
    border-color: var(--accent) !important;
    box-shadow: none !important;
}
.btn-primary:hover, .btn-add:hover, .btn-save:hover {
    background: var(--accent-strong) !important;
    border-color: var(--accent-strong) !important;
}
.btn-back, .btn-nav, .btn-settings {
    border: 1px solid var(--border-color) !important;
    background: var(--btn-back-bg) !important;
    color: var(--btn-back-color) !important;
}
.btn-back:hover, .btn-nav:hover, .btn-settings:hover, .btn-settings:focus, .btn-settings.show {
    background: var(--btn-back-hover) !important;
    border-color: var(--border-strong) !important;
    color: var(--text-heading) !important;
}
.btn-edit, .btn-test, .btn-graph {
    border: 1px solid rgba(100, 203, 208, .28) !important;
    background: rgba(100, 203, 208, .14) !important;
    color: var(--signal) !important;
}
.btn-edit:hover, .btn-test:hover, .btn-graph:hover {
    background: rgba(100, 203, 208, .24) !important;
    color: var(--text-heading) !important;
}
.btn-terminal {
    color: #fff !important;
    background: #9b621f !important;
    border: 1px solid #b77b34 !important;
}
.btn-delete {
    border: 1px solid rgba(227, 107, 103, .38) !important;
    background: rgba(227, 107, 103, .14) !important;
    color: #ec817b !important;
}
.btn-delete:hover { background: rgba(227,107,103,.24) !important; color: #ffaaa4 !important; }
.btn-test-wa { background: #287d5b !important; border-color: #287d5b !important; }
.btn-test-wa:hover { background: #216b4d !important; }
.btn-outline-info {
    color: var(--signal) !important;
    border-color: var(--signal) !important;
}
.btn-outline-info:hover { color: var(--bg-body) !important; background: var(--signal) !important; }

.form-control, .form-select, .input-group-text {
    min-height: 40px;
    border: 1px solid var(--border-strong) !important;
    border-radius: 7px !important;
    background-color: var(--bg-input) !important;
    color: var(--search-color) !important;
    box-shadow: none !important;
}
.form-control:focus, .form-select:focus {
    border-color: var(--signal) !important;
    box-shadow: 0 0 0 3px rgba(100, 203, 208, .16) !important;
}
.form-control::placeholder { color: var(--search-placeholder) !important; opacity: 1; }
.form-label { margin-bottom: .45rem; font-weight: 600; color: var(--text-label) !important; }
.form-text { line-height: 1.5; }
.form-check-input {
    border-color: var(--border-strong) !important;
    background-color: var(--surface-raised) !important;
}
.form-check-input:checked {
    background-color: var(--signal) !important;
    border-color: var(--signal) !important;
}
.form-check-input:focus { box-shadow: 0 0 0 3px rgba(100,203,208,.18) !important; }

.table-responsive { border-radius: 8px; }
.table {
    --bs-table-color: var(--table-color);
    --bs-table-bg: transparent;
    --bs-table-hover-bg: var(--bg-hover);
    --bs-table-hover-color: var(--text-heading);
    margin-bottom: 0;
    color: var(--table-color) !important;
}
.table thead th {
    padding: .8rem .85rem;
    border-bottom: 1px solid var(--border-strong) !important;
    background: var(--surface-raised);
    color: var(--table-head-color) !important;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .075em;
    text-transform: uppercase;
    white-space: nowrap;
}
.table tbody td {
    padding: .78rem .85rem;
    border-color: var(--border-color) !important;
    color: var(--table-color);
}
.table-hover tbody tr:hover > * {
    --bs-table-accent-bg: var(--bg-hover);
    color: var(--text-heading) !important;
}
.table tbody tr:last-child td { border-bottom: 0; }
.font-monospace { font-variant-numeric: tabular-nums; }
.status-up, .status-down, .status-warning, .status-warn {
    display: inline-flex;
    align-items: center;
    min-height: 25px;
    padding: .22rem .58rem !important;
    border: 1px solid currentColor;
    border-radius: 999px !important;
    font-size: .72rem;
    font-weight: 700 !important;
    letter-spacing: .045em;
    line-height: 1.2;
    white-space: nowrap;
}

.dropdown-menu {
    padding: .45rem;
    border: 1px solid var(--border-color) !important;
    border-radius: 10px;
    background: var(--bg-card) !important;
    box-shadow: 0 14px 32px rgba(8, 23, 29, .2) !important;
}
.dropdown-header { padding: .65rem .8rem !important; }
.dropdown-item { border-radius: 6px; padding: .55rem .75rem; }
.dropdown-item:active { background: var(--accent) !important; }

.modal-backdrop.show { opacity: .66; }
.modal-content {
    overflow: hidden;
    border: 1px solid var(--modal-border) !important;
    border-radius: 13px;
    background: var(--modal-bg) !important;
    box-shadow: 0 22px 70px rgba(0,0,0,.28);
}
.modal-header, .modal-footer { padding: 1rem 1.25rem; border-color: var(--modal-border) !important; }
.modal-body { padding: 1.25rem; }
.modal-title { letter-spacing: -.015em; }
.btn-close { opacity: .72; }
.btn-close:hover { opacity: 1; }
.toast-container {
    position: fixed;
    top: 1.15rem;
    right: 1.15rem;
    z-index: 1090;
    width: min(380px, calc(100vw - 2rem));
}
.toast {
    width: 100%;
    border: 1px solid var(--border-strong) !important;
    border-radius: 9px;
    background: var(--bg-card) !important;
    color: var(--text-primary) !important;
    box-shadow: 0 12px 30px rgba(0,0,0,.2);
}

/* Dashboard workspace */
.search-wrapper { min-width: 0 !important; width: min(680px, 58%) !important; }
#searchInput { min-height: 46px; padding-left: 1rem; }
.search-results {
    border: 1px solid var(--border-strong);
    border-radius: 10px;
    background: var(--bg-card);
    box-shadow: 0 16px 38px rgba(4,18,24,.22);
}
.search-result-item { padding: .85rem 1rem; border-color: var(--border-color); }
.search-result-item:hover { background: var(--bg-hover); }
.match-tag { border-radius: 4px; letter-spacing: .04em; }
.pagination-controls { padding: 1rem 0 .25rem; gap: .4rem; flex-wrap: wrap; }
.pagination-controls button {
    min-width: 34px;
    padding: .42rem .7rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--btn-back-bg);
    color: var(--btn-back-color);
}
.pagination-controls button.active { border-color: var(--accent); background: var(--accent); color: #fff; }
.pagination-controls .page-info { padding-left: .55rem; }
#deviceTable { min-width: 720px; }
#deviceTable td:nth-child(2) { min-width: 170px; }
#deviceTable .device-details { color: var(--text-secondary); }
#deviceTable .last-checked { white-space: nowrap; }

.dashboard-page {
    min-height: 100vh;
    padding-bottom: 2.25rem;
}
.dashboard-page > nav { margin-bottom: 0 !important; }
.pulse-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1.5rem;
    padding: 1.55rem 0 1.15rem;
}
.pulse-eyebrow, .pulse-section-kicker {
    color: var(--text-muted);
    font-size: .66rem;
    font-weight: 700;
    letter-spacing: .14em;
    line-height: 1.3;
}
.pulse-eyebrow { display: flex; align-items: center; gap: .55rem; }
.pulse-eyebrow-mark {
    width: 7px;
    height: 7px;
    border-radius: 2px;
    background: var(--accent);
    transform: rotate(45deg);
}
.pulse-heading h1 {
    margin: .5rem 0 .08rem;
    color: var(--text-heading);
    font-size: clamp(1.7rem, 2.2vw, 2.35rem);
    font-weight: 600;
    letter-spacing: -.045em;
}
.pulse-heading-copy p { margin: 0; color: var(--text-muted); font-size: .9rem; }
.pulse-live-indicator {
    display: flex;
    align-items: center;
    gap: .6rem;
    margin-bottom: .28rem;
    padding: .55rem .8rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: color-mix(in srgb, var(--bg-card) 82%, transparent);
    color: var(--text-secondary);
    font-size: .76rem;
    font-weight: 600;
    white-space: nowrap;
}
.pulse-live-dot, .pulse-table-live-dot {
    width: 7px;
    height: 7px;
    flex: 0 0 7px;
    border-radius: 50%;
    background: var(--success);
}
.pulse-live-divider { width: 1px; height: 14px; background: var(--border-strong); }
.pulse-live-rate { color: var(--text-muted); font-family: "SFMono-Regular", Consolas, monospace; font-size: .68rem; font-weight: 500; }
.pulse-commandbar {
    display: flex;
    align-items: stretch;
    gap: .75rem;
    margin: .35rem 0 1.05rem;
}
.pulse-search { position: relative; flex: 1 1 620px; width: auto !important; }
.pulse-search #searchInput { min-height: 48px; padding-left: 2.75rem; border-radius: 6px !important; }
.pulse-search-icon {
    position: absolute;
    z-index: 2;
    top: 50%;
    left: 1rem;
    color: var(--text-muted);
    transform: translateY(-50%);
    pointer-events: none;
}
.pulse-scope {
    display: flex;
    min-width: 200px;
    flex-direction: column;
    justify-content: center;
    padding: .45rem 1rem;
    border: 1px solid var(--border-color);
    border-left: 2px solid var(--accent);
    border-radius: 6px;
    background: var(--bg-card);
}
.pulse-scope-label { color: var(--text-muted); font-size: .62rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.pulse-scope-name { overflow: hidden; color: var(--text-heading); font-size: .88rem; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.pulse-overview {
    display: grid;
    grid-template-columns: minmax(275px, .78fr) minmax(0, 2.2fr);
    gap: .85rem;
    margin-bottom: 1.35rem;
}
.pulse-health-panel, .pulse-inventory-panel {
    min-width: 0;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-card);
}
.pulse-health-panel {
    position: relative;
    display: flex;
    min-height: 194px;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
    padding: 1.25rem 1.35rem 1rem;
}
.pulse-health-panel::after {
    position: absolute;
    right: -3.8rem;
    bottom: -5.2rem;
    width: 12rem;
    height: 12rem;
    border: 1px solid color-mix(in srgb, var(--danger) 22%, transparent);
    border-radius: 50%;
    box-shadow: 0 0 0 1.2rem color-mix(in srgb, var(--danger) 4%, transparent), 0 0 0 2.4rem color-mix(in srgb, var(--danger) 3%, transparent);
    content: "";
    pointer-events: none;
}
.pulse-health-topline, .pulse-inventory-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
}
.pulse-health-state {
    display: inline-flex;
    align-items: center;
    gap: .42rem;
    color: var(--text-muted);
    font-size: .67rem;
}
.pulse-health-state > span {
    width: 6px;
    height: 6px;
    border: 1px solid var(--signal);
    border-radius: 50%;
}
.pulse-health-measure { display: flex; align-items: flex-end; justify-content: space-between; gap: .7rem; padding: .5rem 0 .7rem; }
.pulse-health-label { color: var(--text-secondary); font-size: .78rem; font-weight: 600; }
.pulse-down-value {
    color: var(--danger);
    font-size: clamp(2.6rem, 4vw, 3.75rem);
    font-weight: 600;
    letter-spacing: -.07em;
    line-height: 1.06;
    font-variant-numeric: tabular-nums;
}
.pulse-device-total {
    display: flex;
    align-items: baseline;
    gap: .3rem;
    padding-bottom: .35rem;
    color: var(--text-muted);
    font-size: .68rem;
    white-space: nowrap;
}
.pulse-device-total strong { color: var(--text-heading); font-family: "SFMono-Regular", Consolas, monospace; font-size: 1rem; font-weight: 600; }
.pulse-health-foot { display: flex; gap: 1rem; padding-top: .7rem; border-top: 1px solid var(--border-color); }
.pulse-status-key { display: inline-flex; align-items: center; gap: .38rem; color: var(--text-muted); font-size: .66rem; }
.pulse-status-key i { width: 6px; height: 6px; border-radius: 50%; background: var(--success); }
.pulse-status-key .key-warning { background: var(--warning); }
.pulse-status-key .key-down { background: var(--danger); }
.pulse-inventory-panel { display: flex; flex-direction: column; padding: 1.15rem 1.25rem .85rem; }
.pulse-inventory-heading { padding: 0 .1rem .75rem; border-bottom: 1px solid var(--border-color); }
.pulse-inventory-caption { color: var(--text-muted); font-size: .7rem; }
.pulse-metric-grid { display: grid; flex: 1; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.pulse-metric {
    position: relative;
    display: flex;
    min-width: 0;
    flex-direction: column;
    justify-content: center;
    padding: .85rem 1rem .45rem;
}
.pulse-metric + .pulse-metric { border-left: 1px solid var(--border-color); }
.pulse-metric-label { color: var(--text-muted); font-size: .68rem; font-weight: 600; }
.pulse-metric strong {
    overflow: hidden;
    margin: .35rem 0 .1rem;
    color: var(--text-heading);
    font-family: "SFMono-Regular", Consolas, monospace;
    font-size: clamp(1.2rem, 1.8vw, 1.65rem);
    font-weight: 600;
    letter-spacing: -.045em;
    line-height: 1.1;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}
.pulse-service-metric strong { color: var(--signal); }
.pulse-pppoe-metric strong { color: var(--warning); }
.pulse-scan-metric strong { font-size: clamp(.95rem, 1.2vw, 1.18rem); letter-spacing: -.025em; }
.pulse-metric-note { color: var(--text-muted); font-size: .64rem; }
.pulse-device-section { min-width: 0; }
.pulse-table-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    margin: 0 0 .7rem;
}
.pulse-table-heading h2 { margin: .25rem 0 .1rem; font-size: 1.2rem; font-weight: 600; letter-spacing: -.025em; }
.pulse-table-heading p { margin: 0; color: var(--text-muted); font-size: .78rem; }
.pulse-table-meta { display: flex; align-items: center; gap: .5rem; padding-bottom: .15rem; color: var(--text-muted); font-size: .69rem; white-space: nowrap; }
.pulse-table-live-dot { width: 6px; height: 6px; flex-basis: 6px; }
.pulse-table-frame {
    padding: .4rem .8rem .2rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-card);
    box-shadow: 0 8px 25px rgba(3, 12, 17, .09);
}
#deviceTable { min-width: 780px; }
#deviceTable thead th { padding-top: .78rem; padding-bottom: .78rem; background: var(--surface-raised); }
#deviceTable tbody td { height: 48px; padding-top: .55rem; padding-bottom: .55rem; font-size: .83rem; }
#deviceTable td:first-child { width: 112px; }
#deviceTable td:nth-child(2) { width: 20%; }
#deviceTable td:nth-child(3) { width: 16%; }
#deviceTable td:nth-child(4) { min-width: 260px; }
#deviceTable .device-details { line-height: 1.45; }
#deviceTable .last-checked { font-family: "SFMono-Regular", Consolas, monospace; font-size: .72rem !important; }
.search-no-results { padding: 1.1rem; color: var(--text-muted); text-align: center; }
.modal-content.alert-active { animation: pulseAlert 1s ease-in-out 3; }
@keyframes pulseAlert {
    0%, 100% { box-shadow: 0 0 0 0 rgba(227,107,103,0); }
    50% { box-shadow: 0 0 0 5px rgba(227,107,103,.24); }
}

/* Device detail sections and observability panels */
.display-5 { font-size: clamp(1.75rem, 3.4vw, 2.7rem); letter-spacing: -.04em; }
.display-5 + div { color: var(--text-secondary); font-size: .95rem !important; }
.display-5 + div .badge { font-size: .7rem; letter-spacing: .07em; }
.card h5.border-bottom, .card h5.border-bottom.pb-2 {
    padding-bottom: .8rem !important;
    border-color: var(--border-color) !important;
}
.card .row > [class*="col"] > .card { height: 100%; }
.card h4.text-dim, .card .text-dim.text-uppercase {
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .09em;
}
#terminal-container {
    min-height: 350px;
    max-height: 66vh;
    overflow: hidden;
    background: #101820 !important;
}
#pingChart { width: 100%; }
.badge-ongoing, .badge-closed {
    padding: .4rem .62rem;
    border: 1px solid currentColor;
    border-radius: 999px;
    font-size: .66rem;
    letter-spacing: .06em;
}
.badge-ongoing { background: rgba(234,179,77,.16) !important; color: #e6b24d !important; }
.badge-closed { background: rgba(57,184,121,.14) !important; color: #39b879 !important; }
.loss-cell-low { color: #e3b450 !important; }
.loss-cell-mid { color: #e99148 !important; }
.loss-cell-high { color: #e36b67 !important; }
.table-events td { white-space: nowrap; }
.table-events td:first-child { white-space: normal; }
.empty-state { padding: 3.5rem 1rem !important; color: var(--text-muted); }
.summary-card {
    height: 100%;
    padding: 1rem 1.1rem;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: var(--bg-card);
}
.summary-card .fs-3 { font-variant-numeric: tabular-nums; }
.filters-row .form-control, .filters-row .form-select { max-width: 220px; }

/* Management pages */
.badge-mikrotik, .badge-arista, .badge-ping, .badge-admin, .badge-viewer {
    border-radius: 5px;
    padding: .36rem .56rem;
    font-size: .71rem;
    font-weight: 700;
}
.badge-mikrotik, .badge-admin { background: rgba(100,203,208,.13) !important; color: var(--signal) !important; border: 1px solid rgba(100,203,208,.3) !important; }
.badge-arista { background: rgba(57,184,121,.12) !important; color: #47be85 !important; border: 1px solid rgba(57,184,121,.3) !important; }
.badge-ping, .badge-viewer { background: var(--surface-raised) !important; color: var(--text-secondary) !important; border: 1px solid var(--border-strong) !important; }
.user-current { background: rgba(100,203,208,.055); box-shadow: inset 3px 0 var(--signal); }
.user-current td:first-child { padding-left: 1rem; }
#deviceModal .modal-body, #userModal .modal-body { max-height: 72vh; overflow-y: auto; }
.mikrotik-fields, #aristaFields { padding-top: .15rem; }
.form-switch .form-check-input { width: 2.4em; }
.channel-badge { border-radius: 5px; }
.channel-badge.badge-tg { background: #237da4; }
.channel-badge.badge-wa { background: #287d5b; }
#notifyPing, #notifyBgp, #notifyOspf, #notifyPppoe, #notifyHealth {
    width: 2.4em;
}
#groupsList > div { padding: .7rem .25rem !important; }

/* Login: deliberately quieter and more focused than the operations workspace */
body:has(.theme-corner) {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}
.theme-corner { top: 1rem !important; right: 1rem !important; }
.theme-corner + .card {
    position: relative;
    width: min(100%, 430px) !important;
    max-width: 430px !important;
    padding: clamp(2rem, 6vw, 3.2rem) !important;
    border-top: 3px solid var(--accent) !important;
}
.theme-corner + .card::before {
    content: "NETWORK OPERATIONS";
    display: block;
    margin: -.25rem auto 1.15rem;
    color: var(--signal);
    font-size: .66rem;
    font-weight: 700;
    letter-spacing: .17em;
}
.theme-corner + .card img {
    max-width: 200px;
    height: auto;
    max-height: 72px;
    object-fit: contain;
}
.theme-corner + .card .text-center h4 { margin-top: .4rem; font-size: 1.5rem; }
.theme-corner + .card label { font-size: .78rem !important; }
.theme-corner + .card .btn-primary { min-height: 46px; }

@media (max-width: 767.98px) {
    .container-fluid { padding-left: 1rem !important; padding-right: 1rem !important; }
    nav { align-items: flex-start !important; gap: .7rem; min-height: 58px; }
    nav > div:first-child { min-width: 0; }
    nav img[alt="IbitsMK"] { height: 32px; max-width: 125px; margin-right: .35rem !important; }
    nav > div:last-child { gap: .4rem !important; }
    .btn-settings { padding: .45rem .65rem; font-size: .78rem; }
    .pulse-heading { align-items: flex-start; flex-direction: column; gap: .8rem; padding-top: 1.15rem; }
    .pulse-live-indicator { margin-bottom: 0; }
    .pulse-commandbar { flex-direction: column; }
    .search-wrapper.pulse-search { width: 100% !important; flex-basis: auto; }
    .pulse-scope { min-height: 54px; }
    .pulse-overview { grid-template-columns: minmax(0, 1fr); }
    .pulse-health-panel { min-height: 182px; }
    .pulse-inventory-panel { padding: 1rem; }
    .pulse-metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .pulse-metric { min-height: 105px; padding: .75rem .8rem; }
    .pulse-metric:nth-child(3) { border-left: 0; border-top: 1px solid var(--border-color); }
    .pulse-metric:nth-child(4) { border-top: 1px solid var(--border-color); }
    .pulse-table-heading { align-items: flex-start; flex-direction: column; gap: .45rem; }
    .pulse-table-meta { white-space: normal; }
    .pulse-table-frame { margin: 0 -.15rem; padding: .35rem .55rem .15rem; }
    .table-responsive { margin: 0 -.15rem; }
    .table thead th, .table tbody td { padding: .65rem .7rem; }
    .filters-row { width: 100%; }
    .filters-row .form-control, .filters-row .form-select { max-width: none; flex: 1 1 145px; }
    .filters-row .form-check { margin-left: 0 !important; }
    #bgpSearch, #pppoeSearch { width: 100% !important; }
    .display-5 + div { line-height: 1.8; }
    #terminal-container { min-height: 280px; }
    .modal-dialog { margin: .65rem; }
}
@media (min-width: 768px) and (max-width: 1100px) {
    .pulse-overview { grid-template-columns: minmax(220px, .72fr) minmax(0, 1.7fr); }
    .pulse-inventory-panel { padding-left: .85rem; padding-right: .85rem; }
    .pulse-metric { padding-left: .7rem; padding-right: .7rem; }
    .pulse-metric-note { font-size: .59rem; }
}
@media (max-width: 520px) {
    .pulse-heading h1 { font-size: 1.75rem; }
    .pulse-heading-copy p { font-size: .82rem; }
    .pulse-live-indicator { padding: .5rem .65rem; }
    .pulse-health-panel { padding: 1.05rem; }
    .pulse-health-measure { align-items: flex-start; flex-direction: column; gap: .2rem; }
    .pulse-device-total { padding-bottom: 0; }
    .pulse-health-foot { gap: .75rem; }
    .pulse-inventory-heading { align-items: flex-start; flex-direction: column; gap: .25rem; }
    .pulse-metric strong { font-size: 1.2rem; }
    .pulse-metric-note { font-size: .58rem; }
    .pulse-down-value { font-size: 3rem; }
    .pulse-table-frame { margin: 0 -.25rem; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}