/*
 * WebbMTS Unified Module Stylesheet
 * Shared module-level UI aligned to Stitch references.
 */

:root {
    --module-gap: 12px;
    --module-stack-gap: 12px;
    --module-radius: 12px;
    --module-card-padding: 14px;
    --kpi-status-green: #34d399;
    --kpi-status-amber: #f59e0b;
    --kpi-status-red: #ef4444;
}

.admin-section {
    background: transparent;
}

/* Global vertical rhythm for module content blocks */
.admin-section > h2 {
    margin: 0 0 var(--module-stack-gap) !important;
}

/* Topbar is now the canonical module header */
.admin-section > h2 {
    display: none !important;
}

/* Unified vertical stack rhythm inside primary module content areas */
#inv-local-view-assets > * + *,
#devices-list-view > * + *,
.network-sub-view > * + *,
.depthub-sub-view > * + * {
    margin-top: var(--module-stack-gap) !important;
}

#inv-local-view-assets :is(h3, h4),
#devices-list-view :is(h3, h4),
.network-sub-view :is(h3, h4),
.depthub-sub-view :is(h3, h4) {
    margin-bottom: 0;
}

/* Shared top summary/info cards */
.module-kpi-card,
.depthub-summary-card,
.network-summary-card,
.dashboard-widget-stat-card,
.helpdesk-meta-card,
.dashboard-home-panel,
.system-license-status,
.system-license-availability {
    background: var(--surface-panel-alt) !important;
    border: 0 !important;
    border-radius: var(--module-radius);
}

.module-kpi-card,
.depthub-summary-card,
.network-summary-card,
.dashboard-widget-stat-card {
    padding: var(--module-card-padding);
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    min-height: 102px;
    box-shadow: 0 0 0 1px rgba(148, 163, 184, 0.08), 0 8px 18px rgba(2, 8, 23, 0.22);
}

.wmts-kpi-card-with-icon {
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 14px;
}

.wmts-kpi-card-icon {
    width: 48px;
    height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    color: var(--kpi-icon-color, var(--text-primary));
    background: color-mix(in srgb, var(--kpi-icon-color, var(--border-panel)) 16%, transparent);
    border: 0;
    box-shadow: 0 0 0 1px rgba(148, 163, 184, 0.1), 0 10px 18px rgba(2, 8, 23, 0.28);
    flex: 0 0 48px;
}

.wmts-kpi-card-icon svg {
    width: 28px;
    height: 28px;
    stroke: currentColor;
    fill: none;
}

.wmts-kpi-card-body {
    display: flex;
    flex-direction: column;
    gap: 4px;
    text-align: left;
}

/* Stitch-like tint variation for KPI strips */
.module-kpi-grid.use-kpi-tint > .module-kpi-card:nth-child(1) {
    background: var(--kpi-card-1-bg) !important;
    border-color: var(--kpi-card-1-border) !important;
    box-shadow: 0 0 0 1px var(--kpi-card-1-ring), 0 0 18px var(--kpi-card-1-glow), 0 8px 18px rgba(2, 8, 23, 0.22);
    --kpi-icon-color: var(--kpi-card-1-border);
}

.depthub-summary-grid > .depthub-summary-card:nth-child(1),
.network-summary-grid > .network-summary-card:nth-child(1),
.network-summary-grid > .network-summary-card:nth-child(5) {
    background: var(--kpi-card-1-bg) !important;
    border-color: var(--kpi-card-1-border) !important;
    box-shadow: 0 0 0 1px var(--kpi-card-1-ring), 0 0 18px var(--kpi-card-1-glow), 0 8px 18px rgba(2, 8, 23, 0.22);
}

.module-kpi-grid.use-kpi-tint > .module-kpi-card:nth-child(2) {
    background: var(--kpi-card-2-bg) !important;
    border-color: var(--kpi-card-2-border) !important;
    box-shadow: 0 0 0 1px var(--kpi-card-2-ring), 0 0 18px var(--kpi-card-2-glow), 0 8px 18px rgba(2, 8, 23, 0.22);
    --kpi-icon-color: var(--kpi-card-2-border);
}

.depthub-summary-grid > .depthub-summary-card:nth-child(2),
.network-summary-grid > .network-summary-card:nth-child(2),
.network-summary-grid > .network-summary-card:nth-child(6) {
    background: var(--kpi-card-2-bg) !important;
    border-color: var(--kpi-card-2-border) !important;
    box-shadow: 0 0 0 1px var(--kpi-card-2-ring), 0 0 18px var(--kpi-card-2-glow), 0 8px 18px rgba(2, 8, 23, 0.22);
}

.module-kpi-grid.use-kpi-tint > .module-kpi-card:nth-child(3) {
    background: var(--kpi-card-3-bg) !important;
    border-color: var(--kpi-card-3-border) !important;
    box-shadow: 0 0 0 1px var(--kpi-card-3-ring), 0 0 18px var(--kpi-card-3-glow), 0 8px 18px rgba(2, 8, 23, 0.22);
    --kpi-icon-color: var(--kpi-card-3-border);
}

.depthub-summary-grid > .depthub-summary-card:nth-child(3),
.network-summary-grid > .network-summary-card:nth-child(3) {
    background: var(--kpi-card-3-bg) !important;
    border-color: var(--kpi-card-3-border) !important;
    box-shadow: 0 0 0 1px var(--kpi-card-3-ring), 0 0 18px var(--kpi-card-3-glow), 0 8px 18px rgba(2, 8, 23, 0.22);
}

.module-kpi-grid.use-kpi-tint > .module-kpi-card:nth-child(4) {
    background: var(--kpi-card-4-bg) !important;
    border-color: var(--kpi-card-4-border) !important;
    box-shadow: 0 0 0 1px var(--kpi-card-4-ring), 0 0 18px var(--kpi-card-4-glow), 0 8px 18px rgba(2, 8, 23, 0.22);
    --kpi-icon-color: var(--kpi-card-4-border);
}

.depthub-summary-grid > .depthub-summary-card:nth-child(4),
.network-summary-grid > .network-summary-card:nth-child(4) {
    background: var(--kpi-card-4-bg) !important;
    border-color: var(--kpi-card-4-border) !important;
    box-shadow: 0 0 0 1px var(--kpi-card-4-ring), 0 0 18px var(--kpi-card-4-glow), 0 8px 18px rgba(2, 8, 23, 0.22);
}

/* Dept Hub summary semantic colors */
.depthub-summary-grid > .depthub-summary-card.is-claimed {
    background: #4c3b1f !important;
    border-color: #7a5a1a !important;
    box-shadow: 0 0 0 1px rgba(250, 204, 21, 0.18), 0 0 9px rgba(245, 158, 11, 0.18), 0 8px 18px rgba(2, 8, 23, 0.22);
    --kpi-icon-color: var(--kpi-status-amber);
}

.depthub-summary-grid > .depthub-summary-card.is-open {
    background: #3b2326 !important;
    border-color: #522e33 !important;
    box-shadow: 0 0 0 1px rgba(248, 113, 113, 0.18), 0 0 9px rgba(239, 68, 68, 0.18), 0 8px 18px rgba(2, 8, 23, 0.22);
    --kpi-icon-color: var(--kpi-status-red);
}

body[data-theme-mode="light"] .depthub-summary-grid > .depthub-summary-card.is-claimed {
    background: #fff5e5 !important;
    border-color: #f6d9a6 !important;
    box-shadow: 0 0 0 1px rgba(245, 158, 11, 0.18), 0 0 9px rgba(245, 158, 11, 0.14), 0 8px 18px rgba(2, 8, 23, 0.12);
    --kpi-icon-color: var(--kpi-status-amber);
}

body[data-theme-mode="light"] .depthub-summary-grid > .depthub-summary-card.is-open {
    background: #ffdfe4 !important;
    border-color: #f2a6b1 !important;
    box-shadow: 0 0 0 1px rgba(239, 68, 68, 0.18), 0 0 9px rgba(239, 68, 68, 0.14), 0 8px 18px rgba(2, 8, 23, 0.12);
    --kpi-icon-color: var(--kpi-status-red);
}

/* Unified status KPI colors across all modules (cards only) */
.module-kpi-card.is-assigned,
.module-kpi-grid > .module-kpi-card.is-assigned,
.network-summary-card.is-up {
    background: #1b3531 !important;
    border-color: transparent !important;
    box-shadow: 0 0 9px rgba(16, 185, 129, 0.18), 0 8px 18px rgba(2, 8, 23, 0.22);
    --kpi-icon-color: var(--kpi-status-green);
}

.module-kpi-card.is-open,
.module-kpi-card.is-claimed,
.module-kpi-grid > .module-kpi-card.is-open,
.module-kpi-grid > .module-kpi-card.is-claimed,
.network-summary-card.is-alerts {
    background: #4c3b1f !important;
    border-color: transparent !important;
    box-shadow: 0 0 9px rgba(245, 158, 11, 0.18), 0 8px 18px rgba(2, 8, 23, 0.22);
    --kpi-icon-color: var(--kpi-status-amber);
}

.module-kpi-card.is-warranty,
.module-kpi-grid > .module-kpi-card.is-warranty,
.network-summary-card.is-down {
    background: #3b2326 !important;
    border-color: transparent !important;
    box-shadow: 0 0 9px rgba(239, 68, 68, 0.18), 0 8px 18px rgba(2, 8, 23, 0.22);
    --kpi-icon-color: var(--kpi-status-red);
}

/* Light theme: soften status KPI cards */
body[data-theme-mode="light"] .module-kpi-card.is-assigned,
body[data-theme-mode="light"] .module-kpi-grid > .module-kpi-card.is-assigned,
body[data-theme-mode="light"] .network-summary-card.is-up {
    background: #def2e7 !important;
    border-color: #b4e2cb !important;
    box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.18), 0 0 9px rgba(34, 197, 94, 0.14), 0 8px 18px rgba(2, 8, 23, 0.12);
    --kpi-icon-color: var(--kpi-status-green);
}

body[data-theme-mode="light"] .module-kpi-card.is-open,
body[data-theme-mode="light"] .module-kpi-card.is-claimed,
body[data-theme-mode="light"] .module-kpi-grid > .module-kpi-card.is-open,
body[data-theme-mode="light"] .module-kpi-grid > .module-kpi-card.is-claimed,
body[data-theme-mode="light"] .network-summary-card.is-alerts {
    background: #fff5e5 !important;
    border-color: #f6d9a6 !important;
    box-shadow: 0 0 0 1px rgba(245, 158, 11, 0.18), 0 0 9px rgba(245, 158, 11, 0.14), 0 8px 18px rgba(2, 8, 23, 0.12);
    --kpi-icon-color: var(--kpi-status-amber);
}

body[data-theme-mode="light"] .module-kpi-card.is-warranty,
body[data-theme-mode="light"] .module-kpi-grid > .module-kpi-card.is-warranty,
body[data-theme-mode="light"] .network-summary-card.is-down {
    background: #ffdfe4 !important;
    border-color: #f2a6b1 !important;
    box-shadow: 0 0 0 1px rgba(239, 68, 68, 0.18), 0 0 9px rgba(239, 68, 68, 0.14), 0 8px 18px rgba(2, 8, 23, 0.12);
    --kpi-icon-color: var(--kpi-status-red);
}

/* Neutral KPI cards: follow table alternating colors per theme */
.module-kpi-grid > .module-kpi-card:not(.is-assigned):not(.is-open):not(.is-warranty):not(.is-claimed):not(.is-alerts):not(.is-down):not(.is-up) {
    background: var(--table-row-bg-strong) !important;
    border-color: var(--table-border-strong) !important;
    box-shadow: 0 0 0 1px rgba(148, 163, 184, 0.08), 0 8px 18px rgba(2, 8, 23, 0.22);
    --kpi-icon-color: var(--text-primary);
}

.module-kpi-grid > .module-kpi-card:not(.is-assigned):not(.is-open):not(.is-warranty):not(.is-claimed):not(.is-alerts):not(.is-down):not(.is-up) .module-kpi-label,
.module-kpi-grid > .module-kpi-card:not(.is-assigned):not(.is-open):not(.is-warranty):not(.is-claimed):not(.is-alerts):not(.is-down):not(.is-up) .module-kpi-value {
    color: var(--sidebar-text) !important;
}

.module-kpi-grid > .module-kpi-card:not(.is-assigned):not(.is-open):not(.is-warranty):not(.is-claimed):not(.is-alerts):not(.is-down):not(.is-up) .wmts-kpi-card-icon {
    color: var(--text-primary) !important;
}

.module-kpi-grid > .module-kpi-card:not(.is-assigned):not(.is-open):not(.is-warranty):not(.is-claimed):not(.is-alerts):not(.is-down):not(.is-up):nth-child(even) {
    background: var(--table-row-even-strong) !important;
}

.depthub-summary-grid > .depthub-summary-card:not(.is-claimed):not(.is-open) {
    background: var(--table-row-bg-strong) !important;
    border-color: var(--table-border-strong) !important;
    box-shadow: 0 0 0 1px rgba(148, 163, 184, 0.08), 0 8px 18px rgba(2, 8, 23, 0.22);
    --kpi-icon-color: var(--text-primary);
}

.depthub-summary-grid > .depthub-summary-card:not(.is-claimed):not(.is-open):nth-child(even) {
    background: var(--table-row-even-strong) !important;
}

/* QuickCheck KPI third card = danger */
#view-events .module-kpi-grid > .module-kpi-card:nth-child(3),
#view-quickcheck .module-kpi-grid > .module-kpi-card:nth-child(3) {
    background: var(--kpi-card-4-bg) !important;
    border-color: var(--kpi-card-4-border) !important;
    box-shadow: 0 0 0 1px var(--kpi-card-4-ring), 0 0 18px var(--kpi-card-4-glow), 0 8px 18px rgba(2, 8, 23, 0.22);
}

/* Device Management KPI semantic colors */
#view-devices .module-kpi-card.is-assigned {
    background: #1b3531 !important;
    border-color: #234942 !important;
    box-shadow: 0 0 0 1px rgba(52, 211, 153, 0.18), 0 0 9px rgba(16, 185, 129, 0.18), 0 8px 18px rgba(2, 8, 23, 0.22);
    --kpi-icon-color: var(--kpi-status-green);
}

#view-devices .module-kpi-card.is-open {
    background: #4c3b1f !important;
    border-color: #7a5a1a !important;
    box-shadow: 0 0 0 1px rgba(250, 204, 21, 0.18), 0 0 9px rgba(245, 158, 11, 0.18), 0 8px 18px rgba(2, 8, 23, 0.22);
    --kpi-icon-color: var(--kpi-status-amber);
}

#view-devices .module-kpi-card.is-warranty {
    background: #3b2326 !important;
    border-color: #522e33 !important;
    box-shadow: 0 0 0 1px rgba(248, 113, 113, 0.18), 0 0 9px rgba(239, 68, 68, 0.18), 0 8px 18px rgba(2, 8, 23, 0.22);
    --kpi-icon-color: var(--kpi-status-red);
}

body[data-theme-mode="light"] #view-devices .module-kpi-card.is-assigned {
    background: #def2e7 !important;
    border-color: #b4e2cb !important;
    box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.18), 0 0 9px rgba(34, 197, 94, 0.14), 0 8px 18px rgba(2, 8, 23, 0.12);
    --kpi-icon-color: var(--kpi-status-green);
}

body[data-theme-mode="light"] #view-devices .module-kpi-card.is-open {
    background: #fff5e5 !important;
    border-color: #f6d9a6 !important;
    box-shadow: 0 0 0 1px rgba(245, 158, 11, 0.18), 0 0 9px rgba(245, 158, 11, 0.14), 0 8px 18px rgba(2, 8, 23, 0.12);
    --kpi-icon-color: var(--kpi-status-amber);
}

body[data-theme-mode="light"] #view-devices .module-kpi-card.is-warranty {
    background: #ffdfe4 !important;
    border-color: #f2a6b1 !important;
    box-shadow: 0 0 0 1px rgba(239, 68, 68, 0.18), 0 0 9px rgba(239, 68, 68, 0.14), 0 8px 18px rgba(2, 8, 23, 0.12);
    --kpi-icon-color: var(--kpi-status-red);
}

/* Extra depth on icon tiles for red/amber/green KPI cards */
.module-kpi-card.is-assigned .wmts-kpi-card-icon,
.module-kpi-card.is-open .wmts-kpi-card-icon,
.module-kpi-card.is-claimed .wmts-kpi-card-icon,
.module-kpi-card.is-warranty .wmts-kpi-card-icon,
.network-summary-card.is-up .wmts-kpi-card-icon,
.network-summary-card.is-alerts .wmts-kpi-card-icon,
.network-summary-card.is-down .wmts-kpi-card-icon,
.depthub-summary-card.is-claimed .wmts-kpi-card-icon,
.depthub-summary-card.is-open .wmts-kpi-card-icon {
    box-shadow: 0 0 0 1px rgba(148, 163, 184, 0.1), 0 12px 20px rgba(2, 8, 23, 0.45);
}

/* Maps summary semantic colors */
.maps-summary-grid > .network-summary-card.is-total-maps,
.maps-summary-grid > .network-summary-card.is-locations {
    background: var(--table-row-bg-strong) !important;
    border-color: var(--table-border-strong) !important;
    box-shadow: 0 0 0 1px rgba(148, 163, 184, 0.08), 0 8px 18px rgba(2, 8, 23, 0.22);
    --kpi-icon-color: var(--text-primary);
}

.maps-summary-grid > .network-summary-card.is-locations {
    background: var(--table-row-even-strong) !important;
}

.maps-summary-grid > .network-summary-card.is-up {
    background: #1b3531 !important;
    border-color: #234942 !important;
    box-shadow: 0 0 0 1px rgba(52, 211, 153, 0.18), 0 0 18px rgba(16, 185, 129, 0.18), 0 8px 18px rgba(2, 8, 23, 0.22);
    --kpi-icon-color: #34d399;
}

.maps-summary-grid > .network-summary-card.is-alerts {
    background: #4c3b1f !important;
    border-color: #7a5a1a !important;
    box-shadow: 0 0 0 1px rgba(250, 204, 21, 0.18), 0 0 18px rgba(245, 158, 11, 0.18), 0 8px 18px rgba(2, 8, 23, 0.22);
    --kpi-icon-color: #f59e0b;
}

.maps-summary-grid > .network-summary-card.is-down {
    background: #3b2326 !important;
    border-color: #522e33 !important;
    box-shadow: 0 0 0 1px rgba(248, 113, 113, 0.18), 0 0 18px rgba(239, 68, 68, 0.18), 0 8px 18px rgba(2, 8, 23, 0.22);
    --kpi-icon-color: #ef4444;
}

body[data-theme-mode="light"] .maps-summary-grid > .network-summary-card.is-up {
    background: #def2e7 !important;
    border-color: #b4e2cb !important;
    box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.18), 0 0 18px rgba(34, 197, 94, 0.14), 0 8px 18px rgba(2, 8, 23, 0.12);
    --kpi-icon-color: #22c55e;
}

body[data-theme-mode="light"] .maps-summary-grid > .network-summary-card.is-alerts {
    background: #fff5e5 !important;
    border-color: #f6d9a6 !important;
    box-shadow: 0 0 0 1px rgba(245, 158, 11, 0.18), 0 0 18px rgba(245, 158, 11, 0.14), 0 8px 18px rgba(2, 8, 23, 0.12);
    --kpi-icon-color: #f59e0b;
}

body[data-theme-mode="light"] .maps-summary-grid > .network-summary-card.is-down {
    background: #ffdfe4 !important;
    border-color: #f2a6b1 !important;
    box-shadow: 0 0 0 1px rgba(239, 68, 68, 0.18), 0 0 18px rgba(239, 68, 68, 0.14), 0 8px 18px rgba(2, 8, 23, 0.12);
    --kpi-icon-color: #ef4444;
}

/* Network monitoring KPI overrides */
.network-summary-grid > .network-summary-card.is-total {
    background: var(--table-row-bg-strong) !important;
    border-color: var(--table-border-strong) !important;
    box-shadow: 0 0 0 1px rgba(148, 163, 184, 0.08), 0 8px 18px rgba(2, 8, 23, 0.22);
    --kpi-icon-color: var(--text-primary);
}

.network-summary-grid > .network-summary-card.is-up {
    background: #1b3531 !important;
    border-color: #234942 !important;
    box-shadow: 0 0 0 1px rgba(52, 211, 153, 0.18), 0 0 18px rgba(16, 185, 129, 0.18), 0 8px 18px rgba(2, 8, 23, 0.22);
    --kpi-icon-color: #34d399;
}

.network-summary-grid > .network-summary-card.is-alerts {
    background: #4c3b1f !important;
    border-color: #7a5a1a !important;
    box-shadow: 0 0 0 1px rgba(250, 204, 21, 0.18), 0 0 18px rgba(245, 158, 11, 0.18), 0 8px 18px rgba(2, 8, 23, 0.22);
    --kpi-icon-color: #f59e0b;
}

.network-summary-grid > .network-summary-card.is-down {
    background: #3b2326 !important;
    border-color: #522e33 !important;
    box-shadow: 0 0 0 1px rgba(248, 113, 113, 0.18), 0 0 18px rgba(239, 68, 68, 0.18), 0 8px 18px rgba(2, 8, 23, 0.22);
    --kpi-icon-color: #ef4444;
}

.module-kpi-strip,
.module-kpi-grid,
.depthub-summary-grid,
.network-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 12px;
}

/* Per-user display preference: hide top summary cards */
body.wmts-hide-summary-cards .module-kpi-strip,
body.wmts-hide-summary-cards .network-summary-grid,
body.wmts-hide-summary-cards .depthub-summary-grid,
body.wmts-hide-summary-cards .helpdesk-meta-card {
    display: none !important;
}

.module-kpi-strip {
    margin: 0 0 var(--module-stack-gap);
}

.module-kpi-grid {
    width: 100%;
}

.module-kpi-label,
.depthub-summary-card span,
.network-summary-card span,
.helpdesk-meta-column span,
.dashboard-home-panel p,
.system-license-kv span {
    color: var(--text-muted) !important;
    font-size: 11px;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    font-weight: 600;
}

.module-kpi-value,
.depthub-summary-card strong,
.network-summary-card strong,
.dashboard-widget-stat-value,
.helpdesk-meta-column strong,
.dashboard-home-panel h3,
.system-license-kv strong,
.system-license-availability-name {
    color: var(--text-primary) !important;
}

.module-kpi-value,
.depthub-summary-card strong,
.network-summary-card strong {
    font-size: 28px;
    line-height: 1.1;
    font-weight: 700;
}

.helpdesk-meta-divider {
    background: var(--border-panel) !important;
}

.helpdesk-bulk-toolbar {
    background: var(--surface-panel-alt) !important;
    border: 1px solid var(--border-panel) !important;
    border-radius: var(--module-radius);
}

#view-helpdesk .helpdesk-meta-card,
#view-helpdesk .helpdesk-bulk-toolbar {
    background: var(--helpdesk-config-panel-bg) !important;
    border-color: var(--helpdesk-config-panel-border) !important;
}

#view-helpdesk .helpdesk-meta-divider {
    background: var(--helpdesk-config-panel-border) !important;
}

#view-helpdesk .helpdesk-meta-column strong {
    color: var(--text-primary) !important;
}

#view-helpdesk .helpdesk-meta-column span {
    color: var(--text-secondary) !important;
}

#view-helpdesk #helpdesk-ticket-detail-page {
    min-width: 0;
}

#view-helpdesk .helpdesk-ticket-detail-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: nowrap;
    margin-bottom: 12px;
}

#view-helpdesk .helpdesk-ticket-detail-toolbar-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex: 1 1 auto;
    margin-left: auto;
    min-width: 0;
    flex-wrap: wrap;
}

#view-helpdesk #helpdesk-ticket-list-toolbar-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
}

#view-helpdesk #helpdesk-ticket-list-toolbar-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: nowrap;
    margin-left: auto;
}

#view-helpdesk .helpdesk-ticket-detail-toolbar > .wmts-helpdesk-ticket-back-btn,
#view-helpdesk .helpdesk-ticket-detail-toolbar-actions .wmts-helpdesk-ticket-edit-btn {
    width: 38px !important;
    min-width: 38px !important;
    max-width: 38px !important;
    height: 38px !important;
    min-height: 38px !important;
}

#view-helpdesk .helpdesk-ticket-detail-toolbar > .wmts-helpdesk-ticket-back-btn {
    width: auto !important;
    min-width: 140px !important;
    max-width: none !important;
    padding: 0 12px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0 !important;
    font-size: 13px !important;
    font-weight: 600;
    line-height: 1.2;
}

#view-helpdesk .helpdesk-ticket-detail-toolbar > .wmts-helpdesk-ticket-back-btn .wmts-table-action-glyph {
    display: none !important;
}

#view-helpdesk .wmts-helpdesk-ticket-back-label {
    display: inline;
    white-space: nowrap;
}

#view-helpdesk .helpdesk-ticket-detail-toolbar-actions .wmts-menu-select.wmts-menu-select-icon {
    width: 56px;
    min-width: 56px;
    height: 38px;
    min-height: 38px;
}

#view-helpdesk .helpdesk-ticket-detail-toolbar > .wmts-helpdesk-ticket-back-btn .wmts-table-action-glyph,
#view-helpdesk .helpdesk-ticket-detail-toolbar-actions .wmts-helpdesk-ticket-edit-btn .wmts-table-action-glyph {
    font-size: 15px;
}

#view-helpdesk #helpdesk-ticket-table-body a {
    color: inherit;
    text-decoration: none;
}

#view-helpdesk #helpdesk-ticket-table-body a:hover {
    text-decoration: underline;
}

#view-helpdesk #helpdesk-ticket-table-body > tr.wmts-helpdesk-ticket-row {
    cursor: pointer;
    transition: transform .12s ease;
}

#view-helpdesk #helpdesk-ticket-table-body > tr.wmts-helpdesk-ticket-row:hover > td,
#view-helpdesk #helpdesk-ticket-table-body > tr.wmts-helpdesk-ticket-row:focus-within > td {
    background: var(--table-row-hover-strong) !important;
}

#view-helpdesk #helpdesk-ticket-table-body > tr.wmts-helpdesk-ticket-row:active > td {
    filter: brightness(1.06);
}

#view-helpdesk .wmts-helpdesk-ticket-actions .wmts-helpdesk-mobile-edit-trigger {
    display: none !important;
}

#view-helpdesk .helpdesk-meta-card {
    border-radius: 10px;
    border: 1px solid var(--helpdesk-config-panel-border);
    padding: 12px;
    min-width: 0;
    overflow: hidden;
}

#view-helpdesk .helpdesk-meta-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    min-width: 0;
}

#view-helpdesk .helpdesk-meta-grid-secondary {
    grid-template-columns: minmax(220px, 0.9fr) minmax(260px, 1.1fr);
}

#view-helpdesk .helpdesk-meta-divider {
    height: 1px;
    margin: 10px 0;
}

#view-helpdesk .helpdesk-meta-column {
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr);
    align-items: start;
    gap: 6px 10px;
    min-width: 0;
}

#view-helpdesk .helpdesk-meta-column strong {
    font-size: 11px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    font-weight: 700;
    line-height: 1.3;
    white-space: nowrap;
}

#view-helpdesk .helpdesk-meta-column span {
    min-width: 0;
    font-size: 13px;
    line-height: 1.35;
    overflow-wrap: anywhere;
    word-break: break-word;
}

#view-helpdesk .helpdesk-meta-responses-card {
    margin-top: 10px;
    display: grid;
    gap: 8px;
}

#view-helpdesk .helpdesk-meta-responses-card + .modal-grid {
    margin-top: var(--module-stack-gap);
}

#view-helpdesk .helpdesk-meta-responses-title {
    font-size: 10px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--text-primary);
}

#view-helpdesk .helpdesk-meta-responses-body {
    min-width: 0;
    max-height: 210px;
    overflow-y: auto;
    overflow-x: hidden;
    display: grid;
    gap: 6px;
    font-size: 13px;
    line-height: 1.35;
    color: var(--text-secondary);
}

#view-helpdesk .helpdesk-meta-response-line {
    font-size: 13px;
    font-weight: 600;
    line-height: 1.35;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    word-break: break-word;
}

#view-helpdesk #helpdesk-ticket-meta-last-message,
#view-helpdesk #helpdesk-ticket-meta-last-response {
    white-space: normal !important;
}

#view-helpdesk #helpdesk-ticket-subject-description,
#view-helpdesk #helpdesk-ticket-messages {
    min-width: 0;
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: break-word;
    overflow-x: hidden;
}

#view-helpdesk .helpdesk-ticket-detail-flags {
    margin-top: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

#view-helpdesk .helpdesk-ticket-detail-footer-actions {
    margin-top: 12px;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

#view-helpdesk #helpdesk-ticket-reply-body {
    display: block;
    width: 100%;
    max-width: none;
    min-height: 74px;
    padding: 12px !important;
    line-height: 1.35;
}

