
/* --- from styles.css 1-1085: base shell --- */

/* ===== Variables de thème ===== */
:root {
  /* Thème clair (défaut) */
  --bg: #f0f2f5;
  --bg-secondary: #f5f6f8;
  --surface: #ffffff;
  --border: #e2e4e8;
  --text: #1a1d23;
  --text-secondary: #6b7280;
  --muted: #5c6370;
  --nav-height: 64px;
  --main-padding: 1.5rem;
  --page-padding: 24px;

  /* Accent principal — dégradé signature bleu-violet */
  --accent: #667eea;
  --accent-hover: #5a6fd6;
  --accent-end: #764ba2;
  --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --gradient-primary-subtle: linear-gradient(135deg, rgba(102, 126, 234, 0.12) 0%, rgba(118, 75, 162, 0.12) 100%);
  --accent-shadow: rgba(102, 126, 234, 0.35);
  --accent-glow: rgba(102, 126, 234, 0.15);

  /* Sémantiques */
  --link: #667eea;
  --danger: #dc2626;
  --danger-hover: #b91c1c;
  --danger-bg: #fef2f2;
  --danger-border: #fecaca;
  --danger-shadow: rgba(220, 38, 38, 0.3);
  --warning: #ca8a04;
  --warning-hover: #b45309;
  --warning-bg: #fffbeb;
  --warning-border: #fcd34d;
  --success: #16a34a;
  --success-hover: #059669;
  --success-bg: #ecfdf5;
  --success-border: #a7f3d0;

  /* Priorités (1-10 : vert → jaune → rouge) */
  --prio-1: #44ff00;
  --prio-2: #77ff00;
  --prio-3: #aaff00;
  --prio-4: #ddff00;
  --prio-5: #ffff00;
  --prio-6: #ffcc00;
  --prio-7: #ff9900;
  --prio-8: #ff6600;
  --prio-9: #ff3300;
  --prio-10: #ff0000;

  /* Priorités UI (icônes dropdowns, 1-10 : vert → rouge) */
  --prio-ui-1: #4caf50;
  --prio-ui-2: #66bb6a;
  --prio-ui-3: #8bc34a;
  --prio-ui-4: #cddc39;
  --prio-ui-5: #ffeb3b;
  --prio-ui-6: #ffc107;
  --prio-ui-7: #ff9800;
  --prio-ui-8: #ff5722;
  --prio-ui-9: #f44336;
  --prio-ui-10: #d32f2f;

  /* Palette de tags (12 couleurs cycliques) */
  --tag-1: #e06c75;
  --tag-2: #d19a66;
  --tag-3: #e5c07b;
  --tag-4: #98c379;
  --tag-5: #56b6c2;
  --tag-6: #61afef;
  --tag-7: #c678dd;
  --tag-8: #be5046;
  --tag-9: #5c6370;
  --tag-10: #abb2bf;
  --tag-11: #7c9ce0;
  --tag-12: #8ab4f8;
}

[data-theme="dark"] {
  --bg: #1a1d23;
  --bg-secondary: #2a2e36;
  --surface: #242830;
  --border: #3d4452;
  --text: #e6e9ef;
  --text-secondary: #9096a3;
  --muted: #9096a3;

  /* Accent */
  --accent: #7c9ce0;
  --accent-hover: #92b0eb;
  --accent-end: #a07ed6;
  --gradient-primary: linear-gradient(135deg, #7c9ce0 0%, #a07ed6 100%);
  --gradient-primary-subtle: linear-gradient(135deg, rgba(124, 156, 224, 0.2) 0%, rgba(160, 126, 214, 0.2) 100%);
  --accent-shadow: rgba(124, 156, 224, 0.35);
  --accent-glow: rgba(124, 156, 224, 0.15);

  /* Sémantiques */
  --link: #8ab4f8;
  --danger: #e06c75;
  --danger-hover: #c75a63;
  --danger-bg: rgba(220, 38, 38, 0.1);
  --danger-border: rgba(220, 38, 38, 0.3);
  --danger-shadow: rgba(224, 108, 117, 0.3);
  --warning: #e5c07b;
  --warning-hover: #d4a84e;
  --warning-bg: rgba(252, 211, 77, 0.1);
  --warning-border: rgba(252, 211, 77, 0.3);
  --success: #98c379;
  --success-hover: #7daa62;
  --success-bg: rgba(5, 150, 105, 0.12);
  --success-border: rgba(5, 150, 105, 0.3);
}

/* ===== Reset & Base ===== */
* { box-sizing: border-box; }

h1, h2, h3, h4, h5, h6 {
  font-weight: normal;
}

body {
  margin: 0;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Shell connecté : pas de scroll sur tout le document — scroll dans les colonnes */
body.has-app-shell {
  height: 100vh;
  height: 100dvh;
  max-height: 100vh;
  max-height: 100dvh;
  min-height: 0;
  overflow: hidden;
  flex: 1;
}

html {
  height: 100%;
}

html:has(body.has-app-shell) {
  overflow: hidden;
  height: 100%;
  max-height: 100%;
}

a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ===== Système de boutons unifié ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.6rem 1.25rem;
  border: none;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  line-height: 1.4;
  white-space: nowrap;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

/* Primary — dégradé signature */
.btn-primary {
  background: var(--gradient-primary);
  color: white;
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px var(--accent-shadow);
}

.btn-primary:active:not(:disabled) {
  transform: translateY(0);
}

/* Secondary — fond surface (bouton « blanc ») + bordure */
.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--bg-secondary);
  border-color: var(--text-secondary);
}

/* Ghost — minimal */
.btn-ghost {
  background: transparent;
  color: var(--muted);
}

.btn-ghost:hover:not(:disabled) {
  color: var(--text);
  background: var(--bg-secondary);
}

/* Outline */
.btn-outline {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-outline:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent);
}

.btn-outline-danger {
  background: var(--bg-primary);
  color: var(--danger);
  border-color: var(--danger);
}

.btn-outline-danger:hover:not(:disabled) {
  background: var(--danger-bg);
  border-color: var(--danger);
  color: var(--danger);
}

/* Danger */
.btn-danger {
  background: var(--danger);
  color: white;
}

.btn-danger:hover:not(:disabled) {
  background: var(--danger-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px var(--danger-shadow);
}

.btn-danger:active:not(:disabled) {
  transform: translateY(0);
}

.btn-danger-ghost {
  background: none;
  color: var(--muted);
  border: none;
}

.btn-danger-ghost:hover:not(:disabled) {
  color: var(--danger);
  background: none;
}

/* Accent — accent solide (non dégradé, pour actions secondaires "colorées") */
.btn-accent {
  background: var(--accent);
  color: white;
}

.btn-accent:hover:not(:disabled) {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px var(--accent-shadow);
}

/* Tailles */
.btn-sm {
  padding: 0.375rem 0.75rem;
  font-size: 0.8rem;
  border-radius: 6px;
}

.btn-lg {
  padding: 0.875rem 1.5rem;
  font-size: 0.95rem;
  border-radius: 10px;
}

.btn-block {
  display: flex;
  width: 100%;
  user-select: none;
  -webkit-user-select: none;
}


.btn-icon-only {
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: transparent;
  color: var(--text-secondary);
}

.btn-icon-only:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-glow);
}

.btn-icon-only.btn-icon-danger:hover:not(:disabled) {
  border-color: var(--danger);
  color: var(--danger);
  background: var(--danger-bg);
}


.btn-icon-tiny {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: all 0.15s;
  text-decoration: none;
  flex-shrink: 0;
}
.btn-icon-tiny:hover {
  color: var(--accent, #6366f1);
  background: var(--accent-shadow, rgba(99, 102, 241, 0.08));
}

/* ===== Header / Navigation ===== */
.app-nav {
  flex-shrink: 0;
  height: var(--nav-height);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 100;
}

/* Burger button — hidden on desktop, shown on mobile */
.burger-btn {
  display: none;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 6px;
  color: var(--text);
  flex-shrink: 0;
}

.burger-btn:hover {
  background: var(--bg-secondary);
}

/* Mobile drawer */
.mobile-drawer-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 299;
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}

