/* Dark theme component overrides */

html[data-theme="dark"] .header-menu-btn {
    border: none;
    background: transparent;
    color: rgba(255, 255, 255, 0.65);
}

html[data-theme="dark"] .header-menu-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.95);
}

html[data-theme="dark"] .user-dropdown {
    border-color: var(--gray-300);
    box-shadow: 0 18px 35px -18px rgba(2, 6, 23, 0.9);
}

html[data-theme="dark"] .dropdown-divider {
    background: var(--gray-300);
}

html[data-theme="dark"] .dropdown-item:hover {
    background: var(--gray-200);
    color: var(--primary-light);
}

html[data-theme="dark"] .dropdown-item:hover .dropdown-icon {
    color: var(--primary-light);
}

html[data-theme="dark"] .dropdown-icon {
    color: var(--gray-500);
}

/* Theme Toggle - Dark Mode */
html[data-theme="dark"] .theme-toggle-pill {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.2);
}

html[data-theme="dark"] .theme-toggle-thumb {
    background: rgba(255, 255, 255, 0.28);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

html[data-theme="dark"] .theme-toggle-btn {
    color: rgba(255, 255, 255, 0.6);
}

html[data-theme="dark"] .theme-toggle-btn:hover {
    color: rgba(255, 255, 255, 0.85);
}

html[data-theme="dark"] .theme-toggle-btn.active {
    color: var(--primary-light);
}

html[data-theme="dark"] .theme-section-title {
    color: rgba(255, 255, 255, 0.7);
}

html[data-theme="dark"] .dropdown-item.logout-link {
    color: var(--gray-900);
}

html[data-theme="dark"] .dropdown-item.logout-link .dropdown-icon {
    color: inherit;
}

html[data-theme="dark"] .dropdown-item.logout-link:hover {
    color: #ffffff;
}

html[data-theme="dark"] .messages-container .message {
    border: 1px solid rgba(148, 163, 184, 0.25);
    background: var(--white);
    color: var(--gray-800);
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

html[data-theme="dark"] .message-success {
    background: rgba(34, 197, 94, 0.15);
    border-left-color: rgba(34, 197, 94, 0.8);
    border-color: rgba(34, 197, 94, 0.35);
    color: #bbf7d0;
}

html[data-theme="dark"] .message-error {
    background: rgba(248, 113, 113, 0.18);
    border-left-color: rgba(220, 38, 38, 0.8);
    border-color: rgba(220, 38, 38, 0.35);
    color: #fecaca;
}

html[data-theme="dark"] .message-warning {
    background: rgba(250, 204, 21, 0.18);
    border-left-color: rgba(250, 204, 21, 0.8);
    border-color: rgba(250, 204, 21, 0.35);
    color: #fef08a;
}

html[data-theme="dark"] .message-info {
    background: rgba(96, 165, 250, 0.2);
    border-left-color: rgba(59, 130, 246, 0.8);
    border-color: rgba(96, 165, 250, 0.35);
    color: #bfdbfe;
}

html[data-theme="dark"] .search-highlight {
    background: rgba(250, 204, 21, 0.25);
    color: #fde68a;
    box-shadow: 0 0 0 1px rgba(250, 204, 21, 0.35);
}

html[data-theme="dark"] .tree-node.search-match {
    background: rgba(250, 204, 21, 0.12);
    border-left-color: #facc15;
}

html[data-theme="dark"] .loading-overlay {
    background: rgba(0, 0, 0, 0.92);
}

html[data-theme="dark"] .spinner {
    border-color: var(--gray-300);
    border-top-color: transparent;
    border-right-color: transparent;
}

html[data-theme="dark"] .loading-spinner p {
    color: var(--gray-700);
}

html[data-theme="dark"] body,
html[data-theme="dark"] .dashboard-container,
html[data-theme="dark"] .main-content {
    background: var(--gray-50);
    color: var(--gray-900);
}

html[data-theme="dark"] .topology-tree {
    background: var(--gray-50);
    border-color: var(--gray-300);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.5), 0 2px 4px -1px rgba(0, 0, 0, 0.3);
}

html[data-theme="dark"] .header,
html[data-theme="dark"] .footer,
html[data-theme="dark"] .sidebar,
html[data-theme="dark"] .sidebar .control-section,
html[data-theme="dark"] .panel {
    background: var(--gray-100);
    color: var(--gray-900);
}

/* Topology header - transparent, buttons float above content */
html[data-theme="dark"] .topology-header {
    background: transparent;
    border-bottom: none;
    color: var(--gray-900);
}

html[data-theme="dark"] .header,
html[data-theme="dark"] .footer,
html[data-theme="dark"] .sidebar,
html[data-theme="dark"] .topology-header,
html[data-theme="dark"] .panel-resizer--sidebar,
html[data-theme="dark"] .panel-resizer--details {
    border-color: var(--gray-300);
}

html[data-theme="dark"] .footer-text,
html[data-theme="dark"] .topology-breadcrumb,
html[data-theme="dark"] .nav-link {
    color: var(--gray-700);
}

html[data-theme="dark"] .nav-link:hover,
html[data-theme="dark"] .nav-link.active {
    background: var(--gray-200);
    color: var(--gray-900);
}

html[data-theme="dark"] .user-name,
html[data-theme="dark"] .user-details span,
html[data-theme="dark"] .dropdown-item {
    color: var(--gray-800);
}

html[data-theme="dark"] .user-menu-btn {
    border: 2px solid rgba(255, 255, 255, 0.15);
    background: var(--primary-color);
    color: white;
}

html[data-theme="dark"] .user-menu-btn:hover {
    border-color: var(--primary-light);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

html[data-theme="dark"] .dropdown-item:hover {
    background: var(--gray-200);
}

html[data-theme="dark"] .dropdown-item.logout-link {
    color: var(--gray-900);
}

html[data-theme="dark"] .dropdown-item.logout-link:hover {
    color: #ffffff;
}

html[data-theme="dark"] .dropdown-label {
    color: var(--gray-800);
}



/* Siren button states - MAXIMUM CONTRAST for instant recognition */
html[data-theme="dark"] .icon-btn.siren.calm,
html[data-theme="dark"] .icon-btn.siren[data-state="calm"] {
    background: rgba(48, 209, 88, 0.75);
    border-color: rgba(48, 209, 88, 0.95);
    color: #ffffff;
    box-shadow: 0 0 0 2px rgba(48, 209, 88, 0.5), 0 2px 8px rgba(48, 209, 88, 0.4);
}

html[data-theme="dark"] .icon-btn.siren.calm img,
html[data-theme="dark"] .icon-btn.siren[data-state="calm"] img {
    filter: brightness(0) invert(1);
}

html[data-theme="dark"] .icon-btn.siren.calm:hover,
html[data-theme="dark"] .icon-btn.siren[data-state="calm"]:hover {
    background: rgba(48, 209, 88, 0.75);
    border-color: rgba(48, 209, 88, 0.95);
    color: #ffffff;
    box-shadow: 0 0 0 2px rgba(48, 209, 88, 0.5), 0 2px 8px rgba(48, 209, 88, 0.4);
    transform: none;
}

html[data-theme="dark"] .icon-btn.siren.active,
html[data-theme="dark"] .icon-btn.siren[data-state="alert"] {
    background: #ff453a;
    border-color: #c1271f;
    color: #ffffff;
    box-shadow: 0 0 0 3px rgba(255, 69, 58, 0.5), 0 12px 30px rgba(255, 69, 58, 0.4);
    animation: pulse-red 2s ease-in-out infinite;
}

@keyframes pulse-red {
    0%, 100% {
        box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.4), 0 4px 12px rgba(239, 68, 68, 0.6);
    }
    50% {
        box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.6), 0 4px 16px rgba(239, 68, 68, 0.8);
    }
}

