@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Source+Serif+4:opsz,wght@8..60,500;8..60,600;8..60,700&family=Roboto:wght@400;500;700;900&display=swap");

/* Système multi-thème (docs/v4/CHANTIER_REFONTE_DESIGN.md, chantier
   2026-08-03 ; thème "terracotta" retiré le 2026-08-08, plus jamais utilisé) :
   2 identités visuelles ("apex" = défaut/:root, inspiré d'un dashboard SaaS
   sombre fourni par le porteur du projet, "google" = inspiré des applications
   Google/Material), chacune déclinée en clair + sombre = 4 jeux de tokens au
   total, sélectionnés via deux attributs indépendants sur <html> : [data-brand]
   (global, imposé par l'admin, stocké dans config/main.uiTheme, voir app.js
   applyBrandTheme()) et [data-theme] (individuel, déjà existant, stocké dans
   localStorage). Seule cette section définit des couleurs : modules/company/
   style.css et articles/style.css ne codent plus aucune couleur en dur, ils
   pointent tous vers ces variables (var(--text), var(--primary), etc.) pour ne
   jamais diverger d'un thème à l'autre. --success/--warning/--danger restent
   volontairement hors de la déclinaison par marque (une erreur doit rester
   rouge, un succès vert, quel que soit le thème visuel actif).
   --story-bg/--story-bg-2 : les quelques panneaux décoratifs "toujours
   sombres" (bandeau hero du site public, panneau gauche des pages Auth,
   carte d'accroche du tableau de bord, etc.) qui ne basculent PAS avec
   [data-theme] — seulement avec la marque active, comme une plaque de
   couleur de marque plutôt qu'une zone de contenu normale. */
:root {
  --app-bg: #f4f6fb;
  --surface: #ffffff;
  --surface-muted: #eef1f8;
  --surface-elevated: #ffffff;
  --surface-border: #e2e6f0;
  --surface-border-strong: #cbd2e6;
  --text: #111827;
  --text-muted: #5b6472;
  --primary: #4f6ef7;
  --primary-hover: #3f59d9;
  --primary-container: #e6eaff;
  /* Distincte de --primary : sert uniquement aux textes accentués
     (.text-emerald-600/700, alias visuel de l'accent de marque). Avant
     cette séparation, un même bouton avec un fond ET un texte de la même
     couleur devenait illisible — voir docs/v4/CAHIER_DES_CHARGES_V4.md,
     chantier 2026-08-02. */
  --primary-text: #3f59d9;
  --success: #16a34a;
  --success-container: #dcfce7;
  --warning: #d97706;
  --danger: #dc2626;
  --success-rgb: 22, 163, 74;
  --warning-rgb: 217, 119, 6;
  --danger-rgb: 220, 38, 38;
  --shadow-sm: 0 1px 2px rgba(17, 24, 39, 0.06), 0 1px 3px rgba(17, 24, 39, 0.05);
  --shadow-md: 0 12px 24px rgba(17, 24, 39, 0.08), 0 4px 10px rgba(17, 24, 39, 0.05);
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 26px;
  --transition: 180ms cubic-bezier(0.2, 0.8, 0.2, 1);
  --font-display: var(--font-body);
  --font-body: "Inter", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --primary-rgb: 79, 110, 247;
  --app-bg-rgb: 244, 246, 251;
  --text-rgb: 17, 24, 39;
  --story-bg: #0b0f1a;
  --story-bg-2: #1b2650;
  --story-bg-rgb: 11, 15, 26;
  /* Trio catégoriel dédié aux graphiques Chart.js (shared/finance-trend-chart.js) :
     --success/--danger existent déjà mais leur rouge/vert échoue le contrôle
     de séparation daltonisme (ΔE 5.0 < 6 requis, script dataviz) une fois
     posés côte à côte sur un même graphique — --danger reste donc réservé aux
     messages d'erreur, pas aux séries de graphique. Trio validé
     (node scripts/validate_palette.js, skill dataviz) pour les 4 combinaisons
     marque×thème de ce fichier. */
  --chart-inflow: #0086ab;
  --chart-outflow: #d97706;
  --chart-line: #4f6ef7;
}

