/* ==========================================================================
   B'DESK — DESIGN SYSTEM & FEUILLE DE STYLE PRINCIPALE (STYLE BOULANGER)
   ========================================================================== */

:root {
  /* --- Palette Boulanger Signature --- */
  --orange: #f37021;
  --orange-hover: #ff7e33;
  --orange-dark: #df5d12;
  --orange-soft: #fff5ee;
  --orange-tint: rgba(243, 112, 33, 0.08);
  --orange-border: rgba(243, 112, 33, 0.22);
  --orange-glow: rgba(243, 112, 33, 0.28);
  --orange-gradient: linear-gradient(135deg, #f37021 0%, #ff833e 100%);

  /* --- Bleu Marine Boulanger (Tech & Contrast) --- */
  --blue: #0c2340;
  --blue-dark: #071526;
  --blue-light: #16365c;
  --navy: #0c2340;
  --navy-light: #16365c;
  --blue-soft: #edf3f8;
  --blue-tint: rgba(12, 35, 64, 0.06);
  --navy-gradient: linear-gradient(135deg, #0c2340 0%, #1a436e 100%);

  /* --- Couleurs Sémantiques --- */
  --green: #10b981;
  --green-dark: #059669;
  --green-soft: #ecfdf5;
  --red: #ef4444;
  --red-dark: #dc2626;
  --red-soft: #fef2f2;
  --amber: #f59e0b;
  --amber-soft: #fffbeb;
  --purple: #8b5cf6;
  --purple-soft: #f5f3ff;
  --sky: #0284c7;
  --sky-soft: #f0f9ff;

  /* --- Neutres & Surfaces --- */
  --white: #ffffff;
  --background: #f5f8fb;
  --surface: #ffffff;
  --surface-hover: #fafcfe;
  --surface-alt: #f8fafc;
  --text: #0d1e32;
  --text-primary: #0d1e32;
  --muted: #586e86;
  --text-secondary: #475a6f;
  --text-muted: #8b9eb3;
  --line: #dbe4ee;
  --line-light: #edf2f7;

  /* --- Ombres & Élévation --- */
  --shadow-xs: 0 1px 3px rgba(12, 35, 64, 0.04);
  --shadow-sm: 0 3px 10px rgba(12, 35, 64, 0.05);
  --shadow: 0 8px 24px -4px rgba(12, 35, 64, 0.07), 0 2px 6px -1px rgba(12, 35, 64, 0.04);
  --shadow-md: 0 8px 24px -4px rgba(12, 35, 64, 0.07), 0 2px 6px -1px rgba(12, 35, 64, 0.04);
  --shadow-lg: 0 16px 36px -6px rgba(12, 35, 64, 0.11), 0 4px 12px -2px rgba(12, 35, 64, 0.05);
  --shadow-orange: 0 8px 20px -3px rgba(243, 112, 33, 0.35);

  /* --- Rayons de Courbure --- */
  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius: 18px;
  --radius-lg: 22px;
  --radius-xl: 28px;
  --radius-full: 9999px;

  /* --- Variables Système --- */
  --touch-target: 64px;
  --header-height: 72px;
  --transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-smooth: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

body.dark-mode {
  --background: #101820;
  --surface: #17232e;
  --surface-hover: #1d2c38;
  --surface-alt: #14202a;
  --white: #f4f7fa;
  --blue: #edf3f7;
  --blue-dark: #ffffff;
  --blue-light: #c1ced8;
  --navy: #edf3f7;
  --navy-light: #c1ced8;
  --text: #edf3f7;
  --text-primary: #edf3f7;
  --muted: #a7b8c7;
  --text-secondary: #c1ced8;
  --text-muted: #8194a5;
  --line: #304454;
  --line-light: #263947;
  --blue-soft: #203545;
  --blue-tint: rgba(164, 190, 211, 0.1);
  --orange-soft: #3a291f;
  --orange-tint: rgba(243, 112, 33, 0.14);
  --green-soft: #17352d;
  --amber-soft: #3a3018;
  --red-soft: #3a2024;
  --purple-soft: #2b2440;
  --sky-soft: #193344;
  background-color: var(--background);
  background-image: radial-gradient(at 100% 0%, rgba(243, 112, 33, 0.08) 0, transparent 50%), radial-gradient(at 0% 100%, rgba(64, 137, 190, 0.08) 0, transparent 50%);
}

body.dark-mode .panel,
body.dark-mode .compact-tool-card,
body.dark-mode .home-welcome,
body.dark-mode .home-daily-tasks,
body.dark-mode .date-card,
body.dark-mode .home-focus-panel,
body.dark-mode .home-news-panel,
body.dark-mode .fifo-card,
body.dark-mode .sav-scan-panel,
body.dark-mode .sav-list-panel,
body.dark-mode .sav-item,
body.dark-mode .notes-control-card,
body.dark-mode .notes-empty-state,
body.dark-mode .password-card,
body.dark-mode .password-login-panel,
body.dark-mode .transfer-simple-panel,
body.dark-mode .received-files-panel,
body.dark-mode .tasks-sidebar,
body.dark-mode .tasks-planning,
body.dark-mode .login-card {
  background: var(--surface);
  border-color: var(--line);
}

body.dark-mode input,
body.dark-mode select,
body.dark-mode textarea,
body.dark-mode option,
body.dark-mode [contenteditable="true"],
body.dark-mode .password-pill,
body.dark-mode .quick-buttons button,
body.dark-mode .calendar-corner,
body.dark-mode .calendar-day,
body.dark-mode .calendar-person,
body.dark-mode .calendar-cell,
body.dark-mode .received-file-item {
  background: var(--surface-alt);
  border-color: var(--line);
  color: var(--text);
}

body.dark-mode .topbar {
  background: rgba(16, 24, 32, 0.96);
  border-color: var(--line);
}

body.dark-mode .sidebar-toggle,
body.dark-mode .menu-toggle {
  background: var(--surface-alt);
  border-color: var(--line);
  color: var(--text);
}

body.dark-mode .menu-toggle span {
  background: var(--text);
}

body.dark-mode .nav-link:hover,
body.dark-mode .secondary-button:hover,
body.dark-mode .notes-secondary-button:hover {
  background: var(--surface-hover);
}

body.dark-mode .nav-link.active {
  background: #4b2b1d;
  color: #ffb078;
}

body.dark-mode .nav-link-premium {
  color: #fff;
}

body.dark-mode .home-welcome {
  background: linear-gradient(135deg, #17232e 0%, #1b2934 100%);
}

body.dark-mode .date-card,
body.dark-mode .home-daily-tasks,
body.dark-mode .login-card {
  background: rgba(23, 35, 46, 0.97);
}

body.dark-mode .home-daily-head strong,
body.dark-mode .home-daily-label {
  color: var(--text);
}

body.dark-mode .home-daily-item {
  background: var(--surface-alt);
  border-color: var(--line);
}

body.dark-mode .home-daily-item.is-done {
  background: rgba(22, 163, 74, 0.15);
  border-color: rgba(34, 197, 94, 0.4);
}

body.dark-mode .home-daily-item.is-done .home-daily-label {
  color: #86efac;
}

body.dark-mode .home-daily-check {
  background: var(--surface-alt);
  border-color: var(--line);
}

body.dark-mode .home-daily-progress {
  background: var(--surface-alt);
}

body.dark-mode .service-search-panel,
body.dark-mode .service-card,
body.dark-mode .service-card-qr,
body.dark-mode .fifo-day-card,
body.dark-mode .home-reminder-item,
body.dark-mode .note-card,
body.dark-mode .procedure-card,
body.dark-mode .contact-card,
body.dark-mode .nff-stat-card,
body.dark-mode .nff-toolbar,
body.dark-mode .nff-side-panel,
body.dark-mode .nff-add-card,
body.dark-mode .nff-manager-card,
body.dark-mode .printer-settings,
body.dark-mode .service-form,
body.dark-mode .raccourcis-info {
  background: var(--surface);
  border-color: var(--line);
  color: var(--text);
}

body.dark-mode .service-card-details h2,
body.dark-mode .home-panel-heading h2,
body.dark-mode .home-reminder-content strong,
body.dark-mode .note-card-title,
body.dark-mode .procedure-card h3,
body.dark-mode .contact-card h3,
body.dark-mode .nff-stat-value,
body.dark-mode .tasks-section-title,
body.dark-mode .tasks-week-label {
  color: var(--blue);
}

body.dark-mode .home-reminder-item.is-overdue {
  background: var(--red-soft);
  border-color: #71333d;
}

body.dark-mode .home-reminder-item.is-today {
  background: var(--orange-soft);
  border-color: #795035;
}

body.dark-mode .tasks-calendar,
body.dark-mode .tasks-calendar-wrap {
  border-color: var(--line);
  background: var(--line);
}

body.dark-mode .search-field,
body.dark-mode .nff-filters,
body.dark-mode .nff-period-button,
body.dark-mode .nff-collaborator-filter select,
body.dark-mode .category-button,
body.dark-mode .empty-state,
body.dark-mode .sav-history-item,
body.dark-mode .home-reminder-item,
body.dark-mode .note-status-button,
body.dark-mode .note-icon-button,
body.dark-mode .tasks-button-secondary,
body.dark-mode .tasks-button-warning,
body.dark-mode .procedure-tab,
body.dark-mode .secondary-button,
body.dark-mode .notes-secondary-button {
  background: var(--surface-alt);
  border-color: var(--line);
  color: var(--blue);
}

body.dark-mode .search-field:focus-within,
body.dark-mode .category-button:hover,
body.dark-mode .nff-period-button:hover,
body.dark-mode .procedure-tab:hover,
body.dark-mode .secondary-button:hover,
body.dark-mode .notes-secondary-button:hover {
  background: var(--surface-hover);
}

body.dark-mode .category-button.active,
body.dark-mode .nff-period-button.active,
body.dark-mode .procedure-tab.active {
  background: var(--orange-gradient);
  border-color: transparent;
  color: var(--white);
}

body.dark-mode .search-field input::placeholder,
body.dark-mode input::placeholder,
body.dark-mode textarea::placeholder {
  color: var(--text-muted);
}

body.dark-mode .procedure-form-group input,
body.dark-mode .procedure-form-group select,
body.dark-mode .procedure-form-group textarea,
body.dark-mode #editor-container .ql-toolbar.ql-snow,
body.dark-mode #editor-container .ql-container.ql-snow,
body.dark-mode #editor-container .ql-editor {
  background: var(--surface-alt) !important;
  border-color: var(--line) !important;
  color: var(--text) !important;
}

body.dark-mode #editor-container .ql-editor.ql-blank::before {
  color: var(--text-muted);
}

body.dark-mode #editor-container .ql-stroke {
  stroke: var(--text-secondary);
}

body.dark-mode #editor-container .ql-fill {
  fill: var(--text-secondary);
}

body.dark-mode #editor-container .ql-picker-label,
body.dark-mode #editor-container .ql-picker-options,
body.dark-mode #editor-container .ql-picker-item {
  color: var(--text-secondary);
  background: var(--surface-alt);
}

body.dark-mode #editor-container .ql-picker-options {
  border-color: var(--line);
}

body.dark-mode .procedure-form-group .ql-toolbar,
body.dark-mode .procedure-form-group .ql-container,
body.dark-mode .procedure-form-group .ql-editor {
  background: var(--surface-alt) !important;
  border-color: var(--line) !important;
  color: var(--text) !important;
}

body.dark-mode .procedure-form-group .ql-editor.ql-blank::before {
  color: var(--text-muted) !important;
}

body.dark-mode .nff-card,
body.dark-mode .note-modal-panel,
body.dark-mode .task-modal-panel,
body.dark-mode .password-edit-card,
body.dark-mode .procedure-modal-panel,
body.dark-mode .nff-add-modal,
body.dark-mode .nff-manager-modal,
body.dark-mode .service-modal,
body.dark-mode .categorie-modal {
  background: var(--surface) !important;
  border-color: var(--line) !important;
  color: var(--text) !important;
}

body.dark-mode .nff-card p,
body.dark-mode .nff-card strong,
body.dark-mode .nff-card span,
body.dark-mode .nff-card h2,
body.dark-mode .nff-card h3,
body.dark-mode .task-modal-panel p,
body.dark-mode .note-modal-panel h2,
body.dark-mode .password-edit-card h2,
body.dark-mode .procedure-modal-panel,
body.dark-mode .procedure-modal-panel * {
  color: var(--text);
}

body.dark-mode .nff-card .nff-resolution,
body.dark-mode .nff-card .nff-resolution p,
body.dark-mode .nff-card .nff-resolution span {
  background: var(--green-soft);
  color: #6ee7b7;
  border-color: rgba(16, 185, 129, 0.3);
}

body.dark-mode .note-modal-panel input,
body.dark-mode .note-modal-panel select,
body.dark-mode .note-modal-panel textarea,
body.dark-mode .task-modal-panel input,
body.dark-mode .task-modal-panel select,
body.dark-mode .task-modal-panel textarea,
body.dark-mode .password-edit-card input,
body.dark-mode .password-edit-card select,
body.dark-mode .password-edit-card textarea,
body.dark-mode .procedure-modal-panel input,
body.dark-mode .procedure-modal-panel select,
body.dark-mode .procedure-modal-panel textarea {
  background: var(--surface-alt) !important;
  border-color: var(--line) !important;
  color: var(--text) !important;
}

body.dark-mode .note-modal-close,
body.dark-mode .password-edit-close,
body.dark-mode .nff-manager-close,
body.dark-mode .nff-add-close,
body.dark-mode .procedure-modal-close {
  background: var(--surface-alt);
  color: var(--text-secondary);
}

body.dark-mode .note-modal-close:hover,
body.dark-mode .password-edit-close:hover,
body.dark-mode .nff-manager-close:hover,
body.dark-mode .nff-add-close:hover,
body.dark-mode .procedure-modal-close:hover {
  background: var(--orange-soft);
  color: var(--orange);
}

body.dark-mode .toast {
  background: #203545;
  border-color: #3d5a6d;
  color: var(--text);
}

body.dark-mode .ql-toolbar button,
body.dark-mode .ql-toolbar .ql-picker-label {
  background: transparent !important;
  color: var(--text-secondary) !important;
}

body.dark-mode .ql-toolbar button:hover,
body.dark-mode .ql-toolbar .ql-picker-label:hover {
  background: var(--surface-hover) !important;
}

body.dark-mode button:disabled:not(.primary-button):not(.notes-primary-button):not(.print-button):not(.tasks-button-primary) {
  background: var(--surface-alt) !important;
  border-color: var(--line) !important;
  color: var(--text-muted) !important;
}

body.dark-mode .procedure-form-actions button[style*="color"],
body.dark-mode [style*="color:#dc3545"] {
  color: #ff8f9a !important;
}

body.dark-mode .login-card h1,
body.dark-mode .login-card label,
body.dark-mode .home-welcome h1,
body.dark-mode .section-heading h2,
body.dark-mode .compact-tool-content strong,
body.dark-mode .home-sav-title,
body.dark-mode .home-sav-color strong {
  color: var(--text);
}

/* ==========================================================================
   RESET & STYLES GLOBAUX
   ========================================================================== */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  overflow-x: clip;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background-color: var(--background);
  background-image: 
    radial-gradient(at 100% 0%, rgba(243, 112, 33, 0.04) 0px, transparent 50%),
    radial-gradient(at 0% 100%, rgba(12, 35, 64, 0.03) 0px, transparent 50%);
  background-attachment: fixed;
  color: var(--text);
  font-family: "Montserrat", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-track {
  background: #edf2f7;
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 999px;
  border: 2px solid #edf2f7;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--orange);
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  border: 0;
  background: none;
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(243, 112, 33, 0.45);
  outline-offset: 2px;
}

[hidden],
.hidden {
  display: none !important;
}

.app-shell {
  display: flex;
  min-height: 100vh;
  flex-direction: column;
}

.app-shell > .topbar,
.app-shell > .alerts-ticker,
.app-shell > .main-content,
.app-shell > .footer {
  margin-left: calc(260px + max(24px, (100% - 1580px) / 2));
  transition: width 0.35s cubic-bezier(0.16, 1, 0.3, 1), margin-left 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.app-shell > .topbar {
  width: 260px;
  margin-left: 0;
  transition: width 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.app-shell > .alerts-ticker {
  margin-left: 260px;
  width: calc(100% - 260px);
}

.main-content {
  width: min(calc(100% - 308px), 1320px);
  flex: 1;
  margin-top: 0;
  margin-right: auto;
  margin-bottom: 0;
  margin-left: calc(260px + max(24px, (100% - 1580px) / 2));
  padding: 36px 0 60px;
}

@media (max-width: 768px) {
  .app-shell > .main-content,
  .app-shell > .footer {
    margin-left: auto;
    margin-right: auto;
  }

  .main-content {
    width: min(calc(100% - 32px), 1320px);
    padding: 24px 0 48px;
  }

  .footer {
    width: calc(100% - 32px);
    margin-left: 0;
    margin-right: 0;
  }
}

/* ==========================================================================
   COMPOSANTS DE BASE & CARTES
   ========================================================================== */

/* Bandeau d'alertes / News Flash */
.alerts-ticker {
  position: relative;
  width: 100%;
  background: linear-gradient(105deg, #df5d12 0%, #f37021 48%, #ff833e 100%);
  color: var(--white);
  font-size: 14px;
  font-weight: 600;
  overflow: hidden;
  box-sizing: border-box;
  box-shadow: 0 3px 12px rgba(223, 93, 18, 0.18), inset 0 -1px 0 rgba(255, 255, 255, 0.18);
}

.alerts-ticker::before {
  position: absolute;
  top: 0;
  bottom: 0;
  left: -35%;
  width: 24%;
  content: "";
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transform: skewX(-20deg);
  animation: alert-shine 14s ease-in-out infinite;
  pointer-events: none;
}

@keyframes alert-shine {
  0%, 55% { left: -35%; }
  100% { left: 120%; }
}

.alerts-ticker-track {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 32px;
  min-height: 42px;
  padding: 9px 24px;
  white-space: nowrap;
  flex-wrap: nowrap;
  width: max-content;
  animation: tickerScroll linear infinite;
  animation-duration: 40s;
}

.alerts-ticker:hover .alerts-ticker-track,
.alerts-ticker:focus-within .alerts-ticker-track {
  animation-play-state: paused;
}

@keyframes tickerScroll {
  to { transform: translateX(-50%); }
}

.alerts-ticker-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  line-height: 1.35;
}

.alerts-ticker-separator::before {
  content: "•";
  color: rgba(255, 255, 255, 0.58);
  margin-left: 8px;
}

@media (prefers-reduced-motion: reduce) {
  .alerts-ticker::before {
    animation: none;
  }

  .alerts-ticker-track {
    animation: none;
  }
}

@media (max-width: 768px) {
  .alerts-ticker {
    font-size: 13px;
  }

  .alerts-ticker-track {
    padding: 10px 16px;
    gap: 16px;
  }
}

.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.panel:hover {
  box-shadow: var(--shadow-md);
}

.eyebrow,
.notes-kicker,
.notes-section-kicker {
  margin: 0;
  color: var(--orange);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* --- Boutons --- */
.primary-button,
.secondary-button,
.notes-primary-button,
.notes-secondary-button,
.print-button {
  display: inline-flex;
  min-height: var(--touch-target);
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 20px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: -0.2px;
  text-decoration: none;
  transition: var(--transition);
  cursor: pointer;
  white-space: nowrap;
}

.primary-button,
.notes-primary-button,
.print-button {
  background: var(--orange-gradient);
  color: var(--white);
  box-shadow: 0 4px 14px rgba(243, 112, 33, 0.28);
  border: 1px solid transparent;
}

.primary-button:hover:not(:disabled),
.notes-primary-button:hover:not(:disabled),
.print-button:hover:not(:disabled) {
  background: linear-gradient(135deg, #ff7e33 0%, #f37021 100%);
  box-shadow: 0 6px 20px rgba(243, 112, 33, 0.4);
  transform: translateY(-2px);
}

.primary-button:active:not(:disabled),
.notes-primary-button:active:not(:disabled),
.print-button:active:not(:disabled) {
  transform: translateY(0);
}

.secondary-button,
.notes-secondary-button {
  border: 1px solid var(--line);
  background: var(--white);
  color: var(--blue);
  box-shadow: var(--shadow-xs);
}

.secondary-button:hover:not(:disabled),
.notes-secondary-button:hover:not(:disabled) {
  border-color: #cbd5e1;
  background: var(--blue-soft);
  color: var(--blue);
  transform: translateY(-1px);
}

.primary-button:disabled,
.secondary-button:disabled,
.notes-primary-button:disabled,
.notes-secondary-button:disabled,
.print-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none !important;
  box-shadow: none !important;
}

.full-width {
  width: 100%;
}

.empty-state {
  padding: 36px 24px;
  border: 1.5px dashed #cbd5e1;
  border-radius: 16px;
  background: #fbfcfd;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  text-align: center;
}

/* ==========================================================================
   NAVIGATION PRINCIPALE & HEADER (DESIGN BOULANGER)
   ========================================================================== */

.topbar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 500;
  display: flex;
  width: 260px;
  height: 100vh;
  align-items: stretch;
  border-right: 1px solid rgba(219, 228, 238, 0.85);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 2px 12px rgba(12, 35, 64, 0.03);
  padding: 24px 14px;
  box-sizing: border-box;
}

@media (min-width: 769px) {
  .topbar {
    overflow: visible;
  }

  .topbar-inner {
    max-height: calc(100vh - 48px);
    overflow-x: hidden;
    overflow-y: auto;
    scrollbar-width: thin;
  }
}

.topbar-inner {
  display: flex;
  width: 100%;
  flex-direction: column;
  align-items: stretch;
  gap: 24px;
  box-sizing: border-box;
}

.sidebar-toggle {
  position: fixed;
  top: calc(50% + 5px);
  left: 259px;
  display: grid;
  width: 28px;
  height: 58px;
  flex: 0 0 28px;
  place-items: center;
  margin: 0;
  border: 1px solid var(--line);
  border-left: 0;
  border-radius: 0 10px 10px 0;
  background: var(--white);
  color: var(--blue);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  transition: var(--transition);
  transform: translateY(-50%);
  box-shadow: 3px 0 10px rgba(12, 35, 64, 0.06);
}

.sidebar-toggle:hover {
  border-color: var(--orange);
  background: var(--orange-soft);
  color: var(--orange);
  transform: translateX(2px) translateY(-50%);
}

/* En-tête logo + bouton theme (desktop: colonne ; mobile: ligne) */
.topbar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
}

/* Logo B'Desk */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  text-decoration: none;
  transition: var(--transition);
  margin: 0 10px;
}

