/* Network Planner theme shell.
   The Python layout keeps operational colors for states/routes; this layer
   changes neutral surfaces, text, tables, tabs, forms, charts and popovers. */

body.npl-theme-dark {
    --bg: #0d1117;
    --line: #30363d;
    --text: #c9d1d9;
    --muted: #8b949e;
    --npl-bg: #0d1117;
    --npl-surface: #161b22;
    --npl-surface-2: #0b1220;
    --npl-surface-3: #111827;
    --npl-border: #30363d;
    --npl-text: #c9d1d9;
    --npl-muted: #8b949e;
    --npl-strong: #ffffff;
    --npl-chart-grid: rgba(148, 163, 184, 0.22);
    background: #0d1117 !important;
}

body.npl-theme-light {
    --bg: #f5f3ec;
    --line: #cfc7b8;
    --text: #172033;
    --muted: #64748b;
    --npl-bg: #f5f3ec;
    --npl-surface: #ffffff;
    --npl-surface-2: #f0eadf;
    --npl-surface-3: #e7dfd0;
    --npl-border: #cfc7b8;
    --npl-text: #172033;
    --npl-muted: #64748b;
    --npl-strong: #0f172a;
    --npl-chart-grid: rgba(100, 116, 139, 0.22);
    background: #f5f3ec !important;
    color: #172033 !important;
}

#npl-workspace-root.npl-theme-dark {
    --npl-bg: #0d1117;
    --npl-surface: #161b22;
    --npl-surface-2: #0b1220;
    --npl-surface-3: #111827;
    --npl-border: #30363d;
    --npl-text: #c9d1d9;
    --npl-muted: #8b949e;
    --npl-strong: #ffffff;
    --npl-chart-grid: rgba(148, 163, 184, 0.22);
}

#npl-workspace-root.npl-theme-light {
    --npl-bg: #f5f3ec;
    --npl-surface: #ffffff;
    --npl-surface-2: #f0eadf;
    --npl-surface-3: #e7dfd0;
    --npl-border: #cfc7b8;
    --npl-text: #172033;
    --npl-muted: #64748b;
    --npl-strong: #0f172a;
    --npl-chart-grid: rgba(100, 116, 139, 0.22);
    background-color: var(--npl-bg) !important;
    color: var(--npl-text) !important;
}

#npl-workspace-root.npl-theme-light .npl-kpi-card,
#npl-workspace-root.npl-theme-light .npl-plan-shell,
#npl-workspace-root.npl-theme-light .npl-plan-header-panel,
#npl-workspace-root.npl-theme-light .npl-create-edit-zone,
#npl-workspace-root.npl-theme-light .npl-replicate-zone,
#npl-workspace-root.npl-theme-light .npl-action-group,
#npl-workspace-root.npl-theme-light .npl-network-map-section,
#npl-workspace-root.npl-theme-light .npl-network-map-card,
#npl-workspace-root.npl-theme-light .accordion-item,
#npl-workspace-root.npl-theme-light .card,
#npl-workspace-root.npl-theme-light details,
#npl-workspace-root.npl-theme-light .offcanvas,
#npl-workspace-root.npl-theme-light .modal-content,
#npl-workspace-root.npl-theme-light .toast {
    background-color: var(--npl-surface) !important;
    border-color: var(--npl-border) !important;
    color: var(--npl-text) !important;
}

#npl-workspace-root.npl-theme-light .npl-kpi-card div,
#npl-workspace-root.npl-theme-light .npl-plan-shell div[style*="color"],
#npl-workspace-root.npl-theme-light .npl-plan-shell span[style*="color"],
#npl-workspace-root.npl-theme-light .npl-plan-shell label[style*="color"],
#npl-workspace-root.npl-theme-light .npl-zone-title,
#npl-workspace-root.npl-theme-light .npl-field-label,
#npl-workspace-root.npl-theme-light .npl-action-group-title,
#npl-workspace-root.npl-theme-light .npl-network-map-title,
#npl-workspace-root.npl-theme-light summary,
#npl-workspace-root.npl-theme-light label,
#npl-workspace-root.npl-theme-light .form-check-label {
    color: var(--npl-text) !important;
}

#npl-workspace-root.npl-theme-light small,
#npl-workspace-root.npl-theme-light .text-muted,
#npl-workspace-root.npl-theme-light .npl-network-map-subtitle,
#npl-workspace-root.npl-theme-light .npl-network-map-card-subtitle {
    color: var(--npl-muted) !important;
}

#npl-workspace-root.npl-theme-light .nav-tabs {
    border-color: var(--npl-border) !important;
}

