/* ============================================================
   MATHU Benin — PWA Global Styles
   Design System v2.0 — Mobile-first
   ============================================================ */

/* ── BOUTONS ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  min-height: var(--touch-min);
  padding: var(--sp-3) var(--sp-4);
  font-family: var(--font);
  font-size: var(--text-base);
  font-weight: 600;
  line-height: 1;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition);
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}
.btn svg { flex-shrink: 0; }

.btn-primary {
  width: 100%;
  min-height: var(--input-h);
  padding: var(--sp-3) var(--sp-5);
  background: var(--primary, var(--accent));
  color: white;
  font-family: var(--font-display);
  font-size: var(--text-base);
  font-weight: 700;
  border: none;
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--transition);
  box-shadow: var(--shadow-accent-sm);
}
.btn-primary:hover { background: var(--primary-hover, var(--accent-hover)); box-shadow: var(--shadow-accent); }
.btn-primary:active { transform: scale(0.98); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-secondary {
  width: 100%;
  min-height: var(--touch-min);
  padding: var(--sp-3) var(--sp-5);
  background: var(--surface);
  color: var(--text);
  font-size: var(--text-base);
  font-weight: 600;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--transition);
  box-shadow: var(--shadow-xs, none);
}
.btn-secondary:hover { border-color: var(--primary, var(--accent)); color: var(--primary, var(--accent)); }

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: none;
  padding: var(--sp-2);
  min-height: var(--touch-min);
  min-width: var(--touch-min);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
}
.btn-ghost:hover { background: var(--surface2); color: var(--text); }

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--touch-min);
  height: var(--touch-min);
  background: none;
  border: none;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
  padding: 0;
}
.btn-icon:hover { background: var(--surface2); color: var(--text); }

.btn-accent {
  width: 100%;
  min-height: var(--touch-min);
  padding: var(--sp-3) var(--sp-5);
  background: var(--secondary);
  color: white;
  font-size: var(--text-base);
  font-weight: 600;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background var(--transition);
}
.btn-accent:hover { background: var(--secondary-hover); }

/* ── CHAMPS FORMULAIRE ── */
.field {
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
}
.field label {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
}
.field input,
.field select,
.field textarea {
  min-height: var(--input-h);
  padding: var(--sp-3) var(--sp-4);
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  transition: border-color var(--transition), box-shadow var(--transition);
  -webkit-appearance: none;
  appearance: none;
  box-shadow: var(--shadow-xs, none);
}
.field input:hover,
.field select:hover { border-color: var(--border-hover); }
.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--primary, var(--accent));
  box-shadow: 0 0 0 3px var(--focus-ring);
  outline: none;
}
.field input::placeholder,
.field textarea::placeholder {
  color: var(--text-muted);
}
.field input:disabled,
.field select:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: var(--bg);
}
.field select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%237A6090' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--sp-3) center;
  padding-right: var(--sp-8);
}
.field .field-error {
  font-size: var(--text-xs);
  color: var(--danger);
  display: flex;
  align-items: center;
  gap: var(--sp-1);
  min-height: 18px;
}
.field .field-hint {
  font-size: var(--text-xs);
  color: var(--muted);
  margin-top: 4px;
}
.field.has-error input,
.field.has-error select {
  border-color: var(--danger);
}
.field.readonly input {
  background: var(--bg);
  color: var(--text-muted);
  border-color: transparent;
}

/* ── ERREURS & MESSAGES ── */
.error-msg {
  background: var(--danger-bg);
  border: 1px solid var(--danger);
  color: var(--danger);
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

/* ── HEADER ── */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-3) var(--sp-4);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  min-height: 56px;
  overflow: hidden;
}
.app-header h2 {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.btn-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--touch-min);
  height: var(--touch-min);
  background: none;
  border: none;
  color: var(--text);
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: background var(--transition);
}
.btn-back:hover { background: var(--surface2); }

/* ── GRILLES ── */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-3);
}
.col-span-2 { grid-column: span 2; }

@media (max-width: 414px) {
  .grid-2 { grid-template-columns: 1fr; }
  .col-span-2 { grid-column: span 1; }
}

/* ── LOGIN ── */
.login-screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  position: relative;
  overflow: hidden;
}
.login-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 120% 60% at 50% 0%, #3D1260 0%, transparent 70%),
    radial-gradient(ellipse 80% 50% at 80% 100%, rgba(232,149,10,0.15) 0%, transparent 60%),
    linear-gradient(180deg, #1A0A2E 0%, #2D1F5E 35%, #F4F1FA 35%);
  z-index: 0;
}
[data-theme="dark"] .login-bg {
  background:
    radial-gradient(ellipse 120% 60% at 50% 0%, #3D1260 0%, transparent 70%),
    radial-gradient(ellipse 80% 50% at 80% 100%, rgba(232,149,10,0.1) 0%, transparent 60%),
    linear-gradient(180deg, #0C0919 0%, #1C1535 35%, #0C0919 35%);
}
.login-container {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--sp-6) var(--sp-5);
  gap: var(--sp-5);
}

/* Hero — Logo */
.login-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-3);
  animation: loginFadeDown 0.6s ease-out;
}
@keyframes loginFadeDown {
  from { opacity: 0; transform: translateY(-16px); }
  to   { opacity: 1; transform: translateY(0); }
}
.login-logo-wrap {
  width: min(280px, 70vw);
  padding: var(--sp-4) var(--sp-5);
  background: rgba(255,255,255,0.08);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,0.12);
  display: flex;
  align-items: center;
  justify-content: center;
}
.login-logo-img {
  width: 100%;
  height: auto;
  max-height: 72px;
  object-fit: contain;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.3));
}
.login-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.5px;
  margin: 0;
}
.login-tagline {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  color: rgba(255,255,255,0.7);
  letter-spacing: 0.5px;
}
.login-sbee-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  background: rgba(232,149,10,0.2);
  border: 1px solid rgba(232,149,10,0.3);
  border-radius: 20px;
  color: #F7B731;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

/* Card connexion */
.login-card {
  background: var(--surface);
  border-radius: 24px;
  padding: var(--sp-6) var(--sp-6);
  border: 1px solid var(--border);
  width: 100%;
  max-width: 380px;
  box-shadow: var(--shadow-xl);
  animation: loginCardUp 0.5s ease-out 0.15s both;
}
@keyframes loginCardUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
[data-theme="dark"] .login-card {
  box-shadow: var(--shadow-xl);
  border-color: rgba(255,255,255,0.06);
}
.login-card-header {
  text-align: center;
  margin-bottom: var(--sp-6);
}
.login-card-header h2 {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.4px;
}
.login-card-header p {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Champs login */
.login-field {
  margin-bottom: var(--sp-4);
}
.login-field label {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.login-field-icon {
  display: inline-flex;
  color: var(--secondary);
}
.login-field input {
  width: 100%;
  height: 50px;
  padding: 0 16px;
  background: var(--bg);
  border: 2px solid var(--border);
  border-radius: 14px;
  font-family: var(--font);
  font-size: 16px !important;
  color: var(--text);
  transition: border-color var(--transition), box-shadow var(--transition);
  -webkit-appearance: none;
  appearance: none;
}
.login-field input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--focus-ring);
  outline: none;
}
.login-field input::placeholder {
  color: var(--text-muted);
  font-size: 14px !important;
}
.login-field.has-error input {
  border-color: var(--danger);
  box-shadow: var(--focus-ring-danger);
}
.login-pass-wrap {
  position: relative;
}
.login-pass-wrap input {
  padding-right: 52px;
}
.login-pass-toggle {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 10px;
  transition: color var(--transition);
}
.login-pass-toggle:hover {
  color: var(--text);
}