.brand:hover {
  transform: translateY(-1px);
}

.brand-logo-mark {
  position: relative;
  overflow: hidden;
  display: inline-grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 11px;
  background: linear-gradient(145deg, #ff9b5d 0%, #f37021 48%, #df5d12 100%);
  box-shadow: 0 6px 14px rgba(243, 112, 33, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.brand-logo-mark::before,
.login-brand-mark::before {
  position: absolute;
  top: -45%;
  left: -25%;
  width: 150%;
  height: 55%;
  content: "";
  background: rgba(255, 255, 255, 0.24);
  transform: rotate(-35deg);
  pointer-events: none;
}

.brand-logo-mark .brand-mark {
  position: relative;
  z-index: 1;
  color: var(--white);
  font-size: 16px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0;
}

.brand-name {
  color: var(--blue);
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.8px;
}

.brand-tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--orange-soft);
  color: var(--orange-dark);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* Liens de navigation */
.main-nav {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  margin: 0;
  min-width: 0;
}

.nav-link {
  display: inline-flex;
  min-height: 52px;
  align-items: center;
  gap: 6px;
  padding: 0 14px;
  border-radius: 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -0.2px;
  text-decoration: none;
  transition: var(--transition);
  white-space: nowrap;
  touch-action: manipulation;
}

.nav-icon {
  font-size: 16px;
  line-height: 1;
  display: grid;
  place-items: center;
  transition: transform 0.2s ease;
}

.nav-link:hover {
  background: var(--blue-soft);
  color: var(--blue);
}

.nav-link:hover .nav-icon {
  transform: scale(1.15);
}

.nav-link.active {
  background: var(--orange-soft);
  color: var(--orange-dark);
  font-weight: 800;
}

.nav-link:active {
  background: var(--orange-tint);
  transform: scale(0.98);
}

.nav-divider {
  width: 100%;
  height: 1px;
  background: var(--line);
  margin: 8px 0;
}

.nav-link-external {
  color: #6b7f94;
}

.nav-link-premium {
  color: var(--white);
  background: linear-gradient(135deg, #df5d12 0%, #f37021 52%, #ff833e 100%);
  box-shadow: 0 5px 14px rgba(243, 112, 33, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.nav-link-premium:hover {
  color: var(--white);
  background: linear-gradient(135deg, #f37021 0%, #ff833e 58%, #ff9b5d 100%);
  box-shadow: 0 7px 18px rgba(243, 112, 33, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.24);
}

.nav-link-premium .nav-icon {
  color: var(--white);
}

.nav-external-arrow {
  font-size: 11px;
  opacity: 0.6;
  margin-left: -2px;
}

/* Actions à droite */
.topbar-actions {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: 4px;
  flex-shrink: 0;
  margin-top: auto;
}

.topbar-actions > * {
  flex: 1;
  min-width: 0;
}

.theme-toggle {
  position: relative;
  display: inline-flex;
  width: 100%;
  min-height: 40px;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
  transition: var(--transition);
  cursor: pointer;
}

.topbar-header .theme-toggle {
  width: auto;
  min-height: 36px;
  flex-shrink: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

.topbar-header .theme-toggle:hover {
  background: transparent;
}

.topbar-header .theme-toggle-label {
  display: none;
}

.theme-toggle:hover {
  border-color: var(--orange);
  background: var(--orange-soft);
  color: var(--orange-dark);
}

.theme-toggle-track {
  position: relative;
  display: inline-flex;
  flex: 0 0 auto;
  width: 44px;
  height: 24px;
  align-items: center;
  border-radius: 999px;
  background: rgba(12, 35, 64, 0.14);
  transition: var(--transition);
}

.theme-toggle.is-dark .theme-toggle-track {
  background: var(--navy-gradient);
}

.theme-toggle-icon {
  position: relative;
  z-index: 1;
  display: inline-flex;
  width: 22px;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  line-height: 1;
  opacity: 0.55;
  transition: var(--transition);
}

.theme-toggle-icon-sun {
  color: var(--orange-dark);
}

.theme-toggle-icon-moon {
  color: var(--blue);
}

.theme-toggle.is-dark .theme-toggle-icon-sun {
  opacity: 0.35;
}

.theme-toggle.is-dark .theme-toggle-icon-moon {
  color: #ffd27a;
  opacity: 1;
}

.theme-toggle:not(.is-dark) .theme-toggle-icon-sun {
  opacity: 1;
}

.theme-toggle-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--white);
  box-shadow: 0 2px 6px rgba(12, 35, 64, 0.28);
  transition: transform 0.25s ease;
}

.theme-toggle.is-dark .theme-toggle-thumb {
  transform: translateX(20px);
}

.theme-toggle-label {
  white-space: nowrap;
}

.admin-header-link {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 5px;
  min-height: 40px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 11px;
  font-weight: 800;
  text-decoration: none;
  transition: var(--transition);
  white-space: nowrap;
  line-height: 1;
  touch-action: manipulation;
}

.admin-header-link:hover {
  border-color: var(--orange);
  background: var(--orange-soft);
  color: var(--orange-dark);
  transform: translateY(-1px);
}

.logout-button {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 5px;
  min-height: 40px;
  padding: 0 8px;
  border: 1px solid #fee2e2;
  border-radius: 10px;
  background: #fff5f5;
  color: var(--red-dark);
  font-size: 11px;
  font-weight: 800;
  transition: var(--transition);
  white-space: nowrap;
  cursor: pointer;
  line-height: 1;
  touch-action: manipulation;
}

.logout-button:hover:not(:disabled) {
  border-color: var(--red);
  background: #fee2e2;
  transform: translateY(-1px);
}

.logout-button:disabled {
  cursor: wait;
  opacity: 0.65;
}

@media (min-width: 769px) {
  .sidebar-collapsed .topbar,
  .sidebar-collapsed .app-shell > .topbar {
    width: 76px;
    min-width: 76px;
    max-width: 76px;
    padding-right: 8px;
    padding-left: 8px;
  }

  .sidebar-collapsed .sidebar-toggle {
    top: calc(50% + 5px);
    left: 75px;
  }

  .sidebar-collapsed .topbar-header {
    flex-direction: column;
    gap: 10px;
  }

  .sidebar-collapsed .theme-toggle {
    width: 36px;
    min-height: 36px;
    padding: 0;
    justify-content: center;
    align-self: center;
    margin: 0;
  }

  .sidebar-collapsed .theme-toggle-label,
  .sidebar-collapsed .theme-toggle-track {
    display: none;
  }

  .sidebar-collapsed .theme-toggle::before {
    content: "☾";
    font-size: 16px;
  }

  .sidebar-collapsed .theme-toggle.is-dark::before {
    content: "☀";
  }

  .sidebar-collapsed .app-shell > .alerts-ticker {
    margin-left: 76px;
    width: calc(100% - 76px);
  }

  .sidebar-collapsed .app-shell > .main-content,
  .sidebar-collapsed .app-shell > .footer,
  .sidebar-collapsed .main-content,
  .sidebar-collapsed .footer {
    margin-left: calc(76px + max(24px, (100% - 1444px) / 2));
  }

  .sidebar-collapsed .main-content,
  .sidebar-collapsed .footer {
    width: min(calc(100% - 124px), 1320px);
  }

  .sidebar-collapsed .brand {
    justify-content: center;
    margin: 0;
  }

  .sidebar-collapsed .brand-name {
    display: none;
  }

  .sidebar-collapsed .sidebar-toggle {
    margin: 0;
  }

  .sidebar-collapsed .nav-link {
    justify-content: center;
    min-height: 42px;
    padding: 0;
  }

  .sidebar-collapsed .main-nav {
    flex: 1;
    justify-content: space-evenly;
    gap: 4px;
    min-height: 0;
  }

  .sidebar-collapsed .nav-icon {
    font-size: 16px;
  }

  .sidebar-collapsed .nav-divider {
    margin: 4px 0;
  }

  .sidebar-collapsed .nav-text,
  .sidebar-collapsed .nav-external-arrow {
    display: none;
  }

  .sidebar-collapsed .nav-divider {
    width: 36px;
    align-self: center;
  }

  .sidebar-collapsed .topbar-actions > * {
    width: 40px;
    height: 40px;
    min-height: 40px;
    flex: 0 0 40px;
    justify-content: center;
    padding: 0;
    border-radius: 10px;
  }

  .sidebar-collapsed .topbar-actions {
    width: 100%;
    flex-direction: column;
    align-items: center;
    gap: 8px;
  }

  .sidebar-collapsed .topbar-actions > * > span:not(.admin-icon):not(.logout-icon) {
    display: none;
  }

  .sidebar-collapsed .admin-header-link,
  .sidebar-collapsed .logout-button {
    width: 36px;
    height: 36px;
    flex-basis: 36px;
    font-size: 16px;
  }
}

/* Hamburger mobile & Tablette */
.menu-toggle {
  display: none;
  width: 48px;
  height: 48px;
  padding: 9px;
  margin-left: auto;
  border: 2px solid var(--line);
  border-radius: 12px;
  background: var(--white);
  cursor: pointer;
  transition: var(--transition);
  touch-action: manipulation;
}

.menu-toggle span {
  display: block;
  width: 100%;
  height: 4px;
  margin: 6px 0;
  border-radius: 99px;
  background: var(--blue);
  transition: var(--transition);
}

@media (max-width: 768px) {
  .sidebar-toggle {
    display: none;
  }

  .theme-toggle {
    width: auto;
    min-height: 36px;
    padding: 0 4px;
    border: 0;
    background: transparent;
  }

  .theme-toggle:hover {
    background: transparent;
  }

  .theme-toggle-label {
    display: none;
  }

  .menu-toggle {
    display: block;
  }

  .main-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-height: calc(100vh - var(--header-height));
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding: 12px 16px 16px;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 20px 40px rgba(12, 35, 64, 0.12);
    overflow-y: auto;
  }

  .main-nav.open {
    display: flex;
  }

  .main-nav .nav-link {
    min-height: 40px;
    padding: 0 12px;
    font-size: 12.5px;
  }

  .main-nav .nav-icon {
    font-size: 15px;
  }

  .nav-divider {
    width: 100%;
    height: 1px;
    margin: 4px 0;
  }
}

@media (max-width: 768px) {
  .app-shell > .topbar,
  .app-shell > .alerts-ticker,
  .app-shell > .main-content {
    margin-left: 0;
  }

  .app-shell > .main-content,
  .app-shell > .footer {
    margin-left: auto;
    margin-right: auto;
  }

  .app-shell > .topbar {
    width: 100%;
  }

  .app-shell > .alerts-ticker {
    width: 100%;
  }

  .app-shell > .footer {
    width: calc(100% - 32px);
  }

  .topbar {
    position: sticky;
    inset: auto;
    width: 100%;
    height: auto;
    min-height: var(--header-height);
    align-items: center;
    border-right: 0;
    border-bottom: 1px solid rgba(219, 228, 238, 0.85);
    padding: 0 12px;
  }

  .topbar-inner {
    flex-direction: row;
    min-height: var(--header-height);
    align-items: center;
    gap: 10px;
    margin: 0 auto;
  }

  .brand {
    margin: 0;
  }

  .topbar-header {
    order: 1;
    width: auto;
    gap: 12px;
  }

  .menu-toggle {
    order: 2;
    margin-left: auto;
  }

  .topbar-actions {
    order: 3;
  }

  .main-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    display: none;
    max-height: calc(100vh - var(--header-height));
    align-items: stretch;
    gap: 4px;
    padding: 12px 16px 16px;
    background: rgba(255, 255, 255, 0.98);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 20px 40px rgba(12, 35, 64, 0.12);
    overflow-y: auto;
  }

  .main-nav.open {
    display: flex;
  }

  .main-nav .nav-link {
    min-height: 40px;
    padding: 0 12px;
    font-size: 12.5px;
  }

  .main-nav .nav-icon {
    font-size: 15px;
  }

  .nav-divider {
    width: 100%;
    height: 1px;
    margin: 4px 0;
  }

  .topbar-actions {
    flex-direction: row;
    align-items: center;
    gap: 8px;
    margin: 0 0 0 auto;
  }

  .admin-header-link,
  .logout-button {
    justify-content: center;
  }
}

@media (max-width: 600px) {
  .topbar {
    padding: 0 10px;
  }

  .topbar-actions .admin-header-link span:not(.admin-icon),
  .topbar-actions .logout-button span:not(.logout-icon) {
    display: none;
  }
  .topbar-actions .admin-header-link,
  .topbar-actions .logout-button {
    padding: 0 12px;
    min-height: 40px;
  }
}

/* ==========================================================================
   HERO BANNER & TITRES DE PAGE
   ========================================================================== */

.page-hero,
.welcome-section {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  margin-bottom: 32px;
}

.page-hero h1,
.welcome-section h1 {
  margin: 4px 0 8px;
  color: var(--blue);
  font-size: clamp(30px, 3.8vw, 44px);
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: -1.2px;
}

.page-hero p:not(.eyebrow),
.welcome-text {
  max-width: 760px;
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.6;
}

.bexpert-hero-button {
  margin-top: 20px;
  min-height: 48px;
  padding: 0 24px;
  background: linear-gradient(135deg, #df5d12 0%, #f37021 52%, #ff833e 100%);
  box-shadow: 0 8px 20px rgba(243, 112, 33, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.bexpert-hero-button:hover:not(:disabled) {
  background: linear-gradient(135deg, #f37021 0%, #ff833e 58%, #ff9b5d 100%);
  box-shadow: 0 10px 24px rgba(243, 112, 33, 0.36), inset 0 1px 0 rgba(255, 255, 255, 0.24);
}

.back-link {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
  color: var(--blue);
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
  transition: var(--transition);
}

.back-link:hover {
  color: var(--orange);
  transform: translateX(-3px);
}

.hero-icon {
  display: grid;
  width: 84px;
  height: 84px;
  flex-shrink: 0;
  place-items: center;
  border-radius: 22px;
  font-size: 40px;
  font-weight: 800;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.hero-icon:hover {
  transform: scale(1.05) rotate(2deg);
}

.hero-icon-orange {
  background: var(--orange-soft);
  color: var(--orange);
  border: 1px solid var(--orange-border);
}

.hero-icon-blue {
  background: var(--blue-soft);
  color: var(--blue);
  border: 1px solid rgba(12, 35, 64, 0.1);
}

@media (max-width: 768px) {
  .page-hero,
  .welcome-section {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }
  .hero-icon {
    display: none;
  }
}

/* ==========================================================================
   PAGE D'ACCUEIL (DASHBOARD)
   ========================================================================== */

.home-dashboard {
  padding-top: 28px;
}

.home-welcome {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 32px;
  padding: 32px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, #ffffff 0%, #fff7f2 100%);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}

.home-welcome::before,
.home-welcome::after {
  position: absolute;
  z-index: 0;
  inset: 0;
  content: "";
  pointer-events: none;
}

.home-welcome::before {
  opacity: 0.2;
  background-image: linear-gradient(126deg, transparent 0 42%, rgba(243, 112, 33, 0.08) 55%, transparent 72%);
}

.home-welcome::after {
  opacity: 0.5;
  background-image: linear-gradient(
    118deg,
    transparent 26%,
    rgba(255, 255, 255, 0.12) 42%,
    rgba(255, 255, 255, 0.34) 50%,
    rgba(243, 112, 33, 0.06) 58%,
    transparent 72%
  );
  background-size: 260% 160%;
  background-position: 115% 25%;
  animation: welcome-sheen 28s ease-in-out infinite;
}

@keyframes welcome-sheen {
  0%, 18% { background-position: 115% 25%; }
  43% { background-position: 45% 68%; }
  71% { background-position: -5% 18%; }
  100% { background-position: 115% 25%; }
}

.home-welcome > * {
  position: relative;
  z-index: 1;
}

@media (prefers-reduced-motion: reduce) {
  .home-welcome::after {
    animation: none;
    background-position: 0 0;
  }
}

.home-welcome h1 span#greeting {
  color: var(--orange);
}

.date-card {
  display: grid;
  min-width: 250px;
  gap: 4px;
  padding: 16px 20px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(8px);
  box-shadow: var(--shadow-xs);
  text-align: right;
}

.date-label {
  color: var(--orange);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.date-card strong {
  color: var(--blue);
  font-size: 15px;
  font-weight: 800;
}

.current-time {
  display: block;
  margin-top: 2px;
  color: var(--orange-dark);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
}

.home-sav-colors {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.home-sav-color {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--blue);
  text-align: left;
}

.home-sav-title {
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
}

.home-sav-dot {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
  border: 2px solid rgba(12, 35, 64, 0.12);
  border-radius: 50%;
}

.home-sav-color span:last-child {
  display: flex;
  align-items: baseline;
  gap: 5px;
}

.home-sav-color small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.25;
}

.home-sav-color strong {
  font-size: 13px;
  font-weight: 800;
}

/* Widget routine du jour (hero accueil) */
.home-daily-tasks {
  flex: 1 1 320px;
  max-width: 470px;
  min-width: 270px;
  max-height: 292px;
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr);
  gap: 8px;
  align-content: start;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(8px);
  box-shadow: var(--shadow-xs);
  overflow: hidden;
}

.home-daily-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.home-daily-head .eyebrow {
  margin: 0 0 2px;
}

.home-daily-head strong {
  color: var(--blue);
  font-size: 14px;
  font-weight: 800;
}

.home-daily-progress {
  height: 6px;
  border-radius: 6px;
  background: #e2e8f0;
  overflow: hidden;
}

.home-daily-fill {
  height: 100%;
  border-radius: 6px;
  background: linear-gradient(135deg, #f37021 0%, #ff833e 100%);
  transition: width 0.3s ease;
}

.home-daily-tasks .home-panel-status:empty {
  display: none;
}

.home-daily-tasks .home-panel-status:not(:empty) {
  padding: 8px;
}

.home-daily-list {
  display: grid;
  gap: 6px;
  align-content: start;
  min-height: 0;
  margin: 0;
  padding: 0 4px 2px 0;
  overflow-y: auto;
  list-style: none;
  scrollbar-width: thin;
  scrollbar-color: var(--orange) transparent;
}

.home-daily-list::-webkit-scrollbar {
  width: 6px;
}

.home-daily-list::-webkit-scrollbar-track {
  background: transparent;
}

.home-daily-list::-webkit-scrollbar-thumb {
  background: var(--orange-gradient);
  border-radius: 6px;
}

.home-daily-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: var(--transition);
}

.home-daily-item:hover {
  border-color: var(--orange);
  transform: translateY(-1px);
}

.home-daily-check {
  display: grid;
  flex-shrink: 0;
  place-items: center;
  width: 20px;
  height: 20px;
  border: 2px solid #cbd5e1;
  border-radius: 50%;
  background: #fff;
  color: transparent;
  font-size: 11px;
  font-weight: 900;
}

.home-daily-item.is-done {
  border-color: #86efac;
  background: #f0fdf4;
}

.home-daily-item.is-done .home-daily-check {
  border-color: #16a34a;
  background: #16a34a;
  color: #fff;
}

.home-daily-label {
  flex: 1;
  min-width: 0;
  color: var(--blue);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-daily-item.is-done .home-daily-label {
  color: #166534;
  text-decoration: line-through;
}

.home-daily-time {
  flex-shrink: 0;
  padding: 2px 6px;
  border-radius: 6px;
  background: #fff0e6;
  color: #c2410c;
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}

@media (max-width: 768px) {
  .home-welcome {
    flex-direction: column;
    align-items: stretch;
    padding: 24px;
  }
  .bexpert-hero-button {
    width: 100%;
    padding: 0 16px;
  }
  .home-daily-tasks {
    max-width: none;
  }
  .date-card {
    text-align: left;
  }
}

/* Section Accès Rapide */
.quick-access-section {
  margin-bottom: 24px;
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 12px;
}

.section-heading h2 {
  margin: 2px 0 0;
  color: var(--blue);
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.6px;
}

.compact-tool-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

@media (max-width: 960px) {
  .compact-tool-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 600px) {
  .compact-tool-grid {
    grid-template-columns: 1fr;
  }
}

.compact-tool-card {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 72px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--white);
  color: var(--text);
  box-shadow: var(--shadow-xs);
  text-decoration: none;
  transition: var(--transition);
  cursor: pointer;
}

.compact-tool-card:hover {
  border-color: #cbd5e1;
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
}

.compact-tool-card .tool-icon {
  display: grid;
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  place-items: center;
  border-radius: 11px;
  font-size: 20px;
  font-weight: 800;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.compact-tool-card:hover .tool-icon {
  transform: scale(1.1) rotate(3deg);
}

.tool-card-orange .tool-icon {
  background: var(--orange-soft);
  color: var(--orange);
  border: 1px solid var(--orange-border);
}

.tool-card-blue .tool-icon {
  background: var(--blue-soft);
  color: var(--blue);
  border: 1px solid rgba(12, 35, 64, 0.1);
}

.compact-tool-content {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.compact-tool-content strong {
  overflow: hidden;
  color: var(--blue);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: -0.3px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.compact-tool-content small {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.compact-tool-card .tool-arrow {
  display: grid;
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  margin-left: auto;
  place-items: center;
  border-radius: 8px;
  background: var(--background);
  color: var(--muted);
  font-size: 16px;
  font-weight: 800;
  transition: var(--transition);
}

.compact-tool-card:hover .tool-arrow {
  background: var(--orange);
  color: var(--white);
  transform: translateX(4px);
}

/* Grille des Priorités & Notes d'accueil */
.home-focus-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: 20px;
  margin-bottom: 32px;
}

@media (max-width: 880px) {
  .home-focus-grid {
    grid-template-columns: 1fr;
  }
}

.home-focus-panel {
  display: flex;
  min-height: 320px;
  flex-direction: column;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.home-focus-panel::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--navy);
}

.home-reminders-panel::before {
  background: var(--orange-gradient);
}

.home-panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 15px;
  margin-bottom: 16px;
}

.home-panel-heading h2 {
  margin: 3px 0 0;
  color: var(--blue);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.home-priority-count {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--red-soft);
  color: var(--red);
  font-size: 11px;
  font-weight: 800;
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.home-panel-status {
  padding: 24px 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  text-align: center;
}

.home-panel-error {
  color: var(--red);
}

.home-reminders-list,
.home-notes-list {
  display: grid;
  gap: 10px;
}

.home-reminder-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfcfd;
  color: var(--text);
  text-decoration: none;
  transition: var(--transition);
}

.home-reminder-item:hover {
  border-color: #cbd5e1;
  background: var(--white);
  box-shadow: var(--shadow-xs);
  transform: translateY(-1px);
}

.home-reminder-item.is-overdue {
  border-color: #fecaca;
  background: #fef2f2;
}

.home-reminder-item.is-today {
  border-color: #fed7aa;
  background: #fff7ed;
}

.home-reminder-icon {
  display: grid;
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  place-items: center;
  border-radius: 50%;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 14px;
  font-weight: 800;
}

.home-reminder-content {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.home-reminder-content strong {
  overflow: hidden;
  color: var(--blue);
  font-size: 13px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-reminder-content small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

.home-reminder-state {
  margin-left: auto;
  color: var(--orange-dark);
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.home-reminder-item.is-overdue .home-reminder-state {
  color: var(--red);
}

.home-note-row {
  padding: 12px 0;
  border-bottom: 1px solid var(--line-light);
}

.home-note-row:first-child {
  padding-top: 0;
}

.home-note-row:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.home-note-row-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 4px;
}

.home-note-date {
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.home-note-row h3 {
  margin: 0 0 4px;
  color: var(--blue);
  font-size: 14px;
  font-weight: 800;
}

.home-note-row p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.home-panel-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding-top: 14px;
  margin-top: auto;
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
  transition: var(--transition);
}

.home-panel-link:hover {
  color: var(--orange);
  transform: translateX(3px);
}

.home-panel-link-top {
  padding: 0;
  margin: 0;
}

/* Actualités Magasin */
.home-news-panel {
  padding: 20px 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: var(--shadow-sm);
  margin-bottom: 20px;
}

.home-news-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

@media (max-width: 880px) {
  .home-news-list {
    grid-template-columns: 1fr;
  }
}

.home-news-item {
  display: flex;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfcfd;
  transition: var(--transition);
}

.home-news-item:hover {
  border-color: #cbd5e1;
  background: var(--white);
  box-shadow: var(--shadow-xs);
  transform: translateY(-1px);
}

.news-date {
  display: grid;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  place-items: center;
  align-content: center;
  border-radius: 10px;
  background: var(--orange-soft);
  color: var(--orange-dark);
  text-align: center;
  border: 1px solid var(--orange-border);
}

.news-date span {
  font-size: 15px;
  font-weight: 800;
  line-height: 1;
}

.news-date small {
  margin-top: 2px;
  font-size: 8px;
  font-weight: 800;
  text-transform: uppercase;
}

.news-content {
  min-width: 0;
  flex: 1;
}

.news-category,
.service-category {
  display: inline-block;
  margin-bottom: 4px;
  color: var(--orange);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.news-content h3 {
  margin: 0 0 4px;
  color: var(--blue);
  font-size: 15px;
  font-weight: 800;
  line-height: 1.3;
}

.news-content p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

/* ==========================================================================
   MODULE : SERVICES & CODES CAISSE (services.html)
   ========================================================================== */

.service-search-panel {
  display: flex;
  align-items: flex-end;
  gap: 16px;
  padding: 20px 24px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.search-area {
  flex: 1;
  min-width: min(100%, 360px);
}

.search-label {
  display: block;
  margin-bottom: 8px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.search-field {
  display: flex;
  min-height: 48px;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfcfd;
  transition: var(--transition);
}

.search-field:focus-within {
  border-color: var(--orange);
  background: var(--white);
  box-shadow: 0 0 0 3px rgba(243, 112, 33, 0.15);
}

.search-field span {
  color: var(--text-muted);
  font-size: 18px;
  line-height: 1;
}

.search-field input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
}

.search-field input::placeholder {
  color: #94a3b8;
}

/* Filtres Catégories */
.categories-filter {
  display: flex;
  gap: 8px;
  margin-bottom: 22px;
  flex-wrap: wrap;
  overflow-x: auto;
  padding-bottom: 4px;
}

.category-button {
  min-height: 38px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--white);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.category-button:hover {
  border-color: var(--orange);
  color: var(--orange);
  background: var(--orange-soft);
}

.category-button.active {
  background: var(--orange-gradient);
  border-color: transparent;
  color: var(--white);
  box-shadow: 0 4px 12px rgba(243, 112, 33, 0.28);
}

.services-layout {
  display: grid;
  gap: 20px;
}

.result-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.result-header p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.data-status {
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green-dark);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.data-status-error {
  background: var(--red-soft);
  color: var(--red-dark);
  border-color: rgba(239, 68, 68, 0.2);
}

.services-grid-qr {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

.service-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: var(--shadow-xs);
  transition: var(--transition);
  overflow: hidden;
}

.service-card:hover {
  border-color: #cbd5e1;
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
}

.service-card-qr {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.service-card-details h2 {
  margin: 0 0 6px;
  color: var(--blue);
  font-size: 15px;
  font-weight: 800;
  line-height: 1.35;
  letter-spacing: -0.3px;
}

.service-code-display {
  display: grid;
  gap: 2px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--blue-soft);
  border: 1px solid rgba(12, 35, 64, 0.08);
}

.service-code-display span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.service-code-display strong {
  color: var(--blue);
  font-size: 20px;
  font-weight: 900;
  letter-spacing: 1px;
}

.service-qr-code {
  display: grid;
  place-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--white);
  position: relative;
  cursor: pointer;
  transition: var(--transition);
}

.service-qr-code:hover {
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(243, 112, 33, 0.15);
}

.service-qr-code img,
.service-qr-code canvas {
  display: block;
  width: 140px !important;
  height: 140px !important;
  max-width: 100%;
}

.service-qr-code::after {
  content: "📋 Copier";
  position: absolute;
  bottom: 8px;
  right: 8px;
  padding: 4px 8px;
  border-radius: 6px;
  background: rgba(12, 35, 64, 0.88);
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}

.service-qr-code:hover::after {
  opacity: 1;
}

.service-qr-code.clicked {
  animation: pulse-ring 0.4s ease;
}

@keyframes pulse-ring {
  0% { transform: scale(1); }
  50% { transform: scale(0.96); box-shadow: 0 0 0 4px var(--orange); }
  100% { transform: scale(1); }
}

/* ==========================================================================
   MODULE : GESTION SAV (FIFO) (gestion-sav.html)
   ========================================================================== */

.gestion-sav-page {
  max-width: 1180px;
}

.fifo-dashboard {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 24px;
}

@media (max-width: 768px) {
  .fifo-dashboard {
    grid-template-columns: 1fr;
  }
}

.fifo-card {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: var(--shadow-sm);
}

.fifo-card--priority {
  border: 2px solid var(--orange);
  background: linear-gradient(135deg, #ffffff 0%, #fff7f2 100%);
  box-shadow: 0 8px 24px -4px rgba(243, 112, 33, 0.18);
}

.fifo-card-label {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.fifo-card--priority .fifo-card-label {
  color: var(--orange-dark);
}

.fifo-color-info {
  display: flex;
  align-items: center;
  gap: 18px;
}

.fifo-dot {
  display: block;
  width: 64px;
  height: 64px;
  flex: 0 0 64px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.8);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
}

.fifo-color-day {
  display: block;
  color: var(--blue);
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.fifo-color-name {
  display: block;
  margin-top: 2px;
  color: var(--text-secondary);
  font-size: 15px;
  font-weight: 700;
}

.fifo-priority-copy {
  margin: 14px 0 0;
  color: var(--blue);
  font-size: 13px;
  font-weight: 700;
}

/* Légende jours FIFO */
.fifo-days-legend {
  margin-top: 24px;
}

.fifo-days-heading {
  margin-bottom: 12px;
}

.fifo-days-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}

@media (max-width: 900px) {
  .fifo-days-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 500px) {
  .fifo-days-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.fifo-day-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--white);
  box-shadow: var(--shadow-xs);
}

.fifo-day-dot {
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  border-radius: 50%;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.fifo-day-card strong {
  display: block;
  color: var(--blue);
  font-size: 13px;
  font-weight: 800;
}

.fifo-day-card span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
}

/* Scan SAV & File d'attente */
.sav-scan-panel {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 22px;
  align-items: end;
  margin-top: 24px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: var(--shadow-sm);
}

@media (max-width: 768px) {
  .sav-scan-panel {
    grid-template-columns: 1fr;
  }
}

.sav-scan-panel h2,
.sav-list-panel h2 {
  margin: 0;
  color: var(--blue);
  font-size: 20px;
  font-weight: 800;
}

.sav-scan-panel p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.sav-scan-form {
  min-width: min(100%, 460px);
}

.sav-scan-row {
  display: flex;
  gap: 8px;
  margin-top: 6px;
}

.sav-scan-row input {
  flex: 1;
  min-height: 48px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfcfd;
  font-size: 14px;
  font-weight: 700;
}

.sav-scan-row input:focus {
  border-color: var(--orange);
  background: var(--white);
  box-shadow: 0 0 0 3px rgba(243, 112, 33, 0.15);
  outline: none;
}

.sav-list-panel {
  margin-top: 20px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: var(--shadow-sm);
}

.sav-list-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.sav-count {
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 11px;
  font-weight: 800;
}

.sav-list {
  display: grid;
  gap: 10px;
}

.sav-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--white);
  transition: var(--transition);
}

.sav-item:hover {
  border-color: #cbd5e1;
  box-shadow: var(--shadow-xs);
}

.sav-item--priority {
  border-left: 5px solid var(--orange);
  background: #fffcf9;
}

.sav-item--done {
  opacity: 0.65;
  background: #f8fafc;
}

.sav-item-dot {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.sav-item strong {
  color: var(--blue);
  font-size: 14px;
  font-weight: 800;
}

.sav-item small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.sav-history-toggle {
  margin-top: 16px;
}

/* ==========================================================================
   MODULE : ÉTIQUETTE SAV (etiquette-sav.html)
   ========================================================================== */

.sav-page {
  max-width: 1080px;
}

.sav-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
  gap: 24px;
  align-items: start;
}

@media (max-width: 880px) {
  .sav-layout {
    grid-template-columns: 1fr;
  }
}

.sav-card {
  padding: 28px;
}

.sav-heading {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line-light);
}

.sav-icon {
  display: grid;
  width: 52px;
  height: 52px;
  flex: 0 0 52px;
  place-items: center;
  border-radius: 14px;
  background: var(--orange-soft);
  color: var(--orange);
  font-size: 24px;
  font-weight: 800;
  border: 1px solid var(--orange-border);
}

.sav-heading h2 {
  margin: 0 0 4px;
  color: var(--blue);
  font-size: 20px;
  font-weight: 800;
}

.sav-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.form-group {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
}

.form-group label {
  color: var(--blue);
  font-size: 13px;
  font-weight: 800;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  min-height: 48px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfcfd;
  font-size: 14px;
  font-weight: 600;
  transition: var(--transition);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--orange);
  background: var(--white);
  box-shadow: 0 0 0 3px rgba(243, 112, 33, 0.15);
  outline: none;
}

.quick-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.quick-buttons button {
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  color: var(--blue);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
}

.quick-buttons button:hover {
  border-color: var(--orange);
  background: var(--orange-soft);
  color: var(--orange-dark);
}

.printer-settings {
  margin: 20px 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fbfcfd;
}

.printer-settings legend {
  padding: 0 8px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.form-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 12px;
}

@media (max-width: 600px) {
  .form-grid {
    grid-template-columns: 1fr;
  }
}

.sav-status {
  padding: 12px 16px;
  border-radius: 10px;
  margin-bottom: 18px;
  font-size: 13px;
  font-weight: 700;
}

.sav-status.error {
  background: var(--red-soft);
  color: var(--red-dark);
  border: 1px solid #fecaca;
}

.sav-status.info {
  background: var(--green-soft);
  color: var(--green-dark);
  border: 1px solid #a7f3d0;
}

.sav-history {
  padding: 24px;
}

.sav-history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.sav-history-header h2 {
  margin: 3px 0 0;
  color: var(--blue);
  font-size: 18px;
  font-weight: 800;
}

.sav-history-list {
  display: grid;
  gap: 10px;
}

.sav-history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfcfd;
}

.sav-history-item-main strong {
  display: block;
  color: var(--blue);
  font-size: 13px;
  font-weight: 800;
}

.sav-history-item-main span {
  display: block;
  color: var(--muted);
  font-size: 11px;
}

.sav-history-item-meta {
  text-align: right;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 600;
}

/* ==========================================================================
   MODULE : NFF (SUIVI QUALITÉ SAV) (nff.html)
   ========================================================================== */

.nff-dashboard {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr)) minmax(260px, 1.4fr);
  gap: 16px;
  margin-bottom: 24px;
}

@media (max-width: 880px) {
  .nff-dashboard {
    grid-template-columns: 1fr;
  }
}

.nff-stat-card {
  display: grid;
  min-height: 120px;
  align-content: start;
  gap: 6px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.nff-stat-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--blue);
}

.nff-stat-card:nth-child(2)::before {
  background: var(--orange-gradient);
}

.nff-stat-card-wide::before {
  background: var(--green);
}

.nff-stat-label {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.nff-stat-card strong {
  color: var(--blue);
  font-size: 32px;
  font-weight: 900;
  letter-spacing: -1px;
}

.nff-stat-card-wide strong {
  font-size: 20px;
}

.nff-stat-card small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

.nff-toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 24px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.nff-toolbar-actions {
  display: flex;
  gap: 8px;
}

.nff-filters {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding: 16px 20px;
  margin-bottom: 24px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--white);
  box-shadow: var(--shadow-xs);
}

.nff-filter-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.nff-filter-label {
  color: var(--blue);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.nff-period-buttons {
  display: flex;
  gap: 6px;
}

.nff-period-button {
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  transition: var(--transition);
}

.nff-period-button:hover {
  background: var(--blue-soft);
}

.nff-period-button.active {
  background: var(--orange-gradient);
  border-color: transparent;
  color: var(--white);
  box-shadow: 0 4px 10px rgba(243, 112, 33, 0.28);
}

.nff-collaborator-filter select {
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  font-size: 12px;
  font-weight: 700;
}

.nff-reset-button {
  min-height: 36px;
  padding: 0 14px;
  margin-left: auto;
}

.nff-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 24px;
  align-items: start;
}

@media (max-width: 960px) {
  .nff-layout {
    grid-template-columns: 1fr;
  }
}

.nff-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

@media (max-width: 680px) {
  .nff-grid {
    grid-template-columns: 1fr;
  }
}

.nff-card {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--white);
  box-shadow: var(--shadow-xs);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
}

.nff-card:hover {
  border-color: #cbd5e1;
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.nff-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line-light);
}

.nff-card-header strong {
  color: var(--blue);
  font-size: 18px;
  font-weight: 800;
}

.nff-created-date {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
}

.nff-card-section {
  margin-top: 12px;
}

.nff-card-section span {
  display: block;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.nff-card-section p {
  margin: 4px 0 0;
  color: var(--blue);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.45;
}

.nff-resolution {
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--green-soft);
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.nff-resolution span {
  color: var(--green-dark);
}

.nff-resolution p {
  color: #065f46;
}

.nff-side-panel {
  padding: 24px;
}

.nff-side-panel h2 {
  margin: 4px 0 10px;
  color: var(--blue);
  font-size: 18px;
  font-weight: 800;
}

.nff-side-panel p {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.feature-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 10px;
}

.feature-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 700;
}

.feature-list li span {
  color: var(--orange);
  font-weight: 900;
}

/* ==========================================================================
   MODULE : NOTES & RAPPELS (notes.html)
   ========================================================================== */

.notes-body {
  background-color: var(--background);
}

.notes-dashboard {
  width: min(calc(100% - 308px), 1320px);
  flex: 1;
  margin-top: 0;
  margin-right: auto;
  margin-bottom: 0;
  margin-left: calc(260px + max(24px, (100% - 1580px) / 2));
  padding: 36px 0 60px;
}

@media (max-width: 768px) {
  .notes-dashboard {
    width: min(calc(100% - 32px), 1320px);
    margin-left: auto;
    margin-right: auto;
    padding: 24px 0 48px;
  }

  .footer {
    width: calc(100% - 32px);
    margin-left: 0;
    margin-right: 0;
  }
}

.notes-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}