#npl-workspace-root.npl-theme-light .nav-tabs .nav-link {
    background-color: transparent !important;
    border-color: transparent !important;
    color: var(--npl-text) !important;
}

#npl-workspace-root.npl-theme-light .nav-tabs .nav-link:hover {
    border-color: var(--npl-border) !important;
}

#npl-workspace-root.npl-theme-light .nav-tabs .nav-link.active {
    background-color: var(--npl-surface-3) !important;
    border-color: var(--npl-border) var(--npl-border) var(--npl-surface-3) !important;
    color: var(--npl-strong) !important;
}

#npl-workspace-root.npl-theme-light input,
#npl-workspace-root.npl-theme-light textarea,
#npl-workspace-root.npl-theme-light select,
#npl-workspace-root.npl-theme-light .form-control,
#npl-workspace-root.npl-theme-light .Select-control,
#npl-workspace-root.npl-theme-light .Select-menu-outer,
#npl-workspace-root.npl-theme-light .Select-menu,
#npl-workspace-root.npl-theme-light .DateInput_input,
#npl-workspace-root.npl-theme-light .DateRangePickerInput,
#npl-workspace-root.npl-theme-light .npl-picker-button,
#npl-workspace-root.npl-theme-light .npl-date-picker-popover,
#npl-workspace-root.npl-theme-light .npl-time-picker-popover {
    background-color: var(--npl-surface) !important;
    border-color: var(--npl-border) !important;
    color: var(--npl-text) !important;
}

#npl-workspace-root.npl-theme-light .Select-value-label,
#npl-workspace-root.npl-theme-light .Select-placeholder,
#npl-workspace-root.npl-theme-light .Select-input > input,
#npl-workspace-root.npl-theme-light .Select-option,
#npl-workspace-root.npl-theme-light .DateInput_input {
    color: var(--npl-text) !important;
}

#npl-workspace-root.npl-theme-light .Select-option {
    background-color: var(--npl-surface) !important;
}

#npl-workspace-root.npl-theme-light .Select-option.is-focused,
#npl-workspace-root.npl-theme-light .npl-time-picker-option:hover,
#npl-workspace-root.npl-theme-light .npl-date-picker-day:hover {
    background-color: var(--npl-surface-2) !important;
}

#npl-workspace-root.npl-theme-light .dash-table-container,
#npl-workspace-root.npl-theme-light .dash-table-container .dash-spreadsheet-container,
#npl-workspace-root.npl-theme-light .dash-table-container .dash-spreadsheet-inner,
#npl-workspace-root.npl-theme-light .dash-table-container .dash-spreadsheet-inner table {
    background-color: var(--npl-surface) !important;
    color: var(--npl-text) !important;
}

#npl-workspace-root.npl-theme-light .dash-table-container .dash-spreadsheet-inner th,
#npl-workspace-root.npl-theme-light .dash-table-container .dash-header {
    background-color: #e6dcca !important;
    border-color: var(--npl-border) !important;
    color: var(--npl-strong) !important;
}

#npl-workspace-root.npl-theme-light .dash-table-container .dash-spreadsheet-inner td,
#npl-workspace-root.npl-theme-light .dash-table-container .dash-cell,
#npl-workspace-root.npl-theme-light .dash-table-container .dash-filter {
    background-color: var(--npl-surface) !important;
    border-color: #ded6c8 !important;
    color: var(--npl-text) !important;
}

#npl-workspace-root.npl-theme-light .dash-table-container .dash-cell.focused,
#npl-workspace-root.npl-theme-light .dash-table-container .dash-cell.cell--selected {
    background-color: #edf7fb !important;
    border-color: #0ea5e9 !important;
}

#npl-workspace-root.npl-theme-light .popover,
#npl-workspace-root.npl-theme-light .npl-kpi-popover,
#npl-workspace-root.npl-theme-light .npl-action-popover,
body.npl-theme-light .popover,
body.npl-theme-light .npl-kpi-popover,
body.npl-theme-light .npl-action-popover {
    --bs-popover-bg: var(--npl-surface);
    --bs-popover-border-color: var(--npl-border);
    --bs-popover-header-bg: var(--npl-surface-2);
    --bs-popover-header-color: var(--npl-strong);
    --bs-popover-body-color: var(--npl-text);
    background-color: var(--npl-surface) !important;
    border-color: var(--npl-border) !important;
    color: var(--npl-text) !important;
}

#npl-workspace-root.npl-theme-light .popover-header,
#npl-workspace-root.npl-theme-light .npl-kpi-popover-header,
#npl-workspace-root.npl-theme-light .npl-action-popover-header,
body.npl-theme-light .popover-header,
body.npl-theme-light .npl-kpi-popover-header,
body.npl-theme-light .npl-action-popover-header {
    background-color: var(--npl-surface-2) !important;
    border-color: var(--npl-border) !important;
    color: var(--npl-strong) !important;
}