/* Erreur login */
.login-error {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-4);
  background: var(--danger-bg);
  border: 1px solid var(--danger-border);
  border-radius: 12px;
  margin-bottom: var(--sp-4);
  animation: shakeX 0.4s ease;
}
.login-error-icon {
  display: inline-flex;
  color: var(--danger);
  flex-shrink: 0;
}
.login-error span:last-child {
  font-size: 13px;
  font-weight: 500;
  color: var(--danger);
}
@keyframes shakeX {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

/* Bouton connexion */
.login-submit {
  width: 100%;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-3);
  background: linear-gradient(135deg, #E8950A 0%, #D4880A 100%);
  color: #fff;
  border: none;
  border-radius: 14px;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: transform var(--transition-fast), box-shadow var(--transition);
  box-shadow: var(--shadow-accent);
  -webkit-tap-highlight-color: transparent;
}
.login-submit:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-accent-lg);
}
.login-submit:active {
  transform: translateY(0) scale(0.98);
}
.login-submit:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

/* Footer */
.login-footer {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: 11px;
  color: var(--text-muted);
  animation: loginCardUp 0.5s ease-out 0.3s both;
}
.login-footer-dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--text-muted);
}

/* ── DASHBOARD ── */
.dash-screen {
  position: relative;
  padding-bottom: 68px;
}
.dash-header {
  background: linear-gradient(135deg, #1A0A2E 0%, #2D1854 60%, #3D1260 100%);
  padding: var(--sp-5) var(--sp-4) var(--sp-4);
  border-bottom: none;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  min-height: 80px;
  border-radius: 0 0 20px 20px;
}
.dash-header-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.dash-header-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.dash-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  margin-top: 4px;
  background: rgba(232,149,10,0.2);
  color: #F7B731;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 20px;
  font-family: var(--font-display);
  width: fit-content;
}
.dash-profile-btn {
  width: var(--touch-min);
  height: var(--touch-min);
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(232,149,10,0.2);
  border: 1.5px solid rgba(232,149,10,0.3);
  border-radius: 12px;
  cursor: pointer;
  color: #F7B731;
  transition: background var(--transition);
}
.dash-profile-btn:active { background: rgba(232,149,10,0.3); }

/* Network bar */
.network-bar {
  width: 100%;
  padding: 6px var(--sp-4);
  background: var(--success-bg);
  color: var(--success);
  font-size: 11px;
  font-weight: 600;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  transition: background var(--transition-slow), color var(--transition-slow);
}
.network-bar.offline {
  background: var(--danger-bg);
  color: var(--danger);
}

/* Dashboard content */
.dash-content {
  padding: var(--sp-4);
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* KPI Grid */
.dash-kpi-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-3);
  margin-bottom: var(--sp-4);
}
.dash-kpi {
  background: var(--surface);
  border-radius: 16px;
  padding: var(--sp-4);
  border: 1px solid var(--border);
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-fast);
}
.dash-kpi:active { transform: scale(0.97); }
.dash-kpi::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
}
.dash-kpi.orange::before { background: var(--orange, #E8950A); }
.dash-kpi.violet::before { background: #5B1E8A; }
.dash-kpi.blue::before   { background: #1E40AF; }
.dash-kpi.green::before  { background: var(--success); }
.dash-kpi-value {
  display: block;
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -1px;
  line-height: 1;
}
.dash-kpi-label {
  display: block;
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  font-weight: 600;
  margin-top: 4px;
}
.dash-kpi-icon {
  position: absolute;
  bottom: 12px; right: 12px;
  width: 30px; height: 30px;
  background: var(--bg);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
}

/* CTA Button */
.dash-btn-new {
  width: 100%;
  height: 54px;
  border: none;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--orange) 0%, var(--orange-dark) 100%);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-3);
  box-shadow: var(--shadow-accent);
  margin-bottom: var(--sp-3);
  transition: transform var(--transition-fast), box-shadow var(--transition);
  -webkit-tap-highlight-color: transparent;
}
.dash-btn-new:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-accent-lg);
}
.dash-btn-new:active {
  transform: scale(0.98);
}
.dash-btn-new-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px; height: 28px;
  background: rgba(255,255,255,0.2);
  border-radius: 8px;
}

/* Secondary actions */
.dash-actions-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-3);
  margin-bottom: var(--sp-5);
}
.dash-btn-sec {
  height: 46px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 14px;
  color: var(--text);
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  transition: border-color var(--transition), background var(--transition);
  -webkit-tap-highlight-color: transparent;
}
.dash-btn-sec:hover { border-color: var(--primary); }
.dash-btn-sec:active { background: var(--bg); }

/* Section title */
.dash-section { margin-bottom: var(--sp-4); }
.dash-section-title {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -0.2px;
  color: var(--text);
  margin-bottom: var(--sp-3);
}

/* Recent fiches list */
.dash-recent-list {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}
.dash-empty {
  text-align: center;
  padding: var(--sp-6) var(--sp-4);
  color: var(--muted);
  font-size: 12px;
}
.dash-fiche-item {
  background: var(--surface);
  border-radius: 14px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  transition: background var(--transition-fast);
  box-shadow: var(--shadow-xs);
}
.dash-fiche-item:active { background: var(--surface-hover); }
.dash-fiche-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.dash-fiche-dot.synced  { background: var(--success); }
.dash-fiche-dot.pending { background: var(--warning); }
.dash-fiche-dot.syncing { background: var(--info); }
.dash-fiche-dot.error   { background: var(--danger); }
.dash-fiche-info {
  flex: 1;
  min-width: 0;
}
.dash-fiche-ref {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dash-fiche-abonne {
  font-size: 10px;
  color: var(--muted);
  margin-top: 1px;
}
.dash-fiche-tag {
  font-size: 9px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 20px;
  white-space: nowrap;
}
.dash-fiche-tag.synced  { background: var(--success-bg); color: var(--success); }
.dash-fiche-tag.pending { background: var(--warning-bg); color: var(--warning); }
.dash-fiche-tag.syncing { background: var(--info-bg);    color: var(--info); }
.dash-fiche-tag.error   { background: var(--danger-bg);  color: var(--danger); }

/* Bottom Navigation */
.dash-bottom-nav {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 68px;
  background: var(--surface);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 0 8px;
  padding-bottom: env(safe-area-inset-bottom);
  z-index: 10;
}
.dash-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px 12px;
  -webkit-tap-highlight-color: transparent;
}
.dash-nav-icon {
  width: 28px; height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  color: var(--muted);
  transition: background var(--transition), color var(--transition);
}
.dash-nav-item.active .dash-nav-icon {
  background: var(--orange-light);
  color: var(--orange-dark);
}
.dash-nav-label {
  font-size: 9px;
  font-weight: 600;
  color: var(--muted);
}
.dash-nav-item.active .dash-nav-label {
  color: var(--orange-dark);
}