.mobile-drawer-backdrop.visible {
  opacity: 1;
  pointer-events: auto;
}

.mobile-drawer {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 280px;
  max-width: 85vw;
  background: var(--surface);
  z-index: 300;
  flex-direction: column;
  transform: translateX(-100%);
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-y: auto;
}

.mobile-drawer.open {
  transform: translateX(0);
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.2);
}

.mobile-drawer-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1.25rem 1rem;
  border-bottom: 1px solid var(--border);
}

.mobile-drawer-user {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}

.mobile-drawer-user strong {
  font-size: 0.95rem;
  color: var(--text);
}

.mobile-drawer-user span {
  font-size: 0.8rem;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mobile-drawer-nav {
  display: flex;
  flex-direction: column;
  padding: 0.5rem 0;
  flex: 1;
}

.mobile-drawer-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.25rem;
  color: var(--text);
  text-decoration: none;
  font-size: 0.9rem;
  border: none;
  background: none;
  cursor: pointer;
  width: 100%;
  text-align: left;
}

.mobile-drawer-link:hover {
  background: var(--bg-secondary);
}

.mobile-drawer-link.active {
  color: var(--accent);
  background: var(--accent-alpha, rgba(102, 126, 234, 0.08));
  font-weight: 500;
}

.mobile-drawer-footer {
  border-top: 1px solid var(--border);
  padding: 0.5rem 0;
}

.mobile-drawer-danger {
  color: var(--danger) !important;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
}

.header-nav nav {
  display: flex;
  gap: 0.5rem;
}

@media (max-width: 768px) {
  .burger-btn {
    display: flex;
  }

  .mobile-drawer-backdrop {
    display: block;
  }

  .mobile-drawer {
    display: flex;
  }

  .header-nav {
    display: none;
  }
}

.app-title {
  margin: 0;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex-wrap: wrap;
}

.gemini-icon {
  display: inline-flex;
  flex-shrink: 0;
  color: var(--accent);
}

.header-sep {
  color: var(--muted);
  margin: 0 0.5rem;
  font-weight: 400;
  user-select: none;
}

.header-title-link {
  color: inherit;
  text-decoration: none;
}

.header-title-link:hover {
  color: var(--accent);
  text-decoration: none;
}

.nav-link {
  color: var(--muted);
  text-decoration: none;
  padding: 0.35rem 0.9rem 0.35rem 0.75rem;
  border-radius: 6px;
  font-size: 0.9rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  position: relative;
}

.nav-link-icon {
  display: inline-flex;
  flex-shrink: 0;
}

.nav-link:hover,
.nav-link.active {
  color: var(--accent);
  background: rgba(124, 156, 224, 0.12);
  text-decoration: none;
}

.nav-unread-badge {
  position: absolute;
  top: 0.1rem;
  right: 0.15rem;
  transform: translate(45%, -45%);
  background: #ef4444;
  color: #fff;
  border-radius: 999px;
  min-width: 14px;
  height: 14px;
  padding: 0 0.22rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.55rem;
  font-weight: 700;
  line-height: 1;
  box-shadow: 0 0 0 2px var(--surface);
}

/* ===== Avatar Menu ===== */
.avatar-menu-wrapper {
  position: relative;
}

.avatar-trigger {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3rem 0.5rem 0.3rem 0.3rem;
  border: 1px solid transparent;
  border-radius: 24px;
  background: transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  color: var(--text);
}

.avatar-trigger:hover {
  background: var(--bg-secondary);
  border-color: var(--border);
}

.avatar-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--gradient-primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.avatar-circle-lg {
  width: 40px;
  height: 40px;
}

.avatar-name {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text);
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.avatar-chevron {
  color: var(--muted);
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.avatar-chevron.open {
  transform: rotate(180deg);
}

/* Dropdown menu */
.avatar-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 240px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
  padding: 0.5rem;
  z-index: 1000;
  opacity: 0;
  transform: translateY(-4px) scale(0.97);
  pointer-events: none;
  transition: all 0.15s ease;
}

.avatar-dropdown.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

[data-theme="dark"] .avatar-dropdown {
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
}

.avatar-dropdown-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 0.625rem 0.75rem;
}

.avatar-dropdown-user {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.avatar-dropdown-user strong {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.avatar-dropdown-user span {
  font-size: 0.78rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.avatar-dropdown-divider {
  height: 1px;
  margin: 0.25rem 0.5rem;
  background: var(--border);
}

.avatar-dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  width: 100%;
  padding: 0.6rem 0.625rem;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.12s ease;
  line-height: 1.4;
}

.avatar-dropdown-item:hover {
  background: var(--bg-secondary);
  text-decoration: none;
}

.avatar-dropdown-item svg {
  flex-shrink: 0;
  color: var(--muted);
}

.avatar-dropdown-item:hover svg {
  color: var(--accent);
}

.avatar-dropdown-danger {
  color: var(--danger);
}

.avatar-dropdown-danger:hover {
  background: var(--danger-bg);
}

.avatar-dropdown-danger svg {
  color: var(--danger) !important;
}

/* Theme toggle in dropdown */
.icon-sun-menu { display: inline-flex; }
.icon-moon-menu { display: none; }
.theme-label-light { display: inline; }
.theme-label-dark { display: none; }

[data-theme="dark"] .icon-sun-menu { display: none; }
[data-theme="dark"] .icon-moon-menu { display: inline-flex; }
[data-theme="dark"] .theme-label-light { display: none; }
[data-theme="dark"] .theme-label-dark { display: inline; }

/* ===== Main Content ===== */
au-viewport {
  display: block;
}

main {
  flex: 1;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--main-padding);
  padding-top: calc(var(--nav-height) + var(--main-padding));
}

/* Shell applicatif (sidebar) : plus de topbar fixe */
main.app-main {
  max-width: none;
  margin: 0;
  padding: var(--main-padding);
  padding-top: var(--main-padding);
}

/* ===== Modal ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  z-index: 5000;
  overflow-y: auto;
  padding: 2rem 1rem;
}

.modal-content {
  background: var(--surface);
  border-radius: 8px;
  padding: 1.5rem;
  min-width: 350px;
  max-width: 90vw;
  max-height: calc(100vh - 4rem);
  overflow-y: auto;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.modal-content h2 {
  margin: 0 0 1rem;
  font-size: 1.25rem;
}

.modal-content .form-group {
  margin-bottom: 1rem;
}

.modal-content .form-group label {
  display: block;
  margin-bottom: 0.35rem;
  font-weight: 500;
  font-size: 0.9rem;
  color: var(--muted);
}

.modal-content .form-group input,
.modal-content .form-group select {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.95rem;
  background: var(--surface);
  color: var(--text);
}

.modal-content .form-group input:focus,
.modal-content .form-group select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-glow);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

/* btn-cancel et btn-create supprimés — remplacés par .btn .btn-secondary / .btn .btn-primary */

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1rem;
}

/* api-secret-input dans les modales : label + aide au-dessus, champ pleine largeur (évite l’input collé à droite si la description est longue) */
.modal-content .api-key-row {
  flex-direction: column;
  align-items: stretch;
  gap: 0.5rem;
  padding: 0;
  border-bottom: none;
  margin-bottom: 0.75rem;
}

.modal-content .api-key-info {
  min-width: 0;
  max-width: 100%;
}

.modal-content .api-key-input-wrapper {
  flex: none;
  max-width: none;
  width: 100%;
}

.modal-header h2 {
  margin: 0;
  font-size: 1.25rem;
}

.modal-close-btn {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--muted);
  padding: 0.25rem 0.5rem;
  line-height: 1;
  border-radius: 4px;
  transition: all 0.15s ease;
}

