/* ==========================================================================
   PhotoManager — Design tokens & base styles
   A calm, warm-graphite dashboard shell for professional photographers.
   Accent: brass/aperture gold — a nod to golden hour and lens rings,
   without leaning on the generic AI-orange or a cream+serif landing look.
   ========================================================================== */

:root {
  /* --- Light mode --- */
  --canvas: 250 250 248;         /* #FAFAFA8 warm off-white */
  --surface: 255 255 255;        /* card / panel surface */
  --surface-raised: 255 255 255;
  --border: 231 229 224;         /* #E7E5E0 */
  --border-strong: 214 211 203;
  --text-primary: 28 27 25;      /* #1C1B19 */
  --text-secondary: 107 104 99;  /* #6B6863 */
  --text-tertiary: 155 151 143;

  --accent: 198 138 61;          /* #C68A3D brass gold */
  --accent-hover: 179 122 47;    /* #B37A2F */
  --accent-soft: 245 231 210;    /* accent tint bg */
  --accent-contrast: 255 255 255;

  --success: 76 154 106;
  --success-soft: 224 240 231;
  --danger: 196 89 63;
  --danger-soft: 248 227 219;
  --info: 74 127 181;
  --info-soft: 224 234 244;

  --shadow-color: 28 27 25;

  --sidebar-w: 264px;
  --sidebar-w-collapsed: 76px;
  --header-h: 64px;
}

.dark {
  --canvas: 20 19 17;             /* #141311 */
  --surface: 27 26 23;            /* #1B1A17 */
  --surface-raised: 33 32 28;     /* #21201C */
  --border: 47 45 40;             /* #2F2D28 */
  --border-strong: 61 58 51;
  --text-primary: 242 240 236;    /* #F2F0EC */
  --text-secondary: 163 158 150;  /* #A39E96 */
  --text-tertiary: 122 117 109;

  --accent: 216 158 90;           /* lighter brass for dark bg */
  --accent-hover: 230 174 108;
  --accent-soft: 54 43 26;
  --accent-contrast: 24 20 12;

  --success: 111 179 138;
  --success-soft: 30 45 36;
  --danger: 214 122 97;
  --danger-soft: 51 32 27;
  --info: 116 162 209;
  --info-soft: 27 39 51;

  --shadow-color: 0 0 0;
}

* {
  border-color: rgb(var(--border));
}

html {
  color-scheme: light;
}
html.dark {
  color-scheme: dark;
}

body {
  background-color: rgb(var(--canvas));
  color: rgb(var(--text-primary));
  font-family: "Inter", ui-sans-serif, system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection {
  background-color: rgb(var(--accent) / 0.25);
}

/* --- Scrollbars --- */
.thin-scroll::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
.thin-scroll::-webkit-scrollbar-track {
  background: transparent;
}
.thin-scroll::-webkit-scrollbar-thumb {
  background: rgb(var(--border-strong));
  border-radius: 999px;
}
.thin-scroll {
  scrollbar-width: thin;
  scrollbar-color: rgb(var(--border-strong)) transparent;
}

/* --- Focus visibility (accessibility) --- */
:focus-visible {
  outline: 2px solid rgb(var(--accent));
  outline-offset: 2px;
  border-radius: 4px;
}

/* --- Sidebar width transition --- */
#sidebar {
  width: var(--sidebar-w);
  transition: width 200ms ease;
}
#sidebar.collapsed {
  width: var(--sidebar-w-collapsed);
}
#main-region {
  transition: margin-left 200ms ease;
}
@media (min-width: 1024px) {
  #main-region {
    margin-left: var(--sidebar-w);
  }
  #main-region.collapsed {
    margin-left: var(--sidebar-w-collapsed);
  }
}

/* Hide nav labels + section labels when collapsed (desktop) */
#sidebar.collapsed .nav-label,
#sidebar.collapsed .nav-section-label,
#sidebar.collapsed .sidebar-brand-text,
#sidebar.collapsed .user-mini-text {
  display: none;
}
#sidebar.collapsed .nav-item {
  justify-content: center;
}
#sidebar.collapsed .nav-item .nav-icon {
  margin-right: 0;
}

/* --- Mobile drawer --- */
#mobile-sidebar {
  transform: translateX(-100%);
  transition: transform 220ms ease;
}
#mobile-sidebar.open {
  transform: translateX(0);
}
#mobile-overlay {
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms ease;
}
#mobile-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

/* --- Dropdown panels --- */
.dropdown-panel {
  opacity: 0;
  transform: translateY(-6px) scale(0.98);
  pointer-events: none;
  transition: opacity 140ms ease, transform 140ms ease;
}
.dropdown-panel.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

/* --- Nav item active state --- */
.nav-item {
  position: relative;
  color: rgb(var(--text-secondary));
}
.nav-item:hover {
  background-color: rgb(var(--text-primary) / 0.05);
  color: rgb(var(--text-primary));
}
.nav-item.active {
  background-color: rgb(var(--accent-soft));
  color: rgb(var(--accent));
  font-weight: 500;
}
.nav-item.active .nav-icon {
  color: rgb(var(--accent));
}

/* --- Card --- */
.card {
  background-color: rgb(var(--surface));
  border: 1px solid rgb(var(--border));
  border-radius: 12px;
  box-shadow: 0 1px 2px rgb(var(--shadow-color) / 0.04);
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 8px;
  padding: 0.5rem 0.875rem;
  transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease, opacity 120ms ease;
  white-space: nowrap;
}
.btn:disabled {
  opacity: 0.5;
  pointer-events: none;
}
.btn-primary {
  background-color: rgb(var(--accent));
  color: rgb(var(--accent-contrast));
}
.btn-primary:hover {
  background-color: rgb(var(--accent-hover));
}
.btn-secondary {
  background-color: rgb(var(--surface));
  color: rgb(var(--text-primary));
  border: 1px solid rgb(var(--border-strong));
}
.btn-secondary:hover {
  background-color: rgb(var(--text-primary) / 0.04);
}
.btn-ghost {
  background-color: transparent;
  color: rgb(var(--text-secondary));
}
.btn-ghost:hover {
  background-color: rgb(var(--text-primary) / 0.06);
  color: rgb(var(--text-primary));
}
.btn-danger {
  background-color: rgb(var(--danger));
  color: white;
}
.btn-danger:hover {
  opacity: 0.9;
}
.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 8px;
  color: rgb(var(--text-secondary));
  transition: background-color 120ms ease, color 120ms ease;
}
.btn-icon:hover {
  background-color: rgb(var(--text-primary) / 0.06);
  color: rgb(var(--text-primary));
}

/* ==========================================================================
   Form fields (search, filters, forms across pages)
   ========================================================================== */
