/* Five visual presets. No changes to layouts, app logic or statuses. */
:root{--theme-bg:#080f1a;--theme-surface:#0b1524;--theme-surface2:#111d31;--theme-tile:#1b2737;--theme-input:#0f1828;--theme-border:#26354b;--theme-text:#eef4ff;--theme-muted:#93a5c4;--theme-accent:#83b8ff;--theme-active:#253b58;--theme-primary:#314b73;--theme-shadow:rgba(0,0,0,.25);color-scheme:dark}
:root[data-theme="oled"]{--theme-bg:#030303;--theme-surface:#0c0c0c;--theme-surface2:#151515;--theme-tile:#1b1b1b;--theme-input:#090909;--theme-border:#303030;--theme-text:#fafafa;--theme-muted:#a5a5a5;--theme-accent:#d0e1fb;--theme-active:#333333;--theme-primary:#363e48;--theme-shadow:rgba(0,0,0,.4)}
:root[data-theme="emerald"]{--theme-bg:#081411;--theme-surface:#0e211b;--theme-surface2:#152f27;--theme-tile:#1d3a30;--theme-input:#0a1a15;--theme-border:#2e5042;--theme-text:#f0faf5;--theme-muted:#9dbeb0;--theme-accent:#58d9a5;--theme-active:#225541;--theme-primary:#277251;--theme-shadow:rgba(0,0,0,.25)}
:root[data-theme="purple"]{--theme-bg:#100e17;--theme-surface:#1a1525;--theme-surface2:#251f34;--theme-tile:#30283e;--theme-input:#151121;--theme-border:#453b5d;--theme-text:#f7f3ff;--theme-muted:#b3a7cc;--theme-accent:#ba9eff;--theme-active:#453464;--theme-primary:#57437e;--theme-shadow:rgba(0,0,0,.25)}
:root[data-theme="light"]{--theme-bg:#f4f6fa;--theme-surface:#fff;--theme-surface2:#f0f3f8;--theme-tile:#e9eef5;--theme-input:#fff;--theme-border:#d7e0eb;--theme-text:#1b2a40;--theme-muted:#647793;--theme-accent:#316ec5;--theme-active:#dfeafa;--theme-primary:#3569ae;--theme-shadow:rgba(19,44,80,.08);color-scheme:light}
html,body{background:var(--theme-bg)!important;color:var(--theme-text)}
body{background-image:none!important}
.metric-card,.panel,.auth-card,.modal-card{background:var(--theme-surface)!important;border-color:var(--theme-border)!important;box-shadow:0 12px 32px var(--theme-shadow)!important;color:var(--theme-text)}
.month-bar,.prev-summary,.w-extra{background:var(--theme-surface2)!important;border-color:var(--theme-border)!important;color:var(--theme-text)}
.w-card,.w-section,.legend-item,.mini-item,.prev-stat-grid>span,.w-drawer-panel{background:var(--theme-tile)!important;border-color:var(--theme-border)!important;color:var(--theme-text)}
.w-drawer-panel{background:var(--theme-surface)!important}
input,select:not(.inline-status),textarea,.search-wrap input,.w-form input,.w-form select,.w-form textarea{background:var(--theme-input)!important;color:var(--theme-text)!important;border-color:var(--theme-border)!important}
.btn.secondary,.w-nav,.w-action,.month-button,.prev-stat-grid>span,.tab-btn.active,.year-pill,.copy-url,.open-url{background:var(--theme-surface2)!important;color:var(--theme-text)!important;border-color:var(--theme-border)!important}
.btn.primary{background:var(--theme-primary)!important;color:#fff!important}
.w-nav.active,.w-nav:hover,.w-ptab.active,.w-ptab:hover,.tab-btn.active{background:var(--theme-active)!important;color:var(--theme-text)!important}
.w-ptab,.tab-btn,.sort-head{color:var(--theme-muted)}
.w-drawer-head h2,.w-name,.w-card b,.w-stat b,.w-log strong,.w-section h3,.page-header h1,.month-info strong,.prev-stat-grid b,.w-listrow strong{color:var(--theme-text)!important}
.muted,.w-muted,.w-drawer-head small,.month-rule,.month-info small,.page-header p,.metric-label,.side-hint,.table-meta,.w-listrow small,.w-log small,th,.field-hint,.manager-list-item small{color:var(--theme-muted)!important}
.w-name:hover,.link-btn{color:var(--theme-accent)!important}
th,td,.w-listrow,.manager-list-item,.w-eventtable td,.w-eventtable th{border-color:var(--theme-border)!important}
tr:hover td{background:color-mix(in srgb,var(--theme-accent) 5%,transparent)!important}
.w-drawer-tabs,.w-drawer-panel,.manager-list,.w-drawer .w-section{border-color:var(--theme-border)!important}
.w-quickbar,.table-meta,.w-stat{color:var(--theme-muted)!important}
.w-ads-row{min-width:0}.w-ads-actions{display:flex;align-items:center;gap:7px;flex-shrink:0}.w-ads-row>div:first-child{min-width:0;overflow:hidden}.w-ads-row small{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
/* Light preset: maintain legible controls and meaningful status badges. */
:root[data-theme="light"] .w-pill{background:#e7edf7!important}
:root[data-theme="light"] .status-pill,:root[data-theme="light"] .badge{filter:brightness(.84)}
:root[data-theme="light"] .w-nav.active,:root[data-theme="light"] .tab-btn.active{color:#173357!important}
:root[data-theme="light"] .w-drawer-backdrop{background:rgba(17,36,61,.42)}
:root[data-theme="light"] .w-eventtable th,:root[data-theme="light"] .w-log small{color:#61748f!important}
/* Theme selection: one compact dropdown in the existing header */
.theme-select-wrap{position:relative}.theme-menu{position:absolute;right:0;top:calc(100% + 10px);width:225px;padding:9px;background:var(--theme-surface);border:1px solid var(--theme-border);border-radius:13px;box-shadow:0 22px 48px var(--theme-shadow);z-index:130;display:grid;gap:2px}.theme-menu-title{padding:7px 10px;color:var(--theme-muted);font-size:11px;font-weight:650}.theme-menu button{display:flex;align-items:center;gap:9px;white-space:nowrap;text-align:left;padding:10px;border:0;border-radius:9px;background:transparent;color:var(--theme-text);font:inherit;font-size:12px;cursor:pointer}.theme-menu button:hover,.theme-menu button.selected{background:var(--theme-active)}.theme-menu button span{margin-left:auto;visibility:hidden;color:var(--theme-accent)}.theme-menu button.selected span{visibility:visible}.theme-swatch{width:17px;height:17px;display:inline-block;border-radius:5px;background:var(--swatch);border:1px solid #8792aa70;flex-shrink:0}
@media(max-width:650px){.theme-menu{right:-65px}.header-right{gap:6px}.theme-select-wrap .btn{padding:9px}}

/* V7.3: Semantic campaign status colors must be independent from global theme inputs. */
.inline-status {
  background-color:var(--status-bg)!important;
  color:var(--status-color)!important;
  border-color:color-mix(in srgb,var(--status-color) 22%,transparent)!important;
}
.inline-status:hover {border-color:color-mix(in srgb,var(--status-color) 52%,transparent)!important;}
/* Keep the familiar dark status palette visible over the light theme. */
:root[data-theme="light"] .inline-status {
  background-color:color-mix(in srgb,var(--status-color) 15%,white)!important;
  color:color-mix(in srgb,var(--status-color) 72%,black)!important;
  border-color:color-mix(in srgb,var(--status-color) 36%,transparent)!important;
}
