:root {
    --admin-bg: #f4f7fb;
    --admin-surface: #ffffff;
    --admin-surface-soft: #f8fafc;
    --admin-text: #172033;
    --admin-muted: #657187;
    --admin-border: #dfe6f0;
    --admin-radius: 8px;
    --admin-shadow: 0 16px 38px rgba(15, 23, 42, 0.08);
    --theme-primary-rgb: 0, 95, 162;
}

body[class*="theme-"],
body.burntSienna,
body.goldenHarvest,
body.limePunch,
body.freshBasil,
body.tropicalRain,
body.clearSky,
body.oceanDepth,
body.purpleMystery,
body.vividOrchid,
body.magentaFusion,
body.roseBloom,
body.spicyRed,
body.burgundyRed,
body.amethystTwilight,
body.orangeTreedawn,
body.sableSahara {
    --theme-primary: rgb(var(--theme-primary-rgb));
    --theme-primary-hover: color-mix(in srgb, var(--theme-primary) 86%, #000);
    --theme-primary-active: color-mix(in srgb, var(--theme-primary) 76%, #000);
    --theme-primary-soft: color-mix(in srgb, var(--theme-primary) 13%, #fff);
    --theme-primary-border: color-mix(in srgb, var(--theme-primary) 32%, #fff);
    --theme-sidebar: color-mix(in srgb, var(--theme-primary) 36%, #111827);
    --theme-sidebar-soft: color-mix(in srgb, var(--theme-primary) 52%, #111827);
    --theme-sidebar-text: #dbe7f4;
    --theme-sidebar-muted: #a8b7ca;
    --theme-ring-bg: color-mix(in srgb, var(--theme-primary) 14%, #e5edf7);
    --theme-focus-shadow: 0 0 0 0.25rem color-mix(in srgb, var(--theme-primary) 25%, transparent);
    --bs-primary: var(--theme-primary);
    --bs-primary-rgb: var(--theme-primary-rgb);
    --bs-link-color: var(--theme-primary);
    --bs-link-color-rgb: var(--theme-primary-rgb);
    --bs-link-hover-color: var(--theme-primary-hover);
    --admin-accent: var(--theme-primary);
    --admin-accent-soft: var(--theme-primary-soft);
    --admin-sidebar: var(--theme-sidebar);
    --admin-sidebar-soft: var(--theme-sidebar-soft);
}

html[data-bs-theme="dark"] {
    --admin-bg: #111213;
    --admin-surface: #181a1d;
    --admin-surface-soft: #202327;
    --admin-text: #f1f3f5;
    --admin-muted: #a4abb3;
    --admin-border: rgba(255, 255, 255, 0.12);
    --admin-shadow: 0 18px 42px rgba(0, 0, 0, 0.28);
    --theme-primary-soft: color-mix(in srgb, var(--theme-primary) 20%, #181a1d);
    --theme-primary-border: color-mix(in srgb, var(--theme-primary) 40%, #181a1d);
    --theme-sidebar: color-mix(in srgb, var(--theme-primary) 16%, #101112);
    --theme-sidebar-soft: color-mix(in srgb, var(--theme-primary) 28%, #151719);
    --theme-ring-bg: color-mix(in srgb, var(--theme-primary) 16%, #2a2d31);
    color-scheme: dark;
}

body.theme-burntSienna,
body.burntSienna {
    --theme-primary-rgb: 162, 54, 0;
}

.theme-burntSienna {
    --swatch-rgb: 162, 54, 0;
}

body.theme-goldenHarvest,
body.goldenHarvest {
    --theme-primary-rgb: 162, 148, 0;
}

.theme-goldenHarvest {
    --swatch-rgb: 162, 148, 0;
}

body.theme-limePunch,
body.limePunch {
    --theme-primary-rgb: 108, 162, 0;
}

.theme-limePunch {
    --swatch-rgb: 108, 162, 0;
}

body.theme-freshBasil,
body.freshBasil {
    --theme-primary-rgb: 41, 162, 0;
}

.theme-freshBasil {
    --swatch-rgb: 41, 162, 0;
}

body.theme-tropicalRain,
body.tropicalRain {
    --theme-primary-rgb: 0, 162, 95;
}

.theme-tropicalRain {
    --swatch-rgb: 0, 162, 95;
}

body.theme-clearSky,
body.clearSky {
    --theme-primary-rgb: 0, 162, 162;
}

.theme-clearSky {
    --swatch-rgb: 0, 162, 162;
}

body.theme-oceanDepth,
body.oceanDepth {
    --theme-primary-rgb: 0, 95, 162;
}

.theme-oceanDepth {
    --swatch-rgb: 0, 95, 162;
}

body.theme-purpleMystery,
body.purpleMystery {
    --theme-primary-rgb: 41, 0, 162;
}

.theme-purpleMystery {
    --swatch-rgb: 41, 0, 162;
}

body.theme-vividOrchid,
body.vividOrchid {
    --theme-primary-rgb: 108, 0, 162;
}

.theme-vividOrchid {
    --swatch-rgb: 108, 0, 162;
}

body.theme-magentaFusion,
body.magentaFusion {
    --theme-primary-rgb: 162, 0, 148;
}

.theme-magentaFusion {
    --swatch-rgb: 162, 0, 148;
}

body.theme-roseBloom,
body.roseBloom {
    --theme-primary-rgb: 162, 0, 81;
}

.theme-roseBloom {
    --swatch-rgb: 162, 0, 81;
}

body.theme-spicyRed,
body.spicyRed {
    --theme-primary-rgb: 162, 0, 14;
}

.theme-spicyRed {
    --swatch-rgb: 162, 0, 14;
}

body.theme-burgundyRed,
body.burgundyRed {
    --theme-primary-rgb: 128, 0, 32;
}

.theme-burgundyRed {
    --swatch-rgb: 128, 0, 32;
}

body.theme-amethystTwilight,
body.amethystTwilight {
    --theme-primary-rgb: 46, 69, 163;
}

.theme-amethystTwilight {
    --swatch-rgb: 46, 69, 163;
}

body.theme-orangeTreedawn,
body.orangeTreedawn {
    --theme-primary-rgb: 225, 165, 54;
}

.theme-orangeTreedawn {
    --swatch-rgb: 225, 165, 54;
}

body.theme-sableSahara,
body.sableSahara {
    --theme-primary-rgb: 105, 82, 32;
}

.theme-sableSahara {
    --swatch-rgb: 105, 82, 32;
}

.project-dot[class*="theme-"],
.project-theme-pill[class*="theme-"] {
    background-color: rgb(var(--swatch-rgb));
}

html[data-bs-theme="dark"] body[class*="theme-"],
html[data-bs-theme="dark"] body.burntSienna,
html[data-bs-theme="dark"] body.goldenHarvest,
html[data-bs-theme="dark"] body.limePunch,
html[data-bs-theme="dark"] body.freshBasil,
html[data-bs-theme="dark"] body.tropicalRain,
html[data-bs-theme="dark"] body.clearSky,
html[data-bs-theme="dark"] body.oceanDepth,
html[data-bs-theme="dark"] body.purpleMystery,
html[data-bs-theme="dark"] body.vividOrchid,
html[data-bs-theme="dark"] body.magentaFusion,
html[data-bs-theme="dark"] body.roseBloom,
html[data-bs-theme="dark"] body.spicyRed,
html[data-bs-theme="dark"] body.burgundyRed,
html[data-bs-theme="dark"] body.amethystTwilight,
html[data-bs-theme="dark"] body.orangeTreedawn,
html[data-bs-theme="dark"] body.sableSahara {
    --theme-primary-soft: color-mix(in srgb, var(--theme-primary) 20%, #181a1d);
    --theme-primary-border: color-mix(in srgb, var(--theme-primary) 40%, #181a1d);
    --theme-sidebar: color-mix(in srgb, var(--theme-primary) 16%, #101112);
    --theme-sidebar-soft: color-mix(in srgb, var(--theme-primary) 28%, #151719);
    --theme-ring-bg: color-mix(in srgb, var(--theme-primary) 16%, #2a2d31);
}

.btn-primary {
    --bs-btn-color: #fff;
    --bs-btn-bg: var(--theme-primary);
    --bs-btn-border-color: var(--theme-primary);
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: var(--theme-primary-hover);
    --bs-btn-hover-border-color: var(--theme-primary-hover);
    --bs-btn-focus-shadow-rgb: var(--theme-primary-rgb);
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: var(--theme-primary-active);
    --bs-btn-active-border-color: var(--theme-primary-active);
    --bs-btn-disabled-bg: var(--theme-primary);
    --bs-btn-disabled-border-color: var(--theme-primary);
}

.btn-outline-primary {
    --bs-btn-color: var(--theme-primary);
    --bs-btn-border-color: var(--theme-primary);
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: var(--theme-primary);
    --bs-btn-hover-border-color: var(--theme-primary);
    --bs-btn-focus-shadow-rgb: var(--theme-primary-rgb);
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: var(--theme-primary-active);
    --bs-btn-active-border-color: var(--theme-primary-active);
}

.text-bg-primary,
.badge.text-bg-primary {
    color: #fff !important;
    background-color: var(--theme-primary) !important;
}

.text-primary {
    color: var(--theme-primary) !important;
}

.bg-primary {
    background-color: var(--theme-primary) !important;
}

.border-primary {
    border-color: var(--theme-primary) !important;
}

.dropdown-item:active,
.dropdown-item.active {
    color: #fff;
    background-color: var(--theme-primary);
}

.form-control:focus,
.form-select:focus,
.form-check-input:focus,
.btn:focus-visible {
    border-color: var(--theme-primary-border);
    box-shadow: var(--theme-focus-shadow);
}

.form-check-input:checked {
    background-color: var(--theme-primary);
    border-color: var(--theme-primary);
}

.card,
.modal-content,
.dropdown-menu {
    --bs-card-bg: var(--admin-surface);
    --bs-card-border-color: var(--admin-border);
    --bs-dropdown-bg: var(--admin-surface);
    --bs-dropdown-border-color: var(--admin-border);
    --bs-dropdown-link-color: var(--admin-text);
    --bs-modal-bg: var(--admin-surface);
    color: var(--admin-text);
}