/* Bandeau sync */
.sync-banner {
  background: var(--orange-light, #FEF3D7);
  border: 1px solid rgba(232,149,10,0.2);
  border-radius: 10px;
  padding: var(--sp-2) var(--sp-3);
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  margin-bottom: var(--sp-3);
  color: var(--orange-dark, #B56B08);
}
.sync-text {
  font-size: 11px;
  font-weight: 600;
  flex: 1;
}

/* Actions */
.actions {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

/* ── FORMULAIRE 4 BLOCS ── */
.form-screen {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 0;
  position: relative;
}

/* ── Form Header (prototype) ── */
.form-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-6) var(--sp-4) var(--sp-3);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}
.form-header-left {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  min-width: 0;
  flex: 1;
}
.form-header-text {
  min-width: 0;
}
.form-header .btn-back {
  width: var(--touch-min);
  height: var(--touch-min);
  min-width: var(--touch-min);
  background: var(--bg);
  border: none;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  cursor: pointer;
  transition: background var(--transition);
}
.form-header .btn-back:hover {
  background: var(--bg-secondary);
}
.form-header-text h2 {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.3px;
  color: var(--text);
  line-height: 1.2;
  margin: 0;
}
.form-header-subtitle {
  font-size: 10px;
  color: var(--muted);
  line-height: 1.3;
}
.form-step-count {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  flex-shrink: 0;
  margin-left: var(--sp-2);
}

/* ── Step Indicator (4 bars — recap shares bar 4) ── */
.step-indicator {
  display: flex;
  gap: var(--sp-1);
  padding: var(--sp-2) var(--sp-4);
  background: var(--surface);
}
.step-bar {
  flex: 1;
  height: 3px;
  border-radius: 2px;
  transition: background var(--transition);
}
.step-bar.step-done {
  background: var(--orange, #E8950A);
}
.step-bar.step-active {
  background: var(--secondary, #5B1E8A);
}
.step-bar.step-pending {
  background: var(--border);
}

.form-content {
  padding: var(--sp-3);
}
.form-bloc {
  background: var(--surface);
  border-radius: var(--radius-xl);
  padding: var(--sp-5);
  margin-bottom: var(--sp-3);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.form-bloc-title {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: 10px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: var(--sp-3);
  padding-bottom: var(--sp-2);
  border-bottom: 1px solid var(--border);
}
.bloc-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}
.bloc-dot.violet { background: var(--secondary); }
.bloc-dot.orange { background: var(--accent); }
.bloc-dot.blue   { background: #1E40AF; }
.bloc-dot.green  { background: var(--success); }

/* Form field spacing */
.form-field-gap { margin-top: var(--sp-3); }

/* Form bottom spacer */
.form-bottom-spacer { height: 80px; }

/* Branch button icon */
.branch-icon {
  display: inline-flex;
  color: var(--muted);
  transition: color var(--transition);
}
.btn-branch.active .branch-icon { color: var(--orange, #E8950A); }

/* Scanner button */
.input-group {
  display: flex;
  gap: var(--sp-2);
}
.input-group input { flex: 1; }
.btn-scan {
  min-height: var(--input-h);
  padding: var(--sp-3) var(--sp-4);
  background: var(--secondary);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  transition: background var(--transition);
}
.btn-scan:hover { background: var(--secondary-hover); }

/* Photo zone */
.photo-zone {
  border: 2px dashed var(--border-hover);
  border-radius: var(--radius-lg);
  min-height: 90px;
  height: clamp(90px, 20vh, 120px);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: var(--sp-2);
  cursor: pointer;
  color: var(--text-muted);
  font-size: var(--text-sm);
  transition: border-color var(--transition);
  overflow: hidden;
}
.photo-zone:active { border-color: var(--accent); }
.photo-zone img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: calc(var(--radius-lg) - 2px);
}
.photo-zone.has-photo {
  border-style: solid;
  border-color: var(--success);
}
.gps-info {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-3);
  background: var(--success-bg);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  color: var(--success);
  margin-top: var(--sp-2);
}

/* Type branchement */
.branchement-selector {
  margin-top: var(--sp-3);
}
.branchement-selector > label {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: block;
  margin-bottom: var(--sp-2);
}
.btn-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-2);
}
.btn-branch {
  min-height: 56px;
  padding: var(--sp-2) var(--sp-3);
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  font-size: var(--text-sm);
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: all var(--transition);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
}
.btn-branch:hover { border-color: var(--border-hover); }
.btn-branch.active {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}
.btn-branch .branch-label {
  font-family: var(--font-display);
  font-size: var(--text-base);
  font-weight: 700;
}
.btn-branch .branch-sub {
  font-size: 10px;
  color: var(--muted);
}
.btn-branch.active .branch-label { color: #fff; }
.btn-branch.active .branch-sub { color: rgba(255,255,255,0.8); }

/* Submit */
.form-submit-area {
  padding: var(--sp-3) var(--sp-3) var(--sp-6);
}

/* ── Fixed Submit Bar ── */
.form-submit-bar {
  position: sticky;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 10px 14px 16px;
  background: linear-gradient(0deg, var(--surface) 80%, transparent);
  z-index: 50;
}
.btn-submit-gradient {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  width: 100%;
  height: 48px;
  border: none;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--orange, #E8950A), var(--primary-dark, #A86D08));
  color: #FFFFFF;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity var(--transition), transform var(--transition);
  box-shadow: var(--shadow-accent);
}
.btn-submit-gradient:hover {
  opacity: 0.92;
}
.btn-submit-gradient:active {
  transform: scale(0.98);
}
.btn-submit-gradient:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
.form-error-banner {
  background: var(--danger-bg);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: var(--danger);
  border-radius: var(--radius-md);
  padding: var(--sp-3) var(--sp-4);
  font-size: var(--text-sm);
  text-align: center;
  margin-bottom: var(--sp-3);
  word-break: break-word;
  overflow-wrap: break-word;
}

/* ── LISTE FICHES ── */
.list-screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0;
  position: relative;
  padding-bottom: 68px;
}
.list-header {
  background: var(--surface);
  padding: var(--sp-6) var(--sp-4) var(--sp-3);
  border-bottom: 1px solid var(--border);
}
.list-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--sp-3);
}
.list-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.4px;
  margin: 0;
}
.list-filter-btn {
  width: var(--touch-min);
  height: var(--touch-min);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  color: var(--muted);
  transition: border-color var(--transition);
}
.list-filter-btn:active { border-color: var(--primary); }
.search-bar {
  height: 40px;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  display: flex;
  align-items: center;
  padding: 0 12px;
  gap: var(--sp-2);
  transition: border-color var(--transition);
}
.search-bar:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--focus-ring);
}
.search-bar-icon { color: var(--muted); flex-shrink: 0; }
.search-bar input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 13px;
  color: var(--text);
  outline: none;
  font-family: var(--font);
}
.search-bar input::placeholder { color: var(--muted); }

/* Scrollable list area */
.list-scroll {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: var(--sp-3) var(--sp-4) var(--sp-4);
}

/* Loading state */
.list-loading {
  display: flex;
  justify-content: center;
  padding: var(--sp-8);
}

