
/* ================================================================
   STYLES v4.1 — Contrôle Hygiène
   Modifications vs v4.0 :
   - Fix nav overlap : padding-bottom corrigé sur #appShell,
     #mainContent, #view-hygiene-form
   - .form-actions : position static (dans le flux normal)
   - .footer-actions : bottom ajusté avec nav-h + safe-area
   ================================================================ */


/* ── Variables de design ─────────────────────────────────────── */
:root {
  --bg:            #08111f;
  --surface:       #101c2e;
  --card:          rgba(17,27,45,.82);
  --border:        rgba(162,181,214,.16);
  --border-strong: rgba(177,193,222,.28);
  --text:          #eef4ff;
  --muted:         #8ea2c5;
  --primary:       #4f8cff;
  --primary-2:     #6ea5ff;
  --danger:        #f0677d;
  --success:       #3ecf8e;
  --warning:       #ffbf5f;
  --nc-red:        #ff5c7a;
  --nc-red-bg:     rgba(255,92,122,.14);
  --nc-red-bd:     rgba(255,92,122,.32);
  --ok-green:      #3ecf8e;
  --ok-green-bg:   rgba(62,207,142,.13);
  --ok-green-bd:   rgba(62,207,142,.30);
  --shadow:        0 16px 42px rgba(0,0,0,.32);
  --radius:        22px;
  --radius-sm:     14px;
  --topbar-h:      64px;
  --nav-h:         80px;
}