#helpdesk-ticket-edit-modal .wmts-helpdesk-ticket-edit-modal-content {
    max-width: 760px;
}

#helpdesk-ticket-edit-modal .helpdesk-ticket-edit-grid {
    grid-template-columns: minmax(0, 1fr);
}

#helpdesk-ticket-edit-modal .helpdesk-ticket-edit-grid .modal-item {
    grid-column: 1 / -1;
}

#helpdesk-ticket-edit-modal .helpdesk-ticket-edit-grid .modal-item > .admin-input,
#helpdesk-ticket-edit-modal .helpdesk-ticket-edit-grid .modal-item > .table-select,
#helpdesk-ticket-edit-modal .helpdesk-ticket-edit-grid .modal-item > textarea.admin-input {
    width: 100%;
    max-width: none;
}

#helpdesk-ticket-edit-modal .helpdesk-ticket-edit-grid .helpdesk-ticket-edit-priority-item {
    max-width: 280px;
}

#helpdesk-ticket-edit-modal textarea.admin-input {
    min-height: 96px;
}

#view-helpdesk .helpdesk-plugin-panel,
#view-helpdesk #helpdesk-ticket-subject-description,
#view-helpdesk #helpdesk-ticket-messages {
    background: var(--helpdesk-config-panel-bg) !important;
    border: 1px solid var(--helpdesk-config-panel-border) !important;
    color: var(--text-primary) !important;
}

#view-helpdesk #helpdesk-admin-view-replysetup #helpdesk-ticket-reply-template-body {
    width: 100%;
    min-height: 220px;
}

#view-helpdesk #helpdesk-admin-view-replysetup .helpdesk-reply-template-info {
    margin-top: 10px;
}

#view-helpdesk #helpdesk-admin-view-replysetup .helpdesk-reply-template-info p {
    margin: 0 0 6px;
}

#view-helpdesk #helpdesk-admin-view-replysetup .helpdesk-reply-template-info p:last-child {
    margin-bottom: 0;
}

#view-helpdesk #helpdesk-sub-view-admin .modal-item.full {
    background: transparent !important;
    border: 0 !important;
    color: var(--text-primary) !important;
    padding: 0 !important;
}

#view-helpdesk #helpdesk-admin-view-form .wmts-sortable-panel {
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
}

#view-helpdesk .helpdesk-form-config-stack {
    display: grid;
    gap: var(--module-gap);
}

#view-helpdesk .helpdesk-form-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

#view-helpdesk .helpdesk-form-section-title {
    margin: 0;
    font-size: 15px;
    line-height: 1.3;
    font-weight: 700;
    color: var(--text-primary);
}

#view-helpdesk .helpdesk-form-link-row {
    margin-top: 10px;
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

#view-helpdesk .helpdesk-form-link-row .admin-input {
    flex: 1 1 360px;
    min-width: 280px;
}

#view-helpdesk .helpdesk-form-link-row .wmts-check-toggle {
    margin-left: auto;
    flex: 0 0 auto;
}

#helpdesk-mailbox-modal .helpdesk-mailbox-modal-grid {
    grid-template-columns: repeat(2, minmax(220px, 1fr));
    gap: 12px 14px;
}

#helpdesk-mailbox-modal .modal-item > .admin-input,
#helpdesk-mailbox-modal .modal-item > .table-select,
#helpdesk-mailbox-modal .modal-item > textarea {
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    box-sizing: border-box;
}

#helpdesk-mailbox-modal .helpdesk-mailbox-toggle {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    justify-content: space-between;
}

#helpdesk-mailbox-modal .helpdesk-mailbox-toggle > span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#helpdesk-mailbox-modal .helpdesk-mailbox-status-readout {
    min-height: 38px;
    display: flex;
    align-items: center;
}

#helpdesk-mailbox-modal .helpdesk-mailbox-spacer {
    min-height: 1px;
}

@media (max-width: 860px) {
    #helpdesk-mailbox-modal .helpdesk-mailbox-modal-grid {
        grid-template-columns: 1fr;
    }

    #helpdesk-mailbox-modal .helpdesk-mailbox-spacer {
        display: none;
    }
}

#view-helpdesk #helpdesk-sub-view-mailboxes table thead {
    display: table-header-group;
}

#view-helpdesk #helpdesk-mailbox-table-body {
    display: table-row-group;
    background: transparent !important;
}

#view-helpdesk #helpdesk-mailbox-table-body > tr {
    display: table-row;
}

#view-helpdesk #helpdesk-mailbox-table-body > tr > td {
    vertical-align: middle;
}

#view-helpdesk .helpdesk-mailbox-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

#view-helpdesk .helpdesk-mailbox-error-preview {
    display: inline-block;
    max-width: 420px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: middle;
}

#view-helpdesk .helpdesk-form-fields-header {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    margin: 0 0 10px;
}

#view-helpdesk #helpdesk-form-add-field-btn {
    margin-left: auto;
}

#helpdesk-custom-field-modal #helpdesk-custom-field-modal-options-wrap {
    display: none;
}

#helpdesk-custom-field-modal .modal-item > .wmts-check-toggle {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
    justify-content: space-between;
    overflow: hidden;
}

#helpdesk-custom-field-modal .helpdesk-custom-field-modal-content {
    width: min(760px, 94vw);
}

#helpdesk-custom-field-modal .helpdesk-custom-field-modal-grid {
    grid-template-columns: repeat(2, minmax(220px, 1fr));
    gap: 12px 14px;
}

#helpdesk-custom-field-modal .helpdesk-custom-field-modal-spacer {
    min-height: 1px;
}

#helpdesk-custom-field-modal .modal-item > .admin-input,
#helpdesk-custom-field-modal .modal-item > .table-select {
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
}

#helpdesk-custom-field-modal .modal-item > .wmts-menu-select,
#helpdesk-custom-field-modal #helpdesk-custom-field-modal-type + .wmts-menu-select {
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
}

#helpdesk-custom-field-modal .modal-item > .wmts-menu-select .wmts-menu-btn,
#helpdesk-custom-field-modal #helpdesk-custom-field-modal-type + .wmts-menu-select .wmts-menu-btn {
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
}

#helpdesk-custom-field-modal #helpdesk-custom-field-modal-options-table-wrap {
    display: none;
}

#helpdesk-custom-field-modal .helpdesk-custom-field-option-add-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: end;
}

#helpdesk-custom-field-modal .helpdesk-custom-field-option-add-row > * {
    min-width: 0;
}

#helpdesk-custom-field-modal #helpdesk-custom-field-modal-options-table-wrap .table-wrap {
    margin-top: 0;
}

#helpdesk-custom-field-modal .helpdesk-custom-field-option-action-cell {
    width: 68px;
    text-align: right;
    white-space: nowrap;
}

#helpdesk-custom-field-modal #helpdesk-custom-field-modal-options-empty {
    margin-top: 8px;
}

#view-helpdesk .helpdesk-form-add-grid {
    margin-top: 10px;
    display: grid;
    grid-template-columns: minmax(220px, 2fr) minmax(130px, 0.7fr) minmax(120px, 0.7fr) minmax(260px, 2fr) auto;
    gap: 8px;
    align-items: center;
}

#view-helpdesk .helpdesk-form-add-grid .wmts-check-toggle {
    width: fit-content;
}

#view-helpdesk .helpdesk-form-save-row {
    margin-top: 14px;
    display: flex;
    justify-content: flex-end;
}

#view-helpdesk .helpdesk-plugin-panel,
#helpdesk-module-ticket-config-modal .helpdesk-plugin-panel {
    display: grid;
    gap: 10px;
}

#view-helpdesk .helpdesk-plugin-note,
#helpdesk-module-ticket-config-modal .helpdesk-plugin-note {
    color: var(--text-muted);
    font-size: 13px;
}

#view-helpdesk .helpdesk-plugin-header,
#helpdesk-module-ticket-config-modal .helpdesk-plugin-header {
    font-weight: 700;
    color: var(--text-primary);
}

#view-helpdesk .helpdesk-plugin-row,
#helpdesk-module-ticket-config-modal .helpdesk-plugin-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    padding: 8px 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    border-top: 1px solid var(--helpdesk-config-row-border);
}

#view-helpdesk .helpdesk-plugin-title-wrap,
#helpdesk-module-ticket-config-modal .helpdesk-plugin-title-wrap {
    min-width: 220px;
}

#view-helpdesk .helpdesk-plugin-title,
#helpdesk-module-ticket-config-modal .helpdesk-plugin-title {
    font-weight: 600;
    color: var(--text-primary);
}

#view-helpdesk .helpdesk-plugin-helper,
#helpdesk-module-ticket-config-modal .helpdesk-plugin-helper {
    margin-top: 2px;
    color: var(--text-muted);
    font-size: 13px;
}

#view-helpdesk .helpdesk-plugin-controls,
#helpdesk-module-ticket-config-modal .helpdesk-plugin-controls {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

#view-helpdesk .helpdesk-plugin-controls .wmts-check-toggle {
    width: 220px;
    justify-content: space-between;
    background: transparent !important;
    border: 0 !important;
    padding: 0 !important;
    min-height: 0 !important;
    box-shadow: none !important;
}

#helpdesk-module-ticket-config-modal .helpdesk-plugin-controls .wmts-check-toggle {
    min-width: 220px;
    justify-content: space-between;
}

#view-helpdesk .helpdesk-plugin-controls .wmts-check-toggle > span,
#helpdesk-module-ticket-config-modal .helpdesk-plugin-controls .wmts-check-toggle > span {
    overflow: hidden;
    text-overflow: ellipsis;
}

#view-helpdesk .helpdesk-plugin-controls-no-action,
#helpdesk-module-ticket-config-modal .helpdesk-plugin-controls-no-action {
    min-height: 34px;
}

#view-helpdesk .helpdesk-plugin-inline-note,
#helpdesk-module-ticket-config-modal .helpdesk-plugin-inline-note {
    color: var(--text-muted);
    font-size: 12px;
}

#view-helpdesk .helpdesk-plugin-dual-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

#view-helpdesk .helpdesk-plugin-static,
#helpdesk-module-ticket-config-modal .helpdesk-plugin-static {
    padding: 6px 10px;
    border: 1px solid var(--switch-shell-border);
    border-radius: 10px;
    background: var(--switch-shell-bg);
    color: var(--switch-shell-text);
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
    min-height: 34px;
    display: inline-flex;
    align-items: center;
}

#view-helpdesk .helpdesk-thread-item {
    padding: 10px;
    margin-bottom: 8px;
    border: 1px solid var(--helpdesk-config-row-border);
    border-radius: 6px;
    background: var(--helpdesk-config-row-bg);
}

#view-helpdesk .helpdesk-thread-item.is-event {
    background: var(--helpdesk-config-row-hover-bg);
}

#view-helpdesk .helpdesk-thread-meta {
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 6px;
    display: flex;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
}

#view-helpdesk .helpdesk-thread-from {
    font-size: 11px;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

#view-helpdesk .helpdesk-thread-body {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    word-break: break-word;
    color: var(--text-primary);
}

#view-helpdesk .helpdesk-thread-attachments {
    margin-top: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

#view-helpdesk .helpdesk-thread-attachment-link {
    display: inline-flex;
    align-items: flex-start;
    gap: 8px;
    width: min(260px, 100%);
    min-height: 32px;
    padding: 6px 8px;
    border-radius: 10px;
    border: 1px solid var(--table-border-strong);
    background: color-mix(in srgb, var(--table-row-bg-strong) 70%, transparent);
    color: var(--text-primary);
    text-decoration: none;
}

#view-helpdesk .helpdesk-thread-attachment-link:hover {
    border-color: var(--input-focus-border);
    background: color-mix(in srgb, var(--table-row-hover-bg) 82%, transparent);
}

#view-helpdesk .helpdesk-attachment-icon {
    width: 20px;
    height: 20px;
    min-width: 20px;
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 0;
}

#view-helpdesk .helpdesk-attachment-icon svg {
    width: 18px;
    height: 18px;
    display: block;
}

#view-helpdesk .helpdesk-thread-attachment-text {
    min-width: 0;
    display: grid;
    gap: 1px;
}

#view-helpdesk .helpdesk-thread-attachment-name {
    font-size: 12px;
    line-height: 1.2;
    overflow-wrap: anywhere;
    word-break: break-word;
}

#view-helpdesk .helpdesk-thread-attachment-size {
    font-size: 10px;
    line-height: 1.2;
    color: var(--text-muted);
}

#view-helpdesk .helpdesk-ticket-reply-attachments-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 4px;
}

#view-helpdesk .helpdesk-ticket-reply-attachments-count {
    font-size: 12px;
    color: var(--text-muted);
}

#view-helpdesk .helpdesk-ticket-reply-attachments-list {
    margin-top: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

#view-helpdesk .helpdesk-ticket-reply-attachment-empty {
    color: var(--text-muted);
    font-size: 12px;
}

#view-helpdesk .helpdesk-ticket-reply-attachment-item {
    display: inline-flex;
    align-items: flex-start;
    gap: 8px;
    width: min(260px, 100%);
    min-height: 32px;
    padding: 6px 8px;
    border-radius: 10px;
    border: 1px solid var(--table-border-strong);
    background: color-mix(in srgb, var(--table-row-bg-strong) 72%, transparent);
}

#view-helpdesk .helpdesk-ticket-reply-attachment-main {
    display: grid;
    gap: 1px;
    min-width: 0;
    flex: 1 1 auto;
}

#view-helpdesk .helpdesk-ticket-reply-attachment-name {
    font-size: 12px;
    line-height: 1.2;
    color: var(--text-primary);
    overflow-wrap: anywhere;
    word-break: break-word;
}

#view-helpdesk .helpdesk-ticket-reply-attachment-size {
    font-size: 10px;
    line-height: 1.2;
    color: var(--text-muted);
}

#view-helpdesk .helpdesk-ticket-reply-attachment-item .wmts-table-action-icon {
    margin-left: auto;
    align-self: center;
}

#profile-signature-preview {
    color: var(--helpdesk-signature-preview-text) !important;
}

#profile-signature-preview-image {
    border: 1px solid var(--helpdesk-signature-preview-border) !important;
    background: var(--helpdesk-signature-preview-bg) !important;
}

/* Shared reorderable list rows (Helpdesk / Network / Devices) */
.wmts-sortable-panel {
    margin-top: 10px;
    padding: 0;
    border: 0;
    border-radius: var(--module-radius);
    background: var(--table-wrap-bg, var(--surface-panel-alt));
    overflow: hidden;
}

/* Global info text box */
.wmts-info-box {
    padding: 20px 14px;
    border: 1px solid var(--helpdesk-config-panel-border);
    border-radius: 8px;
    background: color-mix(in srgb, var(--helpdesk-config-panel-bg) 70%, transparent);
}

.devices-settings-intro {
    margin: 0 0 var(--module-stack-gap);
}

.devices-settings-intro p {
    margin: 0;
}

/* Modal boxes inherit sidebar surface */
.modal .wmts-info-box,
.modal .wmts-sortable-panel {
    background: var(--app-surface);
}

.wmts-sortable-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0;
}

.wmts-sortable-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 10px;
    border: 0;
    border-radius: 0;
    background: var(--wmts-sortable-row-bg, var(--table-row-bg-strong));
    transition: border-color 0.14s ease, box-shadow 0.14s ease, background 0.14s ease;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.wmts-sortable-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    background: var(--table-head-bg-strong);
    color: var(--table-head-text-strong);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.helpdesk-form-layout-header {
    display: grid;
    grid-template-columns: var(--helpdesk-form-layout-cols, minmax(360px, 1fr) 100px 140px 140px 80px);
    gap: 0;
    padding: 8px 10px;
    border-radius: var(--module-radius) var(--module-radius) 0 0;
    overflow: hidden;
}

.helpdesk-form-layout-header > span {
    justify-self: start;
    text-align: left;
}

.helpdesk-form-layout-header > span:nth-child(3),
.helpdesk-form-layout-header > span:nth-child(4) {
    justify-self: center;
    text-align: center;
}

.helpdesk-form-layout-header > span:last-child {
    justify-self: end;
    text-align: right;
}

.helpdesk-form-layout-sortable {
    border-radius: 0 0 var(--module-radius) var(--module-radius);
    overflow: hidden;
    background: var(--table-row-bg-strong);
    width: 100%;
}

.helpdesk-form-layout-header + .helpdesk-form-layout-sortable {
    margin-top: 0;
}

@media (max-width: 1100px) {
    .helpdesk-form-table {
        --helpdesk-form-action-col: 120px;
        --helpdesk-form-layout-cols: 1fr 100px 140px 140px var(--helpdesk-form-action-col);
    }
}

.wmts-sortable-item:nth-child(even):not(.is-dragging) {
    --wmts-sortable-row-bg: var(--table-row-even-strong);
}

/* Ensure helpdesk/queue sortable lists also alternate correctly */
.helpdesk-ticket-sortable-list > .wmts-sortable-item:nth-child(even):not(.is-dragging),
.helpdesk-form-layout-sortable > .wmts-sortable-item:nth-child(even):not(.is-dragging),
.helpdesk-form-table-body > .wmts-sortable-item:nth-child(even):not(.is-dragging) {
    --wmts-sortable-row-bg: var(--table-row-even-strong);
}

.wmts-sortable-item-locked:nth-child(odd):not(.is-dragging) {
    background: var(--table-row-bg-strong) !important;
}

.wmts-sortable-item-locked:nth-child(even):not(.is-dragging) {
    background: var(--table-row-even-strong) !important;
}

.wmts-sortable-item-main {
    min-width: 0;
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.wmts-sortable-item-main strong {
    font-weight: 600;
    color: var(--text-primary);
}

/* Device queue configuration: bold row text */
#devices-job-status-sortable .wmts-sortable-item,
#devices-sub-view-queues .wmts-sortable-item {
    font-weight: 600;
    color: var(--text-primary);
}

#devices-job-status-sortable .wmts-sortable-item-main,
#devices-sub-view-queues .wmts-sortable-item-main,
#devices-job-status-sortable .wmts-sortable-item-meta,
#devices-sub-view-queues .wmts-sortable-item-meta {
    font-weight: 600;
}

/* Device checklist configuration: bold row text */
#devices-job-config-sortable .wmts-sortable-item,
#devices-sub-view-jobconfig .wmts-sortable-item {
    font-weight: 600;
    color: var(--text-primary);
}

#devices-job-config-sortable .wmts-sortable-item-main,
#devices-sub-view-jobconfig .wmts-sortable-item-main,
#devices-job-config-sortable .wmts-sortable-item-meta,
#devices-sub-view-jobconfig .wmts-sortable-item-meta {
    font-weight: 600;
}

.wmts-sortable-item-main > button.wmts-table-action-icon.wmts-table-action-move-locked {
    margin-right: 0;
    flex: 0 0 auto;
}

.wmts-sortable-handle {
    width: 28px;
    height: 28px;
    min-width: 28px;
    border: var(--icon-btn-border-width) solid var(--icon-btn-border-color);
    border-radius: 8px;
    background: var(--icon-btn-bg);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: grab;
    color: var(--icon-btn-color);
    font-size: 14px;
    line-height: 1;
    user-select: none;
}

body .wmts-sortable-handle:hover {
    background: var(--icon-btn-bg);
    border-color: var(--icon-btn-border-color);
    color: var(--icon-btn-color);
}

.wmts-sortable-item-meta {
    color: var(--text-muted);
    font-size: 11px;
}

.wmts-info-icon-btn {
    width: 22px !important;
    min-width: 22px !important;
    max-width: 22px !important;
    height: 22px !important;
    min-height: 22px !important;
    max-height: 22px !important;
    border-radius: 999px !important;
    padding: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    line-height: 1 !important;
    flex: 0 0 22px !important;
    background: var(--icon-btn-bg) !important;
    border: var(--icon-btn-border-width) solid var(--icon-btn-border-color) !important;
    color: var(--icon-btn-color) !important;
    box-shadow: none !important;
}

.wmts-info-icon-btn:hover,
.wmts-info-icon-btn:focus-visible {
    background: var(--icon-btn-hover-bg) !important;
    border-color: var(--icon-btn-hover-border-color) !important;
    color: var(--icon-btn-hover-color) !important;
    box-shadow: none !important;
}

.wmts-sortable-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
    min-width: max-content;
}

.wmts-sortable-actions > .table-select,
.wmts-sortable-actions > .wmts-menu-select {
    min-width: 110px;
}

.wmts-sortable-actions > .table-select:last-child,
.wmts-sortable-actions > .wmts-menu-select:last-child {
    margin-right: 38px;
}

.wmts-sortable-item.is-over {
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.25);
    background: var(--helpdesk-config-row-hover-bg);
}

.wmts-sortable-item.is-dragging {
    opacity: 0.8;
    border-color: var(--brand-primary);
    background: var(--helpdesk-config-row-hover-bg);
}

.wmts-sortable-item-locked {
    background: inherit !important;
    border-color: inherit !important;
}

.helpdesk-ticket-sortable-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.helpdesk-admin-hint {
    margin-top: 6px;
    color: var(--text-muted);
    font-size: 12px;
}

.helpdesk-form-layout-hint-top {
    margin: 0 0 8px;
    padding: 8px 0 10px;
}

.helpdesk-form-layout-hint-bottom {
    margin: 8px 0 0;
    padding: 10px 0 6px;
}

.helpdesk-form-table {
    --helpdesk-form-action-col: 136px;
    --helpdesk-form-layout-cols: 1fr 110px 160px 160px var(--helpdesk-form-action-col);
}

.helpdesk-form-table-head {
    display: grid;
    grid-template-columns: var(--helpdesk-form-layout-cols);
    gap: 0;
    padding: 0;
    justify-content: stretch;
    background: var(--table-head-bg-strong);
    color: var(--table-head-text-strong);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    border-radius: var(--module-radius) var(--module-radius) 0 0;
}

.helpdesk-form-table-head > div:nth-child(1),
.helpdesk-form-table-head > div:nth-child(2) {
    text-align: left;
}

.helpdesk-form-table-head > div {
    padding: 8px 10px;
    box-sizing: border-box;
}

.helpdesk-form-table-head > div:nth-child(3),
.helpdesk-form-table-head > div:nth-child(4) {
    text-align: center;
}

.helpdesk-form-table-head > div:nth-child(5) {
    text-align: right;
}

.helpdesk-form-layout-sortable,
.helpdesk-form-table-body {
    border-radius: 0 0 var(--module-radius) var(--module-radius);
    overflow: hidden;
    background: var(--table-row-bg-strong);
    width: 100%;
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 0;
}

.helpdesk-form-layout-row.wmts-sortable-item,
.helpdesk-form-table-row.wmts-sortable-item {
    display: grid;
    grid-template-columns: var(--helpdesk-form-layout-cols);
    gap: 0;
    align-items: center;
    width: 100%;
    padding: 0;
    justify-content: stretch;
}

.helpdesk-form-cell {
    display: inline-flex;
    align-items: center;
    min-width: 0;
    padding: 8px 10px;
    box-sizing: border-box;
}

.helpdesk-form-cell .wmts-sortable-item-main {
    gap: 8px;
}

.helpdesk-form-table-row .helpdesk-form-cell:nth-child(3),
.helpdesk-form-table-row .helpdesk-form-cell:nth-child(4) {
    justify-content: center;
}

.helpdesk-form-table-row .helpdesk-form-cell:nth-child(2) {
    justify-content: flex-start;
}

.helpdesk-form-table-row .helpdesk-form-cell:nth-child(5) {
    justify-content: flex-end;
}

.helpdesk-form-layout-end,
.helpdesk-form-layout-muted {
    color: var(--text-muted);
    font-size: 12px;
}

.helpdesk-form-layout-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    font-size: 12px;
    color: var(--text-secondary);
}

.helpdesk-form-actions {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    justify-content: flex-end;
    width: 100%;
}


.helpdesk-form-layout-btn-sm {
    padding: 4px 8px !important;
}

@media (max-width: 1280px) {
    #view-helpdesk .helpdesk-form-add-grid {
        grid-template-columns: minmax(220px, 1.4fr) minmax(130px, 0.7fr) minmax(120px, 0.8fr) minmax(220px, 1.4fr) auto;
    }
}

@media (max-width: 1024px) {
    #view-helpdesk .helpdesk-form-add-grid {
        grid-template-columns: 1fr;
    }
    #view-helpdesk .helpdesk-plugin-controls {
        width: 100%;
        justify-content: flex-start;
    }
    .helpdesk-form-layout-header,
    .helpdesk-form-layout-row.wmts-sortable-item {
        --helpdesk-form-layout-cols: minmax(260px, 2fr) 90px 110px 100px 120px;
    }
}

.batch-edit-table th,
.batch-edit-table td {
    border-bottom-color: var(--table-cell-border) !important;
}

.batch-edit-table th {
    color: var(--text-muted) !important;
}

.batch-input-small {
    background: var(--input-bg) !important;
    border-color: var(--input-border) !important;
    color: var(--input-text) !important;
}

/* Shared module shell blocks */
.network-shell,
.devices-shell,
.helpdesk-shell,
.inventory-shell,
.settings-shell {
    display: grid;
    gap: var(--module-gap);
}

/* Dept Hub uses same block stack rhythm as other primary module pages */
.depthub-shell {
    display: block;
}

.depthub-shell > * + * {
    margin-top: var(--module-stack-gap) !important;
}

.depthub-toolbar,
.network-toolbar,
.devices-jobs-toolbar,
.devices-list-toolbar,
.depthub-notes-header,
.depthub-kb-actions,
.depthub-wall-compose-row,
.network-host-toolbar,
.network-map-toolbar,
.network-link-create-row,
.network-color-scale-row,
.network-status-custom-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* Devices list controls: keep Include Decommissioned on the left of the global switcher row,
   while export/import/add actions remain grouped to the right. */
.devices-list-toolbar .devices-list-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.devices-list-toolbar.wmts-inline-switcher-controls .devices-list-actions {
    flex: 1 1 auto;
    min-width: 0;
    width: 100%;
}

.devices-list-toolbar.wmts-inline-switcher-controls .devices-list-actions > .wmts-check-toggle {
    margin-right: auto;
}

/* Devices deep-fix:
   1) remove hidden search source from layout flow (but keep it available for topbar search proxy),
   2) neutralize auto action-row right-push classes for this toolbar only,
   3) keep Include Decommissioned left and export/import clustered to the right. */
body.app-authenticated #view-devices .devices-list-toolbar .search-wrapper.devices-list-search,
body.app-authenticated #view-devices .devices-jobs-toolbar .search-wrapper.devices-list-search {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: 0 !important;
    border: 0 !important;
    opacity: 0 !important;
    pointer-events: none !important;
    clip: rect(0 0 0 0) !important;
    clip-path: inset(50%) !important;
    overflow: hidden !important;
    white-space: nowrap !important;
}

#view-devices .devices-list-toolbar.wmts-refresh-add-actions {
    margin-left: 0 !important;
    justify-content: flex-end !important;
    display: flex !important;
}

#view-devices .devices-list-toolbar .devices-list-actions.wmts-refresh-add-actions,
#view-devices .devices-list-toolbar .devices-list-actions {
    margin-left: 0 !important;
    justify-content: flex-end !important;
    flex: 1 1 auto !important;
    min-width: 0 !important;
    width: 100% !important;
}

#view-devices .devices-list-toolbar .devices-list-actions.wmts-inline-switcher-controls,
#view-devices .devices-list-toolbar .devices-list-actions.wmts-refresh-add-actions {
    margin-left: 0 !important;
    justify-content: flex-end !important;
    flex: 1 1 auto !important;
    width: 100% !important;
    display: flex !important;
}

#view-devices .devices-list-toolbar.wmts-inline-switcher-controls {
    margin-left: 0 !important;
    justify-content: flex-start !important;
    display: flex !important;
    width: 100% !important;
}

#view-devices .devices-list-toolbar .devices-list-actions > .wmts-check-toggle {
    margin-right: auto !important;
}

/* Device list: keep Export/Import/Add clustered together even in on-page add mode. */
#view-devices .devices-list-toolbar .devices-list-actions .wmts-btn-add.wmts-inline-add-right {
    margin-left: 0 !important;
}

