/* Purple dark v2: deep navy surfaces with violet light, matching the supplied reference. Color-only overrides; existing geometry, animation and behavior are unchanged. */
body.crm-interface-v2.dark-theme {
  --ui-bg:#090d20;--ui-card:#101226;--ui-text:#eff0ff;--ui-muted:#a4a8ce;
  --ui-line:#272a48;--ui-blue:#aa9cff;--ui-tint:#191c3a;--ui-row:#161a35;
  --ui-green:#0ed6a3;--ui-red:#fb6287;--ui-orange:#f7c437;--ui-purple:#a78aff;
  --bg-main:#090d20;--sidebar-bg:#080c1c;--sidebar-hover:#191c3a;
  --text-main:#eff0ff;--text-muted:#a4a8ce;--border-light:#272a48;
  --card-bg:#101226;--card-dark:#101226;--input-bg:#14182f;
  --table-head-bg:#11152f;--row-acc-bg:#161a35;--row-adset-bg:#11152b;--hover-bg:#1c2140;
}
body.dark-theme #page-stats .dark-summary-card {background:#101226;border-color:#272a48;box-shadow:0 7px 16px #0002}
body.dark-theme #page-stats .summary-title-main,body.dark-theme #page-stats .summary-item .label {color:#a4a8ce}
body.dark-theme #page-stats .summary-item .value {color:#eff0ff}
body.dark-theme #page-stats .summary-item .value.accent {color:#aa9cff}
body.dark-theme #page-stats .summary-item .value.warning {color:#f7c437}
body.dark-theme #page-stats .summary-big-value {color:#0ed6a3}
body.dark-theme #page-stats th {background:#11152f}
body.dark-theme #page-stats .row-account {background:#161a35;border-left-color:#6756d4}
body.dark-theme #page-stats .row-account[data-expanded="1"] {background:#191c3a}
body.dark-theme #page-stats .row-campaign {background:#101226}
body.dark-theme #page-stats .row-campaign[data-expanded="1"] {background:#171b35}
body.dark-theme #page-stats .row-adset {background:#11152b}
body.dark-theme #page-stats .row-adset[data-expanded="1"] {background:#1d2240}
body.dark-theme #page-stats .row-ad {background:#101226}
body.dark-theme #page-stats tr.crm-v2-selected {background:#212141!important}
body.dark-theme #page-stats tr.crm-v2-selected td:first-child {box-shadow:inset 3px 0 #8a77f5}
body.dark-theme #page-stats tr.crm-v2-selected:hover {background:#28294d!important}
body.dark-theme #page-stats .bg-active {background:#10342f}
body.dark-theme #page-stats .bg-paused {background:#352039}
body.dark-theme #page-stats .badge-bid,body.dark-theme #page-stats .badge-cbo {background:#252048;border-color:#413765}
body.dark-theme #page-stats .badge-wl {background:#10342f;border-color:#30463d}
body.dark-theme #page-stats .badge-abo,body.dark-theme #page-stats .geo-badge {background:#1b1c3c;border-color:#343653}
body.dark-theme #page-stats .agent-chip {background:#1e1c43}
body.dark-theme #page-stats input[type=checkbox] {accent-color:#aa9cff}
body.dark-theme .nav-item.active {background:#352aaa;color:#aa9cff;box-shadow:inset 2px 0 #aa9cff}
body.dark-theme .nav-item {color:#a4a8ce}

/* Clear actions without isolated black button tiles. */
body.dark-theme #page-stats .action-btn {background:transparent!important;border-color:#303555;box-shadow:none}
body.dark-theme #page-stats .action-btn.is-play {color:#0ed6a3}
body.dark-theme #page-stats .action-btn.is-pause {color:#fb6287}
body.dark-theme #page-stats .action-btn.is-remod {color:#a78aff}
body.dark-theme #page-stats .action-btn:hover {background:#ffffff0a!important;border-color:#665d9b}
body.dark-theme #page-stats .summary-item .value.orange {color:#f7c437}

body.dark-theme #page-stats .action-btn.is-play svg {fill:#0ed6a3}
body.dark-theme #page-stats .action-btn.is-pause svg {fill:#fb6287}
body.dark-theme #page-stats .action-btn.is-remod svg {stroke:#a78aff}

/* Equal numeric readability at campaign, ad set and ad levels. */
body.dark-theme #page-stats .row-ad > td:nth-child(n+4):nth-child(-n+16) {color:var(--ui-text)}

/* Shared controls and every interactive state. */
body.crm-interface-v2.dark-theme {
 --accent:#aa9cff;--purple:#b09cff;
 --ui-pop-shadow:0 12px 32px #03061780;
}
body.crm-interface-v2.dark-theme a {color:var(--accent)}
body.crm-interface-v2.dark-theme input[type=checkbox],body.crm-interface-v2.dark-theme input[type=radio]{accent-color:#8d79ff}
body.crm-interface-v2.dark-theme .nav-item:hover{background-color:#171b36;color:#dcd6ff}
body.crm-interface-v2.dark-theme .nav-item.active:hover{background-color:#4938c3;color:#e3deff}
body.crm-interface-v2.dark-theme .logo{color:#a599ff}
body.crm-interface-v2.dark-theme .filters button.active{background-color:#24204e;color:#b8aaff}
body.crm-interface-v2.dark-theme .filters button:hover:not(.active){background-color:#191b38;color:#d5d4f7}
body.crm-interface-v2.dark-theme .top-action-btn:hover{background-color:#1c2140;border-color:#575289}
body.crm-interface-v2.dark-theme #page-stats .crm-v2-datebar .filters button.active{background-color:#24204e;color:#b8aaff}
body.crm-interface-v2.dark-theme #page-stats .crm-v2-action-group>.top-action-btn svg{color:var(--ui-purple)}
body.crm-interface-v2.dark-theme #page-stats .crm-v2-action-group>.top-action-btn[onclick*="ACTIVE"] svg{color:var(--ui-green)}
body.crm-interface-v2.dark-theme #page-stats .crm-v2-action-group>.top-action-btn[onclick*="PAUSED"] svg{color:var(--ui-red)}
body.crm-interface-v2.dark-theme tbody tr:hover{background-color:#1c2140!important}
body.crm-interface-v2.dark-theme #page-stats tr.crm-v2-selected{background-color:#212141!important}
body.crm-interface-v2.dark-theme #page-stats tr.crm-v2-selected:hover{background-color:#28294d!important}
body.crm-interface-v2.dark-theme #page-stats tr.crm-v2-selected td:first-child{box-shadow:inset 3px 0 #8a77f5}
body.crm-interface-v2.dark-theme #page-stats .budget-btn{color:#baacff;border-color:#39345e;background-color:#211d46}
body.crm-interface-v2.dark-theme #page-stats .budget-btn:hover{color:#e0d6ff;background-color:#302857;border-color:#7865bc}
body.crm-interface-v2.dark-theme #page-stats .action-btn:hover{background-color:#262548!important;border-color:#675b97}
body.crm-interface-v2.dark-theme .crm-v2-floating-menu :is(.sort-item,.filter-item,button):hover{background-color:#1c2140;color:#c1b5ff!important}
body.crm-interface-v2.dark-theme .crm-v2-floating-menu :is([aria-selected=true],[aria-pressed=true]){background-color:#212141!important;color:#ddd3ff!important}
body.crm-interface-v2.dark-theme .crm-v2-floating-menu :is([aria-selected=true],[aria-pressed=true]):hover{background-color:#28294d!important}
body.crm-interface-v2.dark-theme .crm-v2-modal{background-color:#030617cc}
body.crm-interface-v2.dark-theme .crm-v2-modal .modal-input,body.crm-interface-v2.dark-theme .crm-v2-select-button{background-color:#14182f}
body.crm-interface-v2.dark-theme .crm-v2-modal .modal-input:focus{border-color:#9c8bff;box-shadow:0 0 0 3px #8573ff26}
body.crm-interface-v2.dark-theme .crm-v2-select-button[aria-expanded=true]{background-color:#191c3a;border-color:#9c8bff}
body.crm-interface-v2.dark-theme #remoderateModal #remodPageSelectBtn{background-color:#14182f!important}
body.crm-interface-v2.dark-theme .crm-v2-modal .btn-save,body.crm-interface-v2.dark-theme .btn-save,body.crm-interface-v2.dark-theme .crm-ui-button.primary{background-color:#6650e8;border-color:#6650e8;color:#fff}
body.crm-interface-v2.dark-theme .crm-v2-modal .btn-save:hover,body.crm-interface-v2.dark-theme .btn-save:hover{background-color:#7b62f2;border-color:#7b62f2}
body.crm-interface-v2.dark-theme .btn-cancel:hover{background-color:#1c2140;border-color:#575289}
body.crm-interface-v2.dark-theme :is(button,input,textarea,select):focus-visible{outline-color:#b0a0ff}
body.crm-interface-v2.dark-theme :is(button,input,textarea):disabled{color:#777d9e;border-color:#303450}
body.crm-interface-v2.dark-theme #page-stats .stats-archive-bid{background-color:#252048;border-color:#413765}

/* Autolaunch controls use a separate set of existing color tokens. */
body.crm-interface-v2.dark-theme #al-root,body.crm-interface-v2.dark-theme .al-dialog-overlay{
 --al-accent-text:#b4a3ff;--al-accent-soft:#191a38;--al-accent-hover:#252449;
 --al-accent-selected:#29244f;--al-accent-border:#5a4b8d;--al-tinted-bg:#10142b;
 --al-account-bg:#151931;--al-account-border:#303657;
 --al-control-border:#303651;--al-progress-track:#242847;
}
body.crm-interface-v2.dark-theme #al-root .al-btn.primary,body.crm-interface-v2.dark-theme .al-dialog-overlay .al-btn.primary{background-color:#6650e8;border-color:#6650e8;color:#fff}
body.crm-interface-v2.dark-theme #al-root .al-btn.primary:hover:not(:disabled),body.crm-interface-v2.dark-theme .al-dialog-overlay .al-btn.primary:hover:not(:disabled){background-color:#7b62f2;border-color:#7b62f2}
body.crm-interface-v2.dark-theme #al-root .al-field :is(input,textarea,select):focus{box-shadow:0 0 0 2px #8573ff26}
body.crm-interface-v2.dark-theme #al-root .al-select-option[aria-selected=true]{background-color:#29244f;color:#ddd3ff}
body.crm-interface-v2.dark-theme #al-root .al-select-option:hover{background-color:#252449}
body.crm-interface-v2.dark-theme .al-dialog-overlay{background-color:#030617cc}
body.crm-interface-v2.dark-theme ::selection{background-color:#514591;color:#fff}

body.crm-interface-v2.dark-theme #addAccountTopBtn{background-color:#6650e8!important;color:#fff!important;box-shadow:0 4px 6px #6650e84d!important}
body.crm-interface-v2.dark-theme #addAccountTopBtn:hover{background-color:#7b62f2!important}
body.crm-interface-v2.dark-theme #al-root .al-page-nav #al-next:not(:disabled),
body.crm-interface-v2.dark-theme .al-dialog-primary{background-color:#6650e8;border-color:#6650e8;color:#fff;box-shadow:0 3px 9px #6650e822}
body.crm-interface-v2.dark-theme #al-root .al-page-nav #al-next:hover:not(:disabled),
body.crm-interface-v2.dark-theme .al-dialog-primary:hover{background-color:#7b62f2;border-color:#7b62f2}
body.crm-interface-v2.dark-theme #al-root .al-progress-fill,
body.crm-interface-v2.dark-theme #al-root .al-segment-active{background-color:#8d79ff}
body.crm-interface-v2.dark-theme .al-dialog-primary{box-shadow:0 4px 10px #6650e82b}

/* Purple switches retain the original size, thumb and motion. */
body.crm-interface-v2.dark-theme .switch .slider{background-color:#252940}
body.crm-interface-v2.dark-theme .switch input:checked+.slider{background-color:#6650e8}
body.crm-interface-v2.dark-theme .switch input:checked+.slider:hover{background-color:#7b62f2}
body.crm-interface-v2.dark-theme .switch .slider:before{background-color:#f4f1ff}

/* All CRM dialogs: same geometry; inline legacy action colors overridden. */
body.crm-interface-v2.dark-theme .modal-overlay{background-color:#030617cc}
body.crm-interface-v2.dark-theme .modal-card{background-color:#101226;border-color:#272a48;color:#eff0ff}
body.crm-interface-v2.dark-theme .modal-overlay:not(#removeWhitelistModal) .btn-save{background-color:#6650e8!important;border-color:#6650e8!important;color:#fff!important}
body.crm-interface-v2.dark-theme .modal-overlay:not(#removeWhitelistModal) .btn-save:hover{background-color:#7b62f2!important;border-color:#7b62f2!important}
body.crm-interface-v2.dark-theme .modal-overlay:not(#removeWhitelistModal) .modal-header>svg[style*="stroke:"]{stroke:#aa9cff!important}
body.crm-interface-v2.dark-theme .modal-overlay .ttl-btn.active{background-color:#212141;border-color:#7768c4;color:#c7bbff}
body.crm-interface-v2.dark-theme .modal-overlay .ttl-btn:hover:not(.active){background-color:#171b34;border-color:#42466c}
body.crm-interface-v2.dark-theme .modal-overlay .btn-cancel:hover{background-color:#212141;border-color:#42466c}
body.crm-interface-v2.dark-theme .modal-overlay:not(.crm-v2-modal) .modal-input:focus{border-color:#9c8bff;box-shadow:0 0 0 3px #8573ff26}
body.crm-interface-v2.dark-theme .modal-overlay:not(.crm-v2-modal) .btn-save{box-shadow:0 4px 6px -1px #6650e84d}

body.crm-interface-v2.dark-theme .modal-overlay{color-scheme:dark}

/* Soft light is painted into existing backgrounds; no extra elements or geometry. */
body.crm-interface-v2.dark-theme #page-stats .dark-summary-card {
 background-color:#101226;
 background-image:radial-gradient(ellipse at 48% 0%,#554de332,transparent 64%),linear-gradient(115deg,#0e1328,#11132a 60%,#0d1327);
 border-color:#292d49;
}
body.crm-interface-v2.dark-theme .nav-item.active {
 background-color:#352aaa;
 background-image:linear-gradient(145deg,#4937c8,#2d2394);
 color:#e6e1ff;
}
body.crm-interface-v2.dark-theme .nav-item.active:hover {background-image:linear-gradient(145deg,#5a47db,#3b2cab)}
body.crm-interface-v2.dark-theme #page-stats .crm-v2-action-group,
body.crm-interface-v2.dark-theme #page-stats .top-action-btn,
body.crm-interface-v2.dark-theme .crm-v2-sync-chip {
 background-image:linear-gradient(180deg,#29244924,transparent);
}
body.crm-interface-v2.dark-theme #page-stats .crm-v2-action-group>.top-action-btn[onclick*="ACTIVE"]:hover {background-color:#155b4b70;color:#35d5b1!important}
body.crm-interface-v2.dark-theme #page-stats .row-account {
 background-image:linear-gradient(100deg,#171b38,#141831);
 border-left-color:#6957d2;
}
body.crm-interface-v2.dark-theme #page-stats .row-account[data-expanded="1"] {background-image:linear-gradient(100deg,#1a1d3d,#161a35)}
body.crm-interface-v2.dark-theme tbody tr:hover,
body.crm-interface-v2.dark-theme #page-stats tr.crm-v2-selected {background-image:none!important}
body.crm-interface-v2.dark-theme #page-stats .budget-btn {
 background-image:linear-gradient(160deg,#6d53d521,transparent);
}
body.crm-interface-v2.dark-theme #page-stats .action-btn {
 background:linear-gradient(150deg,#27264180,#151a2c80)!important;
 border-color:#353655;
}
body.crm-interface-v2.dark-theme #page-stats .action-btn:hover {background:#282749!important;border-color:#7060a4}
body.crm-interface-v2.dark-theme .modal-card,
body.crm-interface-v2.dark-theme .al-dialog-overlay .al-dialog-card {
 background-image:radial-gradient(ellipse at 50% 0%,#5b4bdb16,transparent 68%);
}

/* Auto Rules: quiet violet actions; preserve original button geometry and handlers. */
body.crm-interface-v2.dark-theme #page-rules :is(.top-action-btn[data-rule-id],.top-action-btn[onclick="addNewRuleRow()"]){
 background-color:#211e3d!important;
 background-image:linear-gradient(180deg,#7860bf14,transparent)!important;
 color:#c4b7f5!important;
}
body.crm-interface-v2.dark-theme #page-rules :is(.top-action-btn[data-rule-id],.top-action-btn[onclick="addNewRuleRow()"]):hover:not(:disabled){background-color:#30284f!important;color:#e1d6ff!important}
body.crm-interface-v2.dark-theme #page-rules :is(.top-action-btn[data-rule-id],.top-action-btn[onclick="addNewRuleRow()"]):active:not(:disabled){background-color:#3a2e60!important;color:#eee7ff!important}
body.crm-interface-v2.dark-theme #page-rules #runNowBtn{
 background-color:#332759!important;
 background-image:linear-gradient(180deg,#a38bff12,transparent)!important;
 color:#e0d6ff!important;
}
body.crm-interface-v2.dark-theme #page-rules #runNowBtn:hover:not(:disabled){background-color:#44346e!important;color:#f2ecff!important}
body.crm-interface-v2.dark-theme #page-rules #runNowBtn:active:not(:disabled){background-color:#514080!important;color:#fff!important}
body.crm-interface-v2.dark-theme #page-rules .btn-delete[data-rule-id]{background-color:#251c2d;color:#e394aa}
/* Requested throughout the dark theme: match the SAVE/Edit label size and weight. */
body.crm-interface-v2.dark-theme .btn-delete{font-size:11px;font-weight:600}
body.crm-interface-v2.dark-theme .btn-action-small~.btn-delete{font-size:10.5px;font-weight:700}
body.crm-interface-v2.dark-theme #page-rules .btn-delete[data-rule-id]:hover:not(:disabled){background-color:#392339;color:#ffb0c4}
body.crm-interface-v2.dark-theme #page-rules .btn-delete[data-rule-id]:active:not(:disabled){background-color:#48273e;color:#ffc9d7}
body.crm-interface-v2.dark-theme #page-rules :is(.top-action-btn[data-rule-id],.top-action-btn[onclick="addNewRuleRow()"],#runNowBtn,.btn-delete[data-rule-id]):focus-visible{outline-color:#b0a0ff}
body.crm-interface-v2.dark-theme #page-rules :is(.top-action-btn[data-rule-id],.top-action-btn[onclick="addNewRuleRow()"],#runNowBtn,.btn-delete[data-rule-id]):disabled{
 background-color:#1b1c30!important;background-image:none!important;color:#777d9e!important;
}

/* Light-theme sidebar treatment with the requested violet active state. */
body.crm-interface-v2.dark-theme #sidebarMenu{background-color:#0b1120;border-right-color:#272a48}
body.crm-interface-v2.dark-theme #sidebarMenu .nav-item{color:#94a3b8}
body.crm-interface-v2.dark-theme #sidebarMenu .nav-item:hover{background-color:#1e293b;color:#fff}
body.crm-interface-v2.dark-theme #sidebarMenu .nav-item.active{
 background-color:#6650e8;background-image:none;color:#fff;box-shadow:0 4px 12px #6650e84d;
}
body.crm-interface-v2.dark-theme #sidebarMenu .nav-item.active:hover{background-color:#7b62f2;background-image:none;color:#fff}

/* Slightly darker account and campaign surfaces; selection and hover stay distinct. */
body.crm-interface-v2.dark-theme #page-stats .row-account{background-color:#101326;background-image:linear-gradient(100deg,#111428,#0f1224)}
body.crm-interface-v2.dark-theme #page-stats .row-account[data-expanded="1"]{background-color:#13162a;background-image:linear-gradient(100deg,#14172d,#111528)}
body.crm-interface-v2.dark-theme #page-stats .row-campaign{background-color:#0c0f1e}
body.crm-interface-v2.dark-theme #page-stats .row-campaign[data-expanded="1"]{background-color:#121529}
body.crm-interface-v2.dark-theme #page-stats tr.crm-v2-selected{background-color:#13162e!important;background-image:linear-gradient(100deg,#14172f,#12152a)!important}
body.crm-interface-v2.dark-theme #page-stats tr.crm-v2-selected:hover{background-color:#1c2140!important;background-image:none!important}
body.crm-interface-v2.dark-theme #page-stats .agent-chip{background-color:rgba(51,77,122,.85);color:#e7efff}

/* Readable blue numeric accents, coordinated with the muted blue agent badges. */
body.crm-interface-v2.dark-theme #page-stats .summary-item .value.accent,
body.crm-interface-v2.dark-theme #page-stats .k-metric:nth-child(9),
body.crm-interface-v2.dark-theme #page-stats .badge-avg-inst{color:#65b2ff!important}

/* Requested badge alignment: match status text and total height, including borders. */
body.crm-interface-v2.dark-theme #page-stats :is(.badge-cbo,.badge-abo){display:inline-flex;align-items:center;justify-content:center;font-size:10.5px;line-height:1.2;padding:4px 5px 2px}