html,
body {
  font-family: var(--font-body);
  color: var(--text);
  background: radial-gradient(
    circle at top,
    rgba(var(--primary-rgb), 0.05) 0%,
    var(--app-bg) 48%,
    rgba(var(--primary-rgb), 0.03) 100%
  );
}

body {
  min-height: 100vh;
}

button,
input,
select,
textarea {
  font: inherit;
}

input,
select,
textarea {
  appearance: none;
  background: var(--surface-muted);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  color: var(--text);
  transition:
    border-color var(--transition),
    background-color var(--transition),
    box-shadow var(--transition);
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary);
  background: var(--surface);
  box-shadow: 0 0 0 3px rgba(201, 51, 25, 0.14);
}

.gm-surface {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

.gm-muted {
  color: var(--text-muted);
}

.gm-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-weight: 600;
  transition:
    background-color var(--transition),
    border-color var(--transition),
    color var(--transition),
    transform var(--transition),
    box-shadow var(--transition);
}

.gm-button:hover {
  transform: translateY(-1px);
}

.gm-button-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 8px 18px rgba(201, 51, 25, 0.22);
}

.gm-button-primary:hover {
  background: var(--primary-hover);
}

.gm-button-secondary {
  background: var(--surface-muted);
  color: var(--text);
  border-color: var(--surface-border);
}

.gm-button-secondary:hover {
  background: var(--surface-elevated);
}

.gm-button-outline {
  background: transparent;
  color: var(--text);
  border-color: var(--surface-border-strong);
}

.gm-btn-primary {
  background: var(--primary);
  color: #fff;
}

.gm-btn-primary:hover {
  background: var(--primary-hover);
}

.gm-badge-valid {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border-radius: 999px;
  background: var(--success-container);
  color: var(--success);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.65rem;
}

.app-card,
.rounded-\[28px\].border.border-slate-200.bg-white,
.rounded-\[32px\].border.border-slate-200.bg-white {
  background: var(--surface) !important;
  border-color: var(--surface-border) !important;
  box-shadow: var(--shadow-sm) !important;
}

/* Chantier 2026-08-02 (docs/v4/CHANTIER_REFONTE_DESIGN.md) : exigence
   explicite du porteur du projet — une carte ne doit jamais imposer sa
   hauteur aux autres cartes de sa grille. CSS Grid étire ses enfants par
   défaut (align-items:stretch implicite) ; on neutralise ce comportement
   uniquement sur les grilles qui contiennent des cartes (signature déjà
   utilisée dans tout le projet : rounded-[28px]/[32px]/3xl + border, ou un
   <article>), pour ne pas toucher aux grilles de mise en page (formulaires,
   colonnes de texte) qui, elles, veulent parfois s'étirer. */
.grid:has(> .rounded-\[28px\]),
.grid:has(> .rounded-\[32px\]),
.grid:has(> article),
.grid:has(> .rounded-3xl.border) {
  align-items: start;
}

/* Chantier navigation 2026-08-08 : les tuiles KPI (shared/kpi-tiles.js) sont
   soit des <article>, soit des <button> quand elles sont cliquables — le
   sélecteur ci-dessus ne matche jamais les tuiles cliquables (aucune classe
   rounded-3xl/28px/32px, tag "button" pas "article"), donc l'étirement en
   hauteur restait un problème pour elles. Une grille Tailwind à colonnes
   fixes (grid-cols-N, pistes en 1fr) laisse en plus une dernière rangée
   incomplète collée à gauche, car justify-content n'a aucun effet sur des
   pistes qui occupent déjà toute la largeur. Passer ces conteneurs en
   flexbox centré résout les deux problèmes d'un coup, sans toucher aux
   grilles génériques (formulaires, tableaux) du reste de l'app. */
.kpi-tile-grid {
  display: flex !important;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-start;
}
.kpi-tile-grid > * {
  flex: 1 1 260px;
  max-width: 340px;
}

/* Sélecteur de thème visuel (Administration > Paramètres généraux, voir
   admin/sections/config.html + admin/index.js). Le radio réel reste
   accessible (.sr-only) ; :has() bascule l'apparence de la vignette
   englobante — même technique que la règle de grille de cartes ci-dessus. */