.notes-hero-copy h1 {
  margin: 4px 0 6px;
  color: var(--blue);
  font-size: clamp(28px, 3.5vw, 40px);
  font-weight: 800;
  letter-spacing: -1px;
}

.notes-hero-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.notes-control-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 20px 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: var(--shadow-sm);
  margin-bottom: 28px;
  flex-wrap: wrap;
}

.notes-control-main {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1;
  min-width: 0;
}

.notes-select-icon {
  display: grid;
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  place-items: center;
  border-radius: 14px;
  background: var(--orange-soft);
  color: var(--orange);
  font-size: 22px;
  border: 1px solid var(--orange-border);
}

.notes-collab-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.notes-collab-label {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.notes-collaborateurs-list {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.notes-collab-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 38px;
  padding: 0 14px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  background: #fbfcfd;
  color: var(--blue);
  font-size: 13px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
  user-select: none;
}

.notes-collab-btn:hover {
  border-color: var(--orange);
  background: var(--orange-soft);
  color: var(--orange-dark);
  transform: translateY(-1px);
}

.notes-collab-btn.is-active {
  background: var(--orange-gradient);
  border-color: var(--orange);
  color: var(--white);
  font-weight: 800;
  box-shadow: 0 4px 12px rgba(243, 112, 33, 0.28);
  transform: translateY(-1px);
}

.notes-collab-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(243, 112, 33, 0.25);
}