/* Device detail view layout */
:is(#view-devices, #view-network) #devices-detail-view .devices-detail-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

:is(#view-devices, #view-network) #devices-detail-view .devices-detail-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

:is(#view-devices, #view-network) #devices-detail-view .devices-detail-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

:is(#view-devices, #view-network) #devices-detail-view #device-page-title {
    margin: 0;
    color: var(--text-primary);
    font-size: 16px;
}

:is(#view-devices, #view-network) #devices-detail-view #device-page-status {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
}

:is(#view-devices, #view-network) #devices-detail-view #device-save-indicator {
    font-size: 12px;
    color: var(--success-primary);
    display: none;
}

:is(#view-devices, #view-network) #devices-detail-view .devices-detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 260px;
    gap: 16px;
    align-items: stretch;
}

:is(#view-devices, #view-network) #devices-detail-view .devices-detail-main {
    display: grid;
    gap: 12px;
}

:is(#view-devices, #view-network) #devices-detail-view .devices-detail-card {
    background: var(--surface-panel-alt);
    border: 1px solid var(--border-panel);
    border-radius: 12px;
    padding: 14px;
}

:is(#view-devices, #view-network) #devices-detail-view .devices-detail-grid {
    gap: 12px;
}

:is(#view-devices, #view-network) #devices-detail-view .devices-detail-meta {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

:is(#view-devices, #view-network) #devices-detail-view .devices-detail-meta-item label {
    display: block;
    margin: 0 0 6px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
}

:is(#view-devices, #view-network) #devices-detail-view .devices-detail-meta-item div {
    font-size: 13px;
    color: var(--text-primary);
}

:is(#view-devices, #view-network) #devices-detail-view .devices-detail-side {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: stretch;
    height: 100%;
}

:is(#view-devices, #view-network) #devices-detail-view .devices-detail-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

:is(#view-devices, #view-network) #devices-detail-view .devices-detail-image-wrap {
    width: 100%;
    background: var(--surface-panel-alt);
    border: 1px solid var(--border-panel);
    border-radius: 12px;
    padding: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 180px;
    flex: 1;
    aspect-ratio: 1 / 1;
}

:is(#view-devices, #view-network) #devices-detail-view .devices-detail-image-wrap img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

@media (max-width: 980px) {
    :is(#view-devices, #view-network) #devices-detail-view .devices-detail-layout {
        grid-template-columns: 1fr;
    }

    :is(#view-devices, #view-network) #devices-detail-view .devices-detail-actions {
        justify-content: flex-start;
    }
}

/* Device history modal: fixed height + custom table shell */
#device-history-modal .modal-content.devices-history-modal {
    width: min(920px, 94vw);
}

#device-history-modal .modal-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

#device-history-modal .devices-history-table-wrap {
    --history-row-height: 40px;
    --history-head-height: 40px;
    border: 1px solid var(--border-panel);
    border-radius: 12px;
    background: var(--surface-panel-alt);
    overflow: hidden;
    min-height: calc(var(--history-head-height) + (var(--history-row-height) * 10));
}

#device-history-modal .devices-history-table-wrap table {
    margin-bottom: 0 !important;
    border: 0 !important;
    background: transparent !important;
}

#device-history-modal .devices-history-table th,
#device-history-modal .devices-history-table td {
    padding: 10px 12px !important;
}

#device-history-modal .devices-history-table tbody tr:nth-child(odd) {
    background: var(--table-row-bg-strong) !important;
}

#device-history-modal .devices-history-table tbody tr:nth-child(even) {
    background: var(--table-row-even-strong) !important;
}

#device-history-modal .devices-history-table th:last-child,
#device-history-modal .devices-history-table td:last-child {
    text-align: left !important;
}

#device-history-modal .devices-history-table-wrap thead th {
    height: var(--history-head-height);
}

#device-history-modal .devices-history-table-wrap tbody tr {
    height: var(--history-row-height);
}

#device-history-modal .devices-history-pager {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    font-size: 12px;
    color: var(--text-muted);
}

#device-history-modal .devices-history-pager .btn-close {
    padding: 4px 10px;
    height: 30px;
}

/* Device job create modal sections */
#device-create-job-modal .modal-content.device-create-job-modal {
    width: min(820px, 94vw);
}

#device-create-job-modal .device-modal-section {
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid var(--border-panel);
    background: var(--app-surface);
}

#device-create-job-modal .device-modal-section + .device-modal-section {
    margin-top: 12px;
}

#device-create-job-modal .device-modal-section h4 {
    margin: 0 0 10px;
    font-size: 12px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-muted);
}

#device-create-job-modal .device-modal-help-text {
    margin-top: 8px;
    font-size: 12px;
    color: var(--text-muted);
}

/* Device create/edit modals */
#device-create-modal .modal-content,
#device-edit-modal .modal-content {
    width: min(760px, 94vw);
}

#device-create-modal .modal-body .modal-grid,
#device-edit-modal .modal-body .modal-grid {
    grid-template-columns: repeat(2, minmax(220px, 1fr));
    gap: 14px 16px;
}

#device-create-modal .modal-item > .admin-input,
#device-create-modal .modal-item > .table-select,
#device-edit-modal .modal-item > .admin-input,
#device-edit-modal .modal-item > .table-select {
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
}

#device-create-modal #device-create-model + .wmts-menu-select,
#device-create-modal #device-create-batch + .wmts-menu-select,
#device-edit-modal #device-edit-model + .wmts-menu-select,
#device-edit-modal #device-edit-batch + .wmts-menu-select {
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
}

#device-create-modal #device-create-model + .wmts-menu-select .wmts-menu-btn,
#device-create-modal #device-create-batch + .wmts-menu-select .wmts-menu-btn,
#device-edit-modal #device-edit-model + .wmts-menu-select .wmts-menu-btn,
#device-edit-modal #device-edit-batch + .wmts-menu-select .wmts-menu-btn {
    width: 100% !important;
}

#device-create-modal .modal-footer,
#device-edit-modal .modal-footer {
    gap: 10px;
    flex-wrap: wrap;
}

#device-edit-modal .device-edit-modal-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-right: auto;
    flex-wrap: wrap;
}

/* Device model add/edit modal */
#device-model-modal .device-model-modal-content {
    width: min(860px, 94vw);
}

#device-model-modal .device-model-modal-grid {
    grid-template-columns: repeat(2, minmax(220px, 1fr));
    gap: 12px 14px;
}

#device-model-modal .modal-item {
    min-width: 0;
}

#device-model-modal .modal-item > .admin-input,
#device-model-modal .modal-item > .table-select {
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
}

#device-model-modal .device-model-batches-heading {
    margin: 0;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

#device-model-modal .device-model-batch-add-row {
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) auto;
    gap: 8px;
    align-items: end;
}

#device-model-modal .device-model-batch-add-row > * {
    min-width: 0;
}

#device-model-modal .device-model-batches-list {
    min-width: 0;
}

#device-model-modal .device-model-photo-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

#device-model-modal .device-model-image-preview {
    width: 120px;
    height: 90px;
    object-fit: contain;
    border: 1px solid var(--table-border-strong);
    border-radius: 8px;
    background: var(--app-bg);
}

#device-model-modal .device-model-batch-table-wrap {
    margin-top: 0;
}

#device-model-modal .device-model-batch-table th:last-child,
#device-model-modal .device-model-batch-table td:last-child {
    width: 68px;
    text-align: right;
}

#device-model-modal .device-model-batch-action-cell {
    white-space: nowrap;
}

#device-model-modal .device-model-batch-mobile-cards {
    display: none;
}

#device-model-modal .device-model-batch-empty {
    color: var(--text-muted);
    font-size: 12px;
}

/* Inventory add/edit asset modals (aligned to model modal structure) */
#add-inventory-modal .inventory-asset-modal-content,
#edit-inventory-modal .inventory-asset-modal-content {
    width: min(980px, 94vw);
}

#add-inventory-modal .inventory-asset-modal-grid,
#edit-inventory-modal .inventory-asset-modal-grid {
    grid-template-columns: repeat(2, minmax(220px, 1fr));
    gap: 12px 14px;
}

#add-inventory-modal .inventory-asset-modal-grid .modal-item,
#edit-inventory-modal .inventory-asset-modal-grid .modal-item {
    min-width: 0;
}

#add-inventory-modal .inventory-asset-modal-grid .modal-item > .admin-input,
#add-inventory-modal .inventory-asset-modal-grid .modal-item > .table-select,
#edit-inventory-modal .inventory-asset-modal-grid .modal-item > .admin-input,
#edit-inventory-modal .inventory-asset-modal-grid .modal-item > .table-select {
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
}

#add-inventory-modal .inventory-asset-modal-grid .search-wrapper,
#edit-inventory-modal .inventory-asset-modal-grid .search-wrapper {
    width: 100%;
    min-width: 0;
}

#add-inventory-modal .inventory-asset-modal-grid .search-wrapper > .admin-input,
#edit-inventory-modal .inventory-asset-modal-grid .search-wrapper > .admin-input {
    width: 100% !important;
    max-width: none !important;
}

#add-inventory-modal #new-cat + .wmts-menu-select,
#edit-inventory-modal #edit-item-cat + .wmts-menu-select {
    width: 100% !important;
}

#add-inventory-modal #new-cat + .wmts-menu-select .wmts-menu-btn,
#edit-inventory-modal #edit-item-cat + .wmts-menu-select .wmts-menu-btn {
    width: 100% !important;
}

#add-inventory-modal .inventory-asset-batch-header,
#edit-inventory-modal .inventory-asset-batch-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

#add-inventory-modal .inventory-asset-batches-heading,
#edit-inventory-modal .inventory-asset-batches-heading {
    margin: 0;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

#add-inventory-modal .inventory-modal-batches-wrap,
#edit-inventory-modal .inventory-modal-batches-wrap {
    min-width: 0;
}

#add-inventory-modal .batch-edit-table th:last-child,
#add-inventory-modal .batch-edit-table td:last-child,
#edit-inventory-modal .batch-edit-table th:last-child,
#edit-inventory-modal .batch-edit-table td:last-child {
    width: 72px;
    text-align: right;
}

#add-inventory-modal .inv-batch-new-act,
#edit-inventory-modal .inv-batch-new-act {
    white-space: nowrap;
    text-align: right;
}

#add-inventory-modal .inventory-modal-batches-wrap .batch-input-small,
#edit-inventory-modal .inventory-modal-batches-wrap .batch-input-small {
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
}

#add-inventory-modal .inventory-asset-photo-row,
#edit-inventory-modal .inventory-asset-photo-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

#add-inventory-modal .inventory-asset-image-preview,
#edit-inventory-modal .inventory-asset-image-preview {
    width: 120px;
    height: 90px;
    object-fit: contain;
    border: 1px solid var(--table-border-strong);
    border-radius: 8px;
    background: var(--app-bg);
}

#add-inventory-modal .inventory-modal-batches-table-wrap .batch-edit-table thead th,
#edit-inventory-modal .inventory-modal-batches-table-wrap .batch-edit-table thead th {
    color: var(--table-muted-strong) !important;
}

/* Device warranty template modal */
#device-warranty-template-modal .device-warranty-template-modal-content {
    width: min(760px, 94vw);
}

#device-warranty-template-modal .device-warranty-template-modal-grid {
    grid-template-columns: 1fr;
    gap: 14px;
}

#device-warranty-template-modal .modal-item > .admin-input,
#device-warranty-template-modal .modal-item > .table-select,
#device-warranty-template-modal .modal-item > textarea {
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
}

#device-warranty-template-modal #device-warranty-template-body {
    min-height: 120px;
}

#device-warranty-template-modal .device-warranty-template-help-row {
    margin-top: 8px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-muted);
    font-size: 12px;
}

#device-warranty-template-modal .device-warranty-template-help-trigger {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 1px solid var(--input-border);
    background: var(--surface-panel-alt);
    color: var(--text-primary);
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    cursor: pointer;
}

#device-warranty-template-modal .device-warranty-template-token-popover {
    margin-top: 10px;
    border: 1px solid var(--helpdesk-config-panel-border);
    border-radius: 10px;
    background: color-mix(in srgb, var(--helpdesk-config-panel-bg) 72%, transparent);
    padding: 10px 12px;
}

#device-warranty-template-modal .device-warranty-template-token-popover-title {
    margin: 0 0 4px;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-primary);
}

#device-warranty-template-modal .device-warranty-template-token-popover-subtitle {
    margin: 0 0 8px;
    font-size: 12px;
    color: var(--text-muted);
}

#device-warranty-template-modal .device-warranty-template-token-list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 6px;
}

#device-warranty-template-modal .device-warranty-template-token-list li {
    font-size: 12px;
    color: var(--text-secondary);
}

#device-warranty-template-modal .device-warranty-template-token-list code {
    color: var(--text-primary);
    font-weight: 700;
}

#device-warranty-template-modal .modal-footer {
    gap: 10px;
    flex-wrap: wrap;
}

.network-host-toolbar-left,
.network-host-toolbar-right,
.network-map-toolbar-left,
.network-map-toolbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.network-host-toolbar-right,
.network-map-toolbar-right {
    margin-left: auto;
    justify-content: flex-end;
}

/* Maps toolbar: keep action groups separate, but do not pin to far-right edge */
.network-map-toolbar {
    justify-content: flex-start;
    gap: 12px;
}

.network-map-toolbar-right {
    margin-left: 0;
    justify-content: flex-start;
    padding-left: 12px;
    border-left: 1px solid var(--border-panel);
}

.network-map-layout {
    display: grid;
    grid-template-columns: 400px minmax(0, 1fr);
    gap: 12px;
    align-items: stretch;
    min-height: 320px;
}

.network-map-list-panel {
    background: var(--app-surface) !important;
    border: 1px solid var(--border-panel) !important;
    border-radius: var(--module-radius);
    display: flex;
    flex-direction: column;
    min-height: 0;
    height: 100%;
    overflow: hidden;
    grid-column: 1;
}

.network-map-main {
    grid-column: 2;
    min-width: 0;
    display: grid;
    gap: 10px;
    align-content: start;
    min-height: 0;
    height: 100%;
    grid-template-rows: auto minmax(0, 1fr);
}

.network-map-canvas-wrap {
    min-height: 0;
    height: 100%;
    overflow: hidden;
    padding: 8px;
    box-sizing: border-box;
    background: var(--app-surface);
}

#network-sub-view-maps {
    display: block;
}

/* Maps/Location Manager: normalize first-row top gap to match other subviews.
   Maps has a hidden legacy select first, which can otherwise trigger extra spacing. */
#network-sub-view-maps > .network-map-layout,
#network-sub-view-locations > .network-toolbar {
    margin-top: 0 !important;
}

.network-map-fit-viewport {
    width: 100%;
    height: 100%;
    overflow: hidden;
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
}

.network-map-fit-stage {
    position: relative;
    flex: 0 0 auto;
    overflow: visible;
}

#network-map-canvas .network-map-frame {
    position: absolute;
    top: 0;
    left: 0;
    margin: 0;
    transform-origin: top left;
}

#network-map-canvas .network-map-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    object-fit: fill;
    user-select: none;
    pointer-events: none;
}

#network-map-canvas .network-map-link-layer {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
}

#network-map-canvas .network-map-node {
    position: absolute;
    z-index: 3;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    overflow: visible;
}

#network-map-canvas .network-map-node.no-circle {
    border-radius: 10px;
}

#network-map-canvas.is-edit-mode,
#network-map-canvas.is-edit-mode .network-map-fit-viewport,
#network-map-canvas.is-edit-mode .network-map-node.is-draggable {
    touch-action: none;
}

#network-map-canvas.is-edit-mode .network-map-node.is-draggable {
    cursor: grab;
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}

#network-map-canvas .network-map-node.is-dragging {
    cursor: grabbing;
}

#network-map-canvas .network-map-node-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    overflow: hidden;
}

#network-map-canvas .network-map-node-icon img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
}

#network-map-canvas .network-map-node-label {
    position: absolute;
    z-index: 4;
    font-size: 11px;
    line-height: 1.15;
    white-space: nowrap;
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    pointer-events: none;
}

#network-map-canvas .network-map-node-label.top {
    left: 50%;
    top: 0;
    transform: translate(-50%, -100%);
}

#network-map-canvas .network-map-node-label.bottom {
    left: 50%;
    bottom: 0;
    transform: translate(-50%, 100%);
}

#network-map-canvas .network-map-node-label.left {
    right: 100%;
    top: 50%;
    transform: translate(-6px, -50%);
}

#network-map-canvas .network-map-node-label.right {
    left: 100%;
    top: 50%;
    transform: translate(6px, -50%);
}

.network-map-list-head {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border-panel);
    background: var(--app-surface);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.network-map-list-head h4 {
    margin: 0;
    color: var(--text-primary);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.network-map-list-search {
    padding: 8px;
    border-bottom: 1px solid var(--border-panel);
    background: var(--app-surface);
}

.network-map-list-search .search-input {
    width: 100%;
}

.network-toolbar-rightalign {
    justify-content: flex-end;
}

/* Network Manager: keep all +Add actions pinned to the right across sub-pages */
#network-sub-view-hosts #network-add-host-btn,
#network-sub-view-scripts #script-manager-add-btn,
#network-sub-view-scripts-workflows #workflow-manager-add-btn,
#network-top-settings-subtabs #network-settings-add-host-group-btn,
#network-top-settings-subtabs #network-settings-add-function-btn,
#network-top-settings-subtabs #network-settings-add-rule-btn,
#network-top-settings-subtabs #network-settings-add-credential-btn {
    margin-left: auto !important;
}

#network-location-search {
    min-width: 260px;
    width: min(480px, 100%);
}

/* Maps: Location Manager action row should always keep +Add pinned right */
#network-sub-view-locations > .network-toolbar {
    width: 100%;
    justify-content: flex-start;
}

#network-sub-view-locations > .network-toolbar .search-wrapper {
    flex: 1 1 320px;
    min-width: 220px;
    max-width: 520px;
}

#network-sub-view-locations > .network-toolbar #network-add-location-btn {
    margin-left: auto !important;
}

/* If +Add Location is docked to sidebar/topbar, collapse the now-empty in-page row
   so Location Manager keeps the same switcher->table spacing as other views. */
#network-sub-view-locations > .network-toolbar:has(#network-add-location-btn.wmts-sidebar-source-hidden) {
    display: none !important;
}

#network-sub-view-locations > .network-toolbar:has(#network-add-location-btn.wmts-sidebar-source-hidden) + .table-wrap {
    margin-top: 0 !important;
}

.network-map-add-btn-icon {
    width: 32px;
    height: 32px;
    min-width: 32px;
    border-radius: 8px;
    border: var(--icon-btn-border-width, 1px) solid var(--icon-btn-border-color, transparent);
    background: var(--icon-btn-bg, var(--table-row-bg-strong));
    color: var(--icon-btn-color, var(--table-text));
    font-size: 20px;
}
.network-map-add-btn-icon:hover,
.network-map-add-btn-icon:focus-visible {
    border-color: var(--icon-btn-hover-border-color, var(--icon-btn-border-color, transparent));
    background: var(--icon-btn-hover-bg, var(--icon-btn-bg, var(--table-row-bg-strong)));
    color: var(--icon-btn-hover-color, var(--icon-btn-color, var(--table-text)));
    box-shadow: none;
    outline: none;
}

.network-map-list-body {
    display: block;
    gap: 0;
    padding: 0;
    margin: 6px;
    overflow: auto;
    align-content: start;
    background: var(--table-row-bg-strong);
    border-radius: 10px;
    border: 1px solid var(--table-border-strong);
    box-shadow: none;
}

.network-map-list-empty {
    padding: 12px;
    border: 1px dashed var(--border-panel);
    border-radius: 10px;
    color: var(--text-muted);
    font-size: 12px;
}

.network-map-list-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    padding: 10px 10px;
    border: 0;
    border-radius: 0;
    background: var(--table-row-bg-strong);
    border-bottom: 1px solid var(--table-border-strong);
    transition: background-color 0.14s ease, box-shadow 0.14s ease;
}

.network-map-list-edit {
    justify-self: end;
}

.network-map-list-row:not(.is-active):not(.is-over) {
    background: var(--table-row-bg-strong);
}

.network-map-list-row:nth-child(even):not(.is-active):not(.is-over) {
    background: var(--table-row-even-strong);
}

.network-map-list-row:last-child {
    border-bottom: 0;
}

.network-map-list-drag {
    width: 28px;
    height: 28px;
    min-width: 28px;
    border: var(--icon-btn-border-width) solid var(--icon-btn-border-color);
    border-radius: 8px;
    background: var(--icon-btn-bg);
    color: var(--icon-btn-color);
    font-size: 14px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: grab;
}

.network-map-list-drag:hover {
    background: var(--icon-btn-bg);
    border-color: var(--icon-btn-border-color);
    color: var(--icon-btn-color);
}

.network-map-list-row.is-dragging {
    opacity: 0.65;
}

.network-map-list-row.is-over {
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand-primary) 35%, transparent);
    background: var(--helpdesk-config-row-hover-bg);
}

.network-map-list-row.is-active {
    background: color-mix(in srgb, var(--table-row-bg-strong) 78%, var(--brand-primary) 22%);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand-primary) 40%, transparent);
}

.network-map-list-select {
    display: block;
    width: 100%;
    min-width: 0;
    border: 0;
    background: transparent;
    color: var(--text-primary);
    text-align: left;
    font: inherit;
    line-height: 1.2;
    padding: 6px 4px;
    cursor: pointer;
}

.network-map-list-name {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 600;
}

.network-map-list-edit {
    white-space: nowrap;
    min-width: 82px;
}


.wmts-drag-ghost {
    position: fixed;
    left: 0;
    top: 0;
    z-index: 99999;
    pointer-events: none;
    opacity: 1;
    box-shadow: none;
    border-radius: 10px;
    filter: none !important;
    will-change: transform;
    background: var(--table-row-bg-strong) !important;
    border: 1px solid var(--border-panel) !important;
}

.wmts-drag-ghost * {
    opacity: 1 !important;
    filter: none !important;
}

.network-map-main .network-map-toolbar-right {
    margin-left: 0;
    justify-content: flex-start;
    padding-left: 0;
    border-left: 0;
}

#network-map-mobile-fullscreen-btn {
    display: none;
}

@media (max-width: 900px) {
    #network-map-mobile-fullscreen-btn {
        display: inline-flex;
    }

    .network-map-layout {
        grid-template-columns: minmax(0, 1fr);
        height: auto !important;
    }

    .network-map-main,
    .network-map-list-panel {
        grid-column: auto;
        height: auto;
    }

    .network-map-main {
        grid-template-rows: auto minmax(280px, auto);
    }

    .network-map-list-panel {
        min-height: 180px;
    }

    .network-map-canvas-wrap {
        width: 100%;
        min-height: 280px;
        height: auto;
        padding: 4px 0 0;
    }

    .network-map-fit-viewport {
        min-height: 272px;
    }

    #network-sub-view-maps.is-mobile-fullscreen {
        position: fixed;
        inset: 0;
        z-index: 3600;
        display: block !important;
        margin: 0 !important;
        padding:
            calc(env(safe-area-inset-top, 0px) + 8px)
            calc(env(safe-area-inset-right, 0px) + 8px)
            calc(env(safe-area-inset-bottom, 0px) + 8px)
            calc(env(safe-area-inset-left, 0px) + 8px);
        background: var(--app-bg);
    }

    #network-sub-view-maps.is-mobile-fullscreen > .network-map-layout {
        height: 100% !important;
        min-height: 0;
        grid-template-columns: minmax(0, 1fr);
        gap: 8px;
    }

    #network-sub-view-maps.is-mobile-fullscreen .network-map-list-panel {
        display: none !important;
    }

    #network-sub-view-maps.is-mobile-fullscreen .network-map-main {
        height: 100%;
        min-height: 0;
        grid-template-rows: auto minmax(0, 1fr);
    }

    #network-sub-view-maps.is-mobile-fullscreen .network-map-canvas-wrap {
        height: 100%;
        min-height: 0;
        padding: 0;
    }

    #network-sub-view-maps.is-mobile-fullscreen .network-map-fit-viewport,
    #network-sub-view-maps.is-mobile-fullscreen .network-map-fit-stage {
        height: 100%;
        min-height: 0;
    }
}

html.wmts-map-node-dragging,
body.wmts-map-node-dragging,
html.wmts-map-mobile-fullscreen,
body.wmts-map-mobile-fullscreen {
    overflow: hidden !important;
    overscroll-behavior: none !important;
    touch-action: none !important;
}

/* Interactive Maps node/location/host modal restoration (backup structure + current theme) */
#network-map-node-modal .modal-content {
    max-width: min(1120px, 96vw) !important;
}

#network-map-node-modal .modal-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    row-gap: 12px;
    column-gap: 8px;
    align-items: start;
}

#network-map-node-modal #network-node-modal-label-wrap { order: 1; }
#network-map-node-modal #network-node-modal-host-wrap { order: 2; }
#network-map-node-modal #network-node-modal-icon-wrap { order: 3; }
#network-map-node-modal #network-node-modal-size-wrap { order: 4; }
#network-map-node-modal #network-node-modal-hostname-wrap { order: 5; }
#network-map-node-modal #network-node-modal-ip-wrap { order: 6; }
#network-map-node-modal #network-node-modal-up-wrap { order: 7; }
#network-map-node-modal #network-node-modal-down-wrap { order: 8; }
#network-map-node-modal #network-node-modal-text-controls-wrap { order: 9; }
#network-map-node-modal #network-node-modal-create-link-wrap { order: 10; }
#network-map-node-modal #network-node-modal-current-links-wrap { order: 11; }

/* Row 1: left-half pair + right-half pair */
#network-map-node-modal #network-node-modal-label-wrap { grid-column: 1; }
#network-map-node-modal #network-node-modal-host-wrap { grid-column: 2; }
#network-map-node-modal #network-node-modal-icon-wrap { grid-column: 3; }
#network-map-node-modal #network-node-modal-size-wrap { grid-column: 4; }

#network-map-node-modal #network-node-modal-host-wrap > .table-select,
#network-map-node-modal #network-node-modal-label-wrap > .admin-input,
#network-map-node-modal #network-node-modal-icon-wrap > .table-select,
#network-map-node-modal #network-node-modal-hostname-wrap .table-select,
#network-map-node-modal #network-node-modal-ip-wrap .table-select {
    width: 100% !important;
    max-width: none !important;
    display: block;
}

#network-map-node-modal #network-node-modal-host,
#network-map-node-modal #network-node-modal-label,
#network-map-node-modal #network-node-modal-icon,
#network-map-node-modal #network-node-modal-size {
    width: 100% !important;
    max-width: none !important;
}

#network-map-node-modal #network-node-modal-host-wrap,
#network-map-node-modal #network-node-modal-label-wrap,
#network-map-node-modal #network-node-modal-icon-wrap,
#network-map-node-modal #network-node-modal-size-wrap {
    display: flex;
    flex-direction: column;
    width: 100%;
    min-width: 0;
}

#network-map-node-modal #network-node-modal-size-wrap .wmts-number-with-suffix {
    width: 100% !important;
    max-width: none !important;
}

#network-map-node-modal #network-node-modal-icon-wrap,
#network-map-node-modal #network-node-modal-size-wrap {
    margin-left: 0;
}

/* Row 2+: single-column flow per section (full-width rows) */
#network-map-node-modal #network-node-modal-hostname-wrap { grid-column: 1 / -1; }
#network-map-node-modal #network-node-modal-ip-wrap { grid-column: 1 / -1; }
#network-map-node-modal #network-node-modal-up-wrap { grid-column: 1 / -1; }
#network-map-node-modal #network-node-modal-down-wrap { grid-column: 1 / -1; }
#network-map-node-modal #network-node-modal-text-controls-wrap { grid-column: 1 / -1; }
#network-map-node-modal #network-node-modal-create-link-wrap { grid-column: 1 / -1; }
#network-map-node-modal #network-node-modal-current-links-wrap { grid-column: 1 / -1; }

#network-map-node-modal #network-node-modal-text-controls-wrap #network-node-modal-textbg-wrap,
#network-map-node-modal #network-node-modal-text-controls-wrap #network-node-modal-text-wrap {
    order: initial;
}

#network-map-node-modal .modal-item > label {
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-size: 11px;
    font-weight: 700;
}

#network-map-host-modal .modal-grid,
#network-location-modal .modal-grid {
    grid-template-columns: repeat(2, minmax(220px, 1fr));
    gap: 12px 14px;
    align-items: start;
}

#network-map-create-modal .network-map-create-modal-grid {
    grid-template-columns: repeat(2, minmax(220px, 1fr));
    gap: 12px 14px;
    align-items: start;
}

#network-map-create-modal .network-map-create-modal-grid .modal-item > .admin-input,
#network-map-create-modal .network-map-create-modal-grid .modal-item > .table-select {
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
}

#network-map-create-modal #network-map-create-location + .wmts-menu-select {
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
}

#network-map-create-modal #network-map-create-location + .wmts-menu-select .wmts-menu-btn {
    width: 100% !important;
}

#network-map-create-modal .network-map-create-image-item .network-map-create-image-row {
    display: grid;
    grid-template-columns: auto minmax(220px, 1fr);
    gap: 12px;
    align-items: center;
}

#network-map-create-modal .network-map-create-image-item .modal-image-section {
    margin: 0;
}

#network-map-create-modal .network-map-create-image-item .file-upload-wrapper {
    display: flex;
    width: 100%;
    max-width: none;
}

#network-map-create-modal .network-map-create-image-item #network-map-create-image-trigger {
    width: 100%;
}

#network-host-modal .modal-grid {
    grid-template-columns: repeat(2, minmax(220px, 1fr));
    gap: 12px 14px;
    align-items: start;
}

#network-host-modal .modal-item > .admin-input,
#network-host-modal .modal-item > .table-select,
#network-host-modal #network-host-location-picker,
#network-host-modal #network-host-location-picker .admin-input {
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
}