.theme-swatch-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem;
  border: 2px solid var(--surface-border);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: border-color var(--transition);
}
.theme-swatch-option:has(input:checked) {
  border-color: var(--primary);
}
.theme-swatch {
  display: block;
  width: 100%;
  height: 2.5rem;
  border-radius: var(--radius-md);
}
.theme-swatch-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-align: center;
  color: var(--text);
}
.theme-swatch-label small {
  display: block;
  margin-top: 0.15rem;
  font-weight: 400;
  color: var(--text-muted);
}

/* Grille de permissions (modal "Permissions" par utilisateur, admin/index.js,
   et éditeur de rôle, roles/index.js, voir shared/permissions.js) : la case
   native est cachée (.sr-only) au profit d'une ligne entière qui se surligne
   quand elle est cochée — même technique que .theme-swatch-option ci-dessus,
   nécessaire ici car une grille dense de 20+ cases à cocher rendait très
   difficile de repérer ce qui était sélectionné. */
.permission-check-option {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.5rem 0.7rem;
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 0.875rem;
  color: var(--text);
  transition: background var(--transition), border-color var(--transition);
}
.permission-check-option:has(input:checked) {
  background: rgba(var(--primary-rgb), 0.12);
  border-color: var(--primary);
  font-weight: 600;
}
.permission-check-option:has(input:focus-visible) {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}
.permission-check-box {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.15rem;
  height: 1.15rem;
  flex-shrink: 0;
  border: 2px solid var(--surface-border);
  border-radius: 0.35rem;
  transition: background var(--transition), border-color var(--transition);
}
.permission-check-option:has(input:checked) .permission-check-box {
  background: var(--primary);
  border-color: var(--primary);
}
.permission-check-box::after {
  content: "";
  width: 0.28rem;
  height: 0.52rem;
  border: solid var(--primary-text);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) translate(-1px, -1px);
  opacity: 0;
  transition: opacity var(--transition);
}
.permission-check-option:has(input:checked) .permission-check-box::after {
  opacity: 1;
}

.bg-slate-50,
.bg-slate-100 {
  background: var(--surface-muted) !important;
}

.bg-emerald-600,
.bg-emerald-500 {
  background-color: var(--primary) !important;
}

.hover\:bg-emerald-700:hover {
  background-color: var(--primary-hover) !important;
}

.text-emerald-700,
.text-emerald-600 {
  color: var(--primary-text) !important;
}

.border-emerald-600,
.focus\:border-emerald-600:focus {
  border-color: var(--primary) !important;
}

.bg-emerald-100 {
  background-color: var(--primary-container) !important;
}

.bg-emerald-50 {
  background-color: var(--primary-container) !important;
}

.text-emerald-400,
.hover\:text-emerald-400:hover {
  color: var(--primary-text) !important;
}

.hover\:bg-emerald-400:hover {
  background-color: var(--primary) !important;
}

.border-emerald-200,
.hover\:border-emerald-300:hover {
  border-color: rgba(var(--primary-rgb), 0.3) !important;
}

.ring-emerald-100,
.focus\:ring-emerald-100:focus {
  --tw-ring-color: rgba(var(--primary-rgb), 0.16) !important;
}

.ring-emerald-500,
.focus\:ring-emerald-500:focus {
  --tw-ring-color: rgba(var(--primary-rgb), 0.35) !important;
}

#nav-menu {
  border-top-color: var(--surface-border);
}

details summary {
  list-style: none;
  cursor: pointer;
}

details summary::-webkit-details-marker {
  display: none;
}

details summary::marker {
  content: none;
}

details[open] summary {
  border-bottom: 1px solid var(--surface-border);
}

