/* NALA — styles d'après la charte graphique v1.0 (NALA_Charte_Graphique.html) */
:root {
  --fond: #EEF1F5; --blanc: #FFFFFF; --encre: #141A23; --graphite: #3F4856;
  --acier: #6B7482; --acier-clair: #C3CAD4; --ligne: #D5DBE3;
  --cyan: #00E5FF; --cyan-lum: #3EF0FF; --cyan-prof: #00A6C7; --cyan-lisible: #0E7490;
  --alerte: #B42318;
  --f-titre: "Michroma", "Eurostile", "Arial Black", sans-serif;
  --f-texte: "Exo 2", "Segoe UI", system-ui, sans-serif;
  --f-code: "JetBrains Mono", ui-monospace, Menlo, monospace;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--fond); color: var(--encre); font-family: var(--f-texte); font-size: 16px; line-height: 1.45; -webkit-text-size-adjust: 100%; }
body { min-height: 100dvh; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--cyan-lisible); }
h1, h2, h3 { font-family: var(--f-titre); font-weight: 400; margin: 0; letter-spacing: .02em; text-wrap: balance; }
h1 { font-size: 24px; line-height: 1.25; }
h2 { font-size: 18px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Structure */
.app { max-width: 560px; margin: 0 auto; min-height: 100dvh; display: flex; flex-direction: column; }
.top { position: sticky; top: 0; z-index: 5; background: rgba(238, 241, 245, .92); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: calc(14px + env(safe-area-inset-top, 0px)) 16px 12px; border-bottom: 1px solid transparent; }
.top.scrolled { border-bottom-color: var(--ligne); }
.top .logo { width: 150px; display: block; }
.main { flex: 1; padding: 8px 16px 120px; display: flex; flex-direction: column; gap: 18px; }
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; background: var(--blanc); border-top: 1px solid var(--ligne); padding-bottom: env(safe-area-inset-bottom, 0px); }
.tabbar nav { max-width: 560px; margin: 0 auto; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.tabbar a { min-height: 56px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; text-decoration: none; color: var(--graphite); font-family: var(--f-code); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; }
.tabbar a[aria-current="page"] { color: var(--encre); }
.tabbar a[aria-current="page"] .dot { background: var(--cyan); box-shadow: 0 0 8px var(--cyan); }
.tabbar .dot { width: 6px; height: 6px; border-radius: 3px; background: transparent; }
.tabbar svg { width: 20px; height: 20px; }

/* Textes */
.label { font-family: var(--f-code); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--graphite); display: flex; align-items: center; gap: 8px; }
.label.live { color: var(--cyan-lisible); }
.mono { font-family: var(--f-code); font-size: 12px; letter-spacing: .04em; }
.muted { color: var(--graphite); }
.sous-titre { font-size: 19px; font-weight: 300; color: var(--graphite); margin: 0; }
.vide { padding: 18px; text-align: center; color: var(--graphite); border: 1px dashed var(--acier-clair); border-radius: 4px; font-size: 15px; }

/* Lumière NALA */
.point { width: 8px; height: 8px; border-radius: 4px; background: var(--cyan); box-shadow: 0 0 8px var(--cyan); flex: none; }
@media (prefers-reduced-motion: no-preference) {
  .pulse { animation: nalaPulse 3.2s ease-in-out infinite; }
  @keyframes nalaPulse { 50% { box-shadow: 0 0 0 3px rgba(0, 229, 255, .25), 0 0 14px var(--cyan); } }
  .spin { animation: spin 1s linear infinite; }
  @keyframes spin { to { transform: rotate(360deg); } }
}