#network-host-modal #network-host-group + .wmts-menu-select,
#network-host-modal #network-host-function + .wmts-menu-select,
#network-host-modal #network-host-location + .wmts-menu-select {
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
}

#network-host-modal #network-host-group + .wmts-menu-select .wmts-menu-btn,
#network-host-modal #network-host-function + .wmts-menu-select .wmts-menu-btn,
#network-host-modal #network-host-location + .wmts-menu-select .wmts-menu-btn {
    width: 100% !important;
}

#network-function-modal .modal-grid {
    grid-template-columns: repeat(2, minmax(220px, 1fr));
    gap: 12px 14px;
    align-items: start;
}

#network-function-modal .modal-item > .admin-input,
#network-function-modal .modal-item > .table-select {
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
}

#network-function-modal .modal-item > label.wmts-check-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px !important;
    width: 100%;
    min-height: 38px;
    max-width: 100%;
    padding: 6px 10px !important;
    font-size: 12px !important;
    border-radius: 10px !important;
    box-sizing: border-box;
    overflow: hidden;
    justify-content: flex-start;
}

#network-function-modal .modal-item > label.wmts-check-toggle input[type="checkbox"] {
    width: 42px !important;
    height: 22px !important;
    min-width: 42px !important;
    min-height: 22px !important;
    flex: 0 0 42px;
}

#network-function-modal .modal-item > label.wmts-check-toggle input[type="checkbox"]::before {
    width: 16px;
    height: 16px;
    top: 2px;
    left: 2px;
}

#network-function-modal .modal-item > label.wmts-check-toggle input[type="checkbox"]:checked::before {
    transform: translateX(20px);
}

#network-function-modal .modal-item > label.wmts-check-toggle input[type="checkbox"]:checked {
    box-shadow: inset 0 1px 1px rgba(9, 34, 87, 0.24) !important;
}

#script-host-modal .modal-grid {
    grid-template-columns: repeat(2, minmax(220px, 1fr));
    gap: 12px 14px;
    align-items: start;
}

#script-host-modal .modal-item > .admin-input,
#script-host-modal .modal-item > .table-select {
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
}

#script-host-modal .modal-item > label.wmts-check-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px !important;
    width: 100%;
    min-height: 38px;
    max-width: 100%;
    padding: 6px 10px !important;
    font-size: 12px !important;
    border-radius: 10px !important;
    box-sizing: border-box;
    overflow: hidden;
    justify-content: flex-start;
}

#script-host-modal .modal-item > label.wmts-check-toggle input[type="checkbox"] {
    width: 42px !important;
    height: 22px !important;
    min-width: 42px !important;
    min-height: 22px !important;
    flex: 0 0 42px;
}

#script-host-modal .modal-item > label.wmts-check-toggle input[type="checkbox"]::before {
    width: 16px;
    height: 16px;
    top: 2px;
    left: 2px;
}

#script-host-modal .modal-item > label.wmts-check-toggle input[type="checkbox"]:checked::before {
    transform: translateX(20px);
}

#script-host-modal .modal-item > label.wmts-check-toggle input[type="checkbox"]:checked {
    box-shadow: inset 0 1px 1px rgba(9, 34, 87, 0.24) !important;
}

#network-discovery-rule-modal .modal-grid {
    grid-template-columns: repeat(2, minmax(220px, 1fr));
    gap: 12px 14px;
    align-items: start;
}

#network-discovery-rule-modal .modal-item > .admin-input,
#network-discovery-rule-modal .modal-item > .table-select {
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
}

#network-discovery-rule-modal #network-discovery-rule-group + .wmts-menu-select {
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
}

#network-discovery-rule-modal #network-discovery-rule-group + .wmts-menu-select .wmts-menu-btn {
    width: 100% !important;
}

#network-discovery-rule-modal .modal-item > label.wmts-check-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px !important;
    width: 100%;
    min-height: 38px;
    max-width: 100%;
    padding: 6px 10px !important;
    font-size: 12px !important;
    border-radius: 10px !important;
    box-sizing: border-box;
    overflow: hidden;
    justify-content: flex-start;
}

#network-discovery-rule-modal .modal-item > label.wmts-check-toggle input[type="checkbox"] {
    width: 42px !important;
    height: 22px !important;
    min-width: 42px !important;
    min-height: 22px !important;
    flex: 0 0 42px;
}

#network-discovery-rule-modal .modal-item > label.wmts-check-toggle input[type="checkbox"]::before {
    width: 16px;
    height: 16px;
    top: 2px;
    left: 2px;
}

#network-discovery-rule-modal .modal-item > label.wmts-check-toggle input[type="checkbox"]:checked::before {
    transform: translateX(20px);
}

#network-discovery-rule-modal .modal-item > label.wmts-check-toggle input[type="checkbox"]:checked {
    box-shadow: inset 0 1px 1px rgba(9, 34, 87, 0.24) !important;
}

#network-location-modal .modal-item > .admin-input,
#network-location-modal .modal-item > .table-select,
#network-location-modal .modal-item > .wmts-number-with-suffix,
#network-location-modal .modal-item > .wmts-number-with-suffix .admin-input {
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
}

#network-location-modal #network-location-parent,
#network-location-modal #network-location-type,
#network-location-modal #network-location-linked-map {
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
}

#network-location-modal #network-location-parent.wmts-menu-source-select,
#network-location-modal #network-location-type.wmts-menu-source-select,
#network-location-modal #network-location-linked-map.wmts-menu-source-select {
    display: none !important;
}

#network-location-modal #network-location-parent + .wmts-menu-select,
#network-location-modal #network-location-type + .wmts-menu-select,
#network-location-modal #network-location-linked-map + .wmts-menu-select {
    display: flex !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
}

.network-position-row,
.network-status-custom-row,
.network-link-create-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.network-position-row .table-select {
    flex: 1 1 140px;
    min-width: 130px;
}

#network-map-node-modal .network-position-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    width: 100%;
}

#network-map-node-modal .network-status-custom-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    width: 100%;
}

#network-map-node-modal .network-position-row .wmts-check-toggle,
#network-map-node-modal .network-status-custom-row .wmts-check-toggle {
    width: 100%;
    min-width: 0;
    max-width: none;
}

#network-map-node-modal .wmts-check-toggle {
    min-width: 0;
    max-width: 100%;
    display: grid !important;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    column-gap: 8px;
}

#network-map-node-modal .wmts-check-toggle > span {
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#network-map-node-modal .network-position-row .table-select {
    min-width: 0;
    width: 100%;
}

#network-map-node-modal #network-node-modal-hostname-wrap .network-position-row .wmts-check-toggle,
#network-map-node-modal #network-node-modal-ip-wrap .network-position-row .wmts-check-toggle {
    order: 1;
}

#network-map-node-modal #network-node-modal-hostname-wrap .network-position-row .table-select,
#network-map-node-modal #network-node-modal-ip-wrap .network-position-row .table-select {
    order: 2;
}

#network-map-node-modal #network-node-modal-up-wrap .network-status-custom-row,
#network-map-node-modal #network-node-modal-down-wrap .network-status-custom-row {
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
}

#network-map-node-modal #network-node-modal-textbg-wrap .wmts-check-toggle {
    width: 100%;
    min-width: 0;
    flex: unset;
}

#network-map-node-modal #network-node-modal-text-wrap {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    width: 100%;
}

#network-map-node-modal .network-inline-color-toggle,
#network-map-node-modal .network-highlight-toggle-inline,
#network-map-node-modal .network-textbg-toggle {
    width: 100%;
    min-width: 0;
    display: grid !important;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    column-gap: 10px;
    min-height: 38px;
    padding: 6px 10px !important;
    box-sizing: border-box;
}

#network-map-node-modal .network-inline-color-toggle .network-color-swatch,
#network-map-node-modal .network-highlight-toggle-inline .network-color-swatch,
#network-map-node-modal .network-textbg-toggle .network-color-swatch {
    width: 34px !important;
    height: 18px !important;
    min-width: 34px !important;
    min-height: 18px !important;
    border-radius: 6px !important;
}

#network-map-node-modal .network-textbg-toggle .network-textbg-color-inline {
    margin-right: 2px;
}

#network-map-node-modal .network-text-color-row {
    display: flex;
    align-items: center;
    min-height: 38px;
    width: 100%;
    justify-content: flex-end;
}

#network-map-node-modal #network-node-modal-text-wrap {
    align-self: start;
}

#network-map-note-modal input[type="color"].admin-input {
    width: 100%;
    height: 38px;
    padding: 0 !important;
    border-radius: 10px !important;
    overflow: hidden;
    border: 1px solid var(--input-border) !important;
    background: transparent !important;
    appearance: none;
    -webkit-appearance: none;
}

#network-map-note-modal .modal-body input[type="color"].admin-input {
    padding: 0 !important;
    border-radius: 10px !important;
    min-height: 38px !important;
    height: 38px !important;
}

#network-map-note-modal input[type="color"].admin-input::-webkit-color-swatch-wrapper {
    padding: 0;
}

#network-map-note-modal input[type="color"].admin-input::-webkit-color-swatch,
#network-map-note-modal input[type="color"].admin-input::-moz-color-swatch {
    border: 0;
    border-radius: 8px;
}

.network-color-swatch {
    width: 38px;
    height: 38px;
    min-width: 38px;
    padding: 0 !important;
    border: 1px solid var(--input-border) !important;
    border-radius: 10px !important;
    background: transparent !important;
    cursor: pointer;
    overflow: hidden;
    appearance: none;
    -webkit-appearance: none;
    box-sizing: border-box;
}

#network-map-node-modal .modal-body input.network-color-swatch,
#network-map-node-modal .modal-body input[type="color"].network-color-swatch {
    padding: 0 !important;
    border-radius: 10px !important;
    min-height: 38px !important;
    height: 38px !important;
    background: transparent !important;
}

.network-color-swatch::-webkit-color-swatch-wrapper {
    padding: 0;
}

.network-color-swatch::-webkit-color-swatch {
    border: 0;
    border-radius: 8px;
}

.network-color-swatch::-moz-color-swatch {
    border: 0;
    border-radius: 8px;
}

.network-highlight-toggle {
    width: auto;
    min-width: 220px;
}

#network-map-node-modal .network-highlight-toggle {
    width: 100%;
    min-width: 0;
}

.network-inline-input-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

#network-map-node-modal .network-inline-input-tag span {
    display: inline-flex;
    align-items: center;
    min-width: 0;
    justify-content: flex-end;
}

#network-map-node-modal .network-inline-input-tag {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 6px;
    width: 100%;
}

#network-map-node-modal .network-scale-wrap {
    width: 100%;
    min-width: 0;
    max-width: none;
}

#network-map-node-modal .network-link-width-wrap {
    width: 100%;
    min-width: 0;
    max-width: none;
}

#network-map-node-modal #network-node-modal-size-wrap {
    align-self: start;
}

#network-map-node-modal #network-node-modal-size-wrap .wmts-number-with-suffix {
    width: 100% !important;
    max-width: none !important;
    margin-left: 0;
}

#network-map-node-modal #network-node-modal-size-wrap .network-stepper .admin-input {
    width: 100% !important;
    padding-right: 58px !important;
}

#network-map-node-modal #network-node-modal-size-wrap .network-stepper .wmts-number-suffix {
    right: 30px;
}

#network-map-node-modal .network-stepper {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
}

#network-map-node-modal .network-stepper .admin-input {
    padding-right: 76px !important;
}

#network-map-node-modal .network-stepper .wmts-number-suffix {
    right: 34px;
}

#network-map-node-modal .network-scale-wrap .admin-input {
    padding-right: 52px !important;
}

#network-map-node-modal .network-scale-wrap .wmts-number-suffix {
    right: 26px;
    min-width: 16px;
    text-align: center;
}

#network-map-node-modal .network-stepper input[type="number"]::-webkit-outer-spin-button,
#network-map-node-modal .network-stepper input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

#network-map-node-modal .network-stepper input[type="number"] {
    -moz-appearance: textfield;
    padding-right: 52px !important;
}

#network-map-node-modal .network-stepper-buttons {
    position: absolute;
    right: 0;
    top: 0;
    width: 24px;
    height: 100%;
    display: flex;
    flex-direction: column;
    border-left: 1px solid var(--input-border);
    border-radius: 0 8px 8px 0;
    overflow: hidden;
    background: var(--input-bg);
    z-index: 3;
    box-sizing: border-box;
    box-shadow: inset 0 0 0 1px var(--input-border);
}

#network-map-node-modal .network-stepper-btn {
    flex: 1;
    border: 0;
    background: transparent;
    color: var(--text-muted);
    font-size: 10px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
}

#network-map-node-modal .network-stepper-btn:hover {
    background: var(--surface-hover);
    color: var(--text-primary);
}

#network-map-node-modal .modal-item.is-disabled,
#network-map-node-modal .modal-item.is-disabled * {
    opacity: 0.65;
}

#network-map-node-modal .modal-item.is-disabled input,
#network-map-node-modal .modal-item.is-disabled select,
#network-map-node-modal .modal-item.is-disabled button {
    pointer-events: none;
}

#network-map-node-modal .network-link-create-row . {
    height: 38px;
    align-self: center;
    white-space: nowrap;
}

#network-map-node-modal .network-link-inline-label-row {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    line-height: 1;
    white-space: nowrap;
}

#network-map-node-modal .network-link-inline-label-row > span {
    display: inline-flex;
    align-items: center;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    line-height: 1;
}

/* Node modal canonical layout (single source of truth) */
#network-map-node-modal .modal-grid > .modal-item {
    min-width: 0;
}

#network-map-node-modal .network-position-row,
#network-map-node-modal .network-status-custom-row {
    display: block;
    width: 100%;
    min-width: 0;
}

#network-map-node-modal .wmts-check-toggle {
    min-height: 38px;
    height: auto;
    box-sizing: border-box;
    align-items: center !important;
    padding: 6px 10px !important;
    overflow: visible;
}

#network-map-node-modal .wmts-check-toggle input[type="checkbox"] {
    align-self: center;
    margin: 0 !important;
}

#network-map-node-modal .wmts-check-toggle > span {
    display: inline-flex;
    align-items: center;
    min-height: 18px;
    line-height: 1.2;
    padding-bottom: 1px;
}

#network-map-node-modal .network-highlight-toggle-inline > span,
#network-map-node-modal .network-textbg-toggle > span {
    text-transform: none !important;
    letter-spacing: normal !important;
}

#network-map-node-modal .network-position-toggle-inline {
    display: grid !important;
    grid-template-columns: auto minmax(0, 1fr) 240px;
    column-gap: 10px;
    width: 100%;
}

#network-map-node-modal .network-position-toggle-inline .network-embedded-select {
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    height: 30px !important;
    min-height: 30px !important;
    padding-left: 12px !important;
    padding-right: 34px !important;
}

#network-map-node-modal .network-highlight-toggle-inline {
    display: grid !important;
    grid-template-columns: auto minmax(0, 1fr) auto 240px;
    column-gap: 10px;
    width: 100% !important;
    max-width: none !important;
    padding: 6px 10px !important;
}

#network-map-node-modal .network-inline-input-tag-embedded {
    width: 232px !important;
    min-width: 232px !important;
    max-width: 232px !important;
    margin-left: auto;
    margin-right: 0;
    display: grid !important;
    grid-template-columns: 46px minmax(0, 1fr);
    align-items: center;
    gap: 4px;
    justify-self: end;
}

#network-map-node-modal .network-inline-input-tag-embedded > span {
    white-space: nowrap;
    justify-content: flex-end;
}

#network-map-node-modal .network-inline-input-tag-embedded .network-scale-wrap,
#network-map-node-modal .network-inline-input-tag-embedded .network-stepper,
#network-map-node-modal .network-inline-input-tag-embedded .wmts-number-with-suffix {
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
}

#network-map-node-modal .network-inline-input-tag-embedded .network-stepper .admin-input {
    width: 100% !important;
    height: 30px !important;
    min-height: 30px !important;
    padding-right: 56px !important;
}

#network-map-node-modal .network-inline-input-tag-embedded .network-stepper .wmts-number-suffix {
    position: absolute !important;
    right: 30px !important;
    top: 50% !important;
    transform: translateY(-50%);
    z-index: 4;
}

#network-map-node-modal .network-inline-input-tag-embedded .network-stepper .network-stepper-buttons {
    position: absolute !important;
    top: 0 !important;
    right: 0 !important;
    width: 24px !important;
    height: 100% !important;
    z-index: 5;
}

#network-map-node-modal .network-highlight-toggle-inline input[type="color"].network-color-swatch,
#network-map-node-modal .network-textbg-toggle input[type="color"].network-color-swatch {
    width: 34px !important;
    min-width: 34px !important;
    height: 34px !important;
    min-height: 34px !important;
    border-radius: 10px !important;
    padding: 0 !important;
    margin: 0 !important;
    display: block;
    align-self: center;
}

#network-map-node-modal .network-textbg-toggle {
    display: grid !important;
    grid-template-columns: auto minmax(0, 1fr) auto;
    column-gap: 10px;
    width: 100% !important;
    max-width: none !important;
}

#network-map-node-modal .network-text-color-row {
    justify-content: flex-start !important;
}

#network-map-node-modal #network-node-modal-text-controls-wrap {
    width: 100%;
}

#network-map-node-modal #network-node-modal-text-controls-wrap .network-text-controls-row {
    display: block;
    width: 100%;
}

#network-map-node-modal #network-node-modal-text-controls-wrap #network-node-modal-textbg-wrap {
    width: 100%;
    min-width: 0;
}

#network-map-node-modal #network-node-modal-text-controls-wrap .network-text-inline-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: stretch;
    gap: 8px;
    width: 100%;
    padding-right: 8px;
    box-sizing: border-box;
}

#network-map-node-modal #network-node-modal-text-controls-wrap #network-node-modal-textbg-wrap .network-textbg-toggle {
    width: 100% !important;
    max-width: none !important;
    min-width: 0;
}

#network-map-node-modal #network-node-modal-text-controls-wrap #network-node-modal-text-wrap {
    width: auto;
    min-width: 0;
    margin: 0 !important;
    padding: 0 !important;
}

#network-map-node-modal #network-node-modal-text-controls-wrap #network-node-modal-textbg-wrap > label,
#network-map-node-modal #network-node-modal-text-controls-wrap #network-node-modal-text-wrap > label {
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-secondary);
    margin: 0 0 6px;
    white-space: nowrap;
}

#network-map-node-modal #network-node-modal-text-controls-wrap #network-node-modal-textbg-wrap .network-textbg-toggle {
    width: 100% !important;
    max-width: none !important;
}

#network-map-node-modal #network-node-modal-text-controls-wrap #network-node-modal-text-wrap .network-textcolor-toggle {
    width: auto !important;
    min-width: 132px;
    max-width: none !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    column-gap: 10px;
    padding: 6px 10px !important;
}

#network-map-node-modal #network-node-modal-text-controls-wrap #network-node-modal-text-wrap .network-textcolor-toggle > span {
    text-transform: none !important;
    letter-spacing: normal !important;
}

#network-map-node-modal #network-node-modal-text-controls-wrap #network-node-modal-text-wrap .network-textcolor-toggle .network-color-swatch {
    width: 34px !important;
    min-width: 34px !important;
    height: 34px !important;
    min-height: 34px !important;
    margin: 0 !important;
    align-self: center;
}

/* Node modal interaction hardening + themed alpha control */
#network-map-node-modal .network-position-row {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) 240px;
    align-items: center;
    gap: 10px;
    width: 100%;
}

#network-map-node-modal #network-node-modal-hostname-wrap .network-position-row > .network-position-toggle-inline,
#network-map-node-modal #network-node-modal-ip-wrap .network-position-row > .network-position-toggle-inline {
    order: 1 !important;
    grid-column: 1 !important;
    justify-self: stretch;
}

#network-map-node-modal #network-node-modal-hostname-wrap .network-position-row > .network-position-select-inline,
#network-map-node-modal #network-node-modal-ip-wrap .network-position-row > .network-position-select-inline {
    order: 2 !important;
    grid-column: 2 !important;
    justify-self: stretch;
}

#network-map-node-modal #network-node-modal-hostname-wrap .network-position-row > .wmts-menu-select,
#network-map-node-modal #network-node-modal-ip-wrap .network-position-row > .wmts-menu-select {
    order: 2 !important;
    grid-column: 2 !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    justify-self: stretch;
}

#network-map-node-modal .network-position-toggle-inline {
    display: grid !important;
    grid-template-columns: auto minmax(0, 1fr) !important;
    column-gap: 10px;
    width: 100%;
}

#network-map-node-modal .network-position-select-inline {
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    height: 30px !important;
    min-height: 30px !important;
}

#network-map-node-modal .network-textbg-toggle {
    grid-template-columns: auto minmax(0, 1fr) auto auto !important;
    column-gap: 10px !important;
}

#network-map-node-modal .network-alpha-inline {
    display: grid;
    grid-template-columns: auto minmax(84px, 1fr) auto;
    align-items: center;
    gap: 6px;
    min-width: 220px;
    max-width: 290px;
    padding: 4px 8px;
    border: 1px solid color-mix(in srgb, var(--brand-primary) 45%, var(--border-color));
    border-radius: 8px;
    background: linear-gradient(180deg,
        color-mix(in srgb, var(--surface-panel-alt) 90%, transparent) 0%,
        color-mix(in srgb, var(--surface-hover) 35%, var(--surface-panel-alt)) 100%);
    box-shadow: inset 0 1px 0 color-mix(in srgb, var(--brand-primary) 12%, transparent);
}

#network-map-node-modal .network-alpha-inline-label,
#network-map-node-modal .network-alpha-inline-value {
    font-size: 11px;
    line-height: 1;
    color: var(--text-secondary);
    white-space: nowrap;
}

#network-map-node-modal .network-alpha-inline-value {
    min-width: 32px;
    text-align: right;
    color: var(--text-primary);
    font-weight: 600;
}

#network-map-node-modal .network-alpha-inline-slider {
    width: 100%;
    height: 8px;
    border-radius: 999px;
    appearance: none;
    outline: none;
    border: 1px solid color-mix(in srgb, var(--brand-primary) 30%, var(--border-color));
    background: linear-gradient(90deg,
        color-mix(in srgb, var(--surface-main) 90%, transparent) 0%,
        color-mix(in srgb, var(--brand-primary) 80%, var(--surface-hover)) 100%);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--surface-hover) 28%, transparent);
}

#network-map-node-modal .network-alpha-inline-slider::-webkit-slider-thumb {
    appearance: none;
    width: 8px;
    height: 10px;
    margin-top: -1px;
    border-radius: 2px;
    border: 2px solid color-mix(in srgb, var(--brand-primary) 78%, #fff 22%);
    background: var(--surface-main);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-primary) 32%, transparent);
    cursor: pointer;
}

#network-map-node-modal .network-alpha-inline-slider::-moz-range-thumb {
    width: 8px;
    height: 10px;
    border-radius: 2px;
    border: 2px solid color-mix(in srgb, var(--brand-primary) 78%, #fff 22%);
    background: var(--surface-main);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-primary) 32%, transparent);
    cursor: pointer;
}

#network-map-node-modal .network-highlight-color-inline,
#network-map-node-modal .network-textbg-color-inline {
    width: 34px !important;
    min-width: 34px !important;
    height: 34px !important;
    min-height: 34px !important;
    border-radius: 10px !important;
    border: 1px solid color-mix(in srgb, var(--border-color) 80%, transparent) !important;
    background: color-mix(in srgb, var(--surface-main) 70%, transparent) !important;
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--surface-hover) 45%, transparent);
}

/* Global themed color picker */
.wmts-theme-color-native-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

.wmts-theme-color-trigger {
    width: 34px;
    min-width: 34px;
    height: 34px;
    min-height: 34px;
    border-radius: 10px;
    border: 1px solid color-mix(in srgb, var(--border-color) 82%, transparent);
    background: var(--surface-main);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--surface-hover) 45%, transparent);
    cursor: pointer;
}

.wmts-theme-color-popover {
    position: fixed;
    z-index: 25000;
    width: 300px;
    max-width: calc(100vw - 16px);
    padding: 10px;
    border-radius: 12px;
    border: 1px solid color-mix(in srgb, var(--brand-primary) 45%, var(--border-color));
    background: color-mix(in srgb, var(--surface-panel-alt) 94%, #000 6%);
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.48), inset 0 1px 0 color-mix(in srgb, var(--brand-primary) 18%, transparent);
}

.wmts-theme-color-head {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr);
    gap: 8px;
    margin-bottom: 10px;
}

.wmts-theme-color-preview {
    width: 38px;
    height: 38px;
    border-radius: 9px;
    border: 1px solid var(--border-color);
}

.wmts-theme-color-hex {
    height: 38px !important;
    font-family: Consolas, "Courier New", monospace;
    font-size: 13px;
    letter-spacing: 0.02em;
}

.wmts-theme-color-grid {
    display: grid;
    gap: 8px;
}

.wmts-theme-color-wheel-wrap {
    display: flex;
    justify-content: center;
    margin-bottom: 10px;
}

.wmts-theme-color-wheel {
    position: relative;
    width: 108px;
    height: 108px;
    border-radius: 50%;
    border: 1px solid color-mix(in srgb, var(--border-color) 86%, transparent);
    background:
        radial-gradient(circle at center, #ffffff 0%, rgba(255, 255, 255, 0) 72%),
        conic-gradient(
            #ff0000 0deg,
            #ffff00 60deg,
            #00ff00 120deg,
            #00ffff 180deg,
            #0000ff 240deg,
            #ff00ff 300deg,
            #ff0000 360deg
        );
    cursor: crosshair;
    padding: 0;
}

.wmts-theme-color-wheel-thumb {
    position: absolute;
    width: 12px;
    height: 12px;
    margin-left: -6px;
    margin-top: -6px;
    border-radius: 50%;
    border: 2px solid #fff;
    background: transparent;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.55);
    pointer-events: none;
}

.wmts-theme-color-grid > label {
    display: grid;
    gap: 4px;
    color: var(--text-secondary);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 700;
}

.wmts-theme-color-grid input[type="range"] {
    width: 100%;
    height: 8px;
}

.wmts-theme-color-swatches {
    margin-top: 10px;
    display: grid;
    grid-template-columns: repeat(8, minmax(0, 1fr));
    gap: 6px;
}

.wmts-theme-color-swatch {
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 8px;
    border: 1px solid color-mix(in srgb, var(--border-color) 88%, transparent);
    cursor: pointer;
}

.wmts-theme-color-actions {
    margin-top: 10px;
    display: flex;
    justify-content: flex-end;
}

/* Current Links table: force global table shell + compact width stepper */
#network-map-node-modal #network-node-modal-current-links-wrap table {
    width: 100% !important;
    table-layout: auto !important;
    border-collapse: separate !important;
    border-spacing: 0 !important;
    border: 1px solid var(--table-cell-border) !important;
    border-radius: 10px !important;
    overflow: hidden !important;
    background: var(--table-bg) !important;
    margin: 0 !important;
}

#network-map-node-modal #network-node-modal-current-links-wrap thead th {
    background: var(--table-head-bg) !important;
    color: var(--text-muted) !important;
}

#network-map-node-modal #network-node-modal-current-links-wrap tbody tr:nth-child(odd):not(.low-stock-row) {
    background: var(--table-row-odd) !important;
}

#network-map-node-modal #network-node-modal-current-links-wrap tbody tr:nth-child(even):not(.low-stock-row) {
    background: var(--table-row-even) !important;
}

#network-map-node-modal #network-node-modal-current-links-wrap td:nth-child(4) {
    width: 170px;
}

#network-map-node-modal #network-node-modal-current-links-wrap .network-link-width-wrap {
    width: 120px !important;
    min-width: 120px !important;
    max-width: 120px !important;
    margin: 0 auto 0 0 !important;
}

#network-map-node-modal #network-node-modal-current-links-wrap .network-link-width-wrap .admin-input {
    width: 100% !important;
}

@media (max-width: 1120px) {
    #network-map-node-modal .modal-grid {
        grid-template-columns: repeat(2, minmax(220px, 1fr));
    }

    #network-map-node-modal #network-node-modal-host-wrap,
    #network-map-node-modal #network-node-modal-label-wrap,
    #network-map-node-modal #network-node-modal-icon-wrap,
    #network-map-node-modal #network-node-modal-size-wrap,
    #network-map-node-modal #network-node-modal-hostname-wrap,
    #network-map-node-modal #network-node-modal-ip-wrap,
    #network-map-node-modal #network-node-modal-up-wrap,
    #network-map-node-modal #network-node-modal-down-wrap {
        grid-column: auto;
    }

    #network-map-node-modal #network-node-modal-text-controls-wrap {
        grid-column: 1 / -1;
    }

    #network-map-node-modal #network-node-modal-create-link-wrap,
    #network-map-node-modal #network-node-modal-current-links-wrap {
        grid-column: 1 / -1;
    }
}