.input-field {
  width: 100%;
  padding: 0.5rem 0.75rem 0.5rem 2.25rem;
  font-size: 0.875rem;
  border-radius: 8px;
  border: 1px solid rgb(var(--border));
  background-color: rgb(var(--canvas));
  color: rgb(var(--text-primary));
  outline: none;
  transition: border-color 120ms ease;
}
.input-field:focus {
  border-color: rgb(var(--accent));
}
.input-field::placeholder {
  color: rgb(var(--text-tertiary));
}
.select-field {
  font-size: 0.8125rem;
  font-weight: 500;
  padding: 0.5rem 2rem 0.5rem 0.75rem;
  border-radius: 8px;
  border: 1px solid rgb(var(--border-strong));
  background-color: rgb(var(--surface));
  color: rgb(var(--text-primary));
  outline: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236B6863' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.6rem center;
}
.select-field:focus {
  border-color: rgb(var(--accent));
}

/* --- Status badges (used across bookings, invoices, galleries…) --- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  white-space: nowrap;
}
.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  flex-shrink: 0;
}
.badge-success {
  background-color: rgb(var(--success-soft));
  color: rgb(var(--success));
}
.badge-success .badge-dot { background-color: rgb(var(--success)); }
.badge-info {
  background-color: rgb(var(--info-soft));
  color: rgb(var(--info));
}
.badge-info .badge-dot { background-color: rgb(var(--info)); }
.badge-warning {
  background-color: rgb(var(--accent-soft));
  color: rgb(var(--accent));
}
.badge-warning .badge-dot { background-color: rgb(var(--accent)); }
.badge-danger {
  background-color: rgb(var(--danger-soft));
  color: rgb(var(--danger));
}
.badge-danger .badge-dot { background-color: rgb(var(--danger)); }
.badge-neutral {
  background-color: rgb(var(--text-primary) / 0.06);
  color: rgb(var(--text-secondary));
}

/* --- Trend indicator --- */
.trend-up { color: rgb(var(--success)); }
.trend-down { color: rgb(var(--danger)); }

/* ==========================================================================
   Agenda / calendar page
   ========================================================================== */

/* Filter chips */
.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8125rem;
  font-weight: 500;
  padding: 0.375rem 0.75rem;
  border-radius: 999px;
  border: 1px solid rgb(var(--border-strong));
  color: rgb(var(--text-secondary));
  background-color: rgb(var(--surface));
  white-space: nowrap;
  transition: background-color 120ms ease, color 120ms ease, border-color 120ms ease;
}
.filter-chip:hover {
  background-color: rgb(var(--text-primary) / 0.04);
}
.filter-chip[aria-pressed="true"] {
  background-color: rgb(var(--text-primary));
  border-color: rgb(var(--text-primary));
  color: rgb(var(--canvas));
}
.dark .filter-chip[aria-pressed="true"] {
  background-color: rgb(var(--text-primary));
  color: rgb(var(--canvas));
}
.filter-chip .chip-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  flex-shrink: 0;
}


/* --- Badge / notification dot --- */
.notif-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background-color: rgb(var(--danger));
  border: 2px solid rgb(var(--surface));
}

/* --- Skeleton loading state (for future async page content) --- */
.skeleton {
  background: linear-gradient(
    90deg,
    rgb(var(--border)) 25%,
    rgb(var(--border-strong)) 37%,
    rgb(var(--border)) 63%
  );
  background-size: 400% 100%;
  animation: skeleton-loading 1.4s ease infinite;
  border-radius: 6px;
}
@keyframes skeleton-loading {
  0% { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}

/* --- Reduced motion --- */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}

/* --- Remise / supplément par rapport au tarif de la prestation (équipe) --- */
.price-adjust {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.375rem 0.5rem;
  margin-top: 0.5rem; padding: 0.5rem 0.625rem; border-radius: 8px; font-size: 0.75rem;
  color: rgb(var(--text-secondary));
}
.price-adjust.is-discount { background-color: rgb(var(--success) / 0.08); }
.price-adjust.is-surcharge { background-color: rgb(var(--warning, 217 119 6) / 0.1); }
.price-adjust-badge {
  display: inline-flex; align-items: center; gap: 0.25rem; padding: 0.1rem 0.45rem; border-radius: 999px;
  font-weight: 600; white-space: nowrap;
}
.price-adjust-badge svg, .price-adjust-badge i { width: 0.8rem; height: 0.8rem; }
.price-adjust.is-discount .price-adjust-badge { color: rgb(var(--success)); background-color: rgb(var(--success) / 0.14); }
.price-adjust.is-surcharge .price-adjust-badge { color: rgb(var(--warning, 180 83 9)); background-color: rgb(var(--warning, 217 119 6) / 0.16); }
.price-adjust-text s { opacity: 0.7; }
.price-adjust-text strong { color: rgb(var(--text-primary)); }

/* --- Barre d'actions de fiche (réservation, facture) : principale + icônes, menu « Plus » --- */
.page-actions { display: flex; align-items: center; gap: 0.5rem; }
.page-actions .btn-icon-only { padding-left: 0.6rem; padding-right: 0.6rem; }
@media (max-width: 639px) {
  .page-actions { width: 100%; }
  .page-actions > .page-actions-main { flex: 1 1 auto; justify-content: center; }
  .page-actions .btn-label { display: none; }
}
.menu-item {
  display: flex; align-items: center; gap: 0.625rem; width: 100%; padding: 0.55rem 1rem;
  font-size: 0.875rem; text-align: left; color: rgb(var(--text-primary));
}
.menu-item:hover { background-color: rgb(var(--text-primary) / 0.05); }
.menu-item svg, .menu-item i { width: 1rem; height: 1rem; color: rgb(var(--text-secondary)); flex-shrink: 0; }
.menu-item.is-danger, .menu-item.is-danger svg, .menu-item.is-danger i { color: rgb(var(--danger)); }
.menu-item[aria-disabled="true"] { opacity: 0.45; pointer-events: none; }
.menu-item-hint { display: block; font-size: 0.75rem; color: rgb(var(--text-tertiary)); }
.menu-sep { height: 1px; margin: 0.375rem 0; background-color: rgb(var(--border)); }

/* --- Liste des factures : contenu d'une ligne déroulée (colonne « Détail ») --- */
.invoices-table tbody tr { cursor: pointer; }
.inv-detail { display: grid; gap: 0.625rem; min-width: min(28rem, 80vw); white-space: normal; }
.inv-detail-lines li {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem;
  padding: 0.375rem 0; border-bottom: 1px dashed rgb(var(--border));
}
.inv-detail-lines small { display: block; font-size: 0.75rem; color: rgb(var(--text-secondary)); }
.inv-detail-lines strong { white-space: nowrap; font-weight: 600; }
.inv-detail-payments { display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; font-size: 0.75rem; color: rgb(var(--text-secondary)); }
.inv-detail-payments span { display: inline-flex; align-items: center; gap: 0.25rem; }
.inv-detail-payments svg, .inv-detail-payments i { width: 0.8rem; height: 0.8rem; color: rgb(var(--success)); }
.inv-detail-actions { display: flex; gap: 0.5rem; }
.inv-detail-actions .btn { padding-top: 0.35rem; padding-bottom: 0.35rem; font-size: 0.8125rem; }