html[data-theme="dark"] .icon-btn.siren.active img,
html[data-theme="dark"] .icon-btn.siren[data-state="alert"] img {
    filter: brightness(0) invert(1) drop-shadow(0 0 4px rgba(255, 69, 58, 0.55));
}

html[data-theme="dark"] .icon-btn.siren.active:hover,
html[data-theme="dark"] .icon-btn.siren[data-state="alert"]:hover {
    background: #ff453a;
    border-color: #c1271f;
    color: #ffffff;
    box-shadow: 0 0 0 3px rgba(255, 69, 58, 0.5), 0 12px 30px rgba(255, 69, 58, 0.4);
    transform: none;
}

html[data-theme="dark"] .icon-btn.siren.suppressed,
html[data-theme="dark"] .icon-btn.siren[data-state="suppressed"] {
    background: rgba(142, 142, 147, 0.35);
    border-color: rgba(142, 142, 147, 0.6);
    color: rgba(255, 255, 255, 0.85);
    box-shadow: 0 0 0 2px rgba(142, 142, 147, 0.15);
}

html[data-theme="dark"] .icon-btn.siren.suppressed img,
html[data-theme="dark"] .icon-btn.siren[data-state="suppressed"] img {
    filter: brightness(0) invert(1) grayscale(1) opacity(0.65);
}