.modal-close-btn:hover {
  background: var(--bg-secondary);
  color: var(--text);
}

.version-loading,
.version-error,
.version-empty {
  text-align: center;
  padding: 2rem;
  color: var(--muted);
}

.version-error {
  color: var(--danger);
}

.version-empty-hint {
  font-size: 0.85rem;
  opacity: 0.7;
  margin-top: 0.5rem;
}

.version-browser {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  overflow: hidden;
}

/* Navigation */
.version-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem;
  background: var(--bg-secondary);
  border-radius: 8px;
}

/* nav-btn supprimé — remplacé par .btn .btn-sm .btn-secondary */

.version-counter {
  font-weight: 600;
  color: var(--text);
}

/* Version info */
.version-info {
  padding: 0.75rem;
  background: var(--bg-secondary);
  border-radius: 8px;
  border-left: 4px solid var(--accent);
}

.version-meta {
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
}

.version-date {
  font-weight: 500;
}

.version-trigger {
  font-size: 0.85rem;
  padding: 0.2rem 0.5rem;
  background: var(--bg);
  border-radius: 4px;
}

.version-description {
  margin-top: 0.5rem;
  font-size: 0.9rem;
  color: var(--muted);
  font-style: italic;
}

/* Preview */
.version-preview {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem;
  max-height: 350px;
}

.version-preview h3 {
  margin: 0 0 1rem 0;
  font-size: 1rem;
  color: var(--muted);
}

.preview-section {
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.preview-section:last-child {
  border-bottom: none;
}

.preview-section label {
  display: block;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

.preview-value {
  font-size: 0.9rem;
  color: var(--text);
}

.preview-text {
  white-space: pre-wrap;
  max-height: 100px;
  overflow-y: auto;
  background: var(--bg-secondary);
  padding: 0.5rem;
  border-radius: 4px;
  font-size: 0.85rem;
}

.preview-list {
  margin: 0;
  padding-left: 1.25rem;
  font-size: 0.85rem;
}

.preview-list li {
  margin-bottom: 0.25rem;
}

/* Actions */
.version-actions {
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
}

/* btn-restore supprimé — remplacé par .btn .btn-primary .btn-lg */

/* Version history button in subject detail */
.btn-history {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.75rem;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-history:hover {
  background: var(--bg-secondary);
  border-color: var(--accent);
  color: var(--accent);
}

.btn-history svg {
  width: 14px;
  height: 14px;
}


/* --- from styles.css 1086-2114: auth 2fa passkeys settings --- */

/* ============================================
   AUTHENTIFICATION
   ============================================ */

/* Auth layout */
main.auth-layout {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 2rem;
  background: var(--gradient-primary);
}

/* Auth page container */
.auth-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 60px);
  padding: 2rem;
}

main.auth-layout .auth-page {
  min-height: auto;
}

/* Auth card */
.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border-radius: 16px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
  padding: 2.5rem;
}

[data-theme="dark"] .auth-card {
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

/* Auth header */
.auth-header {
  text-align: center;
  margin-bottom: 2rem;
}

.auth-header h1 {
  font-size: 1.75rem;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 0.5rem 0;
}

.auth-header p {
  color: var(--muted);
  margin: 0;
  font-size: 0.95rem;
}

/* Auth form */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-group label {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
}

.form-group input {
  padding: 0.875rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-size: 1rem;
  background: var(--surface);
  color: var(--text);
  transition: all 0.2s ease;
}

.form-group input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-group input::placeholder {
  color: var(--muted);
}

.form-hint {
  font-size: 0.8rem;
  color: var(--muted);
  margin: 0;
}

/* Auth error */
.auth-error {
  padding: 1rem;
  background: var(--danger-bg);
  border: 1px solid var(--danger-border);
  border-radius: 8px;
  color: var(--danger);
  font-size: 0.9rem;
}

.error-list {
  margin: 0.5rem 0 0;
  padding-left: 1.25rem;
  font-size: 0.85rem;
}

/* Auth warning (email not verified) */
.auth-warning {
  padding: 1.5rem;
  background: var(--warning-bg);
  border: 1px solid var(--warning-border);
  border-radius: 12px;
  text-align: center;
}

.auth-warning h3 {
  margin: 0 0 0.5rem;
  color: var(--warning-hover);
  font-size: 1.1rem;
}

.auth-warning p {
  color: var(--muted);
  margin: 0 0 0.5rem;
  font-size: 0.9rem;
}

.auth-warning .btn-secondary {
  margin-top: 1rem;
}

.auth-error-box {
  text-align: center;
  padding: 2rem 1rem;
}

.auth-error-box h2 {
  color: var(--danger);
  font-size: 1.25rem;
  margin: 0 0 0.75rem;
}

.auth-error-box p {
  color: var(--muted);
  margin: 0 0 1rem;
}

/* Auth success */
.auth-success {
  text-align: center;
  padding: 1rem 0;
}

.auth-success .success-icon {
  width: 60px;
  height: 60px;
  margin: 0 auto 1rem;
  background: linear-gradient(135deg, var(--success), var(--success-hover));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: white;
}

.auth-success h2 {
  font-size: 1.5rem;
  color: var(--text);
  margin: 0 0 0.75rem;
}

.auth-success p {
  color: var(--muted);
  margin: 0 0 0.5rem;
  font-size: 0.95rem;
}

.auth-success .btn-primary,
.auth-success .btn-secondary {
  margin-top: 1.5rem;
}

/* Loading spinner */
.auth-loading {
  text-align: center;
  padding: 3rem 1rem;
}

.auth-loading .spinner {
  width: 40px;
  height: 40px;
  margin: 0 auto 1rem;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* Buttons (auth pages) — surcharges pour layout full-width */
.auth-card .btn-primary,
.auth-card .btn-secondary,
.auth-card .btn-danger {
  display: block;
  width: 100%;
  padding: 0.875rem 1.5rem;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}

.auth-card .btn-primary {
  background: var(--gradient-primary);
  color: white;
  border: none;
}

.auth-card .btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px var(--accent-shadow);
}

.auth-card .btn-primary:active:not(:disabled) {
  transform: translateY(0);
}

.auth-card .btn-primary:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

.auth-card .btn-secondary {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
}

.auth-card .btn-secondary:hover {
  background: var(--bg-secondary);
  color: var(--text);
  border-color: var(--text-secondary);
}

/* Auth links */
.auth-links {
  text-align: center;
}

.auth-links a {
  color: var(--accent);
  text-decoration: none;
  font-size: 0.9rem;
}

.auth-links a:hover {
  text-decoration: underline;
}

/* Divider */
.auth-divider {
  display: flex;
  align-items: center;
  margin: 1.5rem 0;
  gap: 1rem;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.auth-divider span {
  color: var(--muted);
  font-size: 0.85rem;
}

/* OAuth buttons */
.btn-oauth {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 0.875rem 1.5rem;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-oauth:hover:not(:disabled) {
  background: var(--bg-secondary);
  border-color: var(--accent);
}

.btn-oauth:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Auth footer */
.auth-footer {
  margin-top: 1.5rem;
  text-align: center;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.auth-footer p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.auth-footer a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}

.auth-footer a:hover {
  text-decoration: underline;
}

/* Login button (when not authenticated) */
.btn-login {
  padding: 0.5rem 1rem;
  background: var(--gradient-primary);
  color: white;
  border-radius: 6px;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  transition: all 0.15s ease;
}

.btn-login:hover {
  box-shadow: 0 2px 8px var(--accent-shadow);
  text-decoration: none;
}

/* ============================================
   2FA SETUP
   ============================================ */

.tfa-content {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.tfa-info {
  text-align: center;
  padding: 1rem 0;
}

.tfa-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.tfa-info h3 {
  font-size: 1.25rem;
  margin: 0 0 0.75rem;
  color: var(--text);
}

.tfa-info p {
  color: var(--muted);
  margin: 0;
  line-height: 1.6;
}

.tfa-steps {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.tfa-step {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.step-number {
  width: 28px;
  height: 28px;
  background: var(--accent);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.step-content h4 {
  margin: 0 0 0.25rem;
  font-size: 1rem;
  color: var(--text);
}

.step-content p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
}

.qr-code-container {
  text-align: center;
  padding: 1rem;
  background: white;
  border-radius: 12px;
  border: 1px solid var(--border);
}

.qr-code {
  max-width: 200px;
  height: auto;
}

.secret-manual {
  text-align: center;
  padding: 1rem;
  background: var(--bg-secondary);
  border-radius: 8px;
}

.secret-manual p {
  margin: 0 0 0.5rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.secret-code {
  display: block;
  font-family: monospace;
  font-size: 0.9rem;
  padding: 0.5rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  margin-bottom: 0.5rem;
  word-break: break-all;
}

/* btn-small supprimé — remplacé par .btn .btn-sm .btn-secondary */

.tfa-input {
  width: 100%;
  padding: 1rem;
  font-size: 1.5rem;
  text-align: center;
  letter-spacing: 0.5em;
  font-family: monospace;
  border: 2px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
}

.tfa-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.backup-codes-container {
  padding: 1.5rem;
  background: var(--bg-secondary);
  border-radius: 12px;
  text-align: center;
}

.backup-codes-container h4 {
  margin: 0 0 0.5rem;
  color: var(--text);
}

.backup-codes-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
  margin: 1rem 0;
}

.backup-code {
  font-family: monospace;
  font-size: 0.9rem;
  padding: 0.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
}

.tfa-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.tfa-disable-form {
  padding: 1.5rem;
  background: var(--danger-bg);
  border-radius: 12px;
  border: 1px solid var(--danger-border);
}

.tfa-disable-form h4 {
  margin: 0 0 1rem;
  color: var(--danger);
}

.auth-card .btn-danger {
  background: var(--danger);
  color: white;
  border: none;
}

.auth-card .btn-danger:hover:not(:disabled) {
  background: var(--danger-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px var(--danger-shadow);
}

.auth-card .btn-danger:active:not(:disabled) {
  transform: translateY(0);
}

.auth-card .btn-danger:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

/* Passkey button on login */
.btn-google {
  margin-top: 0;
}

.btn-passkey {
  margin-top: 0.5rem;
}

.btn-passkey svg {
  color: var(--accent);
}

/* Auth card wide (passkeys / 2FA management) */
.auth-card-wide {
  max-width: 560px;
}

/* ============================================
   PASSKEYS PAGE
   ============================================ */

/* Header */
.passkeys-header {
  text-align: center;
  margin-bottom: 2rem;
}

.passkeys-header-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.12) 0%, rgba(118, 75, 162, 0.12) 100%);
  color: var(--accent);
}

[data-theme="dark"] .passkeys-header-icon {
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.2) 0%, rgba(118, 75, 162, 0.2) 100%);
}

.passkeys-header h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 0.5rem 0;
}

.passkeys-header p {
  color: var(--muted);
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.5;
  max-width: 380px;
  margin: 0 auto;
}

/* Success banner */
.passkeys-success-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  margin-bottom: 1.25rem;
  border-radius: 10px;
  background: var(--success-bg);
  color: var(--success);
  font-size: 0.9rem;
  font-weight: 500;
  border: 1px solid var(--success-border);
  animation: passkeys-slide-in 0.3s ease;
}