*, *::before, *::after { box-sizing: border-box; }
html, body { overflow-x: hidden; }
html, body {
  margin: 0;
  background: radial-gradient(circle at top, #102340 0%, #08111f 48%, #050b15 100%);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
button, select, input, textarea { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }


/* ══════════════════════════════════════════════════════════════
   ÉCRAN PIN
══════════════════════════════════════════════════════════════ */

#pinScreen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}

.pin-card {
  width: min(100%, 360px);
  padding: 36px 28px 32px;
  border-radius: var(--radius);
  background: var(--card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.pin-logo     { font-size: 40px; margin-bottom: 12px; line-height: 1; }
.pin-title    { font-size: 22px; font-weight: 800; color: var(--text); margin-bottom: 6px; }
.pin-subtitle { font-size: 13px; color: var(--muted); margin-bottom: 24px; line-height: 1.5; }

.pin-input {
  width: 100%;
  text-align: center;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: .3em;
  padding: 16px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(110,165,255,.35);
  background: rgba(8,16,31,.80);
  color: var(--text);
  outline: none;
  margin-bottom: 10px;
  transition: border-color .18s, box-shadow .18s;
}
.pin-input:focus {
  border-color: var(--primary-2);
  box-shadow: 0 0 0 4px rgba(79,140,255,.14);
}
.pin-input::placeholder {
  letter-spacing: .12em; font-size: 16px;
  color: var(--muted); font-weight: 600;
}

.pin-error {
  min-height: 20px; font-size: 13px; font-weight: 700;
  color: var(--nc-red); margin-bottom: 10px;
  text-align: center; line-height: 1.4; width: 100%;
}


/* ══════════════════════════════════════════════════════════════
   APP SHELL
══════════════════════════════════════════════════════════════ */

#appShell {
  padding-bottom: calc(var(--nav-h) + 32px + env(safe-area-inset-bottom));
}

.app {
  max-width: 820px;
  margin: 0 auto;
  min-height: 100vh;
  overflow-x: hidden;
}


/* ── Glassmorphism ───────────────────────────────────────────── */
.glass, .glass-card, .card, .control-card,
.calendar-card, .form-card, .soft-card,
.planning-card, .dashboard-card {
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background: var(--card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}


/* ── Topbar ──────────────────────────────────────────────────── */
.top-bar {
  position: sticky; top: 0; z-index: 30;
  height: var(--topbar-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 14px;
  background: rgba(8,14,26,.88);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(255,255,255,.05);
}
.top-title { font-size: 17px; font-weight: 800; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 12px;
  border: 1px solid rgba(177,193,222,.14); background: rgba(255,255,255,.04);
  color: var(--text); display: grid; place-items: center;
  transition: .15s background;
}
.icon-btn:active { background: rgba(255,255,255,.12); }

.topbar {
  position: sticky; top: 0; z-index: 30;
  height: var(--topbar-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 16px;
  border-bottom: 1px solid rgba(255,255,255,.04);
}
.topbar-group { display: flex; align-items: center; gap: 10px; }
.eyebrow { font-size: 10px; letter-spacing: .13em; text-transform: uppercase; color: #84a0cb; font-weight: 700; }
.title   { font-size: 19px; font-weight: 750; line-height: 1.1; }


/* ── Boutons compact ─────────────────────────────────────────── */
.tiny-rect-btn {
  height: 36px; min-width: 36px; padding: 0 12px;
  border-radius: 10px; border: 1px solid var(--border-strong);
  background: linear-gradient(180deg, rgba(255,255,255,.08), rgba(255,255,255,.02));
  color: var(--text); font-size: 13px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  transition: .18s transform, .18s border-color;
}
.tiny-rect-btn:active { transform: scale(.96); }
.iconish { width: 40px; padding: 0; }


/* ── Hero strip ──────────────────────────────────────────────── */
.hero-strip {
  margin: 12px 14px 0; padding: 18px 18px 16px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(79,140,255,.22), rgba(110,165,255,.08));
  border: 1px solid rgba(123,163,255,.22);
  box-shadow: var(--shadow);
}
.hero-strip h1 { margin: 4px 0 0; font-size: 24px; font-weight: 800; line-height: 1.1; }


/* ── Layout ──────────────────────────────────────────────────── */
.section    { padding: 14px; }
.two-blocks { display: grid; gap: 14px; }


/* ── Contenu principal ───────────────────────────────────────── */
#mainContent {
  padding: 14px 14px calc(var(--nav-h) + 40px + env(safe-area-inset-bottom));
}

/* Vue formulaire — espace supplémentaire pour les boutons en bas */
#view-hygiene-form {
  padding-bottom: calc(var(--nav-h) + 80px + env(safe-area-inset-bottom));
}

/* ── Vues ────────────────────────────────────────────────────── */
.view-section  { padding-bottom: 14px; }
.view-title    { margin: 12px 0 4px; font-size: 22px; font-weight: 800; }
.view-subtitle { margin: 0 0 14px; }


/* ── Cartes ──────────────────────────────────────────────────── */
.card, .control-card, .calendar-card, .form-card, .soft-card,
.dashboard-card, .planning-card {
  border-radius: var(--radius); padding: 16px;
}
.soft-card {
  min-height: 88px; display: grid; place-items: center;
  text-align: center; color: var(--muted); font-size: 14px;
}
.card-head {
  display: flex; align-items: flex-start; flex-wrap: wrap;
  justify-content: space-between; gap: 10px;
}
.card-head .ctrl-type-badge { flex: 1 1 0; min-width: 0; }
.card-head .btn.compact      { flex-shrink: 0; }
.card-row { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.card-right { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; flex-shrink: 0; }


/* ── Badge type de contrôle ──────────────────────────────────── */
.ctrl-type-badge {
  display: inline-flex; align-items: center; flex-wrap: wrap; gap: 4px 6px;
  padding: 5px 12px; border-radius: 14px;
  background: var(--badge-bg, rgba(79,140,255,.14));
  border: 1px solid var(--badge-bd, rgba(79,140,255,.28));
  color: var(--badge-color, #b7d1ff);
  font-size: 12px; font-weight: 800; text-transform: uppercase;
  letter-spacing: .07em; white-space: normal; word-break: break-word; max-width: 100%;
}


/* ── Badge NC ────────────────────────────────────────────────── */
.nc-badge {
  display: inline-flex; align-items: center;
  padding: 6px 12px; border-radius: 999px;
  font-size: 12px; font-weight: 900;
  letter-spacing: .06em; text-transform: uppercase; white-space: nowrap;
}
.nc-badge.ok   { background: var(--ok-green-bg); border: 1px solid var(--ok-green-bd); color: var(--ok-green); }
.nc-badge.ko   { background: var(--nc-red-bg);   border: 1px solid var(--nc-red-bd);   color: var(--nc-red); font-size: 14px; font-weight: 900; }
.nc-badge.warn { background: rgba(255,191,95,.12); border: 1px solid rgba(255,191,95,.28); color: var(--warning); }


/* ── Compteur incrémental ────────────────────────────────────── */
.counter-wrap {
  display: flex; align-items: center;
  height: 52px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); overflow: hidden; background: var(--surface);
}
.counter-btn {
  flex: 0 0 52px; height: 100%; font-size: 22px; font-weight: 700;
  color: var(--muted); background: transparent; border: none; cursor: pointer;
  transition: background .12s, color .12s;
  display: flex; align-items: center; justify-content: center;
}
.counter-btn:active             { background: rgba(255,255,255,.07); color: var(--text); }
.counter-btn.counter-inc:active { color: #4ade80; }
.counter-btn.counter-dec:active { color: #f87171; }
.counter-val {
  flex: 1; text-align: center; font-size: 22px; font-weight: 800;
  color: var(--text); border-left: 1px solid var(--border);
  border-right: 1px solid var(--border); line-height: 52px;
  min-width: 0; transition: color .15s;
}


/* ── Légende formulaire ──────────────────────────────────────── */
.form-legend {
  font-size: 12px; color: var(--muted);
  background: rgba(167,139,250,.08); border: 1px solid rgba(167,139,250,.2);
  border-radius: var(--radius-sm); padding: 8px 12px; margin-bottom: 16px; line-height: 1.6;
}


/* ── Boutons gravité 0→3 ─────────────────────────────────────── */
.gravity-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 8px; }
.gravity-btn {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  padding: 10px 6px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--surface); color: var(--muted);
  cursor: pointer; transition: background .15s, border-color .15s, color .15s;
  font-size: 13px; font-weight: 700; min-width: 0; width: 100%;
}
.gravity-btn .grav-num { font-size: 16px; font-weight: 900; line-height: 1; }
.gravity-btn .grav-sub { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.grav-0.active { background: rgba(34,197, 94,.18); border-color: #22c55e; color: #4ade80; }
.grav-1.active { background: rgba(234,179,  8,.18); border-color: #eab308; color: #fbbf24; }
.grav-2.active { background: rgba(249,115, 22,.18); border-color: #f97316; color: #fb923c; }
.grav-3.active { background: rgba(239, 68, 68,.18); border-color: #ef4444; color: #f87171; }
.choice.grav-0:not(.active) { border-color: rgba(34,197, 94,.25); color: rgba(74,222,128,.55); }
.choice.grav-1:not(.active) { border-color: rgba(234,179, 8,.25); color: rgba(251,191,36,.55); }
.choice.grav-2:not(.active) { border-color: rgba(249,115,22,.25); color: rgba(251,146,60,.55); }
.choice.grav-3:not(.active) { border-color: rgba(239, 68,68,.25); color: rgba(248,113,113,.55); }
.gravity-btn:not(.active):hover { background: rgba(255,255,255,.05); border-color: var(--border-strong); }


/* ── C/NC et Oui/Non ─────────────────────────────────────────── */
.choice.choice-ok        { border-color: rgba(34,197,94,.3);  color: rgba(74,222,128,.7); }
.choice.choice-ko        { border-color: rgba(239,68,68,.3);  color: rgba(248,113,113,.7); }
.choice.choice-ok.active { background: rgba(34,197,94,.18);  border-color: #22c55e; color: #4ade80; }
.choice.choice-ko.active { background: rgba(239,68,68,.18);  border-color: #ef4444; color: #f87171; }


/* ── Badge générique ─────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 10px; border-radius: 999px;
  background: rgba(79,140,255,.14); border: 1px solid rgba(79,140,255,.24);
  color: #b7d1ff; font-size: 11px; font-weight: 800;
  text-transform: uppercase; letter-spacing: .08em;
}


h2      { margin: 12px 0 8px; font-size: 21px; }
.muted  { color: var(--muted); font-size: 14px; line-height: 1.55; }
.remark { margin-top: 6px; font-style: italic; }


/* ── Labels de champ ─────────────────────────────────────────── */
.label { font-size: 12px; color: #9fb0cb; margin: 0 0 8px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.req   { color: #ff8fa0; }


/* ── Inputs / Select / Textarea ──────────────────────────────── */
.input, select, textarea {
  width: 100%; border-radius: var(--radius-sm);
  border: 1px solid rgba(168,184,211,.22);
  background: rgba(8,16,31,.76); color: var(--text);
  padding: 14px 15px; min-height: 52px; outline: none;
  transition: border-color .16s, box-shadow .16s, background .16s;
  font-size: 15px;
}
.input:focus, select:focus, textarea:focus {
  border-color: rgba(110,165,255,.58);
  box-shadow: 0 0 0 4px rgba(79,140,255,.12);
  background: rgba(10,20,40,.88);
}
textarea      { min-height: 96px; resize: vertical; }
.readonly-box { opacity: .88; color: #cfe0ff; }


/* ── Grilles de champs ───────────────────────────────────────── */
.field-row     { display: grid; gap: 12px; margin-bottom: 16px; }
.form-top-grid { gap: 14px; grid-template-columns: 1fr; }
.grid-2 { display: grid; gap: 10px; grid-template-columns: 1fr; }
.grid-3 { display: grid; gap: 8px;  grid-template-columns: 1fr; }
.grid-4 { display: grid; gap: 8px;  grid-template-columns: repeat(2,1fr); }


/* ── Boutons de choix ────────────────────────────────────────── */
.choice {
  min-height: 48px; padding: 0 8px; border-radius: var(--radius-sm);
  border: 1px solid rgba(168,184,211,.2);
  background: rgba(255,255,255,.03); color: #dce8ff;
  font-weight: 700; font-size: 14px;
  transition: .16s background, .16s border-color, .16s color, .16s box-shadow;
}
.choice.active {
  background: linear-gradient(180deg, rgba(79,140,255,.36), rgba(79,140,255,.20));
  border-color: rgba(123,163,255,.50); color: #fff;
  box-shadow: 0 6px 16px rgba(79,140,255,.18);
}
.choice:active { transform: scale(.97); }


/* ── Titres de section ───────────────────────────────────────── */
.section-title {
  margin: 20px 0 12px; padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.02));
  border: 1px solid rgba(167,183,211,.14);
  font-size: 12px; font-weight: 800; letter-spacing: .10em;
  text-transform: uppercase; color: #dbe6fb;
}


/* ── Boutons principaux ──────────────────────────────────────── */
.btn {
  min-height: 52px; padding: 0 20px; border-radius: var(--radius-sm);
  border: 1px solid transparent; font-weight: 800; font-size: 15px;
  background: #253450; color: var(--text);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: .18s transform, .18s box-shadow, .18s background;
}
.btn:active    { transform: scale(.97); }
.btn-primary   { background: linear-gradient(180deg, var(--primary-2), var(--primary)); color: #fff; box-shadow: 0 10px 22px rgba(79,140,255,.28); }
.btn-secondary { background: rgba(255,255,255,.06); border-color: rgba(174,191,220,.18); color: #e9f0ff; }
.btn-ghost     { background: rgba(255,255,255,.05); border-color: rgba(174,191,220,.18); color: #e9f0ff; }
.btn-danger    { background: linear-gradient(180deg, #ff8398, #f0677d); color: #fff; }
.btn.compact   { min-height: 40px; padding: 0 14px; border-radius: 12px; font-size: 13px; }

/* Bouton déconnexion */
.btn-logout {
  width: 100%;
  background: rgba(240,103,125,.10);
  border: 1px solid rgba(240,103,125,.25);
  color: #ffb3be; font-size: 14px; min-height: 46px;
}
.btn-logout:active { background: rgba(240,103,125,.22); }


/* ── Boutons Annuler / Enregistrer — dans le flux normal ─────── */
.form-actions {
  display: flex;
  gap: 12px;
  margin-top: 20px;
  margin-bottom: 0;
  position: static;
}
.form-actions .btn { flex: 1; }


/* ── Footer actions (sticky, hors formulaire) ────────────────── */
.footer-actions {
  position: sticky;
  bottom: calc(var(--nav-h) + 12px + env(safe-area-inset-bottom));
  padding: 12px 14px; margin: 0 14px;
  display: flex; gap: 12px; border-radius: 20px;
  background: linear-gradient(180deg, rgba(7,12,24,0) 0, rgba(7,12,24,.90) 24%, rgba(7,12,24,.97) 100%);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  z-index: 10;
}
.footer-actions .btn { flex: 1; }


/* ── Drawer (menu burger) ────────────────────────────────────── */
#backdrop {
  position: fixed; inset: 0;
  background: rgba(4,9,18,.54);
  opacity: 0; pointer-events: none;
  transition: opacity .2s; z-index: 40;
}
#backdrop.open { opacity: 1; pointer-events: auto; }

#drawer {
  position: fixed; top: 0; left: 0;
  width: min(86vw, 300px); height: 100%;
  display: flex; flex-direction: column;
  background: rgba(8,15,28,.96);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  border-right: 1px solid rgba(177,193,222,.16);
  transform: translateX(-100%); transition: transform .22s; z-index: 41;
  overflow-y: auto;
}
#drawer.open { transform: translateX(0); }

.drawer-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 16px 12px;
  border-bottom: 1px solid rgba(177,193,222,.10);
  flex-shrink: 0;
}
.drawer-brand { font-size: 18px; font-weight: 800; }

/* Bloc utilisateur connecté */
.drawer-user {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px 10px;
  border-bottom: 1px solid rgba(177,193,222,.08);
  flex-shrink: 0;
}
.drawer-user-icon { font-size: 22px; flex-shrink: 0; }
.drawer-user-name { font-size: 13px; color: var(--muted); line-height: 1.5; }
.drawer-user-name strong { color: var(--text); font-size: 14px; font-weight: 800; display: block; }

.drawer-menu { list-style: none; margin: 0; padding: 8px 12px; flex: 1; }
.drawer-menu li { margin-bottom: 4px; }
.drawer-item {
  width: 100%; text-align: left; height: 48px; padding: 0 14px;
  border-radius: 12px; border: 1px solid rgba(177,193,222,.10);
  background: rgba(255,255,255,.03); color: var(--text);
  font-size: 14px; font-weight: 700;
  transition: .15s background, .15s border-color;
}
.drawer-item:active { background: rgba(79,140,255,.18); border-color: rgba(123,163,255,.30); }

/* Zone basse drawer */
.drawer-footer {
  padding: 12px 16px calc(16px + env(safe-area-inset-bottom));
  border-top: 1px solid rgba(177,193,222,.08);
  flex-shrink: 0;
}


/* ── Bandeau statut persistant ───────────────────────────────── */
.persistent-status {
  margin: 10px 0 0; padding: 12px 14px; border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 700; line-height: 1.4;
}
.persistent-status.offline { border: 1px solid rgba(255,191,95,.28); background: rgba(255,191,95,.08); color: #ffe2a8; }
.persistent-status.pending { border: 1px solid rgba(79,140,255,.28); background: rgba(79,140,255,.10); color: #caddff; }


/* ── Boutons d'action (édition / suppression) ────────────────── */
.row-actions { display: flex; gap: 8px; justify-content: flex-end; }
.icon-action {
  width: 40px; height: 40px; border-radius: 12px;
  border: 1px solid rgba(177,193,222,.18); background: rgba(255,255,255,.05);
  color: #edf4ff; display: grid; place-items: center;
  transition: .15s background, .15s border-color;
}
.icon-action:active        { background: rgba(255,255,255,.12); }
.icon-action.delete        { color: #ffc4cf; }
.icon-action.delete:active { background: rgba(240,103,125,.18); }


/* ── Calendrier ──────────────────────────────────────────────── */
.calendar-nav  { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.calendar-grid { display: grid; grid-template-columns: repeat(7,1fr); gap: 6px; }
.calendar-weekday, .calendar-day {
  min-height: 40px; display: grid; place-items: center;
  border-radius: 10px; border: 1px solid rgba(177,193,222,.12);
  background: rgba(255,255,255,.03); font-size: 13px;
}
.calendar-weekday  { font-size: 11px; color: var(--muted); font-weight: 800; border: none; background: none; }
.calendar-day      { color: var(--text); cursor: pointer; transition: .15s background; }
.calendar-day.empty    { opacity: .24; pointer-events: none; }
.calendar-day.has-data { background: rgba(62,207,142,.14); border-color: rgba(62,207,142,.32); }
.calendar-day.selected { box-shadow: 0 0 0 2px rgba(79,140,255,.50); border-color: transparent; }
.calendar-day.today    { border-color: rgba(110,165,255,.52); }
.calendar-day:active   { background: rgba(79,140,255,.22); }


/* ── Bottom nav ──────────────────────────────────────────────── */
.bottom-nav {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(14px + env(safe-area-inset-bottom)); z-index: 35;
  max-width: 780px; width: calc(100% - 28px);
  
  /* CHANGEMENT ICI : On passe de grid à flex pour le centrage dynamique */
  display: flex; 
  justify-content: center; /* Centre les boutons horizontalement */
  align-items: center;
  gap: 8px; 
  
  padding: 8px; border-radius: 22px;
  background: rgba(9,14,24,.88);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(177,193,222,.12); box-shadow: var(--shadow);
}

.nav-btn {
  /* CHANGEMENT ICI : width: 100% ou flex: 1 pour qu'ils s'adaptent */
  flex: 1; 
  max-width: 160px; /* Optionnel : évite que 2 boutons ne deviennent trop larges */
  
  height: 56px; border-radius: 14px; border: 1px solid transparent; background: transparent;
  color: #aebdd9; display: grid; grid-template-rows: auto auto;
  place-items: center; gap: 3px; padding: 6px 0;
  transition: .16s background, .16s color, .16s border-color;
}

/* SÉCURITÉ AFFICHAGE */
.admin-only { 
  display: none !important; 
}

body[data-role="ADMIN"] .admin-only { 
  display: grid !important; /* On remet en grid car le bouton lui-même utilise grid-template-rows */
}

/* LE RESTE DE VOTRE CSS INCHANGÉ */
.nav-btn.active { background: linear-gradient(180deg, rgba(79,140,255,.32), rgba(79,140,255,.16)); border-color: rgba(123,163,255,.30); color: #fff; }
.nav-btn:active { transform: scale(.95); }
.nav-icon { width: 22px; height: 22px; display: block; opacity: .88; }
.nav-btn.active .nav-icon { opacity: 1; filter: drop-shadow(0 0 8px rgba(110,165,255,.30)); }
.nav-label { font-size: 10px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; line-height: 1; }


/* ── Toasts ──────────────────────────────────────────────────── */
#toastStack {
  position: fixed; top: 18px; left: 50%; transform: translateX(-50%);
  z-index: 70; width: min(92vw, 420px); display: grid; gap: 10px; pointer-events: none;
}
.toast {
  pointer-events: auto; padding: 14px 16px; border-radius: var(--radius-sm);
  border: 1px solid rgba(177,193,222,.14); background: rgba(8,15,28,.96);
  box-shadow: var(--shadow); display: flex; gap: 12px; align-items: flex-start;
  animation: slideDown .22s ease; transition: opacity .18s, transform .18s;
}
.toast-title   { font-size: 12px; font-weight: 900; letter-spacing: .04em; text-transform: uppercase; }
.toast-message { font-size: 14px; line-height: 1.45; color: #dbe6fb; margin-top: 3px; }
.toast.success { border-color: rgba(62,207,142,.28); }
.toast.success .toast-title { color: #96f1c4; }
.toast.error   { border-color: rgba(240,103,125,.30); }
.toast.error   .toast-title { color: #ffbac6; }
.toast.info    { border-color: rgba(79,140,255,.30); }
.toast.info    .toast-title { color: #b8d0ff; }
.toast.warning { border-color: rgba(255,191,95,.30); }
.toast.warning .toast-title { color: #ffe0a0; }


/* ── Modale de confirmation ──────────────────────────────────── */
#confirmLayer {
  position: fixed; inset: 0; z-index: 80;
  display: none; align-items: flex-end; justify-content: center;
  background: rgba(4,9,18,.58); padding: 18px;
}
#confirmLayer.open { display: flex; }
.confirm-modal   { width: min(100%, 440px); padding: 20px; border-radius: 26px; }
.confirm-title   { font-size: 20px; font-weight: 800; margin-bottom: 10px; }
.confirm-message { color: #c8d7f2; line-height: 1.55; font-size: 14px; }
.confirm-actions { display: flex; gap: 10px; margin-top: 18px; }
.confirm-actions .btn { flex: 1; }


/* ── Animations ──────────────────────────────────────────────── */
@keyframes slideDown { from { transform: translateY(-8px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }


/* ── Responsive tablette ─────────────────────────────────────── */
@media (min-width: 680px) {
  .form-top-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .grid-2        { grid-template-columns: repeat(2, 1fr); }
  .grid-3        { grid-template-columns: repeat(3, 1fr); }
  .grid-4        { grid-template-columns: repeat(4, 1fr); }
  .two-blocks    { grid-template-columns: 1.1fr .9fr; }
  .section       { padding: 18px; }
  .hero-strip    { margin: 14px 18px 0; }
}
/* --- SÉCURITÉ AFFICHAGE --- */

/* 1. On cache TOUS les éléments admin par défaut */
.admin-only {
  display: none !important;
}

/* 2. On les affiche UNIQUEMENT si le body a l'attribut ADMIN */
/* Le sélecteur doit être collé : body[data-role="ADMIN"] */
body[data-role="ADMIN"] .admin-only {
  display: block !important; 
  /* ou display: flex !important; si tes boutons sont dans un menu flex */
}

.input-with-action {
  display: flex; gap: 6px; align-items: flex-start;
}
.input-with-action input,
.input-with-action textarea {
  flex: 1;
}
.btn-input-action {
  flex-shrink: 0;
  background: none;
  border: 1.5px solid var(--border, #334155);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 18px;
  cursor: pointer;
  line-height: 1;
}
.btn-input-action.recording {
  background: #ef444422;
  border-color: #ef4444;
}
#qrOverlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.85);
  z-index: 9999;
  display: flex; align-items: center; justify-content: center;
}
.qr-modal {
  display: flex; flex-direction: column; align-items: center;
  gap: 12px; padding: 20px;
  background: var(--surface, #1e293b);
  border-radius: 16px; width: 90%; max-width: 380px;
}
#qrVideo {
  width: 100%; border-radius: 10px;
  max-height: 300px; object-fit: cover;
}
.qr-label { color: var(--text, #f1f5f9); font-size: 14px; }
