/* ============================================================
   ÉTUDIOS — Design System v2.1
   Refonte 2026-07-03 : moderne, responsive mobile-first,
   dark mode natif, rétro-compatible avec les vues existantes.
   ============================================================ */

/* ---------- POLICE : Inter auto-hébergée (statique par poids) ----------
   Auparavant chargée depuis fonts.googleapis.com. Certains navigateurs gèrent
   mal le fichier "police variable" unique que Google sert par défaut aux
   navigateurs récents pour ce sous-ensemble latin (un seul binaire interpolé
   pour tous les poids) : le poids demandé s'affichait alors gras et flou,
   avec un rendu incohérent selon le navigateur. Fichiers statiques distincts
   par poids ci-dessous = rendu identique partout, et plus de dépendance à un
   CDN tiers (latence, blocage réseau d'établissement, RGPD). */
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 300; font-display: swap; src: url('/fonts/inter/inter-latin-300.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 400; font-display: swap; src: url('/fonts/inter/inter-latin-400.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 500; font-display: swap; src: url('/fonts/inter/inter-latin-500.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 600; font-display: swap; src: url('/fonts/inter/inter-latin-600.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 700; font-display: swap; src: url('/fonts/inter/inter-latin-700.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 800; font-display: swap; src: url('/fonts/inter/inter-latin-800.woff2') format('woff2'); }

/* ---------- TOKENS : thème clair (défaut) ---------- */
:root {
  --brand-50:  #E9F5EE;
  --brand-100: #CFEADB;
  --brand-200: #A5D8BC;
  --brand-300: #6FBF95;
  --brand-400: #45A876;
  --brand-500: #2F8F5B;
  --brand-600: #237447;
  --brand-700: #1C5E3A;
  --brand-800: #17492E;
  --brand-900: #123822;

  --teal-500:  #2E7D8F;
  --teal-600:  #245764;

  --bg:          #F5F8F4;
  --surface:     #FFFFFF;
  --surface-2:   #EEF3EA;
  --surface-3:   #E4EDE0;
  --border:      #DCE7D8;
  --border-soft: #E8EFE4;

  --text:        #16241C;
  --text-light:  #56685D;
  --text-faint:  #7E8E84;

  --primary:        var(--brand-500);
  --primary-strong: var(--brand-700);
  --primary-soft:   var(--brand-50);
  --error:        #C0392B;
  --error-soft:   #FBEBE9;
  --success:      #1F9D57;
  --success-soft: #E6F6EC;
  --warning:      #B9770E;
  --warning-soft: #FBF1DE;
  --info:         #2E7D8F;
  --info-soft:    #E4F1F4;
  --orange:       #C2691C;

  /* Alias rétro-compatibles (inline dans les vues) */
  --green:        var(--brand-500);
  --green-dark:   var(--brand-700);
  --green-deeper: var(--brand-800);
  --green-light:  var(--brand-300);
  --green-pale:   var(--brand-50);
  --blue:         var(--teal-500);
  --blue-dark:    var(--teal-600);
  --blue-deep:    #0D3B5E;
  --blue-light:   #74C0D8;
  --blue-pale:    var(--info-soft);
  --white:        var(--surface);
  --gray-light:   var(--surface-2);
  --gray-mid:     var(--border);

  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-xl: 28px;
  --sh-sm: 0 1px 2px rgba(16,32,24,.06), 0 1px 3px rgba(16,32,24,.05);
  --sh-md: 0 4px 12px rgba(16,32,24,.08), 0 2px 4px rgba(16,32,24,.04);
  --sh-lg: 0 12px 32px rgba(16,32,24,.14);

  --font: 'Inter', system-ui, -apple-system, sans-serif;
  --t: .2s ease;

  --topbar-h: 60px;
  --sidebar-w: 250px;
  --bottomnav-h: 62px;

  color-scheme: light;
}

/* ---------- TOKENS : thème sombre ---------- */
[data-theme="dark"] {
  --bg:          #0E1512;
  --surface:     #16211C;
  --surface-2:   #1D2B24;
  --surface-3:   #26362D;
  --border:      #2C3D34;
  --border-soft: #24332B;

  --text:        #E8EFE9;
  --text-light:  #A2B3A8;
  --text-faint:  #7C8D82;

  --primary:        var(--brand-400);
  --primary-strong: var(--brand-300);
  --primary-soft:   #14301F;
  --error:        #F1897E;
  --error-soft:   #35201D;
  --success:      #52C888;
  --success-soft: #16301F;
  --warning:      #E0AC57;
  --warning-soft: #33280F;
  --info:         #6FC0D0;
  --info-soft:    #122E34;

  --green:        var(--brand-400);
  --green-dark:   var(--brand-300);
  --green-deeper: var(--brand-200);
  --green-light:  var(--brand-300);
  --green-pale:   #14301F;
  --blue:         #5EB6C8;
  --blue-dark:    #8FCEDC;
  --blue-light:   #A9E0EC;
  --blue-pale:    #122E34;
  --white:        var(--surface);
  --gray-light:   var(--surface-2);
  --gray-mid:     var(--border);

  --sh-sm: 0 1px 2px rgba(0,0,0,.4);
  --sh-md: 0 4px 14px rgba(0,0,0,.45);
  --sh-lg: 0 14px 36px rgba(0,0,0,.55);

  color-scheme: dark;
}

/* ---------- RESET ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font); color: var(--text); line-height: 1.6;
  background: var(--bg);
  transition: background .25s ease, color .25s ease;
  overflow-x: hidden;
  /* Sans ça, Inter (police fine) rend gras/flou sur macOS et Retina : le
     navigateur applique un anti-aliasing "subpixel" pensé pour des polices
     système plus épaisses. */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
img, svg { max-width: 100%; }
a { color: inherit; text-decoration: none; }
/* La règle ci-dessus rend les liens indiscernables du texte : à utiliser sur tout lien
   textuel (hors boutons et menus) pour qu'on voie où cliquer. */
.link { color: var(--primary-strong); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.link:hover { color: var(--primary); text-decoration-thickness: 2px; }
h1, h2, h3, h4 { line-height: 1.25; color: var(--text); text-wrap: balance; }
h1 { font-size: clamp(1.5rem, 4vw, 1.9rem); font-weight: 800; letter-spacing: -.02em; }
h2 { font-size: 1.25rem; font-weight: 700; }
h3 { font-size: 1.05rem; font-weight: 600; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; border-radius: 4px; }

/* ============================================================
   TOP BAR (app authentifiée)
   ============================================================ */
.topbar {
  position: sticky; top: 0; z-index: 50; height: var(--topbar-h);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border); display: flex; align-items: center;
}
.topbar-inner { width: 100%; max-width: 1400px; margin: 0 auto; padding: 0 1rem; display: flex; align-items: center; gap: .6rem; }
.topbar-logo { display: flex; align-items: center; gap: .5rem; font-weight: 800; font-size: 1.1rem; color: var(--primary-strong); }
.topbar-logo svg { width: 26px; height: 26px; color: var(--primary); }
.topbar-logo img { width: 30px; height: 30px; display: block; }
.nav-logo img { display: block; }
/* Marque textuelle « etudes.gestios.fr » */
.brand-wordmark { display: inline-flex; align-items: baseline; font-weight: 800; letter-spacing: -.02em; line-height: 1; }
.brand-wordmark .bw-1 { color: #17512c; }
.brand-wordmark .bw-dot { color: #52a55e; }
.brand-wordmark .bw-2 { color: #37474f; }
.brand-wordmark .bw-tld { color: #607d8b; font-size: .72em; font-weight: 700; margin-left: .03em; }
[data-theme="dark"] .brand-wordmark .bw-1 { color: #6cc24a; }
[data-theme="dark"] .brand-wordmark .bw-2 { color: #e2e8f0; }
[data-theme="dark"] .brand-wordmark .bw-tld { color: #94a3b8; }
/* En mode sombre, l'emblème vert foncé manque de contraste : pastille claire derrière. */
[data-theme="dark"] .topbar-logo img { background: #fff; border-radius: 8px; padding: 3px; box-sizing: content-box; }
/* Logo complet du hero de la landing */
.hero-logo { display: block; margin: 0 auto 1.6rem; width: auto; max-width: min(460px, 82vw); height: auto; }
.topbar-spacer { flex: 1; }
.topbar-actions { display: flex; align-items: center; gap: .3rem; }

.icon-btn {
  position: relative; width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--r-sm); border: 1px solid transparent; background: transparent;
  color: var(--text-light); cursor: pointer; font-size: 1.15rem; transition: var(--t);
}
.icon-btn:hover, .icon-btn:focus-visible { background: var(--surface-2); color: var(--text); }
.sidebar-toggle { display: none; }

.topbar-user { display: flex; align-items: center; gap: .5rem; padding: .2rem .4rem .2rem .2rem; border-radius: 999px; }
.topbar-user .avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--primary); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: .85rem; }
.topbar-user .uname { font-size: .85rem; font-weight: 600; }
@media (max-width: 640px) { .topbar-user .uname { display: none; } }

.notif-badge {
  position: absolute; top: 4px; right: 4px; min-width: 16px; height: 16px; padding: 0 4px;
  background: var(--error); color: #fff; font-size: .62rem; font-weight: 700;
  border-radius: 10px; display: flex; align-items: center; justify-content: center;
}

/* ============================================================
   LAYOUT : sidebar (desktop) + main + bottom nav (mobile)
   ============================================================ */
.app-shell { display: flex; min-height: calc(100vh - var(--topbar-h)); }

.app-sidebar {
  width: var(--sidebar-w); flex-shrink: 0; background: var(--surface);
  border-right: 1px solid var(--border); padding: 1rem .75rem;
  position: sticky; top: var(--topbar-h); height: calc(100vh - var(--topbar-h)); overflow-y: auto;
}
.side-user { display: flex; align-items: center; gap: .6rem; padding: .6rem .5rem 1rem; border-bottom: 1px solid var(--border-soft); margin-bottom: .5rem; }
.side-user .avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--primary); color:#fff; display:flex; align-items:center; justify-content:center; font-weight:700; flex-shrink: 0; }
.side-user .meta { font-size: .85rem; overflow: hidden; }
.side-user .meta strong { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-user .meta span { color: var(--text-light); font-size: .78rem; }

.side-section { font-size: .68rem; text-transform: uppercase; letter-spacing: .08em; color: var(--text-faint); font-weight: 700; padding: .9rem .6rem .35rem; }
.side-menu { list-style: none; display: flex; flex-direction: column; gap: 2px; }
.side-menu a {
  display: flex; align-items: center; gap: .7rem; padding: .6rem .7rem; border-radius: var(--r-sm);
  color: var(--text-light); font-weight: 500; font-size: .92rem; transition: var(--t); min-height: 42px;
}
.side-menu a .ico { width: 20px; text-align: center; font-size: 1.05rem; }
.side-menu a:hover { background: var(--surface-2); color: var(--text); }
.side-menu a.active { background: var(--primary-soft); color: var(--primary-strong); font-weight: 700; }

.app-main { flex: 1; min-width: 0; padding: 1.5rem; padding-bottom: 3rem; }
.app-main-inner { max-width: 1180px; margin: 0 auto; }

.sidebar-backdrop { display: none; position: fixed; inset: var(--topbar-h) 0 0 0; z-index: 45; background: rgba(10,20,15,.45); backdrop-filter: blur(2px); }

.bottom-nav {
  display: none; position: fixed; bottom: 0; left: 0; right: 0; z-index: 48;
  background: color-mix(in srgb, var(--surface) 95%, transparent);
  backdrop-filter: saturate(180%) blur(12px); -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-top: 1px solid var(--border); padding-bottom: env(safe-area-inset-bottom);
}
.bottom-nav-row { display: flex; align-items: stretch; justify-content: space-around; height: var(--bottomnav-h); }
.bottom-nav a, .bottom-nav button {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--text-light); font-size: .62rem; font-weight: 600; background: none; border: none; cursor: pointer; transition: var(--t); min-width: 48px;
}
.bottom-nav a .ico, .bottom-nav button .ico { font-size: 1.3rem; line-height: 1; }
.bottom-nav a.active { color: var(--primary); }
.bottom-nav a:active, .bottom-nav button:active { background: var(--surface-2); }

.more-sheet {
  display: none; position: fixed; bottom: calc(var(--bottomnav-h) + env(safe-area-inset-bottom)); left: 0; right: 0;
  z-index: 47; background: var(--surface); border-top: 1px solid var(--border); box-shadow: var(--sh-lg); padding: .5rem;
}
.more-sheet.open { display: block; }
.more-sheet a { display: flex; align-items: center; gap: .75rem; padding: .8rem .9rem; border-radius: var(--r-sm); color: var(--text); font-weight: 500; }
.more-sheet a:active { background: var(--surface-2); }
.more-sheet a .ico { font-size: 1.2rem; width: 24px; text-align: center; }

/* ============================================================
   BOUTONS
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .62rem 1.15rem; border-radius: var(--r-sm);
  font-family: var(--font); font-size: .92rem; font-weight: 600; line-height: 1.1;
  cursor: pointer; border: 1px solid transparent; transition: var(--t); text-decoration: none; min-height: 42px; white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
/* Variante compacte : min-height/padding de .btn sont trop hauts pour une rangée
   d'actions dans une carte (les boutons passaient à la ligne). */
.btn-sm { padding: .3rem .5rem; font-size: .75rem; min-height: 30px; gap: .25rem; }
.btn-primary { background: var(--primary); color: #fff; box-shadow: var(--sh-sm); }
.btn-primary:hover, .btn-primary:focus-visible { background: var(--primary-strong); }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn-secondary:hover, .btn-secondary:focus-visible { background: var(--surface-2); border-color: var(--text-faint); }
.btn-success { background: var(--success); color: #fff; }
.btn-danger { background: var(--error); color: #fff; }
.form-button {
  display: inline-flex; align-items: center; justify-content: center; gap:.5rem;
  padding: .7rem 1.4rem; border-radius: var(--r-sm); background: var(--primary); color: #fff;
  font-weight: 700; font-size: .95rem; border: none; cursor: pointer; transition: var(--t); min-height: 44px;
}
.form-button:hover { background: var(--primary-strong); }

/* ============================================================
   CARTES / GRILLES / EN-TÊTE
   ============================================================ */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); padding: 1.35rem; box-shadow: var(--sh-sm); transition: box-shadow var(--t), transform var(--t); }
.card-title { font-size: 1.05rem; font-weight: 700; color: var(--text); margin-bottom: .25rem; }
.card-meta { font-size: .82rem; color: var(--text-light); }
.card-description { font-size: .9rem; color: var(--text-light); margin-top: .5rem; line-height: 1.55; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.1rem; }
.header { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.header h1 { margin-bottom: .15rem; }
.header-actions { display: flex; gap: .5rem; flex-wrap: wrap; }

/* ============================================================
   FORMULAIRES
   ============================================================ */
.form-group { margin-bottom: 1.1rem; }
.form-label { display: block; font-size: .85rem; font-weight: 600; color: var(--text); margin-bottom: .35rem; }
.form-input, .form-textarea, .form-select {
  width: 100%; padding: .65rem .8rem; border-radius: var(--r-sm); border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font-family: var(--font); font-size: .95rem; transition: var(--t); min-height: 44px;
}
.form-textarea { min-height: 110px; resize: vertical; line-height: 1.55; }
.form-input:focus, .form-textarea:focus, .form-select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.form-input.is-error, .form-textarea.is-error, .form-select.is-error { border-color: var(--error); }
.form-input::placeholder, .form-textarea::placeholder { color: var(--text-faint); }

/* ============================================================
   BADGES / ALERTES
   ============================================================ */
.badge { display: inline-flex; align-items: center; gap: .3rem; padding: .22rem .6rem; border-radius: 999px; font-size: .74rem; font-weight: 600; line-height: 1; background: var(--surface-2); color: var(--text-light); }
.badge-secondary { background: var(--surface-2); color: var(--text-light); }
.badge-success { background: var(--success-soft); color: var(--success); }
.badge-danger { background: var(--error-soft); color: var(--error); }
.badge-warning { background: var(--warning-soft); color: var(--warning); }

.alert { display: flex; align-items: flex-start; gap: .6rem; padding: .85rem 1.05rem; border-radius: var(--r-sm); font-size: .9rem; margin-bottom: 1.25rem; border: 1px solid transparent; }
.alert-success { background: var(--success-soft); color: var(--success); border-color: color-mix(in srgb, var(--success) 30%, transparent); }
.alert-error   { background: var(--error-soft);   color: var(--error);   border-color: color-mix(in srgb, var(--error) 30%, transparent); }
.alert-info    { background: var(--info-soft);    color: var(--info);    border-color: color-mix(in srgb, var(--info) 30%, transparent); }
.alert-danger  { background: var(--error-soft);   color: var(--error);   border-color: color-mix(in srgb, var(--error) 30%, transparent); }
.hidden { display: none !important; }

/* Spinner & indicateur d'activité IA */
.spinner { display:inline-block; width:20px; height:20px; border:3px solid var(--border); border-top-color: var(--primary); border-radius:50%; animation: spin .8s linear infinite; vertical-align:middle; flex:none; }
.spinner-lg { width:34px; height:34px; border-width:4px; }
@keyframes spin { to { transform: rotate(360deg); } }
.ai-working-card { border:1px solid var(--primary) !important; background: var(--primary-soft) !important; }
.ai-progress-bar { position:relative; height:6px; border-radius:999px; background: var(--border); overflow:hidden; margin-top:.6rem; max-width:340px; }
.ai-progress-bar > span { position:absolute; left:-40%; width:40%; height:100%; border-radius:999px; background: var(--primary); animation: aiprog 1.3s ease-in-out infinite; }
@keyframes aiprog { 0%{ left:-40%; } 100%{ left:100%; } }
.badge-pulse { animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity:.45; } }

/* Barre de progression des générations IA multi-étapes (cf. partials/ai-progress).
   Rayures diagonales qui défilent en continu tant que .is-working est présent :
   montre visuellement que ça travaille même quand le % n'avance pas (une étape
   peut prendre 1-2 min). Retrait de .is-working = figée (fin de génération). */
.ai-gen-bar { position: relative; height: 12px; border-radius: 999px; background: var(--border); overflow: hidden; }
.ai-gen-bar-fill {
  height: 100%; width: 0; border-radius: 999px;
  background-color: #6d3ff0;
  background-image: repeating-linear-gradient(45deg, rgba(255,255,255,.28) 0 12px, transparent 12px 24px);
  background-size: 34px 100%;
  transition: width .4s ease, background-color .3s ease;
}
.ai-gen-bar-fill.is-working { animation: ai-gen-stripes .7s linear infinite; }
@keyframes ai-gen-stripes { from { background-position: 0 0; } to { background-position: 34px 0; } }
.alert-warning { background: var(--warning-soft); color: var(--warning); border-color: color-mix(in srgb, var(--warning) 30%, transparent); }

/* Tables dans une carte */
.card table th { color: var(--text); }
.card table td, .card table th { border-color: var(--border) !important; }

.app-version { text-align: center; font-size: .72rem; color: var(--text-faint); padding: 1.5rem 0 .5rem; margin-top: 1rem; }

/* ============================================================
   PAGES PUBLIQUES (accueil marketing) — préservées
   ============================================================ */
.site-nav {
  position: sticky; top: 0; z-index: 100;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--gray-mid); padding: .85rem 1rem; transition: box-shadow var(--t);
}
.site-nav.scrolled { box-shadow: var(--sh-sm); }
.nav-inner { max-width: 1200px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.nav-logo { display: flex; align-items: center; gap: .6rem; font-weight: 700; font-size: 1.05rem; color: var(--green-dark); }
.nav-logo-icon { width: 28px; height: 28px; }
.nav-links { display: flex; align-items: center; gap: 1.5rem; list-style: none; }
.nav-links a { color: var(--text-light); font-size: .9rem; font-weight: 500; transition: color var(--t); padding: .25rem 0; border-bottom: 2px solid transparent; }
.nav-links a:hover { color: var(--green-dark); border-bottom-color: var(--green-dark); }
.nav-cta { display: flex; gap: .75rem; }

/* Auth (login / register) — préservées */
.auth-page {
  min-height: 100dvh;
  background: linear-gradient(150deg, var(--green-deeper) 0%, var(--green-dark) 25%, #2d7d62 50%, var(--blue-dark) 75%, var(--blue-deep) 100%);
  display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 2rem 1rem; overflow: hidden; position: relative;
}
.auth-card {
  position: relative; z-index: 1; background: rgba(255,255,255,.12);
  backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255,255,255,.22); border-radius: var(--r-lg);
  padding: 2.75rem 2.25rem 2.25rem; width: 100%; max-width: 460px;
  box-shadow: 0 8px 64px rgba(0,0,0,.35); animation: fade-enter .7s ease both;
}
@keyframes fade-enter { from { opacity: 0; transform: translateY(30px) scale(.97); } to { opacity: 1; transform: translateY(0) scale(1); } }
.auth-card h1 { font-size: 1.7rem; font-weight: 700; color: #fff; text-align: center; line-height: 1.25; margin-bottom: .4rem; }
.auth-sub { text-align: center; color: rgba(255,255,255,.72); font-size: .95rem; margin-bottom: 1.75rem; }
.auth-form { display: flex; flex-direction: column; gap: .75rem; }
.auth-field { display: flex; flex-direction: column; gap: .4rem; }
.auth-field label { color: rgba(255,255,255,.8); font-size: .875rem; font-weight: 500; }
.auth-input { width: 100%; padding: .875rem 1.1rem; background: rgba(255,255,255,.15); border: 1.5px solid rgba(255,255,255,.3); border-radius: var(--r-md); color: #fff; font-size: 1rem; font-family: var(--font); transition: var(--t); outline: none; }
.auth-input::placeholder { color: rgba(255,255,255,.45); }
.auth-input:focus { border-color: rgba(255,255,255,.8); background: rgba(255,255,255,.22); }
/* Le menu déroulant natif s'affiche sur fond clair : forcer un texte foncé pour les options
   (sinon texte blanc sur fond blanc = illisible). Le libellé sélectionné reste blanc via .auth-input. */
select.auth-input { -webkit-appearance: none; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23ffffff'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 1rem center; background-size: .9rem; padding-right: 2.6rem; }
select.auth-input option { color: #1a1a2e; background: #fff; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
  .app-sidebar { position: fixed; top: var(--topbar-h); left: 0; z-index: 46; transform: translateX(-100%); transition: transform .25s ease; box-shadow: var(--sh-lg); }
  .app-shell.sidebar-open .app-sidebar { transform: translateX(0); }
  .app-shell.sidebar-open .sidebar-backdrop { display: block; }
  .sidebar-toggle { display: inline-flex; }
  .bottom-nav { display: block; }
  .app-main { padding: 1rem; padding-bottom: calc(var(--bottomnav-h) + env(safe-area-inset-bottom) + 1.5rem); }
  .nav-links { display: none; }
}
@media (min-width: 901px) { .bottom-nav, .more-sheet { display: none !important; } }
@media (max-width: 560px) {
  .grid { grid-template-columns: 1fr; }
  .app-main { padding: .85rem; padding-bottom: calc(var(--bottomnav-h) + env(safe-area-inset-bottom) + 1.5rem); }
  .header { margin-bottom: 1rem; }
  .card { padding: 1.1rem; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }

/* ============================================================
   QUILL (éditeur riche) — le thème "snow" impose Helvetica/Arial en dur,
   ce qui décroche du reste de l'app (Inter). Rechargé après app.css par CDN,
   donc c'est bien ce fichier qui doit avoir le dernier mot.
   ============================================================ */
.ql-editor, .ql-editor.ql-blank::before, .ql-toolbar { font-family: var(--font) !important; }

/* La zone de saisie garde un fond blanc quel que soit le thème (cf. rich-editor.blade.php),
   mais son texte héritait de --text — quasi blanc en thème sombre = illisible sur fond blanc. */
.ql-editor { color: #16241C !important; }
.ql-editor.ql-blank::before { color: #6B7A70 !important; }

/* ============================================================
   BOUTON FLOTTANT "METTRE A JOUR" (PWA) — standard PNDEV
   ============================================================ */
.app-update-btn {
  position: fixed; right: 1.1rem; bottom: 1.1rem; z-index: 60;
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .65rem 1.1rem; border: 1px solid var(--border);
  border-radius: 999px; background: var(--surface); color: var(--text);
  font-family: var(--font); font-size: .85rem; font-weight: 700;
  box-shadow: var(--sh-md); cursor: pointer;
  transition: opacity .25s ease, transform .25s ease, background .15s ease;
}
.app-update-btn:hover:not(:disabled) { background: var(--surface-2); border-color: var(--primary); }
.app-update-btn:disabled { opacity: .75; cursor: default; }
.app-update-btn--hidden { opacity: 0; transform: translateY(1.5rem); pointer-events: none; }
.app-update-btn #app-update-icon { color: var(--primary-strong); font-size: 1.05rem; line-height: 1; }
.app-update-spin { display: inline-block; animation: app-update-spin .8s linear infinite; }
@keyframes app-update-spin { to { transform: rotate(360deg); } }

@media (max-width: 900px) {
  .app-update-btn { bottom: calc(var(--bottomnav-h) + env(safe-area-inset-bottom) + .85rem); }
}