@keyframes passkeys-slide-in {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Content wrapper */
.passkeys-content {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Empty state */
.passkeys-empty-state {
  text-align: center;
  padding: 2rem 1.5rem;
  border-radius: 12px;
  background: var(--bg-secondary);
  border: 1px dashed var(--border);
}

[data-theme="dark"] .passkeys-empty-state {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.1);
}

.passkeys-empty-illustration {
  width: 72px;
  height: 72px;
  margin: 0 auto 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.08) 0%, rgba(118, 75, 162, 0.08) 100%);
  color: var(--accent);
}

[data-theme="dark"] .passkeys-empty-illustration {
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.15) 0%, rgba(118, 75, 162, 0.15) 100%);
}

.passkeys-empty-state h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 0.5rem 0;
}

.passkeys-empty-state p {
  font-size: 0.875rem;
  color: var(--muted);
  margin: 0;
  line-height: 1.6;
  max-width: 360px;
  margin: 0 auto;
}

/* Passkeys list */
.passkeys-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.passkeys-list-header {
  padding: 0 0.25rem;
  margin-bottom: 0.25rem;
}

.passkeys-count {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.passkey-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.875rem 1rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  transition: all 0.2s ease;
}

.passkey-item:hover {
  border-color: var(--accent);
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.08);
}

[data-theme="dark"] .passkey-item:hover {
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.15);
}

.passkey-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1;
  min-width: 0;
}

.passkey-icon {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: var(--gradient-primary-subtle);
  color: var(--accent);
}

.passkey-details {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

.passkey-details strong {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.passkey-meta {
  font-size: 0.78rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.passkey-actions {
  display: flex;
  gap: 0.375rem;
  flex-shrink: 0;
  margin-left: 0.5rem;
}

/* btn-icon et passkeys-add-btn supprimés — remplacés par .btn-icon-only et .btn .btn-primary .btn-lg .btn-block */

/* Loading */
.passkeys-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 3rem 1rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.passkeys-loading-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: passkeys-spin 0.6s linear infinite;
}

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

/* Navigation footer */
.passkeys-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1.75rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}

.passkeys-nav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.5rem 0.875rem;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  transition: all 0.15s ease;
}

.passkeys-nav-link:hover {
  background: var(--bg-secondary);
  color: var(--accent);
  text-decoration: none;
}

[data-theme="dark"] .passkeys-nav-link:hover {
  background: rgba(255, 255, 255, 0.06);
}

.passkeys-nav-link svg {
  flex-shrink: 0;
  opacity: 0.7;
}

.passkeys-nav-link:hover svg {
  opacity: 1;
}

/* ============================================
   SETTINGS PAGE
   ============================================ */

.settings-page {
  display: flex;
  min-height: calc(100vh - 2 * var(--main-padding));
  width: 100%;
  max-width: none;
  margin: 0;
}

body.has-app-shell .settings-page {
  min-height: 0;
  flex: 1 1 0%;
  align-self: stretch;
  width: 100%;
  max-width: none;
  overflow: hidden;
}

/* Anti-flicker: when a route is immediately denied, hide viewport until redirect finishes. */
body.route-access-blocked .app-viewport-host {
  visibility: hidden;
}

/* Sidebar secondaire (même logique que la sidebar app, fond gris) */
.settings-sidebar {
  width: var(--app-sidebar-width, 212px);
  flex-shrink: 0;
  padding: 0.35rem 0.4rem 0.75rem;
  border-right: 1px solid var(--border);
  background: var(--bg-secondary);
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
}

.settings-nav {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  position: sticky;
  top: 0;
  padding-top: 0.35rem;
}

.settings-nav-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin: 0 0 0.75rem 0.75rem;
}

.settings-nav-item {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.25rem;
  width: 100%;
  padding: 0.38rem 0.45rem;
  border: none;
  border-radius: 8px;
  background: transparent;
  font-family: inherit;
  color: var(--text);
  font-size: 0.875rem;
  font-weight: 400;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
  text-align: left;
}

.settings-nav-item:hover {
  background: var(--surface);
}

.settings-nav-item.active {
  background: var(--gradient-primary-subtle);
  color: var(--accent);
  font-weight: 600;
}

.settings-sidebar .settings-nav-item .app-nav-rail-cell {
  color: var(--muted);
}

.settings-sidebar .settings-nav-item.active .app-nav-rail-cell {
  color: var(--accent);
}

.settings-nav-item svg {
  flex-shrink: 0;
  color: inherit;
}

.settings-nav-item.active svg {
  color: var(--accent);
}