html[data-theme="dark"] {
  color-scheme: dark;
  --app-bg: #0b0f1a;
  --surface: #131a2b;
  --surface-muted: #0e1424;
  --surface-elevated: #171f34;
  --surface-border: #232c44;
  --surface-border-strong: #2e3854;
  --text: #f1f4fb;
  --text-muted: #93a0bd;
  --primary: #5b7cfa;
  --primary-hover: #7691ff;
  --primary-container: rgba(91, 124, 250, 0.18);
  --primary-text: #8ca0ff;
  --success: #34d399;
  --success-container: rgba(52, 211, 153, 0.16);
  --warning: #fbbf24;
  --danger: #f87171;
  --success-rgb: 52, 211, 153;
  --warning-rgb: 251, 191, 36;
  --danger-rgb: 248, 113, 113;
  --shadow-sm: 0 1px 2px rgba(2, 4, 10, 0.5), 0 1px 3px rgba(2, 4, 10, 0.35);
  --shadow-md: 0 16px 32px rgba(2, 4, 10, 0.55), 0 4px 12px rgba(2, 4, 10, 0.4);
  --primary-rgb: 91, 124, 250;
  --app-bg-rgb: 11, 15, 26;
  --text-rgb: 241, 244, 251;
  --chart-inflow: #1f9e97;
  --chart-outflow: #c9701f;
  --chart-line: #5b7cfa;
}

html[data-theme="dark"] body {
  background: radial-gradient(
    circle at top,
    rgba(var(--primary-rgb), 0.08) 0%,
    var(--app-bg) 52%,
    rgba(0, 0, 0, 0.35) 100%
  );
  color: var(--text);
}

html[data-theme="dark"] .gm-surface,
html[data-theme="dark"] .app-card,
html[data-theme="dark"] .rounded-\[28px\].border.border-slate-200.bg-white,
html[data-theme="dark"] .rounded-\[32px\].border.border-slate-200.bg-white,
html[data-theme="dark"] .border-slate-200,
html[data-theme="dark"] .bg-white,
html[data-theme="dark"] .bg-slate-50,
html[data-theme="dark"] .bg-slate-100 {
  background-color: var(--surface) !important;
  border-color: var(--surface-border) !important;
}

html[data-theme="dark"] .text-slate-900,
html[data-theme="dark"] .text-slate-800,
html[data-theme="dark"] .text-slate-700,
html[data-theme="dark"] .text-slate-600,
html[data-theme="dark"] .text-slate-500 {
  color: var(--text) !important;
}

html[data-theme="dark"] .text-slate-500 {
  color: var(--text-muted) !important;
}

html[data-theme="dark"] .border-slate-300,
html[data-theme="dark"] .border-slate-200,
html[data-theme="dark"] .border-slate-100 {
  border-color: var(--surface-border) !important;
}

html[data-theme="dark"] .bg-slate-700,
html[data-theme="dark"] .bg-slate-950,
html[data-theme="dark"] .hover\:bg-slate-800:hover,
html[data-theme="dark"] .hover\:bg-slate-200:hover {
  background-color: var(--surface-elevated) !important;
}

html[data-theme="dark"] .bg-emerald-600 {
  background-color: var(--primary) !important;
}

html[data-theme="dark"] .hover\:bg-emerald-700:hover {
  background-color: var(--primary-hover) !important;
}

html[data-theme="dark"] .text-emerald-700,
html[data-theme="dark"] .text-emerald-600 {
  color: var(--primary-text) !important;
}

/* Menu latéral du back-office admin (voir modules/admin/index.js). Utilise
   directement les variables de thème plutôt que des couleurs fixes afin de
   rester correct en clair comme en sombre sans règle dupliquée. */