@media (max-width: 760px) {
    #network-map-node-modal .modal-grid,
    #network-map-create-modal .network-map-create-modal-grid,
    #network-host-modal .modal-grid,
    #network-function-modal .modal-grid,
    #script-host-modal .modal-grid,
    #network-discovery-rule-modal .modal-grid,
    #network-map-host-modal .modal-grid,
    #network-location-modal .modal-grid,
    #add-inventory-modal .inventory-asset-modal-grid,
    #edit-inventory-modal .inventory-asset-modal-grid,
    #device-create-modal .modal-grid,
    #device-edit-modal .modal-grid,
    #device-model-modal .device-model-modal-grid {
        grid-template-columns: 1fr;
    }

    #network-map-create-modal .network-map-create-image-item .network-map-create-image-row {
        grid-template-columns: 1fr;
        align-items: start;
    }

    #device-model-modal .device-model-batch-add-row {
        grid-template-columns: 1fr;
    }

    #device-job-modal .device-job-meta-grid {
        grid-template-columns: 1fr;
    }

    #device-job-modal .device-job-modal-content {
        width: 100% !important;
        max-width: 100% !important;
    }

    #device-job-modal .device-job-section-header {
        flex-wrap: wrap;
        align-items: flex-start;
    }

    #device-job-modal .device-job-add-photo-btn {
        max-width: 100%;
    }

    #device-job-modal .device-job-image-card {
        width: 96px;
        height: 74px;
    }
}

/* Node modal switches intentionally inherit the global .wmts-check-toggle skin */

/* Modal input defaults can bleed into checkboxes; force exact global switch metrics in modals */
.modal-body .wmts-check-toggle input[type="checkbox"] {
    appearance: none !important;
    -webkit-appearance: none !important;
    width: 42px !important;
    height: 22px !important;
    min-height: 22px !important;
    padding: 0 !important;
    margin: 0 !important;
    border-radius: 999px !important;
    border: 1px solid var(--switch-track-off-border) !important;
    background: linear-gradient(180deg, var(--switch-track-off-start) 0%, var(--switch-track-off-end) 100%) !important;
    position: relative !important;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.24) !important;
    box-sizing: border-box !important;
}

.modal-body .wmts-check-toggle input[type="checkbox"]::before {
    content: "" !important;
    position: absolute !important;
    width: 16px !important;
    height: 16px !important;
    top: 2px !important;
    left: 2px !important;
    border-radius: 50% !important;
    background: linear-gradient(180deg, var(--switch-knob-start) 0%, var(--switch-knob-end) 100%) !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.32) !important;
    transition: transform 0.16s ease !important;
}

.modal-body .wmts-check-toggle input[type="checkbox"]:checked {
    background: linear-gradient(
        180deg,
        color-mix(in srgb, var(--tab-active-bg-start) 50%, transparent) 0%,
        color-mix(in srgb, var(--tab-active-bg-end) 50%, transparent) 100%
    ) !important;
    border-color: color-mix(in srgb, var(--tab-active-border) 50%, transparent) !important;
    box-shadow: inset 0 1px 1px rgba(9, 34, 87, 0.24), 0 0 0 2px var(--switch-track-on-glow) !important;
}

.modal-body .wmts-check-toggle input[type="checkbox"]:checked::before {
    transform: translateX(20px) !important;
}

/* Dashboard grid/widget layer restored (missing from current build) */
.dashboard-shell {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

#view-home.tab-content {
    overflow-x: hidden;
}

#view-home .admin-section,
#view-home .dashboard-shell {
    width: 100%;
    max-width: none;
    min-width: 0;
    margin-left: 0;
    margin-right: 0;
}

#view-home #dashboard-grid {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    overflow-x: hidden;
}

.dashboard-toolbar {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
}

.dashboard-toolbar-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: nowrap;
    overflow-x: auto;
    width: 100%;
    justify-content: flex-end;
}

.dashboard-toolbar-presets {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
    margin-right: auto;
}

.dashboard-toolbar-presets .table-select {
    min-width: 150px;
    height: 36px;
}

.dashboard-toolbar-presets .wmts-check-toggle {
    min-height: 36px;
}

.dashboard-intro {
    color: var(--text-muted);
    font-size: 13px;
    margin: 0;
}

.dashboard-fullscreen-controls {
    position: fixed;
    top: 12px;
    right: 12px;
    display: none;
    align-items: center;
    gap: 8px;
    z-index: 2000;
    opacity: 1;
    transition: opacity 0.2s ease;
}

.dashboard-fullscreen-controls.is-idle {
    opacity: 0;
    pointer-events: none;
}

.dashboard-fullscreen-edit-icon,
.dashboard-fullscreen-exit {
    width: 34px;
    height: 34px;
    padding: 0;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.dashboard-fullscreen-edit-icon {
    font-size: 15px;
}

.dashboard-fullscreen-exit {
    border-radius: 6px;
    border: 1px solid var(--app-border);
    background: var(--surface-panel);
    color: var(--text-primary);
    font-size: 16px;
}

body.dashboard-fullscreen-active {
    overflow: hidden !important;
}

body.dashboard-fullscreen-active #main-dashboard .tab-container,
body.dashboard-fullscreen-active #view-home h2,
body.dashboard-fullscreen-active #view-home .dashboard-toolbar {
    display: none !important;
}

.dashboard-fullscreen-stage {
    position: fixed;
    inset: 0;
    z-index: 3200;
    display: none;
    background: var(--surface-main);
    padding: 10px;
    box-sizing: border-box;
}

.dashboard-fullscreen-stage.is-open {
    display: block;
}

.dashboard-fullscreen-stage #dashboard-grid {
    min-height: 0;
    height: calc(100vh - 20px);
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
    overflow-y: scroll;
    scrollbar-gutter: stable both-edges;
}

.dashboard-fullscreen-stage .dashboard-fullscreen-controls {
    display: inline-flex !important;
}

.dashboard-grid {
    --dashboard-grid-rows: 20;
    --dashboard-grid-cols: 20;
    --dashboard-grid-gap: 8px;
    --dashboard-cell-size: 32px;
    display: grid;
    grid-template-columns: repeat(var(--dashboard-grid-cols), minmax(0, 1fr));
    grid-auto-rows: var(--dashboard-cell-size);
    gap: var(--dashboard-grid-gap);
    min-height: calc((var(--dashboard-cell-size) * var(--dashboard-grid-rows)) + (var(--dashboard-grid-gap) * (var(--dashboard-grid-rows) - 1)));
    padding: 4px;
}

.dashboard-grid.editing {
    background-image:
        linear-gradient(to right, rgba(125, 155, 188, 0.15) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(125, 155, 188, 0.15) 1px, transparent 1px);
    background-size: var(--dashboard-cell-size) var(--dashboard-cell-size);
    background-position: 4px 4px;
}

.dashboard-widget {
    position: relative;
    min-width: 0;
    min-height: 0;
    border: 1px solid var(--border-panel);
    border-radius: 10px;
    background: var(--surface-panel-alt);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.dashboard-widget-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border-subtle);
    background: color-mix(in srgb, var(--surface-panel-alt) 86%, #fff 14%);
}

.dashboard-widget-title {
    margin: 0;
    font-size: 13px;
    line-height: 1.2;
    color: var(--text-primary);
    font-weight: 700;
}

.dashboard-widget-actions {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.dashboard-widget-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    padding: 10px 12px;
}

.dashboard-map-widget {
    position: relative;
    padding: 0;
    margin-top: 0;
    overflow: hidden;
    border: 1px solid var(--border-panel);
    background: var(--surface-panel-alt);
    width: 100%;
    height: 100%;
    min-height: 0;
}

.dashboard-map-canvas {
    display: block;
    width: 100%;
    height: 100%;
    background: var(--dashboard-map-canvas-bg, var(--surface-panel));
}

.dashboard-map-back-btn {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 3;
    height: 30px !important;
    padding: 0 12px !important;
    border-radius: 8px !important;
    font-size: 12px !important;
    font-weight: 600 !important;
}

.dashboard-widget-remove {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    border-radius: 6px;
    border: 1px solid rgba(248, 113, 113, 0.35);
    background: rgba(127, 29, 29, 0.35);
    color: var(--table-immediate-text);
    cursor: pointer;
    z-index: 3;
    font-size: 0;
    line-height: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.dashboard-widget-remove::before {
    content: "\00D7";
    font-size: 16px;
    line-height: 1;
    font-weight: 700;
}

.dashboard-widget-remove:hover {
    background: rgba(153, 27, 27, 0.45);
    border-color: rgba(248, 113, 113, 0.5);
}

.dashboard-widget-move {
    position: absolute;
    top: 8px;
    right: 36px;
    width: 24px;
    height: 24px;
    border-radius: 6px;
    border: 1px solid var(--app-border);
    background: var(--surface-panel);
    color: var(--text-muted);
    cursor: pointer;
    z-index: 3;
}

.dashboard-widget-resize {
    position: absolute;
    right: 0;
    bottom: 0;
    width: 16px;
    height: 16px;
    border: 0;
    border-radius: 8px 0 8px 0;
    background: linear-gradient(135deg, transparent 0 48%, var(--brand-primary) 49% 100%);
    cursor: nwse-resize;
}

.dashboard-empty-slot {
    border: 1px dashed var(--app-border-strong);
    border-radius: 8px;
    background: color-mix(in srgb, var(--surface-panel) 74%, transparent);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-weight: 700;
    cursor: pointer;
}

.dashboard-empty-slot:hover {
    background: color-mix(in srgb, var(--brand-primary) 26%, var(--surface-panel));
    color: var(--text-primary);
}

.dashboard-empty {
    grid-column: 1 / -1;
    border: 1px dashed var(--app-border);
    border-radius: 10px;
    padding: 14px;
    color: var(--text-muted);
}

.dashboard-editor-root {
    display: grid;
    gap: 12px;
}

.dashboard-toolbar-presets .dashboard-widget-scale-wrap {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 36px;
    padding: 4px 8px;
    border: 1px solid var(--app-border);
    border-radius: 10px;
    background: color-mix(in srgb, var(--surface-panel-alt) 92%, #fff 8%);
}

.dashboard-widget-scale-label {
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.dashboard-widget-scale-wrap button {
    width: 34px !important;
    min-width: 34px !important;
    height: 34px !important;
    min-height: 34px !important;
    padding: 0 !important;
    font-size: 17px !important;
    line-height: 1 !important;
    justify-content: center !important;
}

.dashboard-widget-scale-wrap .dashboard-widget-scale-reset {
    width: auto !important;
    min-width: 62px !important;
    padding: 0 10px !important;
    font-size: 12px !important;
    font-weight: 700;
}

#dashboard-widget-scale-range {
    width: clamp(140px, 18vw, 220px);
}

.dashboard-widget-scale-value {
    min-width: 62px;
    text-align: right;
    font-weight: 700;
    color: var(--text-primary);
}

.dashboard-widget-picker-shell {
    border: 1px solid var(--app-border);
    border-radius: 14px;
    padding: 10px;
    background: var(--surface-main);
    width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

.dashboard-widget-tabs {
    margin-bottom: 10px;
    width: 100%;
    overflow: visible;
    white-space: normal;
}

.dashboard-widget-tabs.sub-tab-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    width: 100%;
    box-sizing: border-box;
    border-radius: 14px;
    align-items: stretch;
}

.dashboard-widget-tabs .sub-tab {
    flex: 0 1 auto;
    max-width: 100%;
}

.dashboard-widget-tab-panels {
    min-height: 220px;
    width: 100%;
}

.dashboard-editor-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 10px;
}

.dashboard-editor-item {
    border: 1px solid var(--border-panel);
    border-radius: 10px;
    background: var(--surface-panel-alt);
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 220px;
}

.dashboard-editor-item small {
    color: var(--text-muted);
}

.dashboard-editor-actions {
    margin-top: auto;
    display: grid;
    gap: 8px;
    align-content: end;
}

.dashboard-editor-item .save-btn,
.dashboard-editor-item .btn-close,
.dashboard-editor-item .btn-delete {
    width: 100% !important;
    height: 40px !important;
    min-height: 40px !important;
    padding: 10px 14px !important;
    justify-content: center !important;
    box-sizing: border-box !important;
}

.dashboard-editor-item .table-select {
    height: 40px !important;
    min-height: 40px !important;
    box-sizing: border-box !important;
}

.dashboard-widget-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.dashboard-widget-controls .admin-input {
    flex: 1 1 220px;
    min-height: 38px;
}

.dashboard-widget-controls button,
.dashboard-widget-controls .save-btn,
.dashboard-widget-controls .btn-close,
.dashboard-widget-controls .btn-delete {
    height: 38px !important;
    min-height: 38px !important;
    padding: 8px 14px !important;
    box-sizing: border-box !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.dashboard-widget-controls-search .save-btn {
    min-width: 120px;
}

.dashboard-widget-body table,
.dashboard-mini-table {
    width: 100%;
    table-layout: fixed !important;
    border-collapse: separate;
    border-spacing: 0;
    border: 1px solid var(--table-cell-border) !important;
    border-radius: 10px;
    overflow: hidden;
    clip-path: inset(0 round 10px);
    margin-bottom: 0 !important;
    background: var(--table-bg) !important;
}

.dashboard-widget-body table thead th,
.dashboard-mini-table thead th,
.dashboard-widget-body table tbody td,
.dashboard-mini-table tbody td {
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.dashboard-widget-body table thead th,
.dashboard-mini-table thead th {
    background: var(--table-head-bg-strong) !important;
    color: var(--text-muted) !important;
    font-size: 11px !important;
    font-weight: 500 !important;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 12px 14px !important;
    border-bottom: 1px solid var(--table-cell-border) !important;
}

.dashboard-widget-body table tbody td,
.dashboard-mini-table tbody td {
    background: transparent !important;
    color: var(--text-primary) !important;
    font-size: 13px !important;
    line-height: 1.35 !important;
    padding: 11px 14px !important;
    border-bottom: 1px solid var(--table-cell-border) !important;
}

.dashboard-widget-body table tbody tr:nth-child(odd):not(.low-stock-row):not(.table-row-warning):not(.table-row-immediate) td,
.dashboard-mini-table tbody tr:nth-child(odd):not(.low-stock-row):not(.table-row-warning):not(.table-row-immediate) td {
    background: var(--table-row-bg-strong) !important;
}

.dashboard-widget-body table tbody tr:nth-child(even):not(.low-stock-row):not(.table-row-warning):not(.table-row-immediate) td,
.dashboard-mini-table tbody tr:nth-child(even):not(.low-stock-row):not(.table-row-warning):not(.table-row-immediate) td {
    background: var(--table-row-even-strong) !important;
}

.dashboard-widget-body table tbody tr:hover:not(.low-stock-row):not(.table-row-warning):not(.table-row-immediate) td,
.dashboard-mini-table tbody tr:hover:not(.low-stock-row):not(.table-row-warning):not(.table-row-immediate) td {
    background: var(--table-row-hover-strong) !important;
}

.dashboard-widget-body table tbody tr.table-row-warning td,
.dashboard-mini-table tbody tr.table-row-warning td {
    background: var(--table-warning-bg) !important;
    border-bottom-color: var(--table-warning-border) !important;
}

.dashboard-widget-body table tbody tr.table-row-warning:hover td,
.dashboard-mini-table tbody tr.table-row-warning:hover td {
    background: var(--table-warning-hover-bg) !important;
}

.dashboard-widget-body table tbody tr.table-row-immediate td,
.dashboard-widget-body table tbody tr.low-stock-row td,
.dashboard-mini-table tbody tr.table-row-immediate td,
.dashboard-mini-table tbody tr.low-stock-row td {
    background: var(--table-immediate-bg) !important;
    border-bottom-color: var(--table-immediate-border) !important;
}

.dashboard-widget-body table tbody tr.table-row-immediate:hover td,
.dashboard-widget-body table tbody tr.low-stock-row:hover td,
.dashboard-mini-table tbody tr.table-row-immediate:hover td,
.dashboard-mini-table tbody tr.low-stock-row:hover td {
    background: var(--table-immediate-hover-bg) !important;
}

.dashboard-widget-body table tbody td.sev-warning,
.dashboard-mini-table tbody td.sev-warning {
    color: var(--table-warning-text) !important;
    font-weight: 700;
}

.dashboard-widget-body table tbody td.sev-immediate,
.dashboard-mini-table tbody td.sev-immediate {
    color: var(--table-immediate-text) !important;
    font-weight: 700;
}

@media (max-width: 900px) {
    .dashboard-grid {
        --dashboard-grid-cols: 2;
    }
}

/* Status / pills */
.depthub-job-status-pill,
.depthub-wall-status-pill,
.network-status-badge,
.system-license-chip,
.status-pill,
.dashboard-status-badge {
    border-radius: 999px;
    font-weight: 700;
}

.depthub-job-status-pill,
.network-status-badge,
.status-pill,
.dashboard-status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 10px;
    font-size: 11px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    border: 1px solid transparent;
    background: var(--status-pill-bg, color-mix(in srgb, var(--surface-panel) 70%, transparent));
    color: var(--status-pill-text, var(--text-primary));
}

.status-pill.is-ok,
.dashboard-status-badge.is-ok,
.dashboard-status-badge.is-success,
.status-pill.is-open,
.status-pill.is-up,
.status-pill.is-success,
.network-status-badge.is-up,
.network-status-badge.is-open,
.network-status-badge.is-success {
    --status-pill-bg: color-mix(in srgb, var(--success-primary) 22%, transparent);
    --status-pill-text: color-mix(in srgb, var(--success-primary) 82%, var(--text-primary) 18%);
    border-color: color-mix(in srgb, var(--success-primary) 52%, transparent);
}

.status-pill.is-warn,
.status-pill.is-warning,
.status-pill.is-amber,
.status-pill.is-checked_out,
.status-pill.is-queue,
.status-pill.is-custom,
.dashboard-status-badge.is-warn,
.dashboard-status-badge.is-warning,
.network-status-badge.is-warn,
.network-status-badge.is-warning,
.network-status-badge.is-unknown {
    --status-pill-bg: color-mix(in srgb, var(--warning-primary) 20%, transparent);
    --status-pill-text: color-mix(in srgb, var(--warning-primary) 82%, var(--text-primary) 18%);
    border-color: color-mix(in srgb, var(--warning-primary) 48%, transparent);
}

.status-pill.is-failed,
.status-pill.is-failure,
.status-pill.is-error,
.status-pill.is-closed,
.status-pill.is-down,
.dashboard-status-badge.is-failed,
.dashboard-status-badge.is-error,
.network-status-badge.is-down,
.network-status-badge.is-failed {
    --status-pill-bg: color-mix(in srgb, var(--danger-primary) 20%, transparent);
    --status-pill-text: color-mix(in srgb, var(--danger-primary) 80%, var(--text-primary) 20%);
    border-color: color-mix(in srgb, var(--danger-primary) 46%, transparent);
}

.status-tab {
    position: relative;
    padding: 6px 14px;
    border-radius: 999px;
}

.status-tab[data-status="open"] {
    color: color-mix(in srgb, var(--success-primary) 76%, var(--text-primary) 24%);
    border-color: color-mix(in srgb, var(--success-primary) 42%, transparent);
}

.status-tab[data-status="closed"] {
    color: color-mix(in srgb, var(--danger-primary) 76%, var(--text-primary) 24%);
    border-color: color-mix(in srgb, var(--danger-primary) 40%, transparent);
}

.status-tab:not([data-status="open"]):not([data-status="closed"]) {
    color: color-mix(in srgb, var(--warning-primary) 78%, var(--text-primary) 22%);
    border-color: color-mix(in srgb, var(--warning-primary) 38%, transparent);
}

.status-tab.active[data-status="open"] {
    background: color-mix(in srgb, var(--success-primary) 22%, transparent);
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--success-primary) 34%, transparent) inset;
}

.status-tab.active[data-status="closed"] {
    background: color-mix(in srgb, var(--danger-primary) 20%, transparent);
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--danger-primary) 34%, transparent) inset;
}

.status-tab.active:not([data-status="open"]):not([data-status="closed"]) {
    background: color-mix(in srgb, var(--warning-primary) 20%, transparent);
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--warning-primary) 34%, transparent) inset;
}

/* Shared module content cards */
.depthub-wall-post,
.depthub-notes-list-wrap,
.depthub-note-editor,
.depthub-kb-card,
.depthub-kb-empty,
.network-map-canvas-wrap,
.network-map-frame {
    background: var(--surface-panel-alt) !important;
    border: 1px solid var(--border-panel) !important;
    border-radius: var(--module-radius);
}

/* Dept Hub wall + KB shared sizing/layout */
.depthub-wall-feed {
    display: grid;
    gap: 10px;
}

.depthub-wall-post {
    padding: 16px 18px;
    background: var(--depthub-post-bg) !important;
    border-color: var(--depthub-post-border) !important;
}

.depthub-wall-post.is-alt {
    background: var(--depthub-post-alt-bg) !important;
}

.depthub-wall-post-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.depthub-wall-post-head-actions {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.depthub-wall-post-author {
    font-size: 12px;
    color: var(--depthub-post-muted);
}

.depthub-wall-post-meta {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    margin-bottom: 2px;
    color: var(--depthub-post-muted);
    font-size: 12px;
}

.depthub-wall-post-author-name {
    color: var(--text-primary);
    font-weight: 700;
}

.depthub-wall-post-author-time {
    color: var(--depthub-post-muted);
}

.depthub-avatar {
    display: inline-block;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid var(--input-border);
    object-fit: cover;
    flex: 0 0 auto;
    background: var(--input-bg);
}

.depthub-avatar-post {
    width: 36px;
    height: 36px;
}

.depthub-avatar-comment {
    width: 24px;
    height: 24px;
}

.depthub-wall-post-subject {
    font-size: 17px;
    font-weight: 700;
    color: var(--depthub-post-subject);
}

.depthub-wall-post-body {
    white-space: pre-wrap;
    color: var(--text-primary);
    line-height: 1.45;
    margin-left: 48px;
}

.depthub-wall-post-media {
    margin-top: 8px;
    margin-left: 48px;
    max-width: calc(100% - 48px);
}

.depthub-wall-post-media img {
    display: block;
    max-width: 420px;
    width: min(420px, 100%);
    height: auto;
    border-radius: 10px;
    border: 1px solid var(--border-panel);
}

.depthub-wall-attachment {
    margin-top: 8px;
    margin-left: 48px;
    max-width: calc(100% - 48px);
}

.depthub-wall-comments {
    margin: 14px -18px -16px;
    padding: 14px 24px 16px;
    border-top: 1px solid var(--border-panel);
    display: grid;
    gap: 10px;
    background: color-mix(in srgb, var(--depthub-post-bg) 80%, var(--surface-main) 20%);
    border-radius: 0 0 calc(var(--module-radius) - 1px) calc(var(--module-radius) - 1px);
}

.depthub-wall-comment-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    min-width: 0;
}

.depthub-wall-comment-avatar {
    flex: 0 0 auto;
    margin-top: 2px;
}

.depthub-wall-comment-row .depthub-wall-comment {
    flex: 1 1 auto;
    min-width: 0;
    max-width: 100%;
    position: relative;
    background: var(--depthub-comment-bg);
    border: 1px solid var(--depthub-comment-border);
    border-radius: 10px;
    padding: 10px 32px 10px 12px;
    display: grid;
    gap: 3px;
}

.depthub-wall-comment-meta {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    margin: 0;
    font-size: 11px;
    line-height: 1.05;
    color: var(--text-muted);
    padding-right: 24px;
}

.depthub-wall-comment-meta-main {
    display: inline-flex;
    flex-direction: row;
    align-items: baseline;
    gap: 8px;
    min-width: 0;
    max-width: calc(100% - 26px);
    overflow-wrap: anywhere;
    word-break: break-word;
    margin: 0;
    padding: 0;
    line-height: 1.2;
}

.depthub-wall-comment-meta-text {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.depthub-wall-comment-author {
    color: var(--text-primary);
    font-weight: 700;
    line-height: 1;
}

.depthub-wall-comment-time {
    color: var(--text-muted);
    line-height: 1;
}

.depthub-wall-post .depthub-inline-delete-btn,
.depthub-wall-comment .depthub-inline-delete-btn {
    width: 26px !important;
    min-width: 26px !important;
    max-width: 26px !important;
    height: 26px !important;
    min-height: 26px !important;
    max-height: 26px !important;
    flex: 0 0 26px !important;
    align-self: flex-start !important;
    padding: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    line-height: 1 !important;
    aspect-ratio: 1 / 1;
    border-radius: 4px !important;
    font-size: 12px !important;
}

.depthub-wall-comment .depthub-inline-delete-btn {
    position: absolute !important;
    right: 8px !important;
    top: 8px !important;
    width: 20px !important;
    min-width: 20px !important;
    max-width: 20px !important;
    height: 20px !important;
    min-height: 20px !important;
    max-height: 20px !important;
    flex: 0 0 20px !important;
    border-radius: 4px !important;
    font-size: 11px !important;
}

.depthub-wall-comment-body {
    color: var(--text-primary);
    line-height: 1.35;
    margin: 0;
    max-width: 100%;
    padding-right: 22px;
    white-space: pre-wrap;
    overflow-wrap: anywhere !important;
    word-break: break-word !important;
    padding-top: 0;
}

.depthub-wall-comment-row.is-reply {
    margin-left: 28px;
}

.depthub-wall-comment-row.is-reply .depthub-wall-comment {
    background: var(--depthub-reply-bg);
    border-color: var(--depthub-reply-border);
}

.depthub-wall-comment-create {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 4px;
    padding-left: 2px;
}

.depthub-wall-comment-create .admin-input {
    flex: 1 1 auto;
    min-height: 40px;
    border-radius: 10px !important;
}

.depthub-wall-comment-create .save-btn {
    min-height: 40px;
    padding-inline: 18px;
    border-radius: 10px;
}

#depthub-sub-view-notes {
    position: relative;
    background: transparent !important;
    border: 0 !important;
    border-radius: 0;
    box-shadow: none;
    padding: 0;
}

#depthub-sub-view-notes .depthub-notes-tabs {
    margin-bottom: 12px;
    position: relative;
    z-index: 2;
    flex-wrap: nowrap !important;
    white-space: nowrap;
    min-width: 0;
    flex: 1 1 auto;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

#depthub-sub-view-notes .depthub-notes-tabs::-webkit-scrollbar {
    display: none;
}

body[data-theme-mode] #depthub-sub-view-notes #depthub-notes-subtabs.sub-tab-container.network-subtabs {
    border: 1px solid var(--tab-strip-border) !important;
    border-radius: 999px !important;
    background: linear-gradient(180deg, var(--tab-strip-bg-start) 0%, var(--tab-strip-bg-end) 100%) !important;
    box-shadow: inset 0 1px 0 var(--tab-strip-shadow) !important;
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
}

body[data-theme-mode] #depthub-sub-view-notes #depthub-notes-subtabs > .sub-tab {
    border-radius: 999px;
    color: var(--tab-text) !important;
    white-space: nowrap;
}

body[data-theme-mode] #depthub-sub-view-notes #depthub-notes-subtabs > .sub-tab.active {
    color: var(--tab-active-text) !important;
}

body[data-theme-mode] #depthub-sub-view-notes #depthub-notes-subtabs.wmts-tab-glider-ready > .sub-tab.active {
    background: transparent !important;
    border-color: transparent !important;
    box-shadow: none !important;
}

#depthub-main-subtabs {
    position: relative;
    z-index: 12;
}

#depthub-sub-view-notes .depthub-notes-tabs-row {
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: nowrap;
}

#depthub-sub-view-notes .depthub-sticky-board-profile-row {
    display: none;
    margin-bottom: 0;
    margin-left: auto;
    flex: 0 0 auto;
    width: auto;
    justify-content: flex-end;
}

#depthub-sub-view-notes .depthub-notes-tabs-row .depthub-notes-tabs {
    margin-bottom: 0;
    flex: 0 1 auto;
    min-width: 0;
}

#depthub-sub-view-notes .depthub-sticky-board-profile-bar {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-wrap: nowrap;
}

#depthub-sub-view-notes .depthub-sticky-board-profile-bar .table-select {
    min-width: 220px;
}

#depthub-sub-view-notes .depthub-sticky-board-profile-bar .btn-close {
    min-height: 34px;
    padding-inline: 12px;
}

#depthub-sticky-note-picker-list .save-btn.is-success {
    background: linear-gradient(180deg, #22c55e 0%, #16a34a 100%);
    border-color: #16a34a;
    color: #fff;
}

#depthub-sub-view-notes .depthub-sticky-canvas-sheet {
    --depthub-sticky-board-height: max(620px, calc(100vh - 214px));
    position: relative;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    padding: 0;
    z-index: 2;
    min-height: var(--depthub-sticky-board-height);
    height: var(--depthub-sticky-board-height);
}

#depthub-sub-view-notes .depthub-sticky-toolbar {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 10px 14px;
    margin-bottom: 0;
    padding: 10px 12px;
    border: 1px solid #d8e0ea;
    border-radius: 12px;
    background: rgba(248, 251, 255, .92);
    position: absolute;
    top: 12px;
    left: 12px;
    right: 12px;
    z-index: 86;
    box-shadow: 0 10px 22px rgba(15, 23, 42, .2);
    backdrop-filter: blur(6px);
}