/* Content — pleine largeur dans la zone utile */
.settings-content {
  flex: 1;
  min-width: 0;
  padding: 1rem var(--main-padding) 1.5rem 1.25rem;
  overflow-y: auto;
  overflow-x: hidden;
  background: var(--bg);
}

/* Cards */
.settings-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 1rem;
}

.settings-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg-secondary);
  border-radius: 11px 11px 0 0;
}

[data-theme="dark"] .settings-card-header {
  background: rgba(255, 255, 255, 0.02);
}

.settings-card-header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.settings-card-header-actions .btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.settings-card-header h3 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Variante : le bandeau de carte est directement un titre (ex. stats/settings). */
.settings-card-header:is(h1, h2, h3, h4) {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
}


/* --- from styles.css 6550-6900: 2fa passkeys inline --- */

/* ===== 2FA inline styles ===== */
.tfa-setup-flow {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.tfa-setup-step {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.tfa-step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--gradient-primary);
  color: white;
  font-size: 0.78rem;
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 0.1rem;
}

.tfa-setup-step strong {
  display: block;
  font-size: 0.9rem;
  margin-bottom: 0.15rem;
}

.tfa-setup-step .text-muted {
  margin: 0;
}

.tfa-qr-wrapper {
  display: flex;
  justify-content: center;
  padding: 0.75rem 0;
}

.tfa-qr-img {
  width: 180px;
  height: 180px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: white;
  padding: 8px;
}

.tfa-secret-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.tfa-secret-code {
  padding: 0.35rem 0.65rem;
  border-radius: 6px;
  background: var(--bg-secondary);
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 0.825rem;
  letter-spacing: 0.04em;
  color: var(--text);
  word-break: break-all;
}

.tfa-code-input {
  max-width: 160px;
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 1.1rem;
  letter-spacing: 0.2em;
  text-align: center;
}

/* 2FA status banners */
.tfa-success-banner {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1rem;
  border-radius: 8px;
  background: var(--success-bg);
  color: var(--success);
  border: 1px solid var(--success-border);
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 1rem;
}

[data-theme="dark"] .tfa-success-banner {
  background: rgba(5, 150, 105, 0.1);
  border-color: rgba(5, 150, 105, 0.25);
  color: #34d399;
}

.tfa-enabled-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1rem;
  border-radius: 8px;
  background: var(--success-bg);
  color: var(--success);
  border: 1px solid var(--success-border);
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 1rem;
}

[data-theme="dark"] .tfa-enabled-status {
  background: rgba(5, 150, 105, 0.1);
  border-color: rgba(5, 150, 105, 0.25);
  color: #34d399;
}

.tfa-disabled-banner {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1rem;
  border-radius: 8px;
  background: var(--warning-bg);
  color: var(--warning);
  border: 1px solid var(--warning-border);
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 1rem;
}

[data-theme="dark"] .tfa-disabled-banner {
  background: rgba(252, 211, 77, 0.08);
  border-color: rgba(252, 211, 77, 0.2);
  color: #fbbf24;
}

/* Backup codes grid */
.tfa-backup-section {
  margin-top: 0.5rem;
}

.tfa-backup-section strong {
  display: block;
  font-size: 0.9rem;
  margin-bottom: 0.25rem;
}

.tfa-backup-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 0.375rem;
  margin: 0.75rem 0;
}

.tfa-backup-code {
  padding: 0.4rem 0.5rem;
  border-radius: 6px;
  background: var(--bg-secondary);
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 0.85rem;
  text-align: center;
  letter-spacing: 0.05em;
  color: var(--text);
}

/* 2FA action forms (disable/regenerate) */
.tfa-action-form {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

.tfa-action-form .text-muted {
  margin: 0 0 0.5rem;
}

.tfa-action-form-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* ===== Passkeys inline styles ===== */
.passkeys-inline-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-bottom: 0.25rem;
}

.passkey-inline-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--border);
}

.passkey-inline-item:last-child {
  border-bottom: none;
}

.passkey-inline-info {
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
  flex: 1;
  min-width: 0;
}

.passkey-inline-info > svg {
  flex-shrink: 0;
  margin-top: 0.15rem;
  color: var(--muted);
}

.passkey-inline-details {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}

.passkey-inline-details strong {
  font-size: 0.875rem;
  color: var(--text);
}

.passkey-inline-details .text-muted {
  font-size: 0.78rem;
}

.passkey-inline-actions {
  display: flex;
  gap: 0.375rem;
  flex-shrink: 0;
}

/* ── Settings: mobile nav-rail + drawer ── */

/* Backdrop (hidden on desktop) */
.settings-drawer-backdrop {
  display: none;
}

/* Mobile-only: show a simple "Sections" trigger */
.settings-mobile-sections-trigger {
  display: none;
}

/* Label span (visible on desktop by default) */
.settings-nav-label {
  /* no-op on desktop — label is always visible */
}

@media (max-width: 768px) {

  .settings-mobile-sections-trigger {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.5rem;
    margin: 0 0 0.75rem;
  }

  /* --- Rail (collapsed sidebar) --- */
  .settings-sidebar {
    position: fixed;
    left: 0;
    top: var(--nav-height);
    bottom: 0;
    width: 48px;
    padding: 0.75rem 0;
    border-right: 1px solid var(--border);
    border-bottom: none;
    background: var(--bg-secondary);
    z-index: 50;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    transition: width 0.22s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.22s ease;
  }

  body.has-app-shell .settings-sidebar {
    top: var(--app-mobile-chrome-h, 0px);
  }

  .settings-sidebar.expanded {
    width: 220px;
    z-index: 201;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.18);
    overflow-y: auto;
    clip-path: inset(0 -30px 0 0);
  }

  [data-theme="dark"] .settings-sidebar.expanded {
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.5);
  }

  /* --- Nav items in rail mode --- */
  .settings-nav {
    flex-direction: column;
    gap: 0.125rem;
    position: static;
  }

  .settings-nav-title {
    display: none;
  }

  .settings-nav-item {
    justify-content: center;
    padding: 0.7rem 0;
    gap: 0;
    border-radius: 0;
    width: 48px;
    min-height: 44px;
    position: relative;
  }

  .settings-nav-item svg,
  .settings-nav-item > svg {
    flex-shrink: 0;
  }

  .settings-nav-item.active {
    background: var(--gradient-primary-subtle);
    box-shadow: inset 3px 0 0 var(--accent);
  }

  /* Hide labels in rail mode */
  .settings-nav-label {
    display: none;
  }

  /* Catégories repliées : un trait, pas un titre tronqué. */
  .settings-sidebar:not(.expanded) .settings-nav-group {
    height: 0;
    margin: 0.75rem 0 0.4rem;
    padding: 0;
    overflow: hidden;
    font-size: 0;
    letter-spacing: 0;
    color: transparent;

/* --- from styles.css 7662-7900: toasts --- */

/* =============================================
   Toast Notifications
   ============================================= */
.toast-container {
  position: fixed;
  bottom: 1.25rem;
  right: 1.25rem;
  z-index: 10000;
  display: flex;
  flex-direction: column-reverse;
  gap: 0.5rem;
  max-width: 420px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15), 0 2px 8px rgba(0, 0, 0, 0.08);
  font-size: 0.85rem;
  color: var(--text);
  pointer-events: auto;
  opacity: 0;
  transform: translateX(20px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.toast-visible {
  opacity: 1;
  transform: translateX(0);
}

.toast-leaving {
  opacity: 0;
  transform: translateX(20px);
}

.toast-icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  margin-top: 1px;
}

.toast-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
}

.toast-message {
  line-height: 1.4;
  word-break: break-word;
}

.toast-link {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--accent, #667eea);
  text-decoration: none;
  align-self: flex-start;
}

.toast-link:hover {
  text-decoration: underline;
}

.toast-close {
  flex-shrink: 0;
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 2px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  opacity: 0.6;
  transition: opacity 0.15s;
}

