/* ═══════════════════════════════════════════════════════════════════════════
   SD Engine — Metabase Professional Dark Theme
   Palette: #0D0D0D · #141414 · #1A1A1A · #2D2D2D · #E8E8E8 · Accent #00ADB5
   Created: 2026-04-30
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
    /* ── Backgrounds ── */
    --mb-color-background:                    #0D0D0D !important;
    --mb-color-background-primary:            #0D0D0D !important;
    --mb-color-background-primary-inverse:    #E8E8E8 !important;
    --mb-color-background-secondary:          #141414 !important;
    --mb-color-background-secondary-inverse:  #D0D0D0 !important;
    --mb-color-background-tertiary:           #1A1A1A !important;
    --mb-color-background-tertiary-inverse:   #B0B0B0 !important;
    --mb-color-background-hover:              #222222 !important;
    --mb-color-background-disabled:           #111111 !important;
    --mb-color-background-disabled-inverse:   #666666 !important;
    --mb-color-background-selected:           #1A2A2B !important;
    --mb-color-background-brand:              #00ADB5 !important;
    --mb-color-background-error:              #2D1111 !important;
    --mb-color-background-success:            #112D18 !important;
    --mb-color-background-warning:            #2D2511 !important;
    --mb-color-background-info:               #111A2D !important;
    --mb-color-background-highlight:          #1A1A1A !important;

    /* ── Dashboard ── */
    --mb-color-bg-dashboard:                  #0D0D0D !important;
    --mb-color-bg-dashboard-card:             #141414 !important;

    /* ── Text ── */
    --mb-color-text-primary:                  #E8E8E8 !important;
    --mb-color-text-primary-inverse:          #0D0D0D !important;
    --mb-color-text-secondary:                #999999 !important;
    --mb-color-text-secondary-inverse:        #333333 !important;
    --mb-color-text-tertiary:                 #666666 !important;
    --mb-color-text-tertiary-inverse:         #444444 !important;
    --mb-color-text-brand:                    #00ADB5 !important;
    --mb-color-text-hover:                    #FFFFFF !important;
    --mb-color-text-selected:                 #00CDD7 !important;
    --mb-color-white:                         #E8E8E8 !important;

    /* ── Brand ── */
    --mb-color-brand:                         #00ADB5 !important;
    --mb-color-brand-hover:                   #00CDD7 !important;
    --mb-color-metabase-brand:                #00ADB5 !important;
    --mb-color-metabase-brand-hover:          #00CDD7 !important;
    --mb-color-icon-brand:                    #00ADB5 !important;
    --mb-color-icon-secondary:                #666666 !important;
    --mb-color-accent:                        #00ADB5 !important;
    --mb-color-focus:                         #00ADB5 !important;
    --mb-color-filter:                        #00ADB5 !important;
    --mb-color-summarize:                     #B0B0B0 !important;

    /* ── Borders ── */
    --mb-color-border:                        #2D2D2D !important;
    --mb-color-border-brand:                  #00ADB5 !important;
    --mb-color-border-filter:                 #00ADB5 !important;
    --mb-color-border-stronger:               #3D3D3D !important;
    --mb-color-border-subtle:                 #1A1A1A !important;

    /* ── Status ── */
    --mb-color-success:                       #4ADE80 !important;
    --mb-color-success-secondary:             #112D18 !important;
    --mb-color-warning:                       #FBBF24 !important;
    --mb-color-error:                         #EF4444 !important;
    --mb-color-danger:                        #EF4444 !important;

    /* ── Overlays / shadows ── */
    --mb-color-shadow:                        rgba(0, 0, 0, 0.6) !important;
    --mb-color-overlay:                       rgba(0, 0, 0, 0.85) !important;

    /* ── Tooltips ── */
    --mb-color-tooltip-background:            #1A1A1A !important;
    --mb-color-tooltip-background-focused:    #222222 !important;
    --mb-color-tooltip-text:                  #E8E8E8 !important;
    --mb-color-tooltip-text-secondary:        #999999 !important;

    /* ── Navbar ── */
    --mb-color-admin-navbar:                  #0A0A0A !important;
    --mb-color-admin-navbar-inverse:          #E8E8E8 !important;

    /* ── Switch ── */
    --mb-color-switch-off:                    #2D2D2D !important;

    /* ── Notebook ── */
    --mb-color-notebook-step-bg:              #141414 !important;
    --mb-color-notebook-step-bg-hover:        #1A1A1A !important;

    /* ── Syntax highlighting ── */
    --mb-color-syntax-parameters:             #00ADB5 !important;
    --mb-color-syntax-parameters-active:      #00CDD7 !important;

    /* ── Saturated palette (charts) ── */
    --mb-color-saturated-blue:                #00ADB5 !important;
    --mb-color-saturated-green:               #4ADE80 !important;
    --mb-color-saturated-purple:              #A78BFA !important;
    --mb-color-saturated-red:                 #EF4444 !important;
    --mb-color-saturated-yellow:              #FBBF24 !important;

    /* ── Upsell / illustration ── */
    --mb-color-upsell-gem:                    #00ADB5 !important;
    --mb-color-upsell-pattern:                #1A1A1A !important;
    --mb-color-upsell-pattern-light:          #222222 !important;
    --mb-color-upsell-primary:                #00ADB5 !important;
    --mb-color-upsell-secondary:              #141414 !important;
    --mb-color-illustration-brand-secondary:  #00ADB5 !important;
    --mb-color-illustration-brand-tertiary:   #141414 !important;

    /* ── Dotted background ── */
    --mb-dotted-bg-background:                #0D0D0D !important;
    --mb-dotted-bg-color:                     #1A1A1A !important;

    /* ── Fonts ── */
    --mb-default-font-family:                 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
    --mb-default-monospace-font-family:       "JetBrains Mono", "Fira Code", monospace !important;
}

