/* ==========================================================================
   FocusBoard — Design System Dark Mode (Mobile-First)
   ========================================================================== */

:root {
  --bg-base: #0b0f19;
  --bg-elevated: rgba(17, 24, 39, 0.72);
  --bg-elevated-hover: rgba(23, 32, 52, 0.85);
  --bg-input: rgba(10, 14, 24, 0.85);

  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);

  --text-primary: #f3f6fc;
  --text-secondary: #9aa5b8;
  --text-muted: #66738a;

  /* Couleurs d'état */
  --emerald: #10b981;
  --emerald-bg: rgba(16, 185, 129, 0.14);
  --emerald-border: rgba(16, 185, 129, 0.35);

  --amber: #f59e0b;
  --amber-bg: rgba(245, 158, 11, 0.14);
  --amber-border: rgba(245, 158, 11, 0.35);

  --rose: #f43f5e;
  --rose-bg: rgba(244, 63, 94, 0.14);
  --rose-border: rgba(244, 63, 94, 0.35);

  --sky: #38bdf8;
  --sky-bg: rgba(56, 189, 248, 0.14);
  --sky-border: rgba(56, 189, 248, 0.35);

  --violet: #a78bfa;
  --violet-bg: rgba(167, 139, 250, 0.14);
  --violet-border: rgba(167, 139, 250, 0.35);

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --radius-pill: 999px;

  --shadow-card: 0 12px 32px -12px rgba(0, 0, 0, 0.65);
  --shadow-fab: 0 14px 34px -6px rgba(56, 189, 248, 0.35);
  --transition: 180ms cubic-bezier(0.22, 1, 0.36, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background-color: var(--bg-base);
  color: var(--text-primary);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

button,
input,
select,
textarea {
  font-family: inherit;
  color: inherit;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.85em;
  background: rgba(255, 255, 255, 0.07);
  padding: 0.15em 0.4em;
  border-radius: 6px;
}

.hidden {
  display: none !important;
}

.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;
}

/* Fond ambiant subtil */
.ambient-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(600px circle at 15% 10%, rgba(56, 189, 248, 0.08), transparent 60%),
    radial-gradient(500px circle at 85% 85%, rgba(16, 185, 129, 0.07), transparent 60%);
}

/* Cartes glassmorphism */
.glass-card {
  background: var(--bg-elevated);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
}

/* ==========================================================================
   Écran de verrouillage (Auth)
   ========================================================================== */
.auth-screen {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px 16px;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  padding: 36px 28px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.auth-brand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.auth-brand h1 {
  margin: 0;
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  border: 1.5px solid rgba(56, 189, 248, 0.45);
  background: rgba(56, 189, 248, 0.08);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.brand-mark-sm {
  width: 26px;
  height: 26px;
  border-radius: 8px;
}

.brand-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--sky), var(--emerald));
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.65);
}

.brand-mark-sm .brand-dot {
  width: 7px;
  height: 7px;
}

.auth-subtitle {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.94rem;
}

.btn-google {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 13px 20px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: #ffffff;
  color: #0f172a;
  font-size: 0.96rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition), opacity var(--transition);
}

.btn-google:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(255, 255, 255, 0.14);
}

.btn-google:active {
  transform: translateY(0);
}

.btn-google:disabled {
  opacity: 0.6;
  cursor: wait;
}

.google-icon {
  width: 19px;
  height: 19px;
  flex-shrink: 0;
}

.auth-footnote {
  margin: 0;
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* ==========================================================================
   Boîtes d'alerte
   ========================================================================== */
.alert-box {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  font-size: 0.86rem;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.alert-box p {
  margin: 0;
  color: var(--text-secondary);
}

.alert-amber {
  background: var(--amber-bg);
  border-color: var(--amber-border);
  color: #fde68a;
}

.alert-rose {
  background: var(--rose-bg);
  border-color: var(--rose-border);
  color: #fecdd3;
}

/* ==========================================================================
   Barre supérieure (Topbar)
   ========================================================================== */
.app-shell {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px));
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  background: rgba(11, 15, 25, 0.78);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border-subtle);
}

@media (min-width: 720px) {
  .topbar {
    padding: 14px 28px;
  }
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 9px;
}