.toast-close:hover {
  opacity: 1;
}

/* Type variants */
.toast-error {
  border-left: 3px solid var(--danger, #ef4444);
}

.toast-error .toast-icon {
  color: var(--danger, #ef4444);
}

.toast-success {
  border-left: 3px solid var(--success, #22c55e);
}

.toast-success .toast-icon {
  color: var(--success, #22c55e);
}

.toast-warning {
  border-left: 3px solid var(--warning, #f59e0b);
}

.toast-warning .toast-icon {
  color: var(--warning, #f59e0b);
}

.toast-info {
  border-left: 3px solid var(--accent, #667eea);
}

.toast-info .toast-icon {
  color: var(--accent, #667eea);
}

[data-theme="dark"] .toast {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4), 0 2px 8px rgba(0, 0, 0, 0.2);
}

@media (max-width: 640px) {
  .toast-container {
    left: 0.75rem;
    right: 0.75rem;
    bottom: 0.75rem;
    max-width: none;
  }
}

.text-success { color: var(--success); }
.text-danger { color: var(--danger); }

.settings-status-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.settings-status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.settings-status-connected { background: var(--success); }
.settings-status-disconnected { background: var(--danger); }
.settings-feedback { font-size: 0.875rem; }

.settings-toggle-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  cursor: pointer;
}
.settings-toggle-text {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.settings-toggle-hint {
  font-size: 0.8rem;
  line-height: 1.4;
}

/* Toggle switch */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
  margin-top: 2px;
}
.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.toggle-switch .toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: var(--border);
  border-radius: 24px;
  transition: background 0.2s;
}
.toggle-switch .toggle-slider::before {
  content: '';
  position: absolute;
  left: 2px;
  top: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
  transition: transform 0.2s;
}
.toggle-switch input:checked + .toggle-slider {
  background: var(--accent);
}
.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(20px);
}
.toggle-switch input:disabled + .toggle-slider {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Auto-respond mode dropdown (settings) */
.settings-mode-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}
.auto-respond-mode-dropdown-wrapper {
  position: relative;
  flex-shrink: 0;
}
.auto-respond-mode-trigger {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.75rem;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  border: 1.5px solid var(--border);

/* --- from styles.css 2192-2195: extra 2192-2195 --- */

svg.finance-btn-sync-ico.spin {
  transform-box: fill-box;
  transform-origin: 50% 50%;
}

/* --- from styles.css 2277-2280: extra 2277-2280 --- */

  .ce-table-wrap.finance-pu-table-wrap {
    border: none;
    box-shadow: none;
  }

/* --- from styles.css 2617-2619: extra 2617-2619 --- */

.finance-tx-page .ce-table {
  background: #fff;
}

/* --- from styles.css 2622-2624: extra 2622-2624 --- */

.finance-tx-page .ce-table tbody td {
  background: #fff;
}

/* --- from styles.css 4414-4416: extra 4414-4416 --- */

  body.has-app-shell .finance-tx-page .finance-tx-table-wrap.ce-table-wrap {
    overflow-x: visible;
  }

/* --- from styles.css 4470-4473: extra 4470-4473 --- */

.settings-users-table .settings-users-role-select {
  min-width: 11rem;
  max-width: 100%;
}

/* --- from styles.css 5030-5063: extra 5030-5063 --- */

.ce-table-wrap {
  overflow-x: auto;
  margin-bottom: 0.75rem;
  border-radius: 8px;
}
.ce-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}
.ce-table th,
.ce-table td {
  padding: 0.4rem 0.5rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.ce-table th {
  text-align: left;
  background: var(--bg-secondary);
  font-weight: 600;
  color: var(--muted);
}
.ce-table-input {
  width: 100%;
  min-width: 72px;
  padding: 0.35rem 0.45rem;
  font-size: 0.8rem;
}
.ce-table-arrow {
  text-align: center;
  color: var(--accent);
  font-weight: 600;
  width: 2rem;
}

/* --- from styles.css 5117-5139: extra 5117-5139 --- */

.settings-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
}

.settings-badge-green {
  background: var(--success-bg);
  color: var(--success);
}

.settings-badge-orange {
  background: var(--warning-bg);
  color: var(--warning);
}

.settings-badge-gray {
  background: var(--bg-secondary);
  color: var(--muted);
}

/* --- from styles.css 5197-5207: extra 5197-5207 --- */

.avatar-upload-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.avatar-circle-xl {
  width: 80px;
  height: 80px;
}

/* --- from styles.css 5397-5438: extra 5397-5438 --- */

.api-secret-input-field {
  position: relative;
  flex: 1;
  min-width: 0;
}

.api-secret-input-field > .settings-input {
  width: 100%;
  box-sizing: border-box;
  padding-right: 2.5rem;
}

.api-secret-input-field .api-key-eye-btn--embedded {
  position: absolute;
  right: 0.45rem;
  top: 50%;
  transform: translateY(-50%);
  width: 1.75rem;
  height: 1.75rem;
  border: none;
  border-radius: 999px;
  background: transparent;
  flex-shrink: 0;
  z-index: 1;
}

.api-secret-input-field .api-key-eye-btn--embedded:hover:not(:disabled) {
  color: var(--accent);
  background: var(--bg-secondary);
}

.api-secret-input-field .api-key-eye-btn--embedded:disabled {
  background: transparent;
}

.api-secret-input-field .api-key-eye-btn--embedded:disabled:hover {
  background: transparent;
}

.api-secret-input-field:focus-within .api-key-eye-btn--embedded:not(:disabled) {
  color: var(--accent);
}

/* --- from styles.css 5492-5500: extra 5492-5500 --- */

.settings-badge-blue {
  background: var(--accent-glow);
  color: var(--accent);
}

.llm-table-body {
  padding: 0 !important;
  margin: 0 !important;
}

/* --- from styles.css 5503-5544: extra 5503-5544 --- */

.llm-search-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg-secondary);
}

.llm-search-bar > svg {
  color: var(--muted);
  flex-shrink: 0;
}

.llm-search-input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 0.85rem;
  color: var(--text);
  outline: none;
  font-family: inherit;
}

.llm-search-input::placeholder {
  color: var(--muted);
}

.llm-search-clear {
  background: none;
  border: none;
  padding: 0.2rem;
  cursor: pointer;
  color: var(--muted);
  display: flex;
  border-radius: 4px;
  transition: color 0.15s;
}

.llm-search-clear:hover {
  color: var(--text);
}

/* --- from styles.css 5547-5592: extra 5547-5592 --- */

.llm-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
}

.llm-table thead {
  position: sticky;
  top: 0;
  z-index: 1;
}

.llm-table th {
  text-align: left;
  padding: 0.45rem 0.5rem;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  background: var(--bg-secondary);
  white-space: nowrap;
}