/* --- Suppression de compte (paramètres) --- */
.danger-hero {
  display: flex; align-items: flex-start; gap: 0.875rem; padding: 1rem 1.125rem; border-radius: 12px;
  background-color: rgb(var(--danger) / 0.08); border: 1px solid rgb(var(--danger) / 0.3);
}
.danger-hero-icon {
  width: 2.5rem; height: 2.5rem; border-radius: 10px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background-color: rgb(var(--danger) / 0.14); color: rgb(var(--danger));
}
.danger-hero-icon svg, .danger-hero-icon i { width: 1.25rem; height: 1.25rem; }
.consequence-icon {
  width: 2rem; height: 2rem; border-radius: 8px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background-color: rgb(var(--text-primary) / 0.06); color: rgb(var(--text-secondary));
}
.consequence-icon svg, .consequence-icon i { width: 1rem; height: 1rem; }
.alt-card { display: flex; align-items: center; gap: 0.75rem; padding: 0.875rem 1rem; transition: border-color 120ms ease; }
.alt-card:hover { border-color: rgb(var(--accent) / 0.5); }
.alt-card-icon {
  width: 2.25rem; height: 2.25rem; border-radius: 10px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background-color: rgb(var(--accent-soft)); color: rgb(var(--accent));
}
.alt-card-icon svg, .alt-card-icon i { width: 1.1rem; height: 1.1rem; }
.danger-card { border-color: rgb(var(--danger) / 0.4); }
.btn-danger:disabled { opacity: 0.45; cursor: not-allowed; }

/* --- Guide d'activation des notifications push (préférences) --- */
.push-help {
  margin-top: 1rem; padding: 0.875rem 1rem; border-radius: 12px;
  background-color: rgb(var(--accent-soft)); border: 1px solid rgb(var(--accent) / 0.25);
}
.push-help[hidden] { display: none; }
.push-help-title { display: flex; align-items: center; gap: 0.5rem; font-size: 0.875rem; font-weight: 600; }
.push-help-title svg, .push-help-title i { width: 1.1rem; height: 1.1rem; color: rgb(var(--accent)); flex-shrink: 0; }
.push-steps { margin-top: 0.75rem; display: grid; gap: 0.625rem; }
.push-steps li { display: flex; align-items: flex-start; gap: 0.625rem; font-size: 0.875rem; line-height: 1.45; color: rgb(var(--text-secondary)); }
.push-steps strong { color: rgb(var(--text-primary)); font-weight: 600; }
.push-step-num {
  width: 1.5rem; height: 1.5rem; border-radius: 999px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 0.75rem; font-weight: 600; background-color: rgb(var(--accent)); color: rgb(var(--accent-contrast));
}
.push-key {
  display: inline-flex; align-items: center; justify-content: center; vertical-align: -0.3em;
  width: 1.5rem; height: 1.5rem; margin: 0 0.15rem; border-radius: 6px;
  background-color: rgb(var(--surface)); border: 1px solid rgb(var(--border)); color: rgb(var(--info, 37 99 235));
}
.push-key svg, .push-key i { width: 0.9rem; height: 0.9rem; }

/* --- Formulaire en étapes (mobile) : [data-wizard] + [data-wizard-step] --- */
.wizard-steps { display: none; }
[data-wizard-prev], [data-wizard-next] { display: none; }
@media (max-width: 639px) {
  .wizard-steps {
    display: flex; gap: .5rem; counter-reset: step;
  }
  .wizard-steps li {
    flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: .35rem;
    font-size: .75rem; color: rgb(var(--text-tertiary)); cursor: pointer; position: relative;
  }
  .wizard-steps li:not(:last-child)::after {
    content: ""; position: absolute; top: .875rem; left: calc(50% + 1.1rem); right: calc(-50% + 1.1rem);
    height: 2px; border-radius: 2px; background: rgb(var(--border));
  }
  .wizard-steps li.is-done:not(:last-child)::after { background: rgb(var(--accent)); }
  .wizard-steps span {
    width: 1.75rem; height: 1.75rem; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center;
    font-weight: 600; border: 1.5px solid rgb(var(--border-strong)); background: rgb(var(--surface));
  }
  .wizard-steps li.is-current { color: rgb(var(--text-primary)); font-weight: 500; }
  .wizard-steps li.is-current span { border-color: rgb(var(--accent)); color: rgb(var(--accent)); }
  .wizard-steps li.is-done span { background: rgb(var(--accent)); border-color: rgb(var(--accent)); color: rgb(var(--accent-contrast)); }

  [data-wizard] [data-wizard-step]:not(.is-current) { display: none; }
  [data-wizard] [data-wizard-next] { display: inline-flex; }
  [data-wizard] [data-wizard-prev] { display: inline-flex; }
  [data-wizard][data-step="first"] [data-wizard-prev],
  [data-wizard]:not([data-step="first"]) [data-wizard-cancel],
  [data-wizard]:not([data-step="last"]) [data-wizard-submit],
  [data-wizard][data-step="last"] [data-wizard-next] { display: none; }
}

/* --- Bottom nav (mobile) safe area --- */
#bottom-nav {
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.bottom-nav-item {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  padding: 0.625rem 0.25rem;
  font-size: 11px;
  color: rgb(var(--text-secondary));
  position: relative;
}
.bottom-nav-item.active {
  color: rgb(var(--accent));
  font-weight: 500;
}
.bottom-nav-item.active::before {
  content: "";
  position: absolute;
  top: 0;
  left: 30%;
  right: 30%;
  height: 2px;
  border-radius: 0 0 2px 2px;
  background-color: rgb(var(--accent));
}

/* Plain text/number/date fields without a leading icon (forms) */
.input-plain {
  width: 100%;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  border-radius: 8px;
  border: 1px solid rgb(var(--border));
  background-color: rgb(var(--canvas));
  color: rgb(var(--text-primary));
  outline: none;
  transition: border-color 120ms ease;
}
.input-plain:focus { border-color: rgb(var(--accent)); }
.input-plain::placeholder { color: rgb(var(--text-tertiary)); }

.textarea-field {
  width: 100%;
  min-height: 96px;
  padding: 0.625rem 0.75rem;
  font-size: 0.875rem;
  border-radius: 8px;
  border: 1px solid rgb(var(--border));
  background-color: rgb(var(--canvas));
  color: rgb(var(--text-primary));
  outline: none;
  resize: vertical;
  transition: border-color 120ms ease;
}
.textarea-field:focus { border-color: rgb(var(--accent)); }
.textarea-field::placeholder { color: rgb(var(--text-tertiary)); }

.input-field.has-error,
.input-plain.has-error,
.select-field.has-error,
.textarea-field.has-error {
  border-color: rgb(var(--danger));
}

.form-label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 500;
  color: rgb(var(--text-primary));
  margin-bottom: 0.375rem;
}
.form-label .required-dot { color: rgb(var(--danger)); margin-left: 0.15rem; }
.form-hint { font-size: 0.75rem; color: rgb(var(--text-tertiary)); margin-top: 0.25rem; }
.form-error { font-size: 0.75rem; color: rgb(var(--danger)); margin-top: 0.25rem; }

