/* NOC — página principal (grid, filtros, KPIs) */

body.noc-page,
.noc-page {
    font-family: 'DM Sans', system-ui, sans-serif;
    background: var(--noc-background, var(--bg-main, #050b17)) !important;
    color: var(--noc-text-primary, var(--text-primary, #e2e8f0)) !important;
    transition: background-color 200ms ease, color 200ms ease;
}
.noc-page .font-display {
    font-family: 'Outfit', system-ui, sans-serif;
}

html[data-theme="light"] body.noc-page {
    background: var(--noc-background, #f8fafc) !important;
    color: var(--noc-text-primary, var(--bg-card)) !important;
}
html[data-theme="light"] body.noc-page aside {
    background: var(--noc-surface, rgba(255, 255, 255, 0.96)) !important;
    border-color: var(--noc-border, #e5e7eb) !important;
}

/* Ambient background */
.noc-page-ambient {
    position: fixed;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: -1;
}
.noc-page-ambient__orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.55;
    transition: opacity 200ms ease;
}
.noc-page-ambient__orb--a {
    top: -8%;
    left: 18%;
    width: 420px;
    height: 420px;
    background: color-mix(in srgb, var(--noc-success, #22c55e) 14%, transparent);
}
.noc-page-ambient__orb--b {
    bottom: -6%;
    right: 14%;
    width: 360px;
    height: 360px;
    background: color-mix(in srgb, var(--noc-info, var(--blue)) 16%, transparent);
}
html[data-theme="light"] .noc-page-ambient__orb { opacity: 0.35; }

.noc-page-stack {
    display: grid;
    gap: 18px;
}

.noc-update-badge {
    text-transform: none;
    letter-spacing: 0;
    font-size: 12px;
    font-weight: 700;
}

.noc-header-actions .row {
    gap: 8px;
}

.noc-polling-select {
    padding: 9px 12px;
    min-width: 72px;
}

.noc-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}
.noc-chip {
    font-size: 11px;
    font-weight: 700;
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.2);
    background: rgba(15, 23, 42, 0.35);
    color: rgba(148, 163, 184, 0.95);
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.noc-chip:hover {
    border-color: rgba(110,121,255, 0.35);
    color: #e2e8f0;
}
.noc-chip.is-active {
    border-color: rgba(110,121,255, 0.45);
    background: rgba(110,121,255, 0.12);
    color: #93c5fd;
}
html[data-theme="light"] .noc-chip {
    background: rgba(241, 245, 249, 0.95);
    border-color: rgba(15, 23, 42, 0.1);
    color: #475569;
}
html[data-theme="light"] .noc-chip.is-active {
    background: rgba(110,121,255, 0.1);
    border-color: rgba(110,121,255, 0.35);
    color: var(--blue);
}

.noc-kpi-card--click {
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.noc-kpi-card--click:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}

.noc-filter-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
}

.noc-grid-scroll {
    max-height: min(72vh, 920px);
    overflow-y: auto;
    overscroll-behavior: contain;
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, 0.16);
}
html[data-theme="light"] .noc-grid-scroll {
    border-color: rgba(15, 23, 42, 0.1);
}

.noc-device-grid {
    gap: 16px;
}

.noc-vrow {
    display: grid;
    grid-template-columns: repeat(var(--noc-cols, 3), minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}

.noc-host-card {
    text-align: left;
    width: 100%;
}
.noc-host-card__head {
    align-items: flex-start;
}
.noc-host-card__info {
    min-width: 0;
    flex: 1;
}
.noc-host-card__title {
    font-size: 16px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.noc-host-card__badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}
.noc-host-card__metrics {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 1fr);
    gap: 10px;
    margin-top: 14px;
}
.noc-host-card__metric {
    padding: 12px;
    box-shadow: none;
    min-width: 0;
    overflow: hidden;
}
.noc-host-card__metric-val {
    margin-top: 8px;
    font-weight: 900;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.noc-host-card__metric:first-child .noc-host-card__metric-val {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}
.noc-host-card__foot {
    margin-top: 12px;
    font-size: 12px;
    color: var(--text-secondary);
}
.noc-host-card__foot b {
    color: var(--text-primary);
}

.noc-skeleton-card__line {
    border-radius: 6px;
}
.noc-skeleton-card__line--title {
    height: 18px;
    width: 66%;
}
.noc-skeleton-card__line--sub {
    height: 14px;
    width: 52%;
    margin-top: 10px;
}
.noc-skeleton-card__line--xs {
    height: 10px;
    width: 46px;
}
.noc-skeleton-card__line--sm {
    height: 14px;
    width: 74px;
    margin-top: 10px;
}
.noc-skeleton-card__line--foot {
    height: 14px;
    width: 34%;
    margin-top: 12px;
}
.noc-skeleton-card__badge {
    height: 28px;
    width: 110px;
    border-radius: 999px;
}

.noc-empty {
    margin-top: 8px;
    color: var(--text-secondary);
    text-align: center;
    padding: 24px 12px;
    border-radius: 14px;
    border: 1px dashed rgba(148, 163, 184, 0.2);
}
.noc-empty-actions {
    display: block;
    margin-top: 12px;
}

.noc-list-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 16px;
    padding: 0 4px 24px;
}

/* Filtros sticky (triagem operacional) */
.noc-list-shell .noc-filter-bar {
    position: sticky;
    top: 0;
    z-index: 12;
    padding: 14px 16px;
    background: color-mix(in srgb, var(--bg-card) 94%, transparent);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border);
}

body.icarus-desktop-shell .noc-list-shell .noc-filter-bar {
    top: 56px;
}

body.icarus-mobile-shell .noc-list-shell .noc-filter-bar {
    top: calc(56px + env(safe-area-inset-top, 0px));
}

/* Ações rápidas no card */
.noc-host-card__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid color-mix(in srgb, var(--border) 75%, transparent);
}

.noc-host-card__action {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 8px !important;
    font-size: 11px !important;
    font-weight: 700;
    min-height: 0;
    text-decoration: none;
}

.noc-host-card__action svg,
.noc-host-card__action i {
    width: 14px;
    height: 14px;
}

.noc-list-summary {
    font-size: 12px;
    color: rgba(148, 163, 184, 0.95);
}

.noc-toast-host {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}
.noc-toast {
    pointer-events: auto;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
    animation: noc-toast-in 0.2s ease;
    max-width: min(360px, calc(100vw - 32px));
}
@keyframes noc-toast-in {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}
.noc-toast--ok { background: rgba(16, 185, 129, 0.95); color: #ecfdf5; }
.noc-toast--err { background: rgba(244, 63, 94, 0.95); color: #fff1f2; }
.noc-toast--info { background: rgba(110,121,255, 0.95); color: #eff6ff; }

@media (max-width: 639px) {
    .noc-host-card__metrics {
        grid-template-columns: 1fr;
    }
}

/* Modo war room / parede NOC (P2) */
body.noc-war-room aside.sidebar {
    display: none !important;
}

body.noc-war-room main.page .container {
    max-width: none !important;
    width: 100%;
}

body.noc-war-room .noc-chips {
    display: none;
}

body.noc-war-room .icarus-kpi-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px;
}

body.noc-war-room .noc-page-kpi {
    padding: 22px 24px !important;
}
body.noc-war-room .noc-page-kpi .icarus-kpi-card__label {
    font-size: 13px;
}
body.noc-war-room .noc-page-kpi .icarus-kpi-card__value {
    font-size: clamp(2rem, 3.2vw, 3rem);
    line-height: 1.05;
}

body.noc-war-room .noc-grid-scroll {
    max-height: min(84vh, 1400px);
    border-radius: 16px;
}

body.noc-war-room .noc-war-toggle.is-active {
    background: color-mix(in srgb, var(--accent) 18%, transparent);
    border-color: color-mix(in srgb, var(--accent) 45%, transparent);
    color: var(--accent);
}

.noc-kpi-card--alert-pulse {
    animation: noc-kpi-alert-pulse 1.6s ease-in-out infinite;
    box-shadow: 0 0 0 0 rgba(244, 63, 94, 0.45);
}

@keyframes noc-kpi-alert-pulse {
    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(244, 63, 94, 0.35);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(244, 63, 94, 0);
    }
}

@media (max-width: 900px) {
    body.noc-war-room .icarus-kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Indicador WS / polling (P3) */
.noc-link-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.noc-link-badge__dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: rgba(110,121,255, 0.85);
    flex-shrink: 0;
}

.noc-link-badge--live {
    background: color-mix(in srgb, rgba(16, 185, 129, 0.14) 100%, transparent);
    border-color: rgba(16, 185, 129, 0.35);
    color: #6ee7b7;
}

.noc-link-badge--live .noc-link-badge__dot {
    background: #10b981;
    animation: noc-ws-pulse 1.8s ease-in-out infinite;
}

.noc-link-badge--unavailable {
    background: color-mix(in srgb, rgba(245, 158, 11, 0.12) 100%, transparent);
    border-color: rgba(245, 158, 11, 0.35);
    color: #fcd34d;
}

.noc-link-badge--unavailable .noc-link-badge__dot {
    background: #f59e0b;
}

.noc-link-badge--connecting .noc-link-badge__dot {
    background: rgba(110,121,255, 0.7);
    animation: noc-ws-pulse 1s ease-in-out infinite;
}

html[data-theme="light"] .noc-link-badge--live {
    color: #047857;
}

html[data-theme="light"] .noc-link-badge--unavailable {
    color: #b45309;
}

@keyframes noc-ws-pulse {
    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.55;
        transform: scale(0.92);
    }
}

.noc-host-card--ws-flash {
    outline: 2px solid rgba(16, 185, 129, 0.45);
    outline-offset: 2px;
    transition: outline-color 0.35s ease;
}

/* ═══════════════════════════════════════════════════════════════
   NOC Page — Premium (alinhado ao modal host)
   ═══════════════════════════════════════════════════════════════ */

.noc-page-header {
    align-items: center;
    flex-wrap: wrap;
    gap: 10px 20px;
    margin-bottom: 14px;
}
.noc-page-header__copy { min-width: 0; }
.noc-page-header__actions {
    justify-content: flex-end;
    flex: 1 1 auto;
}
.noc-page-title {
    font-size: clamp(1.75rem, 3vw, 2rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--noc-text-primary, var(--text-primary));
}
.noc-page-subtitle {
    font-size: 14px;
    color: var(--noc-text-secondary, var(--text-secondary));
    max-width: 42rem;
    line-height: 1.5;
}
.noc-page-header__actions {
    gap: 10px;
}
.noc-page .noc-header-actions .btn {
    border-radius: 14px;
    font-size: 13px;
    font-weight: 600;
    transition: transform 200ms ease, box-shadow 200ms ease, background 200ms ease, border-color 200ms ease;
}
.noc-page .noc-header-actions .btn:hover {
    transform: translateY(-1px);
}
.noc-page .noc-header-actions .btn.primary,
.noc-page .noc-filter-actions .btn.primary {
    background: linear-gradient(135deg, color-mix(in srgb, var(--noc-info, var(--blue)) 88%, #000) 0%, var(--noc-info, var(--blue)) 100%);
    border-color: color-mix(in srgb, var(--noc-info, var(--blue)) 45%, transparent);
    box-shadow: 0 8px 24px color-mix(in srgb, var(--noc-info, var(--blue)) 22%, transparent);
}
.noc-page .noc-update-badge,
.noc-page .noc-link-badge {
    border-radius: 999px;
    padding: 8px 14px;
    border: 1px solid var(--noc-border, var(--border));
    background: color-mix(in srgb, var(--noc-card, var(--bg-card)) 75%, transparent);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.01em;
    text-transform: none;
}
.noc-page .noc-polling-select {
    border-radius: 14px;
    border: 1px solid var(--noc-border, var(--border));
    background: color-mix(in srgb, var(--noc-card, var(--bg-card)) 80%, transparent);
    font-size: 13px;
    font-weight: 600;
}

/* KPI premium */
.noc-kpi-premium-grid {
    gap: 20px;
    margin-bottom: 20px;
}
.noc-page-kpi {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 20px 22px !important;
    border-radius: 18px !important;
    overflow: hidden;
    border: 1px solid var(--noc-border, var(--border)) !important;
    background: var(--noc-card, var(--bg-card)) !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    transition: transform 200ms ease, box-shadow 200ms ease, border-color 200ms ease !important;
}
html[data-theme="light"] .noc-page-kpi {
    box-shadow: 0 4px 24px rgba(15, 23, 42, 0.06);
}
.noc-page-kpi.icarus-kpi-card--info {
    background: color-mix(in srgb, var(--noc-info, var(--blue)) 8%, var(--noc-card, var(--bg-card))) !important;
    border-color: color-mix(in srgb, var(--noc-info, var(--blue)) 22%, var(--noc-border, var(--border))) !important;
}
.noc-page-kpi.icarus-kpi-card--ok {
    background: color-mix(in srgb, var(--noc-success, #22c55e) 8%, var(--noc-card, var(--bg-card))) !important;
    border-color: color-mix(in srgb, var(--noc-success, #22c55e) 22%, var(--noc-border, var(--border))) !important;
}
.noc-page-kpi.icarus-kpi-card--danger {
    background: color-mix(in srgb, var(--noc-danger, #ef4444) 8%, var(--noc-card, var(--bg-card))) !important;
    border-color: color-mix(in srgb, var(--noc-danger, #ef4444) 22%, var(--noc-border, var(--border))) !important;
}
.noc-page-kpi.icarus-kpi-card--warn {
    background: color-mix(in srgb, var(--noc-warning, #f59e0b) 8%, var(--noc-card, var(--bg-card))) !important;
    border-color: color-mix(in srgb, var(--noc-warning, #f59e0b) 22%, var(--noc-border, var(--border))) !important;
}
.noc-page-kpi:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.12);
}
.noc-page-kpi__icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.noc-page-kpi__icon svg { width: 20px; height: 20px; }
.noc-page-kpi__icon--info {
    background: color-mix(in srgb, var(--noc-info, var(--blue)) 14%, transparent);
    color: var(--noc-info, var(--blue));
}
.noc-page-kpi__icon--ok {
    background: color-mix(in srgb, var(--noc-success, #22c55e) 14%, transparent);
    color: var(--noc-success, #22c55e);
}
.noc-page-kpi__icon--danger {
    background: color-mix(in srgb, var(--noc-danger, #ef4444) 14%, transparent);
    color: var(--noc-danger, #ef4444);
}
.noc-page-kpi__icon--warn {
    background: color-mix(in srgb, var(--noc-warning, #f59e0b) 14%, transparent);
    color: var(--noc-warning, #f59e0b);
}
.noc-page-kpi__body { flex: 1; min-width: 0; }
.noc-page-kpi .icarus-kpi-card__label {
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.01em;
    text-transform: none;
    color: var(--noc-text-secondary, var(--text-secondary));
}
.noc-page-kpi .icarus-kpi-card__value {
    font-size: clamp(1.75rem, 3vw, 2.25rem);
    margin-top: 4px;
    font-variant-numeric: tabular-nums;
}
.noc-page-kpi.icarus-kpi-card--ok .icarus-kpi-card__value { color: var(--noc-success, #22c55e); }
.noc-page-kpi.icarus-kpi-card--danger .icarus-kpi-card__value { color: var(--noc-danger, #ef4444); }
.noc-page-kpi.icarus-kpi-card--warn .icarus-kpi-card__value { color: var(--noc-warning, #f59e0b); }
.noc-page-kpi.icarus-kpi-card--info .icarus-kpi-card__value { color: var(--noc-info, var(--blue)); }
html[data-theme="light"] .noc-page-kpi.icarus-kpi-card--ok .icarus-kpi-card__value { color: #16a34a; }
html[data-theme="light"] .noc-page-kpi.icarus-kpi-card--danger .icarus-kpi-card__value { color: #dc2626; }
html[data-theme="light"] .noc-page-kpi.icarus-kpi-card--warn .icarus-kpi-card__value { color: #d97706; }
html[data-theme="light"] .noc-page-kpi.icarus-kpi-card--info .icarus-kpi-card__value { color: var(--blue); }
.noc-page-kpi__spark {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 42%;
    height: 32px;
    opacity: 0.28;
    pointer-events: none;
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 32'%3E%3Cpath fill='white' d='M0 28 L20 22 L35 24 L50 14 L65 18 L80 8 L95 12 L120 4 L120 32 L0 32Z'/%3E%3C/svg%3E");
    mask-size: 100% 100%;
}
.noc-page-kpi__spark--info { background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--noc-info, var(--blue)) 60%, transparent)); }
.noc-page-kpi__spark--ok { background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--noc-success, #22c55e) 60%, transparent)); }
.noc-page-kpi__spark--danger { background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--noc-danger, #ef4444) 60%, transparent)); }
.noc-page-kpi__spark--warn { background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--noc-warning, #f59e0b) 60%, transparent)); }

/* Chips premium */
.noc-chips--premium {
    gap: 10px;
    margin-bottom: 20px;
}
.noc-chips--premium .noc-chip {
    font-size: 13px;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: 999px;
    border: 1px solid var(--noc-border, rgba(148, 163, 184, 0.2));
    background: color-mix(in srgb, var(--noc-card, var(--bg-main)) 70%, transparent);
    color: var(--noc-text-secondary, #9ca3af);
    transition: transform 200ms ease, background 200ms ease, border-color 200ms ease, color 200ms ease;
}
.noc-chips--premium .noc-chip:hover {
    transform: translateY(-1px);
    background: var(--noc-hover, var(--bg-card));
    color: var(--noc-text-primary, #fff);
    border-color: color-mix(in srgb, var(--noc-info, var(--blue)) 30%, transparent);
}
.noc-chips--premium .noc-chip.is-active {
    background: color-mix(in srgb, var(--noc-info, var(--blue)) 14%, transparent);
    border-color: color-mix(in srgb, var(--noc-info, var(--blue)) 35%, transparent);
    color: var(--noc-info, var(--blue));
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--noc-info, var(--blue)) 12%, transparent);
}
html[data-theme="light"] .noc-chips--premium .noc-chip {
    background: #fff;
    border-color: #e5e7eb;
    color: #6b7280;
}
html[data-theme="light"] .noc-chips--premium .noc-chip.is-active {
    background: color-mix(in srgb, var(--blue) 10%, #fff);
    border-color: color-mix(in srgb, var(--blue) 30%, #e5e7eb);
    color: var(--blue);
}

/* Filter bar premium */
.noc-list-shell--premium { gap: 20px; }
.noc-filter-premium {
    border-radius: 18px !important;
    border: 1px solid var(--noc-border, var(--border)) !important;
    background: color-mix(in srgb, var(--noc-card, var(--bg-card)) 92%, transparent) !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    padding: 20px 22px !important;
}
html[data-theme="light"] .noc-filter-premium {
    box-shadow: 0 4px 24px rgba(15, 23, 42, 0.05);
}
.noc-filter-premium .filter-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--noc-text-secondary, var(--text-secondary));
    letter-spacing: 0.01em;
    text-transform: none;
}
.noc-filter-premium .input-dark,
.noc-filter-premium .select-dark {
    border-radius: 14px;
    border: 1px solid var(--noc-border, var(--border));
    background: color-mix(in srgb, var(--noc-surface, var(--bg-card)) 85%, transparent);
    font-size: 13px;
    transition: border-color 200ms ease, box-shadow 200ms ease;
}
.noc-filter-premium .input-dark:focus,
.noc-filter-premium .select-dark:focus {
    border-color: color-mix(in srgb, var(--noc-info, var(--blue)) 45%, transparent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--noc-info, var(--blue)) 12%, transparent);
}
.noc-filter-actions .btn {
    border-radius: 14px;
    font-weight: 600;
    font-size: 13px;
}

/* Grid scroll premium */
.noc-grid-scroll--premium {
    border-radius: 18px;
    border: 1px solid var(--noc-border, rgba(148, 163, 184, 0.16));
    background: color-mix(in srgb, var(--noc-card, var(--bg-card)) 40%, transparent);
    padding: 16px;
    box-shadow: inset 0 1px 0 color-mix(in srgb, var(--noc-border, #fff) 8%, transparent);
}
html[data-theme="light"] .noc-grid-scroll--premium {
    background: color-mix(in srgb, #fff 88%, #f8fafc);
    border-color: #e5e7eb;
}
.noc-grid-scroll--premium .noc-device-grid {
    gap: 18px;
}
.noc-grid-scroll--premium .noc-vrow {
    gap: 18px;
    margin-bottom: 18px;
}

/* Host cards premium */
.noc-page .noc-host-card {
    border-radius: 18px !important;
    border: 1px solid var(--noc-border, var(--border)) !important;
    background: var(--noc-card, var(--bg-card)) !important;
    padding: 18px 20px !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    transition: transform 200ms ease, box-shadow 200ms ease, border-color 200ms ease !important;
    position: relative;
    overflow: hidden;
}
html[data-theme="light"] .noc-page .noc-host-card {
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.05);
}
.noc-page .noc-host-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--noc-border, var(--border));
    border-radius: 18px 0 0 18px;
    transition: background 200ms ease;
}
.noc-page .noc-host-card:has(.badge.online)::before { background: var(--noc-success, #22c55e); }
.noc-page .noc-host-card:has(.badge.degraded)::before { background: var(--noc-info, var(--blue)); }
.noc-page .noc-host-card:has(.badge.offline)::before { background: var(--noc-danger, #ef4444); }
.noc-page .noc-host-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.12);
    border-color: color-mix(in srgb, var(--noc-info, var(--blue)) 22%, transparent) !important;
}
.noc-page .noc-host-card.selected {
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--noc-info, var(--blue)) 35%, transparent), 0 14px 36px rgba(0, 0, 0, 0.1) !important;
    border-color: color-mix(in srgb, var(--noc-info, var(--blue)) 40%, transparent) !important;
}
.noc-page .noc-host-card__title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--noc-text-primary, var(--text-primary));
}
.noc-page .noc-host-card .card-meta {
    font-size: 12px;
    color: var(--noc-text-secondary, var(--text-secondary));
    margin-top: 4px;
}
.noc-page .noc-host-card__badges .badge {
    font-size: 10px;
    font-weight: 700;
    border-radius: 999px;
    padding: 4px 10px;
}
.noc-page .noc-host-card__metrics {
    gap: 12px;
    margin-top: 16px;
    grid-template-columns: minmax(0, 1.22fr) minmax(0, 1fr) minmax(0, 1fr);
}
.noc-page .noc-host-card__metric {
    border-radius: 14px !important;
    border: 1px solid var(--noc-border, var(--border)) !important;
    background: color-mix(in srgb, var(--noc-hover, var(--bg-card)) 55%, transparent) !important;
    padding: 12px 10px !important;
    min-width: 0;
    overflow: hidden;
}
.noc-page .noc-host-card__metric:first-child {
    padding-inline: 12px 10px !important;
}
html[data-theme="light"] .noc-page .noc-host-card__metric {
    background: #f8fafc !important;
}
.noc-page .noc-host-card__metric .filter-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: none;
    letter-spacing: 0.01em;
    color: var(--noc-text-secondary, var(--text-secondary));
}
.noc-page .noc-host-card__metric-val {
    font-size: 0.9375rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--noc-text-primary, var(--text-primary));
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.noc-page .noc-host-card__metric:first-child .noc-host-card__metric-val {
    font-size: 0.6875rem;
    letter-spacing: 0.03em;
}
.noc-page .noc-host-card__metric-val.tone-green { color: var(--noc-success, #22c55e); }
.noc-page .noc-host-card__metric-val.tone-blue { color: var(--noc-info, var(--blue)); }
.noc-page .noc-host-card__metric-val.tone-red { color: var(--noc-danger, #ef4444); }
.noc-page .noc-host-card__foot {
    margin-top: 14px;
    font-size: 12px;
    color: var(--noc-text-secondary, var(--text-secondary));
}
.noc-page .noc-host-card__actions {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--noc-border, var(--border));
    gap: 8px;
}
.noc-page .noc-host-card__action {
    border-radius: 10px !important;
    border: 1px solid var(--noc-border, var(--border)) !important;
    background: color-mix(in srgb, var(--noc-card, var(--bg-card)) 80%, transparent) !important;
    transition: background 200ms ease, transform 200ms ease;
}
.noc-page .noc-host-card__action:hover {
    background: var(--noc-hover, var(--bg-card)) !important;
    transform: translateY(-1px);
}

/* Empty state premium */
.noc-empty-premium {
    border-radius: 18px;
    border: 1px dashed var(--noc-border, var(--border));
    background: color-mix(in srgb, var(--noc-card, var(--bg-card)) 60%, transparent);
    padding: 40px 24px;
    margin-top: 8px;
}
.noc-empty-premium .empty-state__icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: color-mix(in srgb, var(--noc-info, var(--blue)) 12%, transparent);
    color: var(--noc-info, var(--blue));
    margin-bottom: 12px;
}
.noc-empty-premium .empty-state__title {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--noc-text-primary, var(--text-primary));
}
.noc-empty-premium .empty-state__text {
    color: var(--noc-text-secondary, var(--text-secondary));
    font-size: 14px;
}

.noc-page .noc-list-summary {
    font-size: 13px;
    color: var(--noc-text-secondary, var(--text-secondary));
}

@media (max-width: 900px) {
    .noc-page-header {
        flex-direction: column;
        align-items: stretch;
    }
    .noc-page-header__actions {
        justify-content: flex-start;
    }
    .noc-kpi-premium-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
@media (max-width: 520px) {
    .noc-kpi-premium-grid {
        grid-template-columns: 1fr;
    }
    .noc-page-kpi {
        padding: 16px 18px !important;
    }
}

/* ── Histórico óptico expandido INLINE (acordeão sob a porta clicada) ───────
   O bloco #mOpticalHistoryWrap é movido para dentro de uma <tr> logo abaixo da
   porta selecionada. Destaca a porta aberta e emoldura a linha do gráfico. */
.noc-optical-row.is-open > td {
  background: rgba(91, 99, 240, .14);
  font-weight: 600;
}
.noc-optical-row.is-open > td:first-child {
  box-shadow: inset 3px 0 0 #6e79ff;
}
tr.noc-optical-hist-tr > td {
  padding: 0;
  background: rgba(91, 99, 240, .06);
  border-top: 0;
}
tr.noc-optical-hist-tr #mOpticalHistoryWrap {
  margin: 0;
  padding: 12px 16px 16px;
}

/* Histórico óptico — cabeçalho com seletor de período (24h/7d/30d) */
.noc-opt-hist-head{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}
.noc-opt-period{display:inline-flex;gap:2px;padding:2px;border-radius:8px;background:rgba(148,163,184,.12);border:1px solid rgba(148,163,184,.18)}
.noc-opt-period__btn{appearance:none;border:0;background:transparent;color:#94a3b8;font:600 11px/1 inherit;letter-spacing:.02em;padding:5px 10px;border-radius:6px;cursor:pointer;transition:background .15s,color .15s}
.noc-opt-period__btn:hover{color:#e2e8f0}
.noc-opt-period__btn.is-active{background:#6e79ff;color:#fff}