/* Cartes */
.card { background: var(--blanc); border: 1px solid var(--ligne); border-radius: 4px; padding: 14px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.card.vivante { border-color: var(--cyan-lisible); box-shadow: 0 0 18px rgba(0, 229, 255, .18); }
.card .entete { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.card .titre { font-size: 16px; line-height: 1.4; }
.card .detail { font-size: 14px; color: var(--graphite); }
.grille3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.grille2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.stat { background: var(--blanc); border: 1px solid var(--ligne); border-radius: 4px; padding: 12px; display: flex; flex-direction: column; gap: 6px; }
.stat .n { font-family: var(--f-titre); font-size: 24px; display: flex; align-items: center; gap: 8px; }
.ligne { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 10px 0; border-top: 1px solid var(--ligne); }
.ligne:first-child { border-top: 0; padding-top: 0; }
.ligne .g { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ligne .d { flex: none; display: flex; gap: 6px; align-items: center; }
.chip { font-family: var(--f-code); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; border: 1px solid var(--ligne); border-radius: 2px; padding: 2px 6px; color: var(--graphite); white-space: nowrap; }
.chip.faite { border-color: var(--encre); color: var(--encre); }
.chip.live { border-color: var(--cyan-lisible); color: var(--cyan-lisible); }

/* Boutons */
.btn { min-height: 46px; border: 0; border-radius: 3px; padding: 0 18px; background: var(--encre); color: var(--blanc); font-family: var(--f-titre); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; display: inline-flex; align-items: center; justify-content: center; gap: 10px; cursor: pointer; box-shadow: 0 0 0 1px var(--encre), 0 0 14px rgba(0, 229, 255, .30); text-decoration: none; }
.btn .point { width: 7px; height: 7px; }
.btn.large { width: 100%; min-height: 54px; font-size: 12px; }
.btn2 { min-height: 44px; border: 1px solid var(--ligne); border-radius: 3px; padding: 0 14px; background: var(--blanc); color: var(--encre); font-weight: 600; font-size: 14px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer; text-decoration: none; }
.btn2.petit { min-height: 36px; padding: 0 10px; font-size: 13px; }
.btn2.danger { color: var(--alerte); }
.btn-icone { width: 44px; height: 44px; border: 1px solid var(--ligne); border-radius: 3px; background: var(--blanc); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; color: var(--encre); }
.btn-icone svg { width: 20px; height: 20px; }
.btn:focus-visible, .btn2:focus-visible, .btn-icone:focus-visible, .tabbar a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--cyan-lisible); outline-offset: 2px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.actions .btn { flex: 1 1 auto; }
button:disabled { opacity: .55; cursor: default; }

/* Onglets */
.onglets { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); border: 1px solid var(--ligne); border-radius: 3px; overflow: hidden; background: var(--blanc); }
.onglets button { min-height: 42px; border: 0; border-left: 1px solid var(--ligne); background: transparent; font-family: var(--f-code); font-size: 12px; letter-spacing: .06em; text-transform: uppercase; cursor: pointer; }
.onglets button:first-child { border-left: 0; }
.onglets button[aria-pressed="true"] { background: var(--encre); color: var(--blanc); }

/* Formulaires */
form { display: flex; flex-direction: column; gap: 14px; margin: 0; }
.champ { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.champ > span { font-family: var(--f-code); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--graphite); }
.champ small { color: var(--graphite); font-size: 13px; }
input[type="text"], input[type="email"], input[type="password"], input[type="tel"], input[type="url"], input[type="date"], input[type="time"], input[type="number"], select, textarea {
  width: 100%; min-height: 46px; border: 1px solid var(--ligne); border-radius: 3px; background: var(--blanc); padding: 10px 12px; font-size: 16px;
}
textarea { min-height: 90px; resize: vertical; }
.case { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; border-top: 1px solid var(--ligne); cursor: pointer; }
.case:first-of-type { border-top: 0; }
.case input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--encre); flex: none; }
.case b { font-weight: 600; display: block; }
.case small { color: var(--graphite); font-size: 13px; }
.rangee { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.erreur { color: var(--alerte); font-size: 14px; margin: 0; }

/* Connexion */
.ecran-connexion { min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; }
.ecran-connexion .boite { width: 100%; max-width: 400px; background: var(--blanc); border: 1px solid var(--ligne); border-radius: 4px; padding: 28px 22px; display: flex; flex-direction: column; gap: 22px; }
.ecran-connexion .logo { width: 220px; max-width: 100%; }

/* Fenêtre (feuille) */
dialog { border: 1px solid var(--ligne); border-radius: 4px; padding: 0; width: min(520px, calc(100% - 24px)); max-height: calc(100dvh - 40px); background: var(--blanc); color: var(--encre); }
dialog::backdrop { background: rgba(20, 26, 35, .35); }
dialog .feuille { padding: 20px 18px; display: flex; flex-direction: column; gap: 16px; }
dialog .feuille .entete { display: flex; justify-content: space-between; align-items: center; gap: 12px; }

/* Message flottant */
.toast { position: fixed; left: 50%; bottom: calc(76px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 20; background: var(--encre); color: var(--blanc); border-radius: 3px; padding: 12px 16px; font-size: 14px; display: flex; gap: 10px; align-items: center; max-width: calc(100% - 32px); box-shadow: 0 0 18px rgba(0, 229, 255, .35); }

/* Orbe (Parler à NALA) */
.orbe { width: 180px; height: 180px; border-radius: 90px; border: 1px solid var(--ligne); display: flex; align-items: center; justify-content: center; margin: 12px auto 0; }
.orbe > div { width: 138px; height: 138px; border-radius: 69px; border: 1.5px solid var(--ligne); display: flex; align-items: center; justify-content: center; }
.orbe > div > div { width: 94px; height: 94px; border-radius: 47px; background: var(--acier-clair); display: flex; align-items: center; justify-content: center; gap: 5px; }
.orbe span { width: 4px; background: var(--encre); }