/* Sticky summary sidebar (order/booking recap on forms) */
@media (min-width: 1024px) {
  .summary-sticky {
    position: sticky;
    top: calc(var(--header-h) + 1rem);
  }
}

/* ==========================================================================
   Séances photo — tableau kanban par étape
   ========================================================================== */
   .kanban-board { gap: 1rem; overflow-x: auto; padding-bottom: 0.5rem; }
   .kanban-column { flex: 0 0 280px; display: flex; flex-direction: column; background-color: rgb(var(--canvas)); border: 1px solid rgb(var(--border)); border-radius: 12px; max-height: calc(100vh - 260px); }
   .kanban-column-header { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; padding: 0.75rem 1rem; border-bottom: 1px solid rgb(var(--border)); }
   .kanban-column-count { font-size: 0.75rem; font-weight: 600; color: rgb(var(--text-secondary)); background-color: rgb(var(--text-primary) / 0.06); border-radius: 999px; padding: 0.05rem 0.5rem; }
   .kanban-column-body { flex: 1; overflow-y: auto; padding: 0.75rem; display: flex; flex-direction: column; gap: 0.625rem; min-height: 80px; transition: background-color 120ms ease; }
   .kanban-column-body.drag-over { background-color: rgb(var(--accent-soft)); border-radius: 8px; }
   .kanban-card { background-color: rgb(var(--surface)); border: 1px solid rgb(var(--border)); border-radius: 10px; padding: 0.75rem; cursor: grab; transition: box-shadow 120ms ease, border-color 120ms ease, opacity 120ms ease; }
   .kanban-card:hover { border-color: rgb(var(--border-strong)); box-shadow: 0 2px 6px rgb(var(--shadow-color) / 0.06); }
   .kanban-card.dragging { opacity: 0.45; }
   .kanban-card:active { cursor: grabbing; }
   
   .stage-tabs { display: flex; gap: 0.25rem; background-color: rgb(var(--canvas)); border: 1px solid rgb(var(--border)); border-radius: 10px; padding: 0.25rem; overflow-x: auto; }
   .stage-tab { flex: 1; text-align: center; font-size: 0.75rem; font-weight: 500; padding: 0.5rem 0.25rem; border-radius: 7px; color: rgb(var(--text-secondary)); white-space: nowrap; }
   .stage-tab[aria-selected="true"] { background-color: rgb(var(--surface)); color: rgb(var(--text-primary)); box-shadow: 0 1px 2px rgb(var(--shadow-color) / 0.08); }
   
   .card-move-btn { width: 26px; height: 26px; border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; color: rgb(var(--text-secondary)); }
   .card-move-btn:hover { background-color: rgb(var(--text-primary) / 0.06); }
   .card-move-btn:disabled { opacity: 0.3; pointer-events: none; }


   .dt-client { display: flex; align-items: center; gap: 0.625rem; }
.dt-avatar {
  width: 2rem; height: 2rem; border-radius: 999px;
  background-color: rgb(var(--accent-soft)); color: rgb(var(--accent));
  display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem; font-weight: 600; flex-shrink: 0;
}
.dt-client-name { font-weight: 500; font-size: 0.875rem; color: rgb(var(--text-primary)); }
.dt-client-subtitle { font-size: 0.75rem; color: rgb(var(--text-tertiary)); }
.dt-service { font-size: 0.875rem; color: rgb(var(--text-secondary)); }
.dt-date { font-size: 0.875rem; color: rgb(var(--text-secondary)); white-space: nowrap; }
.dt-location { display: inline-flex; align-items: center; gap: 0.375rem; font-size: 0.875rem; color: rgb(var(--text-secondary)); }
.dt-location i { width: 14px; height: 14px; color: rgb(var(--text-tertiary)); flex-shrink: 0; }
.dt-amount { font-weight: 500; font-size: 0.875rem; white-space: nowrap; color: rgb(var(--text-primary)); }

.dt-status { display: inline-flex; align-items: center; gap: 0.3rem; font-size: 0.75rem; font-weight: 500; padding: 0.2rem 0.6rem; border-radius: 999px; white-space: nowrap; }
.dt-status-dot { width: 6px; height: 6px; border-radius: 999px; flex-shrink: 0; }
.dt-status-success { background-color: rgb(var(--success-soft)); color: rgb(var(--success)); }
.dt-status-success .dt-status-dot { background-color: rgb(var(--success)); }
.dt-status-warning { background-color: rgb(var(--accent-soft)); color: rgb(var(--accent)); }
.dt-status-warning .dt-status-dot { background-color: rgb(var(--accent)); }
.dt-status-info { background-color: rgb(var(--info-soft)); color: rgb(var(--info)); }
.dt-status-info .dt-status-dot { background-color: rgb(var(--info)); }
.dt-status-danger { background-color: rgb(var(--danger-soft)); color: rgb(var(--danger)); }
.dt-status-danger .dt-status-dot { background-color: rgb(var(--danger)); }
.dt-status-neutral { background-color: rgb(var(--text-primary) / 0.06); color: rgb(var(--text-secondary)); }
.dt-status-neutral .dt-status-dot { background-color: rgb(var(--text-secondary)); }

.dt-actions { display: flex; align-items: center; justify-content: flex-end; gap: 0.25rem; }
.dt-action {
  display: inline-flex; align-items: center; justify-content: center;
  width: 2rem; height: 2rem; border-radius: 8px; color: rgb(var(--text-secondary));
  transition: background-color 120ms ease, color 120ms ease;
}
.dt-action:hover { background-color: rgb(var(--text-primary) / 0.06); color: rgb(var(--text-primary)); }
.dt-action i { width: 16px; height: 16px; }
.dt-action-delete:hover { background-color: rgb(var(--danger-soft)); color: rgb(var(--danger)); }

/* ==========================================================================
   Galeries — à ajouter à la fin de assets/css/app.css
   (fichier séparé ici uniquement pour la lisibilité de la livraison)
   ========================================================================== */

/* Utilitaire d'affichage fiable, indépendant de l'ordre de chargement
   du script Tailwind CDN (évite les conflits avec la classe "hidden"). */
.is-hidden { display: none !important; }

/* --------------------------------------------------------------------
   Liste des galeries — grille + carte
   -------------------------------------------------------------------- */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.875rem;
}
@media (min-width: 640px) {
  .gallery-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.25rem; }
}
@media (min-width: 1024px) {
  .gallery-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (min-width: 1400px) {
  .gallery-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}

.gallery-card {
  display: block;
  border-radius: 14px;
  overflow: hidden;
  background-color: rgb(var(--surface));
  border: 1px solid rgb(var(--border));
  transition: box-shadow 160ms ease, border-color 160ms ease, transform 160ms ease;
}
.gallery-card:hover {
  border-color: rgb(var(--border-strong));
  box-shadow: 0 8px 24px rgb(var(--shadow-color) / 0.1);
  transform: translateY(-2px);
}
.gallery-card-cover {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background-color: rgb(var(--canvas));
}
.gallery-card-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 300ms ease;
}
.gallery-card:hover .gallery-card-cover img { transform: scale(1.05); }