#depthub-sub-view-notes .depthub-sticky-toolbar-left,
#depthub-sub-view-notes .depthub-sticky-toolbar-right {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

#depthub-sub-view-notes .depthub-sticky-toolbar-left {
    flex: 1 1 auto;
    min-width: 0;
}

#depthub-sub-view-notes .depthub-sticky-toolbar-right {
    flex: 0 0 auto;
    margin-left: auto;
}

#depthub-sub-view-notes .depthub-sticky-text-controls {
    display: none;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-left: 10px;
    padding: 4px 8px;
    border: 1px solid #d5deea;
    border-radius: 10px;
    background: rgba(255, 255, 255, .9);
    box-shadow: 0 4px 10px rgba(15, 23, 42, .08);
}

#depthub-sub-view-notes .depthub-sticky-text-controls.is-active {
    display: inline-flex;
}

#depthub-sub-view-notes .depthub-sticky-text-select {
    min-width: 128px;
    max-width: 170px;
    height: 34px;
}

#depthub-sub-view-notes .depthub-sticky-text-size {
    width: 68px;
    min-width: 68px;
    height: 34px;
    padding: 0 8px;
}

#depthub-sub-view-notes .depthub-sticky-text-btn {
    min-width: 30px;
    width: 30px;
    height: 30px;
    min-height: 30px;
    padding: 0;
    border-radius: 7px;
    font-size: 12px;
    font-weight: 700;
    border: 1px solid #c8d3e1 !important;
    background: #ffffff !important;
    color: #0f172a !important;
    box-shadow: none !important;
}

#depthub-sub-view-notes .depthub-sticky-text-btn:hover {
    background: #f5f9ff !important;
    border-color: #9fb3d5 !important;
}

#depthub-sub-view-notes .depthub-sticky-text-btn .depthub-sticky-tool-icon {
    width: 14px;
    height: 14px;
}

#depthub-sub-view-notes .depthub-sticky-text-controls .depthub-sticky-text-select,
#depthub-sub-view-notes .depthub-sticky-text-controls .depthub-sticky-text-size {
    background: #ffffff !important;
    border: 1px solid #c8d3e1 !important;
    color: #0f172a !important;
    box-shadow: none !important;
}

#depthub-sub-view-notes .depthub-sticky-text-controls .depthub-sticky-text-select:focus,
#depthub-sub-view-notes .depthub-sticky-text-controls .depthub-sticky-text-size:focus {
    border-color: #3b82f6 !important;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, .2) !important;
}

#depthub-sub-view-notes #depthub-sticky-text-italic {
    font-style: italic;
}

#depthub-sub-view-notes #depthub-sticky-text-underline {
    text-decoration: underline;
}

#depthub-sub-view-notes .depthub-sticky-text-btn.is-active {
    background: #eef4ff !important;
    box-shadow: inset 0 0 0 2px rgba(15, 91, 219, .42);
}

#depthub-sub-view-notes .depthub-sticky-toolbar-label {
    font-size: 12px;
    font-weight: 700;
    color: #334155;
    margin: 0 2px 0 4px;
}

#depthub-sub-view-notes .depthub-sticky-top-btn {
    min-height: 34px;
    padding: 0 12px;
    border-radius: 8px;
    font-size: 12px;
    white-space: nowrap;
}

#depthub-sub-view-notes .depthub-sticky-color-chip {
    width: 34px;
    min-width: 34px;
    max-width: 34px;
    height: 34px;
    min-height: 34px;
    border-radius: 8px;
    padding: 0;
    border: 1px solid rgba(15, 23, 42, .24);
    cursor: pointer;
}

#depthub-sub-view-notes .depthub-sticky-toolbar input[type="range"] {
    width: 132px;
}

#depthub-sub-view-notes .depthub-sticky-toolbar-right #depthub-sticky-zoom-range {
    width: 168px;
}

#depthub-sub-view-notes .depthub-sticky-toolbar .wmts-theme-color-trigger {
    width: 32px;
    min-width: 32px;
    height: 32px;
    min-height: 32px;
    border-radius: 7px;
}

#depthub-sub-view-notes .depthub-sticky-tools .wmts-theme-color-trigger {
    width: 36px;
    min-width: 36px;
    height: 36px;
    min-height: 36px;
    border-radius: 8px;
}

#depthub-sub-view-notes .depthub-sticky-top-dropdown {
    position: relative;
    z-index: 120;
}

#depthub-sub-view-notes .depthub-sticky-top-dropdown-menu {
    position: absolute;
    left: 0;
    top: calc(100% + 6px);
    min-width: 164px;
    background: #fff;
    border: 1px solid #cfd9e6;
    border-radius: 8px;
    box-shadow: 0 10px 18px rgba(15, 23, 42, .18);
    padding: 6px;
    display: none;
    z-index: 160;
}

#depthub-sub-view-notes .depthub-sticky-top-dropdown.is-open .depthub-sticky-top-dropdown-menu {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

#depthub-sub-view-notes .depthub-sticky-menu-item {
    width: 100%;
    border: 1px solid transparent;
    border-radius: 6px;
    background: #f8fbff;
    color: #0f172a;
    font-size: 12px;
    font-weight: 600;
    text-align: left;
    padding: 7px 10px;
    cursor: pointer;
}

#depthub-sub-view-notes .depthub-sticky-menu-item:hover {
    background: #e9f1fb;
    border-color: #bfd1e8;
}

#depthub-sub-view-notes .depthub-sticky-board-shell {
    position: relative;
    margin-bottom: 0;
    padding-left: 0;
    z-index: 20;
    min-height: 100%;
    height: 100%;
}

#depthub-sub-view-notes.depthub-sticky-fullscreen-active .depthub-notes-tabs-row,
#depthub-sub-view-notes.depthub-sticky-fullscreen-active .depthub-sticky-board-profile-row {
    display: none !important;
}

body.depthub-sticky-fullscreen #main-dashboard .tab-container,
body.depthub-sticky-fullscreen #wmts-global-topbar,
body.depthub-sticky-fullscreen #depthub-page-title,
body.depthub-sticky-fullscreen #view-depthub .depthub-summary-grid,
body.depthub-sticky-fullscreen #view-depthub #depthub-main-subtabs {
    display: none !important;
}

body.depthub-sticky-fullscreen #view-depthub {
    padding: 0 !important;
}

body.depthub-sticky-fullscreen #depthub-sub-view-notes {
    margin: 0 !important;
    padding: 0 !important;
}

body.depthub-sticky-fullscreen #depthub-sub-view-notes #depthub-notes-board-page.depthub-sticky-canvas-sheet {
    position: fixed;
    inset: 0;
    z-index: 120000;
    margin: 0;
    border-radius: 0;
    min-height: 100vh;
    height: 100vh;
    background: #fff;
}

body.depthub-sticky-fullscreen #depthub-sub-view-notes #depthub-notes-board-page .depthub-sticky-board-shell {
    height: 100%;
}

body.depthub-sticky-fullscreen #depthub-sub-view-notes #depthub-notes-board-page .depthub-sticky-board-viewport-wrap {
    border-radius: 0;
}

#depthub-sub-view-notes .depthub-sticky-tools {
    position: absolute;
    left: 12px;
    top: 84px;
    z-index: 70;
    width: 56px;
    border: 1px solid rgba(17, 24, 39, .14);
    border-radius: 12px;
    background: rgba(255, 255, 255, .95);
    box-shadow: 0 8px 20px rgba(10, 18, 34, .18);
    backdrop-filter: blur(3px);
    padding: 8px 6px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
}

#depthub-sub-view-notes .depthub-sticky-tools .save-btn,
#depthub-sub-view-notes .depthub-sticky-tools .btn-close {
    width: 42px;
    min-width: 42px;
    max-width: 42px;
    min-height: 42px;
    height: 42px;
    border-radius: 10px;
    padding: 0;
}

#depthub-sub-view-notes .depthub-sticky-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

#depthub-sub-view-notes .depthub-sticky-tools .save-btn.is-active {
    background: #eef4ff !important;
    box-shadow: inset 0 0 0 2px rgba(15, 91, 219, .42);
}

#depthub-sub-view-notes .depthub-sticky-tool-label {
    margin: 2px 0 -2px;
    font-size: 11px;
    color: #475569;
}

#depthub-sub-view-notes .depthub-sticky-tool-label-icon {
    width: 26px;
    height: 26px;
    min-height: 26px;
    margin: 4px 0 -2px;
    border-radius: 6px;
    border: 1px solid rgba(15, 23, 42, .12);
    background: #f8fafc;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

#depthub-sub-view-notes .depthub-sticky-tool-icon {
    width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #0f172a;
}

#depthub-sub-view-notes .depthub-sticky-tool-icon > svg {
    width: 18px;
    height: 18px;
    display: block;
}

#depthub-sub-view-notes .depthub-sticky-tool-icon.wmts-svg-icon-wrap svg,
#depthub-sub-view-notes .depthub-sticky-tool-icon.wmts-svg-icon-wrap svg * {
    fill: none !important;
    stroke: currentColor !important;
    stroke-linecap: round;
    stroke-linejoin: round;
}

#depthub-sub-view-notes .depthub-sticky-tools .depthub-sticky-color-chip {
    margin-top: 2px;
}

#depthub-sub-view-notes .depthub-sticky-tools input[type="range"] {
    display: none;
}

#depthub-sub-view-notes .depthub-sticky-tools select {
    display: none;
}

#depthub-sub-view-notes .depthub-sticky-zoom-readout {
    width: auto;
    min-width: 46px;
    font-size: 11px;
    line-height: 1.2;
    color: #334155;
    text-align: center;
}

#depthub-sub-view-notes .depthub-sticky-tool-popover {
    position: absolute;
    left: calc(100% + 8px);
    min-width: 130px;
    background: #fff;
    border: 1px solid #cfd9e6;
    border-radius: 8px;
    box-shadow: 0 8px 16px rgba(15, 23, 42, .18);
    padding: 6px;
    display: none;
    flex-direction: column;
    gap: 4px;
    z-index: 90;
}

#depthub-sub-view-notes .depthub-sticky-tool-popover.is-open {
    display: flex;
}

#depthub-sub-view-notes #depthub-sticky-pen-popover {
    top: 54px;
}

#depthub-sub-view-notes #depthub-sticky-shape-popover {
    top: 98px;
}

#depthub-sub-view-notes .depthub-sticky-board-viewport-wrap {
    border: 1px solid #d7dde7;
    border-radius: 14px;
    background: transparent;
    overflow: hidden;
    position: relative;
    z-index: 10;
    width: 100%;
    min-height: 100%;
    height: 100%;
}

#depthub-sub-view-notes .depthub-sticky-board-viewport {
    position: relative;
    min-height: 100%;
    height: 100%;
    cursor: grab;
    user-select: none;
    background: #fff;
}

#depthub-sub-view-notes .depthub-sticky-board-viewport::before {
    display: none;
}

#depthub-sub-view-notes .depthub-sticky-board-viewport.is-panning {
    cursor: grabbing;
}

#depthub-sub-view-notes .depthub-sticky-board-viewport canvas,
#depthub-sub-view-notes .depthub-sticky-board-items {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

#depthub-sub-view-notes #depthub-sticky-board-canvas,
#depthub-sub-view-notes #depthub-sticky-board-preview {
    z-index: 1;
    pointer-events: none;
}

#depthub-sub-view-notes .depthub-sticky-board-items {
    z-index: 2;
    pointer-events: none;
}

#depthub-sub-view-notes .depthub-sticky-selection-box {
    position: absolute;
    display: none;
    pointer-events: none;
    border: 1px dashed rgba(15, 91, 219, .78);
    background: rgba(15, 91, 219, .12);
    border-radius: 6px;
    z-index: 7;
}

#depthub-sub-view-notes .depthub-sticky-cursor-preview {
    position: absolute;
    display: none;
    pointer-events: none;
    transform: translate(-50%, -50%);
    border: 2px solid rgba(15, 23, 42, 0.7);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.2);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.32);
    z-index: 96;
}

#depthub-sub-view-notes .depthub-sticky-card,
#depthub-sub-view-notes .depthub-sticky-image-card {
    position: absolute;
    pointer-events: auto;
    box-sizing: border-box;
}

#depthub-sub-view-notes .depthub-sticky-shape-hitbox {
    position: absolute;
    pointer-events: auto;
    border: 1px dashed transparent;
    background: rgba(255, 255, 255, .01);
}

#depthub-sub-view-notes .depthub-sticky-shape-hitbox.is-editable {
    cursor: move;
}

#depthub-sub-view-notes .depthub-sticky-shape-hitbox.is-editable:hover {
    border-color: rgba(51, 65, 85, .28);
}

#depthub-sub-view-notes .depthub-sticky-card.is-selected,
#depthub-sub-view-notes .depthub-sticky-image-card.is-selected,
#depthub-sub-view-notes .depthub-sticky-text-card.is-selected {
    box-shadow: 0 0 0 2px rgba(15, 91, 219, .85), 0 10px 20px rgba(15, 23, 42, .22);
}

#depthub-sub-view-notes .depthub-sticky-shape-hitbox.is-selected {
    border-color: rgba(15, 91, 219, .85) !important;
    background: rgba(15, 91, 219, .08);
}

#depthub-sub-view-notes .depthub-sticky-text-card {
    position: absolute;
    pointer-events: auto;
    box-sizing: border-box;
    border-radius: 4px;
    border: none;
    background: transparent;
    box-shadow: none;
    padding: 0;
    overflow: visible;
}

#depthub-sub-view-notes .depthub-sticky-text-card.is-editable {
    cursor: move;
}

#depthub-sub-view-notes .depthub-sticky-text-card.is-editable:hover {
    outline: 1px dashed rgba(100, 116, 139, .38);
}

#depthub-sub-view-notes .depthub-sticky-text-body {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    line-height: 1.28;
    white-space: pre-wrap;
    word-break: break-word;
    overflow: auto;
}

#depthub-sub-view-notes .depthub-sticky-text-body.is-editing {
    overflow: auto;
    border: 1px dashed rgba(37, 99, 235, .64);
    border-radius: 6px;
    background: rgba(255, 255, 255, .86);
    outline: none;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, .2);
    padding: 2px 4px;
    cursor: text;
}

#depthub-sub-view-notes .depthub-sticky-context-menu {
    position: fixed;
    min-width: 168px;
    border-radius: 10px;
    border: 1px solid #cbd5e1;
    background: #fff;
    box-shadow: 0 16px 28px rgba(15, 23, 42, .26);
    padding: 6px;
    z-index: 120000;
}

#depthub-sub-view-notes .depthub-sticky-context-menu .depthub-sticky-context-action {
    width: 100%;
    border: 1px solid transparent;
    border-radius: 7px;
    background: #f8fbff;
    color: #0f172a;
    font-size: 12px;
    font-weight: 600;
    text-align: left;
    padding: 8px 10px;
    cursor: pointer;
}

#depthub-sub-view-notes .depthub-sticky-context-menu .depthub-sticky-context-action:hover {
    background: #e9f1fb;
    border-color: #bfd1e8;
}

#depthub-sub-view-notes .depthub-sticky-context-menu .depthub-sticky-context-action.is-danger {
    color: #b91c1c;
}

#depthub-sticky-note-picker-modal .table-wrap {
    max-height: 46vh;
    overflow: auto;
}

#depthub-sub-view-notes .depthub-sticky-card.is-editable,
#depthub-sub-view-notes .depthub-sticky-image-card.is-editable {
    cursor: move;
}

#depthub-sub-view-notes .depthub-sticky-card {
    border-radius: 4px;
    box-shadow: 5px 6px 0 rgba(17, 24, 39, .2);
    border: 1px solid rgba(0, 0, 0, .24);
    padding: 10px 10px 10px;
    overflow: hidden;
}

#depthub-sub-view-notes .depthub-sticky-card-title {
    font-size: 13px;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 6px;
    padding-right: 30px;
    text-shadow: 0 1px 0 rgba(255, 255, 255, .55);
}

#depthub-sub-view-notes .depthub-sticky-card-body {
    font-size: 12px;
    line-height: 1.36;
    color: #1e293b;
    white-space: pre-wrap;
    word-break: break-word;
    overflow: auto;
    max-height: calc(100% - 62px);
    padding-bottom: 4px;
}

#depthub-sub-view-notes .depthub-sticky-card-meta {
    position: absolute;
    right: 8px;
    top: 8px;
    font-size: 10px;
    color: rgba(0, 0, 0, .58);
}

#depthub-sub-view-notes .depthub-sticky-image-card {
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #c8d0dc;
    box-shadow: 0 8px 22px rgba(0, 0, 0, .3);
    background: #111;
}

#depthub-sub-view-notes .depthub-sticky-image-card > img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    pointer-events: none;
}

#depthub-sub-view-notes .depthub-sticky-resize-handle {
    display: none !important;
}

#depthub-sub-view-notes .depthub-notes-list-wrap {
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
}

#depthub-sub-view-notes .depthub-notes-page {
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    padding: 0;
}

#depthub-sub-view-notes .depthub-notes-table-wrap {
    margin-top: 6px;
}

#depthub-sub-view-notes #depthub-notes-list > tr.depthub-note-row {
    cursor: pointer;
}

#depthub-sub-view-notes #depthub-notes-list > tr.depthub-note-row > td {
    transition: background-color 140ms ease;
}

#depthub-sub-view-notes #depthub-notes-list > tr.depthub-note-row:hover > td {
    background: var(--table-row-hover-strong) !important;
}

#depthub-sub-view-notes #depthub-notes-list > tr.depthub-note-row.depthub-note-row-active > td {
    background: color-mix(in srgb, var(--brand-primary) 20%, var(--table-row-bg-strong) 80%) !important;
}

@media (max-width: 1080px) {
    #depthub-sub-view-notes .depthub-sticky-board-shell {
        padding-left: 0;
        min-height: 0;
    }
    #depthub-sub-view-notes .depthub-sticky-toolbar {
        position: static;
        left: auto;
        right: auto;
        top: auto;
        margin-bottom: 10px;
        box-shadow: 0 6px 12px rgba(15, 23, 42, .16);
        backdrop-filter: none;
        flex-direction: column;
        align-items: stretch;
    }
    #depthub-sub-view-notes .depthub-sticky-toolbar-left,
    #depthub-sub-view-notes .depthub-sticky-toolbar-right {
        width: 100%;
    }
    #depthub-sub-view-notes .depthub-sticky-toolbar-right {
        margin-left: 0;
    }
    #depthub-sub-view-notes .depthub-sticky-toolbar input[type="range"] {
        flex: 1 1 auto;
        min-width: 120px;
    }
    #depthub-sub-view-notes .depthub-sticky-tools {
        position: static;
        width: 100%;
        min-height: 0;
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: flex-start;
        gap: 8px;
        margin-bottom: 10px;
    }
    #depthub-sub-view-notes .depthub-sticky-tool-label,
    #depthub-sub-view-notes .depthub-sticky-zoom-readout {
        width: auto;
    }
    #depthub-sub-view-notes .depthub-sticky-tool-popover {
        position: static;
        width: 100%;
        margin-top: 4px;
    }
    #depthub-sub-view-notes .depthub-sticky-board-viewport-wrap {
        min-height: 0;
        height: clamp(460px, 64vh, 860px);
    }
}

#depthub-wall-post-modal .modal-body .modal-item > #depthub-wall-post-body {
    width: 100% !important;
    min-height: 240px;
    resize: vertical;
    background: var(--input-bg) !important;
    border: 1px solid var(--input-border) !important;
    color: var(--input-text) !important;
}

#depthub-wall-post-modal .depthub-wall-compose-row {
    width: 100%;
    align-items: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

#depthub-wall-post-modal .depthub-wall-upload-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 220px;
    flex: 1 1 280px;
}

#depthub-wall-post-modal .depthub-wall-upload-field > label {
    margin: 0;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
}

#depthub-wall-post-modal .depthub-wall-upload-field > input[type="file"] {
    width: 100%;
}

#depthub-wall-post-modal .depthub-wall-compose-row .depthub-file-meta {
    width: 100%;
    margin-top: 2px;
}

#depthub-note-modal .modal-body .modal-item > #depthub-note-body {
    width: 100% !important;
    min-height: 140px;
    resize: vertical;
    background: var(--input-bg) !important;
    border: 1px solid var(--input-border) !important;
    color: var(--input-text) !important;
}

#depthub-note-modal .modal-body .modal-grid {
    grid-template-columns: 1fr !important;
}

#depthub-note-modal .modal-body .modal-item > .admin-input,
#depthub-note-modal .modal-body .modal-item > .table-select {
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
}

#depthub-note-modal .depthub-note-style-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

#depthub-note-modal .depthub-note-style-color-input {
    width: 48px !important;
    min-width: 48px !important;
    max-width: 48px !important;
    min-height: 36px;
    padding: 2px;
}

#depthub-note-modal .depthub-note-style-presets {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

#depthub-note-modal .depthub-note-style-swatch {
    width: 24px;
    height: 24px;
    min-width: 24px;
    border-radius: 6px;
    border: 1px solid rgba(15, 23, 42, .22);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .6);
    cursor: pointer;
    padding: 0;
}

#depthub-note-modal .depthub-note-style-swatch.is-active {
    box-shadow: 0 0 0 2px rgba(30, 64, 175, .35), inset 0 0 0 1px rgba(255, 255, 255, .8);
}

#depthub-note-modal .depthub-note-text-style-swatch {
    border-color: rgba(15, 23, 42, .28);
}

#depthub-note-modal .depthub-note-text-style-swatch.is-active {
    box-shadow: 0 0 0 2px rgba(15, 23, 42, .45), inset 0 0 0 1px rgba(255, 255, 255, .85);
}

#depthub-job-modal .modal-body .modal-grid.depthub-job-modal-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

#depthub-job-modal .modal-body .modal-item > .admin-input,
#depthub-job-modal .modal-body .modal-item > .table-select {
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
}

#depthub-job-modal .modal-body .modal-item > #depthub-job-desc {
    width: 100% !important;
    min-height: 168px;
    resize: vertical;
    background: var(--input-bg) !important;
    border: 1px solid var(--input-border) !important;
    color: var(--input-text) !important;
}

#depthub-job-modal .depthub-job-subtasks-input-list {
    display: grid;
    gap: 8px;
}

#depthub-job-modal .depthub-job-subtask-input-row .admin-input {
    width: 100%;
}

#depthub-job-modal .modal-footer.depthub-job-modal-footer .btn-close,
#depthub-job-modal .modal-footer.depthub-job-modal-footer .save-btn {
    min-width: 140px;
}

@media (max-width: 860px) {
    #depthub-job-modal .modal-body .modal-grid.depthub-job-modal-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 900px) {
    .depthub-wall-post-body {
        margin-left: 0;
    }

    .depthub-wall-post-media,
    .depthub-wall-attachment {
        margin-left: 0;
        max-width: 100%;
    }

    .depthub-wall-comments {
        padding-left: 16px;
        padding-right: 16px;
    }
}

.depthub-wall-post-main {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.depthub-inline-delete-btn {
    width: 26px;
    min-width: 26px;
    max-width: 26px;
    height: 26px;
    min-height: 26px;
    max-height: 26px;
    flex: 0 0 26px;
    align-self: flex-start;
    padding: 0 !important;
    border-radius: 4px;
    line-height: 1;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: "Segoe Fluent Icons", "Segoe MDL2 Assets", "Segoe UI Symbol", sans-serif;
    color: var(--text-muted) !important;
    border-color: var(--border-panel) !important;
    background: color-mix(in srgb, var(--surface-panel-alt) 84%, transparent) !important;
}

.depthub-inline-delete-btn:hover {
    color: var(--text-primary) !important;
    border-color: var(--app-border-strong) !important;
}

.depthub-wall-attachment .btn-close {
    border-color: var(--btn-secondary-border);
    color: var(--btn-secondary-text);
}

.depthub-wall-status-pill {
    border: 1px solid var(--depthub-pill-post-border);
    background: var(--depthub-pill-post-bg);
    color: var(--depthub-pill-post-text);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-size: 11px;
    padding: 6px 12px;
    line-height: 1;
}

.depthub-wall-status-pill-attention,
.depthub-job-status-attention {
    border-color: var(--depthub-pill-attention-border);
    background: var(--depthub-pill-attention-bg);
    color: var(--depthub-pill-attention-text);
}

.depthub-wall-status-pill-claimed,
.depthub-job-status-claimed {
    border-color: var(--depthub-pill-claimed-border);
    background: var(--depthub-pill-claimed-bg);
    color: var(--depthub-pill-claimed-text);
}

.depthub-wall-status-pill-completed,
.depthub-job-status-completed {
    border-color: var(--depthub-pill-completed-border);
    background: var(--depthub-pill-completed-bg);
    color: var(--depthub-pill-completed-text);
}

.depthub-wall-status-pill-post {
    border-color: var(--depthub-pill-post-border);
    background: var(--depthub-pill-post-bg);
    color: var(--depthub-pill-post-text);
}

.depthub-wall-post-type-job .depthub-wall-post-subject,
.depthub-wall-post-status-attention .depthub-wall-post-subject {
    color: var(--depthub-pill-attention-text);
}

.depthub-wall-post-type-project .depthub-wall-post-subject,
.depthub-wall-post-status-claimed .depthub-wall-post-subject {
    color: var(--depthub-pill-claimed-text);
}

.depthub-wall-post-status-completed .depthub-wall-post-subject {
    color: var(--depthub-pill-completed-text);
}

.depthub-wall-post-status-attention {
    border-color: var(--depthub-pill-attention-border) !important;
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--depthub-pill-attention-border) 62%, transparent) inset;
}

.depthub-wall-post-status-claimed {
    border-color: var(--depthub-pill-claimed-border) !important;
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--depthub-pill-claimed-border) 58%, transparent) inset;
}

.depthub-wall-post-status-completed {
    border-color: var(--depthub-pill-completed-border) !important;
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--depthub-pill-completed-border) 58%, transparent) inset;
}

.depthub-empty-message {
    text-align: center;
    color: var(--text-muted);
    padding: 14px;
}

.depthub-empty-message.is-warning {
    color: var(--warning-primary);
}

.depthub-empty-message.is-danger {
    color: var(--danger-primary);
}

.depthub-table-empty {
    text-align: center;
    color: var(--text-muted);
}

.depthub-table-empty.is-warning {
    color: var(--warning-primary);
}

.depthub-table-empty.is-danger {
    color: var(--danger-primary);
}

.depthub-settings-view {
    display: block;
}

.depthub-wall-settings-table th:last-child,
.depthub-wall-settings-table td:last-child {
    width: 220px;
    text-align: right;
}

.depthub-wall-settings-toggle-cell .wmts-check-toggle {
    justify-content: flex-end;
}

.depthub-settings-categories-add-row {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 10px;
    max-width: 640px;
}

.depthub-settings-categories-add-row .admin-input {
    flex: 1 1 auto;
    min-width: 0;
}

.depthub-knowledge-categories-table th:last-child,
.depthub-knowledge-categories-table td:last-child {
    width: 180px;
    text-align: right;
}

.depthub-knowledge-templates-table th:last-child,
.depthub-knowledge-templates-table td:last-child {
    width: 220px;
    text-align: right;
}

.depthub-knowledge-templates-table td:nth-child(2) {
    color: var(--text-secondary);
}

.depthub-table-actions-end {
    text-align: right;
    white-space: nowrap;
}

.depthub-kb-toolbar {
    margin-bottom: 10px;
}

.depthub-kb-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
    align-content: start;
}

.depthub-kb-card.depthub-kb-portrait-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    text-align: left;
    min-width: 0;
    min-height: 190px;
    height: auto;
    max-width: none;
    padding: 18px 18px 16px !important;
    box-sizing: border-box;
    border-radius: 16px;
    border: 1px solid var(--border-panel) !important;
    background: var(--surface-panel) !important;
    box-shadow: var(--table-wrap-shadow, 0 8px 24px rgba(0, 0, 0, 0.22));
    color: var(--text-secondary);
    cursor: pointer;
    overflow: hidden;
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.depthub-kb-card.depthub-kb-portrait-card:hover,
.depthub-kb-card.depthub-kb-portrait-card:focus-visible {
    border-color: var(--brand-primary) !important;
    box-shadow: 0 14px 26px rgba(8, 12, 20, 0.28);
    transform: translateY(-2px);
    outline: none;
}