/* Items container */
.list-items {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

/* Empty state */
.list-empty {
  text-align: center;
  padding: var(--sp-12) var(--sp-4);
  color: var(--text-muted);
}
.list-empty svg { opacity: 0.3; margin-bottom: var(--sp-3); }
.list-empty p { font-size: 13px; }

/* Footer stats */
.list-footer-stats {
  text-align: center;
  font-size: 11px;
  color: var(--muted);
  padding: 14px 0 4px;
}

/* Pending sync banner */
.list-pending-banner {
  background: var(--orange-light);
  border: 1px solid rgba(232,149,10,0.2);
  border-radius: 12px;
  padding: var(--sp-3) var(--sp-4);
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  margin-bottom: var(--sp-3);
}
.list-pending-icon { color: var(--orange-dark); flex-shrink: 0; }
.list-pending-text {
  flex: 1;
  font-size: 11px;
  font-weight: 600;
  color: var(--orange-dark);
}
.list-pending-link {
  font-size: 10px;
  font-weight: 700;
  color: var(--orange);
  text-decoration: none;
  white-space: nowrap;
  padding: 4px 10px;
  background: rgba(232,149,10,0.15);
  border-radius: 8px;
  transition: background var(--transition-fast);
}
.list-pending-link:active { background: rgba(232,149,10,0.25); }

/* ── Fiche Card (redesigned) ── */
.fiche-card {
  background: var(--surface);
  border-radius: 16px;
  padding: var(--sp-4) var(--sp-4);
  border: 1px solid var(--border);
  display: flex;
  gap: var(--sp-3);
  box-shadow: var(--shadow-xs);
  transition: background var(--transition-fast), border-color var(--transition-fast);
}
.fiche-card:active { background: var(--surface-hover); }
.fiche-card.pending {
  border-color: rgba(232,149,10,0.3);
  background: var(--orange-light);
}
[data-theme="dark"] .fiche-card.pending {
  background: rgba(232,149,10,0.06);
}
.fiche-card.error {
  border-color: rgba(196,40,28,0.3);
  background: var(--danger-bg);
}

/* Left dot indicator */
.fiche-card-left {
  display: flex;
  align-items: flex-start;
  padding-top: 6px;
}
.fiche-card-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 0 3px var(--surface);
}
.fiche-card.pending .fiche-card-dot { box-shadow: 0 0 0 3px var(--orange-light); }
[data-theme="dark"] .fiche-card.pending .fiche-card-dot { box-shadow: 0 0 0 3px rgba(232,149,10,0.06); }
.fiche-card.error .fiche-card-dot { box-shadow: 0 0 0 3px var(--danger-bg); }
.fiche-card-dot.synced  { background: var(--success); }
.fiche-card-dot.pending { background: var(--warning); }
.fiche-card-dot.error   { background: var(--danger); }

/* Card body */
.fiche-card-body {
  flex: 1;
  min-width: 0;
}
.fiche-card-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--sp-2);
  margin-bottom: 4px;
}
.fiche-card-num {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.3px;
}
.fiche-card-date {
  font-size: 10px;
  color: var(--muted);
  white-space: nowrap;
  flex-shrink: 0;
}
.fiche-card-abonne {
  display: flex;
  align-items: center;
  gap: var(--sp-1);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 2px;
}
.fiche-card-abonne svg { color: var(--muted); flex-shrink: 0; }
.fiche-card-ref {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--muted);
  margin-bottom: var(--sp-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Badges row */
.fiche-card-badges {
  display: flex;
  gap: var(--sp-2);
  flex-wrap: wrap;
}
.fiche-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  font-size: 10px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  white-space: nowrap;
  letter-spacing: 0.2px;
}
.fiche-badge svg { flex-shrink: 0; }
.badge-mono {
  background: var(--info-bg);
  color: var(--info);
  border: 1px solid var(--info-border);
}
.badge-tri {
  background: var(--orange-light, #FEF3D7);
  color: var(--orange-dark, #B56B08);
  border: 1px solid rgba(232,149,10,0.25);
}
.badge-synced {
  background: var(--success-bg);
  color: var(--success);
  border: 1px solid var(--success-border);
}
.badge-pending {
  background: var(--warning-bg);
  color: var(--warning);
  border: 1px solid var(--warning-border);
}
.badge-error {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid var(--danger-border);
}

/* ── SCANNER ── */
.scanner-screen {
  flex: 1;
  background: #000;
  display: flex;
  flex-direction: column;
  position: fixed;
  inset: 0;
  z-index: 200;
}
.scan-header {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  padding-top: max(var(--sp-3), env(safe-area-inset-top));
  background: rgba(0,0,0,0.85);
  color: white;
  z-index: 10;
}
.scan-header h2 {
  font-size: var(--text-lg);
  font-weight: 600;
  flex: 1;
}
.btn-cancel-scan,
.btn-torch {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.1);
  color: white;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.btn-torch.torch-active {
  background: var(--accent);
  color: #000;
}
.scan-viewport {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.scan-viewport video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Cadre grand format — coins aux extremites du viewport */
.scan-frame-1d {
  position: absolute;
  inset: var(--sp-6);
  z-index: 5;
}

/* Coins du cadre (orange, plus grands) */
.scan-frame-1d .corner-tl,
.scan-frame-1d .corner-tr,
.scan-frame-1d .corner-bl,
.scan-frame-1d .corner-br {
  position: absolute;
  width: 28px;
  height: 28px;
  border-color: var(--accent);
  border-style: solid;
}
.scan-frame-1d .corner-tl { top: 0; left: 0; border-width: 3px 0 0 3px; }
.scan-frame-1d .corner-tr { top: 0; right: 0; border-width: 3px 3px 0 0; }
.scan-frame-1d .corner-bl { bottom: 0; left: 0; border-width: 0 0 3px 3px; }
.scan-frame-1d .corner-br { bottom: 0; right: 0; border-width: 0 3px 3px 0; }

/* Ligne de scan animee — horizontale au centre */
.scan-line {
  position: absolute;
  left: 8px;
  right: 8px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), var(--accent), transparent);
  box-shadow: 0 0 8px rgba(232,149,10,0.9);
  animation: scanLine 2.5s ease-in-out infinite;
  border-radius: 1px;
}
@keyframes scanLine {
  0%, 100% { top: 40%; opacity: 0.6; }
  50% { top: 60%; opacity: 1; }
}

/* Overlay sombre leger (ne masque pas les coins) */
.scan-viewport::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.15);
  pointer-events: none;
  z-index: 3;
}

.scan-instruction {
  position: absolute;
  bottom: var(--sp-4);
  left: var(--sp-4);
  right: var(--sp-4);
  text-align: center;
  color: rgba(255,255,255,0.85);
  font-size: var(--text-sm);
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--radius-sm);
  z-index: 6;
}
.scan-instruction.scan-error {
  background: rgba(185, 28, 28, 0.85);
  color: white;
}
.scan-instruction.scan-hint {
  background: rgba(247, 162, 0, 0.85);
  color: #000;
  font-weight: 600;
  animation: pulseHint 2s ease-in-out infinite;
}
@keyframes pulseHint {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

/* Footer scanner */
.scan-footer {
  display: flex;
  justify-content: center;
  padding: var(--sp-3) var(--sp-4);
  padding-bottom: max(var(--sp-3), env(safe-area-inset-bottom));
  background: rgba(0,0,0,0.85);
  z-index: 10;
}
.btn-manual-entry {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-4);
  min-height: 44px;
  background: rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.85);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: 500;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.btn-manual-entry:active {
  background: rgba(255,255,255,0.2);
}