.gallery-card-status { position: absolute; top: 0.5rem; left: 0.5rem; }

.gallery-card-count {
  position: absolute;
  bottom: 0.5rem;
  right: 0.5rem;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.6875rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background-color: rgb(0 0 0 / 0.55);
  color: white;
  backdrop-filter: blur(4px);
}
.gallery-card-count i { width: 12px; height: 12px; }

.gallery-card-body { padding: 0.75rem 0.875rem 0.9375rem; }
.gallery-card-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: rgb(var(--text-primary));
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.gallery-card-meta {
  font-size: 0.75rem;
  color: rgb(var(--text-tertiary));
  margin-top: 0.15rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gallery-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 3rem 1rem;
  color: rgb(var(--text-tertiary));
  text-align: center;
}
.gallery-empty i { width: 32px; height: 32px; }

/* --------------------------------------------------------------------
   Détail galerie — en-tête bannière
   -------------------------------------------------------------------- */
.gallery-header {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  min-height: 200px;
  display: flex;
  align-items: flex-end;
}
.gallery-header-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.gallery-header-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgb(0 0 0 / 0.15) 0%, rgb(0 0 0 / 0.78) 100%);
}
.gallery-header-content { position: relative; padding: 1.25rem 1.5rem; color: white; }
.gallery-header-badge { margin-bottom: 0.5rem; }
.gallery-header-title { font-size: 1.375rem; font-weight: 600; line-height: 1.2; }
.gallery-header-meta { font-size: 0.8125rem; color: rgb(255 255 255 / 0.8); margin-top: 0.25rem; }
@media (min-width: 640px) {
  .gallery-header { min-height: 260px; }
  .gallery-header-title { font-size: 1.75rem; }
}

.gallery-more-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 0.4rem);
  width: 220px;
  background-color: rgb(var(--surface));
  border: 1px solid rgb(var(--border));
  border-radius: 10px;
  box-shadow: 0 8px 24px rgb(var(--shadow-color) / 0.12);
  padding: 0.375rem;
  z-index: 20;
}
.gallery-more-item {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  font-size: 0.8125rem;
  padding: 0.5rem 0.625rem;
  border-radius: 7px;
  color: rgb(var(--text-primary));
}
.gallery-more-item:hover { background-color: rgb(var(--text-primary) / 0.05); }
.gallery-more-item i { width: 16px; height: 16px; color: rgb(var(--text-tertiary)); }
.gallery-more-item-danger { color: rgb(var(--danger)); }
.gallery-more-item-danger i { color: rgb(var(--danger)); }

/* --------------------------------------------------------------------
   Détail galerie — grille photos en masonry
   -------------------------------------------------------------------- */
.photo-grid { column-count: 2; column-gap: 0.625rem; }
@media (min-width: 640px)  { .photo-grid { column-count: 3; } }
@media (min-width: 1024px) { .photo-grid { column-count: 4; column-gap: 0.875rem; } }
@media (min-width: 1400px) { .photo-grid { column-count: 5; } }

.photo-item {
  position: relative;
  display: block;
  width: 100%;
  margin-bottom: 0.625rem;
  break-inside: avoid;
  border-radius: 10px;
  overflow: hidden;
  background-color: rgb(var(--canvas));
  border: 1px solid rgb(var(--border));
}
@media (min-width: 1024px) { .photo-item { margin-bottom: 0.875rem; } }
.photo-item img { display: block; width: 100%; height: auto; transition: transform 200ms ease; }
.photo-item:hover img { transform: scale(1.03); }

.photo-item-select {
  position: absolute;
  top: 0.4rem;
  left: 0.4rem;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 1.5px solid rgb(255 255 255 / 0.85);
  background-color: rgb(0 0 0 / 0.25);
  display: none;
  align-items: center;
  justify-content: center;
  color: transparent;
  transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease;
}
.photo-item-select i { width: 14px; height: 14px; }
.photo-grid.select-mode .photo-item-select { display: flex; }
.photo-item[data-selected="true"] .photo-item-select {
  background-color: rgb(var(--accent));
  border-color: rgb(var(--accent));
  color: white;
}
.photo-item[data-selected="true"] { outline: 2px solid rgb(var(--accent)); outline-offset: -2px; }