/* ── Force root backgrounds ── */
html, body, #root {
    background-color: #0D0D0D !important;
    color: #E8E8E8 !important;
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #0D0D0D; }
::-webkit-scrollbar-thumb { background: #2D2D2D; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #3D3D3D; }
* { scrollbar-width: thin; scrollbar-color: #2D2D2D #0D0D0D; }

/* ── Kill white backgrounds via inline styles ── */
[style*="background: rgb(255"],
[style*="background-color: rgb(255"],
[style*="background:#fff"],
[style*="background: #fff"],
[style*="background-color: #fff"],
[style*="background: white"],
[style*="background-color: white"],
[style*="background:#FFF"],
[style*="background: #FFF"],
[style*="background-color:#ffffff"],
[style*="background-color: #ffffff"],
[style*="background-color: rgb(255, 255, 255)"] {
    background-color: #0D0D0D !important;
}

[style*="background: rgb(248"],
[style*="background-color: rgb(248"],
[style*="background: rgb(241"],
[style*="background-color: rgb(241"],
[style*="background: rgb(250"],
[style*="background-color: rgb(250"],
[style*="background-color: rgb(245"],
[style*="background-color: rgb(252"],
[style*="background: rgb(252"],
[style*="background-color: rgb(246"],
[style*="background: rgb(246"],
[style*="background-color: rgb(249"],
[style*="background: rgb(249"] {
    background-color: #141414 !important;
}

/* ── Kill white/light text colors that become invisible ── */
[style*="color: rgb(255, 255, 255)"] {
    color: #E8E8E8 !important;
}

/* ── Fix dark text on dark backgrounds ── */
[style*="color: rgb(0, 0, 0)"],
[style*="color: rgb(51, 51, 51)"],
[style*="color: rgb(55, 55, 55)"],
[style*="color: rgb(75, 75, 75)"],
[style*="color:#333"],
[style*="color: #333"],
[style*="color:black"],
[style*="color: black"] {
    color: #E8E8E8 !important;
}

/* ── Theme color meta ── */
meta[name="theme-color"] {
    content: "#0D0D0D" !important;
}
