/* The preference affects the CMS interface, never the website canvas or preview. */
html[data-admin-theme="light"] { color-scheme:light; }
html[data-admin-theme="light"] .studio-sidebar { background:#fff; border-right:1px solid #e3e5e8; }
html[data-admin-theme="light"] .sb-brand, html[data-admin-theme="light"] .ws-switcher-wrap, html[data-admin-theme="light"] .sb-user { border-color:#e3e5e8; }
html[data-admin-theme="light"] .sb-logo, html[data-admin-theme="light"] #sb-user-name { color:#202127!important; }
html[data-admin-theme="light"] .sb-logo-box { background:#202127; }
html[data-admin-theme="light"] .sb-section-title, html[data-admin-theme="light"] #sb-admin-section .sb-section-title { color:#73757e!important; }
html[data-admin-theme="light"] .sb-item { color:#565963; }
html[data-admin-theme="light"] .sb-item:hover { background:#f2f3f5; color:#191a1d; }
html[data-admin-theme="light"] .sb-item.active { background:#e9e9ed; color:#191a1d; }
html[data-admin-theme="light"] .sb-item.active .sb-icon { color:#34353b; }
html[data-admin-theme="light"] .sb-item .sb-badge { background:#e9e9ed; color:#51535c; }
html[data-admin-theme="light"] .ws-select, html[data-admin-theme="light"] .ws-add-btn, html[data-admin-theme="light"] .sb-quota { background:#f6f6f7; border-color:#e0e1e5; color:#24252a; }
html[data-admin-theme="light"] .sb-quota div[style*="color:#cbd5e1"] { color:#555761!important; }
html[data-admin-theme="light"] .studio-topbar, html[data-admin-theme="light"] body[data-studio-view="overview"] .studio-topbar { background:#fff; color:#202127; border-color:#e5e6e9; }
html[data-admin-theme="light"] .studio-topbar .plan-chip, html[data-admin-theme="light"] body[data-studio-view="overview"] .plan-chip { background:#f0f0f2; color:#5b5d65; }
html[data-admin-theme="light"] .studio-topbar .topbar-actions .s-btn, html[data-admin-theme="light"] body[data-studio-view="overview"] .topbar-actions .s-btn { background:#fff; color:#26272c; border-color:#d4d5da; }
html[data-admin-theme="light"] .studio-topbar .topbar-actions .s-btn-primary, html[data-admin-theme="light"] body[data-studio-view="overview"] .topbar-actions .s-btn-primary { background:#242529; color:#fff; border-color:#242529; }
html[data-admin-theme="light"] .studio-topbar .mob-menu-btn { background:#fff; color:#242529; border-color:#d4d5da; }
html[data-admin-theme="light"] body[data-studio-view="overview"] .studio-main, html[data-admin-theme="light"] body[data-studio-view="overview"] .studio-content, html[data-admin-theme="light"] body[data-studio-view="pages"] .studio-main, html[data-admin-theme="light"] body[data-studio-view="pages"] .studio-content { background:#f5f5f6; color:#25262a; }
html[data-admin-theme="light"] .davo-dashboard { color:#202127; }
html[data-admin-theme="light"] .dash-heading h2, html[data-admin-theme="light"] .dash-metric strong, html[data-admin-theme="light"] .dash-insights strong, html[data-admin-theme="light"] .dash-card-head h3 { color:#222327; }
html[data-admin-theme="light"] .dash-stat-strip, html[data-admin-theme="light"] .dash-card { background:#fff; border-color:#e2e3e6; }
html[data-admin-theme="light"] .dash-metric + .dash-metric, html[data-admin-theme="light"] .dash-insights, html[data-admin-theme="light"] .dash-insights > div + div, html[data-admin-theme="light"] .dash-table th, html[data-admin-theme="light"] .dash-table td { border-color:#e5e5e8; }
html[data-admin-theme="light"] .dash-metric small, html[data-admin-theme="light"] .dash-insights small { color:#595b61; }
html[data-admin-theme="light"] .dash-metric span, html[data-admin-theme="light"] .dash-insights > div > span, html[data-admin-theme="light"] .dash-page-title { color:#45464d; }
html[data-admin-theme="light"] .dash-table tbody tr:hover { background:#f6f6f7; }
html[data-admin-theme="light"] .dash-edit, html[data-admin-theme="light"] .dash-text-button, html[data-admin-theme="light"] .dash-insights a { color:#5b496c; }
html[data-admin-theme="light"] .dash-button-primary { background:#25262a; color:#fff; border-color:#25262a; }
html[data-admin-theme="light"] body[data-studio-view="pages"] .s-card { background:#fff; border-color:#e0e1e4; }
html[data-admin-theme="light"] body[data-studio-view="pages"] .s-table th { background:#f5f5f7; color:#5f626b; border-color:#e5e5e8; }
html[data-admin-theme="light"] body[data-studio-view="pages"] .s-table td { color:#303138; border-color:#e5e5e8; }
html[data-admin-theme="light"] body[data-studio-view="pages"] .s-table td div[style*="color:#0f172a"] { color:#25262a!important; }
html[data-admin-theme="light"] body[data-studio-view="pages"] .s-table td [style*="color:#64748b"], html[data-admin-theme="light"] body[data-studio-view="pages"] .s-table td[style*="color:#64748b"] { color:#676a73!important; }
html[data-admin-theme="light"] body[data-studio-view="pages"] .s-table tr:hover td { background:#f7f7f8; }
html[data-admin-theme="light"] body[data-studio-view="pages"] .s-btn, html[data-admin-theme="light"] body[data-studio-view="pages"] .s-input { background:#fff; border-color:#d4d5da; color:#28292d; }
html[data-admin-theme="light"] body[data-studio-view="pages"] .s-btn-primary { background:#292a2d; color:#fff; border-color:#292a2d; }
html[data-admin-theme="light"] body[data-studio-view="pages"] .s-btn-danger { color:#b23d49; border-color:#e9c5c8; }
html[data-admin-theme="light"] body[data-studio-view="pages"] .pill-pub { background:#ecfdf5; color:#087a50; border-color:#a7f3d0; }
html[data-admin-theme="light"] body[data-studio-view="pages"] .pill-draft { background:#fefce8; color:#9a5707; border-color:#fde68a; }
html[data-admin-theme="light"] body[data-studio-view="pages"] .pill-home, html[data-admin-theme="light"] body[data-studio-view="pages"] .pill-sub { background:#f1effa; color:#5a4b80; border-color:#dbd5eb; }
@media(max-width:680px) { html[data-admin-theme="light"] .sb-close-btn { color:#222; background:#f2f2f4; border-color:#d4d5da; } }
/* Dark workspace chrome and common admin controls. The visual editor and
   preview stay in their original colours so website content is not altered. */
html[data-admin-theme="dark"] body:not([data-studio-view="editor"]) .studio-main,
html[data-admin-theme="dark"] body:not([data-studio-view="editor"]) .studio-content { background:#101113; color:#e8e8ea; }
html[data-admin-theme="dark"] body:not([data-studio-view="editor"]) .s-card,
html[data-admin-theme="dark"] body:not([data-studio-view="editor"]) .stat-card { background:#191a1d; border-color:#34353a; color:#ededee; }
html[data-admin-theme="dark"] body:not([data-studio-view="editor"]) .s-label { color:#dedee2; }
html[data-admin-theme="dark"] body:not([data-studio-view="editor"]) .s-input,
html[data-admin-theme="dark"] body:not([data-studio-view="editor"]) .s-select,
html[data-admin-theme="dark"] body:not([data-studio-view="editor"]) .s-textarea { background:#212226; color:#f0f0f2; border-color:#42434a; }
html[data-admin-theme="dark"] body:not([data-studio-view="editor"]) .s-btn { background:#25262a; color:#ededee; border-color:#45464d; }
html[data-admin-theme="dark"] body:not([data-studio-view="editor"]) .s-btn:hover { background:#36373c; }
html[data-admin-theme="dark"] body:not([data-studio-view="editor"]) .s-btn-primary { background:#efeff0; border-color:#efeff0; color:#1b1b1e; }
html[data-admin-theme="dark"] body:not([data-studio-view="editor"]) .s-btn-danger { color:#f4a2aa; border-color:#71474e; }
html[data-admin-theme="dark"] body:not([data-studio-view="editor"]) .s-table th { background:#1c1d21; color:#b9bac0; border-color:#34353a; }
html[data-admin-theme="dark"] body:not([data-studio-view="editor"]) .s-table td { color:#e0e0e3; border-color:#34353a; }
html[data-admin-theme="dark"] body:not([data-studio-view="editor"]) .s-table tr:hover td { background:#25262a; }
html[data-admin-theme="dark"] .s-nav-group { background:#202125; border-color:#3b3c43; }
html[data-admin-theme="dark"] .s-subnav-wrap { border-color:#67617d; }
html[data-admin-theme="dark"] body:not([data-studio-view="editor"]) .studio-content p[style*="color:#64748b"],
html[data-admin-theme="dark"] body:not([data-studio-view="editor"]) .studio-content div[style*="color:#64748b"] { color:#aeb0b8!important; }
html[data-admin-theme="dark"] body:not([data-studio-view="editor"]) .s-subnav-wrap div[style*="color:#4f46e5"] { color:#bfb5ff!important; }
html[data-admin-theme="light"] .dash-chart path[stroke="#29282d"] { stroke:#e2e2e6; }
html[data-admin-theme="light"] .dash-progress, html[data-admin-theme="light"] .quota-bar { background:#e1e1e5; }
html[data-admin-theme="light"] body[data-studio-view="overview"] .sb-item { color:#565963; }
html[data-admin-theme="light"] body[data-studio-view="overview"] .sb-item.active { background:#e9e9ed; color:#191a1d; }

/* Super-admin panels set their own light backgrounds and slate text in the
   markup, so they need explicit dark values. Added after the light/grey text
   on near-white panels in the super-admin view was reported. */
html[data-admin-theme="dark"] body:not([data-studio-view="editor"]) [style*="background:#f8fafc"] {
  background: #1e1f23 !important;
  border-color: #3a3b41 !important;
  color: #e7e7ea !important;
}
html[data-admin-theme="dark"] body:not([data-studio-view="editor"]) [style*="color:#64748b"],
html[data-admin-theme="dark"] body:not([data-studio-view="editor"]) [style*="color:#94a3b8"] {
  color: #b9bbc3 !important;
}
html[data-admin-theme="dark"] body:not([data-studio-view="editor"]) [style*="color:#4f46e5"] {
  color: #a5b4fc !important;
}
html[data-admin-theme="dark"] body:not([data-studio-view="editor"]) [style*="background:#f8fafc"] .s-label,
html[data-admin-theme="dark"] body:not([data-studio-view="editor"]) [style*="background:#f8fafc"] strong {
  color: #dedee2 !important;
}
/* The same muted slate is too faint on the light workspace panels. */
html[data-admin-theme="light"] body:not([data-studio-view="editor"]) [style*="color:#94a3b8"],
html[data-admin-theme="light"] .ws-label,
html[data-admin-theme="light"] #sb-user-role {
  color: #5f636b !important;
}
/* Revenue figure: emerald-500 is too pale on the light workspace. */
html[data-admin-theme="light"] .stat-val[style*="color:#10b981"] { color: #047857 !important; }

/* Dark: primary actions and status chips still carried their light-theme
   tints, so the main buttons read as pale blocks on a dark panel. */
html[data-admin-theme="dark"] body:not([data-studio-view="editor"]) .s-btn-primary {
  background: #4f46e5 !important;
  border-color: #4f46e5 !important;
  color: #ffffff !important;
}
html[data-admin-theme="dark"] body:not([data-studio-view="editor"]) .s-btn-primary:hover {
  background: #6366f1 !important;
  border-color: #6366f1 !important;
}
html[data-admin-theme="dark"] body:not([data-studio-view="editor"]) .pill-pub,
html[data-admin-theme="dark"] body:not([data-studio-view="editor"]) .pill-draft,
html[data-admin-theme="dark"] body:not([data-studio-view="editor"]) .pill-home,
html[data-admin-theme="dark"] body:not([data-studio-view="editor"]) .pill-sub {
  background: #24262c !important;
  border-color: #3f4149 !important;
}
html[data-admin-theme="dark"] body:not([data-studio-view="editor"]) .pill-pub { color: #6ee7b7 !important; }
html[data-admin-theme="dark"] body:not([data-studio-view="editor"]) .pill-draft { color: #fcd34d !important; }
html[data-admin-theme="dark"] body:not([data-studio-view="editor"]) .pill-home,
html[data-admin-theme="dark"] body:not([data-studio-view="editor"]) .pill-sub { color: #c4b5fd !important; }
html[data-admin-theme="dark"] body:not([data-studio-view="editor"]) .stat-label,
html[data-admin-theme="dark"] body:not([data-studio-view="editor"]) .stat-sub,
html[data-admin-theme="dark"] body:not([data-studio-view="editor"]) .s-card code {
  color: #9ca1a8 !important;
}

html[data-admin-theme="dark"] .sb-section-title,
html[data-admin-theme="dark"] #sb-admin-section .sb-section-title { color: #8f919a !important; }

/* Light: the muted slate and status greens/reds sat just under the readable
   threshold on the pale workspace panels. */
html[data-admin-theme="light"] body:not([data-studio-view="editor"]) .stat-label,
html[data-admin-theme="light"] body:not([data-studio-view="editor"]) .stat-sub,
html[data-admin-theme="light"] body:not([data-studio-view="editor"]) .s-table th,
html[data-admin-theme="light"] body:not([data-studio-view="editor"]) [style*="color:#64748b"],
html[data-admin-theme="light"] body:not([data-studio-view="editor"]) [style*="color:#94a3b8"] {
  color: #5c6068 !important;
}
html[data-admin-theme="light"] body:not([data-studio-view="editor"]) [style*="color:#059669"],
html[data-admin-theme="light"] body:not([data-studio-view="editor"]) .pill-pub {
  color: #047857 !important;
}
html[data-admin-theme="light"] body:not([data-studio-view="editor"]) .s-btn-danger {
  color: #b91c1c !important;
  border-color: #f2c7c7 !important;
}

/* Accent levels, studied against the Adminator reference template.
   The solid fill stays a mid blue in both themes so it keeps its contrast
   with white text. Everything else shifts level: text, links and the active
   nav item use a lighter blue on dark panels and a deeper blue on light
   ones, and soft tints swap between a deep navy and a pale wash. */
html[data-admin-theme="light"] body:not([data-studio-view="editor"]) {
  --s-primary: #2563eb;
  --s-primary-hover: #1d4ed8;
  --s-primary-soft: #eff6ff;
}
html[data-admin-theme="dark"] body:not([data-studio-view="editor"]) {
  --s-primary: #2563eb;
  --s-primary-hover: #1d4ed8;
  --s-primary-soft: #0f2847;
}
html[data-admin-theme="light"] body:not([data-studio-view="editor"]) .s-btn-primary,
html[data-admin-theme="dark"] body:not([data-studio-view="editor"]) .s-btn-primary {
  background: #2563eb !important;
  border-color: #2563eb !important;
  color: #ffffff !important;
}
html[data-admin-theme="light"] body:not([data-studio-view="editor"]) .s-btn-primary:hover,
html[data-admin-theme="dark"] body:not([data-studio-view="editor"]) .s-btn-primary:hover {
  background: #1d4ed8 !important;
  border-color: #1d4ed8 !important;
}
html[data-admin-theme="light"] body:not([data-studio-view="editor"]) .dash-edit,
html[data-admin-theme="light"] body:not([data-studio-view="editor"]) .dash-text-button,
html[data-admin-theme="light"] body:not([data-studio-view="editor"]) .dash-insights a,
html[data-admin-theme="light"] body:not([data-studio-view="editor"]) [style*="color:#4f46e5"] {
  color: #1d4ed8 !important;
}
html[data-admin-theme="dark"] body:not([data-studio-view="editor"]) .dash-edit,
html[data-admin-theme="dark"] body:not([data-studio-view="editor"]) .dash-text-button,
html[data-admin-theme="dark"] body:not([data-studio-view="editor"]) .dash-insights a,
html[data-admin-theme="dark"] body:not([data-studio-view="editor"]) [style*="color:#4f46e5"] {
  color: #93c5fd !important;
}
html[data-admin-theme="dark"] .sb-item.active {
  background: #0f2847 !important;
  color: #93c5fd !important;
  box-shadow: inset 3px 0 0 #2563eb;
}
html[data-admin-theme="dark"] body:not([data-studio-view="editor"]) .pill-pub {
  background: #0f2a20 !important; border-color: #1c4a37 !important; color: #34d399 !important;
}
html[data-admin-theme="dark"] body:not([data-studio-view="editor"]) .pill-draft {
  background: #2b1f08 !important; border-color: #4a3a12 !important; color: #fbbf24 !important;
}
html[data-admin-theme="dark"] body:not([data-studio-view="editor"]) .pill-home,
html[data-admin-theme="dark"] body:not([data-studio-view="editor"]) .pill-sub {
  background: #1e1a2c !important; border-color: #362f4d !important; color: #a78bfa !important;
}
html[data-admin-theme="dark"] body:not([data-studio-view="editor"]) .s-btn-danger {
  background: #2b1414 !important; border-color: #4a2323 !important; color: #f87171 !important;
}

/* Muted text levels, same idea as the reference: mid slate on light panels,
   light slate on dark ones, so secondary text reads without shouting. */
html[data-admin-theme="light"] body:not([data-studio-view="editor"]) {
  --s-muted: #5c6068;
}
html[data-admin-theme="dark"] body:not([data-studio-view="editor"]) {
  --s-muted: #94a3b8;
}
html[data-admin-theme="light"] body:not([data-studio-view="editor"]) .dash-kicker,
html[data-admin-theme="light"] body:not([data-studio-view="editor"]) .dash-date,
html[data-admin-theme="light"] body:not([data-studio-view="editor"]) .dash-home,
html[data-admin-theme="light"] body:not([data-studio-view="editor"]) .dash-status,
html[data-admin-theme="light"] body:not([data-studio-view="editor"]) .dash-muted {
  color: #5c6068 !important;
}
html[data-admin-theme="light"] .dash-home { border-color: #d7d8dd !important; }
html[data-admin-theme="dark"] body:not([data-studio-view="editor"]) .dash-kicker,
html[data-admin-theme="dark"] body:not([data-studio-view="editor"]) .dash-date,
html[data-admin-theme="dark"] body:not([data-studio-view="editor"]) .dash-home,
html[data-admin-theme="dark"] body:not([data-studio-view="editor"]) .dash-status,
html[data-admin-theme="dark"] body:not([data-studio-view="editor"]) .dash-muted,
html[data-admin-theme="dark"] body:not([data-studio-view="editor"]) .stat-label,
html[data-admin-theme="dark"] body:not([data-studio-view="editor"]) .stat-sub,
html[data-admin-theme="dark"] body:not([data-studio-view="editor"]) .s-table th,
html[data-admin-theme="dark"] body:not([data-studio-view="editor"]) .s-card code,
html[data-admin-theme="dark"] body:not([data-studio-view="editor"]) small {
  color: #94a3b8 !important;
}
html[data-admin-theme="light"] body:not([data-studio-view="editor"]) .dash-table th,
html[data-admin-theme="light"] body:not([data-studio-view="editor"]) .dash-table td small,
html[data-admin-theme="light"] body:not([data-studio-view="editor"]) .davo-dashboard p,
html[data-admin-theme="light"] body:not([data-studio-view="editor"]) .dash-card small {
  color: #5c6068 !important;
}
html[data-admin-theme="dark"] body:not([data-studio-view="editor"]) .dash-table th,
html[data-admin-theme="dark"] body:not([data-studio-view="editor"]) .dash-table td small,
html[data-admin-theme="dark"] body:not([data-studio-view="editor"]) .dash-card small {
  color: #94a3b8 !important;
}

/* Media library: the cards and their checkerboard thumbnails were left with
   their light-theme values, so filenames were near-invisible in dark mode. */
html[data-admin-theme="dark"] body:not([data-studio-view="editor"]) .media-card {
  background: #191a1d !important;
  border-color: #34353a !important;
}
html[data-admin-theme="dark"] body:not([data-studio-view="editor"]) .media-thumb {
  background: repeating-conic-gradient(#202126 0% 25%, #17181b 0% 50%) 50% / 16px 16px !important;
}
html[data-admin-theme="dark"] body:not([data-studio-view="editor"]) .media-meta {
  background: #191a1d !important;
  border-color: #34353a !important;
}
html[data-admin-theme="dark"] body:not([data-studio-view="editor"]) .media-name { color: #e8e8ea !important; }
html[data-admin-theme="dark"] body:not([data-studio-view="editor"]) .media-sub { color: #94a3b8 !important; }
html[data-admin-theme="dark"] body:not([data-studio-view="editor"]) [style*="background:#fff"] {
  background: #191a1d !important;
  border-color: #34353a !important;
  color: #e6e6e9 !important;
}
html[data-admin-theme="dark"] body:not([data-studio-view="editor"]) .dropzone {
  background: #191a1d !important;
  border-color: #3a3b41 !important;
  color: #e8e8ea !important;
}
html[data-admin-theme="dark"] body:not([data-studio-view="editor"]) [style*="color:#475569"],
html[data-admin-theme="dark"] body:not([data-studio-view="editor"]) [style*="color:#334155"] {
  color: #c3c7cf !important;
}
html[data-admin-theme="dark"] body:not([data-studio-view="editor"]) [style*="color:#0f172a"],
html[data-admin-theme="dark"] body:not([data-studio-view="editor"]) [style*="color:#1e293b"] {
  color: #e8e8ea !important;
}
html[data-admin-theme="light"] body:not([data-studio-view="editor"]) .davo-dashboard small,
html[data-admin-theme="light"] body:not([data-studio-view="editor"]) .dash-axis { color: #5c6068 !important; }
html[data-admin-theme="dark"] body:not([data-studio-view="editor"]) .dash-axis { color: #94a3b8 !important; }

/* Print / save-as-PDF for the website health report */
@media print {
  .studio-sidebar, .sb-backdrop, .studio-topbar, .s-btn, .pg-action, .dash-text-button { display: none !important; }
  .studio-body, .studio-content, .studio-main { background: #fff !important; padding: 0 !important; }
  .studio-main, .studio-main * { color: #111 !important; background-color: transparent !important; box-shadow: none !important; }
  .s-card, .s-table, .s-table th, .s-table td, .dash-metric { border-color: #d4d4d8 !important; }
  .s-card { break-inside: avoid; }
  a[href]::after { content: ""; }
}

/* Analytics: a confirmation green that stays legible in both themes */
.an-on { color: #047857; }
html[data-admin-theme="dark"] .an-on { color: #6ee7b7; }