.notes-collab-btn-icon {
  font-size: 14px;
  opacity: 0.85;
}

.notes-collab-btn.is-active .notes-collab-btn-icon {
  opacity: 1;
}

.notes-loading-pill {
  color: var(--muted);
  font-size: 13px;
  font-style: italic;
}

body.dark-mode .notes-collab-btn {
  background: var(--surface-alt);
  border-color: var(--line);
  color: var(--text);
}

body.dark-mode .notes-collab-btn:hover {
  background: var(--surface-hover);
  border-color: var(--orange);
  color: var(--orange);
}

body.dark-mode .notes-collab-btn.is-active {
  background: var(--orange-gradient);
  border-color: var(--orange);
  color: #ffffff;
}

.notes-control-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.notes-status {
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green-dark);
  font-size: 11px;
  font-weight: 800;
  border: 1px solid rgba(16, 185, 129, 0.2);
}

#all-notes-button.is-active {
  background: var(--orange-gradient);
  border-color: transparent;
  color: var(--white);
  box-shadow: 0 4px 12px rgba(243, 112, 33, 0.28);
}

.notes-error {
  padding: 14px 18px;
  border-radius: 12px;
  background: var(--red-soft);
  color: var(--red-dark);
  border: 1px solid rgba(239, 68, 68, 0.25);
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 20px;
}

.notes-list-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.notes-section-kicker {
  display: block;
  color: var(--orange);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.notes-list-header h2 {
  margin: 0;
  color: var(--blue);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.notes-alert-count {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--red-soft);
  color: var(--red-dark);
  font-size: 12px;
  font-weight: 800;
  border: 1px solid rgba(239, 68, 68, 0.25);
}

.notes-alert-count::before {
  content: "⚠";
  font-size: 13px;
  color: var(--red);
}

.notes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}

.note-card {
  display: flex;
  flex-direction: column;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--white);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  position: relative;
  min-height: 220px;
  overflow: hidden;
}

.note-card:hover {
  border-color: #cbd5e1;
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.note-card.note-overdue {
  border-left: 5px solid var(--red);
  background: linear-gradient(135deg, #ffffff 0%, #fffcfc 100%);
}

.note-card.note-today {
  border-left: 5px solid var(--orange);
  background: linear-gradient(135deg, #ffffff 0%, #fffdfa 100%);
}

.note-card.note-treated {
  border-left: 5px solid var(--green);
  background: #fbfefc;
  opacity: 0.72;
}

.note-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.note-card-header .service-category {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--orange-soft);
  color: var(--orange-dark);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border: 1px solid var(--orange-border);
}

.note-card-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.note-status-button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  transition: var(--transition);
}

.note-status-button:hover {
  border-color: var(--green);
  color: var(--green-dark);
  background: var(--green-soft);
}

.note-status-button.is-treated {
  border-color: rgba(16, 185, 129, 0.3);
  background: var(--green-soft);
  color: var(--green-dark);
}

.note-icon-button {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
  transition: var(--transition);
}

.note-icon-button:hover {
  border-color: #cbd5e1;
  background: var(--blue-soft);
  color: var(--blue);
}

.note-delete-button:hover {
  border-color: #fecaca;
  background: var(--red-soft);
  color: var(--red);
}

.note-card h2 {
  margin: 6px 0 8px;
  color: var(--blue);
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.4px;
  line-height: 1.35;
}

.note-treated h2 {
  text-decoration: line-through;
  opacity: 0.65;
}

.note-content {
  margin: 0 0 16px;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.6;
  word-break: break-word;
  white-space: pre-wrap;
  flex: 1;
}

.note-content-empty {
  color: var(--text-muted);
  font-style: italic;
}

.note-reminder {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 10px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 11px;
  font-weight: 800;
  margin-bottom: 14px;
  border: 1px solid rgba(12, 35, 64, 0.08);
  align-self: flex-start;
}

.note-reminder.reminder-overdue {
  background: var(--red-soft);
  color: var(--red-dark);
  border-color: rgba(239, 68, 68, 0.25);
}

.note-reminder.reminder-overdue::before {
  content: "⏰";
  font-size: 12px;
}

.note-reminder.reminder-today {
  background: var(--orange-soft);
  color: var(--orange-dark);
  border-color: var(--orange-border);
}

.note-reminder.reminder-today::before {
  content: "🔔";
  font-size: 12px;
}

.note-reminder.reminder-future::before {
  content: "📅";
  font-size: 12px;
}

.note-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 12px;
  border-top: 1px solid var(--line-light);
  margin-top: auto;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
}

.notes-empty-state {
  padding: 60px 24px;
  border: 2px dashed #cbd5e1;
  border-radius: var(--radius);
  background: var(--white);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.notes-empty-icon {
  display: grid;
  width: 64px;
  height: 64px;
  place-items: center;
  border-radius: 18px;
  background: var(--orange-soft);
  color: var(--orange);
  font-size: 28px;
  margin-bottom: 4px;
  border: 1px solid var(--orange-border);
}

.notes-empty-state h2 {
  margin: 0;
  color: var(--blue);
  font-size: 20px;
  font-weight: 800;
}

.notes-empty-state p {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 14px;
  max-width: 480px;
}

/* ==========================================================================
   MODULE : MOTS DE PASSE (mot-de-passe.html)
   ========================================================================== */

.passwords-page {
  max-width: 1280px;
}

.password-login-panel {
  max-width: 500px;
  margin: 40px auto;
  padding: 36px;
  text-align: center;
}

.password-login-icon {
  display: grid;
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  place-items: center;
  border-radius: 18px;
  background: var(--orange-soft);
  color: var(--orange);
  font-size: 28px;
}

.password-login-panel h2 {
  margin: 4px 0 8px;
  color: var(--blue);
  font-size: 22px;
  font-weight: 800;
}

.password-login-panel p {
  color: var(--muted);
  font-size: 13px;
}

.password-login-row {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.password-login-row input {
  flex: 1;
  min-height: 48px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfcfd;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 6px;
  text-align: center;
}

.password-login-row input:focus {
  border-color: var(--orange);
  background: var(--white);
  box-shadow: 0 0 0 3px rgba(243, 112, 33, 0.15);
  outline: none;
}

.password-toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.password-toolbar .search-area {
  flex: 1 1 320px;
  min-width: min(100%, 320px);
}

.password-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.password-results-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin: 0 2px 10px;
}

.password-results-header h2 {
  margin: 2px 0 0;
  color: var(--blue);
  font-size: 20px;
}

.password-results-header > p {
  margin: 0 0 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.password-list {
  display: grid;
  gap: 8px;
}

.password-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 22px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--white);
  box-shadow: var(--shadow-xs);
  transition: var(--transition);
}

.password-card:hover {
  border-color: #cbd5e1;
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.password-card-main strong {
  display: block;
  color: var(--blue);
  font-size: 16px;
  font-weight: 800;
}

.password-card-main a {
  color: var(--orange);
  font-size: 12px;
  font-weight: 700;
  text-decoration: underline;
}

.password-card-main p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.password-card-credentials {
  display: flex;
  align-items: center;
  gap: 10px;
}

.password-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 8px;
  background: #f8fafc;
  border: 1px solid var(--line);
  color: var(--blue);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
}

.password-pill:hover {
  border-color: var(--orange);
  background: var(--orange-soft);
  color: var(--orange-dark);
}

/* ==========================================================================
   MODULE : TRANSFERT DE FICHIERS (transfert-fichiers.html)
   ========================================================================== */

/* Sélecteur de mode de transfert (2 Onglets / Slides - Pleine largeur et agrandis) */
.transfer-mode-section {
  margin-bottom: 24px;
  width: 100%;
}

.transfer-mode-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 8px;
  background: #edf2f7;
  border-radius: 18px;
  margin-bottom: 20px;
  width: 100%;
  max-width: 100%;
}

.transfer-mode-tab-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 18px 24px;
  border-radius: 14px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  cursor: pointer;
  transition: all 0.25s ease;
  text-align: left;
}

.transfer-mode-tab-btn:hover {
  color: var(--blue);
  background: rgba(255, 255, 255, 0.6);
}

.transfer-mode-tab-btn.active {
  background: var(--white);
  color: var(--blue);
  box-shadow: 0 6px 20px rgba(12, 35, 64, 0.1);
}

.transfer-mode-tab-btn.active .tab-btn-icon {
  transform: scale(1.15);
}

.tab-btn-icon {
  font-size: 32px;
  transition: transform 0.2s ease;
  display: grid;
  place-items: center;
}

.tab-btn-text {
  display: flex;
  flex-direction: column;
}

.tab-btn-text strong {
  font-size: 15px;
  font-weight: 800;
  line-height: 1.3;
}

.tab-btn-text small {
  font-size: 12px;
  opacity: 0.85;
  font-weight: 600;
}

/* Slides de méthodes - Interface centrée et aérée */
.transfer-slides-wrapper {
  position: relative;
  width: 100%;
}

.transfer-slide-pane {
  padding: 36px 30px;
  border-radius: 20px;
  background: var(--white);
  border: 1.5px solid var(--line);
  box-shadow: var(--shadow-sm);
  animation: slidePaneFade 0.3s ease forwards;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.transfer-slide-pane.hidden {
  display: none !important;
}

@keyframes slidePaneFade {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

#slide-mode-mobile {
  background: linear-gradient(145deg, #ffffff 0%, #fffaf5 100%);
  border-color: rgba(243, 112, 33, 0.25);
}

#slide-mode-qr {
  background: linear-gradient(145deg, #ffffff 0%, #f7faff 100%);
  border-color: rgba(12, 35, 64, 0.15);
}

/* Desktop : QR Code via onglet dépliable (fermé au lancement), sans onglets ni panneau photo */
.transfer-mode-tabs,
#slide-mode-mobile {
  display: none !important;
}

#slide-mode-qr {
  display: flex !important;
}

#slide-mode-qr.qr-collapsed {
  display: none !important;
}

.qr-accordion-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 16px 20px;
  border: 1.5px solid var(--line);
  border-radius: 16px;
  background: var(--white);
  color: var(--blue);
  font: inherit;
  font-size: 15px;
  font-weight: 800;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: var(--transition);
}

.qr-accordion-toggle:hover {
  border-color: var(--orange);
  transform: translateY(-1px);
}

.qr-accordion-toggle[aria-expanded="true"] {
  border-color: var(--orange);
}

.qr-accordion-chevron {
  margin-left: auto;
  color: var(--orange);
  font-size: 16px;
  line-height: 1;
}

body.dark-mode .qr-accordion-toggle {
  background: var(--surface);
  border-color: var(--line);
  color: var(--text);
}

/* QR d'accès direct à l'outil (section installation smartphone) */
.download-app-qr-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--line-light);
}

.download-app-qr {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: var(--shadow-xs);
  line-height: 0;
}

.download-app-qr img,
.download-app-qr canvas,
.download-app-qr table {
  display: block;
}

.download-app-qr-caption {
  margin: 0;
  max-width: 340px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  line-height: 1.5;
}

/* Variante dans la modale du guide : sans séparateur, en tête de contenu */
.install-guide-qr-wrap {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
  margin-bottom: 8px;
}

/* Barre retour B'Desk : visible uniquement en mode smartphone */
.smartphone-topbar {
  display: none;
}

body.transfer-smartphone .smartphone-topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
}

.smartphone-back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--orange);
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
}

.smartphone-back-link:hover {
  text-decoration: underline;
}

body.dark-mode .smartphone-topbar {
  background: rgba(23, 35, 46, 0.95);
}

/* Écran de rappel (mode smartphone uniquement, géré en JS) */
.smartphone-photo-only {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 48px 24px;
  text-align: center;
}

.smartphone-photo-only-icon {
  font-size: 48px;
}

.smartphone-photo-only h1 {
  margin: 0;
  color: var(--blue);
  font-size: 22px;
  font-weight: 800;
}

.smartphone-photo-only p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

/* ==========================================================================
   MODE SMARTPHONE — outil photo seul, sans header, menu ni autres panneaux
   ========================================================================== */
/* Le footer de cette page est hors .app-shell (imbrication legacy) : le masquer aussi */
body.transfer-smartphone .app-shell,
body.transfer-smartphone .footer {
  display: none !important;
}

body.transfer-smartphone .ai-assistant {
  display: none !important;
}

body.transfer-smartphone .photo-transfer-modal {
  position: static;
  display: block;
  padding: 0;
  z-index: auto;
}

body.transfer-smartphone .photo-modal-backdrop,
body.transfer-smartphone .photo-modal-close-btn,
body.transfer-smartphone .photo-modal-footer .secondary-button {
  display: none !important;
}

body.transfer-smartphone .photo-modal-panel {
  width: 100%;
  max-width: none;
  max-height: none;
  min-height: 100dvh;
  border-radius: 0;
  box-shadow: none;
}

.transfer-method-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 16px;
  max-width: 680px;
  width: 100%;
  margin: 0 auto;
}

.transfer-method-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.transfer-method-badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.badge-mobile {
  background: var(--orange-soft);
  color: var(--orange-dark);
}

.badge-all {
  background: var(--blue-soft);
  color: var(--blue);
}

.transfer-method-content h2 {
  margin: 0;
  color: var(--blue);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.4px;
}

.transfer-method-content p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
  max-width: 580px;
}

.mobile-only-notice {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 10px;
  background: #fff3e8;
  color: #c25e10;
  font-size: 12px;
  font-weight: 700;
  width: fit-content;
}

.transfer-method-actions {
  display: flex;
  justify-content: center;
  width: 100%;
  margin-top: 6px;
}

.transfer-method-actions .primary-button {
  min-height: 50px;
  padding: 0 32px;
  font-size: 14px;
  font-weight: 800;
}

/* Zone QR Code centrée */
.transfer-qr-center-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px;
  border-radius: 16px;
  background: #f8fafc;
  border: 1px solid var(--line);
  margin: 0 auto;
}

.transfer-simple-qr {
  display: grid;
  place-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--white);
  box-shadow: var(--shadow-sm);
}

.transfer-simple-qr img,
.transfer-simple-qr canvas {
  width: 200px !important;
  height: 200px !important;
}

.transfer-qr-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  width: 100%;
}