/* Modal saisie manuelle */
.manual-modal {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  padding: var(--sp-4);
}
.manual-modal-content {
  background: var(--surface, #1C1135);
  border-radius: var(--radius-lg);
  padding: var(--sp-5);
  width: 100%;
  max-width: 360px;
  color: var(--text, #F5F0FF);
}
.manual-modal-content h3 {
  font-size: var(--text-lg);
  font-weight: 600;
  margin-bottom: var(--sp-2);
}
.manual-modal-content p {
  font-size: var(--text-sm);
  color: var(--muted, #7A6090);
  margin-bottom: var(--sp-4);
  line-height: 1.4;
}
.manual-modal-content input {
  width: 100%;
  padding: var(--sp-3);
  font-size: var(--text-lg);
  font-family: monospace;
  letter-spacing: 1px;
  border: 2px solid var(--muted, #7A6090);
  border-radius: var(--radius-md);
  background: rgba(255,255,255,0.05);
  color: var(--text, #F5F0FF);
  outline: none;
  box-sizing: border-box;
}
.manual-modal-content input:focus {
  border-color: var(--accent);
}
.manual-modal-actions {
  display: flex;
  gap: var(--sp-3);
  margin-top: var(--sp-4);
}
.btn-secondary-sm {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: var(--sp-2) var(--sp-3);
  background: rgba(255,255,255,0.1);
  color: var(--text, #F5F0FF);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: var(--radius-md);
  font-size: var(--text-base);
  font-weight: 600;
  cursor: pointer;
}
.btn-primary-sm {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: var(--sp-2) var(--sp-3);
  background: var(--accent, #F7A200);
  color: #000;
  border: none;
  border-radius: var(--radius-md);
  font-size: var(--text-base);
  font-weight: 600;
  cursor: pointer;
}

/* ── PHOTO (Prototype 7) ── */
.dark-photo { background: #000; }
.photo-screen {
  background: #000;
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  flex-direction: column;
}
.photo-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: max(var(--sp-3), env(safe-area-inset-top)) var(--sp-4) var(--sp-3);
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(8px);
  z-index: 2;
}
.photo-header-left {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}
.photo-gps-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: rgba(13,107,58,0.7);
  color: #6ee7a0;
  font-size: 10px;
  font-weight: 700;
  border-radius: var(--radius-full);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.photo-gps-badge.error {
  background: rgba(239,68,68,0.7);
  color: #fca5a5;
}
.photo-title {
  font-family: var(--font-display);
  font-size: var(--text-base);
  font-weight: 700;
  color: #fff;
}
.btn-close-photo {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 50%;
  color: #fff;
  cursor: pointer;
  transition: background var(--transition);
}
.btn-close-photo:hover { background: rgba(255,255,255,0.2); }

.photo-viewport {
  flex: 1;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.photo-viewport video,
.photo-viewport img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.photo-grid {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.photo-grid .line-h,
.photo-grid .line-v {
  position: absolute;
  background: rgba(255,255,255,0.12);
}
.photo-grid .line-h { left:0; right:0; height:1px; }
.photo-grid .line-h:nth-child(1) { top:33.33%; }
.photo-grid .line-h:nth-child(2) { top:66.66%; }
.photo-grid .line-v { top:0; bottom:0; width:1px; }
.photo-grid .line-v:nth-child(3) { left:33.33%; }
.photo-grid .line-v:nth-child(4) { left:66.66%; }

/* Viewfinder frame — rectangle guide de cadrage */
.photo-viewfinder {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(280px, 70vw);
  height: min(200px, 40vh);
  border: 1.5px solid rgba(255,255,255,0.25);
  border-radius: 8px;
  pointer-events: none;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
}
.viewfinder-label {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.35);
}

/* Crosshair central */
.photo-crosshair {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 40px;
  height: 40px;
  pointer-events: none;
}
.crosshair-h {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: rgba(255,255,255,0.5);
}
.crosshair-v {
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 1px;
  background: rgba(255,255,255,0.5);
}
.crosshair-dot {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(232,149,10,0.9);
  box-shadow: 0 0 6px rgba(232,149,10,0.6);
}

/* Controls v2 (flash / shutter / switch) */
.photo-controls-v2 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-5) var(--sp-8);
  padding-bottom: max(var(--sp-6), env(safe-area-inset-bottom));
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(8px);
}
.btn-photo-action {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 50%;
  color: rgba(255,255,255,0.8);
  cursor: pointer;
  transition: all var(--transition);
}
.btn-photo-action:hover { background: rgba(255,255,255,0.2); }
.btn-photo-action.flash-off {
  opacity: 0.5;
}
.btn-photo-action.flash-off.active {
  opacity: 1;
}
.btn-photo-action.active {
  background: rgba(232,149,10,0.3);
  border-color: var(--orange);
  color: var(--orange);
}
.shutter-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-2);
}
.btn-shutter {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  border: 4px solid white;
  background: transparent;
  cursor: pointer;
  position: relative;
}
.btn-shutter::after {
  content: '';
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  background: white;
  transition: background var(--transition);
}
.btn-shutter:active::after { background: #ccc; }
.btn-shutter:disabled { opacity: 0.4; cursor: not-allowed; }
.shutter-label {
  font-size: 10px;
  color: rgba(255,255,255,0.5);
  text-align: center;
  letter-spacing: 0.3px;
}

/* ── SUCCES ── */
.success-screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative;
  padding-bottom: 68px;
}
.success-scroll {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.success-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: var(--sp-8) var(--sp-5) var(--sp-6);
}

/* ── Animated check ── */
.success-anim {
  position: relative;
  width: 88px;
  height: 88px;
  margin-bottom: var(--sp-5);
}
.success-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 3px solid var(--success);
  animation: successRingIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
.success-ring::after {
  content: '';
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  border: 2px solid var(--success);
  opacity: 0;
  animation: successRipple 1s 0.4s ease-out both;
}
.success-ring.warning {
  border-color: var(--warning);
}
.success-ring.warning::after {
  border-color: var(--warning);
}
@keyframes successRingIn {
  0% { transform: scale(0.3); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}
@keyframes successRipple {
  0% { transform: scale(1); opacity: 0.5; }
  100% { transform: scale(1.4); opacity: 0; }
}
.success-check-icon {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--success);
  animation: successCheckPop 0.4s 0.25s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
.success-check-icon.warning { color: var(--warning); }
@keyframes successCheckPop {
  0% { transform: scale(0); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

/* Titre + subtitle */
.success-page-title {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 800;
  color: var(--text);
  text-align: left;
  width: 100%;
  margin-bottom: var(--sp-4);
}
.success-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 6px;
  letter-spacing: -0.4px;
  text-align: center;
  animation: fadeInUp 0.4s 0.3s ease both;
}
.success-subtitle {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: var(--sp-3);
  text-align: center;
  animation: fadeInUp 0.4s 0.4s ease both;
}
.success-num-ordre {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--success);
  text-align: center;
  margin-bottom: var(--sp-5);
  animation: fadeInUp 0.4s 0.5s ease both;
}
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}


/* ── SUCCESS CARDS ── */
.success-cards {
  width: 100%;
  max-width: 380px;
  margin-bottom: var(--sp-6);
  animation: fadeInUp 0.4s 0.5s ease both;
}
.success-card {
  border-radius: 16px;
  border: 1px solid var(--border);
  overflow: hidden;
  margin-bottom: var(--sp-3);
  box-shadow: var(--shadow-sm);
}
.success-card-head {
  background: var(--bg);
  padding: var(--sp-3) var(--sp-4);
  font-size: 10px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}
.success-card-head-icon {
  display: inline-flex;
  color: var(--secondary);
}
.success-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--sp-3) var(--sp-4);
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.success-row:last-child { border-bottom: none; }
.success-row-key {
  font-size: 12px;
  color: var(--muted);
}
.success-row-val {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  text-align: right;
  max-width: 58%;
  word-break: break-word;
}
.success-row-val.mono {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--secondary);
}
.success-status-pending {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  color: var(--warning);
  font-weight: 700;
  font-size: 11px;
}

/* ── SUCCESS ACTIONS ── */
.success-actions {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  width: 100%;
  max-width: 380px;
  animation: fadeInUp 0.4s 0.6s ease both;
}
.success-btn-primary {
  height: 52px;
  background: linear-gradient(135deg, var(--orange) 0%, var(--orange-dark) 100%);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  color: white;
  cursor: pointer;
  box-shadow: var(--shadow-accent);
  border: none;
  transition: transform var(--transition-fast), box-shadow var(--transition);
  -webkit-tap-highlight-color: transparent;
}
.success-btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-accent-lg);
}
.success-btn-primary:active { transform: scale(0.98); }
.success-btn-sec {
  height: 48px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  transition: border-color var(--transition);
  -webkit-tap-highlight-color: transparent;
}
.success-btn-sec:hover { border-color: var(--primary); }
.success-btn-sec:active { background: var(--bg); }