.brand-title {
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}

.sync-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.03);
  font-size: 0.74rem;
  color: var(--text-secondary);
  white-space: nowrap;
}

.sync-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--emerald);
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.8);
  transition: background-color var(--transition), box-shadow var(--transition);
}

.sync-pill.syncing .sync-dot {
  background: var(--amber);
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.8);
  animation: pulse 1.2s ease-in-out infinite;
}

.sync-pill.error .sync-dot {
  background: var(--rose);
  box-shadow: 0 0 8px rgba(244, 63, 94, 0.8);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-topbar {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 13px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
  font-size: 0.84rem;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition), color var(--transition);
}

.btn-topbar:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: var(--border-strong);
}

.btn-topbar[aria-pressed="true"] {
  background: var(--sky-bg);
  border-color: var(--sky-border);
  color: #bae6fd;
}

.btn-icon-only {
  padding: 8px 10px;
}

/* ==========================================================================
   Zone Principale du Dashboard
   ========================================================================== */
.dashboard-main {
  width: 100%;
  max-width: 1220px;
  margin: 0 auto;
  padding: 20px 16px 28px;
  display: flex;
  flex-direction: column;
  gap: 26px;
  flex: 1;
}

@media (min-width: 720px) {
  .dashboard-main {
    padding: 28px 28px 36px;
    gap: 30px;
  }
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.section-eyebrow {
  margin: 0;
  font-size: 0.74rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

/* ==========================================================================
   État vierge initial
   ========================================================================== */
.empty-state {
  margin: auto;
  max-width: 520px;
  padding: 36px 24px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.empty-orbit {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 1.4rem;
  color: var(--sky);
  background: var(--sky-bg);
  border: 1px solid var(--sky-border);
}

.empty-state h2 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
}

.empty-state p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.93rem;
}

.empty-hint {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  background: var(--amber-bg);
  border: 1px solid var(--amber-border);
  color: #fde68a;
  font-size: 0.84rem;
}

/* ==========================================================================
   Levier Immédiat (focusAction)
   ========================================================================== */
.focus-card {
  position: relative;
  padding: 22px;
  border-radius: var(--radius-lg);
  background: linear-gradient(145deg, rgba(20, 31, 56, 0.85), rgba(14, 20, 34, 0.92));
  border: 1px solid rgba(56, 189, 248, 0.28);
  box-shadow: 0 20px 44px -18px rgba(56, 189, 248, 0.24);
  display: flex;
  flex-direction: column;
  gap: 12px;
  animation: fadeSlideUp 260ms ease both;
}

@media (min-width: 720px) {
  .focus-card {
    padding: 26px 28px;
  }
}

.focus-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.focus-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 0.74rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: var(--sky-bg);
  border: 1px solid var(--sky-border);
  color: #bae6fd;
}

.focus-meta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.focus-title {
  margin: 0;
  font-size: 1.28rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.3;
}

@media (min-width: 720px) {
  .focus-title {
    font-size: 1.48rem;
  }
}

.focus-description {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.focus-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.focus-context {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Mode Tunnel : masque tout sauf focusAction et centre l'attention */
body.tunnel-mode .widgets-section,
body.tunnel-mode .modules-section {
  display: none !important;
}

body.tunnel-mode .dashboard-main {
  justify-content: center;
  max-width: 680px;
  min-height: calc(100dvh - 150px);
}

body.tunnel-mode .focus-card {
  padding: 32px 26px;
  border-color: rgba(56, 189, 248, 0.45);
  box-shadow: 0 28px 70px -18px rgba(56, 189, 248, 0.32);
}

.tunnel-empty-card {
  padding: 32px 24px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.tunnel-empty-card p {
  margin: 0;
  color: var(--text-secondary);
}

/* ==========================================================================
   Smart Widgets (Micro-indicateurs autonomes)
   ========================================================================== */
.widgets-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

@media (min-width: 480px) {
  .widgets-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 960px) {
  .widgets-grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  }
}

.smart-widget {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: transform var(--transition), border-color var(--transition);
  animation: fadeSlideUp 260ms ease both;
}

.smart-widget:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong);
}

.widget-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.widget-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.widget-icon {
  font-size: 1.15rem;
  flex-shrink: 0;
}