html[data-theme="dark"] .icon-btn.siren.suppressed:hover,
html[data-theme="dark"] .icon-btn.siren[data-state="suppressed"]:hover {
    background: rgba(142, 142, 147, 0.35);
    border-color: rgba(142, 142, 147, 0.6);
    color: rgba(255, 255, 255, 0.85);
    box-shadow: 0 0 0 2px rgba(142, 142, 147, 0.15);
    transform: none;
}

/* Siren-sensitivity group container */
html[data-theme="dark"] .siren-sensitivity-group {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.55);
}

html[data-theme="dark"] .siren-sensitivity-group:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.6);
}

html[data-theme="dark"] .siren-sensitivity-group .icon-btn {
    background: transparent;
    border: none;
}

html[data-theme="dark"] .siren-sensitivity-group .icon-btn:hover {
    transform: none;
}

html[data-theme="dark"] .siren-sensitivity-group .icon-btn:not(.siren):hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Sensitivity bar separator */
html[data-theme="dark"] .sensitivity-bar {
    border-left-color: #48484a;
}

html[data-theme="dark"] .sensitivity-bar.disabled {
    opacity: 0.35;
}

/* Sensitivity level buttons (the dots) */
html[data-theme="dark"] .sensitivity-level {
    background: transparent;
}

html[data-theme="dark"] .sensitivity-level:hover {
    background: rgba(255, 255, 255, 0.1);
}

html[data-theme="dark"] .sensitivity-indicator {
    background: #6e6e73;
}

html[data-theme="dark"] .sensitivity-level.active {
    background: rgba(10, 132, 255, 0.18);
}

html[data-theme="dark"] .sensitivity-level.active .sensitivity-indicator {
    background: linear-gradient(135deg, #4a9eff 0%, #8b7dd0 100%);
    box-shadow: 0 2px 8px rgba(74, 158, 255, 0.6), 0 0 12px rgba(74, 158, 255, 0.4);
}

/* Refresh button and other standalone buttons */
html[data-theme="dark"] .refresh-button,
html[data-theme="dark"] #refresh-btn {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.8);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
}

html[data-theme="dark"] .refresh-button:hover,
html[data-theme="dark"] #refresh-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.95);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.55);
    transform: translateY(-1px);
}

html[data-theme="dark"] .refresh-button img,
html[data-theme="dark"] #refresh-btn img {
    filter: brightness(0) invert(1);
}

html[data-theme="dark"] .sidebar .control-section h3,
html[data-theme="dark"] .section-title,
html[data-theme="dark"] .panel .panel-title {
    color: var(--gray-800);
}

html[data-theme="dark"] .filter-summary,
html[data-theme="dark"] .nav-info,
html[data-theme="dark"] .topology-empty-message {
    color: #aeaeb2;
}

/* Details Panel - Complete overhaul */
html[data-theme="dark"] .details-panel {
    background: #1c1c1e;
    color: var(--gray-900);
    border-left-color: #48484a;
    box-shadow: -4px 0 12px rgba(0, 0, 0, 0.5);
}

html[data-theme="dark"] .details-header {
    background: #2c2c2e;
    border-bottom-color: #48484a;
}

html[data-theme="dark"] .topology-breadcrumb,
html[data-theme="dark"] .breadcrumb-item {
    color: #c7c7cc;
}