.depthub-kb-title {
    margin: 0;
    color: var(--text-primary);
    font-size: clamp(11px, 0.82vw, 15px);
    font-weight: 700;
    line-height: 1.28;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.depthub-kb-summary {
    color: var(--text-secondary);
    font-size: clamp(10px, 0.66vw, 12px);
    line-height: 1.4;
    margin-top: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.depthub-kb-meta {
    color: var(--text-muted);
    font-size: 12px;
    line-height: 1.2;
    margin-top: auto;
    padding-top: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.depthub-kb-tags {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 4px;
    max-height: none;
    overflow: visible;
}

.depthub-kb-tags > span {
    display: inline-flex;
    align-items: center;
    min-height: 20px;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    color: color-mix(in srgb, var(--brand-primary) 62%, var(--text-primary) 38%);
    background: color-mix(in srgb, var(--brand-primary) 18%, transparent);
    border: 1px solid color-mix(in srgb, var(--brand-primary) 34%, transparent);
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.depthub-kb-tags > .depthub-kb-tag-empty {
    color: var(--text-muted);
    background: color-mix(in srgb, var(--surface-panel-strong) 72%, transparent);
    border-color: color-mix(in srgb, var(--border-panel) 82%, transparent);
}

@media (max-width: 1180px) {
    .depthub-kb-card.depthub-kb-portrait-card {
        min-height: 170px;
        height: auto;
    }
}

@media (max-width: 760px) {
    .depthub-kb-list {
        gap: 8px;
    }

    .depthub-kb-card.depthub-kb-portrait-card {
        border-radius: 12px;
        padding: 14px !important;
    }

    .depthub-kb-summary {
        -webkit-line-clamp: 2;
    }
}

.depthub-kb-empty {
    grid-column: 1 / -1;
    padding: 14px;
}

.module-policy-inline-panel {
    margin-top: 12px;
    padding: 14px;
    border-radius: var(--module-radius);
    background: var(--surface-panel-alt);
    border: 1px solid var(--border-panel);
}

.module-policy-inline-panel[data-mode="permissions"],
.module-policy-inline-panel[data-mode="logs"] {
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
}

.module-policy-inline-panel[data-mode="permissions"] .wmts-table-like,
.module-policy-inline-panel[data-mode="logs"] .wmts-table-like {
    border-radius: var(--module-radius);
    overflow: hidden;
}

.module-policy-inline-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 0;
}

.module-policy-inline-title-wrap {
    min-width: 0;
}

.module-policy-inline-title {
    margin: 0;
    color: var(--text-primary);
    font-size: 18px;
    font-weight: 700;
}

.module-policy-inline-subtitle {
    margin: 0;
}

.module-policy-inline-status {
    margin: 0 0 8px 0;
}

.depthub-knowledge-modal-content .modal-body {
    max-height: 78vh;
    overflow: auto;
}

#depthub-knowledge-modal .depthub-knowledge-modal-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

#depthub-knowledge-modal .depthub-knowledge-modal-grid .modal-item.full {
    grid-column: 1 / -1;
}

#depthub-knowledge-modal .depthub-knowledge-modal-grid .modal-item > .admin-input,
#depthub-knowledge-modal .depthub-knowledge-modal-grid .modal-item > .table-select {
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
}

#depthub-knowledge-modal .depthub-knowledge-modal-footer .btn-close,
#depthub-knowledge-modal .depthub-knowledge-modal-footer .save-btn {
    min-width: 148px;
}

.depthub-kb-editor-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
}

.depthub-kb-editor-toolbar .table-select {
    min-width: 220px;
}

.depthub-kb-editor {
    min-height: 220px;
    max-height: 420px;
    overflow: auto;
    white-space: pre-wrap;
}

.depthub-knowledge-references-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 10px;
}

.depthub-kb-ref-card {
    border: 1px solid var(--border-panel);
    border-radius: 12px;
    background: color-mix(in srgb, var(--surface-panel-alt) 92%, transparent);
    padding: 12px;
    display: grid;
    gap: 8px;
}

.depthub-kb-ref-card h4 {
    margin: 0;
    font-size: 15px;
    color: var(--text-primary);
}

.depthub-kb-ref-results {
    display: none;
    border: 1px solid var(--border-panel);
    border-radius: 10px;
    background: var(--surface-panel-alt);
    overflow: hidden;
    max-height: 180px;
    overflow-y: auto;
}

.depthub-kb-ref-results.is-open {
    display: block;
}

.depthub-kb-ref-result {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 10px;
    border-bottom: 1px solid color-mix(in srgb, var(--border-panel) 80%, transparent);
    cursor: pointer;
}

.depthub-kb-ref-result:last-child {
    border-bottom: 0;
}

.depthub-kb-ref-result:hover {
    background: color-mix(in srgb, var(--surface-panel) 78%, transparent);
}

.depthub-kb-ref-result:focus-within,
.depthub-kb-ref-result:focus {
    outline: 1px solid var(--accent-primary);
    outline-offset: -1px;
}

.depthub-kb-ref-result-label {
    font-size: 12px;
    color: var(--text-secondary);
}

.depthub-kb-ref-result-hint {
    font-size: 11px;
    color: var(--text-muted);
}

.depthub-kb-ref-empty {
    font-size: 12px;
    color: var(--text-muted);
    padding: 10px;
}

.depthub-kb-linked-list {
    display: grid;
    gap: 8px;
}

.depthub-kb-linked-item {
    border: 1px solid color-mix(in srgb, var(--border-panel) 84%, transparent);
    border-radius: 10px;
    background: color-mix(in srgb, var(--surface-panel-alt) 90%, transparent);
    padding: 8px 10px;
    display: grid;
    gap: 6px;
}

.depthub-kb-linked-item-label {
    font-size: 12px;
    color: var(--text-primary);
}

.depthub-kb-linked-item-actions {
    display: inline-flex;
    gap: 8px;
    flex-wrap: wrap;
}

.depthub-kb-view-info,
.depthub-kb-view-body,
.depthub-kb-link-modal-body {
    border: 1px solid var(--border-panel);
    border-radius: 10px;
    background: var(--surface-panel-alt);
    padding: 12px;
}

.depthub-kb-view-body {
    margin-top: 10px;
    white-space: pre-wrap;
}

.depthub-kb-inline-ref {
    display: inline-flex;
    align-items: center;
    gap: 0;
    max-width: 100%;
    margin: 1px 2px;
    padding: 1px 0 1px 8px;
    border: 1px solid color-mix(in srgb, var(--accent-primary) 36%, var(--border-panel));
    border-radius: 999px;
    background: color-mix(in srgb, var(--surface-panel) 82%, transparent);
    color: var(--text-primary);
    line-height: 1.2;
    font-size: 12px;
    vertical-align: middle;
}

.depthub-kb-inline-ref-label {
    display: inline-block;
    max-width: 440px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding-right: 6px;
    cursor: pointer;
}

.depthub-kb-inline-ref-remove {
    width: 17px;
    height: 17px;
    border: 0;
    border-left: 1px solid color-mix(in srgb, var(--danger-primary) 45%, transparent);
    border-radius: 0 999px 999px 0;
    background: color-mix(in srgb, var(--danger-primary) 84%, #111827);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
    padding: 0;
    cursor: pointer;
}

.depthub-kb-inline-ref-remove:hover {
    background: color-mix(in srgb, var(--danger-primary) 92%, #111827);
}

@media (max-width: 820px) {
    .depthub-settings-categories-add-row {
        flex-direction: column;
        align-items: stretch;
    }
}

@media (max-width: 1100px) {
    #depthub-knowledge-modal .depthub-knowledge-modal-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 740px) {
    #depthub-knowledge-modal .depthub-knowledge-modal-grid {
        grid-template-columns: 1fr;
    }
}

/* In-page subtab strips (now primary secondary-nav) */
.sub-tab-container,
.sub-tab-container.network-subtabs {
    border: 1px solid var(--tab-strip-border);
    border-radius: 999px;
    background: linear-gradient(180deg, var(--tab-strip-bg-start) 0%, var(--tab-strip-bg-end) 100%);
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 3px;
    padding: 3px;
    box-shadow: inset 0 1px 0 var(--tab-strip-shadow);
    position: relative;
    overflow: hidden;
    isolation: isolate;
}

/* Glass-outline variant for tab switchers (matches +Add styling intent). */
.sub-tab-container.wmts-btn-add {
    background: linear-gradient(
        180deg,
        color-mix(in srgb, var(--tab-strip-bg-start) 50%, transparent) 0%,
        color-mix(in srgb, var(--tab-strip-bg-end) 50%, transparent) 100%
    );
    border: 1px solid var(--tab-strip-border);
    box-shadow:
        inset 0 1px 0 rgba(0, 0, 0, 0.16),
        0 2px 6px rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
}

.sub-tab-container.wmts-btn-add .sub-tab.active {
    background: linear-gradient(
        180deg,
        color-mix(in srgb, var(--tab-active-bg-start) 50%, transparent) 0%,
        color-mix(in srgb, var(--tab-active-bg-end) 50%, transparent) 100%
    ) !important;
    box-shadow:
        inset 0 1px 0 color-mix(in srgb, var(--tab-active-border) 35%, transparent),
        0 2px 6px color-mix(in srgb, var(--tab-active-border) 45%, transparent),
        0 2px 8px color-mix(in srgb, var(--tab-active-glow) 35%, transparent);
}

.sub-tab-container.wmts-btn-add .wmts-tab-glider {
    background: linear-gradient(
        180deg,
        color-mix(in srgb, var(--tab-active-bg-start) 50%, transparent) 0%,
        color-mix(in srgb, var(--tab-active-bg-end) 50%, transparent) 100%
    );
    box-shadow:
        inset 0 1px 0 color-mix(in srgb, var(--tab-active-border) 35%, transparent),
        0 2px 6px color-mix(in srgb, var(--tab-active-border) 45%, transparent),
        0 2px 8px color-mix(in srgb, var(--tab-active-glow) 35%, transparent);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
}

/* Icon-only sub-tab sizing to prevent layout shift */
.sub-tab.wmts-topbar-gear-tab,
.sub-tab.wmts-topbar-settings-tab {
    width: 42px;
    min-width: 42px;
    height: 32px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.sub-tab.wmts-topbar-gear-tab .wmts-topbar-gear-icon,
.sub-tab.wmts-topbar-settings-tab .wmts-topbar-gear-icon {
    width: 18px;
    height: 18px;
}

/* In-page body switchers: keep left aligned (Inventory + Device Management). */
#main-dashboard #view-inventory .sub-tab-container,
#main-dashboard #view-inventory .sub-tab-container.network-subtabs,
#main-dashboard #view-devices .sub-tab-container,
#main-dashboard #view-devices .sub-tab-container.network-subtabs {
    justify-content: flex-start !important;
    margin-left: 0 !important;
    margin-right: auto !important;
    justify-self: start !important;
}

/* Devices: force all in-page switcher strips to remain left-aligned. */
#main-dashboard #view-devices #devices-main-subtabs,
#main-dashboard #view-devices #device-jobs-tab-bar,
#main-dashboard #view-devices #devices-jobs-filter-tabs,
#main-dashboard #view-devices #devices-sub-view-settings .sub-tab-container,
#main-dashboard #view-devices #devices-sub-view-settings .sub-tab-container.network-subtabs {
    justify-content: flex-start !important;
    margin-left: 0 !important;
    margin-right: auto !important;
    justify-self: start !important;
    width: auto !important;
    max-width: 100% !important;
}

/* Devices list rows are clickable: show pointer + hover feedback */
#view-devices table tbody tr[onclick] {
    cursor: pointer;
}

#view-devices table tbody tr[onclick]:hover td {
    background: var(--table-row-hover-strong) !important;
    box-shadow: inset 0 0 0 999px color-mix(in srgb, var(--brand-primary) 6%, transparent);
}

/* Devices queues: align parent dropdown + delete icon to global right edge */
#view-devices .wmts-sortable-actions {
    margin-left: auto;
    justify-content: flex-end;
    width: auto;
}

#view-devices .wmts-sortable-actions > .devices-status-parent-select {
    margin-right: 0;
}

/* Device settings: spacing between tabs, info text, and input rows */
#view-devices #devices-sub-view-settings .devices-settings-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: var(--module-stack-gap);
}

#view-devices #devices-sub-view-settings .devices-settings-header .sub-tab-container {
    margin-bottom: 0 !important;
}

#view-devices #devices-sub-view-settings .devices-settings-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
    flex-wrap: wrap;
}

#view-devices #devices-sub-view-settings .devices-settings-intro {
    margin-top: 0;
    margin-bottom: var(--module-stack-gap);
}

#view-devices #devices-sub-view-settings .devices-settings-intro p {
    margin: 0;
}

#view-devices #devices-sub-view-settings > .devices-settings-header + .devices-job-config-wrap,
#view-devices #devices-sub-view-settings > .devices-settings-header + .devices-settings-intro,
#view-devices #devices-sub-view-settings > .devices-settings-header + .devices-list-toolbar,
#view-devices #devices-sub-view-settings > .devices-settings-header + .network-toolbar,
#view-devices #devices-sub-view-settings > .devices-settings-header + table {
    margin-top: 0 !important;
}

#view-devices #devices-sub-view-settings .devices-job-config-wrap {
    margin-top: 0;
}

#view-devices #devices-sub-view-settings .devices-job-config-add {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: var(--module-stack-gap);
}

/* Warranty spacing: clamp info box + table gap to global stack */
#view-devices #devices-sub-view-warranty .wmts-info-box {
    margin-bottom: var(--module-stack-gap);
}

#view-devices #devices-sub-view-warranty .wmts-info-box + table,
#view-devices #devices-sub-view-warranty #device-warranty-add-btn + table {
    margin-top: 0 !important;
}

#view-devices #devices-sub-view-settings .devices-job-config-add .admin-input {
    min-width: 220px;
}

/* QuickCheck packs switcher spacing: match summary strip gap rhythm */
#main-dashboard #view-events #events-main-subtabs,
#main-dashboard #view-events #events-main-subtabs.sub-tab-container {
    margin: 0 !important;
}

.wmts-inline-switcher-row > #events-main-subtabs {
    margin-bottom: 0 !important;
}

#main-dashboard #view-events .wmts-inline-switcher-row {
    margin-bottom: var(--module-stack-gap) !important;
}

#main-dashboard #view-events #events-shared-toolbar {
    margin-bottom: var(--module-stack-gap) !important;
}

#main-dashboard #view-events #events-shared-toolbar[style*="display: none"],
#main-dashboard #view-events #events-shared-toolbar[style*="display:none"] {
    margin-bottom: 0 !important;
}

#main-dashboard #view-events #events-main-subtabs:has(+ #events-shared-toolbar[style*="display: none"]),
#main-dashboard #view-events #events-main-subtabs:has(+ #events-shared-toolbar[style*="display:none"]) {
    margin-bottom: var(--module-stack-gap) !important;
}

/* Normalize top summary -> main subtab spacing across modules to match Devices */
#devices-main-subtabs,
#inventory-main-subtabs,
#network-main-subtabs,
#maps-main-subtabs,
#depthub-main-subtabs {
    margin-top: 0 !important;
    margin-bottom: var(--module-stack-gap) !important;
}

.network-monitoring-shell > .network-summary-grid {
    margin-bottom: var(--module-stack-gap);
}

/* Dept Hub shell is grid; keep its top in-page tab strips content-width (not stretched). */
#depthub-main-subtabs,
.depthub-shell .depthub-notes-tabs,
.depthub-shell .depthub-jobs-subtabs,
.depthub-shell .depthub-settings-tabs {
    justify-self: start;
    width: auto !important;
}

.sub-tab {
    border: 1px solid transparent !important;
    border-radius: 999px;
    color: var(--tab-text) !important;
    background: transparent !important;
    padding: 9px 24px;
    font-weight: 600;
    line-height: 1.15;
    position: relative;
    z-index: 2;
    transition:
        color .22s ease,
        background .24s ease,
        border-color .24s ease,
        box-shadow .26s ease,
        transform .22s ease;
}

.sub-tab:hover {
    color: var(--tab-text-hover) !important;
    background: var(--tab-hover-bg) !important;
}

.sub-tab.active,
.sub-tab-container.network-subtabs .sub-tab.active {
    color: var(--tab-active-text) !important;
    background: linear-gradient(180deg, var(--tab-active-bg-start) 0%, var(--tab-active-bg-end) 100%) !important;
    border-color: var(--tab-active-border) !important;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.2), 0 8px 18px var(--tab-active-glow);
}

.sub-tab-container.wmts-tab-glider-ready .sub-tab.active,
.sub-tab-container.network-subtabs.wmts-tab-glider-ready .sub-tab.active {
    background: transparent !important;
    border-color: transparent !important;
    box-shadow: none !important;
}

.dashboard-widget-tabs.wmts-tab-glider-ready.wmts-tab-multiline .sub-tab.active {
    color: var(--tab-active-text) !important;
    background: linear-gradient(180deg, var(--tab-active-bg-start) 0%, var(--tab-active-bg-end) 100%) !important;
    border-color: var(--tab-active-border) !important;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.2), 0 8px 18px var(--tab-active-glow) !important;
}

.dashboard-widget-tabs.wmts-tab-multiline .wmts-tab-glider {
    opacity: 0 !important;
}

.sub-tab.wmts-tab-switch-pop {
    animation: wmts-tab-switch-pop .34s cubic-bezier(.22,.98,.29,.99);
}

/* Desktop topbar density: tighten spacing so more controls/tabs fit as width shrinks. */
body[data-ui-shell="desktop"] .wmts-global-topbar {
    gap: 8px;
    padding-left: 16px;
    padding-right: 16px;
}

body[data-ui-shell="desktop"] .wmts-topbar-tabs {
    margin-left: 8px;
}

body[data-ui-shell="desktop"] .wmts-topbar-tabs .sub-tab-container,
body[data-ui-shell="desktop"] .wmts-topbar-tabs .sub-tab-container.network-subtabs {
    gap: 2px;
    padding: 2px;
}

body[data-ui-shell="desktop"] .wmts-topbar-tabs .sub-tab {
    padding: 8px 16px;
}

body[data-ui-shell="desktop"] .wmts-topbar-profile-wrap {
    gap: 8px;
}

body[data-ui-shell="desktop"] .wmts-topbar-search-wrap {
    margin-left: 8px;
}

@media (max-width: 1680px) {
    body[data-ui-shell="desktop"] .wmts-global-topbar {
        gap: 7px;
        padding-left: 12px;
        padding-right: 12px;
    }

    body[data-ui-shell="desktop"] .wmts-topbar-tabs {
        margin-left: 6px;
    }

    body[data-ui-shell="desktop"] .wmts-topbar-tabs .sub-tab {
        padding: 7px 13px;
        font-size: 12px;
    }

    body[data-ui-shell="desktop"] .wmts-global-topbar .wmts-topbar-context-action {
        min-height: 36px;
        padding: 0 11px;
    }
}

@media (max-width: 1450px) {
    body[data-ui-shell="desktop"] .wmts-topbar-tabs .sub-tab {
        padding: 6px 10px;
        font-size: 11px;
    }

    body[data-ui-shell="desktop"] .wmts-topbar-tabs .sub-tab.wmts-topbar-gear-tab,
    body[data-ui-shell="desktop"] .wmts-topbar-tabs .sub-tab.wmts-topbar-settings-tab {
        width: 36px;
        min-width: 36px;
        height: 30px;
    }

    body[data-ui-shell="desktop"] .wmts-topbar-search-wrap {
        flex-basis: 220px;
        min-inline-size: 140px;
    }
}

@keyframes wmts-tab-switch-pop {
    0% {
        transform: translateY(0) scale(0.985);
    }
    55% {
        transform: translateY(-1px) scale(1.015);
    }
    100% {
        transform: translateY(0) scale(1);
    }
}

.wmts-tab-glider {
    position: absolute;
    top: 3px;
    left: 3px;
    height: calc(100% - 6px);
    width: 40px;
    box-sizing: border-box;
    border-radius: 999px;
    pointer-events: none;
    z-index: 1;
    background: linear-gradient(180deg, var(--tab-active-bg-start) 0%, var(--tab-active-bg-end) 100%);
    border: 1px solid var(--tab-active-border);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.2), 0 8px 18px var(--tab-active-glow);
    transform: translateX(0);
    transition:
        transform .34s cubic-bezier(.22,.98,.29,.99),
        width .32s cubic-bezier(.22,.98,.29,.99),
        opacity .2s ease;
    will-change: transform, width;
}

.wmts-tab-glider::before {
    content: "";
    position: absolute;
    inset: -4px;
    border-radius: 999px;
    background: radial-gradient(ellipse at center, var(--tab-active-glow) 0%, rgba(0, 0, 0, 0) 70%);
    opacity: .55;
    filter: blur(2px);
    transform: scaleX(1);
    transition: transform .32s cubic-bezier(.22,.98,.29,.99), opacity .24s ease;
}

.wmts-tab-glider.wmts-tab-glider-moving::before {
    transform: scaleX(1.1);
    opacity: .75;
}

/* Global: align in-page switchers and top action/filter toolbars on one row */
.wmts-inline-switcher-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: var(--module-stack-gap);
}

.wmts-inline-switcher-row > .sub-tab-container,
.wmts-inline-switcher-row > .sub-tab-container.network-subtabs {
    margin-bottom: 0 !important;
}

.wmts-inline-switcher-controls {
    margin-left: auto !important;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    width: auto !important;
    max-width: 100%;
    flex: 1 1 auto;
    justify-content: flex-end;
    margin-bottom: 0 !important;
    margin-top: 0 !important;
    min-width: 0;
}

.wmts-inline-switcher-controls .wmts-btn-add-primary {
    margin-left: auto !important;
}

.wmts-inline-switcher-controls .wmts-btn-refresh + .wmts-btn-add-primary {
    margin-left: 8px !important;
}

.wmts-refresh-add-row {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    flex-wrap: wrap !important;
}

.wmts-refresh-add-row > .search-input,
.wmts-refresh-add-row > input[type="search"] {
    flex: 1 1 320px;
    min-width: 220px;
    max-width: 420px;
}

.wmts-refresh-add-actions {
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    flex-wrap: wrap !important;
    margin-left: auto !important;
}

.wmts-refresh-add-actions .wmts-btn-add-primary {
    margin-left: 8px !important;
}

.wmts-inline-switcher-row > .wmts-inline-switcher-controls :is(.search-input, .table-select, .wmts-menu-select) {
    max-width: min(360px, 100%);
}

.wmts-quickcheck-settings-row {
    margin-bottom: var(--module-stack-gap);
}

.wmts-explicit-switcher-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: var(--module-stack-gap);
}

.wmts-explicit-switcher-row > .sub-tab-container {
    margin-bottom: 0 !important;
}

@media (max-width: 1100px) {
    .wmts-inline-switcher-row {
        align-items: stretch;
    }

    .wmts-inline-switcher-row > .sub-tab-container,
    .wmts-inline-switcher-row > .wmts-inline-switcher-controls {
        flex: 1 1 100%;
    }

    .wmts-inline-switcher-row > .wmts-inline-switcher-controls {
        justify-content: flex-start;
        margin-left: 0 !important;
    }
}

/* Inventory controls aligned to Stitch reference */
.inventory-assets-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
}

.inventory-assets-search {
    position: relative;
    min-width: 0;
    max-width: 320px;
    width: 320px;
}

.inventory-reset-btn {
    display: none;
}

.search-input {
    width: 100%;
    height: 38px;
    border-radius: 8px !important;
    border: 1px solid var(--input-border) !important;
    background: var(--table-head-bg-strong) !important;
    color: var(--input-text) !important;
    padding: 0 12px 0 30px !important;
    font-size: 13px !important;
    line-height: 1.2;
}

.search-input:focus {
    outline: none;
    border-color: var(--brand-primary) !important;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.24);
}

.inventory-assets-filter-group,
.inventory-assets-action-group {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.inventory-assets-filter-group {
    justify-content: flex-start;
}

.inventory-assets-action-group {
    margin-left: auto;
    justify-content: flex-end;
}

.inventory-assets-filter-group .table-select {
    min-width: 132px;
    height: 38px;
    border-radius: 8px !important;
}

.wmts-check-toggle {
    display: inline-flex !important;
    align-items: center;
    gap: 10px !important;
    border: 1px solid var(--input-border) !important;
    background: var(--table-head-bg-strong) !important;
    border-radius: 10px !important;
    padding: 6px 10px !important;
    color: var(--input-text) !important;
    font-size: 12px !important;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.wmts-check-toggle:hover {
    border-color: var(--switch-shell-hover-border) !important;
    box-shadow: 0 0 0 1px var(--switch-shell-hover-ring);
}

.wmts-text-display {
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--switch-shell-border);
    background: var(--switch-shell-bg);
    border-radius: 10px;
    padding: 6px 10px;
    color: var(--switch-shell-text);
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
    min-height: 34px;
    box-sizing: border-box;
}

.wmts-check-toggle input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 42px !important;
    height: 22px !important;
    margin: 0 !important;
    border-radius: 999px;
    border: 1px solid var(--switch-track-off-border);
    background: linear-gradient(180deg, var(--switch-track-off-start) 0%, var(--switch-track-off-end) 100%);
    position: relative;
    cursor: pointer;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.24);
    transition: background-color 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.wmts-check-toggle input[type="checkbox"]::before {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: linear-gradient(180deg, var(--switch-knob-start) 0%, var(--switch-knob-end) 100%);
    top: 2px;
    left: 2px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.32);
    transition: transform 0.16s ease, background 0.16s ease;
}

.wmts-check-toggle input[type="checkbox"]:checked {
    background: linear-gradient(
        180deg,
        color-mix(in srgb, var(--tab-active-bg-start) 50%, transparent) 0%,
        color-mix(in srgb, var(--tab-active-bg-end) 50%, transparent) 100%
    );
    border-color: color-mix(in srgb, var(--tab-active-border) 50%, transparent);
    box-shadow: inset 0 1px 1px rgba(9, 34, 87, 0.24), 0 0 0 2px var(--switch-track-on-glow);
}

.wmts-check-toggle input[type="checkbox"]:checked::before {
    transform: translateX(20px);
}

.wmts-check-toggle.wmts-check-toggle-locked {
    cursor: default !important;
}

.wmts-check-toggle.wmts-check-toggle-locked:hover {
    border-color: var(--switch-shell-border) !important;
    box-shadow: none !important;
}

.wmts-check-toggle.wmts-check-toggle-locked input[type="checkbox"] {
    cursor: default !important;
    pointer-events: none !important;
    background: linear-gradient(180deg, var(--switch-track-off-start) 0%, var(--switch-track-off-end) 100%) !important;
    border-color: var(--switch-track-off-border) !important;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.24) !important;
}

.wmts-check-toggle.wmts-check-toggle-locked input[type="checkbox"]::before {
    content: "\E72E" !important;
    font-family: "Segoe Fluent Icons", "Segoe MDL2 Assets", "Segoe UI Symbol", sans-serif !important;
    font-size: 12px !important;
    line-height: 1 !important;
    color: var(--switch-knob-end) !important;
    width: auto !important;
    height: auto !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    left: 50% !important;
    top: 50% !important;
    transform: translate(-50%, -50%) !important;
}

.wmts-check-toggle.wmts-check-toggle-locked input[type="checkbox"]:checked::before {
    transform: translate(-50%, -50%) !important;
}

.wmts-check-toggle.wmts-check-toggle-locked .wmts-check-toggle-lock {
    width: 42px;
    height: 22px;
    min-width: 42px;
    border-radius: 999px;
    border: 1px solid var(--switch-track-off-border);
    background: linear-gradient(180deg, var(--switch-track-off-start) 0%, var(--switch-track-off-end) 100%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.24);
}

.wmts-check-toggle.wmts-check-toggle-locked .wmts-check-toggle-lock .wmts-table-action-glyph {
    width: 12px;
    height: 12px;
    font-size: 12px;
    line-height: 1;
    color: var(--switch-knob-end);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.dashboard-fullscreen-edit-icon .wmts-menu-btn-icon,
.dashboard-fullscreen-exit .wmts-menu-btn-icon {
    width: 17px;
    height: 17px;
    flex: 0 0 17px;
}

.dashboard-fullscreen-edit-icon .wmts-menu-btn-icon.wmts-svg-icon-wrap svg,
.dashboard-fullscreen-exit .wmts-menu-btn-icon.wmts-svg-icon-wrap svg {
    width: 17px;
    height: 17px;
}

body[data-theme-mode="light"] .wmts-check-toggle {
    color: var(--input-text) !important;
    background: var(--table-head-bg-strong) !important;
    border-color: var(--input-border) !important;
}

body[data-theme-mode="light"] .wmts-check-toggle input[type="checkbox"] {
    background: linear-gradient(180deg, var(--switch-track-off-start) 0%, var(--switch-track-off-end) 100%);
    border-color: var(--switch-track-off-border);
}

/* Inventory table system (Stitch-aligned shared table style) */
#view-inventory .inventory-list-section table,
#view-inventory .inventory-manage-section table {
    border-radius: 10px;
    overflow: hidden;
    border-color: var(--table-border-strong) !important;
    background: var(--table-row-bg-strong) !important;
    table-layout: fixed !important;
}

/* QuickCheck tables: remove inner table bottom gap inside table-wrap */
#inv-local-view-quickadjustments .table-wrap table,
#inv-local-view-qrcodes .table-wrap table {
    margin-bottom: 0 !important;
}

/* Dept Hub tables: remove inherited bottom gutter inside table-wrap
   so no fake footer tile appears under rows. */
#view-depthub .table-wrap > table {
    margin-bottom: 0 !important;
}

