/* Thème clair par défaut, thème sombre si le système le préfère */
:root { --bg: #ffffff; --fg: #1a1a1a; --border: #e0e0e0; --border-accent: #244b47; --accent: #48a69d; --sidebar-bg: #f5f5f5; --group-bg: #f5f5f5; --danger: #dc2626; --success: #16a34a; --root-actions-bg: #ffffff; --root-actions-fg: #151515; --root-actions-hover-bg: #333; --root-actions-hover-fg: #ffffff; }

@media (prefers-color-scheme: dark) {
    :root { --bg: #222222; --fg: #e5e5e5; --border: #3a3a3a; --border-accent: #244b47; --accent: #48a69d; --sidebar-bg: #252526; --group-bg: #2c2d2e; --danger: #f87171; --success: #4ade80; --root-actions-bg: #151515; --root-actions-fg: #ffffff; --root-actions-hover-bg: #ffffff; --root-actions-hover-fg: #151515; }
}

/* La bascule manuelle (theme.js) gagne toujours sur la préférence système */
:root[data-theme="light"] { --bg: #ffffff; --fg: #1a1a1a; --border: #e0e0e0; --border-accent: #244b47; --accent: #48a69d; --sidebar-bg: #f5f5f5; --group-bg: #f5f5f5; --danger: #dc2626; --success: #16a34a; --root-actions-bg: #ffffff; --root-actions-fg: #151515; --root-actions-hover-bg: #333; --root-actions-hover-fg: #ffffff; }
:root[data-theme="dark"] { --bg: #222222; --fg: #e5e5e5; --border: #3a3a3a; --border-accent: #244b47; --accent: #48a69d; --sidebar-bg: #252526; --group-bg: #2c2d2e; --danger: #f87171; --success: #4ade80; --root-actions-bg: #151515; --root-actions-fg: #ffffff; --root-actions-hover-bg: #ffffff; --root-actions-hover-fg: #151515; }

/* Icône soleil/lune du bouton de bascule : une seule visible selon le thème actif */
.theme-icon-dark { display: none; }
:root[data-theme="dark"] .theme-icon-light { display: none; }
:root[data-theme="dark"] .theme-icon-dark { display: inline-flex; }
