/* =====================================================================
   Fond blanc pour tout l'espace privé, quel que soit le thème.
   Chaque thème (Violet, Graphite, Océan, Forêt) ne change plus que la couleur d'accent.
   Ce fichier est chargé en dernier : il remplace les valeurs sombres définies dans shell.css.
   ===================================================================== */

html:has(body.shell), html[data-theme]:has(body.shell) { background: #ffffff !important; }

/* ---------- Couleurs de base (communes à tous les thèmes) ---------- */
html body.shell, html[data-theme] body.shell {
  color-scheme: light;
  --base: #ffffff; --cream: #ffffff;
  --ink: #1b1830; --ink-soft: #5b5870; --d-ink: #1b1830; --d-soft: #5b5870; --d-mute: #8c899c;
  --ln-rgb: 48, 40, 92; --cd-rgb: 255, 255, 255;
  --border: rgba(48, 40, 92, 0.13);
  --card: #ffffff; --d-card: #ffffff; --d-line: rgba(48, 40, 92, 0.10);
  --glass: rgba(48, 40, 92, 0.035);
  --tip-bg: #ffffff; --toast-bg: #1b1830;
  --d-up: #15803d; --d-down: #dc2626; --ok: #15803d; --warn: #b45309;
  --lt-shadow: 0 1px 2px rgba(27, 24, 48, 0.05), 0 8px 24px rgba(27, 24, 48, 0.06);
  background: #ffffff;
  background-attachment: scroll;
}

/* ---------- Couleur d'accent de chaque thème (versions lisibles sur fond blanc) ---------- */
html body.shell, html:not([data-theme]) body.shell, html[data-theme="violet"] body.shell {
  --pink: #a21caf; --violet: #7e22ce; --accent: #a21caf; --d-blue: #7e22ce;
  --d-blue-soft: rgba(147, 51, 234, 0.10);
  --pz-rgb: 192, 38, 211; --pz-ink: #a21caf; --tm-rgb: 126, 34, 206; --tm: #7e22ce;
  --acc: #9333ea; --acc-ink: #7e22ce; --acc-soft: rgba(147, 51, 234, 0.10); --acc-rgb: 147, 51, 234;
}
html[data-theme="graphite"] body.shell {
  --pink: #475569; --violet: #475569; --accent: #475569; --d-blue: #475569;
  --d-blue-soft: rgba(71, 85, 105, 0.10);
  --grad: linear-gradient(135deg, #475569 0%, #64748b 100%);
  --pz-rgb: 71, 85, 105; --pz-ink: #334155; --tm-rgb: 51, 65, 85; --tm: #334155;
  --acc: #475569; --acc-ink: #334155; --acc-soft: rgba(71, 85, 105, 0.10); --acc-rgb: 71, 85, 105;
  --a1-rgb: 71, 85, 105; --a2-rgb: 100, 116, 139; --av-rgb: 100, 116, 139; --bar1: #94a3b8; --bar2: #64748b;
}
html[data-theme="ocean"] body.shell {
  --pink: #0f766e; --violet: #0369a1; --accent: #0f766e; --d-blue: #0369a1;
  --d-blue-soft: rgba(3, 105, 161, 0.10);
  --pz-rgb: 13, 148, 136; --pz-ink: #0f766e; --tm-rgb: 3, 105, 161; --tm: #0369a1;
  --acc: #0284c7; --acc-ink: #0369a1; --acc-soft: rgba(2, 132, 199, 0.10); --acc-rgb: 2, 132, 199;
}
html[data-theme="foret"] body.shell {
  --pink: #4d7c0f; --violet: #15803d; --accent: #4d7c0f; --d-blue: #15803d;
  --d-blue-soft: rgba(21, 128, 61, 0.10);
  --pz-rgb: 77, 124, 15; --pz-ink: #3f6212; --tm-rgb: 21, 128, 61; --tm: #166534;
  --acc: #16a34a; --acc-ink: #15803d; --acc-soft: rgba(22, 163, 74, 0.10); --acc-rgb: 22, 163, 74;
}

/* ---------- Menu de gauche ---------- */
body.shell .sb { background: #ffffff; backdrop-filter: none; border-right: 1px solid var(--border); }
.sb-logo img { filter: none; }
.sb-link:hover, .sb-shop:hover, .sb-sub:hover { background: var(--acc-soft); color: var(--ink); }
.sb-link.is-active { color: var(--acc-ink); background: var(--acc-soft); border-color: rgba(var(--acc-rgb), 0.28); box-shadow: none; }
.sb-link.is-active svg, .sb-sub.is-active svg { color: var(--acc-ink); }
.sb-shop.is-open { color: var(--ink); }
.sb-sub.is-active { color: var(--acc-ink); background: var(--acc-soft); }
.sb-health.is-open { background: var(--acc-soft); }
.sb-shop.is-open .sb-shop-dot { box-shadow: none; }
.sb-logout:hover { color: #dc2626; background: rgba(220, 38, 38, 0.08); }

/* ---------- Cartes et boutons ---------- */
body.shell .timer-card, body.shell .report-card, body.shell .d-card, body.shell .set-card, .set-hero {
  background: #ffffff; border-color: var(--border); box-shadow: var(--lt-shadow); backdrop-filter: none;
}
body.shell .btn-dark { box-shadow: 0 6px 18px rgba(var(--acc-rgb), 0.28); }
body.shell .btn-light, body.shell .btn-icon { background: #ffffff; }
body.shell .status-chip { background: #ffffff; }
body.shell .status-dot { background: #a8a5b8; }
body.shell .status-chip[data-state="running"] { color: #15803d; border-color: rgba(21, 128, 61, 0.35); background: rgba(21, 128, 61, 0.08); }
body.shell .status-chip[data-state="paused"] { color: #b45309; border-color: rgba(180, 83, 9, 0.35); background: rgba(180, 83, 9, 0.08); }
body.shell .timer-display { text-shadow: none; }
body.shell .seg-delete { color: #8c899c; }
body.shell .seg-delete:hover { color: #dc2626; }
body.shell .bar { background: rgba(48, 40, 92, 0.09); }
body.shell .week-totals li .w-bar { background: rgba(48, 40, 92, 0.09); }
body.shell .m-day.is-today { box-shadow: 0 0 0 2px var(--acc); }
body.shell .manual-form input, body.shell .m-fields input, body.shell .d-custom input, body.shell .decl-pick select,
.set-form input { background: #ffffff; color: var(--ink); }
body.shell .toast { color: #ffffff; border-color: transparent; }
.form-error { color: #dc2626; } .form-error.is-ok { color: #15803d; }
.bk-drive-text span.ko, .bk-actions .ko, .bk-err { color: #dc2626; }

/* ---------- Pages boutiques (tableau de bord, marges, déclaration, santé) ---------- */
body.shell .d-seg { background: #ffffff; }
body.shell .d-seg button.on { background: var(--acc-soft); color: var(--acc-ink); }
body.shell .d-tag { color: #b45309; background: rgba(180, 83, 9, 0.10); }
body.shell .d-tip { box-shadow: 0 10px 30px rgba(27, 24, 48, 0.16); }
body.shell .d-error { background: rgba(220, 38, 38, 0.08); color: #b91c1c; }
body.shell .d-decl { background: #ffffff; }
body.shell .d-decl:hover { color: var(--ink); }
body.shell .d-kpi.d-profit, body.shell .m-hero { background: rgba(21, 128, 61, 0.07); border-color: rgba(21, 128, 61, 0.25); }
body.shell .d-kpi.d-profit:hover { background: rgba(21, 128, 61, 0.12); }
body.shell .d-kpi.d-profit .l, body.shell .d-kpi.d-profit .s, body.shell .m-hero .lbl { color: #15803d; }
body.shell .d-kpi.d-profit .v, body.shell .m-hero .big { color: #166534; }
body.shell .d-kpi.d-profit.neg, body.shell .m-hero.neg { background: rgba(220, 38, 38, 0.07); border-color: rgba(220, 38, 38, 0.28); }
body.shell .d-kpi.d-profit.neg .l, body.shell .d-kpi.d-profit.neg .s, body.shell .m-hero.neg .lbl { color: #b91c1c; }
body.shell .d-kpi.d-profit.neg .v, body.shell .m-hero.neg .big { color: #991b1b; }
body.shell .m-warn { background: rgba(180, 83, 9, 0.08); border-color: rgba(180, 83, 9, 0.3); color: #92400e; }
body.shell .decl-table td.neg, body.shell .m-ko, body.shell .s-actions .ko, body.shell .s-error .s-msg { color: #b91c1c; }
body.shell .decl-table td.pos, body.shell .m-ok, body.shell .s-actions .ok { color: #15803d; }
body.shell .s-sum.ok { color: #15803d; background: rgba(21, 128, 61, 0.10); }
body.shell .s-sum.bad { color: #b91c1c; background: rgba(220, 38, 38, 0.10); }
body.shell .s-warn .s-dot { background: #d97706; }

/* ---------- Bouton de thème ---------- */
body.shell .theme-fab { background: #ffffff; box-shadow: 0 6px 20px rgba(27, 24, 48, 0.16); }
.theme-pop { background: #ffffff; box-shadow: 0 14px 40px rgba(27, 24, 48, 0.18); }
.theme-dots i { border-color: rgba(27, 24, 48, 0.18); }