/* ── SPINNER ── */
.spinner {
  width: 20px;
  height: 20px;
  border: 2.5px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.spinner-sm {
  width: 16px;
  height: 16px;
  border-width: 2px;
  display: inline-block;
  vertical-align: middle;
}

/* ── Global loader bar (top of screen) ── */
.global-loader {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}
.global-loader.visible { opacity: 1; }
.global-loader-bar {
  height: 100%;
  background: var(--accent, #F7A200);
  animation: global-loader-slide 1.5s ease-in-out infinite;
}
@keyframes global-loader-slide {
  0% { width: 0; margin-left: 0; }
  50% { width: 60%; margin-left: 20%; }
  100% { width: 0; margin-left: 100%; }
}

/* ══════════════════════════════════════════
   RESPONSIVE — Mobile-first breakpoints
   ══════════════════════════════════════════ */

/* Anti-overflow global */
html, body, #app {
  overflow-x: hidden;
  max-width: 100vw;
}
img, video, canvas { max-width: 100%; height: auto; }

/* 360-480px — Mobile petit */
@media (max-width: 480px) {
  .login-container { padding: var(--sp-5) var(--sp-4); gap: var(--sp-4); }
  .login-card { padding: var(--sp-6) var(--sp-5); border-radius: 20px; }
  .login-logo-wrap { width: min(260px, 75vw); padding: var(--sp-4) var(--sp-4); }
  .login-tagline { font-size: 13px; }

  .dash-content { padding: var(--sp-3); }
  .dash-kpi-grid { gap: var(--sp-2); }
  .dash-kpi { padding: var(--sp-3); border-radius: 14px; }
  .dash-kpi-value { font-size: 24px; }
  .dash-btn-new { height: 50px; font-size: 14px; }

  /* Formulaire compact */
  .form-content { padding: var(--sp-2); }
  .form-bloc { padding: var(--sp-4); margin-bottom: var(--sp-2); }

  /* Branchement: 1 colonne */
  .btn-group { grid-template-columns: 1fr; }
  .btn-branch { font-size: var(--text-sm); padding: var(--sp-2) var(--sp-3); }

  /* Scan: empile input + bouton */
  .input-group { flex-direction: column; }
  .btn-scan { width: 100%; justify-content: center; }

  .app-header h2 { font-size: var(--text-base); }

  .photo-controls-v2 { padding: var(--sp-4) var(--sp-5); }


  .success-body { padding: var(--sp-6) var(--sp-4) var(--sp-5); }
  .success-title { font-size: 20px; }
  .success-anim { width: 76px; height: 76px; margin-bottom: var(--sp-4); }

  .list-scroll { padding: var(--sp-3) var(--sp-3); }
  .fiche-card { padding: var(--sp-3); gap: var(--sp-3); border-radius: 14px; }
  .fiche-card-num { font-size: 12px; }
  .fiche-badge { font-size: 9px; padding: 2px 8px; }

  .manual-modal-content { max-width: 100%; padding: var(--sp-4); }
}

/* 481-767px — Mobile large / Phablet */
@media (min-width: 481px) and (max-width: 767px) {
  .dash-content { padding: var(--sp-5); }
  .form-content { padding: var(--sp-4); }
}

/* 768px+ — Tablette & Desktop */
@media (min-width: 768px) {
  /* Form desktop */
  .form-screen {
    max-width: 600px;
    margin: 0 auto;
    width: 100%;
  }
  .form-content { padding: var(--sp-5); }
  .form-bloc { padding: var(--sp-5); }
  .login-card { padding: var(--sp-8); max-width: 400px; }
  .login-logo-wrap { width: 320px; }
  .success-screen { padding: 0; }

  /* Dashboard desktop: centre et limite la largeur */
  .dash-screen {
    max-width: 720px;
    margin: 0 auto;
    width: 100%;
    position: relative;
  }
  .dash-header {
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  }
  .dash-content {
    padding: var(--sp-6);
  }
  .dash-kpi-grid {
    grid-template-columns: repeat(4, 1fr);
  }
  .dash-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    max-width: 720px;
    width: 100%;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    box-shadow: var(--shadow-md);
  }

  /* List desktop */
  .list-screen {
    max-width: 600px;
    margin: 0 auto;
    width: 100%;
  }

  /* Success desktop */
  .success-screen {
    max-width: 600px;
    margin: 0 auto;
    width: 100%;
  }
}


/* ============================================================
   PROTOTYPE v2 — Nouveaux styles (wizard, dashboard, scanner)
   ============================================================ */

/* ── Multi-step form wizard ── */
.form-step { display: none; }
.form-step.active { display: block; }

.form-step-nav {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  padding: var(--sp-4) 0;
}
.btn-step-back {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  min-height: var(--touch-min);
  padding: var(--sp-3) var(--sp-5);
  background: var(--surface);
  color: var(--text);
  font-family: var(--font-display);
  font-size: var(--text-base);
  font-weight: 600;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--transition);
}
.btn-step-back:hover { border-color: var(--primary); }

.btn-step-next,
.btn-step-submit {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  min-height: 52px;
  padding: var(--sp-3) var(--sp-5);
  background: linear-gradient(135deg, var(--orange) 0%, var(--orange-dark, #B56B08) 100%);
  color: #fff;
  font-family: var(--font-display);
  font-size: var(--text-base);
  font-weight: 700;
  border: none;
  border-radius: var(--radius-lg);
  cursor: pointer;
  box-shadow: var(--shadow-accent);
  transition: all var(--transition);
}
.btn-step-next:hover,
.btn-step-submit:hover { transform: translateY(-1px); box-shadow: var(--shadow-accent-lg); }
.btn-step-next:active,
.btn-step-submit:active { transform: scale(0.98); }
.btn-step-submit:disabled { opacity: 0.5; cursor: not-allowed; }


/* Info banner (step 1) */
.form-info-banner {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-4);
  margin: var(--sp-3) 0;
  background: var(--warning-bg);
  border: 1px solid var(--warning-border);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  color: var(--warning);
}

/* Agence tags */
.agence-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
}
.agence-tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  background: var(--secondary-light, #F3EAFA);
  color: var(--secondary);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 600;
  border-radius: var(--radius-sm);
  letter-spacing: 0.3px;
}
.agence-tag.loading,
.agence-tag.muted {
  background: var(--bg);
  color: var(--muted);
  font-family: var(--font);
}

/* ── Step 2: Scan result box ── */
.scan-result-box {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-4);
  background: var(--success-bg);
  border: 1.5px solid var(--success-border);
  border-radius: var(--radius-md);
  font-family: var(--font-mono);
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--success);
}
.scan-result-check {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  background: var(--success);
  color: white;
  border-radius: 50%;
  flex-shrink: 0;
}