#view-inventory .inventory-list-section .col-name { width: 30%; }
#view-inventory .inventory-list-section .col-cat { width: 14%; }
#view-inventory .inventory-list-section .col-acq { width: 10%; }
#view-inventory .inventory-list-section .col-exp { width: 10%; }
#view-inventory .inventory-list-section .col-qty { width: 12%; text-align: center !important; }
#view-inventory .inventory-list-section .col-value { width: 12%; }
#view-inventory .inventory-list-section .col-act { width: 12%; text-align: right !important; }

#view-inventory .inventory-list-section thead th,
#view-inventory .inventory-manage-section thead th {
    background: var(--table-head-bg-strong) !important;
    color: var(--table-head-text-strong) !important;
    font-size: 11px !important;
    font-weight: 500 !important;
    letter-spacing: 0.04em !important;
}

#view-inventory .inventory-list-section tbody td,
#view-inventory .inventory-manage-section tbody td {
    background: var(--table-row-bg-strong) !important;
    border-bottom-color: var(--table-border-strong) !important;
}

#view-inventory .inventory-list-section tbody tr:hover:not(.low-stock-row) td {
    background: var(--table-row-hover-strong) !important;
}


#view-inventory .inventory-list-heading-alert {
    color: var(--table-immediate-text) !important;
}

#view-inventory .low-stock-row td {
    background: var(--table-immediate-bg) !important;
    border-bottom-color: var(--table-immediate-border) !important;
}

#view-inventory .inv-status-badge.is-low {
    display: inline-flex;
    margin-top: 4px;
    padding: 2px 8px;
    border-radius: 999px;
    border: 1px solid var(--table-immediate-border);
    color: var(--table-immediate-text);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

#view-inventory .inv-asset-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}

#view-inventory .inventory-row-arrow-gap,
#view-inventory .inv-row-arrow {
    width: 16px;
    min-width: 16px;
    display: inline-flex;
    justify-content: center;
}

#view-inventory .inv-asset-meta {
    display: grid;
    gap: 2px;
}

#view-inventory .inv-asset-title {
    color: var(--text-primary);
    font-weight: 600;
}

#view-inventory .inv-asset-sub,
#view-inventory .inv-batch-count {
    color: var(--table-muted-strong);
    font-size: 11px;
}

#view-inventory .inv-row-arrow {
    color: var(--table-head-text-strong);
    font-size: 10px;
    transition: transform 0.16s ease;
}

#view-inventory .inv-row-arrow.is-open {
    transform: rotate(90deg);
}

#view-inventory .inv-parent-row {
    cursor: pointer;
}

#view-inventory .inv-parent-row:hover td {
    background: color-mix(in srgb, var(--table-row-hover-strong) 84%, transparent) !important;
}

#view-inventory .inv-category-link {
    color: var(--btn-outline-text);
}

#view-inventory .inv-expiry {
    color: var(--table-head-text-strong);
}

#view-inventory .inv-qty-control {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

#view-inventory .inv-qty-btn {
    width: 26px;
    height: 26px;
    border-radius: 6px;
    border: 1px solid var(--table-border-strong);
    background: var(--table-row-bg-strong);
    color: var(--table-head-text-strong);
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
}

#view-inventory .inv-qty-btn.is-plus {
    color: var(--success-primary, var(--brand-primary));
    border-color: color-mix(in srgb, var(--success-primary, var(--brand-primary)) 45%, transparent);
}

#view-inventory .inv-qty-btn.is-minus {
    color: var(--danger-primary);
    border-color: color-mix(in srgb, var(--danger-primary) 45%, transparent);
}

#view-inventory .inv-qty-value {
    font-weight: 700;
    color: var(--text-primary);
}

#view-inventory .inv-qty-total-note {
    margin-left: 4px;
    color: var(--table-muted-strong);
    font-size: 12px;
}

#view-inventory .inv-value-strong {
    color: var(--text-primary);
}

#view-inventory .inv-action-btn {
    padding: 5px 14px !important;
    border-radius: 7px !important;
    font-size: 12px !important;
}

#view-inventory .inv-state-note {
    color: var(--table-head-text-strong);
    font-size: 12px;
}

#view-inventory .inv-state-note.is-managed {
    color: var(--warning-primary, var(--brand-primary));
}

#view-inventory .inv-batch-row-wrap {
    display: none;
}

#view-inventory .inv-batch-row-wrap.is-open {
    display: table-row;
}

#view-inventory .inv-batch-row-cell {
    padding: 0 !important;
}

#view-inventory .batch-inner-table {
    margin: 0 !important;
    border: 0 !important;
}

#view-inventory .batch-inner-table th,
#view-inventory .batch-inner-table td {
    background: var(--table-row-even-strong) !important;
}

#view-inventory .batch-inner-table th {
    color: var(--table-muted-strong) !important;
}

#view-inventory .inv-inline-link {
    margin-left: 4px;
    color: var(--btn-outline-text);
    font-size: 11px;
}

#view-inventory .inv-remove-batch-btn,
#view-inventory .inv-remove-inline-btn {
    font-size: 11px !important;
    padding: 4px 10px !important;
}

#view-inventory .inv-batch-new-act,
#view-inventory .inv-threshold-actions {
    text-align: right !important;
}

#view-inventory .inv-stock-edit-inline {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

#view-inventory .inv-stock-manual-input,
#view-inventory .threshold-input {
    width: 74px;
    height: 28px;
    border-radius: 6px;
    border: 1px solid var(--input-border) !important;
    background: var(--input-bg) !important;
    color: var(--input-text) !important;
    padding: 4px 8px;
}

#view-inventory .inv-stock-save-btn,
#view-inventory .inv-stock-cancel-btn,
#view-inventory .inv-threshold-save-btn {
    height: 28px !important;
    font-size: 11px !important;
    padding: 4px 10px !important;
}

#view-inventory .inv-threshold-empty {
    text-align: center !important;
    color: var(--table-muted-strong) !important;
}

/* Inventory thumbnails: keep images constrained inside table rows */
#view-inventory .asset-thumb {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--table-cell-border);
    background: var(--surface-panel);
    cursor: pointer;
}

#view-inventory .inv-row-arrow + .asset-thumb,
#view-inventory .inventory-row-arrow-gap + .asset-thumb {
    margin-left: -31px;
}

#inventory-thumb-modal .modal-body {
    padding: 16px;
}

#inventory-thumb-preview {
    width: 100%;
    max-height: 70vh;
    object-fit: contain;
    display: block;
    margin: 0 auto;
    background: var(--surface-panel);
    border-radius: 10px;
    border: 1px solid var(--border-panel);
}

/* Shared Stitch table skin for non-inventory modules */
#view-quickcheck table,
#view-events table,
#view-devices table,
#view-helpdesk table {
    border-radius: 10px;
    overflow: hidden;
    border-color: var(--table-border-strong) !important;
    background: var(--table-row-bg-strong) !important;
}

#view-quickcheck thead th,
#view-events thead th,
#view-devices thead th,
#view-helpdesk thead th {
    background: var(--table-head-bg-strong) !important;
    color: var(--table-head-text-strong) !important;
    font-size: 11px !important;
    font-weight: 500 !important;
    letter-spacing: 0.04em !important;
}

#view-quickcheck tbody td,
#view-events tbody td,
#view-devices tbody td,
#view-helpdesk tbody td {
    background: var(--table-row-bg-strong) !important;
    border-bottom-color: var(--table-border-strong) !important;
}

#view-quickcheck tbody tr:hover td,
#view-events tbody tr:hover td,
#view-devices tbody tr:hover td,
#view-helpdesk tbody tr:hover td {
    background: var(--table-row-hover-strong) !important;
}

/* Events add/edit pack modals */
#event-create-modal .event-pack-modal-content,
#event-edit-modal .event-pack-modal-content {
    width: min(900px, 94vw);
}

#event-create-modal .event-pack-modal-grid,
#event-edit-modal .event-pack-modal-grid {
    grid-template-columns: repeat(2, minmax(220px, 1fr));
    gap: 12px 14px;
}

#event-create-modal .event-pack-modal-grid .modal-item,
#event-edit-modal .event-pack-modal-grid .modal-item {
    min-width: 0;
}

#event-create-modal .event-pack-modal-grid .modal-item > .admin-input,
#event-create-modal .event-pack-modal-grid .modal-item > .table-select,
#event-edit-modal .event-pack-modal-grid .modal-item > .admin-input,
#event-edit-modal .event-pack-modal-grid .modal-item > .table-select {
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
}

#event-create-modal .event-pack-modal-grid .search-wrapper {
    width: 100%;
    min-width: 0;
}

#event-create-modal .event-pack-modal-grid .search-wrapper > .admin-input {
    width: 100% !important;
    max-width: none !important;
}

#event-create-modal #event-template-select + .wmts-menu-select,
#event-create-modal #event-batch-select + .wmts-menu-select {
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
}

#event-create-modal #event-template-select + .wmts-menu-select .wmts-menu-btn,
#event-create-modal #event-batch-select + .wmts-menu-select .wmts-menu-btn {
    width: 100% !important;
}

#event-create-modal .event-pack-asset-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

#event-create-modal .event-pack-section-title {
    margin: 0;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

#event-create-modal .event-pack-add-asset-btn {
    width: 100%;
}

#event-edit-modal .event-pack-delete-btn {
    margin-right: auto;
}

/* Global unified table striping across all module views */
#main-dashboard .tab-content tbody tr:nth-child(odd):not(.low-stock-row):not(.table-row-warning):not(.table-row-immediate) td {
    background: var(--table-row-bg-strong) !important;
}

#main-dashboard .tab-content tbody tr:nth-child(even):not(.low-stock-row):not(.table-row-warning):not(.table-row-immediate) td {
    background: var(--table-row-even-strong) !important;
}

/* Row-state palette: warning (amber) and immediate action (red) */
#main-dashboard .tab-content tbody tr.table-row-warning td {
    background: var(--table-warning-bg) !important;
    border-bottom-color: var(--table-warning-border) !important;
}

#main-dashboard .tab-content tbody tr.table-row-warning:hover td {
    background: var(--table-warning-hover-bg) !important;
}

/* Ensure Device Management decommissioned rows stay amber regardless of wrapper context */
#view-devices #devices-table-body > tr.table-row-warning > td {
    background: var(--table-warning-bg) !important;
    border-bottom-color: var(--table-border-strong) !important;
}

#view-devices #devices-table-body > tr.table-row-warning:hover > td {
    background: var(--table-warning-hover-bg) !important;
}

#main-dashboard .tab-content tbody td.sev-warning {
    color: var(--table-warning-text) !important;
    font-weight: 700;
}

#main-dashboard .tab-content tbody tr.table-row-immediate td,
#main-dashboard .tab-content tbody tr.low-stock-row td {
    background: var(--table-immediate-bg) !important;
    border-bottom-color: var(--table-immediate-border) !important;
}

#main-dashboard .tab-content tbody tr.table-row-immediate:hover td,
#main-dashboard .tab-content tbody tr.low-stock-row:hover td {
    background: var(--table-immediate-hover-bg) !important;
}

#main-dashboard .tab-content tbody td.sev-immediate {
    color: var(--table-immediate-text) !important;
    font-weight: 700;
}

/* Monitoring section: explicit gap between alerts table and host table */
#network-sub-view-monitoring > .table-wrap + .table-wrap {
    margin-top: 12px !important;
}

#network-sub-view-monitoring .network-monitoring-issues-table {
    border: 0;
    border-radius: 10px;
    background: transparent;
    box-shadow: none;
}

#network-sub-view-monitoring .network-monitoring-issues-table table thead th {
    background: color-mix(in srgb, var(--danger-primary) 18%, var(--table-head-bg));
}

#network-sub-view-monitoring .network-monitoring-issues-table tbody tr {
    animation: wmts-alert-pulse 1s ease-in-out infinite !important;
}

#network-sub-view-monitoring .network-monitoring-issues-table tbody tr td {
    animation: wmts-alert-pulse-cell 1s ease-in-out infinite !important;
}

@keyframes wmts-alert-pulse {
    0% {
        box-shadow: inset 0 0 0 0 rgba(239, 68, 68, 0.0);
    }
    50% {
        box-shadow: inset 0 0 0 999px rgba(239, 68, 68, 0.06);
    }
    100% {
        box-shadow: inset 0 0 0 0 rgba(239, 68, 68, 0.0);
    }
}

@keyframes wmts-alert-pulse-cell {
    0% {
        background-color: var(--table-row-odd) !important;
    }
    50% {
        background-color: color-mix(in srgb, var(--danger-primary) 24%, var(--table-row-hover)) !important;
    }
    100% {
        background-color: var(--table-row-odd) !important;
    }
}

#network-sub-view-monitoring .network-monitoring-issues-table tbody tr.wmts-alert-pulse-on td {
    background-color: color-mix(in srgb, var(--danger-primary) 24%, var(--table-row-hover)) !important;
}

/* Global spacing guard: remove legacy monitoring intro block if present. */
#network-sub-view-monitoring > .network-overview-panel {
    display: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Network tables: remove inherited table bottom margin that appears as extra inner padding. */
#view-network .table-wrap > table {
    margin-bottom: 0 !important;
    border: 0 !important;
}

#view-network .table-wrap {
    --table-wrap-border: transparent;
    --table-wrap-bg: transparent;
    --table-wrap-shadow: none;
}

#network-sub-view-monitoring .network-monitoring-issues-table {
    --table-wrap-border: transparent;
    --table-wrap-bg: transparent;
    --table-wrap-shadow: none;
}

#network-sub-view-monitoring .network-monitoring-issues-table > table {
    border: 0;
}

#inv-local-view-quickadjustments .table-wrap,
#inv-local-view-qrcodes .table-wrap {
    --table-wrap-border: transparent;
    --table-wrap-bg: transparent;
    --table-wrap-shadow: none;
}

body[data-ui-shell="desktop"] #view-inventory #inv-local-view-quickadjustments .quickcheck-stock-cell {
    width: 1%;
    white-space: nowrap;
    text-align: right;
    padding-right: 6px !important;
}

body[data-ui-shell="desktop"] #view-inventory #inv-local-view-quickadjustments .quickcheck-adjust-cell {
    width: 1%;
    white-space: nowrap;
    padding-left: 6px !important;
}

body[data-ui-shell="desktop"] #view-inventory #inv-local-view-quickadjustments .quickcheck-adjust-actions {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

body[data-ui-shell="desktop"] #view-inventory #inv-local-view-quickadjustments .quickcheck-adjust-btn {
    width: 78px;
    height: 78px;
    font-size: 34px;
    line-height: 1;
    border-radius: 12px;
    font-weight: 700;
}

/* Settings tables: same fix for User/Department Management table-wrap blocks. */
#view-settings .table-wrap > table {
    margin-bottom: 0 !important;
}

/* Modal internals already normalized in ui-core; keep sizing unified */
.modal-content {
    max-width: min(1120px, 96vw);
}

#device-create-job-notes {
    width: 100%;
    min-height: 140px;
    background: var(--table-head-bg-strong) !important;
    border: 1px solid var(--input-border) !important;
    color: var(--input-text) !important;
}

#device-create-job-title {
    width: 100%;
}

#device-job-modal .device-job-modal-content {
    width: min(980px, calc(100vw - 24px)) !important;
    max-width: min(980px, calc(100vw - 24px)) !important;
    box-sizing: border-box;
}

#device-job-modal .device-job-modal-layout {
    display: grid;
    gap: 12px;
}

#device-job-modal #device-job-modal-image-upload {
    display: none !important;
}

#device-job-modal .device-job-section {
    border: 1px solid var(--border-panel);
    border-radius: 12px;
    padding: 12px;
    background: var(--app-surface);
    min-width: 0;
}

#device-job-modal .device-job-meta-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px 14px;
}

#device-job-modal .device-job-field-value {
    min-height: 38px;
    display: flex;
    align-items: center;
    color: var(--text-primary);
    font-size: 14px;
    line-height: 1.3;
    font-weight: 600;
}

#device-job-modal .device-job-field-value-muted {
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 500;
}

#device-job-modal #device-job-modal-title,
#device-job-modal #device-job-modal-status-select,
#device-job-modal #device-job-modal-status-select + .wmts-menu-select,
#device-job-modal #device-job-modal-status-select + .wmts-menu-select .wmts-menu-btn {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
}

#device-job-modal .device-job-section-meta .modal-item {
    min-width: 0;
    overflow: hidden;
}

#device-job-modal #device-job-modal-status-select {
    display: block;
    box-sizing: border-box;
}

#device-job-modal #device-job-modal-status-select + .wmts-menu-select {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    flex: none !important;
    align-self: stretch;
    box-sizing: border-box;
    overflow: hidden;
    margin: 0 !important;
    padding: 0 !important;
}

#device-job-modal #device-job-modal-status-select + .wmts-menu-select .wmts-menu-btn {
    display: flex !important;
    box-sizing: border-box;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#device-job-modal #device-job-modal-status-select + .wmts-menu-select .wmts-menu-btn-label {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#device-job-modal #device-job-modal-notes {
    width: 100%;
    min-height: 72px;
    max-height: 72px;
    resize: none;
    background: var(--table-head-bg-strong) !important;
    border: 1px solid var(--input-border) !important;
    color: var(--input-text) !important;
}

#device-job-modal .device-job-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
}

#device-job-modal .device-job-evidence-header {
    margin-top: 12px;
}

#device-job-modal .device-job-section-title {
    margin: 0;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.02em;
}

#device-job-modal .device-job-issues-summary {
    color: var(--text-muted);
    font-size: 12px;
    line-height: 1.4;
    margin-bottom: 8px;
}

#device-job-modal #device-job-modal-edit-checklist-btn {
    width: 32px;
    height: 32px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

#device-job-modal #device-job-modal-edit-checklist-btn.active {
    background: var(--icon-btn-hover-bg) !important;
    border-color: var(--icon-btn-hover-border-color) !important;
    color: var(--icon-btn-hover-color) !important;
}

#device-job-modal .device-job-add-photo-btn {
    min-height: 32px;
    height: 32px;
    padding: 0 10px !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    text-align: center;
    white-space: nowrap;
}

#device-job-modal .device-job-add-photo-btn .wmts-table-action-glyph {
    display: none;
}

#device-job-modal .device-job-images-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

#device-job-modal .device-job-images-empty {
    color: var(--text-muted);
    font-size: 12px;
}

#device-warranty-log-modal .device-warranty-log-input {
    width: 100% !important;
    max-width: 100% !important;
    min-height: 42px;
    box-sizing: border-box;
}

#device-warranty-log-modal #device-warranty-log-body {
    min-height: 220px;
}

#device-warranty-log-modal .device-warranty-log-attachments {
    margin-top: 10px;
}

#device-warranty-log-modal .device-warranty-log-attachments > label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 700;
}

#device-warranty-log-modal .device-warranty-log-attachments-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

#device-warranty-log-modal .device-warranty-attachment-card {
    width: 88px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

#device-warranty-log-modal .device-warranty-attachment-card img {
    width: 88px;
    height: 64px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--input-border);
    cursor: pointer;
}

#device-warranty-log-modal .device-warranty-attachment-card span {
    color: var(--text-muted);
    font-size: 11px;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Dept Hub To-do section headers: match Device settings info-box style */
#view-depthub #depthub-sub-view-jobs .depthub-assigned-table-title {
    margin: 0 0 10px 0;
    padding: 14px 16px;
    border: 1px solid var(--table-wrap-border, var(--surface-border));
    border-radius: 10px;
    background: var(--table-wrap-bg, var(--surface-panel-alt));
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--table-head-text-strong) 10%, transparent);
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 600;
    line-height: 1.35;
}

#view-depthub .depthub-job-desc-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

#view-depthub .depthub-job-desc-content {
    min-width: 0;
}

#view-depthub .depthub-job-subtasks-wrap {
    margin-top: 10px;
    display: grid;
    gap: 8px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    width: auto;
    max-width: 100%;
}

#view-depthub .depthub-job-subtask-item {
    margin: 0;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: var(--text-primary);
    line-height: 1.3;
    font-weight: 500;
    padding-left: 16px;
}

#view-depthub .depthub-job-subtask-item > span {
    font-size: 14px;
}

#view-depthub .depthub-job-subtask-check {
    width: 17px;
    height: 17px;
    min-width: 17px;
    appearance: none;
    -webkit-appearance: none;
    border: 1.5px solid color-mix(in srgb, #ffffff 78%, transparent);
    border-radius: 50%;
    background: transparent;
    display: inline-grid;
    place-content: center;
    cursor: pointer;
    transition: border-color 120ms ease, background-color 120ms ease, transform 120ms ease;
}

#view-depthub .depthub-job-subtask-check::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    transform: scale(0);
    transition: transform 120ms ease;
    background: #9fd7ff;
}

#view-depthub .depthub-job-subtask-check:hover {
    border-color: #9fd7ff;
}

#view-depthub .depthub-job-subtask-check:checked {
    border-color: #9fd7ff;
    background: color-mix(in srgb, #9fd7ff 20%, transparent);
}

#view-depthub .depthub-job-subtask-check:checked::before {
    transform: scale(1);
}

#view-depthub .depthub-job-main-check-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

#view-depthub .depthub-job-main-check {
    width: 19px;
    height: 19px;
    min-width: 19px;
    appearance: none;
    -webkit-appearance: none;
    border: 1.5px solid color-mix(in srgb, #ffffff 78%, transparent);
    border-radius: 50%;
    background: transparent;
    display: inline-grid;
    place-content: center;
    cursor: pointer;
}

#view-depthub .depthub-job-main-check::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    transform: scale(0);
    transition: transform 120ms ease;
    background: #9fd7ff;
}

#view-depthub .depthub-job-main-check:checked {
    border-color: #9fd7ff;
    background: color-mix(in srgb, #9fd7ff 20%, transparent);
}

#view-depthub .depthub-job-main-check:checked::before {
    transform: scale(1);
}

#view-depthub .depthub-job-subtask-meta {
    margin: 2px 0 0 26px;
    font-size: 11px;
    color: var(--text-muted);
}

#view-depthub #depthub-sub-view-jobs .depthub-table-actions-end {
    width: auto;
    white-space: nowrap;
    vertical-align: middle;
    text-align: center;
}

#view-depthub #depthub-sub-view-jobs .depthub-job-action-row {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: nowrap;
}

#view-depthub #depthub-sub-view-jobs .depthub-jobs-cards-wrap {
    margin-top: 10px;
}

#view-depthub #depthub-sub-view-jobs .depthub-jobs-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 12px;
}

#view-depthub #depthub-sub-view-jobs .depthub-job-card {
    border: 1px solid var(--table-wrap-border, var(--surface-border));
    border-radius: 12px;
    background: var(--table-wrap-bg, var(--surface-panel-alt));
    box-shadow: var(--table-wrap-shadow, 0 8px 24px rgba(0, 0, 0, 0.22));
    padding: 10px 12px;
    display: grid;
    gap: 8px;
}

#view-depthub #depthub-sub-view-jobs .depthub-job-card-top {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 10px;
}

#view-depthub #depthub-sub-view-jobs .depthub-job-card-top .depthub-job-status-pill {
    margin-left: auto;
}

#view-depthub #depthub-sub-view-jobs .depthub-job-card-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.3;
}

#view-depthub #depthub-sub-view-jobs .depthub-job-card-body {
    padding-right: 0;
}

#view-depthub #depthub-sub-view-jobs .depthub-job-card-desc {
    margin-top: 4px;
    font-size: 14px;
    color: var(--text-secondary);
}

#view-depthub #depthub-sub-view-jobs .depthub-job-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
    font-size: 11px;
    color: var(--text-muted);
}

#view-depthub #depthub-sub-view-jobs .depthub-job-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: auto;
}

#view-depthub #depthub-sub-view-jobs .depthub-job-action-row {
    margin-left: auto;
}

#view-depthub #depthub-sub-view-jobs .depthub-job-main-check-placeholder {
    width: 19px;
    min-width: 19px;
}

#depthub-job-view-title,
#depthub-job-view-desc,
#depthub-job-view-status {
    white-space: pre-wrap;
}

#depthub-job-view-modal #depthub-job-view-title,
#depthub-job-view-modal #depthub-job-view-desc,
#depthub-job-view-modal #depthub-job-view-status {
    padding: 12px 14px;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.35;
}

#depthub-job-view-modal #depthub-job-view-status {
    font-size: 13px;
    text-transform: lowercase;
}

#depthub-job-view-modal .depthub-job-subtask-section + .depthub-job-subtask-section {
    margin-top: 12px;
}

#depthub-job-view-modal .depthub-job-subtask-section-title {
    margin: 0 0 8px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-muted);
}

#depthub-job-view-modal .depthub-job-subtask-section-list {
    display: grid;
    gap: 6px;
}

#depthub-job-view-modal .depthub-job-subtask-check {
    width: 17px;
    height: 17px;
    min-width: 17px;
    appearance: none;
    -webkit-appearance: none;
    border: 1.5px solid color-mix(in srgb, #ffffff 78%, transparent);
    border-radius: 50%;
    background: transparent;
    display: inline-grid;
    place-content: center;
    cursor: pointer;
    transition: border-color 120ms ease, background 120ms ease;
}

#depthub-job-view-modal .depthub-job-subtask-check::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    transform: scale(0);
    transition: transform 120ms ease;
    background: #d7e3ef;
}

#depthub-job-view-modal .depthub-job-subtask-check:checked {
    border-color: #34d399;
    background: linear-gradient(180deg, #34d399 0%, #10b981 100%);
}

#depthub-job-view-modal .depthub-job-subtask-check:checked::before {
    transform: scale(1);
    background: #ffffff;
}

#depthub-job-view-modal .depthub-job-subtask-item.is-completed > span {
    text-decoration: line-through;
    opacity: 0.65;
}

#device-job-modal .device-job-image-card {
    position: relative;
    width: 110px;
    height: 82px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--table-border-strong);
    background: var(--app-bg);
}

#device-job-modal .device-job-image-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: zoom-in;
    display: block;
}

#device-job-modal .device-job-image-remove-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 22px;
    height: 22px;
    min-width: 22px;
    padding: 0;
    z-index: 2;
}

.device-job-image-preview-body {
    display: flex;
    align-items: center;
    justify-content: center;
}

#device-job-image-preview-image {
    width: min(86vw, 820px);
    max-height: min(82vh, 720px);
    object-fit: contain;
    border: 1px solid var(--table-border-strong);
    border-radius: 10px;
    background: #fff;
    padding: 8px;
}

/* Global checklist grid + checkbox scheme (device jobs + helpdesk public form) */
.module-checkbox-list,
.checklist-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px 12px;
}

@media (max-width: 1100px) {
    .module-checkbox-list,
    .checklist-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 820px) {
    .module-checkbox-list,
    .checklist-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 560px) {
    .module-checkbox-list,
    .checklist-grid {
        grid-template-columns: 1fr;
    }
}

.module-checkbox-item,
.checklist-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 12px;
    background: color-mix(in srgb, var(--surface-panel-strong) 70%, transparent);
    border: 1px solid var(--border-panel);
    color: var(--text-secondary);
    font-size: 12px;
    transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.module-checkbox-item:hover,
.checklist-item:hover {
    border-color: var(--input-focus-border);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--input-focus-ring) 70%, transparent);
}

.module-checkbox-item input[type="checkbox"],
.checklist-item input[type="checkbox"] {
    appearance: none !important;
    -webkit-appearance: none !important;
    width: 16px !important;
    height: 16px !important;
    min-height: 16px !important;
    border-radius: 4px !important;
    border: 1px solid var(--input-border) !important;
    background: var(--input-bg) !important;
    margin: 0 !important;
    position: relative !important;
    display: inline-grid !important;
    place-items: center !important;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.18);
    transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.module-checkbox-item input[type="checkbox"]::after,
.checklist-item input[type="checkbox"]::after {
    content: "";
    width: 8px;
    height: 5px;
    border: 2px solid #fff;
    border-top: 0;
    border-right: 0;
    transform: rotate(-45deg) scale(0);
    transform-origin: center;
    transition: transform 0.16s ease;
}

.module-checkbox-item input[type="checkbox"]:checked,
.checklist-item input[type="checkbox"]:checked {
    background: var(--brand-primary) !important;
    border-color: var(--brand-primary) !important;
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand-primary) 24%, transparent);
}

.module-checkbox-item input[type="checkbox"]:checked::after,
.checklist-item input[type="checkbox"]:checked::after {
    transform: rotate(-45deg) scale(1);
}

.module-checkbox-item:has(input[type="checkbox"]:checked),
.checklist-item:has(input[type="checkbox"]:checked) {
    background: color-mix(in srgb, var(--brand-primary) 18%, var(--surface-panel-strong));
    border-color: color-mix(in srgb, var(--brand-primary) 55%, var(--border-panel));
    color: var(--text-primary);
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--brand-primary) 45%, transparent);
}

.module-checkbox-item input[type="checkbox"]:focus-visible,
.checklist-item input[type="checkbox"]:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px var(--input-focus-ring);
}