.transfer-status {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--green-dark);
  font-size: 12px;
  font-weight: 800;
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 3px var(--green-soft);
  animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4); }
  70% { box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.transfer-expiration {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-align: center;
}

/* ==========================================================================
   TÉLÉCHARGEMENT APP MOBILE (Boutons adaptatifs iOS / Android + QR Code)
   ========================================================================== */

.download-app-section {
  padding: 24px;
}

.download-app-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.download-app-header h2 {
  margin: 4px 0 8px;
  color: var(--navy);
}

.download-app-header p:not(.eyebrow) {
  margin: 0;
  max-width: 720px;
  color: var(--text);
  opacity: 0.85;
}

.download-app-header-icon {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  font-size: 30px;
  background: var(--orange-soft, #fff5ee);
  border: 1px solid var(--line, #dce4eb);
  border-radius: 16px;
  flex-shrink: 0;
}

.download-app-qr-wrapper {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 18px;
  align-items: center;
  padding: 18px;
  background: var(--surface-alt, #f8fafc);
  border: 1px solid var(--line, #dce4eb);
  border-radius: 14px;
  margin-bottom: 18px;
}

.download-app-qr {
  width: 160px;
  height: 160px;
  display: grid;
  place-items: center;
  padding: 10px;
  background: #fff;
  border-radius: 12px;
  border: 1px solid var(--line, #dce4eb);
}

.download-app-qr img,
.download-app-qr canvas {
  width: 140px !important;
  height: 140px !important;
}

.download-app-qr-hint {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.download-app-qr-hint strong {
  color: var(--navy);
  font-size: 15px;
}

.download-app-qr-hint small {
  color: var(--text);
  opacity: 0.75;
  line-height: 1.45;
}

.download-app-buttons {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}

/* Boutons style "App Store / Google Play" */
.store-button {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 220px;
  padding: 12px 18px;
  border-radius: 12px;
  border: 1px solid transparent;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  text-align: left;
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.store-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(11, 37, 69, 0.18);
  filter: brightness(1.05);
}

.store-button:active {
  transform: translateY(0);
}

.store-button-icon {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  flex-shrink: 0;
}

.store-button-icon svg {
  width: 28px;
  height: 28px;
}

.store-button-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.store-button-text small {
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  opacity: 0.85;
}

.store-button-text strong {
  font-size: 16px;
  font-weight: 800;
}

/* Variante iOS : noir / dark */
.store-button-ios {
  background: #000;
  color: #fff;
}

.store-button-ios.store-button-secondary {
  background: #1f2933;
  color: #fff;
}

/* Variante Android : vert Play Store */
.store-button-android {
  background: linear-gradient(135deg, #34a853 0%, #0f9d58 100%);
  color: #fff;
}

.store-button-android.store-button-secondary {
  background: linear-gradient(135deg, #1f8a3d 0%, #0c6e3f 100%);
  color: #fff;
}

.store-button-primary {
  box-shadow: 0 4px 12px rgba(11, 37, 69, 0.15);
}

.download-app-detected {
  margin: 14px 0 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: var(--blue-soft, #edf3f8);
  border: 1px solid var(--line, #dce4eb);
  border-radius: 999px;
  font-size: 13px;
  color: var(--navy);
}

.download-app-detected-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--orange, #f37021);
  display: inline-block;
}

.download-app-detected[data-os="ios"] .download-app-detected-dot {
  background: #0a84ff;
}

.download-app-detected[data-os="android"] .download-app-detected-dot {
  background: #34a853;
}

/* Modal Android : réutilise la structure de la modal iOS pour la cohérence */
.android-install-steps {
  list-style: none;
  margin: 0 0 16px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.android-install-steps li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
  background: var(--surface-alt, #f8fafc);
  border-radius: 10px;
  border: 1px solid var(--line, #dce4eb);
  color: var(--text);
  line-height: 1.4;
}

.android-install-step-icon {
  font-size: 18px;
  flex-shrink: 0;
}

.android-install-extra {
  margin: 0 0 16px;
  padding: 10px 12px;
  background: #fff7e8;
  border: 1px solid #f5d68a;
  border-radius: 10px;
  font-size: 13px;
  color: #6b4e00;
  line-height: 1.4;
}

body.dark-mode .android-install-extra {
  background: #2b2008;
  border-color: #6b4e00;
  color: #f5d68a;
}

/* ==========================================================================
   FICHIERS REÇUS (Grille max 3 colonnes, Accordéons déroulants, Téléchargement direct)
   ========================================================================== */

.received-files-panel {
  padding: 24px;
}

.received-files-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.received-heading-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 3px 0 4px;
}

.received-heading-title h2 {
  margin: 0;
  color: var(--blue);
  font-size: 20px;
  font-weight: 800;
}

.received-count-badge {
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 11px;
  font-weight: 800;
}

/* Grille 3 colonnes max pour afficher 3 dossiers côte à côte avec numéro de dossier bien visible */
.received-files-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
}

@media (max-width: 1100px) {
  .received-files-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .received-files-list {
    grid-template-columns: 1fr;
  }
  .transfer-mode-tabs {
    grid-template-columns: 1fr;
  }
}

/* Carte groupe de dossier compacte */
.dossier-group-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--white);
  box-shadow: var(--shadow-xs);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  overflow: hidden;
}

.dossier-group-card:hover {
  border-color: #cbd5e1;
  box-shadow: var(--shadow-sm);
}

.is-qr-deposit-group {
  border-color: rgba(12, 35, 64, 0.15);
  background: linear-gradient(180deg, #ffffff 0%, #f9fbfd 100%);
}

.is-dossier-scan-group {
  border-color: rgba(243, 112, 33, 0.18);
  background: linear-gradient(180deg, #ffffff 0%, #fffdfa 100%);
}

/* En-tête de dossier cliquable (Accordéon) */
.dossier-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 14px;
  cursor: pointer;
  user-select: none;
  background: transparent;
  transition: background 0.15s ease;
}

.dossier-group-header:hover {
  background: rgba(12, 35, 64, 0.03);
}

.dossier-group-title-area {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
}

.dossier-group-icon {
  display: grid;
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  place-items: center;
  border-radius: 8px;
  background: var(--orange-soft);
  font-size: 15px;
}

.is-qr-deposit-group .dossier-group-icon {
  background: var(--blue-soft);
}

.dossier-title-text-wrap {
  min-width: 0;
  flex: 1;
}

.dossier-group-badge-line {
  margin-bottom: 2px;
}

.dossier-source-badge {
  display: inline-flex;
  align-items: center;
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 800;
}

.badge-qr {
  background: var(--blue-soft);
  color: var(--blue);
}

.badge-dossier {
  background: var(--orange-soft);
  color: var(--orange-dark);
}

.dossier-group-title {
  margin: 0;
  color: var(--blue);
  font-size: 13.5px;
  font-weight: 800;
  word-break: break-word;
  overflow-wrap: anywhere;
  line-height: 1.35;
}

.dossier-group-subtitle {
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dossier-group-header-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 0 0 auto;
}

.dossier-download-all-btn {
  min-height: 40px;
  padding: 0 18px;
  font-size: 13px;
  font-weight: 800;
  border-radius: 10px;
  white-space: nowrap;
}

.dossier-toggle-chevron-btn {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  cursor: pointer;
}

.accordion-chevron {
  transition: transform 0.2s ease;
  font-size: 14px;
  line-height: 1;
}

/* Zone déroulante des fichiers */
.dossier-files-collapsible {
  padding: 0 12px 12px;
  border-top: 1px solid var(--line-light);
  animation: fadeIn 0.2s ease;
}

.dossier-files-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 10px;
}

/* Éléments de fichier compacts */
.received-file-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfcfd;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.received-file-item:hover {
  background: #ffffff;
  border-color: #cbd5e1;
}

.received-file-preview {
  display: grid;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  place-items: center;
  border-radius: 8px;
  overflow: hidden;
  background: #f1f5f9;
  border: 1px solid var(--line);
  position: relative;
}

.received-file-preview.is-clickable {
  cursor: pointer;
}

.received-file-preview.is-clickable:hover::after {
  content: "🔍";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(12, 35, 64, 0.45);
  color: #fff;
  font-size: 11px;
}

.received-file-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.received-file-icon {
  font-size: 16px;
}

.received-file-details {
  min-width: 0;
  flex: 1;
}

.received-file-details strong {
  display: block;
  overflow: hidden;
  color: var(--blue);
  font-size: 11px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.received-file-details span {
  color: var(--muted);
  font-size: 9px;
  white-space: nowrap;
}

.received-file-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
  flex: 0 0 auto;
}

.received-file-thumb-loading {
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 36px;
  color: var(--muted);
  font-size: 16px;
  animation: thumbPulse 1.2s ease-in-out infinite;
}

@keyframes thumbPulse {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}

body.dark-mode .received-file-thumb-loading {
  color: var(--text-muted);
}

.received-file-preview-btn {
  min-height: 40px;
  width: 40px;
  padding: 0;
  display: grid;
  place-items: center;
  font-size: 16px;
  border-radius: 10px;
}

.received-file-download-btn {
  min-height: 40px;
  width: 40px;
  padding: 0;
  display: grid;
  place-items: center;
  font-size: 16px;
  font-weight: 800;
  border-radius: 10px;
}

.delete-file-button {
  display: grid;
  width: 26px;
  height: 26px;
  flex: 0 0 26px;
  place-items: center;
  padding: 0;
  border: 1px solid #fee2e2;
  border-radius: 6px;
  background: #fff5f5;
  color: var(--red-dark);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  transition: var(--transition);
}

.delete-file-button:hover {
  background: #fee2e2;
  border-color: #fca5a5;
}

.delete-file-button {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  place-items: center;
  padding: 0;
  border: 1px solid #fee2e2;
  border-radius: 8px;
  background: #fff5f5;
  color: var(--red-dark);
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  transition: var(--transition);
}

.delete-file-button:hover {
  background: #fee2e2;
  border-color: #fca5a5;
}

@media (max-width: 640px) {
  .received-file-item {
    flex-wrap: wrap;
  }
  .received-file-actions {
    width: 100%;
    justify-content: flex-end;
    margin-top: 4px;
  }
}

/* ==========================================================================
   MODAL PHOTO & SCAN CODE-BARRES (transfert-fichiers.html)
   ========================================================================== */

.photo-transfer-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 16px;
}

.photo-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(12, 35, 64, 0.65);
  backdrop-filter: blur(4px);
}

.photo-modal-panel {
  position: relative;
  z-index: 1;
  width: min(100%, 540px);
  max-height: min(92vh, 720px);
  overflow-y: auto;
  border-radius: 20px;
  background: var(--white);
  box-shadow: 0 20px 48px rgba(12, 35, 64, 0.25);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.photo-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line-light);
}

.photo-modal-kicker {
  display: block;
  color: var(--orange);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 2px;
}

.photo-modal-header h2 {
  margin: 0;
  color: var(--blue);
  font-size: 18px;
  font-weight: 800;
}

.photo-modal-close-btn {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  color: var(--muted);
  font-size: 18px;
  cursor: pointer;
  transition: var(--transition);
}

.photo-modal-close-btn:hover {
  background: var(--red-soft);
  color: var(--red);
  border-color: #fca5a5;
}

.transfer-step {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.step-indicator {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--blue);
}

.step-number {
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border-radius: 50%;
  background: var(--orange-gradient);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}

.active-dossier-tag {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 3px;
  font-size: 12px;
  color: var(--muted);
}

.active-dossier-tag strong {
  color: var(--orange-dark);
}

.btn-text-link {
  background: none;
  border: none;
  color: var(--blue);
  font-size: 11px;
  font-weight: 800;
  text-decoration: underline;
  cursor: pointer;
  padding: 0;
}

/* Scanner de code-barres */
.scanner-camera-wrapper {
  position: relative;
  width: 100%;
  min-height: 220px;
  border-radius: 14px;
  overflow: hidden;
  background: #0b192c;
  border: 2px solid var(--line);
  display: grid;
  place-items: center;
}

.scanner-video-box {
  width: 100% !important;
  border: none !important;
}

.scanner-video-box video {
  border-radius: 12px;
  object-fit: cover;
}

.scanner-reticle-overlay {
  position: absolute;
  inset: 15% 10%;
  border: 2px dashed rgba(243, 112, 33, 0.85);
  border-radius: 12px;
  box-shadow: 0 0 0 1000px rgba(0, 0, 0, 0.35);
  pointer-events: none;
  overflow: hidden;
}

.scanner-laser-line {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--orange);
  box-shadow: 0 0 10px 2px var(--orange);
  animation: scan-laser 2s infinite ease-in-out;
}

@keyframes scan-laser {
  0% { top: 5%; opacity: 0.3; }
  50% { top: 95%; opacity: 1; }
  100% { top: 5%; opacity: 0.3; }
}

.scanner-notice {
  margin: 0;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.scanner-controls-row {
  display: flex;
  justify-content: center;
  gap: 8px;
}

.scanner-ctrl-btn {
  min-height: 34px;
  padding: 0 14px;
  font-size: 11px;
}

.manual-dossier-divider {
  display: flex;
  align-items: center;
  text-align: center;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  margin: 4px 0;
}

.manual-dossier-divider::before,
.manual-dossier-divider::after {
  content: "";
  flex: 1;
  border-bottom: 1px solid var(--line);
}

.manual-dossier-divider span {
  padding: 0 10px;
}

.manual-dossier-box {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.manual-dossier-box label {
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
}

.manual-dossier-input-row {
  display: flex;
  gap: 8px;
}

.manual-dossier-input-row input {
  flex: 1;
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfcfd;
  font-size: 13px;
  font-weight: 700;
}

.manual-dossier-input-row input:focus {
  border-color: var(--orange);
  outline: none;
  box-shadow: 0 0 0 3px rgba(243, 112, 33, 0.15);
}

.manual-dossier-input-row button {
  min-height: 42px;
  padding: 0 18px;
}

/* Étape Photos */
.photo-capture-actions {

/* Bouton "Ne pas renseigner de dossier" */
.btn-skip-dossier-container {
  text-align: center;
  margin-top: 12px;
}

/* Bouton Comment installer application - responsive */
#show-install-help-btn {
  max-width: 100%;
  word-wrap: break-word;
  white-space: normal;
  text-align: center;
  padding: 1rem 1.5rem !important;
  font-size: 1rem !important;
}

@media (max-width: 480px) {
  #show-install-help-btn {
    padding: 0.85rem 1rem !important;
    font-size: 0.9rem !important;
    width: 100%;
    justify-content: center;
  }
  
  #show-install-help-btn span:not(.tab-btn-icon) {
    display: block;
    text-align: center;
  }
}

@media (max-width: 360px) {
  #show-install-help-btn {
    font-size: 0.85rem !important;
    padding: 0.75rem 0.75rem !important;
  }
}
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.photo-action-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 18px 12px;
  border: 2px dashed #cbd5e1;
  border-radius: 14px;
  background: #fbfcfd;
  cursor: pointer;
  transition: var(--transition);
  user-select: none;
}

.photo-action-card:hover {
  border-color: var(--orange);
  background: var(--orange-soft);
  transform: translateY(-2px);
}

.photo-action-camera {
  border-color: rgba(243, 112, 33, 0.4);
  background: #fffdfb;
}

.photo-action-icon {
  font-size: 28px;
  margin-bottom: 4px;
}

.photo-action-card strong {
  color: var(--blue);
  font-size: 13px;
  font-weight: 800;
}

.photo-action-card span {
  color: var(--muted);
  font-size: 11px;
}

.photo-previews-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  border-radius: 14px;
  background: #f8fafc;
  border: 1px solid var(--line);
}

.photo-previews-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.photo-counter-text {
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
}

.photo-previews-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 20px 10px;
  color: var(--muted);
}

.photo-previews-empty span {
  font-size: 32px;
  opacity: 0.4;
  margin-bottom: 6px;
}

.photo-previews-empty p {
  margin: 0;
  font-size: 12px;
}

.photo-previews-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

@media (max-width: 480px) {
  .photo-previews-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.photo-preview-card {
  position: relative;
  aspect-ratio: 1;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #000;
}

.photo-preview-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.photo-remove-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(239, 68, 68, 0.9);
  color: #fff;
  border: none;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  display: grid;
  place-items: center;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

.photo-preview-meta {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 4px 6px;
  background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
  color: #fff;
  font-size: 9px;
  display: flex;
  justify-content: space-between;
}

/* Progress bar */
.upload-progress-box {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px;
  border-radius: 12px;
  background: var(--blue-soft);
}

.upload-progress-bar-track {
  height: 8px;
  border-radius: 999px;
  background: rgba(12, 35, 64, 0.12);
  overflow: hidden;
}

.upload-progress-bar-fill {
  height: 100%;
  width: 0%;
  background: var(--orange-gradient);
  border-radius: 999px;
  transition: width 0.3s ease;
}

.upload-progress-text {
  margin: 0;
  color: var(--blue);
  font-size: 11px;
  font-weight: 700;
  text-align: center;
}

.photo-modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line-light);
}

.photo-modal-footer button {
  min-height: 42px;
  padding: 0 18px;
}

/* Lightbox */
.photo-lightbox-modal {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: grid;
  place-items: center;
  padding: 20px;
}

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
}

.lightbox-content {
  position: relative;
  z-index: 1;
  max-width: min(90vw, 840px);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.lightbox-title {
  margin: 0;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  text-align: center;
}

.lightbox-image-wrap {
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 16px;
  background: #000;
}

.lightbox-img {
  max-width: 100%;
  max-height: 75vh;
  object-fit: contain;
  border-radius: 14px;
}

.lightbox-close-btn {
  position: absolute;
  top: -12px;
  right: -12px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #ffffff;
  color: #0c2340;
  border: none;
  font-size: 20px;
  font-weight: 800;
  cursor: pointer;
  display: grid;
  place-items: center;
  box-shadow: 0 4px 14px rgba(0,0,0,0.4);
}

/* Dark mode */
body.dark-mode .transfer-mode-tabs {
  background: var(--surface-alt);
}

body.dark-mode .transfer-mode-tab-btn.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

body.dark-mode .transfer-slide-pane {
  background: var(--surface);
  border-color: var(--line);
}

body.dark-mode #slide-mode-mobile,
body.dark-mode #slide-mode-qr {
  background: var(--surface);
  border-color: var(--line);
}

body.dark-mode .transfer-slide-pane h2,
body.dark-mode .transfer-method-content h2 {
  color: var(--text);
}

body.dark-mode .transfer-method-content p {
  color: var(--text);
  opacity: 0.85;
}

body.dark-mode .transfer-qr-center-box {
  background: var(--surface-alt);
  border-color: var(--line);
}

body.dark-mode .mobile-only-notice {
  background: rgba(243, 112, 33, 0.18);
  color: #ffb787;
}

body.dark-mode .transfer-status {
  color: #4ade80;
}

body.dark-mode .page-hero h1,
body.dark-mode .welcome-section h1,
body.dark-mode .page-hero p:not(.eyebrow),
body.dark-mode .welcome-text {
  color: var(--text);
}

body.dark-mode .eyebrow {
  color: var(--orange);
}

body.dark-mode .transfer-qr-center-box p {
  color: var(--text);
}

body.dark-mode .transfer-qr-footer .secondary-button {
  color: var(--text);
}

body.dark-mode .transfer-mode-tab-btn:not(.active) {
  color: var(--text);
}

body.dark-mode .transfer-mode-tab-btn:hover:not(.active) {
  color: var(--text);
  background: var(--surface-hover);
}

body.dark-mode .tab-btn-text small,
body.dark-mode .tab-btn-text strong {
  color: inherit;
}

body.dark-mode .back-link {
  color: var(--text);
}

body.dark-mode .hero-icon-blue {
  background: var(--surface-alt);
  color: var(--text);
  border-color: var(--line);
}

body.dark-mode .badge-all {
  background: rgba(12, 35, 64, 0.4);
  color: var(--text);
}

body.dark-mode .badge-mobile {
  background: rgba(243, 112, 33, 0.18);
  color: #ffb787;
}

body.dark-mode .dossier-group-card {
  background: var(--surface);
  border-color: var(--line);
}

body.dark-mode .dossier-group-title {
  color: var(--text);
}

body.dark-mode .received-file-item {
  background: var(--surface-alt);
  border-color: var(--line);
}

body.dark-mode .photo-modal-panel {
  background: var(--surface);
  border-color: var(--line);
}

body.dark-mode .photo-action-card {
  background: var(--surface-alt);
  border-color: var(--line);
}

body.dark-mode .photo-previews-section {
  background: var(--surface-alt);
  border-color: var(--line);
}

body.dark-mode .manual-dossier-input-row input {
  background: var(--surface-alt);
  border-color: var(--line);
  color: var(--text);
}

/* Page Dépôt Client */
.deposit-page {
  min-height: 100vh;
  padding: 24px;
  background: radial-gradient(circle at top, #fff5ee 0%, #f5f8fb 60%);
}

.deposit-shell {
  display: grid;
  width: min(100%, 540px);
  min-height: calc(100vh - 48px);
  place-items: center;
  margin: 0 auto;
}

.deposit-card {
  width: 100%;
  padding: 36px;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--white);
  box-shadow: var(--shadow-lg);
}

.deposit-brand {
  margin-bottom: 24px;
}

.upload-dropzone {
  display: grid;
  place-items: center;
  gap: 8px;
  padding: 32px 20px;
  border: 2px dashed #cbd5e1;
  border-radius: 16px;
  background: #f8fafc;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  margin: 20px 0;
}

.upload-dropzone:hover {
  border-color: var(--orange);
  background: var(--orange-soft);
}

.upload-dropzone input[type="file"] {
  display: none;
}

.upload-icon {
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  border-radius: 50%;
  background: var(--orange-soft);
  color: var(--orange);
  font-size: 24px;
}

/* ==========================================================================
   MODULE : PROCÉDURES & CONTACTS (procedures.html)
   ========================================================================== */

.procedures-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.procedure-tab {
  min-height: 42px;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--white);
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  transition: var(--transition);
}

.procedure-tab:hover {
  border-color: var(--orange);
  color: var(--orange);
  background: var(--orange-soft);
}

.procedure-tab.active {
  background: var(--orange-gradient);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 4px 12px rgba(243, 112, 33, 0.28);
}

.procedures-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

.procedure-card {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--white);
  box-shadow: var(--shadow-xs);
  cursor: pointer;
  transition: var(--transition);
}

.procedure-card:hover {
  border-color: var(--orange);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.procedure-card h3 {
  margin: 10px 0 6px;
  color: var(--blue);
  font-size: 16px;
  font-weight: 800;
}

.category-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.contact-card {
  display: grid;
  gap: 8px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--white);
  box-shadow: var(--shadow-xs);
  transition: var(--transition);
}