.photo-item-fav {
  position: absolute;
  bottom: 0.4rem;
  right: 0.4rem;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background-color: rgb(0 0 0 / 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgb(var(--danger));
}
.photo-item-fav i { width: 13px; height: 13px; }

/* --------------------------------------------------------------------
   Barre de sélection (sticky bottom, mobile-first)
   -------------------------------------------------------------------- */
.selection-bar {
  position: fixed;
  left: 0.75rem;
  right: 0.75rem;
  bottom: calc(0.75rem + env(safe-area-inset-bottom, 0));
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.625rem 0.75rem;
  border-radius: 14px;
  background-color: rgb(var(--text-primary));
  color: rgb(var(--canvas));
  box-shadow: 0 10px 30px rgb(var(--shadow-color) / 0.25);
}
.selection-count { display: inline-flex; align-items: center; gap: 0.4rem; min-width: 0; font-size: 0.8125rem; font-weight: 500; white-space: nowrap; }
.selection-count-num {
  min-width: 1.75rem; height: 1.75rem; padding: 0 0.4rem; border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center;
  background-color: rgb(var(--accent)); color: rgb(var(--accent-contrast));
  font-weight: 600; font-variant-numeric: tabular-nums;
}
.selection-actions { display: flex; align-items: center; gap: 0.125rem; flex-shrink: 0; }
.selection-bar .btn-icon { color: rgb(var(--canvas)); }
.selection-bar .btn-icon:hover { background-color: rgb(255 255 255 / 0.12); }
.selection-bar .btn-ghost { color: rgb(var(--canvas)); }
/* Bouton texte + icône compact (« Tout », « Annuler ») */
.selection-tool {
  display: inline-flex; align-items: center; gap: 0.35rem; height: 2.25rem; padding: 0 0.6rem;
  border-radius: 8px; font-size: 0.8125rem; font-weight: 500; color: rgb(var(--canvas));
  white-space: nowrap;
}
.selection-tool:hover { background-color: rgb(255 255 255 / 0.12); }
.selection-tool svg, .selection-tool i { width: 1rem; height: 1rem; flex-shrink: 0; }
.selection-tool[aria-pressed="true"] { background-color: rgb(255 255 255 / 0.16); }
/* Rien de sélectionné : les actions sur la sélection sont inactives */
.selection-bar[data-empty] .selection-action { opacity: 0.4; pointer-events: none; }
/* Mobile : au-dessus de la barre de navigation, libellés réduits au strict nécessaire */
@media (max-width: 1023px) {
  .selection-bar { bottom: calc(4.5rem + env(safe-area-inset-bottom, 0)); padding: 0.5rem 0.5rem 0.5rem 0.625rem; gap: 0.5rem; }
}
@media (max-width: 639px) {
  .selection-count-label { display: none; }
  .selection-tool { padding: 0 0.5rem; }
  #btn-cancel-select .selection-tool-label { display: none; }
}
@media (max-width: 379px) {
  .selection-tool-label { display: none; }
}
@media (min-width: 1024px) {
  .selection-bar { left: calc(var(--sidebar-w) + 1.5rem); right: 1.5rem; }
}

/* --------------------------------------------------------------------
   Lightbox plein écran
   -------------------------------------------------------------------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 70;
  background-color: rgb(10 10 10 / 0.96);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
#lightbox-image { max-width: min(92vw, 1100px); max-height: 78vh; object-fit: contain; border-radius: 6px; }
.lightbox-close {
  position: absolute; top: 1rem; right: 1rem;
  width: 2.5rem; height: 2.5rem; border-radius: 999px;
  background-color: rgb(255 255 255 / 0.1); color: white;
  display: flex; align-items: center; justify-content: center;
}
.lightbox-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 2.75rem; height: 2.75rem; border-radius: 999px;
  background-color: rgb(255 255 255 / 0.1); color: white;
  display: flex; align-items: center; justify-content: center;
}
.lightbox-prev { left: 0.75rem; }
.lightbox-next { right: 0.75rem; }
@media (min-width: 640px) {
  .lightbox-prev { left: 1.5rem; }
  .lightbox-next { right: 1.5rem; }
}
.lightbox-footer {
  position: absolute; bottom: 1rem; left: 1rem; right: 1rem;
  display: flex; align-items: center; justify-content: space-between; color: white;
}
.lightbox-counter { font-size: 0.8125rem; color: rgb(255 255 255 / 0.75); }
.lightbox-actions { display: flex; align-items: center; gap: 0.375rem; }
.lightbox-actions .btn-icon { color: white; }
.lightbox-actions .btn-icon:hover { background-color: rgb(255 255 255 / 0.12); }

/* --------------------------------------------------------------------
   Modal de partage (feuille mobile / carte centrée desktop)
   -------------------------------------------------------------------- */
.modal-overlay { position: fixed; inset: 0; z-index: 80; background-color: rgb(0 0 0 / 0.5); }
.modal {
  position: fixed;
  z-index: 90;
  background-color: rgb(var(--surface));
  border: 1px solid rgb(var(--border));
  width: 100%;
  left: 0; right: 0; bottom: 0;
  border-radius: 18px 18px 0 0;
  padding: 1.25rem;
  padding-bottom: calc(1.5rem + env(safe-area-inset-bottom, 0));
}
@media (min-width: 640px) {
  .modal {
    left: 50%; right: auto; bottom: auto; top: 50%;
    transform: translate(-50%, -50%);
    width: 420px;
    border-radius: 16px;
  }
}
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.modal-title { font-size: 1rem; font-weight: 600; }
.share-link-row { display: flex; gap: 0.5rem; }
.share-link-row .input-plain { flex: 1; font-size: 0.8125rem; }
.share-options { margin-top: 1rem; display: flex; flex-direction: column; gap: 0.625rem; }
.share-option { display: flex; align-items: center; gap: 0.625rem; font-size: 0.8125rem; color: rgb(var(--text-primary)); }


/* ==========================================================================
   Liens de partage — à ajouter à la fin de assets/css/app.css
   Dépend des classes .is-hidden et .share-link-row déjà ajoutées via
   galleries.css — vérifie que les deux fichiers sont fusionnés.
   ========================================================================== */

/* --------------------------------------------------------------------
   Table — cellule "lien"
   -------------------------------------------------------------------- */
.share-link-cell { display: flex; align-items: center; gap: 0.4rem; }
.share-link-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.75rem;
  padding: 0.15rem 0.45rem;
  border-radius: 6px;
  background-color: rgb(var(--text-primary) / 0.06);
  color: rgb(var(--text-secondary));
  white-space: nowrap;
}

/* --------------------------------------------------------------------
   Interrupteur (toggle) — options d'accès du formulaire
   -------------------------------------------------------------------- */
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.875rem 1rem;
  border: 1px solid rgb(var(--border));
  border-radius: 10px;
  background-color: rgb(var(--canvas));
}
.toggle-row-label { font-size: 0.8125rem; font-weight: 500; color: rgb(var(--text-primary)); }
.toggle-row-hint { font-size: 0.75rem; color: rgb(var(--text-tertiary)); margin-top: 0.15rem; }

.toggle-switch {
  position: relative;
  display: inline-flex;
  width: 44px;
  height: 26px;
  flex-shrink: 0;
}
.toggle-switch input {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
}
.toggle-switch-track {
  position: absolute;
  inset: 0;
  background-color: rgb(var(--border-strong));
  border-radius: 999px;
  transition: background-color 150ms ease;
}
.toggle-switch-track::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  background-color: white;
  border-radius: 999px;
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.25);
  transition: transform 150ms ease;
}
.toggle-switch input:checked + .toggle-switch-track { background-color: rgb(var(--accent)); }
.toggle-switch input:checked + .toggle-switch-track::after { transform: translateX(18px); }
.toggle-switch input:focus-visible + .toggle-switch-track {
  outline: 2px solid rgb(var(--accent));
  outline-offset: 2px;
}

/* --------------------------------------------------------------------
   Récapitulatif du formulaire (colonne sticky)
   -------------------------------------------------------------------- */
.summary-recap {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-size: 0.8125rem;
  color: rgb(var(--text-secondary));
}
.summary-recap li { display: flex; align-items: center; gap: 0.5rem; }
.summary-recap i { width: 15px; height: 15px; color: rgb(var(--text-tertiary)); flex-shrink: 0; }

/* ==========================================================================
   Médias — à ajouter à la fin de assets/css/app.css
   Dépend de .is-hidden, .share-link-row, .selection-bar, .lightbox,
   .modal / .modal-overlay déjà ajoutés via galleries.css et share-links.css.
   ========================================================================== */

/* --------------------------------------------------------------------
   Barre de stockage (carte stat)
   -------------------------------------------------------------------- */
.storage-bar {
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background-color: rgb(var(--text-primary) / 0.08);
  overflow: hidden;
  margin-top: 0.5rem;
}
.storage-bar-fill {
  height: 100%;
  background-color: rgb(var(--accent));
  border-radius: 999px;
}

/* --------------------------------------------------------------------
   Zone de dépôt (drag & drop)
   -------------------------------------------------------------------- */
.upload-dropzone {
  border: 2px dashed rgb(var(--border-strong));
  border-radius: 14px;
  background-color: rgb(var(--surface));
  transition: border-color 150ms ease, background-color 150ms ease;
}
.upload-dropzone.drag-over {
  border-color: rgb(var(--accent));
  background-color: rgb(var(--accent-soft));
}
.upload-dropzone-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  padding: 1.75rem 1rem;
  text-align: center;
  cursor: pointer;
}
.upload-dropzone-inner i { width: 26px; height: 26px; color: rgb(var(--accent)); }
.upload-dropzone-title { font-size: 0.875rem; font-weight: 600; color: rgb(var(--text-primary)); }
.upload-dropzone-hint { font-size: 0.75rem; color: rgb(var(--text-tertiary)); }
.upload-dropzone-link { color: rgb(var(--accent)); font-weight: 600; text-decoration: underline; }

