:root {
    --pdps-navy: #001f4d;
    --pdps-navy-2: #062b5f;
    --pdps-sidebar: #001d46;
    --pdps-blue: #0d6efd;
    --pdps-cyan: #2b8cff;
    --app-radius: .7rem;
    --app-radius-sm: .5rem;
    --app-border: #d8dee8;
    --app-border-strong: #c6ceda;
    --app-surface: #ffffff;
    --app-surface-2: #f7f9fb;
    --app-canvas: #eef2f6;
    --app-muted: #677486;
    --app-shadow: 0 8px 24px rgba(15, 23, 42, .07);
    --app-shadow-sm: 0 2px 8px rgba(15, 23, 42, .05);
    --sidebar-width: 200px;
    --topbar-height: 52px;
}

[data-bs-theme="dark"] {
    --bs-body-bg: #2b3035;
    --bs-body-color: #edf2f7;
    --bs-emphasis-color: #f8fafc;
    --bs-secondary-color: #aeb8c5;
    --bs-tertiary-bg: #24292e;
    --app-border: #3a434c;
    --app-border-strong: #4a5560;
    --app-surface: #23282d;
    --app-surface-2: #20252a;
    --app-canvas: #2b3035;
    --app-muted: #aeb8c5;
    --app-shadow: 0 8px 24px rgba(0, 0, 0, .2);
    --app-shadow-sm: 0 2px 8px rgba(0, 0, 0, .14);
}

html,
body {
    min-height: 100%;
}

body {
    background: var(--app-canvas);
    font-size: .875rem;
}

body.sidebar-open {
    overflow: hidden;
}

/* CRM-style application shell */
.app-shell {
    min-height: 100vh;
}

.app-topbar,
.public-topbar {
    height: var(--topbar-height);
    background: var(--pdps-navy);
    border-bottom: 1px solid rgba(255, 255, 255, .22);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: fixed;
    inset: 0 0 auto 0;
    z-index: 1040;
    padding: 0 .65rem;
}

.public-topbar {
    position: sticky;
}

.app-topbar-brand-wrap,
.app-topbar-actions {
    display: flex;
    align-items: center;
    gap: .45rem;
}

.app-topbar-brand {
    display: inline-flex;
    align-items: center;
    min-width: calc(var(--sidebar-width) - .7rem);
    text-decoration: none;
}

.app-topbar-brand img {
    width: auto;
    height: 42px;
    max-width: 112px;
    object-fit: contain;
    background: #fff;
    padding: 1px 3px;
}

.app-sidebar-toggle,
.app-topbar-icon,
.app-user-menu {
    color: rgba(255, 255, 255, .8);
    border: 1px solid rgba(255, 255, 255, .25);
    background: rgba(255, 255, 255, .03);
    border-radius: .45rem;
    min-height: 30px;
}

.app-sidebar-toggle,
.app-topbar-icon {
    width: 32px;
    padding: 0;
    display: inline-grid;
    place-items: center;
}

.app-sidebar-toggle:hover,
.app-topbar-icon:hover,
.app-user-menu:hover,
.app-user-menu.show {
    color: #fff;
    border-color: rgba(255, 255, 255, .42);
    background: rgba(255, 255, 255, .09);
}

.app-user-menu {
    max-width: 190px;
    padding: .28rem .5rem;
    font-size: .75rem;
    gap: .35rem;
    align-items: center;
}

.app-user-menu span {
    max-width: 125px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.app-topbar-primary {
    min-height: 30px;
    border-radius: .45rem;
    font-size: .75rem;
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    padding-inline: .65rem;
}

.app-global-search {
    width: min(100%, 210px);
    height: 29px;
    border: 1px solid rgba(255, 255, 255, .28);
    background: rgba(255, 255, 255, .09);
    border-radius: .25rem;
    overflow: hidden;
}

.app-global-search input {
    width: 100%;
    border: 0;
    outline: 0;
    background: transparent;
    color: #fff;
    padding: .2rem .45rem;
    font-size: .72rem;
}

.app-global-search input::placeholder {
    color: rgba(255, 255, 255, .68);
}

.app-global-search button {
    width: 30px;
    border: 0;
    border-left: 1px solid rgba(255, 255, 255, .2);
    background: transparent;
    color: rgba(255, 255, 255, .8);
}

.app-sidebar {
    width: var(--sidebar-width);
    position: fixed;
    left: 0;
    top: var(--topbar-height);
    bottom: 0;
    z-index: 1030;
    display: flex;
    flex-direction: column;
    background: var(--pdps-sidebar);
    border-right: 1px solid rgba(255, 255, 255, .12);
    color: #d9e7f6;
    overflow-y: auto;
}

.app-sidebar-nav {
    padding: .55rem .55rem 1rem;
    flex: 1;
}

.sidebar-section-label {
    color: #80b8ef;
    text-transform: uppercase;
    font-size: .6rem;
    letter-spacing: .055em;
    font-weight: 800;
    padding: .55rem .4rem .28rem;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: .6rem;
    color: #d7e6f5;
    text-decoration: none;
    min-height: 36px;
    padding: .48rem .48rem;
    border-radius: .35rem;
    font-size: .77rem;
    font-weight: 500;
    transition: background-color .12s ease, color .12s ease;
}

.sidebar-link i {
    width: 17px;
    text-align: center;
    color: #9fc4eb;
    font-size: .82rem;
}

.sidebar-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, .08);
}

.sidebar-link.active {
    color: #fff;
    background: rgba(13, 110, 253, .2);
    box-shadow: inset 2px 0 0 #3f91ff;
}

.sidebar-link.active i {
    color: #65a7ff;
}

.app-sidebar-footer {
    padding: .7rem .8rem;
    border-top: 1px solid rgba(255, 255, 255, .1);
    color: #9db3c9;
    font-size: .68rem;
    display: flex;
    align-items: center;
    gap: .4rem;
}

.sidebar-status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #32c682;
    box-shadow: 0 0 0 3px rgba(50, 198, 130, .13);
}

.app-page {
    min-height: 100vh;
    margin-left: var(--sidebar-width);
    padding-top: var(--topbar-height);
    display: flex;
    flex-direction: column;
}

.app-main {
    width: 100%;
    max-width: 1800px;
    margin: 0 auto;
    padding: 1rem 1.4rem 1.25rem;
    flex: 1;
}

.app-footer {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: .65rem 1.4rem 1rem;
    color: var(--bs-secondary-color);
    font-size: .68rem;
}

.app-sidebar-backdrop {
    display: none;
}

.public-main {
    width: min(100% - 1.5rem, 1500px);
    margin-inline: auto;
}

/* Page header */
.page-heading {
    display: flex;
    gap: .9rem;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    margin-bottom: .9rem;
}

.page-eyebrow {
    color: #1682ff;
    font-size: .63rem;
    font-weight: 800;
    letter-spacing: .09em;
    text-transform: uppercase;
    margin-bottom: .22rem;
}

.page-heading h1 {
    font-size: clamp(1.45rem, 1.8vw, 1.85rem);
    font-weight: 750;
    line-height: 1.15;
    letter-spacing: -.025em;
    margin-bottom: .22rem;
}

.page-heading p {
    color: var(--bs-secondary-color);
    font-size: .8rem;
    margin-bottom: 0;
}

/* Cards and metrics */
.card {
    background: var(--app-surface);
    border-color: var(--app-border);
    border-radius: var(--app-radius);
}

.app-card,
.filter-card,
.table-card,
.metric-card {
    box-shadow: none;
}

.app-card,
.table-card {
    overflow: hidden;
}

.app-card .card-header,
.table-card .card-header {
    background: var(--app-surface-2) !important;
    border-bottom-color: var(--app-border);
    padding: .62rem .78rem;
}

.card-body {
    padding: .8rem;
}

