/* Presets compartilhados dos painéis Celebrax.
   Os temas alteram somente a interface administrativa; a identidade do site público do evento permanece independente. */

.admin-theme-picker {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin: 8px 0 12px;
}

.admin-theme-option,
.provider-theme-option {
    border: 1px solid var(--admin-border, var(--provider-border));
    color: var(--admin-text, var(--provider-text));
    background: var(--admin-card, var(--provider-card));
    cursor: pointer;
}

.admin-theme-option {
    display: grid;
    grid-template-columns: 25px 1fr;
    gap: 8px;
    align-items: center;
    min-height: 44px;
    padding: 7px 9px;
    border-radius: 11px;
    font-size: .68rem;
    font-weight: 750;
    text-align: left;
}

.admin-theme-option[aria-checked="true"] {
    border-color: var(--admin-primary);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--admin-primary) 18%, transparent);
}

.panel-theme-swatch {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 25px;
    height: 25px;
    overflow: hidden;
    border: 1px solid rgba(15, 23, 42, .14);
    border-radius: 50%;
}

.panel-theme-swatch i {
    display: block;
}

.panel-theme-swatch[data-theme-swatch="light"] i:first-child { background: #f4f7fb; }
.panel-theme-swatch[data-theme-swatch="light"] i:last-child { background: #0b1730; }
.panel-theme-swatch[data-theme-swatch="dark"] i:first-child { background: #0b1120; }
.panel-theme-swatch[data-theme-swatch="dark"] i:last-child { background: #60a5fa; }
.panel-theme-swatch[data-theme-swatch="ocean"] i:first-child { background: #e8f2fb; }
.panel-theme-swatch[data-theme-swatch="ocean"] i:last-child { background: #0f6ea8; }
.panel-theme-swatch[data-theme-swatch="lavender"] i:first-child { background: #f5effa; }
.panel-theme-swatch[data-theme-swatch="lavender"] i:last-child { background: #76549b; }
.panel-theme-swatch[data-theme-swatch="sage"] i:first-child { background: #eef4ed; }
.panel-theme-swatch[data-theme-swatch="sage"] i:last-child { background: #3d7a62; }
.panel-theme-swatch[data-theme-swatch="midnight"] i:first-child { background: #050b18; }
.panel-theme-swatch[data-theme-swatch="midnight"] i:last-child { background: #5ca8ff; }
.panel-theme-swatch[data-theme-swatch="graphite"] i:first-child { background: #111315; }
.panel-theme-swatch[data-theme-swatch="graphite"] i:last-child { background: #a7c7fa; }
.panel-theme-swatch[data-theme-swatch="forest"] i:first-child { background: #07140f; }
.panel-theme-swatch[data-theme-swatch="forest"] i:last-child { background: #62c9a2; }

.admin-theme-caption {
    display: block;
    margin: 2px 0 8px;
    color: var(--admin-muted);
    font-size: .64rem;
    line-height: 1.45;
}

/* Painel do Evento: Oceano */
body.admin-theme-ocean {
    --admin-bg: #eaf3f8;
    --admin-bg-soft: #dcecf4;
    --admin-sidebar: #123a63;
    --admin-sidebar-soft: #174f78;
    --admin-primary: #0f6ea8;
    --admin-coral: #e2675a;
    --admin-orange: #d68a3d;
    --admin-mint: #269c89;
    --admin-gold: #d6a83b;
    --admin-text: #15324c;
    --admin-muted: #566d80;
    --admin-border: #c8dce7;
    --admin-card: #fbfdfe;
    --admin-card-shadow: 0 14px 34px rgba(18, 58, 99, .09);
    --admin-active-bg: linear-gradient(135deg, rgba(15, 110, 168, .18), rgba(38, 156, 137, .10));
    --admin-active-border: rgba(15, 110, 168, .32);
    background: radial-gradient(circle at top right, rgba(15, 110, 168, .13), transparent 30%), linear-gradient(180deg, #f6fbfd, var(--admin-bg)) !important;
}

/* Painel do Evento: Lavanda */
body.admin-theme-lavender {
    --admin-bg: #f3eef7;
    --admin-bg-soft: #ebe2f2;
    --admin-sidebar: #3f315c;
    --admin-sidebar-soft: #594274;
    --admin-primary: #76549b;
    --admin-coral: #c85b79;
    --admin-orange: #c27a53;
    --admin-mint: #4f8d7a;
    --admin-gold: #c59b48;
    --admin-text: #352b49;
    --admin-muted: #6e627f;
    --admin-border: #ddd0e6;
    --admin-card: #fffafd;
    --admin-card-shadow: 0 14px 34px rgba(63, 49, 92, .10);
    --admin-active-bg: linear-gradient(135deg, rgba(118, 84, 155, .20), rgba(200, 91, 121, .10));
    --admin-active-border: rgba(154, 112, 181, .35);
    background: radial-gradient(circle at top right, rgba(118, 84, 155, .14), transparent 30%), linear-gradient(180deg, #fcf9fe, var(--admin-bg)) !important;
}

/* Painel do Evento: Sálvia */
body.admin-theme-sage {
    --admin-bg: #edf3ed;
    --admin-bg-soft: #e1ece2;
    --admin-sidebar: #29483b;
    --admin-sidebar-soft: #365f4e;
    --admin-primary: #3d7a62;
    --admin-coral: #c86c62;
    --admin-orange: #c67a45;
    --admin-mint: #4d9275;
    --admin-gold: #bd9947;
    --admin-text: #263b32;
    --admin-muted: #5c7065;
    --admin-border: #cadacd;
    --admin-card: #fbfdf9;
    --admin-card-shadow: 0 14px 34px rgba(41, 72, 59, .09);
    --admin-active-bg: linear-gradient(135deg, rgba(61, 122, 98, .20), rgba(198, 122, 69, .10));
    --admin-active-border: rgba(77, 146, 117, .34);
    background: radial-gradient(circle at top right, rgba(61, 122, 98, .13), transparent 30%), linear-gradient(180deg, #f8fbf7, var(--admin-bg)) !important;
}

body.admin-theme-ocean .sidebar {
    background: radial-gradient(circle at 15% 0%, rgba(67, 170, 211, .22), transparent 31%), linear-gradient(180deg, #123a63, #0c2a49) !important;
}

body.admin-theme-lavender .sidebar {
    background: radial-gradient(circle at 15% 0%, rgba(200, 91, 121, .20), transparent 31%), linear-gradient(180deg, #3f315c, #2d2442) !important;
}

body.admin-theme-sage .sidebar {
    background: radial-gradient(circle at 15% 0%, rgba(198, 122, 69, .18), transparent 31%), linear-gradient(180deg, #29483b, #1f382e) !important;
}

body.admin-theme-ocean .admin-header-eyebrow,
body.admin-theme-lavender .admin-header-eyebrow,
body.admin-theme-sage .admin-header-eyebrow,
body.admin-theme-ocean .admin-dashboard-kicker,
body.admin-theme-lavender .admin-dashboard-kicker,
body.admin-theme-sage .admin-dashboard-kicker {
    color: var(--admin-primary) !important;
}

body.admin-dark-mode .admin-theme-option {
    color: var(--dark-text);
    background: var(--dark-panel);
    border-color: var(--dark-border);
}

body.admin-dark-mode .admin-theme-option[aria-checked="true"] {
    border-color: var(--dark-accent);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--dark-accent) 22%, transparent);
}

body.admin-dark-mode .admin-theme-caption {
    color: var(--dark-muted);
}

/* Seletor do Portal do Prestador */
.provider-theme-button {
    position: relative;
}

.provider-theme-popover {
    position: fixed;
    z-index: 12000;
    top: 78px;
    right: 24px;
    width: min(330px, calc(100vw - 32px));
    padding: 16px;
    color: var(--provider-text);
    background: var(--provider-card);
    border: 1px solid var(--provider-border);
    border-radius: 18px;
    box-shadow: 0 24px 70px rgba(11, 23, 48, .22);
}

.provider-theme-popover header {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 13px;
}

.provider-theme-popover header div {
    display: grid;
    gap: 3px;
}

.provider-theme-popover header strong {
    color: var(--provider-navy);
    font-size: .82rem;
}

.provider-theme-popover header small {
    color: var(--provider-muted);
    font-size: .64rem;
    line-height: 1.4;
}

.provider-theme-close {
    display: inline-flex;
    width: 34px;
    height: 34px;
    align-items: center;
    justify-content: center;
    padding: 0;
    color: var(--provider-text);
    background: var(--provider-soft);
    border: 1px solid var(--provider-border);
    border-radius: 10px;
}

.provider-theme-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.provider-theme-option {
    display: grid;
    grid-template-columns: 30px 1fr;
    gap: 9px;
    align-items: center;
    min-height: 50px;
    padding: 8px 10px;
    border-radius: 12px;
    font-size: .7rem;
    font-weight: 800;
    text-align: left;
}

.provider-theme-option[aria-checked="true"] {
    border-color: var(--provider-blue);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--provider-blue) 20%, transparent);
}

/* Portal do Prestador: Oceano */
html[data-theme-preset="ocean"] {
    color-scheme: light;
    --provider-bg: #eaf3f8;
    --provider-card: #fbfdfe;
    --provider-text: #15324c;
    --provider-navy: #123a63;
    --provider-muted: #566d80;
    --provider-border: #c8dce7;
    --provider-soft: #dcecf4;
    --provider-blue: #0f6ea8;
    --provider-blue-dark: #0b567f;
    --provider-mint: #269c89;
    --provider-coral: #e2675a;
    --provider-orange: #d68a3d;
    --provider-shadow: 0 20px 60px rgba(18, 58, 99, .12);
}

/* Portal do Prestador: Lavanda */
html[data-theme-preset="lavender"] {
    color-scheme: light;
    --provider-bg: #f3eef7;
    --provider-card: #fffafd;
    --provider-text: #352b49;
    --provider-navy: #3f315c;
    --provider-muted: #6e627f;
    --provider-border: #ddd0e6;
    --provider-soft: #ebe2f2;
    --provider-blue: #76549b;
    --provider-blue-dark: #5d407d;
    --provider-mint: #4f8d7a;
    --provider-coral: #c85b79;
    --provider-orange: #c27a53;
    --provider-shadow: 0 20px 60px rgba(63, 49, 92, .13);
}

/* Portal do Prestador: Sálvia */
html[data-theme-preset="sage"] {
    color-scheme: light;
    --provider-bg: #edf3ed;
    --provider-card: #fbfdf9;
    --provider-text: #263b32;
    --provider-navy: #29483b;
    --provider-muted: #5c7065;
    --provider-border: #cadacd;
    --provider-soft: #e1ece2;
    --provider-blue: #3d7a62;
    --provider-blue-dark: #2e604c;
    --provider-mint: #4d9275;
    --provider-coral: #c86c62;
    --provider-orange: #c67a45;
    --provider-shadow: 0 20px 60px rgba(41, 72, 59, .12);
}

html[data-theme-preset="ocean"] body,
html[data-theme-preset="lavender"] body,
html[data-theme-preset="sage"] body {
    background: var(--provider-bg);
}

html[data-theme-preset="ocean"] .provider-sidebar {
    background: linear-gradient(180deg, #123a63, #0c2a49);
}

html[data-theme-preset="lavender"] .provider-sidebar {
    background: linear-gradient(180deg, #3f315c, #2d2442);
}

html[data-theme-preset="sage"] .provider-sidebar {
    background: linear-gradient(180deg, #29483b, #1f382e);
}

html[data-theme-preset="ocean"] .provider-public-shell::before,
html[data-theme-preset="lavender"] .provider-public-shell::before,
html[data-theme-preset="sage"] .provider-public-shell::before {
    background: color-mix(in srgb, var(--provider-blue) 16%, transparent);
}

html[data-theme-preset="ocean"] .provider-public-shell::after,
html[data-theme-preset="lavender"] .provider-public-shell::after,
html[data-theme-preset="sage"] .provider-public-shell::after {
    background: color-mix(in srgb, var(--provider-mint) 14%, transparent);
}

/* Contrato semântico compartilhado: componentes carregados depois do HTML também recebem o preset. */
body.admin-body[data-panel-theme] {
    --panel-theme-surface: var(--admin-card);
    --panel-theme-surface-soft: var(--admin-bg-soft);
    --panel-theme-input: color-mix(in srgb, var(--admin-card) 86%, var(--admin-bg-soft));
    --panel-theme-card-gradient: linear-gradient(180deg, var(--admin-card), color-mix(in srgb, var(--admin-card) 92%, var(--admin-bg-soft)));
    --admin-primary-strong: color-mix(in srgb, var(--admin-primary) 82%, black);
    --admin-on-primary: #ffffff;
}

body.admin-body[data-theme-mode="light"] {
    color-scheme: light;
}

body.admin-body[data-panel-theme="light"] {
    --admin-muted: #5f6f84;
}

body.admin-dark-mode[data-theme-mode="dark"] {
    color-scheme: dark;
    --dark-bg: #0b1120;
    --dark-bg-soft: #111827;
    --dark-panel: #162033;
    --dark-panel-strong: #1d2939;
    --dark-panel-soft: #101826;
    --dark-border: rgba(148, 163, 184, .22);
    --dark-border-strong: rgba(148, 163, 184, .34);
    --dark-text: #f8fafc;
    --dark-muted: #b6c2d2;
    --dark-muted-soft: #8fa1b7;
    --dark-accent: #60a5fa;
    --dark-accent-strong: #4b8ff5;
    --dark-success: #34d399;
    --dark-warning: #fbbf24;
    --dark-danger: #fb7185;
    --admin-bg: var(--dark-bg);
    --admin-bg-soft: var(--dark-bg-soft);
    --admin-sidebar: #0b1730;
    --admin-sidebar-soft: #10254d;
    --admin-primary: var(--dark-accent);
    --admin-primary-strong: var(--dark-accent-strong);
    --admin-on-primary: #0b1120;
    --admin-text: var(--dark-text);
    --admin-muted: var(--dark-muted);
    --admin-border: var(--dark-border);
    --admin-card: var(--dark-panel);
    --admin-card-shadow: 0 18px 42px rgba(0, 0, 0, .25);
    --admin-card-shadow-strong: 0 24px 62px rgba(0, 0, 0, .34);
    --admin-active-bg: color-mix(in srgb, var(--dark-accent) 19%, transparent);
    --admin-active-border: color-mix(in srgb, var(--dark-accent) 46%, transparent);
    --panel-theme-surface: var(--dark-panel);
    --panel-theme-surface-soft: var(--dark-panel-soft);
    --panel-theme-input: var(--dark-bg-soft);
    --panel-theme-card-gradient: linear-gradient(180deg, var(--dark-panel-strong), var(--dark-panel));
}

/* Painel do Evento: Meia-noite */
body.admin-dark-mode.admin-theme-midnight {
    --dark-bg: #050b18;
    --dark-bg-soft: #091326;
    --dark-panel: #0d1930;
    --dark-panel-strong: #14233d;
    --dark-panel-soft: #0a1529;
    --dark-border: rgba(126, 174, 232, .25);
    --dark-border-strong: rgba(126, 174, 232, .42);
    --dark-text: #f3f7ff;
    --dark-muted: #afbdd2;
    --dark-muted-soft: #8fa2bd;
    --dark-accent: #5ca8ff;
    --dark-accent-strong: #347fd2;
    --dark-success: #44d7b0;
    --dark-warning: #ffca68;
    --dark-danger: #ff7d99;
    --admin-sidebar: #071127;
    --admin-sidebar-soft: #0d2346;
    --admin-coral: #ff6f91;
    --admin-orange: #ffad5b;
    --admin-mint: #44d7b0;
    --admin-gold: #ffca68;
    --admin-on-primary: #050b18;
}

/* Painel do Evento: Grafite */
body.admin-dark-mode.admin-theme-graphite {
    --dark-bg: #111315;
    --dark-bg-soft: #171a1e;
    --dark-panel: #1b1f23;
    --dark-panel-strong: #24292e;
    --dark-panel-soft: #15191d;
    --dark-border: rgba(190, 199, 209, .22);
    --dark-border-strong: rgba(190, 199, 209, .38);
    --dark-text: #f4f5f7;
    --dark-muted: #b7bec7;
    --dark-muted-soft: #929ba6;
    --dark-accent: #a7c7fa;
    --dark-accent-strong: #6f9ee8;
    --dark-success: #66d6a7;
    --dark-warning: #f5c66a;
    --dark-danger: #f58aa0;
    --admin-sidebar: #171a1e;
    --admin-sidebar-soft: #252b31;
    --admin-coral: #f58aa0;
    --admin-orange: #e7a768;
    --admin-mint: #66d6a7;
    --admin-gold: #f5c66a;
    --admin-on-primary: #111315;
}

/* Painel do Evento: Floresta */
body.admin-dark-mode.admin-theme-forest {
    --dark-bg: #07140f;
    --dark-bg-soft: #0c1d15;
    --dark-panel: #10231a;
    --dark-panel-strong: #173126;
    --dark-panel-soft: #0c1c15;
    --dark-border: rgba(132, 190, 159, .25);
    --dark-border-strong: rgba(132, 190, 159, .42);
    --dark-text: #effaf4;
    --dark-muted: #afc5b9;
    --dark-muted-soft: #8fa99b;
    --dark-accent: #62c9a2;
    --dark-accent-strong: #3d9875;
    --dark-success: #69d8a8;
    --dark-warning: #e7c66d;
    --dark-danger: #f58b91;
    --admin-sidebar: #0b2118;
    --admin-sidebar-soft: #173b2c;
    --admin-coral: #f58b91;
    --admin-orange: #dda365;
    --admin-mint: #62c9a2;
    --admin-gold: #e7c66d;
    --admin-on-primary: #07140f;
}

body.admin-dark-mode.admin-theme-midnight .sidebar {
    background: radial-gradient(circle at 15% 0%, rgba(92, 168, 255, .22), transparent 31%), linear-gradient(180deg, #071127, #030813) !important;
}

body.admin-dark-mode.admin-theme-graphite .sidebar {
    background: radial-gradient(circle at 15% 0%, rgba(167, 199, 250, .14), transparent 31%), linear-gradient(180deg, #1a1d21, #0d0f11) !important;
}

body.admin-dark-mode.admin-theme-forest .sidebar {
    background: radial-gradient(circle at 15% 0%, rgba(98, 201, 162, .18), transparent 31%), linear-gradient(180deg, #0b2118, #050f0b) !important;
}

/* Superfícies principais do painel seguem os tokens, inclusive módulos antigos com cores fixas. */
body.admin-body[data-theme-mode="light"]:not([data-panel-theme="light"]) :is(
    .stat-card,
    .chart-container,
    .table-container,
    .admin-panel-card,
    .settings-card,
    .settings-panel,
    .rsvp-settings-card,
    .pix-admin-card,
    .mp-admin-card,
    .theme-settings-card,
    .agenda-form-card,
    .agenda-list-card,
    .agenda-item-card,
    .admin-budget-panel,
    .admin-budget-filters,
    .admin-budget-card,
    .admin-budget-stat,
    .admin-budget-modal-card,
    .admin-user-dropdown,
    .community-shell,
    .community-chat-shell,
    .community-dialog
) {
    background: var(--panel-theme-card-gradient) !important;
    border-color: var(--admin-border) !important;
    color: var(--admin-text) !important;
}

body.admin-dark-mode[data-theme-mode="dark"] :is(
    .stat-card,
    .chart-container,
    .table-container,
    .admin-panel-card,
    .settings-card,
    .settings-panel,
    .rsvp-settings-card,
    .pix-admin-card,
    .mp-admin-card,
    .theme-settings-card,
    .agenda-form-card,
    .agenda-list-card,
    .agenda-item-card,
    .admin-budget-panel,
    .admin-budget-filters,
    .admin-budget-card,
    .admin-budget-stat,
    .admin-budget-modal-card,
    .admin-user-dropdown,
    .community-shell,
    .community-chat-shell,
    .community-dialog
) {
    background: var(--panel-theme-card-gradient) !important;
    border-color: var(--dark-border) !important;
    color: var(--dark-text) !important;
}

body.admin-body[data-panel-theme]:not([data-panel-theme="light"]) :is(
    .btn-primary,
    button.btn-primary,
    .admin-addon-primary,
    .sellable-btn.primary,
    .gift-status-confirm-activate,
    .settings-tab.active,
    .agenda-view-tabs button.active,
    .gift-panel-icon,
    .admin-budget-primary,
    .admin-partners-tab.is-active,
    .admin-partner-open,
    .admin-partner-contact.is-chat
) {
    background: linear-gradient(135deg, var(--admin-primary), var(--admin-primary-strong)) !important;
    border-color: var(--admin-primary) !important;
    color: var(--admin-on-primary) !important;
}

body.admin-body[data-theme-mode="light"]:not([data-panel-theme="light"]) :is(
    .admin-dropdown-title,
    .admin-dropdown-action,
    .admin-dropdown-switch-row
) {
    color: var(--admin-text);
}

body.admin-dark-mode[data-theme-mode="dark"] :is(
    .admin-user-button:hover,
    .admin-user-button[aria-expanded="true"],
    .admin-dropdown-action:hover,
    .admin-dropdown-switch-row:hover
) {
    background: color-mix(in srgb, var(--dark-accent) 14%, transparent) !important;
    border-color: color-mix(in srgb, var(--dark-accent) 36%, transparent) !important;
}

body.admin-body[data-panel-theme] .admin-main :is(
    input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):not([type="file"]),
    select,
    textarea
) {
    accent-color: var(--admin-primary);
}

body.admin-body[data-theme-mode="light"]:not([data-panel-theme="light"]) .admin-main :is(
    input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):not([type="file"]),
    select,
    textarea
) {
    background-color: var(--panel-theme-input);
    border-color: var(--admin-border);
    color: var(--admin-text);
}

/* Portal do Prestador: tokens consumidos por configurações, operações, comunidade, chat e contratos. */
html[data-theme-preset] {
    --provider-surface: var(--provider-card);
    --provider-input: color-mix(in srgb, var(--provider-card) 84%, var(--provider-bg));
    --provider-primary: var(--provider-blue);
    --provider-on-accent: #ffffff;
    --portal-chat-surface: var(--provider-card);
    --portal-chat-soft: var(--provider-soft);
    --portal-chat-input: var(--provider-input);
    --portal-chat-border: var(--provider-border);
    --portal-chat-text: var(--provider-text);
    --portal-chat-muted: var(--provider-muted);
}

html[data-theme="light"][data-theme-preset="light"] {
    --provider-muted: #5f6f84;
}

/* Portal do Prestador: Meia-noite */
html[data-theme="dark"][data-theme-preset="dark"] {
    --provider-blue: #60a5fa;
    --provider-blue-dark: #4b8ff5;
    --provider-on-accent: #0b1120;
}

html[data-theme="dark"][data-theme-preset="midnight"] {
    color-scheme: dark;
    --provider-bg: #050b18;
    --provider-card: #0d1930;
    --provider-text: #f3f7ff;
    --provider-navy: #f3f7ff;
    --provider-muted: #afbdd2;
    --provider-border: #2a4064;
    --provider-soft: #142542;
    --provider-blue: #5ca8ff;
    --provider-blue-dark: #347fd2;
    --provider-mint: #44d7b0;
    --provider-coral: #ff6f91;
    --provider-orange: #ffad5b;
    --provider-shadow: 0 20px 60px rgba(0, 0, 0, .38);
    --provider-on-accent: #050b18;
}

/* Portal do Prestador: Grafite */
html[data-theme="dark"][data-theme-preset="graphite"] {
    color-scheme: dark;
    --provider-bg: #111315;
    --provider-card: #1b1f23;
    --provider-text: #f4f5f7;
    --provider-navy: #f4f5f7;
    --provider-muted: #b7bec7;
    --provider-border: #3b424a;
    --provider-soft: #252b31;
    --provider-blue: #a7c7fa;
    --provider-blue-dark: #6f9ee8;
    --provider-mint: #66d6a7;
    --provider-coral: #f58aa0;
    --provider-orange: #e7a768;
    --provider-shadow: 0 20px 60px rgba(0, 0, 0, .34);
    --provider-on-accent: #111315;
}

/* Portal do Prestador: Floresta */
html[data-theme="dark"][data-theme-preset="forest"] {
    color-scheme: dark;
    --provider-bg: #07140f;
    --provider-card: #10231a;
    --provider-text: #effaf4;
    --provider-navy: #effaf4;
    --provider-muted: #afc5b9;
    --provider-border: #2e5140;
    --provider-soft: #183126;
    --provider-blue: #62c9a2;
    --provider-blue-dark: #3d9875;
    --provider-mint: #69d8a8;
    --provider-coral: #f58b91;
    --provider-orange: #dda365;
    --provider-shadow: 0 20px 60px rgba(0, 0, 0, .38);
    --provider-on-accent: #07140f;
}

html[data-theme="dark"][data-theme-preset="midnight"] .provider-sidebar {
    background: linear-gradient(180deg, #071127, #030813);
}

html[data-theme="dark"][data-theme-preset="graphite"] .provider-sidebar {
    background: linear-gradient(180deg, #1a1d21, #0d0f11);
}

html[data-theme="dark"][data-theme-preset="forest"] .provider-sidebar {
    background: linear-gradient(180deg, #0b2118, #050f0b);
}

html[data-theme="dark"][data-theme-preset] :where(.provider-public-shell *, .provider-app *, .provider-theme-popover *, .provider-operation-modal *, .portal-chat-shell *, .portal-support-shell *) {
    --provider-surface: var(--provider-card);
    --provider-input: color-mix(in srgb, var(--provider-card) 78%, var(--provider-bg));
    --portal-chat-surface: var(--provider-card);
    --portal-chat-soft: var(--provider-soft);
    --portal-chat-input: var(--provider-input);
    --portal-chat-border: var(--provider-border);
    --portal-chat-text: var(--provider-text);
    --portal-chat-muted: var(--provider-muted);
}

html[data-theme="light"][data-theme-preset]:not([data-theme-preset="light"]) :is(
    .provider-settings-card,
    .provider-operations-toolbar,
    .provider-operation-metric,
    .provider-operations-panel,
    .provider-contract-financial-card,
    .provider-community-identity,
    .provider-community-composer,
    .provider-community-post,
    .provider-community-profile-card,
    .provider-drive-state,
    .provider-intelligence-metric,
    .provider-intelligence-panel
) {
    background: var(--provider-card) !important;
    border-color: var(--provider-border) !important;
    color: var(--provider-text) !important;
}

html[data-theme="dark"][data-theme-preset] :is(
    .provider-theme-popover,
    .portal-chat-shell,
    .portal-chat-conversation-header,
    .portal-chat-composer,
    .portal-chat-document,
    .portal-chat-dialog,
    .portal-support-shell > section
) {
    background: var(--provider-card) !important;
    border-color: var(--provider-border) !important;
    color: var(--provider-text) !important;
}

html[data-theme-preset]:not([data-theme-preset="light"]) :is(
    .provider-primary,
    .provider-primary-button,
    .provider-upload-button,
    .provider-settings-tabs button.active,
    .provider-contract-actions .is-primary,
    .provider-opportunities-filters button.is-active,
    .provider-opportunity-actions button.is-primary,
    .provider-community-actions > .is-chat,
    .provider-community-comments form button,
    .provider-community-source > button:not(.community-generate-quote),
    .provider-community-chat form button,
    .pcb-topbar nav button.active,
    .pcb-builder-actions .is-primary,
    .pcb-card-actions .is-primary,
    .portal-support-layout > aside .is-new,
    .portal-support-form .is-primary,
    .portal-support-composer button,
    .portal-chat-charge-actions button,
    .portal-chat-charge-actions a
) {
    background: linear-gradient(135deg, var(--provider-blue), var(--provider-blue-dark)) !important;
    border-color: var(--provider-blue) !important;
    color: var(--provider-on-accent) !important;
}

html[data-theme-preset]:not([data-theme-preset="light"]) :is(
    .provider-kicker,
    .provider-contract-financial-card header span:first-child,
    .provider-agenda-item time,
    .provider-receipt-card a,
    .provider-community-menu-badge,
    .provider-community-avatar,
    .portal-support-layout > aside [data-support-ticket-id] span,
    .portal-chat-charge-card header small
) {
    color: var(--provider-blue) !important;
}

html[data-theme-preset]:not([data-theme-preset="light"]) .provider-community-menu-badge {
    background: var(--provider-soft) !important;
}

html[data-theme="dark"][data-theme-preset] :is(
    .portal-chat-list,
    .portal-chat-messages,
    .portal-chat-list .portal-chat-group-toggle,
    .portal-chat-help-actions a,
    .portal-chat-help-actions button
) {
    background: var(--provider-soft) !important;
    border-color: var(--provider-border) !important;
}

html[data-theme-preset] :is(button, a, input, select, textarea):focus-visible,
body.admin-body[data-panel-theme] :is(button, a, input, select, textarea):focus-visible {
    outline-color: color-mix(in srgb, var(--provider-blue, var(--admin-primary)) 72%, white);
}

@media (max-width: 620px) {
    .admin-theme-picker,
    .provider-theme-options {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .admin-user-dropdown {
        max-height: calc(100dvh - 96px);
        overflow-y: auto;
        overscroll-behavior: contain;
    }

    .provider-theme-popover {
        top: auto;
        right: 12px;
        bottom: 12px;
        left: 12px;
        width: auto;
        max-height: calc(100dvh - 24px);
        overflow-y: auto;
    }
}

@media (max-width: 340px) {
    .admin-theme-picker,
    .provider-theme-options {
        grid-template-columns: 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {
    .admin-theme-option,
    .provider-theme-option,
    .provider-theme-popover {
        transition: none !important;
    }
}

@media (forced-colors: active) {
    .admin-theme-option[aria-checked="true"],
    .provider-theme-option[aria-checked="true"] {
        outline: 2px solid SelectedItem;
        outline-offset: 2px;
    }

    .panel-theme-swatch {
        forced-color-adjust: none;
    }
}

/* Organização por modo e menu de conta compartilhado. */
.panel-theme-mode-tabs{display:grid;grid-template-columns:1fr 1fr;gap:6px;margin:10px 0;padding:4px;border:1px solid var(--admin-border,var(--provider-border));border-radius:12px;background:var(--admin-bg-soft,var(--provider-soft))}.panel-theme-mode-tabs button{min-height:36px;border:0;border-radius:9px;background:transparent;color:var(--admin-muted,var(--provider-muted));cursor:pointer;font-family:inherit;font-size:.72rem;font-weight:800}.panel-theme-mode-tabs button.is-active{background:var(--admin-card,var(--provider-card));box-shadow:0 3px 12px rgba(11,23,48,.1);color:var(--admin-primary,var(--provider-blue))}.admin-theme-picker,.provider-theme-options{display:block}.panel-theme-variant-group{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.panel-theme-variant-group.hidden{display:none!important}
.provider-user-menu{position:relative}.provider-user-button{align-items:center;background:var(--provider-card);border:1px solid var(--provider-border);border-radius:13px;color:var(--provider-text);cursor:pointer;display:flex;gap:10px;justify-content:space-between;min-height:46px;padding:7px 11px}.provider-user-button>span:first-child{display:grid;gap:2px;text-align:left}.provider-user-button strong{color:var(--provider-navy);font-size:.75rem;max-width:170px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.provider-user-button small{color:var(--provider-muted);font-size:.61rem}.provider-user-dropdown{background:var(--provider-card);border:1px solid var(--provider-border);border-radius:16px;box-shadow:var(--provider-shadow,0 20px 60px rgba(11,23,48,.18));display:grid;gap:5px;min-width:275px;padding:9px;position:absolute;right:0;top:calc(100% + 8px);z-index:12020}.provider-user-dropdown.hidden{display:none}.provider-user-dropdown>button{background:transparent;border:0;border-radius:10px;color:var(--provider-text);cursor:pointer;display:flex;font-family:inherit;font-size:.72rem;font-weight:750;justify-content:space-between;min-height:40px;padding:10px;text-align:left}.provider-user-dropdown>button:hover,.provider-user-dropdown>button:focus-visible{background:var(--provider-soft)}.provider-user-dropdown>button:last-child{color:var(--provider-coral)}.provider-user-language{display:none}.provider-user-dropdown>.celebrax-language-switcher{border-bottom:1px solid var(--provider-border);border-top:1px solid var(--provider-border);padding:7px 0}

/* Divulgação e módulos carregados por JavaScript consomem somente tokens do preset ativo. */
html[data-theme-preset] :is(.provider-affiliate-loading,.provider-affiliate-empty,.provider-affiliate-hero,.provider-affiliate-link-card,.provider-affiliate-message-card,.provider-affiliate-studio,.provider-affiliate-evolution,.provider-affiliate-breakdown article,.provider-affiliate-metric){background:var(--provider-card)!important;border-color:var(--provider-border)!important;box-shadow:var(--provider-shadow)!important;color:var(--provider-text)!important}html[data-theme-preset] .provider-affiliate-hero{background:radial-gradient(circle at 100% 0,color-mix(in srgb,var(--provider-mint) 15%,transparent),transparent 38%),linear-gradient(135deg,var(--provider-card),var(--provider-soft))!important}html[data-theme-preset] :is(.provider-affiliate-empty h2,.provider-affiliate-hero h2,.provider-affiliate-studio h3,.provider-affiliate-evolution h3,.provider-affiliate-message-card h3,.provider-affiliate-metric strong,.provider-affiliate-breakdown strong,.provider-affiliate-link-copy code,.provider-affiliate-post-fields label,.provider-affiliate-visibility legend){color:var(--provider-navy)!important}html[data-theme-preset] :is(.provider-affiliate-empty p,.provider-affiliate-empty small,.provider-affiliate-hero p,.provider-affiliate-studio p,.provider-affiliate-message-card p,.provider-affiliate-metric small,.provider-affiliate-breakdown small,.provider-affiliate-privacy,.provider-affiliate-canvas-wrap span,.provider-affiliate-chart-day small,.provider-affiliate-chart-legend){color:var(--provider-muted)!important}html[data-theme-preset] :is(.provider-affiliate-message-card textarea,.provider-affiliate-post-fields input,.provider-affiliate-post-fields textarea,.provider-affiliate-format-picker button){background:var(--provider-input)!important;border-color:var(--provider-border)!important;color:var(--provider-text)!important}html[data-theme-preset] .provider-affiliate-format-picker button small{color:var(--provider-muted)!important}html[data-theme-preset] .provider-affiliate-format-picker button.is-active{background:var(--provider-blue)!important;border-color:var(--provider-blue)!important;color:var(--provider-on-accent)!important}html[data-theme-preset] .provider-affiliate-visibility{border-color:var(--provider-border)!important}html[data-theme-preset] .provider-affiliate-chart{border-color:var(--provider-border)!important}

/* Perfil das indicações: uma viewport, uma rolagem e ações sempre visíveis. */
.admin-partner-modal{height:100dvh!important;isolation:isolate;margin:0!important;max-height:none!important;max-width:none!important;overflow:hidden;padding:clamp(.65rem,2vh,1.25rem)!important;width:100vw!important}.admin-partner-modal-card{height:calc(100dvh - clamp(1.3rem,4vh,2.5rem))!important;max-height:calc(100dvh - clamp(1.3rem,4vh,2.5rem))!important;width:min(1180px,calc(100vw - 1.3rem))!important}.admin-partner-modal-scroll{height:100%;max-height:none;overflow-x:hidden!important;overflow-y:auto!important}.admin-partner-modal-identity{background:linear-gradient(135deg,var(--admin-card),var(--admin-bg-soft))!important;border-color:var(--admin-border)!important;grid-template-columns:88px minmax(0,1fr)!important}.admin-partner-modal-avatar{height:80px!important;width:88px!important}.admin-partner-modal-actions{background:var(--admin-card)!important;border-color:var(--admin-border)!important}.admin-partner-open,.admin-partner-contact.is-chat,.admin-partner-contact.is-quote{background:linear-gradient(135deg,var(--admin-primary),var(--admin-primary-strong))!important;border-color:var(--admin-primary)!important;color:var(--admin-on-primary)!important}
@media(max-width:620px){.panel-theme-variant-group{grid-template-columns:1fr 1fr}.provider-user-button strong{max-width:100px}.provider-user-dropdown{max-height:calc(100dvh - 90px);min-width:min(285px,calc(100vw - 24px));overflow:auto;right:0}.admin-partner-modal{align-items:flex-end!important;padding:0!important}.admin-partner-modal-card{height:calc(100dvh - .5rem)!important;max-height:calc(100dvh - .5rem)!important;width:100vw!important}.admin-partner-modal-scroll{height:100%;max-height:none}.admin-partner-modal-identity{grid-template-columns:68px minmax(0,1fr)!important}.admin-partner-modal-avatar{height:64px!important;width:68px!important}}