.contact-card:hover {
  border-color: #cbd5e1;
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.contact-card h3 {
  margin: 0;
  color: var(--blue);
  font-size: 16px;
  font-weight: 800;
}

.contact-info {
  color: var(--muted);
  font-size: 13px;
}

.contact-phone {
  color: var(--orange);
  font-size: 17px;
  font-weight: 800;
  text-decoration: none;
}

.contact-phone:hover {
  text-decoration: underline;
}

.contact-email {
  color: var(--blue);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.contact-email:hover {
  text-decoration: underline;
}

.raccourcis-info {
  padding: 18px 22px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--white);
  box-shadow: var(--shadow-xs);
  margin-bottom: 20px;
}

.raccourcis-info h3 {
  margin: 0 0 10px;
  color: var(--blue);
  font-size: 14px;
  font-weight: 800;
}

.raccourcis-info ul {
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.8;
}

/* ==========================================================================
   PAGE DE CONNEXION (connexion.html)
   ========================================================================== */

.login-page {
  position: relative;
  display: grid;
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  overflow: hidden;
  isolation: isolate;
  background: #071526;
}

.login-page::before,
.login-page::after {
  position: absolute;
  inset: 0;
  content: "";
  pointer-events: none;
}

.login-page::before {
  z-index: -2;
  opacity: 0.72;
  background-image:
    radial-gradient(circle at 16% 18%, rgba(243, 112, 33, 0.8) 0 1.5px, transparent 2.5px),
    radial-gradient(circle at 78% 24%, rgba(255, 255, 255, 0.6) 0 1px, transparent 2px),
    radial-gradient(circle at 62% 76%, rgba(243, 112, 33, 0.7) 0 2px, transparent 3px),
    radial-gradient(circle at 32% 84%, rgba(255, 255, 255, 0.45) 0 1px, transparent 2px),
    radial-gradient(circle at 92% 66%, rgba(243, 112, 33, 0.6) 0 1.5px, transparent 2.5px);
  background-size: 180px 160px, 240px 220px, 210px 190px, 270px 240px, 200px 180px;
  animation: login-particles 24s ease-in-out infinite alternate;
}

.login-page::after {
  z-index: -1;
  background:
    radial-gradient(circle at 15% 15%, rgba(243, 112, 33, 0.28), transparent 28%),
    radial-gradient(circle at 85% 85%, rgba(26, 67, 110, 0.58), transparent 34%),
    linear-gradient(135deg, rgba(7, 21, 38, 0.94), rgba(12, 35, 64, 0.82));
}

@keyframes login-particles {
  from { transform: translate3d(-10px, -8px, 0) scale(1); }
  to { transform: translate3d(14px, 12px, 0) scale(1.04); }
}

@media (prefers-reduced-motion: reduce) {
  .login-page::before {
    animation: none;
  }
}

.login-shell {
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(420px, 1.1fr);
  width: 100%;
  min-height: 100vh;
  align-items: stretch;
  padding: 32px 48px 32px 32px;
}

.login-brand-panel {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 10px;
  padding: 48px;
  color: var(--white);
  text-align: center;
}

.login-brand-mark {
  position: relative;
  overflow: hidden;
  display: grid;
  width: 92px;
  height: 92px;
  place-items: center;
  margin-bottom: 8px;
  border-radius: 26px;
  background: var(--orange-gradient);
  box-shadow: 0 14px 30px rgba(243, 112, 33, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.3);
  color: var(--white);
  font-size: 42px;
  font-weight: 900;
  letter-spacing: 0;
}

.login-brand-panel strong {
  font-size: 34px;
  font-weight: 800;
  letter-spacing: -1.5px;
}

.login-brand-panel span:last-child {
  color: rgba(255, 255, 255, 0.68);
  font-size: 13px;
  font-weight: 600;
}

.login-card {
  display: flex;
  width: min(100%, 520px);
  min-height: 0;
  flex-direction: column;
  justify-content: center;
  align-self: center;
  justify-self: center;
  padding: 40px 36px 34px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.3), 0 0 0 8px rgba(255, 255, 255, 0.04);
  text-align: center;
  animation: login-card-in 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@media (max-width: 700px) {
  .login-shell {
    grid-template-columns: 1fr;
    padding: 24px 16px 0;
  }

  .login-brand-panel {
    min-height: 230px;
    padding: 32px 24px 24px;
  }

  .login-brand-mark {
    width: 68px;
    height: 68px;
    border-radius: 20px;
    font-size: 30px;
  }

  .login-brand-panel strong {
    font-size: 28px;
  }

  .login-card {
    width: 100%;
    min-height: 0;
    align-self: stretch;
    justify-self: stretch;
    border-radius: 28px 28px 0 0;
  }
}

@keyframes login-card-in {
  from { opacity: 0; transform: translateY(14px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.login-icon {
  display: grid;
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  place-items: center;
  border-radius: 18px;
  background: var(--orange-soft);
  color: var(--orange);
  font-size: 28px;
  box-shadow: 0 8px 18px rgba(243, 112, 33, 0.25);
}

.login-card h1 {
  margin: 4px 0 8px;
  color: var(--blue);
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.login-description {
  margin: 0 0 24px;
  color: var(--muted);
  font-size: 13px;
}

.login-card label {
  display: block;
  margin-bottom: 8px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
  text-align: left;
}

.login-card input {
  width: 100%;
  min-height: 50px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfcfd;
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 16px;
  transition: var(--transition);
}

.login-card input:focus {
  border-color: var(--orange);
  background: var(--white);
  box-shadow: 0 0 0 3px rgba(243, 112, 33, 0.15);
  outline: none;
}

.login-card .primary-button {
  width: 100%;
  min-height: 50px;
  font-size: 14px;
}

.login-error {
  margin: 0 0 14px;
  color: var(--red);
  font-size: 12px;
  font-weight: 700;
}

.login-help {
  margin: 20px 0 0;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
}

/* ==========================================================================
   MODALES UNIVERSELLES
   ========================================================================== */

.note-modal,
.task-modal,
.password-edit-modal,
.nff-manager-modal,
.nff-add-modal,
.elpopole-modal,
.procedure-modal {
  position: fixed;
  z-index: 1000;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
}

.note-modal[hidden],
.task-modal[hidden],
.password-edit-modal[hidden],
.nff-manager-modal[hidden],
.nff-add-modal[hidden],
.elpopole-modal[hidden],
.procedure-modal[hidden] {
  display: none !important;
}

.note-modal-backdrop,
.task-modal-backdrop,
.password-edit-backdrop,
.nff-manager-backdrop,
.nff-add-backdrop,
.elpopole-modal-backdrop,
.procedure-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(12, 35, 64, 0.65);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  animation: fade-in 0.2s ease;
}

.note-modal-panel,
.task-modal-panel,
.password-edit-card,
.nff-manager-card,
.nff-add-card,
.elpopole-modal-card,
.procedure-modal-panel {
  position: relative;
  z-index: 1;
  width: min(100%, 540px);
  max-height: 90vh;
  overflow-y: auto;
  padding: 32px;
  border-radius: var(--radius-lg);
  background: var(--white);
  box-shadow: var(--shadow-lg);
  animation: slide-up 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.note-modal-close,
.password-edit-close,
.nff-manager-close,
.nff-add-close,
.elpopole-close,
.procedure-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 50%;
  background: #f8fafc;
  color: var(--muted);
  font-size: 20px;
  cursor: pointer;
  transition: var(--transition);
}

.elpopole-modal-card {
  width: min(92vw, 760px);
  max-height: calc(100vh - 32px);
  padding: 16px;
  overflow: hidden;
  display: grid;
  place-items: center;
}

.elpopole-image {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: calc(100vh - 64px);
  object-fit: contain;
}

.note-modal-close:hover,
.password-edit-close:hover,
.nff-manager-close:hover,
.nff-add-close:hover,
.elpopole-close:hover,
.procedure-modal-close:hover {
  background: var(--orange-soft);
  color: var(--orange);
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slide-up {
  from { opacity: 0; transform: translateY(16px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.note-form,
.password-edit-form {
  display: grid;
  gap: 16px;
  margin-top: 16px;
}

.note-form-group,
.password-edit-form-group {
  display: grid;
  gap: 6px;
}

.note-form-group label,
.password-edit-form-group label {
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
}

.note-form-group label span {
  color: var(--muted);
  font-weight: 500;
  font-size: 11px;
}

.note-form-group input,
.note-form-group select,
.note-form-group textarea,
.password-edit-form-group input,
.password-edit-form-group select,
.password-edit-form-group textarea {
  width: 100%;
  min-height: 46px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfcfd;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  transition: var(--transition);
}

.note-form-group textarea,
.password-edit-form-group textarea {
  padding: 12px 14px;
  min-height: 100px;
  resize: vertical;
}

.note-form-group input:focus,
.note-form-group select:focus,
.note-form-group textarea:focus,
.password-edit-form-group input:focus,
.password-edit-form-group select:focus,
.password-edit-form-group textarea:focus {
  border-color: var(--orange);
  background: var(--white);
  box-shadow: 0 0 0 3px rgba(243, 112, 33, 0.15);
  outline: none;
}

.note-form-error {
  margin: 4px 0 0;
  color: var(--red);
  font-size: 12px;
  font-weight: 700;
}

.note-form-actions,
.password-edit-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 10px;
}

/* ==========================================================================
   NOTIFICATIONS TOAST
   ========================================================================== */

.toast-container {
  position: fixed;
  z-index: 2000;
  right: 24px;
  bottom: 24px;
  display: grid;
  gap: 10px;
  width: min(380px, calc(100vw - 48px));
  pointer-events: none;
}

.toast {
  padding: 14px 18px;
  border-radius: 14px;
  background: var(--blue);
  color: var(--white);
  box-shadow: 0 12px 32px rgba(12, 35, 64, 0.28);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.45;
  border: 1px solid rgba(255, 255, 255, 0.15);
  animation: toast-in 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: auto;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(20px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ==========================================================================
   PIED DE PAGE (FOOTER)
   ========================================================================== */

.footer {
  display: flex;
  width: min(calc(100% - 308px), 1320px);
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 0;
  margin-right: auto;
  margin-bottom: 0;
  margin-left: calc(260px + max(24px, (100% - 1580px) / 2));
  padding: 24px 0 32px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.footer-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.footer-brand {
  color: var(--blue);
  font-weight: 800;
}

.footer-separator {
  color: #cbd5e1;
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 16px;
}

.footer-link,
.admin-footer-link {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  transition: color 0.2s ease;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

.footer-link:hover,
.admin-footer-link:hover {
  color: var(--orange);
  text-decoration: underline;
}

.footer-year {
  color: var(--text-muted);
  font-size: 11px;
}

@media (max-width: 768px) {
  .footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
}

@media (max-width: 600px) {
  .main-content {
    width: calc(100% - 24px);
    padding-top: 18px;
  }

  .page-hero,
  .welcome-section {
    gap: 18px;
    margin-bottom: 22px;
  }

  .page-hero h1,
  .welcome-section h1 {
    font-size: 30px;
    letter-spacing: -0.7px;
  }

  .home-welcome,
  .sav-card,
  .sav-history,
  .sav-scan-panel,
  .sav-list-panel,
  .received-files-panel,
  .password-toolbar {
    padding: 18px;
  }

  .date-card {
    width: 100%;
    min-width: 0;
  }

  .home-sav-color span:last-child {
    flex-wrap: wrap;
  }

  .compact-tool-card {
    min-height: 64px;
    padding: 8px 10px;
    gap: 10px;
  }

  .compact-tool-card .tool-icon {
    width: 36px;
    height: 36px;
    flex-basis: 36px;
    font-size: 18px;
  }

  .compact-tool-card .tool-arrow {
    width: 28px;
    height: 28px;
    flex-basis: 28px;
  }

  .sav-scan-form,
  .sav-scan-row {
    min-width: 0;
    width: 100%;
  }

  .password-login-row {
    flex-direction: column;
  }

  .password-toolbar .search-area {
    min-width: 0;
    flex-basis: 100%;
  }

  .password-results-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .password-login-row .primary-button {
    width: 100%;
  }

  .sav-scan-row {
    flex-direction: column;
  }

  .sav-scan-row .primary-button {
    width: 100%;
  }

  .sav-list-heading,
  .received-files-header,
  .password-card {
    align-items: flex-start;
    flex-direction: column;
  }

  .sav-count {
    align-self: flex-start;
  }

  .sav-item {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .sav-item .secondary-button {
    grid-column: 2;
    justify-self: start;
  }

  .password-card-credentials,
  .password-toolbar-actions,
  .note-form-actions,
  .password-edit-actions {
    width: 100%;
    flex-wrap: wrap;
  }

  .password-card-credentials > *,
  .password-toolbar-actions > *,
  .note-form-actions > *,
  .password-edit-actions > * {
    flex: 1 1 auto;
  }

  .transfer-simple-panel {
    padding: 18px;
    gap: 20px;
  }

  .transfer-simple-qr-area {
    padding: 14px;
  }

  .transfer-simple-qr img,
  .transfer-simple-qr canvas {
    width: min(260px, 100%) !important;
    height: auto !important;
    aspect-ratio: 1;
  }

  .note-modal,
  .task-modal,
  .password-edit-modal,
  .nff-manager-modal,
  .nff-add-modal,
  .procedure-modal {
    padding: 10px;
  }

  .note-modal-panel,
  .task-modal-panel,
  .password-edit-card,
  .nff-manager-card,
  .nff-add-card,
  .procedure-modal-panel {
    padding: 22px 18px;
  }

  .footer {
    width: calc(100% - 24px);
  }
}

body.dark-mode .login-card input,
body.dark-mode .password-login-row input,
body.dark-mode .sav-scan-row input,
body.dark-mode .form-group input,
body.dark-mode .form-group select,
body.dark-mode .form-group textarea,
body.dark-mode .note-form-group input,
body.dark-mode .note-form-group select,
body.dark-mode .note-form-group textarea,
body.dark-mode .password-edit-form-group input,
body.dark-mode .password-edit-form-group select,
body.dark-mode .password-edit-form-group textarea,
body.dark-mode .search-field,
body.dark-mode .notes-select-group select,
body.dark-mode .nff-collaborator-filter select {
  background: var(--surface-alt) !important;
  border-color: var(--line) !important;
  color: var(--text) !important;
  -webkit-text-fill-color: var(--text) !important;
  caret-color: var(--orange) !important;
}

body.dark-mode .login-card input::placeholder,
body.dark-mode .password-login-row input::placeholder,
body.dark-mode .sav-scan-row input::placeholder,
body.dark-mode .form-group input::placeholder,
body.dark-mode .form-group textarea::placeholder,
body.dark-mode .note-form-group input::placeholder,
body.dark-mode .note-form-group textarea::placeholder,
body.dark-mode .password-edit-form-group input::placeholder {
  color: var(--text-muted) !important;
  -webkit-text-fill-color: var(--text-muted) !important;
}

body.dark-mode input:-webkit-autofill,
body.dark-mode input:-webkit-autofill:hover,
body.dark-mode input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--text) !important;
  -webkit-box-shadow: 0 0 0 1000px var(--surface-alt) inset !important;
  caret-color: var(--orange) !important;
}

/* Dark mode - Actualites magasin (overrides styles injectes par js/news.js) */
/* La modale utilise .news-full-list (pas .home-news-list) : mêmes règles. */
body.dark-mode .home-news-list .home-news-item,
body.dark-mode .news-full-list .home-news-item,
body.dark-mode .news-full-list .news-item {
  background: var(--surface-alt) !important;
  border-color: var(--line) !important;
}

body.dark-mode .home-news-list .home-news-item:hover,
body.dark-mode .news-full-list .home-news-item:hover,
body.dark-mode .news-full-list .news-item:hover {
  background: var(--surface) !important;
  border-color: var(--orange) !important;
}

body.dark-mode .home-news-list .home-news-date,
body.dark-mode .news-full-list .home-news-date,
body.dark-mode .news-full-list .news-date {
  background: var(--orange-soft) !important;
  color: var(--orange) !important;
}

body.dark-mode .home-news-list .home-news-date span,
body.dark-mode .news-full-list .home-news-date span,
body.dark-mode .news-full-list .news-date span {
  color: var(--orange) !important;
}

body.dark-mode .home-news-list .home-news-date small,
body.dark-mode .news-full-list .home-news-date small,
body.dark-mode .news-full-list .news-date small {
  color: var(--muted) !important;
}

body.dark-mode .home-news-list .home-news-category,
body.dark-mode .news-full-list .home-news-category,
body.dark-mode .news-full-list .news-category {
  color: var(--blue) !important;
  background: var(--blue-soft) !important;
}

body.dark-mode .home-news-list .home-news-category.category-important,
body.dark-mode .news-full-list .home-news-category.category-important,
body.dark-mode .news-full-list .news-category.category-important {
  color: #ff8a75 !important;
  background: var(--red-soft) !important;
}

body.dark-mode .home-news-list .home-news-category.category-green,
body.dark-mode .news-full-list .home-news-category.category-green,
body.dark-mode .news-full-list .news-category.category-green {
  color: #4ade80 !important;
  background: var(--green-soft) !important;
}

body.dark-mode .home-news-list .home-news-content h3,
body.dark-mode .news-full-list .home-news-content h3,
body.dark-mode .news-full-list .news-content h3 {
  color: var(--text) !important;
}

body.dark-mode .home-news-list .home-news-content p,
body.dark-mode .news-full-list .home-news-content p,
body.dark-mode .news-full-list .news-content p {
  color: var(--muted) !important;
}

body.dark-mode .news-full-list .news-loading {
  color: var(--muted) !important;
}
/* ==========================================================================
   RESPONSIVE - Section Téléchargement App Mobile
   ========================================================================== */

@media (max-width: 768px) {
  .download-app-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .download-app-qr-wrapper {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }

  .download-app-buttons {
    flex-direction: column;
    align-items: stretch;
  }

  .store-button {
    width: 100%;
    min-width: 0;
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .download-app-qr {
    width: 140px;
    height: 140px;
  }

  .download-app-qr img,
  .download-app-qr canvas {
    width: 120px !important;
    height: 120px !important;
  }

  .store-button-text strong {
    font-size: 15px;
  }
}

/* Dark mode - Téléchargement App */
body.dark-mode .download-app-header h2 {
  color: var(--text);
}

body.dark-mode .download-app-header p:not(.eyebrow) {
  color: var(--text);
  opacity: 0.8;
}

body.dark-mode .download-app-header-icon {
  background: var(--surface-alt);
  border-color: var(--line);
}

body.dark-mode .download-app-qr-wrapper {
  background: var(--surface-alt);
  border-color: var(--line);
}

body.dark-mode .download-app-qr {
  background: var(--surface);
  border-color: var(--line);
}

body.dark-mode .download-app-qr-hint strong {
  color: var(--text);
}

body.dark-mode .download-app-qr-hint small {
  color: var(--text);
  opacity: 0.75;
}

body.dark-mode .download-app-detected {
  background: var(--surface-alt);
  border-color: var(--line);
  color: var(--text);
}

body.dark-mode .android-install-steps li {
  background: var(--surface-alt);
  border-color: var(--line);
  color: var(--text);
}
/* Mode paysage mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .ai-assistant-panel {
    height: min(320px, calc(100vh - 80px));
  }
  
  .main-nav {
    max-height: 100vh;
    overflow-y: auto;
  }
  
  .tool-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ==========================================================================
   RESPONSIVE - Page Procédures
   ========================================================================== */

@media (max-width: 768px) {
  .procedures-tabs {
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 8px;
  }
  
  .procedure-tab {
    flex-shrink: 0;
    min-height: 40px;
    padding: 0 16px;
    font-size: 13px;
  }
  
  .procedures-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  
  .procedure-card {
    padding: 14px;
  }
  
  .procedure-card h3 {
    font-size: 15px;
  }
  
  .contact-card {
    padding: 14px;
  }
  
  .contact-card h3 {
    font-size: 15px;
/* ==========================================================================
   RESPONSIVE - Page Notes
   ========================================================================== */

@media (max-width: 768px) {
  .notes-dashboard {
    padding: 16px 0 60px;
  }
  
  .notes-hero {
    flex-direction: column;
    gap: 16px;
  }
  
  .notes-control-card {
    padding: 16px;
  }
  
  .notes-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  
  .note-card {
    padding: 16px;
    border-radius: 14px;
    min-height: 160px;
  }
  
  .note-card-header {
    flex-direction: column;
    gap: 8px;
    align-items: flex-start;
  }
  
  .note-card-actions {
    position: static;
    margin-top: 8px;
  }
  
/* ==========================================================================
   RESPONSIVE - Page Admin
   ========================================================================== */

@media (max-width: 1024px) {
  .admin-shell {
    min-height: 100vh;
  }
  
  .admin-topbar {
    padding: 0 24px;
  }
  
  .admin-main {
    padding: 32px 0;
  }
  
  .admin-panels-nav {
    flex-wrap: wrap;
    gap: 8px;
  }
  
  .admin-panel-nav-btn {
    padding: 10px 16px;
    font-size: 13px;
  }
}

@media (max-width: 768px) {
  .admin-topbar {
    padding: 0 16px;
  }
  
  .brand {
    font-size: 20px;
  }
  
  .admin-intro {
    text-align: left;
  }
  
  .admin-intro h1 {
    font-size: 36px;
  }
  
  .intro-text {
    font-size: 14px;
  }
  
  .login-card {
    padding: 24px;
    border-radius: 18px;
  }
  
  .lock-icon {
    width: 48px;
    height: 48px;
    font-size: 22px;
  }
  
  .login-card h2 {
    font-size: 20px;
  }
  
  .admin-form .form-group input,
  .admin-form .form-group select {
    padding: 12px 14px;
    font-size: 16px;
  }
  
  .admin-panel {
    padding: 16px;
  }
  
  .admin-toolbar {
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
  }
  
/* ==========================================================================
   RESPONSIVE - Page Transfert de fichiers
   ========================================================================== */

@media (max-width: 768px) {
  .transfer-mode-section {
    margin-bottom: 16px;
  }
  
  .transfer-mode-tabs {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 8px;
    border-radius: 14px;
  }
  
  .transfer-mode-tab-btn {
    flex-direction: row;
    padding: 14px 16px;
    text-align: left;
  }
  
  .tab-btn-icon {
    font-size: 24px;
    width: 44px;
    height: 44px;
  }
  
  .tab-btn-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    text-align: left;
  }
  
  .tab-btn-text strong {
    font-size: 14px;
  }
  
  .tab-btn-text small {
    font-size: 11px;
  }
  
  .transfer-slide-pane {
    padding: 16px;
  }
  
  .transfer-method-content {
    padding: 16px;
  }
  
  .transfer-method-header {
    flex-direction: column;
    gap: 12px;
  }
  
  .transfer-method-badge {
    align-self: flex-start;
  }
  
  .transfer-qr-center-box {
    padding: 20px;
  }
  
  .transfer-qr-center-box canvas,
  .transfer-qr-center-box img {
    width: 180px !important;
    height: 180px !important;
  }
  
  .barcode-input-row {
    flex-direction: column;
  }
  
  .barcode-input-row input {
    width: 100%;
  }
  
  .barcode-input-row .primary-button {
    width: 100%;
  }
  
  .manual-dossier-input-row {
    flex-direction: column;
    gap: 8px;
  }
  
  .manual-dossier-input-row input {
    width: 100%;
/* ==========================================================================
   RESPONSIVE - Page Gestion SAV
   ========================================================================== */

@media (max-width: 768px) {
  .gestion-sav-page {
    padding: 16px 0 60px;
  }
  
  .fifo-dashboard {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  
  .fifo-card {
    padding: 18px;
  }
  
  .fifo-color-info {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }
  
  .fifo-dot {
    width: 56px;
    height: 56px;
  }
  
  .fifo-color-day {
    font-size: 20px;
  }
  
  .fifo-days-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
  
  .fifo-day-item {
    padding: 12px;
  }
}

@media (max-width: 480px) {
  .fifo-dashboard {
    gap: 12px;
  }
  
  .fifo-card {
    padding: 14px;
    border-radius: 14px;
  }
  
  .fifo-card-label {
    font-size: 10px;
  }
  
  .fifo-days-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .fifo-day-dot {
    width: 28px;
    height: 28px;
  }
  
  .fifo-day-name {
    font-size: 11px;
  }
}

/* ==========================================================================
   RESPONSIVE - Page NFF
   ========================================================================== */

@media (max-width: 768px) {
  .nff-page {
    padding: 16px 0 60px;
  }
  
  .nff-filters {
    flex-direction: column;
    gap: 12px;
  }
  
  .nff-search {
    width: 100%;
  }
  
  .nff-status-tabs {
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
  }
  
  .nff-status-tab {
    flex-shrink: 0;
  }
  
  .nff-list {
    gap: 12px;
  }
  
  .nff-card {
    padding: 14px;
  }
  
  .nff-card-header {
    flex-direction: column;
    gap: 8px;
    align-items: flex-start;
  }
  
  .nff-card-id {
    font-size: 15px;
  }
  
  .nff-card-actions {
    width: 100%;
    justify-content: flex-end;
  }
}

@media (max-width: 480px) {
  .nff-card {
    padding: 12px;
    border-radius: 12px;
  }
  
  .nff-badge {
    font-size: 10px;
    padding: 4px 8px;
  }
}
  }
  
  .manual-dossier-input-row .secondary-button {
    width: 100%;
  }
  
  .photo-action-cards {
    grid-template-columns: 1fr;
  }
  
  .photo-action-card {
    padding: 14px;
  }
  
  .received-files-list {
    grid-template-columns: 1fr;
  }
  
  .dossier-group-card {
    margin-bottom: 12px;
  }
  
  .download-app-header {
    flex-direction: column;
    gap: 16px;
    padding: 16px;
  }
  
  .download-app-qr-wrapper {
    grid-template-columns: 1fr;
    text-align: center;
  }
  
  .download-app-buttons {
    flex-direction: column;
  }
}

@media (max-width: 480px) {
  .transfer-method-content h2 {
    font-size: 18px;
  }
  
  .transfer-method-content p {
    font-size: 13px;
  }
  
  .transfer-qr-center-box {
    padding: 16px;
  }
  
  .transfer-qr-center-box canvas,
  .transfer-qr-center-box img {
    width: 150px !important;
    height: 150px !important;
  }
  
  .download-app-header-icon {
    width: 48px;
    height: 48px;
    font-size: 24px;
  }
  
  .download-app-qr {
    width: 140px;
    height: 140px;
  }
  
  .download-app-qr img,
  .download-app-qr canvas {
    width: 120px !important;
    height: 120px !important;
  }
}
  .admin-toolbar h2 {
    font-size: 18px;
  }
  
  .admin-toolbar .primary-button {
    width: 100%;
  }
  
  .admin-list-header {
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
  }
  
  .admin-list-actions {
    width: 100%;
    justify-content: flex-start;
  }
  
  .admin-list-item {
    padding: 14px;
    flex-direction: column;
    gap: 12px;
  }
  
  .admin-list-item-info {
    width: 100%;
  }
  
  .admin-list-item-actions {
    width: 100%;
    justify-content: flex-end;
  }
}

@media (max-width: 480px) {
  .admin-intro h1 {
    font-size: 28px;
    letter-spacing: -1.5px;
  }
  
  .login-card {
    padding: 20px;
  }
  
  .admin-panels-nav {
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 8px;
  }
  
  .admin-panel-nav-btn {
    flex-shrink: 0;
    padding: 8px 14px;
    font-size: 12px;
  }
}
  .note-card h2 {
    font-size: 16px;
  }
}

@media (max-width: 480px) {
  .notes-hero-copy h1 {
    font-size: 22px;
  }
  
  .notes-control-main {
    flex-direction: column;
    gap: 12px;
  }
  
  .notes-select-icon {
    width: 40px;
    height: 40px;
    font-size: 18px;
  }
  
  .notes-collab-btn {
    min-height: 36px;
    padding: 0 12px;
    font-size: 12px;
  }
}
  }
  
  .contact-phone {
    font-size: 16px;
  }
  
  .raccourcis-info {
    padding: 14px;
  }
  
  .raccourcis-info h3 {
    font-size: 15px;
  }
  
  .raccourcis-list li {
    font-size: 12px;
  }
}

@media (max-width: 480px) {
  .procedures-tabs {
    gap: 6px;
  }
  
  .procedure-tab {
    padding: 0 14px;
    font-size: 12px;
    border-radius: 10px;
  }
  
  .procedure-card {
    padding: 12px;
    border-radius: 12px;
  }

  .category-badge {
    font-size: 9px;
    padding: 3px 8px;
  }
}

/* ==========================================================================
   BARRE HAUTE + BANDEAU "MES OUTILS" + MENUS PLEIN ÉCRAN
   (remplace l'ancien menu latéral gauche)
   ========================================================================== */

/* --- Header : barre haute pleine largeur, logo centré --- */
.app-shell > .topbar {
  position: sticky;
  top: 0;
  inset: auto;
  z-index: 600;
  width: 100%;
  height: auto;
  margin: 0;
  border-right: 0;
  border-bottom: 1px solid rgba(219, 228, 238, 0.85);
  padding: 10px 16px;
}

.app-shell > .alerts-ticker {
  margin-left: 0;
  width: 100%;
}

.app-shell > .main-content {
  width: min(calc(100% - 96px), 1240px);
  margin-left: auto;
  margin-right: auto;
}

.app-shell > .footer {
  margin-left: 0;
  width: 100%;
}

.app-shell {
  overflow-x: clip;
  padding-left: 60px;
  box-sizing: border-box;
}

.topbar-inner--bar {
  position: relative;
  flex-direction: row;
  align-items: center;
  gap: 12px;
  width: 100%;
}

.topbar-side {
  display: flex;
  flex: 1;
}

.topbar-side--right {
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
}

.topbar-side .theme-toggle {
  width: auto;
}

.brand--center {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.topbar-inner--bar .topbar-actions {
  flex: 1;
  justify-content: flex-end;
  margin-top: 0;
}

.topbar-inner--bar .topbar-actions > * {
  flex: 0 0 auto;
}

/* --- Bandeau vertical gauche "Mes outils" (ancré, jamais flottant) --- */
.tools-rail {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  z-index: 550;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 60px;
  padding: 20px 0;
  border: 0;
  border-radius: 0 20px 20px 0;
  background: linear-gradient(165deg, #123c69 0%, #1d5a96 100%);
  color: #fff;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 6px 0 24px rgba(12, 35, 64, 0.22);
  touch-action: manipulation;
  transition: box-shadow 0.2s ease, filter 0.2s ease;
}

.tools-rail:hover {
  filter: brightness(1.1);
  box-shadow: 8px 0 30px rgba(12, 35, 64, 0.3);
}

.tools-rail:focus-visible {
  outline: 3px solid #f37021;
  outline-offset: 3px;
}

.tools-rail-icon {
  font-size: 26px;
  line-height: 1;
}

.tools-rail-label {
  writing-mode: vertical-rl;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 3px;
  text-transform: uppercase;
}

/* --- Menus plein écran (outils + actualités) --- */
.tools-overlay[hidden] {
  display: none !important;
}

.tools-overlay {
  position: fixed;
  inset: 0;
  z-index: 700;
  display: flex;
  justify-content: center;
  align-items: stretch;
  padding: 4vh 4vw;
  box-sizing: border-box;
}

.tools-overlay-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(12, 35, 64, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: toolsFade 0.25s ease;
}

.tools-overlay-panel {
  position: relative;
  width: min(980px, 100%);
  max-height: 100%;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--white, #ffffff);
  border-radius: 24px;
  padding: 28px;
  box-sizing: border-box;
  box-shadow: 0 30px 80px rgba(12, 35, 64, 0.35);
  animation: toolsRise 0.32s cubic-bezier(0.16, 1, 0.3, 1);
}

.tools-overlay-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}

.tools-overlay-head h2 {
  margin: 4px 0 0;
}

.tools-close {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  border: 1px solid var(--line, #dbe4ee);
  border-radius: 50%;
  background: transparent;
  color: inherit;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  touch-action: manipulation;
  transition: transform 0.15s ease, background 0.15s ease;
}

.tools-close:hover {
  transform: rotate(90deg);
  background: rgba(243, 112, 33, 0.12);
}

.tools-close:focus-visible,
.tool-tile:focus-visible,
.tools-rail:focus-visible {
  outline: 3px solid #f37021;
  outline-offset: 2px;
}

.tools-grid {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 14px;
  margin: 0;
  padding: 0;
}

.tool-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-height: 132px;
  justify-content: center;
  padding: 20px 10px;
  border: 1px solid var(--line, #dbe4ee);
  border-radius: 18px;
  background: var(--white, #ffffff);
  color: inherit;
  text-align: center;
  text-decoration: none;
  touch-action: manipulation;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
  animation: toolsPop 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.tool-tile:hover {
  transform: translateY(-4px);
  border-color: #f37021;
  box-shadow: 0 12px 26px rgba(243, 112, 33, 0.18);
}

.tool-tile.is-current {
  border-color: #f37021;
  background: rgba(243, 112, 33, 0.08);
}

.tool-tile-icon {
  font-size: 34px;
  line-height: 1;
}

.tool-tile-icon svg {
  display: block;
  width: 34px;
  height: 34px;
}

.tool-tile-label {
  font-size: 14px;
  font-weight: 800;
}

.tool-tile-desc {
  font-size: 11px;
  opacity: 0.7;
}

.news-full-list {
  display: grid;
  gap: 12px;
}

body.tools-open {
  overflow: hidden;
}

@keyframes toolsFade {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes toolsRise {
  from { opacity: 0; transform: translateY(26px) scale(0.98); }
  to { opacity: 1; transform: none; }
}

@keyframes toolsPop {
  from { opacity: 0; transform: translateY(14px) scale(0.96); }
  to { opacity: 1; transform: none; }
}

/* --- Mode sombre --- */
body.dark-mode .tools-overlay-panel {
  background: #101f30;
  color: #edf3f7;
}

body.dark-mode .tool-tile {
  background: #182c42;
  border-color: rgba(255, 255, 255, 0.12);
  color: #edf3f7;
}

body.dark-mode .tools-close {
  border-color: rgba(255, 255, 255, 0.2);
  color: #edf3f7;
}

/* --- Responsive : bandeau compact en bas à droite --- */
@media (max-width: 768px) {
  .app-shell {
    padding-left: 0;
  }

  .app-shell > .main-content {
    width: min(calc(100% - 32px), 1320px);
  }

  .tools-rail {
    top: auto;
    bottom: 20px;
    left: 16px;
    transform: none;
    flex-direction: row;
    width: 62px;
    height: 62px;
    min-height: 0;
    max-height: none;
    padding: 0;
    border-radius: 50%;
  }

  .tools-rail:hover {
    transform: scale(1.06);
  }

  .tools-rail-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }

  .tools-overlay {
    padding: 2vh 3vw;
  }

  .tools-overlay-panel {
    padding: 20px;
    border-radius: 20px;
  }

  .tools-grid {
    grid-template-columns: repeat(auto-fill, minmax(128px, 1fr));
    gap: 10px;
  }

  .tool-tile {
    min-height: 118px;
  }

  .topbar-side .theme-toggle-label,
  .topbar-actions .admin-header-link span:last-child,
  .topbar-actions .logout-button span:last-child {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tools-overlay-backdrop,
  .tools-overlay-panel,
  .tool-tile {
    animation: none;
  }

  .tools-rail,
  .tool-tile,
  .tools-close {
    transition: none;
  }
}

/* --- Variante : bouton bas-gauche + feuille basse --- */
.app-shell {
  padding-left: 0;
}

.tools-rail {
  left: 16px;
  top: auto;
  bottom: 20px;
  transform: none;
  flex-direction: row;
  width: auto;
  height: 60px;
  min-height: 0;
  max-height: none;
  padding: 0 22px;
  border-radius: 30px;
  gap: 10px;
  background: linear-gradient(135deg, #ff9b5d 0%, #f37021 55%, #df5d12 100%);
  box-shadow: 0 12px 30px rgba(243, 112, 33, 0.4);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.tools-rail:hover {
  transform: translateY(-2px);
  filter: none;
  box-shadow: 0 16px 34px rgba(243, 112, 33, 0.45);
}

.tools-rail-icon {
  font-size: 22px;
}

.tools-rail-label {
  writing-mode: horizontal-tb;
  font-size: 14px;
  letter-spacing: 0.3px;
  text-transform: none;
}

.tools-overlay {
  align-items: flex-end;
  padding: 0;
}

.tools-overlay-panel {
  width: min(980px, 100%);
  max-height: 78vh;
  margin: 0 auto;
  border-radius: 24px 24px 0 0;
}

.tools-sheet-handle {
  width: 56px;
  height: 6px;
  margin: 0 auto 14px;
  border-radius: 999px;
  background: rgba(12, 35, 64, 0.18);
}

body.dark-mode .tools-sheet-handle {
  background: rgba(255, 255, 255, 0.25);
}

.tools-admin-sep {
  margin: 20px 0 12px;
  border: 0;
  border-top: 1px dashed rgba(12, 35, 64, 0.2);
}

body.dark-mode .tools-admin-sep {
  border-top-color: rgba(255, 255, 255, 0.2);
}

.tools-admin-title {
  margin: 0 0 10px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  opacity: 0.65;
}

.tools-grid--admin {
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
}

.tool-tile--admin {
  background: rgba(18, 60, 105, 0.05);
}

body.dark-mode .tool-tile--admin {
  background: rgba(255, 255, 255, 0.06);
}

@media (max-width: 768px) {
  .tools-rail {
    height: 56px;
    width: auto;
    padding: 0 20px;
    border-radius: 30px;
  }

  .tools-rail-label {
    position: static;
    width: auto;
    height: auto;
    overflow: visible;
    clip: auto;
    white-space: normal;
    writing-mode: horizontal-tb;
    font-size: 13px;
  }

  .tools-overlay-panel {
    max-height: 88vh;
    border-radius: 20px 20px 0 0;
  }
}

/* --- Feuille compacte sans scroll + zone admin bas-droite + logo fixe --- */
.brand--center:hover {
  transform: translateX(-50%);
}

.tools-overlay-panel {
  max-height: 94vh;
  padding: 20px 22px;
}

.tools-overlay-head {
  margin-bottom: 12px;
}

.tools-overlay-head h2 {
  font-size: 20px;
}

.tools-grid {
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  gap: 10px;
}

.tool-tile {
  min-height: 104px;
  padding: 14px 8px;
}

.tool-tile-icon {
  font-size: 28px;
}

.tool-tile-label {
  font-size: 13px;
}

.tool-tile-desc {
  font-size: 10px;
}

.tools-admin-zone {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 14px;
}

.tools-admin-title {
  margin: 0;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  opacity: 0.6;
}

.tools-grid--admin {
  display: flex;
  gap: 8px;
}

.tool-tile--admin {
  flex-direction: row;
  min-height: 0;
  padding: 10px 16px;
  gap: 8px;
}

.tool-tile--admin .tool-tile-icon {
  font-size: 20px;
}

.tool-tile--admin .tool-tile-label {
  font-size: 12px;
}

.tool-tile--admin .tool-tile-desc {
  display: none;
}

/* --- Actions cartes services : pastilles en overlay --- */
.service-card-qr {
  position: relative;
}

.service-card-actions {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  gap: 6px;
  margin: 0;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.service-card-qr:hover .service-card-actions,
.service-card-qr:focus-within .service-card-actions {
  opacity: 1;
  transform: none;
}

@media (hover: none) {
  .service-card-actions {
    opacity: 1;
    transform: none;
  }
}

.service-card-actions .note-icon-button {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--surface, #ffffff);
  box-shadow: var(--shadow-sm);
}

.service-card-actions .note-icon-button:hover {
  transform: translateY(-1px);
}

@media (prefers-reduced-motion: reduce) {
  .service-card-actions,
  .service-card-actions .note-icon-button {
    transition: none;
  }
}

/* ==========================================================================
   PACK POLISH GLOBAL — dynamisme, profondeur, cohérence (100 % additif)
   ========================================================================== */

/* --- Entrée de page en cascade --- */
.main-content > section,
.main-content > article {
  animation: pageIn 0.45s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.main-content > section:nth-child(2),
.main-content > article:nth-child(2) { animation-delay: 0.05s; }
.main-content > section:nth-child(3),
.main-content > article:nth-child(3) { animation-delay: 0.1s; }
.main-content > section:nth-child(4),
.main-content > article:nth-child(4) { animation-delay: 0.15s; }
.main-content > section:nth-child(n+5),
.main-content > article:nth-child(n+5) { animation-delay: 0.2s; }

@keyframes pageIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

/* --- Typographie fluide --- */
.main-content h1 {
  font-size: clamp(26px, 3.4vw, 38px);
  letter-spacing: -0.5px;
  text-wrap: balance;
}

.main-content h2 {
  font-size: clamp(19px, 2.2vw, 24px);
  text-wrap: balance;
}

.home-panel-heading .eyebrow::before,
.section-heading .eyebrow::before,
.admin-toolbar .eyebrow::before {
  content: "";
  display: inline-block;
  width: 18px;
  height: 3px;
  margin-right: 8px;
  border-radius: 2px;
  background: var(--orange-gradient);
  vertical-align: middle;
}

/* --- Boutons vivants --- */
.primary-button {
  background-size: 160% 160%;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background-position 0.35s ease;
}

.primary-button:hover {
  background-position: 90% 50%;
  transform: translateY(-1px);
  box-shadow: var(--shadow-orange);
}

.primary-button:active {
  transform: translateY(0) scale(0.98);
}

.secondary-button {
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.secondary-button:hover {
  border-color: var(--orange-border);
  background: var(--orange-tint);
  color: var(--orange-dark);
  transform: translateY(-1px);
}

.secondary-button:active {
  transform: translateY(0) scale(0.98);
}

/* --- Cartes : profondeur au survol --- */
.home-focus-panel,
.home-news-panel,
.home-shortcuts-panel {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.home-focus-panel:hover,
.home-news-panel:hover,
.home-shortcuts-panel:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

/* --- Skeletons pendant les chargements --- */
.home-notes-list:empty,
.home-reminders-list:empty,
.home-daily-list:empty {
  min-height: 120px;
  border-radius: 14px;
  background: linear-gradient(100deg, var(--surface-alt) 40%, var(--line-light) 50%, var(--surface-alt) 60%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite linear;
}

@keyframes shimmer {
  to { background-position: -200% 0; }
}

/* --- Progression animée --- */
.home-daily-fill {
  transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

/* --- Toasts --- */
.toast {
  animation: toastIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(8px) scale(0.97); }
  to { opacity: 1; transform: none; }
}

/* --- Liens "Tout voir" : flèche qui avance --- */
.home-panel-link [aria-hidden="true"] {
  display: inline-block;
  transition: transform 0.18s ease;
}

.home-panel-link:hover [aria-hidden="true"] {
  transform: translateX(3px);
}

/* --- Focus visible global --- */
:focus-visible {
  outline: 3px solid #f37021;
  outline-offset: 2px;
  border-radius: 6px;
}

/* --- Sélection + fond d'ambiance + scrollbars --- */
::selection {
  background: rgba(243, 112, 33, 0.28);
}

body {
  background-image:
    radial-gradient(at 100% 0%, rgba(243, 112, 33, 0.05) 0, transparent 45%),
    radial-gradient(at 0% 100%, rgba(22, 54, 92, 0.05) 0, transparent 45%);
  background-attachment: fixed;
}

html {
  scrollbar-color: #f37021 var(--line-light);
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  .main-content > section,
  .main-content > article,
  .toast,
  .home-notes-list:empty,
  .home-reminders-list:empty,
  .home-daily-list:empty {
    animation: none;
  }

  html {
    scroll-behavior: auto;
  }

  .primary-button,
  .secondary-button,
  .home-focus-panel,
  .home-news-panel,
  .home-shortcuts-panel,
  .home-daily-fill,
  .home-panel-link [aria-hidden="true"] {
    transition: none;
  }
}

/* --- Raccourcis personnels (accueil) --- */
.home-shortcuts-panel {
  min-height: 0;
  padding: 18px 20px;
  margin-bottom: 20px;
}

.shortcuts-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  list-style: none;
  margin: 14px 0 0;
  padding: 0;
}

.shortcuts-list li {
  position: relative;
}

.shortcut-chip {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 46px;
  padding: 8px 16px 8px 8px;
  border: 1px solid var(--line, #dbe4ee);
  border-radius: 999px;
  background: var(--white, #ffffff);
  color: inherit;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  touch-action: manipulation;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.shortcut-chip:hover {
  transform: translateY(-2px);
  border-color: #f37021;
  box-shadow: 0 8px 18px rgba(243, 112, 33, 0.16);
}

.shortcut-chip:focus-visible {
  outline: 3px solid #f37021;
  outline-offset: 2px;
}

.shortcut-avatar {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  border-radius: 50%;
  background: linear-gradient(145deg, #ff9b5d 0%, #f37021 55%, #df5d12 100%);
  color: #fff;
  font-size: 15px;
  font-weight: 800;
}

.shortcut-delete {
  position: absolute;
  top: -9px;
  right: -7px;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid var(--line, #dbe4ee);
  border-radius: 50%;
  background: var(--white, #ffffff);
  color: #b0b8c5;
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
  touch-action: manipulation;
}

.shortcut-delete:hover {
  border-color: #dc3545;
  color: #dc3545;
}

.shortcut-delete:focus-visible {
  outline: 3px solid #f37021;
  outline-offset: 2px;
}

.shortcut-modal[hidden] {
  display: none !important;
}

.shortcut-modal {
  position: fixed;
  inset: 0;
  z-index: 750;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  box-sizing: border-box;
}

.shortcut-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(12, 35, 64, 0.5);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.shortcut-modal-panel {
  position: relative;
  width: min(440px, 100%);
  background: var(--white, #ffffff);
  border-radius: 20px;
  padding: 24px;
  box-sizing: border-box;
  box-shadow: 0 24px 60px rgba(12, 35, 64, 0.3);
}

.shortcut-modal-panel h3 {
  margin: 0 0 16px;
}

.shortcut-type-toggle {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.shortcut-type-toggle button {
  flex: 1;
  min-height: 44px;
  border: 1px solid var(--line, #dbe4ee);
  border-radius: 12px;
  background: transparent;
  color: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  touch-action: manipulation;
}

.shortcut-type-toggle button.is-active {
  border-color: #f37021;
  background: rgba(243, 112, 33, 0.1);
  color: #f37021;
}

.shortcut-modal-panel label {
  display: block;
  margin: 12px 0 6px;
  font-size: 12px;
  font-weight: 800;
}

.shortcut-modal-panel select,
.shortcut-modal-panel input {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid var(--line, #dbe4ee);
  border-radius: 12px;
  background: var(--white, #ffffff);
  color: inherit;
  font-size: 14px;
  box-sizing: border-box;
}

.shortcut-error {
  margin: 12px 0 0;
  color: #dc3545;
  font-size: 13px;
  font-weight: 700;
}

.shortcut-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

body.dark-mode .home-shortcuts-panel,
body.dark-mode .shortcut-modal-panel {
  background: #101f30;
  color: #edf3f7;
}

body.dark-mode .shortcut-chip,
body.dark-mode .shortcut-delete,
body.dark-mode .shortcut-modal-panel select,
body.dark-mode .shortcut-modal-panel input {
  background: #182c42;
  border-color: rgba(255, 255, 255, 0.14);
  color: #edf3f7;
}

body.dark-mode .shortcut-type-toggle button {
  color: #edf3f7;
}

/* --- Bouton info actualités (header) + footer à droite --- */
.info-button {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  border: 1px solid var(--line, #dbe4ee);
  border-radius: 50%;
  background: var(--blue-soft, #edf4fa);
  color: var(--blue, #123c69);
  font-size: 21px;
  line-height: 1;
  cursor: pointer;
  touch-action: manipulation;
  transition: transform 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.info-button:hover {
  transform: translateY(-1px);
  border-color: #f37021;
  color: #f37021;
}

.info-button svg {
  display: block;
}

.info-button:focus-visible {
  outline: 3px solid #f37021;
  outline-offset: 2px;
}

.app-shell > .footer {
  justify-content: center;
  text-align: center;
  border-top: 0;
}

@media (max-width: 768px) {
  .app-shell > .footer {
    flex-direction: column;
    align-items: center;
  }
}

/* --- Suppression par appui long + liste gérable au clavier --- */
.shortcut-chip {
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

.shortcut-delete[hidden] {
  display: none;
}

.shortcuts-list li.show-delete .shortcut-chip {
  border-color: #f37021;
  box-shadow: 0 8px 18px rgba(243, 112, 33, 0.16);
}

.shortcut-current {
  margin-top: 18px;
  border-top: 1px solid var(--line, #dbe4ee);
  padding-top: 12px;
}

.shortcut-current > p {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 800;
}

.shortcut-current ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.shortcut-current li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 13px;
  font-weight: 600;
}

.shortcut-current li button {
  min-height: 36px;
  padding: 4px 12px;
  border: 1px solid var(--line, #dbe4ee);
  border-radius: 10px;
  background: transparent;
  color: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  touch-action: manipulation;
}

.shortcut-current li button:hover {
  border-color: #dc3545;
  color: #dc3545;
}

.shortcut-current-empty {
  opacity: 0.65;
}

body.dark-mode .shortcut-current {
  border-top-color: rgba(255, 255, 255, 0.14);
}

/* --- Purge des notes traitées --- */
.notes-danger-button {
  border-color: rgba(220, 53, 69, 0.4);
  color: #dc3545;
}

.notes-danger-button:hover {
  border-color: #dc3545;
  background: rgba(220, 53, 69, 0.08);
  color: #dc3545;
}

body.dark-mode .notes-danger-button {
  border-color: rgba(220, 53, 69, 0.55);
  color: #f08a93;
}

body.dark-mode .notes-danger-button:hover {
  background: rgba(220, 53, 69, 0.14);
  color: #f5a3ab;
}

/* --- Sous-catégories services --- */
.subcategories-filter {
  margin-top: 8px;
}

.subcategories-filter[hidden] {
  display: none;
}

.subcategories-filter .category-button {
  font-size: 12px;
  opacity: 0.92;
}

.category-sub-item {
  padding-left: 22px;
}

.category-item-head {
  font-weight: 800;
  background: transparent;
  border-style: dashed;
  padding: 8px 4px 2px;
}

.modal-sep {
  margin: 18px 0 14px;
  border: 0;
  border-top: 1px solid var(--line, #dbe4ee);
}

/* --- Tuile B'Expert mise en avant --- */
.tool-tile--featured {
  position: relative;
  overflow: hidden;
  border: 0;
  background: linear-gradient(135deg, #ff9b5d 0%, #f37021 55%, #df5d12 100%);
  color: #fff;
  box-shadow: 0 10px 24px rgba(243, 112, 33, 0.4);
}

.tool-tile--featured .tool-tile-desc {
  opacity: 0.85;
}

.tool-tile--featured::after {
  content: "";
  position: absolute;
  top: -20%;
  bottom: -20%;
  left: -40%;
  width: 36%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.45), transparent);
  transform: skewX(-20deg);
  animation: tileSheen 3.6s ease-in-out infinite;
  pointer-events: none;
}

.tool-tile--featured:hover {
  transform: translateY(-4px) scale(1.02);
  border-color: transparent;
  box-shadow: 0 16px 34px rgba(243, 112, 33, 0.5);
}

@keyframes tileSheen {
  0%, 55% { left: -40%; }
  100% { left: 130%; }
}

body.dark-mode .tool-tile--featured {
  background: linear-gradient(135deg, #ff9b5d 0%, #f37021 55%, #df5d12 100%);
  color: #fff;
}

@media (prefers-reduced-motion: reduce) {
  .tool-tile--featured::after {
    animation: none;
  }
}

/* ==========================================================================
   THÈME LIQUID GLASS (clair → sombre → glass)
   ========================================================================== */

body.theme-glass {
  --background: #dfe7f2;
  --surface: rgba(255, 255, 255, 0.55);
  --surface-hover: rgba(255, 255, 255, 0.72);
  --surface-alt: rgba(255, 255, 255, 0.38);
  --text: #0d1e32;
  --text-primary: #0d1e32;
  --muted: #4a6076;
  --text-secondary: #425a72;
  --text-muted: #7b8ea3;
  --line: rgba(255, 255, 255, 0.65);
  --line-light: rgba(255, 255, 255, 0.45);
  --blue-soft: rgba(255, 255, 255, 0.5);
  --blue-tint: rgba(12, 35, 64, 0.06);
  --orange-soft: rgba(255, 245, 238, 0.6);
  --green-soft: rgba(236, 253, 245, 0.6);
  --amber-soft: rgba(255, 251, 235, 0.6);
  --red-soft: rgba(254, 242, 242, 0.65);
  --purple-soft: rgba(245, 243, 255, 0.6);
  --sky-soft: rgba(240, 249, 255, 0.6);
  --shadow: 0 8px 32px rgba(12, 35, 64, 0.12);
  --shadow-lg: 0 20px 50px rgba(12, 35, 64, 0.16);
  background-color: #dfe7f2;
  background-image:
    radial-gradient(at 12% 6%, rgba(255, 155, 93, 0.55) 0, transparent 42%),
    radial-gradient(at 88% 10%, rgba(64, 137, 190, 0.5) 0, transparent 46%),
    radial-gradient(at 86% 88%, rgba(139, 92, 246, 0.42) 0, transparent 48%),
    radial-gradient(at 8% 92%, rgba(243, 112, 33, 0.38) 0, transparent 44%);
  background-attachment: fixed;
  color: var(--text);
}

/* Surfaces floutées + reflet spéculaire */
body.theme-glass .home-focus-panel,
body.theme-glass .home-news-panel,
body.theme-glass .home-shortcuts-panel,
body.theme-glass .tool-tile,
body.theme-glass .shortcut-chip,
body.theme-glass .shortcut-modal-panel,
body.theme-glass .note-modal-panel,
body.theme-glass .tools-overlay-panel,
body.theme-glass .admin-row,
body.theme-glass .dashboard-stat-card,
body.theme-glass .dashboard-collab-card,
body.theme-glass .nff-stat-card,
body.theme-glass .service-card,
body.theme-glass .note-card,
body.theme-glass .login-card {
  background: var(--surface);
  -webkit-backdrop-filter: blur(20px) saturate(1.6);
  backdrop-filter: blur(20px) saturate(1.6);
  border: 1px solid rgba(255, 255, 255, 0.65);
  box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

body.theme-glass .app-shell > .topbar {
  background: rgba(255, 255, 255, 0.55);
  -webkit-backdrop-filter: blur(22px) saturate(1.7);
  backdrop-filter: blur(22px) saturate(1.7);
  border-bottom: 1px solid rgba(255, 255, 255, 0.6);
}

body.theme-glass .tools-rail {
  background: linear-gradient(165deg, rgba(18, 60, 105, 0.82) 0%, rgba(29, 90, 150, 0.82) 100%);
  -webkit-backdrop-filter: blur(18px) saturate(1.5);
  backdrop-filter: blur(18px) saturate(1.5);
  border: 1px solid rgba(255, 255, 255, 0.35);
}

body.theme-glass input,
body.theme-glass select,
body.theme-glass textarea {
  background: rgba(12, 35, 64, 0.05);
  border-color: rgba(12, 35, 64, 0.22);
  color: var(--text);
}

body.theme-glass input:focus,
body.theme-glass select:focus,
body.theme-glass textarea:focus {
  background: rgba(255, 255, 255, 0.8);
  border-color: #f37021;
  box-shadow: 0 0 0 3px rgba(243, 112, 33, 0.18);
  outline: none;
}

body.theme-glass .theme-toggle.is-glass {
  border-color: var(--orange-border);
  box-shadow: 0 0 0 3px rgba(243, 112, 33, 0.18);
}

body.theme-glass .alerts-ticker {
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  backdrop-filter: blur(14px) saturate(1.4);
}

/* --- Sélecteur de thème à 3 choix --- */
.theme-segment {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line, #dbe4ee);
  border-radius: 999px;
  background: var(--blue-soft, #edf3f8);
}

.theme-segment button {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  touch-action: manipulation;
  transition: background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.theme-segment button:hover {
  color: var(--blue);
}

.theme-segment button.is-active {
  background: var(--orange-gradient);
  color: #fff;
  box-shadow: 0 4px 12px rgba(243, 112, 33, 0.35);
}

.theme-segment button:focus-visible {
  outline: 3px solid #f37021;
  outline-offset: 2px;
}

/* --- B'Expert : orange conservé en mode glass --- */
body.theme-glass .tool-tile--featured {
  background: linear-gradient(135deg, #ff9b5d 0%, #f37021 55%, #df5d12 100%);
  border: 0;
  color: #fff;
  box-shadow: 0 10px 24px rgba(243, 112, 33, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

body.theme-glass .tool-tile--featured .tool-tile-desc {
  opacity: 0.85;
}

/* --- Bandeau d'alertes dépoli mais lisible --- */
body.theme-glass .alerts-ticker {
  background: linear-gradient(105deg, rgba(223, 93, 18, 0.78) 0%, rgba(243, 112, 33, 0.78) 48%, rgba(255, 131, 62, 0.78) 100%);
}

body.theme-glass .alerts-ticker-item {
  text-shadow: 0 1px 6px rgba(12, 35, 64, 0.4);
}

/* --- Header mobile : Mes outils intégré, logo à gauche, sans actus --- */
.tools-rail-icon svg,
.tools-header-btn svg {
  display: block;
}

.tools-header-btn {
  display: none;
}

@media (max-width: 768px) {
  .topbar-inner--bar > .topbar-side:first-child {
    display: none;
  }

  .brand--center {
    position: static;
    transform: none;
  }

  .info-button {
    display: none;
  }

  .tools-rail {
    display: none;
  }

  .tools-header-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 42px;
    padding: 0 14px;
    border: 0;
    border-radius: 999px;
    background: linear-gradient(135deg, #ff9b5d 0%, #f37021 55%, #df5d12 100%);
    color: #fff;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
    touch-action: manipulation;
    box-shadow: 0 6px 16px rgba(243, 112, 33, 0.4);
  }

  .tools-header-btn:focus-visible {
    outline: 3px solid #f37021;
    outline-offset: 2px;
  }
}

/* --- Mobile : menu sans titre admin + bulle IA masquée si overlay ouvert --- */
@media (max-width: 768px) {
  .tools-admin-title {
    display: none;
  }

  .tools-admin-zone {
    margin-top: 10px;
  }
}

body.tools-open .ai-assistant {
  display: none;
}

/* --- Planning tâches : lignes et en-têtes contrastés --- */
body.theme-glass .tasks-calendar-wrap {
  border-color: rgba(255, 255, 255, 0.6);
}

body.theme-glass .tasks-calendar {
  background: rgba(12, 35, 64, 0.16);
  box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

body.theme-glass .calendar-corner,
body.theme-glass .calendar-person,
body.theme-glass .calendar-day {
  background: rgba(255, 255, 255, 0.72);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}

body.theme-glass .calendar-day {
  border-right: 1px solid rgba(12, 35, 64, 0.14);
}

body.theme-glass .calendar-day.is-today {
  background: rgba(255, 245, 238, 0.85);
}

body.theme-glass .calendar-cell {
  background: rgba(255, 255, 255, 0.42);
}

body.theme-glass .calendar-cell.is-over {
  background: rgba(255, 245, 238, 0.7);
}

/* --- Lien + formulaire de demande de mot de passe --- */
.login-link {
  display: block;
  width: 100%;
  margin-top: 14px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--orange-dark, #df5d12);
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  cursor: pointer;
  touch-action: manipulation;
}

.login-link:hover {
  text-decoration: underline;
}

.demande-panel {
  width: min(520px, 100%);
}

.demande-form label {
  display: block;
  margin: 12px 0 6px;
  font-size: 12px;
  font-weight: 800;
}

.demande-form input,
.demande-form select,
.demande-form textarea {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid var(--line, #dbe4ee);
  border-radius: 12px;
  background: var(--white, #ffffff);
  color: inherit;
  font-size: 14px;
  box-sizing: border-box;
  font-family: inherit;
}

.demande-form textarea {
  resize: vertical;
}

.demande-error {
  margin: 12px 0 0;
  color: #dc3545;
  font-size: 13px;
  font-weight: 700;
}

.demande-ok {
  margin: 12px 0 0;
  color: #16a34a;
  font-size: 13px;
  font-weight: 700;
}

.demande-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

body.dark-mode .demande-form input,
body.dark-mode .demande-form select,
body.dark-mode .demande-form textarea {
  background: var(--surface);
}

/* --- Lien espace super-admin (bas-gauche connexion) + compteur --- */
.superadmin-link {
  position: fixed;
  left: 16px;
  bottom: 16px;
  z-index: 50;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border: 1px solid var(--line, #dbe4ee);
  border-radius: 999px;
  background: var(--surface, #ffffff);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  touch-action: manipulation;
}

.superadmin-link:hover {
  border-color: var(--orange-border);
  color: var(--orange-dark);
}

.superadmin-count {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: #dc2626;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
}

.superadmin-count[hidden] {
  display: none;
}

/* --- Sélecteur de magasin (connexion) --- */
.magasin-open-button {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  margin: 0 0 16px;
  padding: 0 16px;
  border: 1.5px dashed var(--line);
  border-radius: 12px;
  background: var(--surface-alt, #f8fafc);
  color: var(--blue);
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  touch-action: manipulation;
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.magasin-open-button:hover {
  border-color: var(--orange-border);
  transform: translateY(-1px);
}

.magasin-open-button.has-choice {
  border-style: solid;
  border-color: var(--orange);
  background: var(--orange-tint);
}

.magasin-open-button:focus-visible {
  outline: 3px solid #f37021;
  outline-offset: 2px;
}

.magasin-open-icon {
  font-size: 18px;
}

.store-search-wrap {
  margin-bottom: 14px;
}

.store-search-wrap input {
  width: 100%;
  min-height: 48px;
  padding: 10px 14px;
  border: 1px solid var(--line, #dbe4ee);
  border-radius: 12px;
  background: var(--white, #ffffff);
  color: inherit;
  font-size: 14px;
  box-sizing: border-box;
}

.store-region {
  margin: 18px 0 8px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--orange);
}

.store-region:first-child {
  margin-top: 0;
}

.store-groups .tools-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.store-groups .tools-grid > li {
  min-width: 0;
}

.store-tile .tool-tile-label {
  overflow-wrap: break-word;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

@media (max-width: 1100px) {
  .store-groups .tools-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .store-groups .tools-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .store-groups .tools-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 420px) {
  .store-groups .tools-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.store-tile {
  height: 132px;
  width: 150px;
  flex: 0 0 auto;
  max-width: none;
  padding: 10px 8px;
  justify-content: center;
}

.store-search-wrap {
  position: sticky;
  top: -20px;
  z-index: 2;
  padding: 6px 0 12px;
  background: inherit;
}

.store-tile .tool-tile-desc {
  display: none;
}

.tool-tile-icon.store-code {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.5px;
}

.store-no-result {
  color: var(--muted);
  font-size: 14px;
  text-align: center;
  padding: 20px 0;
}

body.dark-mode .magasin-open-button,
body.dark-mode .store-search-wrap input {
  background: var(--surface);
}

/* --- Tout supprimer (dossier transfert) --- */
.dossier-delete-all-btn {
  border-color: rgba(220, 53, 69, 0.4);
  color: #dc3545;
}

.dossier-delete-all-btn:hover:not(:disabled) {
  border-color: #dc3545;
  background: rgba(220, 53, 69, 0.08);
  color: #dc3545;
}

body.dark-mode .dossier-delete-all-btn {
  border-color: rgba(220, 53, 69, 0.55);
  color: #f08a93;
}

body.dark-mode .dossier-delete-all-btn:hover:not(:disabled) {
  background: rgba(220, 53, 69, 0.14);
  color: #f5a3ab;
}

/* --- Tailles uniformes des boutons groupés --- */
.dossier-download-all-btn,
.dossier-delete-all-btn {
  min-height: 42px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

/* --- Quota Cloudinary (transfert fichiers) --- */
.received-header-side {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.cloud-quota {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 6px 14px;
  border: 1px solid var(--line, #dbe4ee);
  border-radius: 999px;
  background: var(--white, #ffffff);
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  touch-action: manipulation;
  transition: border-color 0.18s ease, transform 0.18s ease;
}

.cloud-quota:hover {
  transform: translateY(-1px);
}

.cloud-quota strong {
  font-size: 13px;
}

.cloud-quota-bar {
  display: inline-block;
  width: 64px;
  height: 8px;
  border-radius: 999px;
  background: var(--line-light, #edf2f7);
  overflow: hidden;
}

.cloud-quota-bar span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: currentColor;
  transition: width 0.4s ease;
}

.cloud-quota.is-ok {
  border-color: rgba(22, 163, 74, 0.45);
  color: #16a34a;
}

.cloud-quota.is-warn {
  border-color: rgba(243, 112, 33, 0.5);
  color: #ea580c;
}

.cloud-quota.is-danger {
  border-color: rgba(220, 53, 69, 0.55);
  color: #dc3545;
}

body.dark-mode .cloud-quota {
  background: var(--surface);
}

body.dark-mode .cloud-quota.is-ok { color: #4ade80; }
body.dark-mode .cloud-quota.is-warn { color: #fb923c; }
body.dark-mode .cloud-quota.is-danger { color: #f87171; }