html[data-theme="dark"] .breadcrumb-separator {
    color: #8e8e93;
}

/* Details header buttons */
html[data-theme="dark"] .details-actions .icon-btn,
html[data-theme="dark"] .panel-actions .icon-btn {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.8);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
}

html[data-theme="dark"] .details-actions .icon-btn:hover,
html[data-theme="dark"] .panel-actions .icon-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.95);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.55);
    transform: translateY(-1px);
}

/* Close button */
html[data-theme="dark"] .close-details-btn,
html[data-theme="dark"] .btn-close {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.8);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
}

html[data-theme="dark"] .close-details-btn:hover,
html[data-theme="dark"] .btn-close:hover {
    background: rgba(255, 69, 58, 0.18);
    border-color: rgba(255, 69, 58, 0.6);
    color: #ffd1cc;
    box-shadow: 0 4px 14px rgba(255, 69, 58, 0.4);
    transform: translateY(-1px);
}

/* CTO section header */
html[data-theme="dark"] .cto-section-header,
html[data-theme="dark"] .details-section-header {
    background: #5e2e2e;
    border-color: #8b4545;
    color: #fca5a5;
}

html[data-theme="dark"] .client-count-badge {
    color: #fca5a5;
}

/* Tables */
html[data-theme="dark"] .table,
html[data-theme="dark"] .card,
html[data-theme="dark"] .panel-body {
    background: #2c2c2e;
    color: var(--gray-900);
    border-color: #48484a;
}

html[data-theme="dark"] .table thead th {
    background: #3a3a3c;
    color: #e5e5e7;
    border-bottom-color: #48484a;
}

html[data-theme="dark"] .table tbody td {
    border-bottom-color: #3a3a3c;
    color: #e5e5e7;
}

html[data-theme="dark"] .table tbody tr:nth-child(odd) {
    background: rgba(58, 58, 60, 0.3);
}

html[data-theme="dark"] .table tbody tr:hover {
    background: rgba(59, 130, 246, 0.12);
}

/* Status indicators in tables */
html[data-theme="dark"] .status-online {
    color: #6ee7b7;
}

html[data-theme="dark"] .status-offline {
    color: #fca5a5;
}

/* Client table in details panel */
html[data-theme="dark"] .client-table {
    background: #2c2c2e;
    border-color: #48484a;
}

html[data-theme="dark"] .client-table th {
    background: #3a3a3c;
    color: #e5e5e7;
    border-bottom-color: #48484a;
}

html[data-theme="dark"] .client-table td {
    border-bottom-color: #3a3a3c;
    color: #e5e5e7;
}

html[data-theme="dark"] .client-table tbody tr:hover {
    background: rgba(59, 130, 246, 0.12);
}

/* Details content sections */
html[data-theme="dark"] .details-content {
    background: #1c1c1e;
}

html[data-theme="dark"] .details-loading,
html[data-theme="dark"] .details-empty {
    color: #aeaeb2;
}

/* CTO card in details panel */
html[data-theme="dark"] .cto-card {
    background: #2c2c2e;
    border-color: #48484a;
}