.metric-card {
    height: 100%;
    overflow: hidden;
    transition: border-color .12s ease, transform .12s ease;
}

.metric-card:hover {
    border-color: #3f91ff;
    transform: translateY(-1px);
}

.metric-card .card-body {
    padding: .65rem .75rem;
}

.metric-card .metric-icon {
    width: 2rem;
    height: 2rem;
    border-radius: .55rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: .95rem;
    color: #1682ff;
    background: rgba(13, 110, 253, .12);
    border: 1px solid rgba(13, 110, 253, .12);
}

.metric-label {
    color: var(--bs-secondary-color);
    font-size: .66rem;
    font-weight: 700;
    line-height: 1.2;
}

.metric-value {
    font-size: clamp(1.25rem, 1.7vw, 1.65rem);
    font-weight: 750;
    line-height: 1;
    letter-spacing: -.025em;
}

.metric-note {
    font-size: .66rem;
    color: var(--bs-secondary-color);
}

.metric-danger .metric-icon { color: #e45160; background: rgba(220, 53, 69, .1); }
.metric-warning .metric-icon { color: #e0a000; background: rgba(255, 193, 7, .11); }
.metric-success .metric-icon { color: #2ba36f; background: rgba(25, 135, 84, .11); }
.metric-info .metric-icon { color: #31a7d1; background: rgba(13, 202, 240, .1); }

.filter-card {
    background: var(--app-surface-2);
}

.filter-card .card-body {
    padding: .72rem .8rem;
}

.filter-card .form-label,
.form-label {
    font-size: .68rem;
    color: var(--bs-body-color);
    font-weight: 650;
    margin-bottom: .3rem;
}

.section-title {
    font-weight: 700;
    font-size: .82rem;
    letter-spacing: -.008em;
}

/* Forms */
.form-control,
.form-select,
.input-group-text {
    border-color: var(--app-border-strong);
    border-radius: .45rem;
    min-height: 34px;
    font-size: .8rem;
    background-color: var(--app-surface);
}

.input-group > .form-control,
.input-group > .form-select,
.input-group > .input-group-text {
    border-radius: 0;
}

.input-group > :first-child {
    border-top-left-radius: .45rem;
    border-bottom-left-radius: .45rem;
}

.input-group > :last-child {
    border-top-right-radius: .45rem;
    border-bottom-right-radius: .45rem;
}

.form-control:focus,
.form-select:focus {
    border-color: rgba(13, 110, 253, .65);
    box-shadow: 0 0 0 .16rem rgba(13, 110, 253, .1);
}

.form-control-lg,
.form-select-lg,
.input-group-lg > .form-control,
.input-group-lg > .form-select,
.input-group-lg > .input-group-text {
    min-height: 40px;
    font-size: .88rem;
}

.btn {
    border-radius: .45rem;
    font-size: .78rem;
    font-weight: 600;
}

.btn-sm {
    font-size: .71rem;
}

.dropdown-menu {
    border-color: var(--app-border);
    border-radius: .55rem;
    box-shadow: var(--app-shadow);
    font-size: .78rem;
}

.alert {
    border-radius: .55rem;
    font-size: .8rem;
}

.quick-filter {
    border-radius: 999px;
}

/* Tables */
.table-card .table {
    margin-bottom: 0;
    font-size: .77rem;
}

.table-card .table thead th,
.table thead th {
    background: var(--app-surface-2);
    color: var(--bs-secondary-color);
    border-bottom-width: 1px;
    border-color: var(--app-border);
    font-size: .62rem;
    font-weight: 750;
    letter-spacing: .04em;
    text-transform: uppercase;
    white-space: nowrap;
    padding: .58rem .65rem;
}

.table-card .table tbody td,
.table tbody td {
    padding: .62rem .65rem;
    border-color: var(--app-border);
    vertical-align: middle;
}

.table-hover > tbody > tr:hover > * {
    --bs-table-hover-bg: rgba(13, 110, 253, .045);
}

.ticket-link {
    color: var(--bs-emphasis-color);
    font-weight: 650;
    text-decoration: none;
}

.ticket-link:hover {
    color: #1682ff;
}

/* Status + priority */
.status-pill,
.priority-pill {
    display: inline-flex;
    align-items: center;
    gap: .28rem;
    border-radius: 999px;
    font-size: .65rem;
    font-weight: 650;
    line-height: 1;
    padding: .34rem .5rem;
    white-space: nowrap;
    border: 1px solid transparent;
}

.status-new { background: rgba(13, 110, 253, .11); color: #0a58ca; border-color: rgba(13, 110, 253, .17); }
.status-assigned { background: rgba(111, 66, 193, .11); color: #6f42c1; border-color: rgba(111, 66, 193, .17); }
.status-progress { background: rgba(13, 202, 240, .12); color: #087990; border-color: rgba(13, 202, 240, .2); }
.status-waiting { background: rgba(255, 193, 7, .15); color: #946200; border-color: rgba(255, 193, 7, .24); }
.status-resolved { background: rgba(25, 135, 84, .11); color: #146c43; border-color: rgba(25, 135, 84, .18); }
.status-closed { background: rgba(108, 117, 125, .13); color: var(--bs-secondary-color); border-color: rgba(108, 117, 125, .2); }
.status-cancelled { background: rgba(220, 53, 69, .10); color: #b02a37; border-color: rgba(220, 53, 69, .16); }
.status-neutral { background: var(--app-surface-2); color: var(--bs-secondary-color); border-color: var(--app-border); }

.priority-critical { background: rgba(220, 53, 69, .1); color: #b02a37; border-color: rgba(220, 53, 69, .16); }
.priority-high { background: rgba(253, 126, 20, .12); color: #b8550b; border-color: rgba(253, 126, 20, .2); }
.priority-medium { background: rgba(255, 193, 7, .14); color: #856404; border-color: rgba(255, 193, 7, .22); }
.priority-low { background: rgba(25, 135, 84, .1); color: #146c43; border-color: rgba(25, 135, 84, .17); }
.priority-neutral { background: var(--app-surface-2); color: var(--bs-secondary-color); border-color: var(--app-border); }

[data-bs-theme="dark"] .status-new { color: #8bb9ff; }
[data-bs-theme="dark"] .status-assigned { color: #c0a7f5; }
[data-bs-theme="dark"] .status-progress { color: #7edced; }
[data-bs-theme="dark"] .status-waiting { color: #f6d264; }
[data-bs-theme="dark"] .status-resolved { color: #75d6a6; }
[data-bs-theme="dark"] .status-cancelled { color: #f08b96; }
[data-bs-theme="dark"] .priority-critical { color: #f08b96; }
[data-bs-theme="dark"] .priority-high { color: #ffad70; }
[data-bs-theme="dark"] .priority-medium { color: #f6d264; }
[data-bs-theme="dark"] .priority-low { color: #75d6a6; }

.sla-overdue { color: var(--bs-danger); font-weight: 650; }
.sla-soon { color: #d69d00; font-weight: 650; }

/* Ticket details */
.avatar {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--app-surface-2);
    border: 1px solid var(--app-border);
    color: var(--bs-secondary-color);
    font-size: .68rem;
    font-weight: 750;
    flex: 0 0 auto;
}

.avatar.avatar-lg {
    width: 2.5rem;
    height: 2.5rem;
    font-size: .82rem;
}

.ticket-hero {
    background: var(--app-surface);
    box-shadow: none;
}

.ticket-meta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: .55rem;
}

.ticket-meta-item {
    padding: .58rem .65rem;
    border: 1px solid var(--app-border);
    border-radius: .5rem;
    background: var(--app-surface-2);
}

.ticket-meta-label {
    color: var(--bs-secondary-color);
    font-size: .61rem;
    font-weight: 750;
    letter-spacing: .04em;
    text-transform: uppercase;
    margin-bottom: .18rem;
}

.timeline {
    position: relative;
}

.timeline-item {
    position: relative;
    padding-left: 2.7rem;
    padding-bottom: .9rem;
}

.timeline-item::before {
    content: "";
    position: absolute;
    left: .96rem;
    top: 2rem;
    bottom: 0;
    width: 1px;
    background: var(--app-border);
}

.timeline-item:last-child::before {
    display: none;
}

.timeline-avatar {
    position: absolute;
    left: 0;
    top: .05rem;
}

.timeline-body {
    border: 1px solid var(--app-border);
    border-radius: .55rem;
    padding: .72rem .8rem;
    background: var(--app-surface);
}

.timeline-body.internal-note {
    border-left: 3px solid var(--bs-warning);
    background: color-mix(in srgb, var(--bs-warning) 4%, var(--app-surface));
}

.sticky-panel {
    position: sticky;
    top: calc(var(--topbar-height) + 1rem);
}

/* Charts / empty states */
.chart-wrap {
    height: 245px;
}

.empty-state {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--bs-secondary-color);
    font-size: .8rem;
}

.empty-state i {
    font-size: 1.7rem;
    opacity: .65;
}

/* Knowledge base */
.kb-card {
    height: 100%;
    transition: border-color .12s ease, transform .12s ease;
}

.kb-card:hover {
    transform: translateY(-1px);
    border-color: #3f91ff;
}

.kb-card .card-body {
    padding: .9rem;
}

.kb-impact {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    color: var(--bs-secondary-color);
    font-size: .69rem;
    font-weight: 600;
}

.kb-impact strong {
    color: var(--bs-emphasis-color);
}

.kb-solved-by-me {
    color: #34b77a;
    font-size: .68rem;
    font-weight: 650;
}

.kb-insight-user {
    display: flex;
    align-items: center;
    gap: .55rem;
}

/* Login */
.login-shell {
    min-height: calc(100vh - var(--topbar-height));
    display: grid;
    place-items: center;
    padding: 2rem 0;
}

.login-card {
    width: min(100%, 430px);
    box-shadow: var(--app-shadow);
}

.min-w-0 { min-width: 0; }

@media (max-width: 1199.98px) {
    .app-main { padding-inline: 1rem; }
}

@media (max-width: 991.98px) {
    :root { --sidebar-width: 230px; }

    .app-topbar-brand { min-width: auto; }
    .app-sidebar {
        transform: translateX(-100%);
        transition: transform .18s ease;
        box-shadow: 12px 0 30px rgba(0, 0, 0, .2);
    }
    .app-sidebar.open { transform: translateX(0); }
    .app-sidebar-backdrop {
        position: fixed;
        inset: var(--topbar-height) 0 0 0;
        z-index: 1025;
        background: rgba(0, 0, 0, .45);
    }
    .app-sidebar-backdrop.show { display: block; }
    .app-page { margin-left: 0; }
    .sticky-panel { position: static; }
}

@media (max-width: 575.98px) {
    .app-topbar-brand img { height: 36px; max-width: 92px; }
    .app-main { padding: .8rem .7rem 1rem; }
    .app-footer { padding-inline: .7rem; }
    .page-heading { margin-bottom: .75rem; }
    .chart-wrap { height: 220px; }
    .timeline-item { padding-left: 2.45rem; }
    .card-body { padding: .7rem; }
}

/* Infrastructure monitoring */
.monitor-period-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    flex-wrap: wrap;
    padding: .7rem .8rem;
    margin-bottom: 1rem;
    background: var(--app-surface);
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius);
    box-shadow: var(--app-shadow-sm);
}

.monitor-custom-range {
    display: flex;
    align-items: center;
    gap: .45rem;
    flex-wrap: wrap;
}

.monitor-custom-range .form-control {
    width: 142px;
}

.monitor-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 64px;
    padding: .22rem .48rem;
    border-radius: 999px;
    font-size: .69rem;
    font-weight: 700;
    border: 1px solid transparent;
}

.monitor-status.up { color: #18794e; background: rgba(25, 135, 84, .1); border-color: rgba(25, 135, 84, .2); }
.monitor-status.warning { color: #946200; background: rgba(255, 193, 7, .14); border-color: rgba(255, 193, 7, .25); }
.monitor-status.down { color: #b42318; background: rgba(220, 53, 69, .1); border-color: rgba(220, 53, 69, .2); }
.monitor-status.unknown { color: var(--app-muted); background: var(--app-surface-2); border-color: var(--app-border); }
.monitor-status.maintenance { color: #0b63a5; background: rgba(13, 110, 253, .1); border-color: rgba(13, 110, 253, .2); }

[data-bs-theme="dark"] .monitor-status.up { color: #75d9a7; }
[data-bs-theme="dark"] .monitor-status.warning { color: #f3cb68; }
[data-bs-theme="dark"] .monitor-status.down { color: #f39aa3; }
[data-bs-theme="dark"] .monitor-status.maintenance { color: #7db8ff; }

.monitor-dot {
    width: 8px;
    height: 8px;
    display: inline-block;
    border-radius: 50%;
    margin-right: .45rem;
    background: #8792a2;
}
.monitor-dot.up { background: #198754; }
.monitor-dot.warning { background: #e4a800; }
.monitor-dot.down { background: #dc3545; }
.monitor-dot.unknown { background: #8792a2; }
.monitor-dot.maintenance { background: #0d6efd; }

.monitor-last-five {
    display: inline-flex;
    gap: .3rem;
    align-items: center;
}

.monitor-ping {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 0 2px var(--app-surface);
}
.monitor-ping.ok { background: #198754; }
.monitor-ping.fail { background: #dc3545; }

.monitor-gauge {
    --gauge-value: 0;
    width: 112px;
    height: 112px;
    flex: 0 0 112px;
    border-radius: 50%;
    background: conic-gradient(#198754 calc(var(--gauge-value) * 1%), var(--app-border) 0);
    display: grid;
    place-items: center;
    position: relative;
}

.monitor-gauge::after {
    content: "";
    position: absolute;
    inset: 10px;
    border-radius: 50%;
    background: var(--app-surface);
}

.monitor-gauge > div {
    position: relative;
    z-index: 1;
    text-align: center;
}

.monitor-gauge strong {
    display: block;
    font-size: 1.15rem;
}

.monitor-gauge span {
    display: block;
    font-size: .62rem;
    color: var(--app-muted);
    margin-top: .1rem;
}

.monitor-summary-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: .65rem .7rem;
    background: var(--app-surface-2);
    border: 1px solid var(--app-border);
    border-radius: .5rem;
    font-size: .78rem;
}

.monitor-agent-card {
    display: flex;
    align-items: center;
    gap: .65rem;
    padding: .75rem;
    color: inherit;
    text-decoration: none;
    border: 1px solid var(--app-border);
    background: var(--app-surface-2);
    border-radius: .55rem;
}

.monitor-agent-card:hover {
    border-color: var(--app-border-strong);
    background: var(--app-surface);
}

.monitor-agent-card small {
    display: block;
    color: var(--app-muted);
    margin-top: .08rem;
}

.monitor-agent-icon {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: .55rem;
    background: var(--app-surface);
    border: 1px solid var(--app-border);
    color: var(--app-muted);
}
.monitor-agent-icon.online { color: #198754; }

.monitor-token {
    padding: .65rem .75rem;
    border-radius: .45rem;
    background: rgba(0, 0, 0, .08);
    overflow-wrap: anywhere;
    user-select: all;
}

.monitor-chart {
    min-height: 310px;
}

@media (max-width: 767.98px) {
    .monitor-custom-range {
        width: 100%;
    }
    .monitor-custom-range .form-control {
        width: calc(50% - 2.1rem);
        min-width: 120px;
    }
    .monitor-gauge {
        width: 94px;
        height: 94px;
        flex-basis: 94px;
    }
}

/* Monitoring V2: agent-offline state and SNMP telemetry */
.monitor-gauge.unknown {
    background: conic-gradient(var(--app-border) 0 100%);
}
.monitor-agent-alert {
    border-color: rgba(255, 193, 7, .35);
}
.monitor-telemetry-panel {
    border: 1px solid var(--app-border);
    border-radius: .65rem;
    background: var(--app-surface-2);
    padding: 1rem;
}
.monitor-supply-progress {
    height: .4rem;
    margin-top: .35rem;
    background: var(--app-border);
}
.monitor-interface-table {
    max-height: 520px;
    overflow: auto;
    border: 1px solid var(--app-border);
    border-radius: .5rem;
}
.monitor-interface-table thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: var(--app-surface);
}

/* Monitoring completion: warning center and compact health bars */
.monitor-warning-center .list-group-item { background: transparent; }
.monitor-alert-icon { width: 2rem; height: 2rem; border-radius: .5rem; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.monitor-alert-icon.critical { background: rgba(220,53,69,.14); color: var(--bs-danger); }
.monitor-alert-icon.warning { background: rgba(255,193,7,.14); color: var(--bs-warning); }
.monitor-alert-icon.info { background: rgba(13,110,253,.12); color: var(--bs-primary); }
.monitor-row-progress, .monitor-tray-progress { height: .34rem; background: var(--app-border); }
.monitor-supply-progress { height: .4rem; }
.monitor-supply-progress .progress-bar.is-low { opacity: .8; }

/* Monitoring V2.3 device-class overview */
.monitor-class-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(290px,1fr));gap:1rem}.monitor-class-card{border:1px solid var(--app-border);border-radius:.75rem;background:var(--app-card);overflow:hidden}.monitor-class-head{display:flex;justify-content:space-between;gap:1rem;align-items:center;padding:.75rem .9rem;border-bottom:1px solid var(--app-border)}.monitor-class-head strong{display:block}.monitor-class-head span{font-size:.78rem;color:var(--app-muted);margin-left:.4rem}.monitor-class-list{display:grid}.monitor-class-row{position:relative;display:grid;grid-template-columns:10px minmax(0,1fr) auto;gap:.65rem;align-items:center;padding:.62rem .8rem;color:inherit;text-decoration:none;border-bottom:1px solid var(--app-border)}.monitor-class-row:last-child{border-bottom:0}.monitor-class-row:hover{background:rgba(127,127,127,.06)}.monitor-class-name{min-width:0}.monitor-class-name strong,.monitor-class-name small{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.monitor-class-name small,.monitor-class-metric small{color:var(--app-muted);font-size:.72rem}.monitor-class-metric{text-align:right}.monitor-card-uptime{position:absolute;bottom:0;left:0;right:0;height:2px;background:rgba(127,127,127,.12)}.monitor-card-uptime i{display:block;height:100%;background:var(--bs-primary)}.mini-toners{height:22px;display:inline-flex;gap:3px;align-items:flex-end}.mini-toner{display:inline-block;width:6px;height:22px;background:rgba(127,127,127,.15);position:relative;overflow:hidden;border-radius:2px}.mini-toner i{position:absolute;bottom:0;left:0;right:0;background:#d9dee3}.mini-toner.c i{background:#35c8e4}.mini-toner.m i{background:#e454a8}.mini-toner.y i{background:#e6c51e}.mini-toner.k i{background:#cfd5da}.monitor-tv-strip{display:flex;gap:.75rem;align-items:center;flex-wrap:wrap}.monitor-tv-strip .metric-pill{border:1px solid var(--app-border);border-radius:.6rem;padding:.55rem .75rem;background:var(--app-card)}.monitor-tv-strip .metric-pill strong{font-size:1.05rem}.monitor-tv-strip .metric-pill small{display:block;color:var(--app-muted)}.monitor-compact-alerts{max-height:230px;overflow:auto}.monitor-target-type-badge{font-size:.72rem;color:var(--app-muted)}

/* Monitoring V2.3 switch faceplate and printer presentation */
.switch-faceplate{border:1px solid var(--app-border);border-radius:.8rem;padding:1rem;background:rgba(127,127,127,.035)}.switch-faceplate-grid{display:grid;grid-template-columns:repeat(24,minmax(18px,1fr));gap:5px}.switch-port{position:relative;aspect-ratio:1.05;border:1px solid var(--app-border);border-radius:3px;background:#39434d;display:flex;align-items:center;justify-content:center;font-size:.62rem;color:#d9e0e5;text-decoration:none}.switch-port.up{background:#16a765;border-color:#1ac477;color:#fff}.switch-port.no-link{background:#3b444c}.switch-port.disabled{background:repeating-linear-gradient(135deg,#3a4249,#3a4249 4px,#232a30 4px,#232a30 8px)}.switch-port.fault{background:#d63b50;border-color:#ec5368}.switch-port small{font-size:.55rem}.switch-face-legend{display:flex;gap:1rem;flex-wrap:wrap;font-size:.72rem;color:var(--app-muted)}.switch-face-legend span:before{content:"";width:10px;height:10px;border-radius:2px;display:inline-block;margin-right:5px;background:#3b444c}.switch-face-legend .up:before{background:#16a765}.switch-face-legend .disabled:before{background:#242b31}.switch-face-legend .fault:before{background:#d63b50}.printer-hero{display:grid;grid-template-columns:minmax(220px,.8fr) 1.3fr 1fr;gap:1rem}.printer-counter-big{font-size:2rem;font-weight:700;line-height:1}.printer-supply-row{display:grid;grid-template-columns:120px 1fr 54px;gap:.65rem;align-items:center;margin:.6rem 0}.printer-supply-bar{height:7px;background:rgba(127,127,127,.15);border-radius:999px;overflow:hidden}.printer-supply-bar i{display:block;height:100%;background:#8c99a5}.printer-supply-bar.c i{background:#34c8e6}.printer-supply-bar.m i{background:#e554a8}.printer-supply-bar.y i{background:#e7c71e}.printer-supply-bar.k i{background:#555}.printer-supply-bar.waste i{background:#e08a2e}@media(max-width:1000px){.switch-faceplate-grid{grid-template-columns:repeat(12,minmax(18px,1fr))}.printer-hero{grid-template-columns:1fr}}

/* Monitoring V2.4.2: keep device health separate from telemetry freshness. */
.monitor-class-badges{display:flex;gap:.35rem;align-items:center;justify-content:flex-end;flex-wrap:wrap}
.monitor-telemetry-note{color:var(--app-muted)!important}
.monitor-telemetry-note.delayed{color:#946200!important}
[data-bs-theme="dark"] .monitor-telemetry-note.delayed{color:#f3cb68!important}

/* ========================================================================== 
   Helpdesk UI Foundation V2.5 - HTMX + Alpine application shell
   ========================================================================== */
:root {
    --sidebar-width: 200px;
    --topbar-height: 58px;
    --app-radius: .8rem;
    --app-radius-sm: .58rem;
    --app-canvas: #f2f5f9;
    --app-surface-2: #f8fafc;
    --app-border: #dce3ec;
    --app-border-strong: #c8d2df;
    --app-muted: #66758a;
    --app-shadow-sm: 0 1px 3px rgba(15, 23, 42, .05), 0 4px 14px rgba(15, 23, 42, .03);
    --app-shadow: 0 10px 28px rgba(15, 23, 42, .07);
}

[data-bs-theme="dark"] {
    --app-canvas: #171c22;
    --app-surface: #20262d;
    --app-surface-2: #1b2128;
    --app-border: #323c47;
    --app-border-strong: #465362;
    --app-muted: #9eacbb;
}

[x-cloak] { display: none !important; }

body {
    letter-spacing: -.005em;
}

.app-topbar {
    background: linear-gradient(90deg, #001a3d 0%, #00285c 65%, #063973 100%);
    border-bottom: 1px solid rgba(255,255,255,.12);
    padding-inline: .85rem;
    box-shadow: 0 2px 12px rgba(0, 20, 55, .14);
}

.app-topbar-brand {
    min-width: calc(var(--sidebar-width) - 1rem);
    gap: .7rem;
}

.app-topbar-brand img {
    height: 39px;
    max-width: 105px;
    border-radius: .35rem;
}

.app-product-name {
    min-width: 0;
    flex-direction: column;
    line-height: 1.08;
    color: #fff;
}

.app-product-name strong {
    font-size: .77rem;
    letter-spacing: .02em;
}

.app-product-name small {
    color: rgba(255,255,255,.58);
    font-size: .57rem;
    margin-top: .13rem;
    letter-spacing: .025em;
}

.app-global-search {
    width: min(31vw, 330px);
    height: 34px;
    border: 1px solid rgba(255,255,255,.17);
    background: rgba(255,255,255,.09);
    border-radius: .62rem;
    display: flex;
    align-items: center;
    padding-left: .65rem;
    transition: border-color .15s ease, background-color .15s ease, box-shadow .15s ease;
}

.app-global-search:focus-within {
    border-color: rgba(113,181,255,.7);
    background: rgba(255,255,255,.13);
    box-shadow: 0 0 0 3px rgba(49,140,255,.13);
}

.app-global-search > i { color: rgba(255,255,255,.55); font-size: .78rem; }
.app-global-search input { padding-inline: .5rem; font-size: .74rem; }
.app-global-search kbd {
    margin-right: .4rem;
    padding: .05rem .3rem;
    border: 1px solid rgba(255,255,255,.16);
    border-radius: .25rem;
    color: rgba(255,255,255,.55);
    background: rgba(0,0,0,.12);
    font-size: .58rem;
    font-family: inherit;
}

.app-topbar-primary,
.app-topbar-icon,
.app-sidebar-toggle,
.app-user-menu { min-height: 34px; border-radius: .58rem; }
.app-topbar-icon,.app-sidebar-toggle { width: 34px; }

.app-user-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(255,255,255,.12);
    display: inline-grid;
    place-items: center;
    font-size: .72rem;
}

.app-account-menu {
    min-width: 220px;
    border-color: var(--app-border);
    box-shadow: var(--app-shadow);
    border-radius: .75rem;
    padding: .45rem;
}
.app-account-menu .dropdown-item { border-radius: .45rem; font-size: .78rem; }

.app-sidebar {
    background:
        radial-gradient(circle at 15% -10%, rgba(50, 132, 235, .24), transparent 28%),
        linear-gradient(180deg, #001c43 0%, #001735 100%);
    border-right-color: rgba(255,255,255,.08);
}

.app-sidebar-nav { padding: .7rem .65rem 1.2rem; }
.sidebar-section-label {
    color: #78a9dc;
    font-size: .57rem;
    letter-spacing: .105em;
    padding: .8rem .55rem .32rem;
}

.sidebar-link {
    min-height: 39px;
    gap: .62rem;
    margin-bottom: .12rem;
    padding: .42rem .55rem;
    border-radius: .55rem;
    color: #cedced;
    font-size: .76rem;
    font-weight: 560;
}

.sidebar-link-icon {
    width: 26px;
    height: 26px;
    flex: 0 0 26px;
    display: grid;
    place-items: center;
    border-radius: .45rem;
    background: rgba(255,255,255,.045);
    border: 1px solid rgba(255,255,255,.055);
}

.sidebar-link i { width: auto; color: #8ebbe8; font-size: .78rem; }
.sidebar-link:hover {
    background: rgba(255,255,255,.075);
    color: #fff;
}
.sidebar-link:hover .sidebar-link-icon { background: rgba(255,255,255,.075); }
.sidebar-link.active {
    background: linear-gradient(90deg, rgba(45,133,241,.27), rgba(45,133,241,.12));
    box-shadow: inset 2px 0 0 #55a0ff;
}
.sidebar-link.active .sidebar-link-icon {
    background: rgba(58,143,248,.18);
    border-color: rgba(90,163,255,.19);
}

.sidebar-nav-group { margin-top: .2rem; }
.sidebar-group-toggle {
    width: 100%;
    border: 0;
    background: transparent;
    color: #78a9dc;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .8rem .55rem .32rem;
}
.sidebar-group-toggle i {
    font-size: .58rem;
    transition: transform .18s ease;
}
.rotate-180 { transform: rotate(180deg); }
.sidebar-subnav { position: relative; }
.sidebar-subnav::before {
    content: "";
    position: absolute;
    left: 18px;
    top: 5px;
    bottom: 5px;
    width: 1px;
    background: rgba(116,174,234,.16);
}
.sidebar-sublink { padding-left: .72rem; }
.sidebar-sublink .sidebar-link-icon { width: 24px; height: 24px; flex-basis: 24px; }

.app-sidebar-footer {
    padding: .85rem .9rem;
    background: rgba(0,0,0,.08);
}
.app-sidebar-footer > div { display: flex; flex-direction: column; line-height: 1.1; }
.app-sidebar-footer strong { color: #d9e7f6; font-size: .68rem; }
.app-sidebar-footer small { color: #6f91b4; font-size: .56rem; margin-top: .12rem; }

.app-main {
    max-width: 1880px;
    padding: 1.25rem 1.55rem 1.5rem;
}

.page-heading {
    margin-bottom: 1.15rem;
    padding-bottom: .25rem;
}
.page-eyebrow { color: #1c7eea; font-size: .6rem; letter-spacing: .11em; }
.page-heading h1 { font-size: clamp(1.5rem, 1.8vw, 1.95rem); }
.page-heading p,.page-heading .text-muted { max-width: 760px; }

.card {
    box-shadow: var(--app-shadow-sm);
}
.app-card .card-header,
.table-card .card-header {
    min-height: 48px;
    display: flex;
    align-items: center;
}
.metric-card {
    border-color: rgba(146,161,180,.28);
    background: linear-gradient(160deg, var(--app-surface), var(--app-surface-2));
}
.metric-card:hover {
    border-color: rgba(57,135,229,.45);
    box-shadow: 0 8px 22px rgba(31,80,140,.08);
}

.btn { border-radius: .58rem; }
.btn-sm { border-radius: .5rem; }
.form-control,.form-select { border-radius: .55rem; border-color: var(--app-border-strong); }
.table > :not(caption) > * > * { padding-top: .62rem; padding-bottom: .62rem; }
.table thead th {
    color: var(--app-muted);
    font-size: .64rem;
    font-weight: 750;
    text-transform: uppercase;
    letter-spacing: .045em;
    border-bottom-width: 1px;
    background: var(--app-surface-2);
}

/* Django messages become lightweight application toasts. */
.app-toast-stack { z-index: 1095; margin-top: calc(var(--topbar-height) + .35rem); }
.app-toast {
    width: min(360px, calc(100vw - 1.5rem));
    border: 1px solid var(--app-border);
    box-shadow: var(--app-shadow);
    background: color-mix(in srgb, var(--app-surface) 96%, transparent);
    backdrop-filter: blur(12px);
}
.app-toast .toast-header { border-bottom-color: var(--app-border); background: transparent; }
.toast-status-dot { width: 8px; height: 8px; border-radius: 50%; margin-right: .5rem; background: #4c8ed9; }
.toast-success { background: #22a06b; }
.toast-warning { background: #e2a117; }
.toast-error,.toast-danger { background: #d64552; }

/* HTMX request feedback: fast operations feel instant, slower ones stay understandable. */
.app-request-progress {
    position: fixed;
    z-index: 1200;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    pointer-events: none;
    opacity: 0;
    transition: opacity .12s ease;
}
.app-request-progress span {
    display: block;
    width: 34%;
    height: 100%;
    background: linear-gradient(90deg, #38a3ff, #78c5ff);
    box-shadow: 0 0 10px rgba(62,166,255,.55);
    animation: pdps-request-progress 1s ease-in-out infinite;
}
body.htmx-request-active .app-request-progress { opacity: 1; }
@keyframes pdps-request-progress {
    from { transform: translateX(-105%); }
    to { transform: translateX(305%); }
}

.htmx-indicator { opacity: 0; transition: opacity .15s ease; }
.htmx-request .htmx-indicator,
.htmx-request.htmx-indicator { opacity: 1; }

/* Foundation components for upcoming HTMX queue/dashboard work. */
.live-region {
    position: relative;
    min-height: 1px;
}
.live-region-refresh {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    color: var(--app-muted);
    font-size: .65rem;
}
.live-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #22a06b;
    box-shadow: 0 0 0 4px rgba(34,160,107,.1);
}
.app-empty-state {
    padding: 2rem 1rem;
    text-align: center;
    color: var(--app-muted);
}
.app-empty-state-icon {
    width: 42px;
    height: 42px;
    margin: 0 auto .65rem;
    border-radius: .75rem;
    display: grid;
    place-items: center;
    background: var(--app-surface-2);
    border: 1px solid var(--app-border);
}

@media (max-width: 991.98px) {
    :root { --sidebar-width: 248px; }
    .app-sidebar { box-shadow: 18px 0 50px rgba(0,0,0,.25); }
    .app-main { padding: 1rem .9rem 1.25rem; }
}

@media (max-width: 575.98px) {
    .app-topbar { padding-inline: .55rem; }
    .app-main { padding: .8rem .65rem 1rem; }
    .app-topbar-brand { min-width: 0; }
    .app-topbar-brand img { height: 35px; }
}

/* ========================================================================== 
   Helpdesk V2.5.1 - permanent infrastructure navigation + operations overview
   ========================================================================== */
.min-w-0 { min-width: 0; }

/* Infrastructure is a normal permanent sidebar section, not a nested tree. */
.sidebar-nav-group,
.sidebar-group-toggle,
.sidebar-subnav::before { display: none !important; }
.sidebar-sublink { padding-left: .55rem; }
.sidebar-sublink .sidebar-link-icon { width: 26px; height: 26px; flex-basis: 26px; }

.ops-page-heading { margin-bottom: .9rem; }
.ops-live-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin: -.15rem 0 .75rem;
    color: var(--app-muted);
    font-size: .66rem;
}
.ops-live-state,
.ops-live-actions { display: inline-flex; align-items: center; gap: .38rem; }
.ops-live-divider { opacity: .55; }

.ops-collector-alert {
    display: flex;
    align-items: flex-start;
    gap: .85rem;
    padding: .85rem 1rem;
    margin-bottom: 1rem;
    border: 1px solid rgba(226,161,23,.38);
    border-radius: .75rem;
    background: color-mix(in srgb, var(--bs-warning) 10%, var(--app-surface));
    box-shadow: var(--app-shadow-sm);
}
.ops-collector-alert-icon {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    display: grid;
    place-items: center;
    border-radius: .62rem;
    color: #9b6a00;
    background: rgba(226,161,23,.14);
}
[data-bs-theme="dark"] .ops-collector-alert-icon { color: #f0c861; }
.ops-collector-alert-title { font-size: .78rem; font-weight: 750; }
.ops-collector-alert-text { margin-top: .12rem; color: var(--app-muted); font-size: .68rem; line-height: 1.45; }

.ops-metric-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: .7rem;
}
.ops-metric-card {
    min-height: 86px;
    display: flex;
    align-items: center;
    gap: .8rem;
    padding: .8rem .9rem;
    border: 1px solid var(--app-border);
    border-radius: .75rem;
    background: linear-gradient(145deg, var(--app-surface), var(--app-surface-2));
    box-shadow: var(--app-shadow-sm);
}
.ops-metric-primary {
    border-color: color-mix(in srgb, var(--bs-primary) 35%, var(--app-border));
    background: linear-gradient(145deg, color-mix(in srgb, var(--bs-primary) 8%, var(--app-surface)), var(--app-surface));
}
.ops-metric-icon {
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    display: grid;
    place-items: center;
    border-radius: .66rem;
    color: #2d78ca;
    background: rgba(45,120,202,.1);
    font-size: .9rem;
}
.ops-metric-icon.good { color: #198754; background: rgba(25,135,84,.11); }
.ops-metric-icon.warn { color: #a26d00; background: rgba(226,161,23,.13); }
.ops-metric-icon.bad { color: #c73745; background: rgba(220,53,69,.11); }
.ops-metric-icon.muted { color: var(--app-muted); background: var(--app-surface-2); }
.ops-metric-card > div { min-width: 0; display: grid; }
.ops-metric-card strong { font-size: 1.28rem; line-height: 1.05; letter-spacing: -.035em; }
.ops-metric-label { color: var(--app-muted); font-size: .61rem; font-weight: 700; text-transform: uppercase; letter-spacing: .055em; }
.ops-metric-card small { color: var(--app-muted); font-size: .62rem; margin-top: .16rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.ops-section { min-width: 0; }
.ops-section-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 1rem;
    margin-bottom: .7rem;
}
.ops-section-kicker {
    color: #2c83dc;
    font-size: .58rem;
    font-weight: 750;
    letter-spacing: .095em;
    text-transform: uppercase;
    margin-bottom: .14rem;
}
.ops-section-head h2 { margin: 0; font-size: 1rem; font-weight: 760; letter-spacing: -.02em; }
.ops-section-head p { margin: .18rem 0 0; max-width: 780px; color: var(--app-muted); font-size: .67rem; }

.ops-class-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: .75rem;
    align-items: start;
}
.ops-class-card {
    min-width: 0;
    height: 330px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--app-border);
    border-radius: .78rem;
    background: var(--app-surface);
    box-shadow: var(--app-shadow-sm);
}
.ops-class-head {
    min-height: 62px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .65rem;
    padding: .72rem .78rem;
    border-bottom: 1px solid var(--app-border);
    background: linear-gradient(180deg, var(--app-surface-2), var(--app-surface));
}
.ops-class-icon {
    width: 31px;
    height: 31px;
    flex: 0 0 31px;
    display: grid;
    place-items: center;
    border: 1px solid var(--app-border);
    border-radius: .6rem;
    background: var(--app-surface);
    color: #4789ce;
    font-size: .82rem;
}
.ops-class-title { font-size: .76rem; font-weight: 760; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ops-class-subtitle { color: var(--app-muted); font-size: .61rem; margin-top: .08rem; }
.ops-class-badges { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: .25rem; }
.ops-badge {
    display: inline-flex;
    align-items: center;
    min-height: 20px;
    padding: .08rem .38rem;
    border: 1px solid transparent;
    border-radius: 999px;
    font-size: .56rem;
    font-weight: 700;
    white-space: nowrap;
}
.ops-badge.good { color: #18794e; background: rgba(25,135,84,.09); border-color: rgba(25,135,84,.18); }
.ops-badge.stale { color: var(--app-muted); background: var(--app-surface-2); border-color: var(--app-border); }
.ops-badge.issue { color: #946200; background: rgba(255,193,7,.11); border-color: rgba(255,193,7,.22); }
.ops-badge.critical { color: #b42318; background: rgba(220,53,69,.1); border-color: rgba(220,53,69,.2); }
[data-bs-theme="dark"] .ops-badge.good { color: #75d9a7; }
[data-bs-theme="dark"] .ops-badge.issue { color: #f3cb68; }
[data-bs-theme="dark"] .ops-badge.critical { color: #f39aa3; }

.ops-class-list {
    flex: 1 1 auto;
    min-height: 0;
    display: block;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: color-mix(in srgb, var(--app-muted) 55%, transparent) transparent;
}
.ops-class-list::-webkit-scrollbar { width: 6px; }
.ops-class-list::-webkit-scrollbar-track { background: transparent; }
.ops-class-list::-webkit-scrollbar-thumb {
    background: color-mix(in srgb, var(--app-muted) 45%, transparent);
    border-radius: 999px;
}
.ops-class-list::-webkit-scrollbar-thumb:hover {
    background: color-mix(in srgb, var(--app-muted) 65%, transparent);
}
.ops-device-row {
    display: grid;
    grid-template-columns: 8px minmax(0,1fr) auto;
    gap: .58rem;
    align-items: center;
    min-height: 51px;
    padding: .55rem .72rem;
    color: inherit;
    text-decoration: none;
    border-bottom: 1px solid color-mix(in srgb, var(--app-border) 80%, transparent);
    transition: background-color .13s ease;
}
.ops-device-row:last-child { border-bottom: 0; }
.ops-device-row:hover { background: color-mix(in srgb, var(--bs-primary) 5%, transparent); }
.ops-device-main { min-width: 0; }
.ops-device-main strong,
.ops-device-main small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ops-device-main strong { font-size: .68rem; font-weight: 720; }
.ops-device-main small { color: var(--app-muted); font-size: .57rem; margin-top: .03rem; }
.ops-device-main .ops-telemetry { margin-top: .1rem; color: var(--app-muted); }
.ops-device-main .ops-telemetry.delayed { color: #946200; }
[data-bs-theme="dark"] .ops-device-main .ops-telemetry.delayed { color: #f3cb68; }
.ops-device-metric { min-width: 62px; max-width: 116px; text-align: right; }
.ops-device-metric small { color: var(--app-muted); font-size: .57rem; line-height: 1.32; }

.ops-panel { overflow: hidden; }
.ops-panel-head { justify-content: space-between; gap: 1rem; }
.ops-alert-list,
.ops-agent-list,
.ops-incident-list { display: grid; }
.ops-alert-row,
.ops-agent-row,
.ops-incident-row {
    color: inherit;
    text-decoration: none;
    border-bottom: 1px solid var(--app-border);
}
.ops-alert-row:last-child,
.ops-agent-row:last-child,
.ops-incident-row:last-child { border-bottom: 0; }
.ops-alert-row:hover,
.ops-agent-row:hover,
.ops-incident-row:hover { background: color-mix(in srgb, var(--bs-primary) 4%, transparent); }
.ops-alert-row {
    display: grid;
    grid-template-columns: 30px minmax(0,1fr) auto;
    align-items: center;
    gap: .68rem;
    padding: .62rem .78rem;
}
.ops-alert-severity {
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    border-radius: .55rem;
    font-size: .68rem;
}
.ops-alert-severity.warning { color: #a26d00; background: rgba(255,193,7,.12); }
.ops-alert-severity.critical { color: #bd2f3e; background: rgba(220,53,69,.11); }
.ops-alert-severity.info { color: #2676c7; background: rgba(13,110,253,.09); }
.ops-alert-copy { min-width: 0; }
.ops-alert-copy strong,
.ops-alert-copy small { display: block; }
.ops-alert-copy strong { font-size: .69rem; }
.ops-alert-copy small { color: var(--app-muted); font-size: .59rem; margin-top: .08rem; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.ops-alert-meta { display: inline-flex; align-items: center; gap: .42rem; color: var(--app-muted); font-size: .6rem; }

.ops-agent-row {
    display: grid;
    grid-template-columns: 32px minmax(0,1fr) auto;
    align-items: center;
    gap: .65rem;
    padding: .62rem .75rem;
}
.ops-agent-icon {
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    border-radius: .55rem;
    color: var(--app-muted);
    background: var(--app-surface-2);
    border: 1px solid var(--app-border);
}
.ops-agent-icon.online { color: #198754; background: rgba(25,135,84,.09); border-color: rgba(25,135,84,.18); }
.ops-agent-icon.offline { color: #b42318; background: rgba(220,53,69,.08); border-color: rgba(220,53,69,.16); }
.ops-agent-icon.maintenance { color: #0b63a5; background: rgba(13,110,253,.08); border-color: rgba(13,110,253,.16); }
.ops-agent-copy { min-width: 0; }
.ops-agent-copy strong,
.ops-agent-copy small { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.ops-agent-copy strong { font-size: .68rem; }
.ops-agent-copy small { color: var(--app-muted); font-size: .57rem; margin-top: .05rem; }

.ops-incident-row {
    display: grid;
    grid-template-columns: 8px minmax(0,1fr) auto;
    align-items: center;
    gap: .58rem;
    padding: .58rem .75rem;
}
.ops-incident-row strong,
.ops-incident-row small { display: block; }
.ops-incident-row strong { font-size: .66rem; }
.ops-incident-row small { color: var(--app-muted); font-size: .56rem; margin-top: .04rem; }
.ops-incident-row > i { color: var(--app-muted); font-size: .62rem; }

.ops-table-card { overflow: hidden; }
.ops-device-table td { font-size: .67rem; }
.ops-device-table .ticket-link { font-weight: 720; }
.ops-last-ping {
    display: grid;
    justify-items: start;
    gap: .22rem;
    min-width: 88px;
}
.ops-last-ping > strong {
    line-height: 1.05;
    white-space: nowrap;
}
.ops-last-ping .monitor-last-five {
    display: flex;
    flex-wrap: nowrap;
    gap: .22rem;
    margin-top: 0 !important;
}
.ops-last-ping .monitor-ping {
    width: 8px;
    height: 8px;
    flex: 0 0 8px;
    box-shadow: none;
}
.ops-telemetry-pill {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    padding: .16rem .4rem;
    border: 1px solid var(--app-border);
    border-radius: 999px;
    color: var(--app-muted);
    background: var(--app-surface-2);
    font-size: .57rem;
    font-weight: 650;
    white-space: nowrap;
}
.ops-telemetry-pill.live { color: #18794e; border-color: rgba(25,135,84,.18); background: rgba(25,135,84,.08); }
.ops-telemetry-pill.delayed { color: #946200; border-color: rgba(255,193,7,.2); background: rgba(255,193,7,.09); }
[data-bs-theme="dark"] .ops-telemetry-pill.live { color: #75d9a7; }
[data-bs-theme="dark"] .ops-telemetry-pill.delayed { color: #f3cb68; }
.ops-table-footer {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: .45rem;
    min-height: 35px;
    padding: .45rem .75rem;
    border-top: 1px solid var(--app-border);
    color: var(--app-muted);
    background: var(--app-surface-2);
    font-size: .6rem;
}

@media (max-width: 1499.98px) {
    .ops-class-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .ops-class-card { height: 320px; }
}
@media (max-width: 1199.98px) {
    .ops-metric-grid { grid-template-columns: repeat(3, minmax(0,1fr)); }
    .ops-class-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 767.98px) {
    .ops-class-card { height: auto; }
    .ops-class-list { overflow: visible; }
    .ops-live-toolbar,
    .ops-section-head,
    .ops-collector-alert { align-items: flex-start; }
    .ops-live-toolbar { flex-direction: column; gap: .25rem; }
    .ops-collector-alert { flex-wrap: wrap; }
    .ops-metric-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
    .ops-class-grid { grid-template-columns: 1fr; }
    .ops-section-head { flex-direction: column; }
}
@media (max-width: 479.98px) {
    .ops-metric-grid { grid-template-columns: 1fr; }
    .ops-alert-meta .ops-badge { display: none; }
}

/* ======================================================================
   Helpdesk V2.6 - unified service desk workspace
   ====================================================================== */
[x-cloak] { display: none !important; }

.service-period-bar { margin-bottom: .85rem; }
.helpdesk-live-toolbar { margin-bottom: .7rem; }
.helpdesk-ops-metrics { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.helpdesk-ops-metrics .ops-metric-card { transition: border-color .12s ease, transform .12s ease, background .12s ease; }
.helpdesk-ops-metrics a.ops-metric-card:hover { border-color: color-mix(in srgb, var(--bs-primary) 36%, var(--app-border)); transform: translateY(-1px); }
.helpdesk-team-live-list { display: grid; }
.helpdesk-team-live-row { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: .75rem; align-items: center; min-height: 54px; padding: .65rem .8rem; border-bottom: 1px solid var(--app-border); color: inherit; text-decoration: none; }
.helpdesk-team-live-row:last-child { border-bottom: 0; }
.helpdesk-team-live-row:hover { background: color-mix(in srgb, var(--bs-primary) 4%, transparent); }
.helpdesk-team-live-row strong, .helpdesk-team-live-row small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.helpdesk-team-live-row strong { font-size: .72rem; }
.helpdesk-team-live-row small { color: var(--app-muted); font-size: .59rem; margin-top: .08rem; }
.helpdesk-team-live-stats { display: grid; grid-template-columns: auto auto; gap: 0 .3rem; align-items: baseline; text-align: right; }
.helpdesk-team-live-stats b { font-size: .95rem; }
.helpdesk-team-live-stats small { font-size: .56rem; text-transform: uppercase; letter-spacing: .04em; }
.helpdesk-team-live-stats em { grid-column: 1 / -1; color: #bd2f3e; font-style: normal; font-size: .57rem; font-weight: 700; }
.helpdesk-ticket-title { max-width: 330px; }
.helpdesk-live-ticket-table td { font-size: .68rem; }

.service-indicator-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: .6rem; }
.service-indicator { border: 1px solid var(--app-border); border-radius: .55rem; background: var(--app-surface-2); padding: .7rem .75rem; min-width: 0; }
.service-indicator span, .service-indicator strong, .service-indicator small { display: block; }
.service-indicator span { color: var(--app-muted); font-size: .6rem; text-transform: uppercase; letter-spacing: .045em; font-weight: 700; }
.service-indicator strong { margin-top: .12rem; font-size: 1.05rem; }
.service-indicator small { color: var(--app-muted); font-size: .58rem; margin-top: .1rem; }
.ageing-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: .55rem; }
.ageing-grid > div { border: 1px solid var(--app-border); border-radius: .55rem; background: var(--app-surface-2); padding: .8rem; text-align: center; }
.ageing-grid span, .ageing-grid strong { display: block; }
.ageing-grid span { color: var(--app-muted); font-size: .62rem; }
.ageing-grid strong { font-size: 1.2rem; margin-top: .15rem; }
.ageing-grid .ageing-danger { border-color: rgba(220,53,69,.28); background: rgba(220,53,69,.06); }
.ageing-grid .ageing-danger strong { color: #bd2f3e; }
.compact-list .list-group-item { background: transparent; color: inherit; border-color: var(--app-border); }

.ticket-page-heading { margin-bottom: .8rem; }
.ticket-summary-card { overflow: hidden; }
.ticket-summary-card > .card-body { padding: .85rem !important; }
.ticket-live-summary-head { display: flex; justify-content: space-between; gap: 1rem; align-items: center; padding: .05rem .05rem .7rem; border-bottom: 1px solid var(--app-border); margin-bottom: .75rem; }
.ticket-meta-grid-compact { grid-template-columns: repeat(4,minmax(0,1fr)); margin-bottom: 0 !important; }
.ticket-meta-grid-compact .ticket-meta-item { min-height: 68px; padding: .6rem .65rem; }
.ticket-first-response-card { border-color: color-mix(in srgb, var(--bs-primary) 22%, var(--app-border)); }
.ticket-description-card .ticket-description { line-height: 1.65; }
.ticket-resolution-banner { border: 1px solid rgba(25,135,84,.28); background: rgba(25,135,84,.055); border-radius: .6rem; padding: .7rem .85rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.ticket-resolution-banner strong, .ticket-resolution-banner small { display: block; }
.ticket-resolution-banner small { color: var(--app-muted); margin-top: .08rem; }
.ticket-conversation-card { padding: .75rem 1rem 1rem; }
.ticket-conversation-live-head { display: flex; justify-content: space-between; gap: .75rem; align-items: center; color: var(--app-muted); font-size: .59rem; padding: 0 0 .65rem; }
.ticket-conversation-timeline .timeline-body { box-shadow: none; }
.ticket-composer-tabs { display: flex; align-items: center; gap: .3rem; padding: .45rem .55rem; background: var(--app-surface-2); }
.ticket-composer-tab { border: 1px solid transparent; background: transparent; color: var(--app-muted); border-radius: .42rem; font-size: .7rem; font-weight: 700; padding: .4rem .65rem; }
.ticket-composer-tab:hover { color: var(--bs-body-color); background: var(--app-surface); }
.ticket-composer-tab.active { color: var(--bs-primary); border-color: color-mix(in srgb, var(--bs-primary) 25%, var(--app-border)); background: var(--app-surface); box-shadow: var(--app-shadow-sm); }
.ticket-side-stack .card { overflow: hidden; }
.ticket-person-row { display: flex; align-items: center; justify-content: space-between; gap: .6rem; border: 1px solid var(--app-border); border-radius: .45rem; padding: .5rem .6rem; background: var(--app-surface-2); }
.ticket-person-row strong, .ticket-person-row small { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.ticket-person-row strong { font-size: .67rem; }
.ticket-person-row small { color: var(--app-muted); font-size: .56rem; }
.app-accordion .accordion-item { border-color: var(--app-border); background: var(--app-surface); color: inherit; }
.app-accordion .accordion-button { background: var(--app-surface); color: inherit; font-size: .72rem; font-weight: 700; }
.app-accordion .accordion-button:not(.collapsed) { background: var(--app-surface-2); color: var(--bs-primary); box-shadow: none; }

/* Consistent list/filter shell across Helpdesk and Infrastructure */
.workspace-filter { border: 1px solid var(--app-border); border-radius: .65rem; background: var(--app-surface); padding: .7rem; margin-bottom: .85rem; }
.workspace-filter .form-label { color: var(--app-muted); font-size: .61rem; font-weight: 700; margin-bottom: .25rem; }
.workspace-table-card { overflow: hidden; }
.workspace-table-card .table { margin-bottom: 0; }
.workspace-table-card .table thead th { font-size: .58rem; letter-spacing: .045em; text-transform: uppercase; color: var(--app-muted); }
.workspace-toolbar { display: flex; justify-content: space-between; gap: 1rem; align-items: center; margin-bottom: .75rem; }
.workspace-toolbar-copy strong, .workspace-toolbar-copy small { display: block; }
.workspace-toolbar-copy small { color: var(--app-muted); font-size: .62rem; }

.kb-card-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: .8rem; }
.kb-modern-card { border: 1px solid var(--app-border); border-radius: .65rem; background: var(--app-surface); padding: .9rem; min-width: 0; box-shadow: var(--app-shadow-sm); }
.kb-modern-card h2 { font-size: .88rem; margin: .35rem 0 .3rem; }
.kb-modern-card p { color: var(--app-muted); font-size: .66rem; line-height: 1.5; min-height: 3em; }

@media (max-width: 1199.98px) {
  .helpdesk-ops-metrics { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .ticket-meta-grid-compact { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .kb-card-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 767.98px) {
  .helpdesk-ops-metrics { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .ageing-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .service-indicator-grid { grid-template-columns: 1fr; }
  .ticket-live-summary-head, .ticket-resolution-banner { align-items: flex-start; flex-direction: column; }
  .ticket-meta-grid-compact { grid-template-columns: 1fr; }
  .kb-card-grid { grid-template-columns: 1fr; }
}
@media (max-width: 480px) { .helpdesk-ops-metrics { grid-template-columns: 1fr; } }