.llm-table td {
  padding: 0.5rem 0.5rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.llm-table tbody tr {
  transition: background 0.12s;
}

.llm-table tbody tr:hover {
  background: var(--bg-secondary);
}

.llm-table tbody tr:last-child td {
  border-bottom: none;
}

.llm-tr-enabled {
  background: rgba(59, 130, 246, 0.03);
}

/* --- from styles.css 5596-5604: extra 5596-5604 --- */

.llm-td-toggle {
  width: 42px;
  text-align: center;
  padding-left: 0.75rem !important;
}

.llm-th-name {
  min-width: 0;
}

/* --- from styles.css 5607-5609: extra 5607-5609 --- */

.llm-td-provider {
  width: 100px;
}

/* --- from styles.css 5612-5615: extra 5612-5615 --- */

.llm-td-icon {
  width: 30px;
  text-align: center;
}

/* --- from styles.css 5618-5633: extra 5618-5633 --- */

.llm-td-release {
  width: 75px;
  text-align: center;
  color: var(--text-secondary);
}

.llm-release-tag {
  display: inline-block;
  font-size: 0.72rem;
  font-family: 'SF Mono', 'Fira Code', monospace;
  color: var(--text-secondary);
  background: var(--bg-tertiary, rgba(255,255,255,0.04));
  padding: 1px 6px;
  border-radius: 4px;
  white-space: nowrap;
}

/* --- from styles.css 5636-5643: extra 5636-5643 --- */

.llm-td-cost {
  width: 70px;
  text-align: right;
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 0.78rem;
  color: var(--text-secondary);
  padding-right: 0.75rem !important;
}

/* --- from styles.css 5646-5669: extra 5646-5669 --- */

.llm-td-name {
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
  min-width: 0;
}

.llm-model-name {
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.llm-model-id {
  font-size: 0.68rem;
  color: var(--muted);
  font-family: 'SF Mono', 'Fira Code', monospace;
  opacity: 0.7;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* --- from styles.css 5672-5684: extra 5672-5684 --- */

.llm-provider-tag {
  font-size: 0.7rem;
  font-weight: 500;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  white-space: nowrap;
}

.llm-provider-gemini { background: rgba(66, 133, 244, 0.1); color: #4285f4; }
.llm-provider-openai { background: rgba(16, 163, 127, 0.1); color: #10a37f; }
.llm-provider-anthropic { background: rgba(204, 150, 96, 0.1); color: #cc9660; }
.llm-provider-groq { background: rgba(244, 78, 59, 0.1); color: #f44e3b; }
.llm-provider-deepseek { background: rgba(75, 109, 245, 0.1); color: #4b6df5; }

/* --- from styles.css 5688-5718: extra 5688-5718 --- */

.llm-icon-eye {
  color: var(--muted);
  opacity: 0.4;
}

.llm-icon-brain.llm-icon-active {
  color: #a855f7;
  opacity: 1;
}

.llm-icon-eye.llm-icon-active {
  color: #22c55e;
  opacity: 1;
}

.llm-icon-decisions {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1rem;
  height: 1rem;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--muted);
  opacity: 0.35;
}

.llm-icon-decisions.llm-icon-active {
  color: #0ea5e9;
  opacity: 1;
}

/* --- from styles.css 5722-5724: extra 5722-5724 --- */

.llm-th-icon .llm-icon-eye {
  opacity: 0.6;
}

/* --- from styles.css 5729-5750: extra 5729-5750 --- */

.llm-truncated {
  padding: 1.25rem 1rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.82rem;
}

.llm-refreshing {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.llm-refreshing .spin {
  animation: spin 1s linear infinite;
}

.llm-truncated {
  border-top: 1px solid var(--border);
  font-size: 0.78rem;
}

/* --- from styles.css 5754-5820: extra 5754-5820 --- */

.llm-select {
  position: relative;
  display: inline-flex;
}

.llm-select-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-size: 0.85rem;
  cursor: pointer;
  transition: border-color 0.15s ease;
  min-width: 180px;
  text-align: left;
}

.llm-select-toggle:hover {
  border-color: var(--accent);
}

.llm-select-label {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.llm-select-chevron {
  opacity: 0.5;
  transition: transform 0.15s;
  flex-shrink: 0;
}

.llm-select.open .llm-select-chevron {
  transform: rotate(180deg);
}

.llm-select-menu {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  z-index: 1000;
  overflow-y: auto;
}

.llm-select-option {
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 0.82rem;
  cursor: pointer;
  text-align: left;
}

.llm-select-star {
  margin-left: 0.25rem;
  vertical-align: middle;
  position: relative;
  top: -1px;
  flex-shrink: 0;
}

/* --- from styles.css 5823-5879: extra 5823-5879 --- */

.llm-select-brain {
  color: var(--muted);
  opacity: 0.6;
  margin-left: 0.25rem;
  vertical-align: middle;
  position: relative;
  top: -1px;
  flex-shrink: 0;
}

.llm-select-release {
  font-size: 0.65rem;
  color: var(--muted);
  opacity: 0.6;
  margin-left: 0.15rem;
}

.llm-select-table {
  width: 100%;
  border-collapse: collapse;
}

.llm-select-table tr.llm-select-option {
  cursor: pointer;
}

.llm-select-table tr.llm-select-option:hover {
  background: var(--background);
}

.llm-select-table tr.llm-select-option.selected {
  background: var(--border);
}

.llm-select-col-label {
  padding: 0.45rem 0.6rem;
  text-align: left;
  white-space: nowrap;
}

.llm-select-col-price {
  padding: 0.45rem 0.6rem;
  text-align: right;
  font-size: 0.65rem;
  color: var(--muted);
  opacity: 0.7;
  white-space: nowrap;
}

.llm-select-overlay {
  display: none;
}

.llm-select.placeholder .llm-select-toggle {
  color: var(--muted);
  font-style: italic;
}

/* --- from styles.css 5935-5944: extra 5935-5944 --- */

.agent-llm-model-select .llm-select {
  display: flex;
  width: 100%;
  min-width: 0;
}

.agent-llm-model-select .llm-select-toggle {
  min-width: 0;
  width: 100%;
}

/* --- from styles.css 5961-5970: extra 5961-5970 --- */

.agent-llm-reasoning-select .llm-select {
  display: flex;
  width: 100%;
  min-width: 0;
}

.agent-llm-reasoning-select .llm-select-toggle {
  min-width: 0;
  width: 100%;
}

/* --- from styles.css 6038-6041: extra 6038-6041 --- */

.agent-llm-fallback-chain-model .llm-select-toggle {
  width: 100%;
  min-width: 0;
}

/* --- from styles.css 6050-6053: extra 6050-6053 --- */

.agent-llm-fallback-chain-reasoning .llm-select-toggle {
  min-width: 0;
  width: 100%;
}

/* --- from styles.css 6117-6120: extra 6117-6120 --- */

.agent-llm-fallback-reasoning .llm-select-toggle {
  min-width: 0;
  width: 100%;
}

/* --- from styles.css 6238-6245: extra 6238-6245 --- */

.collapse-chevron {
  transition: transform 0.2s ease;
  margin-right: 0.25rem;
}

.collapse-chevron.open {
  transform: rotate(90deg);
}

/* --- from styles.css 6248-6292: extra 6248-6292 --- */

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 38px;
  height: 22px;
  flex-shrink: 0;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--border);
  border-radius: 22px;
  transition: 0.2s;
}

.toggle-slider::before {
  content: '';
  position: absolute;
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background: white;
  border-radius: 50%;
  transition: 0.2s;
}

.toggle-switch input:checked + .toggle-slider {
  background: var(--accent);
}

.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(16px);
}

/* --- from styles.css 6458-6460: extra 6458-6460 --- */

.spin {
  animation: spin 0.8s linear infinite;
}

/* --- from styles.css 7071-7079: extra 7071-7079 --- */

  .agent-llm-controls .llm-select {
    flex: 1;
    min-width: 0;
  }

  .agent-llm-controls .llm-select-toggle {
    min-width: 0;
    width: 100%;
  }

/* --- from styles.css 7116-7149: extra 7116-7149 --- */

  .llm-select-overlay {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 999;
  }

  .llm-select-menu {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    top: auto !important;
    min-width: 0 !important;
    width: 100% !important;
    border-radius: 12px 12px 0 0;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
    z-index: 1000 !important;
    max-height: 60vh;
  }

  .llm-select-col-label {
    padding: 0.6rem 0.75rem;
    font-size: 0.85rem;
  }

  .llm-select-col-price {
    padding: 0.6rem 0.75rem;
    font-size: 0.75rem;
  }

/* --- from styles.css 7270-7276: extra 7270-7276 --- */

  .llm-table-body {
    overflow-x: visible;
  }

  .llm-table thead {
    display: none;
  }

/* --- from styles.css 7279-7301: extra 7279-7301 --- */

  .llm-table tbody {
    display: block;
    width: 100%;
  }

  .llm-table tbody tr {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto auto auto;
    grid-template-rows: auto auto;
    gap: 0;
    padding: 0.55rem 0.75rem;
    border-bottom: 1px solid var(--border);
    align-items: center;
  }

  .llm-table tbody tr:last-child {
    border-bottom: none;
  }

  .llm-table td {
    border: none;
    padding: 0;
  }

/* --- from styles.css 7304-7312: extra 7304-7312 --- */

  .llm-table tbody tr td:nth-child(1) {
    grid-column: 1;
    grid-row: 1 / 3;
    padding-right: 0.5rem !important;
    padding-left: 0 !important;
    display: flex;
    align-items: center;
    width: auto;
  }

/* --- from styles.css 7315-7327: extra 7315-7327 --- */

  .llm-table tbody tr td:nth-child(2) {
    grid-column: 2;
    grid-row: 1;
    min-width: 0;
  }

  .llm-model-name {
    font-size: 0.88rem;
  }

  .llm-model-id {
    font-size: 0.66rem;
  }

/* --- from styles.css 7330-7332: extra 7330-7332 --- */

  .llm-table tbody tr td:nth-child(3) {
    display: none;
  }

/* --- from styles.css 7335-7341: extra 7335-7341 --- */

  .llm-table tbody tr td:nth-child(4) {
    grid-column: 3;
    grid-row: 1;
    width: auto;
    text-align: center;
    padding: 0 0.15rem;
  }

/* --- from styles.css 7344-7350: extra 7344-7350 --- */

  .llm-table tbody tr td:nth-child(5) {
    grid-column: 4;
    grid-row: 1;
    width: auto;
    text-align: center;
    padding: 0 0.15rem;
  }

/* --- from styles.css 7353-7359: extra 7353-7359 --- */

  .llm-table tbody tr td:nth-child(6) {
    grid-column: 5;
    grid-row: 1;
    width: auto;
    text-align: center;
    padding: 0 0.15rem;
  }

/* --- from styles.css 7362-7371: extra 7362-7371 --- */

  .llm-table tbody tr td:nth-child(7) {
    grid-column: 2;
    grid-row: 2;
    width: auto;
    text-align: left;
    font-size: 0.72rem;
    color: var(--muted);
    padding-top: 0.15rem;
    white-space: nowrap;
  }

/* --- from styles.css 7375-7396: extra 7375-7396 --- */

  .llm-table tbody tr td:nth-child(9) {
    grid-row: 2;
    width: auto;
    text-align: right;
    font-size: 0.7rem;
    padding-top: 0.15rem;
    white-space: nowrap;
  }

  .llm-table tbody tr td:nth-child(8) {
    grid-column: 3 / 5;
  }

  .llm-table tbody tr td:nth-child(9) {
    grid-column: 5;
    padding-right: 0 !important;
  }

  .llm-release-tag {
    font-size: 0.65rem;
    padding: 1px 4px;
  }

/* --- from styles.css 7431-7434: extra 7431-7434 --- */

.settings-badge-success {
  background: var(--success-bg);
  color: var(--success);
}

/* --- from styles.css 10611-10613: extra 10611-10613 --- */

.chat-note-toggle-switch {
  gap: 0.5rem;
}

/* --- from styles.css 11760-11762: extra 11760-11762 --- */

.settings-toggle-row .toggle-switch {
  margin-top: 0.15rem;
}

/* --- from styles.css 14936-14950: extra 14936-14950 --- */

.res-tl-inq-toggle .toggle-switch {
  width: 34px;
  height: 20px;
}

.res-tl-inq-toggle .toggle-slider::before {
  width: 14px;
  height: 14px;
  left: 3px;
  bottom: 3px;
}

.res-tl-inq-toggle .toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(14px);
}

/* --- from styles.css 16068-16082: extra 16068-16082 --- */

  .res-tl-inq-toggle .toggle-switch {
    width: 34px;
    height: 20px;
  }

  .res-tl-inq-toggle .toggle-slider::before {
    width: 14px;
    height: 14px;
    left: 3px;
    bottom: 3px;
  }

  .res-tl-inq-toggle .toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(14px);
  }

/* --- from styles.css 16606-16608: extra 16606-16608 --- */

.bookings-page .bk-finance-table--body td {
  vertical-align: top;
}

/* --- from styles.css 16693-16725: extra 16693-16725 --- */

.bookings-page .bk-finance-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}
.bookings-page .bk-finance-table th,
.bookings-page .bk-finance-table td {
  padding: 0.14rem 0;
  border-bottom: none;
}
.bookings-page .bk-finance-table--body tr + tr th,
.bookings-page .bk-finance-table--body tr + tr td {
  border-top: 1px solid color-mix(in srgb, var(--border) 55%, transparent);
}
.bookings-page .bk-finance-table th {
  text-align: left;
  color: var(--muted);
  font-weight: 500;
}
.bookings-page .bk-finance-table td {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}
.bookings-page .bk-finance-table__net th,
.bookings-page .bk-finance-table__net td {
  border-bottom: none;
  border-top: 2px solid color-mix(in srgb, var(--text) 28%, var(--border));
  padding-top: 0.48rem;
  font-size: 0.95rem;
  font-weight: 800;
  background: color-mix(in srgb, var(--surface) 88%, var(--text) 4%);
}

/* --- from styles.css 16735-16744: extra 16735-16744 --- */

.bookings-page .bk-card--finance .bk-finance-table__net td {
  font-size: 0.82rem;
  font-weight: 500;
  padding-top: 0.32rem;
  border-top: 1px solid color-mix(in srgb, var(--border) 50%, transparent);
  background: transparent;
}
.bookings-page .bk-card--finance .bk-finance-table__net td {
  font-weight: 600;
}

/* --- from styles.css 18335-18337: extra 18335-18337 --- */

.settings-users-page-alert {
  margin-top: 0.75rem;
}

/* --- from compta.css 29-90: brand --- */

.compta-brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.85rem 0.75rem 0.65rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.compta-brand__mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 9px;
  background: var(--gradient-primary);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  flex-shrink: 0;
  box-shadow: 0 4px 12px var(--accent-shadow);
}

.compta-brand__meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.2;
}