html[data-theme="dark"] .cto-card:hover {
    border-color: #6e6e73;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

html[data-theme="dark"] .cto-card-header {
    background: #2c2c2e;
    border-bottom-color: #48484a;
}

html[data-theme="dark"] .cto-card-header[role="button"]:hover {
    background: #3a3a3c;
}

html[data-theme="dark"] .cto-title,
html[data-theme="dark"] .cto-name {
    color: #e5e5e7;
}

html[data-theme="dark"] .cto-subtitle,
html[data-theme="dark"] .cto-meta {
    color: var(--dark-subtitle-color);
}

html[data-theme="dark"] .panel-resizer::after {
    background: var(--gray-400);
    opacity: 0.75;
}

html[data-theme="dark"] .panel-resizer:hover::after,
html[data-theme="dark"] .panel-resizer:focus-visible::after {
    background: var(--primary-color);
    opacity: 1;
}

html[data-theme="dark"] .message-close {
    color: var(--gray-800);
}

/* Input fields - much more visible */
html[data-theme="dark"] .search-input,
html[data-theme="dark"] input[type="text"],
html[data-theme="dark"] input[type="search"],
html[data-theme="dark"] input[type="email"],
html[data-theme="dark"] input[type="password"],
html[data-theme="dark"] select,
html[data-theme="dark"] textarea {
    background: #3a3a3c;
    border-color: #6e6e73;
    color: #f5f5f7;
}

html[data-theme="dark"] .search-input::placeholder,
html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder {
    color: #98989d;
}

html[data-theme="dark"] .search-input:focus,
html[data-theme="dark"] input:focus,
html[data-theme="dark"] select:focus,
html[data-theme="dark"] textarea:focus {
    background: #424245;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(10, 132, 255, 0.25);
}

/* Dropdown/Select styling */
html[data-theme="dark"] .multiselect-trigger,
html[data-theme="dark"] .olt-multiselect-trigger {
    background: #3a3a3c;
    border-color: #6e6e73;
    color: #f5f5f7;
}

html[data-theme="dark"] .multiselect-trigger:hover {
    background: #424245;
    border-color: #86868b;
}

/* Section headers and labels - more visible */
html[data-theme="dark"] .control-section h3,
html[data-theme="dark"] label,
html[data-theme="dark"] .section-label {
    color: #e5e5e7;
}

/* Client counts and secondary text */
html[data-theme="dark"] .client-count,
html[data-theme="dark"] .tree-node-meta,
html[data-theme="dark"] .cto-clients {
    color: #aeaeb2;
}

/* Dropdown menus */
html[data-theme="dark"] .multiselect-dropdown,
html[data-theme="dark"] .dropdown-menu {
    background: #2c2c2e;
    border-color: #48484a;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
}

html[data-theme="dark"] .multiselect-option,
html[data-theme="dark"] .dropdown-option {
    color: #e5e5e7;
}

html[data-theme="dark"] .multiselect-option:hover {
    background: #3a3a3c;
}

/* OLT Filter Dropdown - Dark Mode */
html[data-theme="dark"] .multiselect-divider {
    background: #48484a;
}

html[data-theme="dark"] .option-label {
    color: #e5e5e7;
}

html[data-theme="dark"] .option-count {
    background: #3a3a3c;
    color: #aeaeb2;
}

html[data-theme="dark"] .select-all-option {
    color: var(--primary-light);
}

html[data-theme="dark"] .select-all-option .option-label {
    color: var(--primary-light);
}

html[data-theme="dark"] .multiselect-option .checkbox-custom {
    border-color: #6e6e73;
}

html[data-theme="dark"] .multiselect-label {
    color: #f5f5f7;
}

/* Search suggestions */
html[data-theme="dark"] .search-suggestions {
    background: #2c2c2e;
    border-color: #48484a;
}

html[data-theme="dark"] .search-suggestion {
    border-bottom-color: #3a3a3c;
}

html[data-theme="dark"] .search-suggestion:hover {
    background: #3a3a3c;
}

html[data-theme="dark"] .suggestion-primary {
    color: #e5e5e7;
}

html[data-theme="dark"] .suggestion-secondary {
    color: #98989d;
}

/* Ensure all SVG icons in buttons are white in dark mode */
html[data-theme="dark"] .icon-btn svg,
html[data-theme="dark"] .icon-btn svg path,
html[data-theme="dark"] .icon-btn svg circle,
html[data-theme="dark"] .icon-btn svg rect,
html[data-theme="dark"] .icon-btn svg line,
html[data-theme="dark"] .icon-btn svg polyline,
html[data-theme="dark"] .icon-btn svg polygon {
    fill: rgba(255, 255, 255, 0.9) !important;
    stroke: rgba(255, 255, 255, 0.9) !important;
    color: rgba(255, 255, 255, 0.9) !important;
}

html[data-theme="dark"] .icon-btn:hover svg,
html[data-theme="dark"] .icon-btn:hover svg path,
html[data-theme="dark"] .icon-btn:hover svg circle,
html[data-theme="dark"] .icon-btn:hover svg rect,
html[data-theme="dark"] .icon-btn:hover svg line,
html[data-theme="dark"] .icon-btn:hover svg polyline,
html[data-theme="dark"] .icon-btn:hover svg polygon {
    fill: #ffffff !important;
    stroke: #ffffff !important;
    color: #ffffff !important;
}

/* Also target img elements (SVG files loaded as images) */
html[data-theme="dark"] .icon-btn img {
    filter: brightness(0) invert(1) !important;
}

html[data-theme="dark"] .icon-btn:hover img {
    filter: brightness(0) invert(1) !important;
}

/* Force white for specific inline SVGs */
html[data-theme="dark"] .filter-dropdown-btn .filter-icon {
    fill: #ffffff !important;
    color: #ffffff !important;
}

html[data-theme="dark"] .filter-dropdown-btn:hover .filter-icon,
html[data-theme="dark"] .filter-dropdown-btn[aria-expanded="true"] .filter-icon {
    fill: #ffffff !important;
    color: #ffffff !important;
}

html[data-theme="dark"] .header-search-icon {
    stroke: #ffffff !important;
    color: #ffffff !important;
}

html[data-theme="dark"] .header-search-wrapper:hover .header-search-icon {
    stroke: #ffffff !important;
    color: #ffffff !important;
}

/* Header search icon */
html[data-theme="dark"] .header-search-icon {
    color: rgba(255, 255, 255, 0.6);
}

html[data-theme="dark"] .header-search-wrapper:hover .header-search-icon {
    color: rgba(255, 255, 255, 0.8);
}

/* PON aggregation cards containing CTO chips */
html[data-theme="dark"] .pon-agg-card {
    background: rgba(28, 28, 30, 0.88);
    border-color: rgba(255, 255, 255, 0.14);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
}

html[data-theme="dark"] .pon-agg-card:hover {
    background: rgba(44, 44, 46, 0.95);
    border-color: rgba(255, 255, 255, 0.22);
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.55);
}