#npl-workspace-root.npl-theme-light .popover-body,
#npl-workspace-root.npl-theme-light .npl-kpi-popover-body,
#npl-workspace-root.npl-theme-light .npl-action-popover-body,
body.npl-theme-light .popover-body,
body.npl-theme-light .npl-kpi-popover-body,
body.npl-theme-light .npl-action-popover-body {
    color: var(--npl-text) !important;
}

body.npl-theme-light .fb-navbar {
    background: rgba(245, 243, 236, 0.9) !important;
    border-color: var(--npl-border) !important;
}

body.npl-theme-light .fb-brand-subtitle,
body.npl-theme-light .fb-nav-logout,
body.npl-theme-light .fb-navbar a {
    color: var(--npl-muted) !important;
}

body.npl-theme-light .logo-invert {
    filter: none !important;
    opacity: 0.92 !important;
}

#npl-workspace-root.npl-theme-light .js-plotly-plot,
#npl-workspace-root.npl-theme-light .js-plotly-plot .plotly,
#npl-workspace-root.npl-theme-light .js-plotly-plot .main-svg,
#npl-workspace-root.npl-theme-light .js-plotly-plot .bg,
#npl-workspace-root.npl-theme-light .js-plotly-plot .plotbg {
    background: transparent !important;
    fill: transparent !important;
}

#npl-workspace-root.npl-theme-light .js-plotly-plot text {
    fill: var(--npl-text) !important;
}

#npl-workspace-root.npl-theme-light .js-plotly-plot .xgrid,
#npl-workspace-root.npl-theme-light .js-plotly-plot .ygrid,
#npl-workspace-root.npl-theme-light .js-plotly-plot .zerolinelayer path {
    stroke: var(--npl-chart-grid) !important;
}

#npl-workspace-root.npl-theme-light #npl-language-toggle,
#npl-workspace-root.npl-theme-light #npl-theme-toggle {
    background-color: #d9d2c3 !important;
    border-color: var(--npl-border) !important;
    color: var(--npl-text) !important;
}

#npl-workspace-root.npl-theme-light .npl-action-button.secondary,
#npl-workspace-root.npl-theme-light .npl-action-button.neutral,
#npl-workspace-root.npl-theme-light button:not(.npl-action-button) {
    border-color: var(--npl-border) !important;
}

.npl-ada-loader {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 6px 11px;
    color: #c4b5fd;
    background: rgba(124, 58, 237, 0.14);
    border: 1px solid rgba(139, 92, 246, 0.48);
    border-radius: 999px;
    box-shadow: 0 0 18px rgba(124, 58, 237, 0.24);
}

.npl-ada-loader-logo {
    width: 34px;
    height: auto;
    object-fit: contain;
    filter: grayscale(1) brightness(1.9) drop-shadow(0 0 8px rgba(139, 92, 246, 0.76));
    transform-origin: center;
    animation: npl-ada-vibrate 720ms infinite linear;
}

.npl-ada-loader-text {
    color: #c4b5fd;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

@keyframes npl-ada-vibrate {
    0%,
    100% {
        transform: translate3d(0, 0, 0) rotate(0deg) scale(1);
        opacity: 0.78;
    }

    15% {
        transform: translate3d(-1px, 0.5px, 0) rotate(-1deg) scale(1.015);
        opacity: 1;
    }

    30% {
        transform: translate3d(1px, -0.5px, 0) rotate(1deg) scale(1.03);
    }

    45% {
        transform: translate3d(-0.5px, 1px, 0) rotate(-0.6deg) scale(1.015);
    }

    60% {
        transform: translate3d(0.8px, 0, 0) rotate(0.8deg) scale(1.035);
        opacity: 0.95;
    }

    75% {
        transform: translate3d(-0.8px, -0.5px, 0) rotate(-0.8deg) scale(1.01);
    }
}

#npl-workspace-root.npl-theme-light .npl-ada-loader {
    color: #6d28d9;
    background: rgba(124, 58, 237, 0.11);
    border-color: rgba(109, 40, 217, 0.42);
    box-shadow: 0 0 16px rgba(109, 40, 217, 0.18);
}

#npl-workspace-root.npl-theme-light .npl-ada-loader-logo {
    filter: grayscale(1) brightness(0.7) drop-shadow(0 0 6px rgba(109, 40, 217, 0.45));
}

#npl-workspace-root.npl-theme-light .npl-ada-loader-text {
    color: #6d28d9;
}