/* --------------------------------------------------------------------
   Grille médias (masonry, carte avec méta toujours visible)
   -------------------------------------------------------------------- */
.media-grid { column-count: 2; column-gap: 0.625rem; }
@media (min-width: 640px)  { .media-grid { column-count: 3; } }
@media (min-width: 1024px) { .media-grid { column-count: 4; column-gap: 0.875rem; } }
@media (min-width: 1400px) { .media-grid { column-count: 5; } }

.media-item {
  position: relative;
  margin-bottom: 0.625rem;
  break-inside: avoid;
  border-radius: 10px;
  overflow: hidden;
  background-color: rgb(var(--surface));
  border: 1px solid rgb(var(--border));
  transition: outline-color 120ms ease;
}
@media (min-width: 1024px) { .media-item { margin-bottom: 0.875rem; } }
.media-item[data-selected="true"] { outline: 2px solid rgb(var(--accent)); outline-offset: -2px; }

.media-item-preview {
  position: relative;
  display: block;
  width: 100%;
  background-color: rgb(var(--canvas));
}
.media-item-preview img { display: block; width: 100%; height: auto; transition: transform 200ms ease; }
.media-item-preview:hover img { transform: scale(1.03); }

.media-item-select {
  position: absolute;
  top: 0.4rem;
  left: 0.4rem;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 1.5px solid rgb(255 255 255 / 0.85);
  background-color: rgb(0 0 0 / 0.25);
  display: none;
  align-items: center;
  justify-content: center;
  color: transparent;
  transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease;
}
.media-item-select i { width: 14px; height: 14px; }
.media-grid.select-mode .media-item-select { display: flex; }
.media-item[data-selected="true"] .media-item-select {
  background-color: rgb(var(--accent));
  border-color: rgb(var(--accent));
  color: white;
}

.media-item-play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 38px;
  height: 38px;
  border-radius: 999px;
  background-color: rgb(0 0 0 / 0.5);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.media-item-duration {
  position: absolute;
  bottom: 0.4rem;
  right: 0.4rem;
  font-size: 0.6875rem;
  font-weight: 600;
  padding: 0.1rem 0.4rem;
  border-radius: 5px;
  background-color: rgb(0 0 0 / 0.6);
  color: white;
}

.media-item-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.4rem 0.55rem;
  font-size: 0.6875rem;
}
.media-item-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: rgb(var(--text-secondary));
  flex: 1;
  min-width: 0;
}
.media-item-size { color: rgb(var(--text-tertiary)); white-space: nowrap; flex-shrink: 0; }

/* Aperçu local pendant un envoi simulé (démo) */
.media-item-uploading .media-item-preview::after {
  content: '';
  position: absolute;
  inset: 0;
  background-color: rgb(0 0 0 / 0.35);
}
.upload-progress {
  position: absolute;
  left: 0.5rem;
  right: 0.5rem;
  bottom: 0.5rem;
  height: 4px;
  border-radius: 999px;
  background-color: rgb(255 255 255 / 0.35);
  overflow: hidden;
  z-index: 1;
}
.upload-progress-fill {
  height: 100%;
  width: 0%;
  background-color: rgb(var(--accent));
  transition: width 120ms linear;
}

/* --------------------------------------------------------------------
   Lightbox — variante vidéo
   -------------------------------------------------------------------- */
#lightbox-video {
  max-width: min(92vw, 1100px);
  max-height: 78vh;
  border-radius: 6px;
  background-color: black;
}

/* ==========================================================================
   AUTHENTIFICATION
   PhotoManager — Login / Register / Password Reset
   ========================================================================== */


/* --------------------------------------------------------------------------
   Panneau gauche
   -------------------------------------------------------------------------- */

.auth-panel {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  padding: 3rem;
  background-color: rgb(var(--text-primary));
  color: rgb(var(--canvas));
}

.auth-panel-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.auth-logo {
  width: 2.25rem;
  height: 2.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border-radius: 10px;
  background-color: rgb(var(--accent));
  color: rgb(var(--accent-contrast));
}

.auth-logo svg {
  width: 1.2rem;
  height: 1.2rem;
}

.auth-panel-title {
  max-width: 560px;
  margin-top: 5rem;
  font-size: clamp(2rem, 3vw, 3rem);
  line-height: 1.08;
  font-weight: 600;
  letter-spacing: -0.035em;
}

.auth-panel-text {
  max-width: 500px;
  margin-top: 1.25rem;
  font-size: 0.95rem;
  line-height: 1.7;
  color: rgb(var(--canvas) / 0.68);
}

.auth-panel-features {
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
  margin-top: 2rem;
}

.auth-panel-feature {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.8125rem;
  color: rgb(var(--canvas) / 0.82);
}

.auth-panel-feature svg {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
  color: rgb(var(--accent));
}

.auth-panel-footer {
  margin-top: 2rem;
  font-size: 0.6875rem;
  color: rgb(var(--canvas) / 0.45);
}

/* --------------------------------------------------------------------------
   Zone formulaire
   -------------------------------------------------------------------------- */

.auth-content {
  position: relative;
  min-width: 0;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background-color: rgb(var(--canvas));
}

.auth-card {
  width: 100%;
  max-width: 420px;
}

.auth-card-brand-mobile {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 2rem;
  font-size: 1rem;
  font-weight: 600;
  color: rgb(var(--text-primary));
}

.auth-card-brand-mobile .auth-logo {
  width: 2rem;
  height: 2rem;
}

/* --------------------------------------------------------------------------
   Bouton thème
   -------------------------------------------------------------------------- */

.auth-theme-toggle {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;

  width: 2.25rem;
  height: 2.25rem;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  border: 1px solid rgb(var(--border));
  border-radius: 8px;

  background-color: rgb(var(--surface));
  color: rgb(var(--text-secondary));

  cursor: pointer;

  transition:
    background-color 120ms ease,
    border-color 120ms ease,
    color 120ms ease;
}

.auth-theme-toggle:hover {
  background-color: rgb(var(--text-primary) / 0.05);
  color: rgb(var(--text-primary));
}

.auth-theme-toggle svg {
  width: 1rem;
  height: 1rem;
}

/* --------------------------------------------------------------------------
   Titres
   -------------------------------------------------------------------------- */

.auth-title {
  margin: 0;
  font-size: 1.5rem;
  line-height: 1.25;
  font-weight: 600;
  letter-spacing: -0.025em;
  color: rgb(var(--text-primary));
}

.auth-subtitle {
  margin-top: 0.5rem;
  margin-bottom: 1.75rem;
  font-size: 0.875rem;
  line-height: 1.5;
  color: rgb(var(--text-secondary));
}