html[data-theme="dark"] .pon-agg-card.is-selected,
html[data-theme="dark"] .pon-agg-card.selected,
html[data-theme="dark"] .tree-node.is-selected .pon-agg-card {
    border-color: rgba(100, 210, 255, 0.7);
    box-shadow: 0 16px 36px rgba(100, 210, 255, 0.26);
    background: linear-gradient(135deg, rgba(100, 210, 255, 0.18) 0%, rgba(94, 92, 255, 0.16) 100%);
}

html[data-theme="dark"] .pon-agg-label {
    color: #e5e5e7;
    opacity: 0.95;
}

html[data-theme="dark"] .pon-agg-empty {
    color: #d4d4d8;
}

html[data-theme="dark"] .pon-agg-header {
    border-bottom-color: #52525b;
}

html[data-theme="dark"] .pon-agg-footer {
    color: #d4d4d8;
    border: none;
}

html[data-theme="dark"] .header-item,
html[data-theme="dark"] .footer-item {
    color: #ffffff;
    font-weight: 500;
}

/* Tree nodes - better contrast */
html[data-theme="dark"] .tree-node-content {
    background: rgba(28, 28, 30, 0.92);
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45);
}

html[data-theme="dark"] .tree-node-content:hover {
    background: rgba(44, 44, 46, 0.95);
    border-color: rgba(255, 255, 255, 0.16);
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.5);
}

html[data-theme="dark"] .tree-node::before {
    background: rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-pill);
    opacity: 1;
}

/* Status indicators on tree nodes - BRIGHT & UNMISTAKABLE */
html[data-theme="dark"] .tree-node.status-online::before {
    background: #30d158;
    box-shadow: 0 0 12px rgba(48, 209, 88, 0.85);
}

html[data-theme="dark"] .tree-node.status-offline::before {
    background: #ff453a;
    box-shadow: 0 0 12px rgba(255, 69, 58, 0.85);
}

html[data-theme="dark"] .tree-node.status-warning::before {
    background: #ffd60a;
    box-shadow: 0 0 12px rgba(255, 214, 10, 0.85);
}

html[data-theme="dark"] .tree-node.status-neutral::before {
    background: #a1a1aa;
}

