/* RénoGest — thèmes de couleurs (chargé après design.css).
   Chaque thème = un mode (data-theme : light / dark) + une palette (data-palette) qui ne change que les couleurs.
   « Clair » et « Nuit » sont les couleurs d'origine (pas de data-palette). */

/* ---------- Clairs ---------- */
/* Lagon : bleu-vert, barre latérale pétrole */
:root[data-palette="lagon"] {
  --bg: #eff6f7; --card: #ffffff; --soft: #f3f9fa; --hover: #e6f2f3; --row-hover: #f0f8f9;
  --border: #dbe9ec; --border-strong: #c5dade;
  --primary: #0b8a86; --primary-d: #087571; --primary-50: #e3f4f3; --focus: rgba(11, 138, 134, .22);
  --navy: #0a2a31; --navy-2: #113a43;
  --grad-primary: linear-gradient(135deg, #10a39e 0%, #0c7fa3 100%);
  --grad-ink: linear-gradient(160deg, #0d3640 0%, #0a2830 55%, #0b2236 100%);
  --nav-actif: linear-gradient(90deg, rgba(16, 163, 158, .42), rgba(12, 127, 163, .16));
  --teinte-1: rgba(16, 163, 158, .08); --teinte-2: rgba(12, 127, 163, .06);
}
/* Sable : tons chauds, accent terre cuite */
:root[data-palette="sable"] {
  --bg: #f7f3ec; --card: #fffdf9; --soft: #faf6ef; --hover: #f2ebdf; --row-hover: #fbf6ee;
  --border: #ebe2d4; --border-strong: #dccfbc; --text: #2a2016; --muted: #7a6a58;
  --primary: #b8541d; --primary-d: #9c4415; --primary-50: #fbeee4; --focus: rgba(184, 84, 29, .2);
  --navy: #2a1c13; --navy-2: #3a2a1e;
  --grad-primary: linear-gradient(135deg, #d0672a 0%, #b03f1f 100%);
  --grad-ink: linear-gradient(160deg, #35251a 0%, #271a12 55%, #2e1c14 100%);
  --nav-actif: linear-gradient(90deg, rgba(208, 103, 42, .42), rgba(176, 63, 31, .16));
  --teinte-1: rgba(208, 103, 42, .07); --teinte-2: rgba(176, 63, 31, .05);
}

/* ---------- Sombres ---------- */
/* Forêt : vert profond, rappel de GREENOVIA */
:root[data-palette="foret"] {
  --bg: #0a120e; --card: #111b16; --soft: #15211b; --hover: #1a2921; --row-hover: #16241d;
  --border: #1f2e26; --border-strong: #2c3f35; --muted: #93a89c;
  --primary: #3cc187; --primary-d: #30a874; --primary-50: rgba(60, 193, 135, .14); --focus: rgba(60, 193, 135, .3);
  --navy: #060d09; --navy-2: #102018;
  --grad-primary: linear-gradient(135deg, #3cc187 0%, #1e9a8f 100%);
  --grad-ink: linear-gradient(160deg, #0b1a12 0%, #060d09 60%, #0a1712 100%);
  --nav-actif: linear-gradient(90deg, rgba(60, 193, 135, .34), rgba(30, 154, 143, .14));
  --teinte-1: rgba(60, 193, 135, .06); --teinte-2: rgba(30, 154, 143, .05);
  --topbar: rgba(10, 18, 14, .88);
}
/* Graphite : gris neutre, accent orange */
:root[data-palette="graphite"] {
  --bg: #111214; --card: #1a1b1e; --soft: #1f2023; --hover: #26282c; --row-hover: #222327;
  --border: #2b2d31; --border-strong: #3a3c42; --muted: #a2a5ad;
  --primary: #f0892e; --primary-d: #dc7620; --primary-50: rgba(240, 137, 46, .14); --focus: rgba(240, 137, 46, .3);
  --navy: #0b0b0c; --navy-2: #1d1e21;
  --grad-primary: linear-gradient(135deg, #f39a3c 0%, #d9572b 100%);
  --grad-ink: linear-gradient(160deg, #18191c 0%, #0d0d0f 60%, #141416 100%);
  --nav-actif: linear-gradient(90deg, rgba(243, 154, 60, .32), rgba(217, 87, 43, .12));
  --teinte-1: rgba(243, 154, 60, .05); --teinte-2: rgba(217, 87, 43, .04);
  --topbar: rgba(17, 18, 20, .88);
}

/* Éléments dont les teintes étaient fixes dans design.css */
:root[data-palette] body {
  background: radial-gradient(1200px 500px at 85% -10%, var(--teinte-1), transparent 60%),
              radial-gradient(900px 400px at 10% -5%, var(--teinte-2), transparent 60%), var(--bg);
  background-attachment: fixed;
}
:root[data-palette] #nav a.active { background: var(--nav-actif); }
:root[data-palette] .avatar { box-shadow: 0 4px 12px -4px var(--focus); }
:root[data-palette] ::selection { background: var(--focus); }
:root[data-palette] .sidebar::before {
  background: radial-gradient(420px 260px at 0% 0%, rgba(255, 194, 26, .08), transparent 70%),
              radial-gradient(380px 300px at 100% 100%, var(--teinte-1), transparent 70%);
}
/* Onglet actif en mode sombre : texte foncé sur la couleur principale */
:root[data-palette="foret"] .tab.active, :root[data-palette="graphite"] .tab.active { color: var(--text); }

/* ---------- Choix du thème ---------- */
.themes { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.theme-carte { border: 2px solid var(--border); border-radius: 14px; padding: 0; overflow: hidden; cursor: pointer; background: var(--card); color: var(--text); font: inherit; text-align: left; transition: border-color .15s, transform .15s; }
.theme-carte:hover { transform: translateY(-2px); border-color: var(--border-strong); }
.theme-carte.actif { border-color: var(--primary); box-shadow: 0 0 0 3px var(--focus); }
.theme-apercu { display: grid; grid-template-columns: 26% 1fr; height: 76px; }
.theme-apercu .ta-side { display: flex; flex-direction: column; gap: 5px; padding: 8px 6px; }
.theme-apercu .ta-side i { display: block; height: 5px; border-radius: 3px; background: rgba(255, 255, 255, .25); }
.theme-apercu .ta-side i.on { background: var(--ta-p); }
.theme-apercu .ta-main { padding: 8px; display: flex; flex-direction: column; gap: 6px; }
.theme-apercu .ta-card { flex: 1; border-radius: 6px; padding: 6px; display: flex; gap: 6px; align-items: flex-start; }
.theme-apercu .ta-card b { width: 34px; height: 10px; border-radius: 5px; background: var(--ta-p); }
.theme-apercu .ta-card s { flex: 1; height: 5px; border-radius: 3px; margin-top: 3px; text-decoration: none; }
.theme-nom { padding: 8px 10px; display: flex; justify-content: space-between; align-items: center; font-weight: 650; font-size: 13.5px; }
.theme-nom span { font-weight: 500; font-size: 11.5px; color: var(--muted); }
