/**
 * CheckPoint SS-Theme — light corporate shell (burgundy + teal).
 * Active when html[data-theme="ss-theme"] or body.cp-theme-ss-theme.
 * Matches Pipeline frontend/static/css/theme-ss.css (Slingshot).
 * Must beat theme-futuristic.css !important red remaps.
 * SME [2026-07-23] Kill faded pink (#fecaca/#ff4d5a) on Integrations + Live Map
 * SME [2026-07-22] Nav tabs + dropdowns: light pills, readable menus (fix dark-on-dark)
 * SME [2026-07-21] Pipeline-aligned SS-Theme (burgundy #6B1E2E + teal #2A9B8F)
 */

html[data-theme="ss-theme"] body,
body.cp-theme-ss-theme,
body.cp-body.cp-theme-ss-theme {
    background: var(--ss-page-bg, linear-gradient(180deg, #ffffff 0%, #F7F7F7 100%)) !important;
    color: #1A1A1A !important;
    font-family: "Outfit", "Inter", "Segoe UI", system-ui, sans-serif !important;
}

body.cp-body--auth.cp-theme-ss-theme,
html[data-theme="ss-theme"] body.cp-body--auth {
    background: var(--cp-auth-bg) !important;
}

body.cp-theme-ss-theme::before {
    opacity: 0.35 !important;
    background-image:
        linear-gradient(rgba(107, 30, 46, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(107, 30, 46, 0.04) 1px, transparent 1px) !important;
    background-size: 48px 48px !important;
}

/* Header — white bar + burgundy underline like Pipeline SS */
body.cp-theme-ss-theme .checkpoint-header {
    background: #ffffff !important;
    border-bottom: 3px solid var(--ss-burgundy, #6B1E2E) !important;
    box-shadow: 0 8px 24px rgba(26, 26, 26, 0.06) !important;
    backdrop-filter: none !important;
    color: #1A1A1A !important;
}

body.cp-theme-ss-theme .checkpoint-header::after {
    height: 0 !important;
    opacity: 0 !important;
}

body.cp-theme-ss-theme .logo-check {
    color: var(--ss-burgundy-dark, #4E1522) !important;
}

body.cp-theme-ss-theme .logo-point {
    color: var(--ss-burgundy, #6B1E2E) !important;
}

body.cp-theme-ss-theme .checkpoint-tagline {
    color: #555555 !important;
}

/* Nav tabs — Pipeline SS light pills (not dark futuristic chips) */
body.cp-theme-ss-theme .checkpoint-nav-link:not(.checkpoint-nav-link--seamless),
body.cp-theme-ss-theme .checkpoint-nav-dropdown-toggle,
body.cp-theme-ss-theme button.checkpoint-nav-link,
body.cp-theme-ss-theme .nav-link,
body.cp-theme-ss-theme .dropdown-toggle {
    color: #1A1A1A !important;
    -webkit-text-fill-color: #1A1A1A !important;
    background: #F7F7F7 !important;
    border: 1px solid rgba(107, 30, 46, 0.12) !important;
    border-radius: 999px !important;
    box-shadow: none !important;
}

body.cp-theme-ss-theme .checkpoint-nav-link:not(.checkpoint-nav-link--seamless):hover,
body.cp-theme-ss-theme .checkpoint-nav-dropdown:hover > .checkpoint-nav-dropdown-toggle,
body.cp-theme-ss-theme .checkpoint-nav-dropdown.is-open > .checkpoint-nav-dropdown-toggle,
body.cp-theme-ss-theme .checkpoint-nav-dropdown:focus-within > .checkpoint-nav-dropdown-toggle {
    background: var(--ss-burgundy-soft, #F5E8EB) !important;
    border-color: rgba(107, 30, 46, 0.28) !important;
    color: #1A1A1A !important;
    -webkit-text-fill-color: #1A1A1A !important;
    box-shadow: none !important;
}

body.cp-theme-ss-theme .checkpoint-nav-link:not(.checkpoint-nav-link--seamless).is-active,
body.cp-theme-ss-theme .checkpoint-nav-dropdown-toggle.is-active,
body.cp-theme-ss-theme .nav-link.active,
body.cp-theme-ss-theme a.nav-link.active {
    background: var(--ss-burgundy, #6B1E2E) !important;
    border-color: var(--ss-burgundy, #6B1E2E) !important;
    color: #fff !important;
    -webkit-text-fill-color: #fff !important;
    box-shadow: 0 4px 14px rgba(107, 30, 46, 0.22) !important;
}

/* Pipeline ↗ — soft burgundy/teal chip on light header */
body.cp-theme-ss-theme .checkpoint-nav-link--seamless,
html[data-theme="ss-theme"] .checkpoint-nav-link--seamless {
    border: 1px solid rgba(107, 30, 46, 0.22) !important;
    background: var(--ss-burgundy-soft, #F5E8EB) !important;
    color: var(--ss-burgundy, #6B1E2E) !important;
    -webkit-text-fill-color: var(--ss-burgundy, #6B1E2E) !important;
    box-shadow: none !important;
}

body.cp-theme-ss-theme .checkpoint-nav-link--seamless:hover,
body.cp-theme-ss-theme .checkpoint-nav-link--seamless:focus-visible,
html[data-theme="ss-theme"] .checkpoint-nav-link--seamless:hover,
html[data-theme="ss-theme"] .checkpoint-nav-link--seamless:focus-visible {
    background: var(--ss-burgundy, #6B1E2E) !important;
    border-color: var(--ss-burgundy, #6B1E2E) !important;
    color: #fff !important;
    -webkit-text-fill-color: #fff !important;
    box-shadow: 0 4px 14px rgba(107, 30, 46, 0.28) !important;
}

body.cp-theme-ss-theme .checkpoint-nav-connected-badge,
html[data-theme="ss-theme"] .checkpoint-nav-connected-badge {
    background: rgba(42, 155, 143, 0.16) !important;
    color: var(--ss-teal-dark, #1F7A70) !important;
}

body.cp-theme-ss-theme .checkpoint-nav-link--seamless:hover .checkpoint-nav-connected-badge,
html[data-theme="ss-theme"] .checkpoint-nav-link--seamless:hover .checkpoint-nav-connected-badge {
    background: rgba(255, 255, 255, 0.22) !important;
    color: #fff !important;
}

/* Dropdown menus — white panel, dark ink (never burgundy-on-black) */
body.cp-theme-ss-theme .checkpoint-nav-dropdown-menu,
html[data-theme="ss-theme"] .checkpoint-nav-dropdown-menu {
    background: #ffffff !important;
    border: 1px solid rgba(107, 30, 46, 0.16) !important;
    box-shadow: 0 16px 40px rgba(26, 26, 26, 0.12) !important;
    backdrop-filter: none !important;
}

body.cp-theme-ss-theme .checkpoint-nav-dropdown-item,
body.cp-theme-ss-theme .checkpoint-nav-dropdown-menu a,
body.cp-theme-ss-theme .checkpoint-nav-dropdown-menu button,
html[data-theme="ss-theme"] .checkpoint-nav-dropdown-item,
html[data-theme="ss-theme"] .checkpoint-nav-dropdown-menu a,
html[data-theme="ss-theme"] .checkpoint-nav-dropdown-menu button {
    color: #1A1A1A !important;
    -webkit-text-fill-color: #1A1A1A !important;
    background: transparent !important;
}

body.cp-theme-ss-theme .checkpoint-nav-dropdown-item:hover,
body.cp-theme-ss-theme .checkpoint-nav-dropdown-item.is-active,
body.cp-theme-ss-theme .checkpoint-nav-dropdown-menu a:hover,
body.cp-theme-ss-theme .checkpoint-nav-dropdown-menu button:hover,
html[data-theme="ss-theme"] .checkpoint-nav-dropdown-item:hover,
html[data-theme="ss-theme"] .checkpoint-nav-dropdown-item.is-active {
    background: var(--ss-burgundy-soft, #F5E8EB) !important;
    color: var(--ss-burgundy, #6B1E2E) !important;
    -webkit-text-fill-color: var(--ss-burgundy, #6B1E2E) !important;
}

body.cp-theme-ss-theme .cp-btn-primary,
body.cp-theme-ss-theme .btn-login,
body.cp-theme-ss-theme .btn-success,
body.cp-theme-ss-theme .btn-primary,
html[data-theme="ss-theme"] .btn-primary,
html[data-theme="ss-theme"] button[type="submit"]:not(.btn-dev):not(.checkpoint-logout-btn) {
    background: var(--ss-burgundy, #6B1E2E) !important;
    color: #fff !important;
    box-shadow: 0 4px 14px rgba(107, 30, 46, 0.28) !important;
    border-color: var(--ss-burgundy, #6B1E2E) !important;
}

body.cp-theme-ss-theme .login-card,
body.cp-theme-ss-theme .panel,
body.cp-theme-ss-theme .settings-card,
body.cp-theme-ss-theme .gate,
body.cp-theme-ss-theme .card,
body.cp-theme-ss-theme .hero,
html[data-theme="ss-theme"] .card,
html[data-theme="ss-theme"] .panel,
html[data-theme="ss-theme"] .hero {
    position: relative;
    background: #ffffff !important;
    border-color: rgba(107, 30, 46, 0.12) !important;
    color: #1A1A1A !important;
    box-shadow: 0 8px 28px rgba(26, 26, 26, 0.06) !important;
}

body.cp-theme-ss-theme .login-card::before,
body.cp-theme-ss-theme .panel::before,
body.cp-theme-ss-theme .settings-card::before,
body.cp-theme-ss-theme .card::before,
html[data-theme="ss-theme"] .card::before,
html[data-theme="ss-theme"] .panel::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--ss-burgundy, #6B1E2E) 0%, var(--ss-teal, #2A9B8F) 100%);
    pointer-events: none;
    z-index: 1;
    border-radius: inherit;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

body.cp-theme-ss-theme .form-control,
body.cp-theme-ss-theme input,
body.cp-theme-ss-theme select,
body.cp-theme-ss-theme textarea,
html[data-theme="ss-theme"] .form-control,
html[data-theme="ss-theme"] .form-select {
    background: #ffffff !important;
    border-color: rgba(107, 30, 46, 0.18) !important;
    color: #1A1A1A !important;
}

body.cp-theme-ss-theme .form-control:focus,
body.cp-theme-ss-theme input:focus,
body.cp-theme-ss-theme select:focus,
body.cp-theme-ss-theme textarea:focus,
html[data-theme="ss-theme"] input:focus,
html[data-theme="ss-theme"] .form-control:focus {
    border-color: rgba(42, 155, 143, 0.45) !important;
    box-shadow: 0 0 0 3px rgba(42, 155, 143, 0.18) !important;
}

html[data-theme="ss-theme"] .kicker,
html[data-theme="ss-theme"] .hero-kicker,
html[data-theme="ss-theme"] .panel-kicker,
html[data-theme="ss-theme"] th,
html[data-theme="ss-theme"] .form-label,
body.cp-theme-ss-theme .kicker,
body.cp-theme-ss-theme .loads-kicker,
body.cp-theme-ss-theme .map-theme-title,
body.cp-theme-ss-theme .dot-legend-title,
body.cp-theme-ss-theme .history-title,
body.cp-theme-ss-theme .detail-section h4 {
    color: var(--ss-burgundy, #6B1E2E) !important;
}

/* Do not recolor header dropdown links — those use light menu rules above */
html[data-theme="ss-theme"] a:not(.checkpoint-nav-link):not(.checkpoint-nav-dropdown-item):not(.btn):not(.logo-point),
body.cp-theme-ss-theme main a:not(.btn):not(.checkpoint-nav-dropdown-item) {
    color: var(--ss-burgundy-dark, #4E1522) !important;
}

/* Live Map chrome — light panels over basemap */
body.cp-theme-ss-theme,
html[data-theme="ss-theme"] body {
    --cp-accent: #6B1E2E;
    --cp-accent-dark: #4E1522;
    --cp-accent-hover: #8B2A3D;
    --cp-accent-glow: rgba(107, 30, 46, 0.35);
}

body.cp-theme-ss-theme .sidebar,
body.cp-theme-ss-theme .sidebar.loads-panel,
body.cp-theme-ss-theme .legend,
body.cp-theme-ss-theme .load-detail-drawer {
    background: linear-gradient(160deg, rgba(255, 255, 255, 0.98), rgba(247, 247, 247, 0.96)) !important;
    border-color: rgba(107, 30, 46, 0.16) !important;
    color: #1A1A1A !important;
    box-shadow: 0 18px 48px rgba(26, 26, 26, 0.12), 0 0 24px rgba(107, 30, 46, 0.08) !important;
}

body.cp-theme-ss-theme .loads-command-header {
    background: linear-gradient(135deg, rgba(107, 30, 46, 0.12), rgba(255, 255, 255, 0.95)) !important;
    border-color: rgba(107, 30, 46, 0.22) !important;
}

body.cp-theme-ss-theme .loads-command-header h3,
body.cp-theme-ss-theme .load-empty,
body.cp-theme-ss-theme .legend-item,
body.cp-theme-ss-theme .card-load {
    color: #1A1A1A !important;
}

body.cp-theme-ss-theme .loads-orb {
    background: var(--ss-teal, #2A9B8F) !important;
    box-shadow: 0 0 0 3px rgba(42, 155, 143, 0.22), 0 0 18px rgba(42, 155, 143, 0.55) !important;
}

body.cp-theme-ss-theme .loads-help-link,
body.cp-theme-ss-theme .sidebar .status-tab.active,
body.cp-theme-ss-theme button.status-tab.active,
body.cp-theme-ss-theme .status-tab.active,
body.cp-theme-ss-theme .map-theme-btn.active,
body.cp-theme-ss-theme .provider-refresh-btn,
body.cp-theme-ss-theme .map-layer-toggle {
    background: var(--ss-burgundy, #6B1E2E) !important;
    border-color: transparent !important;
    color: #fff !important;
    box-shadow: 0 4px 14px rgba(107, 30, 46, 0.28) !important;
}

body.cp-theme-ss-theme .sidebar .status-tabs {
    background: rgba(255, 255, 255, 0.85) !important;
    border-color: rgba(107, 30, 46, 0.14) !important;
}

body.cp-theme-ss-theme .sidebar .status-tab,
body.cp-theme-ss-theme .sidebar button.status-tab {
    color: #555555 !important;
    background: transparent !important;
}

body.cp-theme-ss-theme .sidebar .clear-trail-btn,
body.cp-theme-ss-theme .sidebar button.clear-trail-btn {
    border-color: rgba(42, 155, 143, 0.45) !important;
    background: linear-gradient(135deg, rgba(42, 155, 143, 0.12), rgba(255, 255, 255, 0.9)) !important;
    color: var(--ss-teal-dark, #1F7A70) !important;
    box-shadow: 0 0 18px rgba(42, 155, 143, 0.12) !important;
}

body.cp-theme-ss-theme .sidebar .load-empty {
    border-color: rgba(107, 30, 46, 0.18) !important;
    background: linear-gradient(160deg, rgba(107, 30, 46, 0.06), rgba(255, 255, 255, 0.85)) !important;
    color: #555555 !important;
}

/* Developer docs under SS-Theme */
body.cp-theme-ss-theme.cp-docs .docs-topbar,
body.cp-theme-ss-theme.cp-docs .topbar {
    background: #ffffff !important;
    border-bottom: 3px solid var(--ss-burgundy, #6B1E2E) !important;
}

body.cp-theme-ss-theme.cp-docs .hero-card,
body.cp-theme-ss-theme.cp-docs .panel,
body.cp-theme-ss-theme.cp-docs .endpoint-card,
body.cp-theme-ss-theme.cp-docs .sidebar-block,
body.cp-theme-ss-theme.cp-docs .page-toc {
    background: #ffffff !important;
    border-color: rgba(107, 30, 46, 0.12) !important;
    color: #1A1A1A !important;
    box-shadow: 0 8px 28px rgba(26, 26, 26, 0.06) !important;
}

body.cp-theme-ss-theme.cp-docs .method,
body.cp-theme-ss-theme.cp-docs .http-post,
body.cp-theme-ss-theme.cp-docs .http-get {
    background: rgba(42, 155, 143, 0.12) !important;
    color: var(--ss-teal-dark, #1F7A70) !important;
    border-color: rgba(42, 155, 143, 0.35) !important;
}

body.cp-theme-ss-theme.cp-docs .url,
body.cp-theme-ss-theme.cp-docs .endpoint-path,
body.cp-theme-ss-theme.cp-docs pre,
body.cp-theme-ss-theme.cp-docs .code-block {
    background: #F7F7F7 !important;
    border-color: rgba(107, 30, 46, 0.14) !important;
    color: var(--ss-burgundy-dark, #4E1522) !important;
}

body.cp-theme-ss-theme .table,
html[data-theme="ss-theme"] .table {
    --bs-table-bg: #ffffff;
    --bs-table-color: #1A1A1A;
    --bs-table-border-color: #EEEEEE;
    --bs-table-striped-bg: rgba(107, 30, 46, 0.04);
    --bs-table-hover-bg: rgba(42, 155, 143, 0.08);
    color: #1A1A1A !important;
    background-color: #ffffff !important;
}

body.cp-theme-ss-theme .table th,
html[data-theme="ss-theme"] .table th {
    color: var(--ss-burgundy, #6B1E2E) !important;
    background: #F7F7F7 !important;
}

/* Settings / Integrations pages — solid ink, not washed pink labels */
body.cp-theme-ss-theme .shell,
html[data-theme="ss-theme"] .shell {
    color: #1A1A1A !important;
}

body.cp-theme-ss-theme .shell h1,
body.cp-theme-ss-theme .shell h2,
body.cp-theme-ss-theme .shell h3,
body.cp-theme-ss-theme .shell strong,
html[data-theme="ss-theme"] .shell h1,
html[data-theme="ss-theme"] .shell h2,
html[data-theme="ss-theme"] .shell h3 {
    color: #1A1A1A !important;
    font-family: "Outfit", "Inter", "Segoe UI", system-ui, sans-serif !important;
}

body.cp-theme-ss-theme .shell p,
body.cp-theme-ss-theme .shell .muted,
body.cp-theme-ss-theme .shell .subhint,
html[data-theme="ss-theme"] .shell p,
html[data-theme="ss-theme"] .shell .muted,
html[data-theme="ss-theme"] .shell .subhint {
    color: #555555 !important;
}

body.cp-theme-ss-theme .field label,
body.cp-theme-ss-theme .metric span,
body.cp-theme-ss-theme .map-table th,
body.cp-theme-ss-theme .tenant-table th,
body.cp-theme-ss-theme .hero-kicker,
body.cp-theme-ss-theme .kicker,
html[data-theme="ss-theme"] .field label,
html[data-theme="ss-theme"] .metric span,
html[data-theme="ss-theme"] .map-table th,
html[data-theme="ss-theme"] .tenant-table th {
    color: var(--ss-burgundy, #6B1E2E) !important;
}

body.cp-theme-ss-theme .hint,
body.cp-theme-ss-theme .support-note,
html[data-theme="ss-theme"] .hint,
html[data-theme="ss-theme"] .support-note {
    color: #555555 !important;
    border-color: rgba(42, 155, 143, 0.28) !important;
    background: rgba(42, 155, 143, 0.08) !important;
}

body.cp-theme-ss-theme .shell .btn,
html[data-theme="ss-theme"] .shell .btn {
    background: var(--ss-burgundy, #6B1E2E) !important;
    border-color: var(--ss-burgundy, #6B1E2E) !important;
    color: #fff !important;
    box-shadow: 0 4px 14px rgba(107, 30, 46, 0.22) !important;
}

body.cp-theme-ss-theme .shell .btn.secondary,
html[data-theme="ss-theme"] .shell .btn.secondary {
    background: #ffffff !important;
    border-color: rgba(107, 30, 46, 0.28) !important;
    color: var(--ss-burgundy, #6B1E2E) !important;
    box-shadow: none !important;
}

body.cp-theme-ss-theme .shell .btn.danger,
html[data-theme="ss-theme"] .shell .btn.danger {
    background: var(--ss-burgundy-dark, #4E1522) !important;
    border-color: var(--ss-burgundy-dark, #4E1522) !important;
    color: #fff !important;
}

body.cp-theme-ss-theme .provider-tab,
body.cp-theme-ss-theme .provider-status-chip,
body.cp-theme-ss-theme .pill,
body.cp-theme-ss-theme .connection-pill,
body.cp-theme-ss-theme .metric,
body.cp-theme-ss-theme .info-panel,
body.cp-theme-ss-theme .refresh-option,
body.cp-theme-ss-theme .setup-step,
body.cp-theme-ss-theme .polling-toggle-label,
html[data-theme="ss-theme"] .provider-tab,
html[data-theme="ss-theme"] .provider-status-chip,
html[data-theme="ss-theme"] .pill,
html[data-theme="ss-theme"] .connection-pill,
html[data-theme="ss-theme"] .metric {
    background: #F7F7F7 !important;
    border-color: rgba(107, 30, 46, 0.14) !important;
    color: #1A1A1A !important;
}

body.cp-theme-ss-theme .provider-tab.active,
html[data-theme="ss-theme"] .provider-tab.active {
    background: var(--ss-burgundy, #6B1E2E) !important;
    border-color: var(--ss-burgundy, #6B1E2E) !important;
    color: #fff !important;
}

body.cp-theme-ss-theme .pill.good,
body.cp-theme-ss-theme .connection-pill.connected,
body.cp-theme-ss-theme .provider-status-chip.connected,
body.cp-theme-ss-theme .provider-tab .tab-status.connected,
html[data-theme="ss-theme"] .pill.good {
    color: var(--ss-teal-dark, #1F7A70) !important;
    border-color: rgba(42, 155, 143, 0.4) !important;
    background: rgba(42, 155, 143, 0.12) !important;
}

body.cp-theme-ss-theme .pill.warn,
body.cp-theme-ss-theme .connection-pill.warning,
html[data-theme="ss-theme"] .pill.warn {
    color: #8A5A12 !important;
    border-color: rgba(166, 106, 23, 0.35) !important;
    background: rgba(166, 106, 23, 0.10) !important;
}

body.cp-theme-ss-theme .shell input,
body.cp-theme-ss-theme .shell select,
body.cp-theme-ss-theme .shell textarea,
html[data-theme="ss-theme"] .shell input,
html[data-theme="ss-theme"] .shell select,
html[data-theme="ss-theme"] .shell textarea {
    background: #ffffff !important;
    border-color: rgba(107, 30, 46, 0.18) !important;
    color: #1A1A1A !important;
}

body.cp-theme-ss-theme .map-table td,
body.cp-theme-ss-theme .tenant-table td,
html[data-theme="ss-theme"] .map-table td,
html[data-theme="ss-theme"] .tenant-table td {
    color: #1A1A1A !important;
}

/* Live Map — replace faded pink helper chrome with Slingshot contrast */
body.cp-theme-ss-theme .provider-refresh-control,
body.cp-theme-ss-theme .provider-focus-control {
    border-color: rgba(107, 30, 46, 0.22) !important;
    background: rgba(107, 30, 46, 0.06) !important;
    box-shadow: none !important;
}

body.cp-theme-ss-theme .provider-refresh-btn,
body.cp-theme-ss-theme .provider-focus-btn {
    background: var(--ss-burgundy, #6B1E2E) !important;
    border-color: var(--ss-burgundy, #6B1E2E) !important;
    color: #fff !important;
    box-shadow: 0 4px 14px rgba(107, 30, 46, 0.22) !important;
}

body.cp-theme-ss-theme .provider-layer-notice {
    border-color: rgba(42, 155, 143, 0.35) !important;
    background: rgba(42, 155, 143, 0.10) !important;
    color: var(--ss-teal-dark, #1F7A70) !important;
}

body.cp-theme-ss-theme .legend-help,
body.cp-theme-ss-theme .legend p,
body.cp-theme-ss-theme .card-trail-btn {
    color: #555555 !important;
}

body.cp-theme-ss-theme .card-trail-btn {
    background: rgba(42, 155, 143, 0.10) !important;
    border-color: rgba(42, 155, 143, 0.35) !important;
    color: var(--ss-teal-dark, #1F7A70) !important;
}