/* Add glow to tree node content based on status */
html[data-theme="dark"] .tree-node.status-online > .tree-node-content {
    border-left-color: rgba(48, 209, 88, 0.95);
    background: linear-gradient(120deg, rgba(48, 209, 88, 0.38) 0%, rgba(48, 209, 88, 0.12) 100%);
    box-shadow: 0 0 28px rgba(48, 209, 88, 0.32);
}

html[data-theme="dark"] .tree-node.status-offline > .tree-node-content {
    border-left-color: rgba(255, 69, 58, 0.95);
    background: linear-gradient(120deg, rgba(255, 69, 58, 0.38) 0%, rgba(255, 69, 58, 0.12) 100%);
    box-shadow: 0 0 28px rgba(255, 69, 58, 0.32);
}

html[data-theme="dark"] .tree-node.status-warning > .tree-node-content {
    border-left-color: rgba(255, 214, 10, 0.9);
    background: linear-gradient(120deg, rgba(255, 214, 10, 0.42) 0%, rgba(255, 214, 10, 0.16) 100%);
    box-shadow: 0 0 28px rgba(255, 214, 10, 0.32);
}

html[data-theme="dark"] .tree-node.status-neutral > .tree-node-content {
    border-left-color: rgba(142, 142, 147, 0.75);
    background: linear-gradient(120deg, rgba(142, 142, 147, 0.32) 0%, rgba(142, 142, 147, 0.1) 100%);
    box-shadow: 0 0 24px rgba(142, 142, 147, 0.28);
}

/* Tree node labels and text */
html[data-theme="dark"] .tree-node-label,
html[data-theme="dark"] .tree-label,
html[data-theme="dark"] .tree-node-name {
    color: #ffffff;
    font-weight: 600;
}

html[data-theme="dark"] .tree-node-meta,
html[data-theme="dark"] .tree-meta,
html[data-theme="dark"] .tree-node-details {
    color: #d4d4d8;
}

/* Status badges on tree nodes */
html[data-theme="dark"] .status-badge {
    font-weight: 600;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
}

html[data-theme="dark"] .status-badge.status-online {
    background: rgba(48, 209, 88, 0.28);
    color: #30d158;
    border-color: rgba(48, 209, 88, 0.7);
}

html[data-theme="dark"] .status-badge.status-offline {
    background: rgba(255, 69, 58, 0.3);
    color: #ff6f66;
    border-color: rgba(255, 69, 58, 0.75);
}

html[data-theme="dark"] .status-badge.status-warning {
    background: rgba(255, 214, 10, 0.3);
    color: #ffd60a;
    border-color: rgba(255, 214, 10, 0.75);
}

html[data-theme="dark"] .status-badge.status-neutral {
    background: rgba(142, 142, 147, 0.28);
    color: #d1d1d6;
    border-color: rgba(142, 142, 147, 0.65);
}

/* Tree node expand/collapse toggles */
html[data-theme="dark"] .tree-node-toggle {
    color: #d4d4d8;
}

html[data-theme="dark"] .tree-node-toggle:hover {
    background: #3a3a3c;
    color: #ffffff;
}

/* Header Search Bar - Dark Mode */
html[data-theme="dark"] .header-search-input {
    background: #3a3a3c;
    border-color: #6e6e73;
    color: #f5f5f7;
}

html[data-theme="dark"] .header-search-input::placeholder {
    color: #98989d;
}

html[data-theme="dark"] .header-search-input:focus {
    background: #424245;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(10, 132, 255, 0.25);
}

html[data-theme="dark"] .header-search-icon {
    color: #98989d;
}

html[data-theme="dark"] .header-search-clear {
    background: #4a4a4e;
    color: #d1d1d6;
}

html[data-theme="dark"] .header-search-clear:hover {
    background: #5a5a5e;
    color: #f5f5f7;
}

html[data-theme="dark"] .header-search-suggestions {
    background: #2c2c2e;
    border-color: #48484a;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

@media (max-width: 768px) {
    html[data-theme="dark"] .footer {
        background: rgba(28, 28, 30, 0.8);
        border-top-color: rgba(255, 255, 255, 0.1);
    }
    
    html[data-theme="dark"] .header,
    html[data-theme="dark"] .header-content {
        background: var(--gray-100);
    }
}