.btn-scanner-launch {
  width: 100%;
  min-height: var(--touch-min);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-5);
  background: var(--secondary);
  color: white;
  font-family: var(--font-display);
  font-size: var(--text-base);
  font-weight: 700;
  border: none;
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--transition);
  margin: var(--sp-3) 0;
}
.btn-scanner-launch:hover { background: var(--secondary-hover); }

.scan-separator {
  text-align: center;
  color: var(--muted);
  font-size: var(--text-sm);
  padding: var(--sp-2) 0;
  position: relative;
}
.scan-separator::before,
.scan-separator::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 20%;
  height: 1px;
  background: var(--border);
}
.scan-separator::before { left: 0; }
.scan-separator::after { right: 0; }

/* ── Dashboard v2 — Header (fond violet) ── */
.dash-greeting {
  font-size: var(--text-sm);
  color: rgba(255,255,255,0.6);
  font-weight: 500;
}
.dash-name {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 800;
  color: #fff;
  line-height: 1.2;
  letter-spacing: -0.5px;
}
.dash-agent-info {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  margin-top: 2px;
  font-size: var(--text-sm);
  color: rgba(255,255,255,0.7);
}
.dash-agent-dot {
  width: 8px;
  height: 8px;
  background: var(--success);
  border-radius: 50%;
  flex-shrink: 0;
}

/* KPI cards with LEFT accent border */
.dash-kpi.accent-orange { border-left: 3px solid var(--orange, #E8950A); }
.dash-kpi.accent-violet { border-left: 3px solid var(--secondary); }
.dash-kpi.accent-blue   { border-left: 3px solid var(--info, #1E40AF); }
.dash-kpi.accent-green  { border-left: 3px solid var(--success); }
.dash-kpi.accent-orange::before,
.dash-kpi.accent-violet::before,
.dash-kpi.accent-blue::before,
.dash-kpi.accent-green::before { display: none; }

/* ── Dashboard bottom nav — "+" button highlight ── */
.dash-nav-plus {
  background: var(--primary);
  color: white;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── Scanner dark theme ── */
.dark-scanner {
  background: #0A0716;
  color: #fff;
}
.dark-scanner .scan-header {
  background: transparent;
  border-bottom: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-4);
}
.dark-scanner .scan-title {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 700;
  color: #fff;
  margin: 0;
}
.btn-close-scan {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 50%;
  color: #fff;
  cursor: pointer;
}
.btn-close-scan:hover { background: rgba(255,255,255,0.2); }

.dark-scanner .scan-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-4);
  background: transparent;
}
.btn-cancel-scan-dark {
  min-height: var(--touch-min);
  padding: var(--sp-3) var(--sp-8);
  background: transparent;
  color: #fff;
  font-family: var(--font-display);
  font-size: var(--text-base);
  font-weight: 600;
  border: 1.5px solid rgba(255,255,255,0.3);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--transition);
}
.btn-cancel-scan-dark:hover { border-color: rgba(255,255,255,0.6); background: rgba(255,255,255,0.05); }

.btn-scan-zoom {
  min-height: var(--touch-min);
  padding: var(--sp-2) var(--sp-4);
  background: rgba(255,255,255,0.1);
  color: #fff;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: background 0.15s, border-color 0.15s;
}
.btn-scan-zoom:hover { background: rgba(255,255,255,0.18); border-color: rgba(255,255,255,0.5); }
.btn-scan-zoom:disabled { opacity: 0.4; cursor: not-allowed; }

.scan-footer-info {
  font-size: var(--text-xs);
  color: rgba(255,255,255,0.3);
}

/* Decoded barcode display — centre du viewport */
.scan-decoded-bar {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  z-index: 6;
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--orange);
  text-shadow: 0 0 8px rgba(232,149,10,0.6);
  white-space: nowrap;
}
.scan-decoded-pipes { opacity: 0.5; }

/* ============================================================
   PROTOTYPE v2 — Step 3 Photo captured + Step 5 Recap + Overlay
   ============================================================ */

/* ── Photo captured card (Step 3) — check a gauche ── */
.photo-captured-card {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-4);
  background: var(--success-bg);
  border: 1.5px solid var(--success-border);
  border-radius: var(--radius-lg);
}
.photo-captured-check {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: var(--success);
  color: white;
  border-radius: 50%;
  flex-shrink: 0;
}
.photo-captured-info {
  flex: 1;
  min-width: 0;
}
.photo-captured-name {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--success);
}
.photo-captured-size {
  font-size: var(--text-xs);
  color: var(--muted);
  margin-top: 2px;
}
.photo-action-buttons {
  display: flex;
  gap: var(--sp-2);
  margin-top: var(--sp-3);
}
.photo-action-buttons .btn-photo-retake,
.photo-action-buttons .btn-photo-gallery {
  flex: 1;
  min-height: var(--touch-min);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  font-size: var(--text-sm);
  font-weight: 600;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition);
}
.btn-photo-retake {
  background: var(--surface);
  color: var(--text);
  border: 1.5px solid var(--border);
}
.btn-photo-retake:hover { border-color: var(--primary); }
.btn-photo-gallery {
  background: var(--surface);
  color: var(--muted);
  border: 1.5px solid var(--border);
}
.btn-photo-gallery:hover { border-color: var(--primary); }

/* GPS coord card (Step 3) */
.gps-coord-card {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-3);
  background: var(--success-bg);
  border-radius: var(--radius-md);
  margin-top: var(--sp-3);
}
.gps-coord-icon {
  display: flex;
  align-items: center;
  color: var(--success);
}
.gps-coord-text {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--success);
}
.gps-coord-content {
  flex: 1;
  min-width: 0;
}
.gps-coord-sub {
  display: block;
  font-size: var(--text-xs);
  color: var(--muted);
  margin-top: 2px;
}
.gps-waiting {
  background: var(--warning-bg);
}
.gps-waiting .gps-coord-icon { color: var(--warning); }
.gps-waiting .gps-coord-text { color: var(--warning); font-family: var(--font); }

/* Dept Commune readonly display */
.dept-commune-display {
  padding: var(--sp-3);
  background: var(--bg);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  color: var(--text);
  margin-top: var(--sp-3);
}
.dept-commune-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

/* ── Step 5 Recapitulatif ── */
.recap-section {
  margin-bottom: var(--sp-3);
}
.recap-section-header {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: 10px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: var(--sp-2);
}
.recap-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
}
.recap-row:last-child { border-bottom: none; }
.recap-label {
  font-size: var(--text-xs);
  color: var(--muted);
  flex-shrink: 0;
}
.recap-value {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text);
  text-align: right;
  word-break: break-all;
}
.recap-photo-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  background: var(--success);
  color: white;
  border-radius: 50%;
  margin-right: var(--sp-2);
  vertical-align: middle;
}

/* ── Sending overlay (Prototype 10) ── */
.sending-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--bg);
  padding: var(--sp-6);
  padding-top: var(--sp-8);
  overflow-y: auto;
}

/* Header: titre + sous-titre */
.sending-header {
  text-align: left;
  width: 100%;
  max-width: 320px;
  margin-bottom: var(--sp-6);
}
.sending-title {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 800;
  color: var(--text);
}
.sending-subtitle {
  font-size: var(--text-sm);
  color: var(--muted);
  margin-top: 2px;
}

/* Spinner cercle */
.sending-spinner {
  margin-bottom: var(--sp-4);
}
.sending-spinner svg { display: block; }
.spinner-arc {
  animation: spin-arc 1.2s linear infinite;
  transform-origin: center;
}
@keyframes spin-arc {
  to { transform: rotate(360deg); }
}