.compta-brand__meta strong {
  font-size: 0.92rem;
  font-weight: 650;
  color: var(--text);
}

.compta-brand__meta span {
  font-size: 0.72rem;
  color: var(--muted);
}

@media (min-width: 769px) and (max-width: 1200px) {
  .app-sidebar:not(:hover):not(:focus-within) .compta-brand__meta {
    width: 0;
    max-width: 0;
    opacity: 0;
    overflow: hidden;
  }

  .app-sidebar:not(:hover):not(:focus-within) .compta-brand {
    justify-content: center;
    padding-left: 0.35rem;
    padding-right: 0.35rem;
  }
}

.compta-sidebar-logout {
  margin: 0;
}


/* --- from compta.css 2250-2270: settings-nav-group --- */

.settings-nav-group {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 0.75rem 0.55rem 0.25rem;
}

.settings-nav-group:first-child {
  padding-top: 0.35rem;
}

.settings-section-lead {
  margin: 0 0 1rem;
}

.read-key-table td code {
  font-size: 0.82rem;
}


/* --- from compta.css 5953-5970: settings-nav-item --- */

.settings-nav-item {
  text-decoration: none !important;
}

.settings-nav-item:hover,
.settings-nav-item:focus,
.settings-nav-item:active {
  text-decoration: none !important;
}

/* Aurelia host = chaîne flex Lucidos pour le rail paramètres */
page-settings {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
}

/* --- from compta.css 7523-7535: settings-nav-count --- */

.settings-nav-count {
  position: static;
  transform: none;
  margin-left: auto;
  top: auto;
  right: auto;
}
/* Archive = choix de l'utilisateur : compteur et type, pas une alerte. */
.nav-unread-badge.is-quiet,
.compta-badge.is-quiet {
  box-sizing: border-box;
  background: var(--bg-secondary);
  color: var(--muted);
