/* ==========================================================================
   Mailuxe — light theme ("normal mode")
   Loaded after app.css so these overrides win without touching the dark UI.
   ========================================================================== */
html[data-theme="light"] {
  color-scheme: light;
  --bg: #f3f6fb;
  --bg-soft: #eef3fa;
  --panel: rgba(255, 255, 255, 0.82);
  --panel-solid: #ffffff;
  --panel-deep: #f7f9fd;
  --text: #101828;
  --muted: #54627a;
  --faint: #7c8ba0;
  --line: rgba(15, 23, 42, 0.1);
  --line-soft: rgba(15, 23, 42, 0.06);
  --line-strong: rgba(15, 23, 42, 0.17);
  --teal: #0f766e;
  --teal-soft: #0d9488;
  --emerald: #059669;
  --indigo: #4f46e5;
  --violet: #7c3aed;
  --amber: #b45309;
  --rose: #e11d48;
  --sky: #0284c7;
  --lime: #4d7c0f;
  --grad-subtle: linear-gradient(120deg, rgba(13, 148, 136, 0.1), rgba(79, 70, 229, 0.06));
  --shadow-lg: 0 26px 60px -46px rgba(15, 23, 42, 0.4);
}

html[data-theme="light"] body { background: var(--bg); }
html[data-theme="light"] ::selection { background: rgba(13, 148, 136, 0.2); color: #062a26; }
html[data-theme="light"] ::-webkit-scrollbar-thumb { background: rgba(15, 23, 42, 0.18); background-clip: content-box; }
html[data-theme="light"] ::-webkit-scrollbar-thumb:hover { background: rgba(15, 23, 42, 0.3); background-clip: content-box; }

/* ---------- backdrop ---------- */
html[data-theme="light"] .ambient { background: linear-gradient(180deg, #f9fbff 0%, #eef4fb 55%, #f5f8fd 100%); }
html[data-theme="light"] .orb { opacity: 0.18; }
html[data-theme="light"] .grid-glow {
  background-image:
    linear-gradient(rgba(15, 23, 42, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15, 23, 42, 0.05) 1px, transparent 1px);
}

/* ---------- shell ---------- */
html[data-theme="light"] .sidebar {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(246, 249, 254, 0.98));
  box-shadow: 12px 0 44px -38px rgba(15, 23, 42, 0.4);
}
html[data-theme="light"] .topbar { background: rgba(248, 251, 255, 0.86); }
html[data-theme="light"] .nav-link:hover { background: rgba(15, 23, 42, 0.045); }
html[data-theme="light"] .nav-link.is-active {
  color: #0f172a;
  background: linear-gradient(90deg, rgba(13, 148, 136, 0.13), rgba(79, 70, 229, 0.05));
  border-color: rgba(13, 148, 136, 0.2);
  box-shadow: inset 0 1px 0 #ffffff;
}
html[data-theme="light"] .nav-badge,
html[data-theme="light"] .global-search kbd,
html[data-theme="light"] .kbd { background: rgba(15, 23, 42, 0.05); }
html[data-theme="light"] .nav-badge--accent { background: var(--teal-soft); color: #ffffff; }
html[data-theme="light"] .sending-card {
  background: linear-gradient(145deg, rgba(13, 148, 136, 0.1), rgba(79, 70, 229, 0.05));
}
html[data-theme="light"] .sending-card.is-live {
  background: linear-gradient(145deg, rgba(5, 150, 105, 0.12), rgba(16, 185, 129, 0.04));
}
html[data-theme="light"] .sending-card__head { color: #0f766e; }
html[data-theme="light"] .sending-card a { color: #0f766e; }
html[data-theme="light"] .sending-card a:hover { color: #0f172a; }
html[data-theme="light"] .global-search,
html[data-theme="light"] .icon-btn,
html[data-theme="light"] .segmented,
html[data-theme="light"] .range-switch,
html[data-theme="light"] .page-btn,
html[data-theme="light"] .recipient-chip,
html[data-theme="light"] .search-tag,
html[data-theme="light"] .provider-badge,
html[data-theme="light"] .result-meta div,
html[data-theme="light"] .search-big,
html[data-theme="light"] .mini-stat__icon,
html[data-theme="light"] .quick-icon,
html[data-theme="light"] .empty-icon,
html[data-theme="light"] .toolbar-search { background: rgba(15, 23, 42, 0.04); }
html[data-theme="light"] .icon-btn:hover,
html[data-theme="light"] .row-actions .icon-btn:hover,
html[data-theme="light"] .account-actions .icon-btn:hover,
html[data-theme="light"] .toast-close:hover,
html[data-theme="light"] .bulk-bar__close:hover,
html[data-theme="light"] .password-toggle:hover,
html[data-theme="light"] .popover-links a:hover,
html[data-theme="light"] .notif-row:hover { background: rgba(15, 23, 42, 0.06); }
html[data-theme="light"] .mode-chip {
  border-color: rgba(180, 83, 9, 0.22);
  background: rgba(180, 83, 9, 0.08);
  color: #92400e;
}
html[data-theme="light"] .mode-chip.is-live {
  border-color: rgba(5, 150, 105, 0.24);
  background: rgba(5, 150, 105, 0.08);
  color: #047857;
}
html[data-theme="light"] .segmented a.is-active,
html[data-theme="light"] .range-switch a.is-active {
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.1);
}
html[data-theme="light"] .page-btn.is-active {
  border-color: rgba(13, 148, 136, 0.28);
  background: rgba(13, 148, 136, 0.1);
  color: #0f766e;
}

/* ---------- surfaces ---------- */
html[data-theme="light"] .panel,
html[data-theme="light"] .kpi,
html[data-theme="light"] .mini-stat,
html[data-theme="light"] .metric-box,
html[data-theme="light"] .template-card,
html[data-theme="light"] .segment-card,
html[data-theme="light"] .list-card,
html[data-theme="light"] .automation-card,
html[data-theme="light"] .account-row,
html[data-theme="light"] .flow-node-card,
html[data-theme="light"] .report-kpi,
html[data-theme="light"] .settings-nav,
html[data-theme="light"] .step-row,
html[data-theme="light"] .public-form-card,
html[data-theme="light"] .result-card,
html[data-theme="light"] .error-card,
html[data-theme="light"] .modal-card,
html[data-theme="light"] .toast,
html[data-theme="light"] .popover,
html[data-theme="light"] .chart-tooltip,
html[data-theme="light"] .bulk-bar {
  background: #ffffff;
  box-shadow: 0 26px 55px -48px rgba(15, 23, 42, 0.45), inset 0 1px 0 #ffffff;
}
html[data-theme="light"] .quick-card,
html[data-theme="light"] .feature-card { background: linear-gradient(170deg, #ffffff, #f7fbfa); }
html[data-theme="light"] .quick-card:hover,
html[data-theme="light"] .template-card:hover { background: #ffffff; }
html[data-theme="light"] .profile-hero {
  background:
    radial-gradient(90% 160% at 0% 0%, rgba(13, 148, 136, 0.08), transparent 55%),
    #ffffff;
  box-shadow: var(--shadow-lg), inset 0 1px 0 #ffffff;
}

/* ---------- forms ---------- */
html[data-theme="light"] .field > label { color: var(--text); }
html[data-theme="light"] .input,
html[data-theme="light"] .select,
html[data-theme="light"] .textarea {
  background: #ffffff;
  color-scheme: light;
}
html[data-theme="light"] .input:hover,
html[data-theme="light"] .select:hover,
html[data-theme="light"] .textarea:hover { border-color: rgba(15, 23, 42, 0.28); }
html[data-theme="light"] .input:focus,
html[data-theme="light"] .select:focus,
html[data-theme="light"] .textarea:focus {
  background: #ffffff;
  border-color: rgba(13, 148, 136, 0.55);
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.1);
}
html[data-theme="light"] .select option { background: #ffffff; color: var(--text); }
html[data-theme="light"] .form-actions { background: rgba(248, 250, 252, 0.85); }
html[data-theme="light"] .switch__track { background: rgba(15, 23, 42, 0.08); }
html[data-theme="light"] .choice { background: #ffffff; }
html[data-theme="light"] .choice:has(input:checked) {
  color: #0f766e;
  border-color: rgba(13, 148, 136, 0.35);
  background: rgba(13, 148, 136, 0.08);
}
html[data-theme="light"] .choice--card:has(input:checked) strong { color: #0f766e; }
html[data-theme="light"] .check { background: #ffffff; }
html[data-theme="light"] .progress { background: rgba(15, 23, 42, 0.08); }
html[data-theme="light"] .data tbody tr:hover { background: rgba(15, 23, 42, 0.025); }
html[data-theme="light"] .field-error { color: #be123c; }
html[data-theme="light"] .code-editor { background: #f8fafc; color: #0f172a; }
html[data-theme="light"] .code-editor:focus { box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.08); }

/* ---------- buttons ---------- */
html[data-theme="light"] .btn-secondary {
  background: #ffffff;
  border-color: rgba(15, 23, 42, 0.14);
  color: var(--text);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
html[data-theme="light"] .btn-secondary:hover { background: #f8fafc; border-color: rgba(15, 23, 42, 0.24); }
html[data-theme="light"] .btn-ghost:hover { background: rgba(15, 23, 42, 0.05); }
html[data-theme="light"] .btn-danger {
  color: #be123c;
  border-color: rgba(225, 29, 72, 0.28);
  background: rgba(225, 29, 72, 0.08);
}

/* ---------- pills, labels & messages ---------- */
html[data-theme="light"] .pill { background: rgba(15, 23, 42, 0.04); }
html[data-theme="light"] .pill-sent,
html[data-theme="light"] .pill-subscribed,
html[data-theme="light"] .pill-active,
html[data-theme="light"] .pill-completed,
html[data-theme="light"] .pill-delivered {
  color: #0f766e;
  border-color: rgba(13, 148, 136, 0.2);
  background: rgba(13, 148, 136, 0.08);
}
html[data-theme="light"] .pill-scheduled,
html[data-theme="light"] .pill-bounced {
  color: #b45309;
  border-color: rgba(180, 83, 9, 0.2);
  background: rgba(180, 83, 9, 0.08);
}
html[data-theme="light"] .pill-sending {
  color: #0369a1;
  border-color: rgba(3, 105, 161, 0.2);
  background: rgba(3, 105, 161, 0.08);
}
html[data-theme="light"] .pill-draft,
html[data-theme="light"] .pill-paused,
html[data-theme="light"] .pill-queued,
html[data-theme="light"] .pill-skipped { color: #64748b; background: rgba(15, 23, 42, 0.04); }
html[data-theme="light"] .pill-unsubscribed,
html[data-theme="light"] .pill-failed {
  color: #be123c;
  border-color: rgba(225, 29, 72, 0.2);
  background: rgba(225, 29, 72, 0.07);
}
html[data-theme="light"] .pill-opened {
  color: #4338ca;
  border-color: rgba(67, 56, 202, 0.2);
  background: rgba(67, 56, 202, 0.07);
}
html[data-theme="light"] .pill-clicked {
  color: #6d28d9;
  border-color: rgba(109, 40, 217, 0.2);
  background: rgba(109, 40, 217, 0.07);
}
html[data-theme="light"] .tag--teal {
  color: #0f766e;
  background: rgba(13, 148, 136, 0.08);
  border-color: rgba(13, 148, 136, 0.16);
}
html[data-theme="light"] .tag--violet {
  color: #6d28d9;
  background: rgba(109, 40, 217, 0.07);
  border-color: rgba(109, 40, 217, 0.16);
}
html[data-theme="light"] .kpi-delta {
  color: #047857;
  background: rgba(5, 150, 105, 0.08);
  border-color: rgba(5, 150, 105, 0.18);
}
html[data-theme="light"] .kpi-delta.is-neg {
  color: #be123c;
  background: rgba(225, 29, 72, 0.07);
  border-color: rgba(225, 29, 72, 0.16);
}
html[data-theme="light"] .notif-icon.tone-campaign,
html[data-theme="light"] .activity-icon.tone-campaign { color: #4338ca; }
html[data-theme="light"] .notif-icon.tone-contact,
html[data-theme="light"] .activity-icon.tone-contact { color: #0369a1; }
html[data-theme="light"] .notif-icon.tone-automation,
html[data-theme="light"] .activity-icon.tone-automation { color: #6d28d9; }
html[data-theme="light"] .notif-icon.tone-template,
html[data-theme="light"] .activity-icon.tone-template { color: #b45309; }
html[data-theme="light"] .notif-icon.tone-system,
html[data-theme="light"] .activity-icon.tone-system { color: #475569; }
html[data-theme="light"] .toast p,
html[data-theme="light"] .notif-copy strong,
html[data-theme="light"] .activity-copy p,
html[data-theme="light"] .info-row > span:last-child { color: var(--text); }
html[data-theme="light"] .toast--error .toast-icon { color: #be123c; }
html[data-theme="light"] .toast--info .toast-icon { color: #0369a1; }
html[data-theme="light"] .popover-logout button,
html[data-theme="light"] .modal-icon,
html[data-theme="light"] .danger-zone h4 { color: #be123c; }
html[data-theme="light"] .info-strip .ic { color: #0369a1; }
html[data-theme="light"] .provider-badge.provider-gmail { color: #be123c; }
html[data-theme="light"] .provider-badge.provider-outlook { color: #0369a1; }
html[data-theme="light"] .provider-badge.provider-yahoo { color: #6d28d9; }
html[data-theme="light"] .provider-badge.provider-company { color: #0f766e; }
html[data-theme="light"] .feature-card .mini-label,
html[data-theme="light"] .feature-cta .text-link,
html[data-theme="light"] .public-kicker,
html[data-theme="light"] .auth-art-copy .eyebrow { color: #0f766e; }

/* ---------- charts & donut ---------- */
html[data-theme="light"] .chart-svg text { fill: var(--faint); }
html[data-theme="light"] .chart-svg circle { stroke: #ffffff; }
html[data-theme="light"] .chart-svg line { stroke: rgba(15, 23, 42, 0.1); }
html[data-theme="light"] .donut::after { background: #ffffff; box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.06); }
html[data-theme="light"] .donut { filter: drop-shadow(0 12px 24px rgba(15, 23, 42, 0.12)); }

/* ---------- rich-text editor ---------- */
html[data-theme="light"] .tox-tinymce,
html[data-theme="light"] .tox .tox-editor-header,
html[data-theme="light"] .tox .tox-toolbar-overlord,
html[data-theme="light"] .tox .tox-toolbar,
html[data-theme="light"] .tox .tox-toolbar__primary,
html[data-theme="light"] .tox .tox-menubar,
html[data-theme="light"] .tox .tox-statusbar {
  background-color: #f8fafc !important;
  background-image: none !important;
}
html[data-theme="light"] .tox .tox-edit-area__iframe { background: #ffffff !important; }
html[data-theme="light"] .tox .tox-toolbar__group { border-color: var(--line) !important; }
html[data-theme="light"] .tox .tox-tbtn { color: #44536a !important; }
html[data-theme="light"] .tox .tox-tbtn:hover,
html[data-theme="light"] .tox .tox-tbtn:focus { background: #e9eff7 !important; }
html[data-theme="light"] .tox .tox-tbtn--enabled,
html[data-theme="light"] .tox .tox-tbtn--enabled:hover { background: #dcece9 !important; }
html[data-theme="light"] .tox .tox-tbtn svg { fill: #526075; }
html[data-theme="light"] .tox .tox-tbtn--select,
html[data-theme="light"] .tox .tox-tbtn--bespoke { background: #ffffff !important; color: #44536a !important; }
html[data-theme="light"] .tox .tox-tbtn--select:hover,
html[data-theme="light"] .tox .tox-tbtn--bespoke:hover { background: #e9eff7 !important; }
html[data-theme="light"] .tox .tox-tbtn--select svg,
html[data-theme="light"] .tox .tox-tbtn--bespoke svg { fill: #526075; }
html[data-theme="light"] .tox .tox-tbtn__select-label { color: #44536a !important; }
html[data-theme="light"] .tox .tox-tbtn__select-chevron svg { fill: #7c8ba0; }
html[data-theme="light"] .tox .tox-menu,
html[data-theme="light"] .tox .tox-collection--list { background: #ffffff !important; border-color: var(--line-strong) !important; }
html[data-theme="light"] .tox .tox-collection__item { color: #2b3648 !important; }
html[data-theme="light"] .tox .tox-collection__item--active,
html[data-theme="light"] .tox .tox-collection__item:hover { background: #e9eff7 !important; }
html[data-theme="light"] .tox .tox-collection__item--selected { background: #dcece9 !important; color: #0f766e !important; }
html[data-theme="light"] .tox .tox-dialog { background: #ffffff !important; border-color: var(--line-strong) !important; }
html[data-theme="light"] .tox .tox-dialog__header,
html[data-theme="light"] .tox .tox-dialog__footer { background: #f8fafc !important; border-color: var(--line) !important; }
html[data-theme="light"] .tox .tox-dialog__title,
html[data-theme="light"] .tox .tox-dialog__body-content { color: #2b3648 !important; }
html[data-theme="light"] .tox .tox-label,
html[data-theme="light"] .tox .tox-form__group label { color: #44536a !important; }
html[data-theme="light"] .tox .tox-textfield,
html[data-theme="light"] .tox .tox-selectfield select,
html[data-theme="light"] .tox .tox-textarea { background: #ffffff !important; border-color: var(--line-strong) !important; color: #101828 !important; }
html[data-theme="light"] .tox .tox-tbtn:hover svg { fill: #0f172a; }
html[data-theme="light"] .tox .tox-tbtn--enabled svg { fill: #0f766e; }
html[data-theme="light"] .tox .tox-statusbar,
html[data-theme="light"] .tox .tox-statusbar a,
html[data-theme="light"] .tox .tox-statusbar__path-item,
html[data-theme="light"] .tox .tox-statusbar__wordcount { color: #5b6b80 !important; }
html[data-theme="light"] .tox .tox-statusbar__resize-handle svg { fill: #5b6b80 !important; }
html[data-theme="light"] .tox .tox-split-button:hover { box-shadow: 0 0 0 1px #cbd5e1 inset !important; }
html[data-theme="light"] .tox .tox-split-button .tox-tbtn--select { background: #ffffff !important; }

/* ---------- auth ---------- */
html[data-theme="light"] .auth-page { background: var(--bg); }
html[data-theme="light"] .auth-art {
  background:
    radial-gradient(80% 60% at 15% 10%, rgba(13, 148, 136, 0.16), transparent 55%),
    radial-gradient(70% 60% at 90% 80%, rgba(79, 70, 229, 0.12), transparent 60%),
    linear-gradient(160deg, #f0faf7, #f7f9fe 55%, #eef2fb);
}
html[data-theme="light"] .auth-art::before {
  background-image:
    linear-gradient(rgba(15, 23, 42, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15, 23, 42, 0.05) 1px, transparent 1px);
}
html[data-theme="light"] .auth-art-copy p { color: var(--muted); }
html[data-theme="light"] .auth-point { color: var(--text); }
html[data-theme="light"] .auth-art-copy h1 em,
html[data-theme="light"] .public-hero h1 em,
html[data-theme="light"] .error-code {
  background: linear-gradient(120deg, #0d9488, #0891b2 45%, #4f46e5);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
html[data-theme="light"] .auth-panel {
  background:
    radial-gradient(80% 60% at 100% 0%, rgba(79, 70, 229, 0.06), transparent 60%),
    #f7f9fe;
}
html[data-theme="light"] .auth-theme .icon-btn { background: #ffffff; }

/* ---------- public & errors ---------- */
html[data-theme="light"] .public-page {
  background:
    radial-gradient(70% 50% at 50% -10%, rgba(13, 148, 136, 0.12), transparent 60%),
    radial-gradient(60% 50% at 95% 20%, rgba(79, 70, 229, 0.09), transparent 60%),
    var(--bg);
}
html[data-theme="light"] .public-page::before {
  background-image:
    linear-gradient(rgba(15, 23, 42, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15, 23, 42, 0.05) 1px, transparent 1px);
}
html[data-theme="light"] .public-hero p { color: var(--muted); }
html[data-theme="light"] .public-perk { color: var(--text); }
html[data-theme="light"] .public-avatars .avatar { border-color: #ffffff; }
html[data-theme="light"] .public-form-card,
html[data-theme="light"] .result-card { box-shadow: 0 34px 80px -60px rgba(15, 23, 42, 0.45); }

/* Email previews and signatures always sit on white paper. */
html[data-theme="light"] .preview-viewport { background: #e9edf2; }
html[data-theme="light"] .tpl-paper { background: #fffdf9; }