.widget-title {
  margin: 0;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.widget-value-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.widget-value {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

.widget-unit {
  font-size: 0.86rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.widget-subtext {
  margin: 0;
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.35;
}

.widget-progress-track {
  width: 100%;
  height: 6px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.07);
  overflow: hidden;
}

.widget-progress-fill {
  height: 100%;
  border-radius: var(--radius-pill);
  transition: width 360ms cubic-bezier(0.22, 1, 0.36, 1);
}

/* ==========================================================================
   Grille Principale des Modules
   ========================================================================== */
.modules-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  align-items: start;
}

@media (min-width: 720px) {
  .modules-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1100px) {
  .modules-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.module-card {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: border-color var(--transition), background var(--transition);
  animation: fadeSlideUp 280ms ease both;
}

.module-card:hover {
  border-color: var(--border-strong);
}

.module-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.module-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.module-icon {
  font-size: 1.3rem;
  line-height: 1;
  flex-shrink: 0;
}

.module-title {
  margin: 0;
  font-size: 1.02rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
  border: 1px solid transparent;
}

.module-summary {
  margin: 0;
  font-size: 0.89rem;
  color: var(--text-secondary);
  line-height: 1.48;
}

.module-items {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.module-item-btn {
  width: 100%;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.025);
  text-align: left;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition), opacity var(--transition);
}

.module-item-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--border-subtle);
}

.item-checkbox {
  width: 18px;
  height: 18px;
  margin-top: 1px;
  border-radius: 6px;
  border: 1.5px solid rgba(255, 255, 255, 0.25);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  font-size: 0.72rem;
  color: transparent;
  transition: all var(--transition);
}

.module-item-btn.is-done .item-checkbox {
  background: var(--emerald);
  border-color: var(--emerald);
  color: #04130d;
  font-weight: 700;
}

.item-text {
  font-size: 0.88rem;
  color: var(--text-primary);
  line-height: 1.4;
  transition: color var(--transition);
}

.module-item-btn.is-done .item-text {
  color: var(--text-muted);
  text-decoration: line-through;
}

/* Couleurs dynamiques (emerald, amber, rose, sky, violet) */
.tone-emerald {
  background: var(--emerald-bg);
  border-color: var(--emerald-border);
  color: #6ee7b7;
}
.fill-emerald { background: var(--emerald); }

.tone-amber {
  background: var(--amber-bg);
  border-color: var(--amber-border);
  color: #fcd34d;
}
.fill-amber { background: var(--amber); }

.tone-rose {
  background: var(--rose-bg);
  border-color: var(--rose-border);
  color: #fda4af;
}
.fill-rose { background: var(--rose); }

.tone-sky {
  background: var(--sky-bg);
  border-color: var(--sky-border);
  color: #7dd3fc;
}
.fill-sky { background: var(--sky); }

.tone-violet {
  background: var(--violet-bg);
  border-color: var(--violet-border);
  color: #c4b5fd;
}
.fill-violet { background: var(--violet); }

/* ==========================================================================
   Bouton d'action flottant (FAB)
   ========================================================================== */
.fab-bilan {
  position: fixed;
  right: 18px;
  bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  z-index: 40;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 14px 20px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(125, 211, 252, 0.4);
  background: linear-gradient(135deg, #0ea5e9, #10b981);
  color: #06121a;
  font-weight: 700;
  font-size: 0.94rem;
  letter-spacing: -0.01em;
  box-shadow: var(--shadow-fab);
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition);
}

.fab-bilan:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 40px -6px rgba(56, 189, 248, 0.48);
}

.fab-bilan:active {
  transform: translateY(0);
}

@media (min-width: 720px) {
  .fab-bilan {
    right: 28px;
    bottom: 28px;
  }
}