.admin-sidebar-link {
  border-radius: 9999px;
  padding: 0.65rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  text-align: left;
  white-space: nowrap;
  color: var(--text-muted, #475569);
  background: transparent;
  border: 1px solid transparent;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.admin-sidebar-link:hover {
  background: var(--surface-muted, #f8fafc);
  color: var(--text, #0f172a);
}

.admin-sidebar-link.is-active {
  background: var(--primary, #059669);
  color: #fff;
  border-color: var(--primary, #059669);
}

@media (min-width: 1024px) {
  .admin-sidebar-link {
    text-align: left;
  }
}

/* Regroupement visuel de la sidebar admin/secrétariat (docs/v4/
   CHANTIER_NAVIGATION_NOTIFICATIONS_PIECES_JOINTES.md, Étape 2). Les boutons
   `.admin-sidebar-link` restent des enfants directs recherchables par
   `shared/section-nav.js` (querySelectorAll traverse les wrappers) : seul le
   rendu change. `display:contents` sur mobile annule le wrapper pour garder
   le défilement horizontal à plat déjà en place ; à partir de `lg:`, le
   wrapper redevient une colonne avec son étiquette de groupe au-dessus. */
.admin-sidebar-group {
  display: contents;
}

.admin-sidebar-group-label {
  display: none;
}

@media (min-width: 1024px) {
  .admin-sidebar-group {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
  }

  .admin-sidebar-group + .admin-sidebar-group {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--surface-border, #e2e8f0);
  }

  .admin-sidebar-group-label {
    display: block;
    padding: 0.4rem 1rem 0.25rem;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-muted, #94a3b8);
  }
}

/* Listes chronologiques regroupées par date + pagination "Charger plus"
   (public/modules/shared/history-list.js) — notifications, audit,
   historiques Finance. */
.history-date-group + .history-date-group {
  margin-top: 0.85rem;
}

.history-date-group-label {
  padding: 0 0.25rem 0.35rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted, #94a3b8);
}

.history-load-more-btn {
  margin-top: 0.75rem;
  width: 100%;
  border-radius: 9999px;
  border: 1px solid var(--surface-border, #e2e8f0);
  background: var(--surface-muted, #f8fafc);
  padding: 0.55rem 1rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text, #0f172a);
  transition: background-color 0.15s ease;
}

.history-load-more-btn:hover {
  background: var(--surface-elevated, #eef2f7);
}

/* Entrées du panneau de notifications (public/modules/shared/notifications.js). */
.notification-entry {
  display: flex;
  width: 100%;
  align-items: flex-start;
  gap: 0.6rem;
  border-radius: 1rem;
  padding: 0.55rem 0.6rem;
  text-align: left;
  background: transparent;
  transition: background-color 0.15s ease;
}

.notification-entry:hover {
  background: var(--surface-muted, #f8fafc);
}

.notification-entry-dot {
  margin-top: 0.35rem;
  height: 0.5rem;
  width: 0.5rem;
  flex-shrink: 0;
  border-radius: 9999px;
  background: transparent;
}

.notification-entry.is-unread .notification-entry-dot {
  background: var(--primary, #059669);
}

.notification-entry-body {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.notification-entry-message {
  font-size: 0.83rem;
  line-height: 1.35;
  color: var(--text, #0f172a);
}

.notification-entry.is-unread .notification-entry-message {
  font-weight: 600;
}

.notification-entry-time {
  font-size: 0.72rem;
  color: var(--text-muted, #94a3b8);
}

/* Pièces jointes (public/modules/shared/attachments.js) — client-projects et hr. */
.attachment-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.attachment-entry {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border-radius: 0.85rem;
  border: 1px solid var(--surface-border, #e2e8f0);
  background: var(--surface, #fff);
  padding: 0.4rem 0.5rem;
}

.attachment-entry-link {
  display: flex;
  min-width: 0;
  flex: 1;
  align-items: center;
  gap: 0.55rem;
}

.attachment-thumb {
  height: 2.25rem;
  width: 2.25rem;
  flex-shrink: 0;
  border-radius: 0.5rem;
  object-fit: cover;
}

.attachment-file-icon {
  display: flex;
  height: 2.25rem;
  width: 2.25rem;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  border-radius: 0.5rem;
  background: var(--primary-container, #e2e8f0);
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--primary, #059669);
}

.attachment-entry-meta {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 0.1rem;
}

.attachment-entry-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text, #0f172a);
}

.attachment-entry-size {
  font-size: 0.7rem;
  color: var(--text-muted, #94a3b8);
}

.attachment-delete-btn {
  flex-shrink: 0;
  border-radius: 9999px;
  padding: 0.2rem 0.55rem;
  font-size: 1rem;
  line-height: 1;
  color: var(--danger, #b23b32);
  transition: background-color 0.15s ease;
}

.attachment-delete-btn:hover {
  background: var(--surface-muted, #f8fafc);
}

.attachment-upload-btn {
  display: block;
  margin-top: 0.5rem;
  cursor: pointer;
  border-radius: 9999px;
  border: 1px dashed var(--surface-border-strong, #cbd5e1);
  padding: 0.5rem 1rem;
  text-align: center;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--primary, #059669);
  transition: background-color 0.15s ease;
}

.attachment-upload-btn:hover {
  background: var(--surface-muted, #f8fafc);
}

.attachment-summary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--primary-text, var(--primary));
  background: var(--primary-container, rgba(var(--primary-rgb), 0.1));
  border: 1px solid rgba(var(--primary-rgb), 0.25);
  border-radius: 9999px;
  padding: 0.45rem 0.95rem;
  user-select: none;
  transition: background 0.15s ease;
}

.attachment-summary:hover {
  background: rgba(var(--primary-rgb), 0.18);
}

.attachment-summary svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.attachment-summary-chevron {
  transition: transform 0.15s ease;
}

details[open] > .attachment-summary {
  border-bottom: none;
}

details[open] > .attachment-summary .attachment-summary-chevron {
  transform: rotate(90deg);
}

/* Thème « Google » — inspiré des applications Google/Material (Gmail,
   Google Workspace) : bleu Google en accent, gris neutres caractéristiques,
   Roboto (la police Google réellement disponible sur Google Fonts — Google
   Sans n'est pas distribuée publiquement). Rayons plus modestes, plus
   « modulaires », que les deux autres thèmes. */
html[data-brand="google"] {
  --font-body: "Roboto", "Google Sans", Arial, sans-serif;
  --font-display: var(--font-body);
  --story-bg: #202124;
  --story-bg-2: #174ea6;
  --story-bg-rgb: 32, 33, 36;
  --radius-sm: 8px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 18px;
}

html[data-brand="google"]:not([data-theme="dark"]) {
  --app-bg: #f8f9fa;
  --surface: #ffffff;
  --surface-muted: #f1f3f4;
  --surface-elevated: #ffffff;
  --surface-border: #dadce0;
  --surface-border-strong: #bdc1c6;
  --text: #202124;
  --text-muted: #5f6368;
  --primary: #1a73e8;
  --primary-hover: #1765cc;
  --primary-container: #e8f0fe;
  --primary-text: #1a73e8;
  --success: #188038;
  --success-container: #e6f4ea;
  --warning: #f9ab00;
  --danger: #d93025;
  --success-rgb: 24, 128, 56;
  --warning-rgb: 249, 171, 0;
  --danger-rgb: 217, 48, 37;
  --shadow-sm: 0 1px 2px rgba(32, 33, 36, 0.08), 0 1px 3px rgba(32, 33, 36, 0.06);
  --shadow-md: 0 8px 20px rgba(32, 33, 36, 0.12), 0 2px 8px rgba(32, 33, 36, 0.08);
  --primary-rgb: 26, 115, 232;
  --app-bg-rgb: 248, 249, 250;
  --text-rgb: 32, 33, 36;
  --chart-inflow: #0086ab;
  --chart-outflow: #e8710a;
  --chart-line: #1a73e8;
}

html[data-brand="google"][data-theme="dark"] {
  --app-bg: #202124;
  --surface: #292a2d;
  --surface-muted: #1e1f20;
  --surface-elevated: #303134;
  --surface-border: #3c4043;
  --surface-border-strong: #5f6368;
  --text: #e8eaed;
  --text-muted: #9aa0a6;
  --primary: #8ab4f8;
  --primary-hover: #aecbfa;
  --primary-container: rgba(138, 180, 248, 0.16);
  --primary-text: #8ab4f8;
  --success: #81c995;
  --success-container: rgba(129, 201, 149, 0.16);
  --warning: #fdd663;
  --danger: #f28b82;
  --success-rgb: 129, 201, 149;
  --warning-rgb: 253, 214, 99;
  --danger-rgb: 242, 139, 130;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4), 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 12px 28px rgba(0, 0, 0, 0.45), 0 4px 10px rgba(0, 0, 0, 0.35);
  --primary-rgb: 138, 180, 248;
  --app-bg-rgb: 32, 33, 36;
  --text-rgb: 232, 234, 237;
  /* --chart-line diffère volontairement de --primary (#8ab4f8, L 0.766) :
     ce dernier échoue seul la bande de luminosité OKLCH du script dataviz
     pour un usage graphique (0.48–0.67 en sombre) — #5b93e0 est un bleu de
     la même famille, choisi pour rester dans la bande. */
  --chart-inflow: #1f9e97;
  --chart-outflow: #c9701f;
  --chart-line: #5b93e0;
}
