/*
 * voltea_theme — voltea-frappe-map.css
 *
 * Mapping des tokens Voltea (_brand-tokens.css) sur les variables CSS
 * natives Frappe/ERPNext v15 (définies dans frappe/public/scss/common/
 * css_variables.scss). Aucune couleur en dur ici : tout vient des tokens.
 *
 * Scopé au thème clair : le dark mode Frappe ([data-theme="dark"])
 * garde ses variables natives, le toggle voltea reste fonctionnel.
 */

:root,
[data-theme="light"] {
  /* Couleur primaire → navy (boutons primaires, liens, éléments actifs) */
  --primary: var(--voltea-primary);
  --primary-color: var(--voltea-primary);
  --btn-primary: var(--voltea-primary);
  --border-primary: var(--voltea-primary);
  --checkbox-color: var(--voltea-primary);
  --checkbox-focus-shadow: var(--voltea-focus-ring);

  /* Layout */
  --bg-color: var(--voltea-bg);
  --navbar-bg: var(--voltea-bg);
  --subtle-accent: var(--voltea-surface);
  --subtle-fg: var(--voltea-surface);
  --control-bg: var(--voltea-surface);
  --fg-hover-color: var(--voltea-surface);
  --highlight-color: var(--voltea-surface);
  --disabled-control-bg: var(--voltea-surface);

  /* Bordures — 1px, gris bleuté charte */
  --border-color: var(--voltea-border);
  --dark-border-color: var(--voltea-border-strong);
  --table-border-color: var(--voltea-border);
  --btn-group-border-color: var(--voltea-border-strong);

  /* Sidebar : item actif → lavis navy */
  --sidebar-select-color: var(--voltea-navy-100);

  /* Texte */
  --text-color: var(--voltea-text);
  --text-muted: var(--voltea-text-muted);
  --text-light: var(--voltea-text-muted);
  --heading-color: var(--voltea-text);

  /* Succès → vert charte */
  --alert-bg-success: var(--voltea-green-100);

  /* Divers */
  --progress-bar-bg: var(--voltea-primary);
  --scrollbar-thumb-color: var(--voltea-border-strong);
  --scrollbar-track-color: var(--voltea-surface);
  --highlight-shadow: 1px 1px 10px var(--voltea-navy-100),
    0px 0px 4px var(--voltea-navy-700);
}

/* Navbar : fond charte + bordure basse 1px nette */
[data-theme="light"] .navbar,
:root .navbar {
  background: var(--voltea-bg);
  border-bottom: 1px solid var(--voltea-border);
}

/* Sidebar : item sélectionné lisible sur lavis navy */
.desk-sidebar .standard-sidebar-item.selected,
.desk-sidebar .standard-sidebar-item.selected:hover {
  background: var(--voltea-navy-100);
}

.desk-sidebar .standard-sidebar-item.selected .sidebar-item-label,
.desk-sidebar .standard-sidebar-item.selected .sidebar-item-icon svg {
  color: var(--voltea-navy);
  stroke: var(--voltea-navy);
}

/* Avertissements doux → ambre charte */
.alert-warning,
.form-message.yellow,
.msgprint-dialog .modal-body .warning {
  background-color: var(--voltea-amber-100);
  border: 1px solid var(--voltea-amber);
  color: var(--voltea-text);
}