/* --------------------------------------------------------------------------
   Statut formulaire
   -------------------------------------------------------------------------- */

.form-status {
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;

  margin-bottom: 1rem;
  padding: 0.75rem;

  border-radius: 8px;

  font-size: 0.8125rem;
  line-height: 1.4;
}

.form-status svg {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
  margin-top: 0.05rem;
}

.form-status-success {
  background-color: rgb(var(--success-soft));
  color: rgb(var(--success));
}

/* --------------------------------------------------------------------------
   Password input
   -------------------------------------------------------------------------- */

.input-with-toggle {
  padding-right: 2.75rem;
}

.password-toggle-btn {
  position: absolute;
  top: 50%;
  right: 0.625rem;
  transform: translateY(-50%);

  width: 2rem;
  height: 2rem;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  border-radius: 6px;

  color: rgb(var(--text-tertiary));

  cursor: pointer;

  transition:
    background-color 120ms ease,
    color 120ms ease;
}

.password-toggle-btn:hover {
  background-color: rgb(var(--text-primary) / 0.05);
  color: rgb(var(--text-primary));
}

.password-toggle-btn svg {
  width: 1rem;
  height: 1rem;
}

/* --------------------------------------------------------------------------
   Checkbox / options
   -------------------------------------------------------------------------- */

.share-option {
  display: flex;
  align-items: center;
  gap: 0.625rem;

  font-size: 0.8125rem;
  color: rgb(var(--text-secondary));

  cursor: pointer;
}

.share-option input {
  width: 1rem;
  height: 1rem;

  margin: 0;

  accent-color: rgb(var(--accent));

  cursor: pointer;
}

/* --------------------------------------------------------------------------
   Lien footer
   -------------------------------------------------------------------------- */

.auth-footer-link {
  margin-top: 1.5rem;

  text-align: center;

  font-size: 0.8125rem;
  color: rgb(var(--text-secondary));
}

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

.auth-footer-link a:hover {
  color: rgb(var(--accent-hover));
  text-decoration: underline;
}

/* --------------------------------------------------------------------------
   Responsive desktop
   -------------------------------------------------------------------------- */

@media (min-width: 1024px) {
  .auth-shell {
    grid-template-columns: minmax(360px, 0.9fr) minmax(520px, 1.1fr);
  }

  .auth-panel {
    display: flex;
  }

  .auth-content {
    padding: 3rem;
  }

  .auth-card-brand-mobile {
    display: none;
  }
}

/* --------------------------------------------------------------------------
   Petit écran
   -------------------------------------------------------------------------- */

@media (max-width: 639px) {
  .auth-content {
    align-items: flex-start;
    padding-top: 5rem;
  }

  .auth-card {
    max-width: 100%;
  }

  .auth-title {
    font-size: 1.375rem;
  }

  .auth-theme-toggle {
    top: 1rem;
    right: 1rem;
  }
}

.btn-spinner {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
  animation: btn-spin 0.6s linear infinite;
}
@keyframes btn-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
button[aria-busy="true"] {
  cursor: progress;
}

/* Toasts */
.toast-region {
    position: fixed; top: 4.5rem; right: 1rem; z-index: 70;
    display: flex; flex-direction: column; gap: .5rem;
    width: min(24rem, calc(100vw - 2rem)); pointer-events: none;
}
.toast {
    pointer-events: auto; cursor: pointer; padding: .75rem 1rem; font-size: .875rem;
    border-left: 3px solid rgb(var(--success));
    opacity: 0; transform: translateY(-8px);
    transition: opacity .2s ease, transform .2s ease;
}
.toast.is-visible { opacity: 1; transform: none; }
.toast-error { border-left-color: rgb(var(--danger)); }

/* Panneau de téléversement */
.upload-panel {
    position: fixed; right: 1rem; bottom: 1rem; z-index: 60;
    width: min(22rem, calc(100vw - 2rem)); padding: .75rem;
}
@media (max-width: 1023px) { .upload-panel { bottom: 5rem; } } /* au-dessus de la nav mobile */

.upload-panel-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: .5rem; }
.upload-panel-title { font-size: .875rem; font-weight: 600; }
.upload-panel-list { margin-top: .75rem; max-height: 14rem; overflow-y: auto; display: flex; flex-direction: column; gap: .75rem; }

.upload-panel-overall, .upload-row-bar {
    height: 4px; border-radius: 9999px; overflow: hidden;
    background: rgb(var(--text-primary) / 0.08);
}
.upload-panel-overall-fill, .upload-row-fill {
    height: 100%; width: 0; background: rgb(var(--accent)); transition: width .15s linear;
}
.upload-row-head { display: flex; justify-content: space-between; gap: .75rem; font-size: .75rem; margin-bottom: .25rem; }
.upload-row-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upload-row-status { flex-shrink: 0; color: rgb(var(--text-secondary)); }
.upload-row-msg { margin-top: .25rem; font-size: .75rem; color: rgb(var(--danger)); }
.upload-row-msg:empty { display: none; }
.upload-row.is-done .upload-row-fill { background: rgb(var(--success)); }
.upload-row.is-done .upload-row-status { color: rgb(var(--success)); }
.upload-row.is-error .upload-row-fill { background: rgb(var(--danger)); }
.upload-row.is-error .upload-row-status { color: rgb(var(--danger)); }

/* ==========================================================================
   Pages d'erreur — à ajouter à la fin de assets/css/app.css
   Dépend des classes .auth-content, .auth-logo, .auth-theme-toggle, .btn-*
   ========================================================================== */

.error-card {
  width: 100%;
  max-width: 480px;
  text-align: center;
}

.error-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  margin-bottom: 2.5rem;
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: rgb(var(--text-primary));
}
.error-brand .auth-logo { width: 2rem; height: 2rem; }

/* Pictogramme : anneau "diaphragme" + pastille d'icône */
.error-visual {
  position: relative;
  width: 7rem;
  height: 7rem;
  margin: 0 auto 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.error-visual-ring {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  border: 1.5px dashed rgb(var(--border-strong));
  animation: error-ring-spin 28s linear infinite;
}
.error-visual-core {
  width: 4.5rem;
  height: 4.5rem;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgb(var(--accent-soft));
  color: rgb(var(--accent));
}
.error-visual-core svg { width: 2rem; height: 2rem; }
@keyframes error-ring-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

.error-code {
  font-size: clamp(3.5rem, 12vw, 5.5rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.045em;
  font-variant-numeric: tabular-nums;
  color: rgb(var(--text-primary));
}
.error-title {
  margin-top: 0.75rem;
  font-size: 1.375rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: rgb(var(--text-primary));
}
.error-message {
  max-width: 400px;
  margin: 0.625rem auto 0;
  font-size: 0.9375rem;
  line-height: 1.6;
  color: rgb(var(--text-secondary));
}
.error-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.625rem;
  margin-top: 1.75rem;
}
.error-actions .btn { padding: 0.625rem 1.125rem; }
.error-meta {
  margin-top: 2rem;
  font-size: 0.75rem;
  color: rgb(var(--text-tertiary));
}