/* Status titre */
.sending-status {
  text-align: center;
  margin-bottom: var(--sp-5);
}
.sending-status-title {
  font-family: var(--font-display);
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--text);
}
.sending-status-sub {
  font-size: var(--text-sm);
  color: var(--muted);
  margin-top: 2px;
}

/* Progress section */
.sending-progress-section {
  width: 100%;
  max-width: 320px;
  margin-bottom: var(--sp-5);
}
.sending-progress-labels {
  display: flex;
  justify-content: space-between;
  font-size: var(--text-xs);
  color: var(--muted);
  margin-bottom: var(--sp-2);
}
.sending-progress-labels span:last-child {
  font-weight: 700;
  color: var(--text);
}
.sending-progress-wrap {
  width: 100%;
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}
.sending-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--orange) 0%, var(--secondary) 100%);
  border-radius: 3px;
  transition: width 0.4s ease;
  width: 0%;
}

/* Steps list */
.sending-steps {
  width: 100%;
  max-width: 320px;
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  margin-bottom: var(--sp-5);
}
.sending-step {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  opacity: 0.4;
  transition: opacity 0.3s ease;
}
.sending-step.active { opacity: 1; }
.sending-step.done { opacity: 0.8; }
.sending-step-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: var(--surface);
  color: var(--muted);
  border: 1.5px solid var(--border);
  transition: all 0.3s ease;
}
.sending-step.active .sending-step-icon {
  background: var(--primary, var(--accent));
  color: white;
  border-color: var(--primary, var(--accent));
  animation: pulse-icon 1s ease infinite;
}
.sending-step.done .sending-step-icon {
  background: var(--success);
  color: white;
  border-color: var(--success);
}
.sending-step-text {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text);
}
.sending-step.done .sending-step-text { color: var(--muted); }
@keyframes pulse-icon {
  0%, 100% { box-shadow: 0 0 0 0 rgba(247,162,0,0.4); }
  50% { box-shadow: 0 0 0 6px rgba(247,162,0,0); }
}

/* Offline banner */
.sending-offline-banner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-1);
  padding: var(--sp-3) var(--sp-5);
  background: var(--warning-bg);
  border: 1px solid var(--warning-border);
  border-radius: var(--radius-lg);
  text-align: center;
  max-width: 320px;
  width: 100%;
}
.sending-offline-banner-title {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--text);
}
.sending-offline-banner-sub {
  font-size: var(--text-xs);
  color: var(--muted);
}

/* ============================================================
   DETAIL FICHE (Prototype 13)
   ============================================================ */
.detail-screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding-bottom: 68px;
}
.detail-header {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-5) var(--sp-4) var(--sp-3);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}
.detail-header .btn-back {
  width: var(--touch-min);
  height: var(--touch-min);
  min-width: var(--touch-min);
  background: var(--bg);
  border: none;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  cursor: pointer;
}
.detail-header-text h2 {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 800;
  color: var(--text);
  margin: 0;
  line-height: 1.2;
}
.detail-header-sub {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
}
.detail-scroll {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: var(--sp-3);
}

/* Sync banner */
.detail-sync-banner {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--radius-lg);
  margin-bottom: var(--sp-3);
}
.detail-sync-banner.synced {
  background: var(--success-bg);
}
.detail-sync-banner.pending {
  background: var(--warning-bg);
}
.detail-sync-banner.error {
  background: var(--danger-bg, rgba(185,28,28,0.1));
}
.detail-sync-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  flex-shrink: 0;
}
.detail-sync-banner.synced .detail-sync-icon {
  background: var(--success);
  color: white;
}
.detail-sync-banner.pending .detail-sync-icon {
  background: var(--warning);
  color: white;
}
.detail-sync-banner.error .detail-sync-icon {
  background: var(--danger);
  color: white;
}
.detail-sync-label {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--text);
}
.detail-sync-date {
  font-size: var(--text-xs);
  color: var(--muted);
  margin-top: 1px;
}

/* Photo card */
.detail-photo-card {
  background: rgba(13,107,58,0.08);
  border-radius: var(--radius-lg);
  padding: var(--sp-4);
  margin-bottom: var(--sp-3);
  text-align: center;
}
.detail-photo-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 80px;
  color: var(--muted);
  opacity: 0.5;
}
.detail-photo-name {
  font-size: var(--text-xs);
  color: var(--muted);
  margin-top: var(--sp-2);
}

/* Desktop */
@media (min-width: 768px) {
  .detail-screen {
    max-width: 600px;
    margin: 0 auto;
    width: 100%;
  }
}

/* ============================================================
   PROFIL AGENT
   ============================================================ */
.profile-screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding-bottom: 68px;
}
.profile-header {
  padding: var(--sp-5) var(--sp-4) var(--sp-3);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.profile-header-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 800;
  color: var(--text);
  margin: 0;
}
.profile-scroll {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: var(--sp-4);
}
.profile-identity {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-2);
  margin-bottom: var(--sp-5);
}
.profile-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--secondary) 0%, #3D1260 100%);
  color: #fff;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 1px;
}
.profile-name {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 800;
  color: var(--text);
  text-align: center;
}
.profile-role {
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 2px 10px;
  background: var(--accent-bg);
  border-radius: var(--radius-full);
}
.profile-version {
  text-align: center;
  font-size: var(--text-xs);
  color: var(--muted);
  margin: var(--sp-4) 0 var(--sp-3);
}
.profile-btn-logout {
  width: 100%;
  min-height: var(--touch-min);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-5);
  background: transparent;
  color: var(--danger);
  font-family: var(--font-display);
  font-size: var(--text-base);
  font-weight: 700;
  border: 1.5px solid var(--danger);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--transition);
  margin-bottom: var(--sp-4);
}
.profile-btn-logout:hover {
  background: var(--danger);
  color: #fff;
}

.profile-btn-cache {
  width: 100%;
  min-height: var(--touch-min);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-5);
  background: transparent;
  color: var(--muted);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  border: 1px solid var(--border, rgba(255,255,255,0.1));
  border-radius: var(--radius-md);
  cursor: pointer;
  margin-bottom: var(--sp-3);
  transition: background 0.15s, color 0.15s;
}
.profile-btn-cache:hover {
  background: var(--surface-alt, rgba(255,255,255,0.06));
  color: var(--text);
}
@media (min-width: 768px) {
  .profile-screen {
    max-width: 600px;
    margin: 0 auto;
    width: 100%;
  }
}

/* Offline saved card */
.sending-offline-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-5);
  background: var(--warning-bg);
  border: 1.5px solid var(--warning-border);
  border-radius: var(--radius-lg);
  text-align: center;
  max-width: 320px;
  width: 100%;
}
.sending-offline-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--warning);
  color: white;
  border-radius: 50%;
}
.sending-offline-title {
  font-family: var(--font-display);
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--text);
}
.sending-offline-desc {
  font-size: var(--text-sm);
  color: var(--muted);
  line-height: 1.4;
}
.sending-error-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-5);
  background: var(--danger-bg, rgba(185,28,28,0.1));
  border: 1.5px solid var(--danger);
  border-radius: var(--radius-lg);
  text-align: center;
  max-width: 320px;
  width: 100%;
}
.sending-error-title {
  font-family: var(--font-display);
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--danger);
}
.sending-error-desc {
  font-size: var(--text-sm);
  color: var(--muted);
  line-height: 1.4;
}