/* ==========================================================================
   Modales & Tiroir Point Bilan IA
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(4, 7, 14, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
}

@media (min-width: 640px) {
  .modal-backdrop {
    align-items: center;
    padding: 20px;
  }
}

.drawer-sheet,
.settings-dialog {
  width: 100%;
  max-width: 620px;
  max-height: 92dvh;
  overflow-y: auto;
  padding: 18px 20px calc(20px + env(safe-area-inset-bottom, 0px));
  border-radius: 22px 22px 0 0;
  background: rgba(15, 22, 36, 0.96);
  display: flex;
  flex-direction: column;
  gap: 16px;
  animation: slideUpSheet 220ms ease both;
}

@media (min-width: 640px) {
  .drawer-sheet,
  .settings-dialog {
    border-radius: var(--radius-lg);
    padding: 24px;
    animation: fadeSlideUp 200ms ease both;
  }
}

.drawer-handle {
  width: 40px;
  height: 4px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.18);
  margin: 0 auto 2px;
}

@media (min-width: 640px) {
  .drawer-handle {
    display: none;
  }
}

.drawer-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.drawer-header h2 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
}

.drawer-subtitle {
  margin: 4px 0 0;
  font-size: 0.84rem;
  color: var(--text-secondary);
}

.btn-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
  cursor: pointer;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.btn-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
}

.drawer-body,
.settings-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.bilan-textarea {
  width: 100%;
  min-height: 155px;
  resize: vertical;
  padding: 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: var(--bg-input);
  color: var(--text-primary);
  font-size: 0.96rem;
  line-height: 1.5;
  outline: none;
  transition: border-color var(--transition);
}

.bilan-textarea:focus {
  border-color: var(--sky-border);
}

.bilan-textarea::placeholder {
  color: var(--text-muted);
}

.voice-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.btn-voice {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.04);
  font-size: 0.84rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-voice:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.09);
}

.btn-voice:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.voice-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-muted);
}

.btn-voice[aria-pressed="true"] {
  background: var(--rose-bg);
  border-color: var(--rose-border);
  color: #fecdd3;
}

.btn-voice[aria-pressed="true"] .voice-dot {
  background: var(--rose);
  animation: pulse 1s ease-in-out infinite;
}

.voice-status {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.drawer-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

/* ==========================================================================
   Boutons & Champs de formulaires
   ========================================================================== */
.btn-primary,
.btn-ghost,
.btn-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all var(--transition);
}

.btn-sm {
  padding: 7px 13px;
  font-size: 0.82rem;
}

.btn-primary {
  background: linear-gradient(135deg, #0ea5e9, #10b981);
  color: #05131c;
}

.btn-primary:hover:not(:disabled) {
  filter: brightness(1.07);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: wait;
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--border-subtle);
  color: var(--text-primary);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: var(--border-strong);
}

.btn-danger {
  background: var(--rose-bg);
  border-color: var(--rose-border);
  color: #fecdd3;
}

.btn-danger:hover {
  background: rgba(244, 63, 94, 0.24);
}

.link-btn {
  background: none;
  border: none;
  padding: 0;
  color: #7dd3fc;
  font-size: inherit;
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
}

/* Paramètres */
.settings-section {
  padding: 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.02);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.user-banner {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border-strong);
}

.user-name {
  font-size: 0.9rem;
  font-weight: 600;
}

.user-email {
  font-size: 0.78rem;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
}

.settings-heading {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 600;
}

.settings-help {
  margin: 0;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.field-label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.input-group {
  display: flex;
  gap: 8px;
}

.text-input {
  width: 100%;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: var(--bg-input);
  color: var(--text-primary);
  font-size: 0.88rem;
  outline: none;
}

.text-input:focus {
  border-color: var(--sky-border);
}

.settings-row-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.confirm-inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 0.82rem;
  color: #fecdd3;
}

.danger-zone {
  border-color: rgba(244, 63, 94, 0.22);
}

/* ==========================================================================
   Toast & Spinner
   ========================================================================== */
.toast-container {
  position: fixed;
  left: 50%;
  bottom: calc(86px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  z-index: 80;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: calc(100% - 32px);
  max-width: 460px;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  background: rgba(15, 23, 42, 0.96);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-card);
  font-size: 0.86rem;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: fadeSlideUp 180ms ease both;
}

.toast-success { border-color: var(--emerald-border); }
.toast-error { border-color: var(--rose-border); }
.toast-info { border-color: var(--sky-border); }

.spinner {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  border: 2px solid rgba(5, 19, 28, 0.25);
  border-top-color: #05131c;
  animation: spin 0.7s linear infinite;
}

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

@keyframes slideUpSheet {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(0.88); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
