/* =========================================================================
 * Animaleko 2026 - PWA compagnon mobile
 * Styles tactiles optimises iPad / iPhone (Safari iOS)
 *
 * Conventions :
 *   - Cibles tactiles : 44x44 minimum (Apple HIG)
 *   - Police systeme (-apple-system) pour rendu natif
 *   - Theme clair par defaut ; respect prefers-color-scheme pour dark
 *   - Pas de framework CSS, vanilla pour rester leger et compatible
 * ========================================================================= */

/* --- Reset minimal --- */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; margin: 0; padding: 0; }
button, input, textarea, select {
  font: inherit; color: inherit; background: transparent; border: none;
  -webkit-tap-highlight-color: transparent;
}
button { cursor: pointer; }
input, textarea, select { -webkit-appearance: none; appearance: none; }

/* --- Couleurs Animaleko --- */
:root {
  --brand: #C0813A;          /* orange brand */
  --brand-dark: #A56E2F;
  --brand-light: #E9C088;
  --bg: #faf8f5;             /* fond ivoire chaud */
  --surface: #ffffff;
  --text: #1f2937;
  --text-secondary: #4b5563;
  --text-tertiary: #9ca3af;
  --border: #e5e7eb;
  --danger: #dc2626;
  --success: #16a34a;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.05), 0 2px 6px rgba(0,0,0,.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,.08), 0 2px 4px rgba(0,0,0,.06);
  --radius: 12px;
  --radius-lg: 16px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1a1916;
    --surface: #25231f;
    --text: #f3f4f6;
    --text-secondary: #d1d5db;
    --text-tertiary: #9ca3af;
    --border: #3f3c36;
  }
}

/* --- Base body --- */
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               Helvetica, Arial, sans-serif;
  font-size: 16px;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  /* iPad : prendre toute la safe-area en plein ecran installe */
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}

/* --- Vues (single page) --- */
.view {
  width: 100%;
  min-height: 100vh;
}
.view[hidden] { display: none; }

/* =========================================================================
 * Vue LOGIN
 * ========================================================================= */
.view-login {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #faf8f5 0%, #f0e3d0 100%);
  padding: 20px;
}

.login-card {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 32px 28px;
}

.login-brand {
  text-align: center;
  margin-bottom: 28px;
}
.login-logo {
  width: 80px; height: 80px;
  margin: 0 auto 12px;
  background: #fff;
  border: 2px solid var(--brand);
  border-radius: 20px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 8px rgba(192, 129, 58, .18);
  overflow: hidden;
}
.login-logo img {
  display: block;
  max-width: 70%;
  max-height: 70%;
  object-fit: contain;
}
.login-brand h1 {
  margin: 0; font-size: 24px; color: var(--brand-dark);
}
.login-subtitle {
  margin: 4px 0 0; font-size: 14px; color: var(--text-tertiary);
}

.field {
  display: block;
  margin-bottom: 16px;
}
.field-label {
  display: block;
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 6px;
  font-weight: 500;
}
.field input[type="email"],
.field input[type="password"],
.field input[type="text"] {
  width: 100%;
  padding: 12px 14px;
  font-size: 16px;          /* >= 16px : empeche iOS de zoomer au focus */
  border: 1.5px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  transition: border-color .15s;
}
.field input:focus {
  outline: none;
  border-color: var(--brand);
}

.field-inline {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 20px;
  font-size: 14px; color: var(--text-secondary);
  cursor: pointer;
}
.field-inline input[type="checkbox"] {
  width: 22px; height: 22px;
  accent-color: var(--brand);
}

.login-footnote {
  margin: 18px 0 0;
  font-size: 12px;
  color: var(--text-tertiary);
  text-align: center;
}

/* =========================================================================
 * Boutons (tactiles : >= 44px)
 * ========================================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 18px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  transition: transform .1s, opacity .15s, background .15s;
  -webkit-touch-callout: none;
  user-select: none;
}
.btn:active { transform: scale(.98); }

.btn-primary {
  background: var(--brand);
  color: #fff;
}
.btn-primary:hover:not(:disabled) { background: var(--brand-dark); }
.btn-primary:disabled { opacity: .5; cursor: not-allowed; }

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.btn-ghost:hover { background: var(--bg); }

.btn-danger {
  background: var(--danger);
  color: #fff;
}
.btn-danger:hover:not(:disabled) { background: #b91c1c; }
.btn-danger:disabled { opacity: .5; cursor: not-allowed; }

.btn-large {
  width: 100%;
  min-height: 52px;
  font-size: 17px;
  margin-top: 8px;
}

.btn-sm {
  min-height: 36px;
  padding: 6px 12px;
  font-size: 13px;
}

/* =========================================================================
 * Messages
 * ========================================================================= */
.msg {
  margin: 12px 0 0;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 14px;
  text-align: center;
}
.msg-error {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fca5a5;
}
.msg-info {
  background: #dbeafe;
  color: #1e3a8a;
  border: 1px solid #93c5fd;
}

/* =========================================================================
 * Vue HOME
 * ========================================================================= */
.view-home {
  display: flex;
  flex-direction: column;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar-brand {
  display: flex; align-items: center; gap: 10px;
}
.topbar-logo {
  width: 36px; height: 36px;
  background: #fff;
  border: 1.5px solid var(--brand);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.topbar-logo img {
  display: block;
  max-width: 75%;
  max-height: 75%;
  object-fit: contain;
}
.topbar-title {
  display: flex; flex-direction: column; line-height: 1.1;
}
.topbar-title strong {
  font-size: 15px; color: var(--brand-dark);
}
.topbar-sub {
  font-size: 11px; color: var(--text-tertiary);
}
.topbar-user {
  display: flex; align-items: center; gap: 10px;
}
.topbar-user-name {
  font-size: 14px; color: var(--text-secondary);
  max-width: 200px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.container {
  max-width: 1024px;
  margin: 0 auto;
  padding: 20px 16px 40px;
  width: 100%;
}

.welcome-card {
  background: linear-gradient(135deg, #fff 0%, #faf5ec 100%);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}
.welcome-card h2 {
  margin: 0 0 4px;
  color: var(--brand-dark);
  font-size: 24px;
}
.welcome-sub {
  margin: 0;
  color: var(--text-secondary);
  font-size: 14px;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 28px;
}
.kpi {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}
.kpi-label {
  font-size: 12px;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: 6px;
}
.kpi-value {
  font-size: 32px;
  font-weight: 700;
  color: var(--brand);
}
/* KPI cliquable : cursor pointer + micro-elevation au hover.
 * Applique a tous les KPIs qui ouvrent une liste filtree (data-kpi-target). */
.kpi-clickable {
  cursor: pointer;
  transition: transform .12s, box-shadow .12s;
}
.kpi-clickable:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}
.kpi-clickable:active { transform: translateY(0); }

/* KPI d'alerte (factures en retard, contrats expirant) : accent rouge doux
 * pour attirer l'oeil quand la valeur > 0 sans pour autant crier. */
.kpi-alert { border-left: 3px solid #dc2626; }
.kpi-alert .kpi-value { color: #b91c1c; }
.kpi-alert .kpi-label { color: #991b1b; }
/* Etat "OK" : valeur = 0, on passe en vert pour signaler la bonne nouvelle
 * (bordure verte + libelle/valeur verts). Prime sur .kpi-alert via ordre CSS. */
.kpi-alert.kpi-ok { border-left-color: #16a34a; }
.kpi-alert.kpi-ok .kpi-value { color: #15803d; }
.kpi-alert.kpi-ok .kpi-label { color: #166534; }
/* Activite recente (home) : liste compacte des derniers contrats/devis/factures.
 * Un item = icone colorée par type + ref + client + statut + montant. */
.activity-list { display: flex; flex-direction: column; }
.activity-item {
  display: grid;
  grid-template-columns: 40px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border-light, rgba(0,0,0,0.04));
  cursor: pointer;
  transition: background .12s;
}
.activity-item:last-child { border-bottom: none; }
.activity-item:hover { background: var(--bg-secondary, #f9fafb); }
.activity-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.activity-main { min-width: 0; }
.activity-title {
  font-weight: 600;
  font-size: 13px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.activity-sub { color: var(--text-secondary); font-size: 12px; margin-top: 2px; }
.activity-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  font-size: 12px;
}

/* KPI "Revenus" : accent brand pour valeur business, sous-libelle date. */
.kpi-revenue { border-left: 3px solid var(--brand, #C0813A); }
.kpi-revenue .kpi-value { color: var(--brand, #C0813A); font-size: 26px; }
.kpi-sub {
  font-size: 11px;
  color: var(--text-tertiary, #9ca3af);
  margin-top: 4px;
  text-transform: none;
  letter-spacing: 0;
}
/* Badge trend vs mois precedent : vert si delta >= 0 sinon rouge. Compact. */
.kpi-trend {
  display: inline-block;
  padding: 1px 5px;
  border-radius: 4px;
  font-weight: 600;
  font-size: 10px;
}
.kpi-trend.trend-up   { background: rgba(21, 128, 61, 0.12);  color: #15803d; }
.kpi-trend.trend-down { background: rgba(185, 28, 28, 0.12);  color: #b91c1c; }

.section-title {
  margin: 24px 0 12px;
  font-size: 16px;
  color: var(--text-secondary);
}

.tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-bottom: 32px;
}
.tile {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  text-align: left;
  cursor: pointer;
  transition: transform .15s, box-shadow .15s, border-color .15s;
  min-height: 110px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.tile:hover:not(:disabled):not(.tile-coming) {
  transform: translateY(-2px);
  border-color: var(--brand);
  box-shadow: var(--shadow-md);
}
.tile-icon {
  width: 40px; height: 40px;
  background: var(--brand-light);
  color: var(--brand-dark);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 20px;
}
.tile-icon svg { display: block; }
.tile-label {
  font-weight: 600;
  font-size: 15px;
}
.tile-coming {
  opacity: .55;
  cursor: not-allowed;
}
.tile-coming-label {
  font-size: 12px;
  color: var(--text-tertiary);
  font-style: italic;
}

.footer-info {
  margin-top: 40px;
  text-align: center;
  font-size: 12px;
  color: var(--text-tertiary);
}
.footer-info p { margin: 4px 0; }

/* =========================================================================
 * Cards + listes (vues home, previsite, client)
 * ========================================================================= */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  margin-bottom: 20px;
  overflow: hidden;
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}
.card-header h3 {
  margin: 0;
  font-size: 16px;
  color: var(--text);
}

.list {
  display: flex;
  flex-direction: column;
}
.list-placeholder {
  padding: 24px;
  text-align: center;
  color: var(--text-tertiary);
  font-size: 14px;
}
.list-empty {
  padding: 30px 20px;
  text-align: center;
  color: var(--text-tertiary);
}

/* ============================================================
   Planning calendrier sur la home (FullCalendar)
   ============================================================ */
.card-planning .card-header { padding-bottom: 8px; }
/* Groupe de boutons d'action a droite du header (Masquer + Rafraichir) */
.card-header-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
/* Etat replie : on masque le contenu calendrier mais on garde le header
   pour pouvoir le re-deployer en un clic. */
.card-planning.is-collapsed .home-calendar { display: none; }
.card-planning .chevron-icon {
  transition: transform 0.18s ease;
}
.card-planning.is-collapsed .chevron-icon {
  transform: rotate(180deg);
}
.home-calendar {
  padding: 12px 14px 18px;
}
/* Legende compacte sous le calendrier : pastille couleur + label */
.home-calendar-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  padding: 10px 14px 16px;
  font-size: 12px;
  color: var(--text-secondary);
  border-top: 1px dashed var(--border);
}
.card-planning.is-collapsed .home-calendar-legend { display: none; }

/* ============================================================
   Prochain rendez-vous sur la home (remplace "Pré-visites du jour")
   ============================================================ */
.card-next-rdv .card-header { padding-bottom: 8px; }
.card-next-rdv.is-collapsed .home-next-rdv { display: none; }
.card-next-rdv .chevron-icon { transition: transform 0.18s ease; }
.card-next-rdv.is-collapsed .chevron-icon { transform: rotate(180deg); }

.home-next-rdv { padding: 4px 0; }
.next-rdv-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.next-rdv-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 8px 4px 12px;
  border-bottom: 1px solid var(--border);
}
.next-rdv-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand, #C0813A), var(--brand-dark, #8a5a28));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.next-rdv-header-body { flex: 1; min-width: 0; }
.next-rdv-source {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary, #6b7280);
  margin-bottom: 2px;
}
.next-rdv-client {
  font-size: 17px;
  font-weight: 700;
  color: var(--text, #111827);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.next-rdv-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 0 4px;
}
.next-rdv-line {
  font-size: 14px;
  color: var(--text, #111827);
}
.next-rdv-line strong {
  display: inline-block;
  min-width: 70px;
  color: var(--text-secondary, #6b7280);
  font-weight: 500;
}
.next-rdv-actions { padding: 8px 4px 4px; }
.next-rdv-actions .btn-block {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 18px;
  font-size: 15px;
  font-weight: 600;
}
.home-calendar-legend .legend-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}
.home-calendar-legend .legend-swatch {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 3px;
  flex-shrink: 0;
}
/* Toolbar (boutons prev/next/today + selecteur de vue) */
.home-calendar .fc-toolbar.fc-header-toolbar {
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}
.home-calendar .fc-toolbar-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}
.home-calendar .fc-button {
  background: var(--surface);
  color: var(--text-primary);
  border: 1px solid var(--border);
  font-size: 13px;
  font-weight: 500;
  padding: 6px 12px;
  text-transform: none;
  box-shadow: none;
}
.home-calendar .fc-button:hover { background: var(--bg-secondary); }
.home-calendar .fc-button-primary:not(:disabled).fc-button-active,
.home-calendar .fc-button-primary:not(:disabled):active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}
.home-calendar .fc-button-primary:focus,
.home-calendar .fc-button-primary:not(:disabled).fc-button-active:focus {
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand) 40%, transparent);
}
.home-calendar .fc-event { cursor: pointer; }
.home-calendar .fc-daygrid-event,
.home-calendar .fc-timegrid-event { font-size: 12px; }
/* Slots horaires un poil plus aerés pour le tactile */
.home-calendar .fc-timegrid-slot { height: 32px; }
.home-calendar .fc-col-header-cell-cushion,
.home-calendar .fc-list-day-cushion { color: var(--text-secondary); }
/* Adaptation responsive (iPhone portrait) */
@media (max-width: 640px) {
  .home-calendar { padding: 8px 6px 12px; }
  .home-calendar .fc-toolbar.fc-header-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  .home-calendar .fc-toolbar-chunk { display: flex; justify-content: center; }
  .home-calendar .fc-toolbar-title { font-size: 14px; }
  .home-calendar .fc-button { font-size: 12px; padding: 5px 10px; }
}
.list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  min-height: 56px;
  transition: background .15s;
  text-align: left;
  width: 100%;
}
.list-item:last-child { border-bottom: none; }
.list-item:active { background: var(--bg); }
.list-item-time {
  flex: 0 0 64px;
  font-weight: 700;
  color: var(--brand-dark);
  font-size: 15px;
}
.list-item-main {
  flex: 1;
  min-width: 0;
}
.list-item-title {
  font-weight: 600;
  font-size: 15px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.list-item-sub {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.list-item-meta {
  flex: 0 0 auto;
  font-size: 12px;
  color: var(--text-tertiary);
  text-align: right;
}
.list-item-chevron {
  flex: 0 0 16px;
  color: var(--text-tertiary);
  font-size: 18px;
}

/* Badges status */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .03em;
}
.badge-planifiee  { background: #fef3c7; color: #92400e; }
.badge-realisee   { background: #d1fae5; color: #065f46; }
.badge-annulee    { background: #fee2e2; color: #991b1b; }
.badge-neutral    { background: #e5e7eb; color: #4b5563; }
/* Contrats (V2.2) : couleurs distinctes du cycle de vie */
.badge-brouillon  { background: #e0e7ff; color: #3730a3; }
.badge-envoye     { background: #dbeafe; color: #1e40af; }
.badge-signe      { background: #d1fae5; color: #065f46; }
.badge-annule     { background: #fee2e2; color: #991b1b; }
.badge-expire     { background: #e5e7eb; color: #4b5563; }
/* Devis (V2.3) : accepte/refuse/commande specifiques + reuse brouillon/envoye/expire */
.badge-accepte    { background: #d1fae5; color: #065f46; }
.badge-refuse     { background: #fee2e2; color: #991b1b; }
.badge-commande   { background: #ede9fe; color: #5b21b6; }
/* Facture (V2.4) : a_envoyer/envoyee/payee/retard/terminee + reuse annulee */
.badge-a_envoyer  { background: #fef3c7; color: #92400e; }
.badge-envoyee    { background: #dbeafe; color: #1e40af; }
.badge-payee      { background: #d1fae5; color: #065f46; }
.badge-retard     { background: #fed7aa; color: #9a3412; }
.badge-terminee   { background: #e5e7eb; color: #4b5563; }

/* Facture - paiements (V2.4) */
.facture-paiements { padding: 4px 0; }
.facture-paiement {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  border-bottom: 1px dashed var(--border);
  gap: 12px;
}
.facture-paiement:last-child { border-bottom: none; }
.list-empty.small { padding: 12px 16px; font-size: 13px; }

/* ============================================================
   Devis - detail (V2.3)
   ============================================================ */
.devis-detail-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  gap: 12px;
}
.devis-detail-numero {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-tertiary);
}
.devis-detail-name {
  font-size: 18px;
  font-weight: 700;
  margin: 2px 0 6px;
}
.devis-detail-date { font-size: 13px; color: var(--text-secondary); }
.devis-detail-contract { font-size: 12px; color: var(--text-tertiary); margin-top: 4px; }
.devis-detail-description {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  color: var(--text-primary);
  background: var(--bg-secondary);
}
.devis-lines { padding: 0; }
.devis-line {
  display: grid;
  grid-template-columns: 1fr auto 90px 100px auto;
  gap: 8px;
  padding: 10px 16px;
  border-bottom: 1px dashed var(--border);
  align-items: center;
}
.devis-line-actions {
  display: flex;
  gap: 2px;
  margin-left: 4px;
}
.devis-line-actions .btn { padding: 4px 6px; }
.devis-line:last-child { border-bottom: none; }
.devis-line-main { min-width: 0; }
.devis-line-designation { font-weight: 600; font-size: 14px; }
.devis-line-sub { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }
.devis-line-qty { font-size: 13px; color: var(--text-secondary); text-align: right; }
.devis-line-price { font-size: 13px; color: var(--text-secondary); text-align: right; }
.devis-line-total { font-size: 14px; font-weight: 600; text-align: right; }
.devis-detail-totals {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
}
.devis-total-row {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  font-size: 15px;
}
.devis-total-row:last-child { padding-top: 8px; border-top: 1px solid var(--border); font-size: 17px; }
.devis-detail-actions {
  padding: 12px 16px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* ============================================================
   PWA CustomSelect (leger, remplace <select> natif)
   ============================================================ */
.pwa-select {
  position: relative;
  display: block;
  width: 100%;
}
.pwa-select-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface, #fff);
  color: var(--text);
  font-size: 14px;
  text-align: left;
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s;
}
.pwa-select-trigger:hover { border-color: var(--brand, #C0813A); }
.pwa-select-trigger:focus,
.pwa-select-trigger:focus-visible {
  border-color: var(--brand, #C0813A);
  box-shadow: 0 0 0 3px rgba(192, 129, 58, 0.15);
  outline: none;
}
/* Etat "menu ouvert" : le parent .pwa-select recoit .is-open via JS pour
 * assurer la coloration coherente sur navigateurs sans :has() (< iOS 15.4). */
.pwa-select.is-open .pwa-select-trigger {
  border-color: var(--brand, #C0813A);
  box-shadow: 0 0 0 3px rgba(192, 129, 58, 0.15);
}
.pwa-select-value {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pwa-select-value.is-placeholder { color: var(--text-tertiary, #9ca3af); }
.pwa-select-chevron { flex-shrink: 0; color: var(--text-secondary); }

.pwa-select-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 100;
  background: var(--bg-primary, #fff);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 6px 24px rgba(0,0,0,0.12);
  max-height: 320px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
/* Fix : [hidden] doit ecraser display:flex sinon le menu reste visible
   meme apres selection d'une option. */
.pwa-select-menu[hidden] { display: none !important; }
/* Bouton "+ Nouveau ..." en tete du menu (opt-in via opts.onAddNew) : accent
 * brand pour signaler l'action creation, souligne pour delimiter du search. */
.pwa-select-add-new {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  width: 100%;
  border: none;
  background: rgba(192, 129, 58, 0.06);
  color: var(--brand, #C0813A);
  font-weight: 600;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background .12s;
}
.pwa-select-add-new:hover { background: rgba(192, 129, 58, 0.12); }

.pwa-select-search {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
}
.pwa-select-search input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-size: 14px;
  color: var(--text);
}
.pwa-select-options {
  overflow-y: auto;
  max-height: 260px;
}
.pwa-select-option {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 10px 14px;
  width: 100%;
  border: none;
  background: transparent;
  text-align: left;
  cursor: pointer;
  border-bottom: 1px solid var(--border-light, rgba(0,0,0,0.04));
  transition: background .12s;
}
.pwa-select-option:last-child { border-bottom: none; }
.pwa-select-option:hover { background: var(--bg-secondary, #f9fafb); }
.pwa-select-option.is-selected {
  background: rgba(192, 129, 58, 0.08);
  font-weight: 600;
}
.pwa-select-option-label { font-size: 14px; color: var(--text); }
.pwa-select-option-sub   { font-size: 12px; color: var(--text-secondary); }
.pwa-select-empty {
  padding: 14px;
  text-align: center;
  color: var(--text-tertiary, #9ca3af);
  font-size: 13px;
}

/* Recap header dans les modals PWA (email, paiement, etc.) */
.pwa-recap {
  padding: 10px 12px;
  background: var(--bg-secondary, #f9fafb);
  border-radius: 8px;
  font-size: 13px;
  color: var(--text-secondary);
}
.pwa-recap strong { color: var(--text); }

/* Container d'actions batch (envoyer rappels...) au-dessus des listes.
 * Fond alerte doux + padding pour distinguer des chips filtre. */
.batch-actions {
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  margin-bottom: 8px;
  background: rgba(220, 38, 38, 0.06);
  border-left: 3px solid #dc2626;
  border-radius: 6px;
}
.batch-actions .btn { flex-shrink: 0; }

/* Total agrege en pied des listes commerciales (devis/factures/commandes).
 * Discret, sticky en fond secondaire ; s'affiche seulement quand items > 0. */
.list-total {
  padding: 10px 16px;
  margin-top: 8px;
  background: var(--bg-secondary, #f9fafb);
  border-radius: 8px;
  color: var(--text-secondary);
  font-size: 12px;
  text-align: right;
}
.list-total:empty { display: none; }

/* Filter chips (utilise pour filtrer par statut sur liste contrats/devis/factures) */
.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 12px;
  padding: 0;
}
.filter-chips .chip {
  border: 1px solid var(--border);
  background: var(--surface, #fff);
  color: var(--text-secondary, #6b7280);
  padding: 6px 12px;
  border-radius: 18px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all .15s;
}
.filter-chips .chip:hover { border-color: var(--brand, #C0813A); }
.filter-chips .chip.is-on {
  background: var(--brand, #C0813A);
  color: #fff;
  border-color: var(--brand, #C0813A);
  font-weight: 600;
}

/* Tile subtitle (non-coming) */
.tile-sub {
  font-size: 12px;
  color: var(--text-tertiary);
}

/* Topbar centered title (sous-vues) */
.topbar-title-center {
  flex: 1;
  text-align: center;
}
.topbar-title-center strong {
  font-size: 16px;
  color: var(--text);
}
.back-arrow {
  font-size: 18px;
  font-weight: 700;
  display: inline-block;
  margin-right: 4px;
  vertical-align: -2px;
}

/* =========================================================================
 * Recherche client
 * ========================================================================= */
.search-box {
  margin-bottom: 16px;
}
.search-input {
  width: 100%;
  padding: 14px 16px;
  font-size: 17px;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
}
.search-input:focus {
  outline: none;
  border-color: var(--brand);
}
.search-hint {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  color: var(--text-tertiary);
}

/* =========================================================================
 * Detail pre-visite / client : sections d'info
 * ========================================================================= */
.detail-section {
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
}
.detail-section:last-child { border-bottom: none; }
.detail-section h4 {
  margin: 0 0 8px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-tertiary);
  font-weight: 600;
}
.detail-row {
  display: flex;
  gap: 12px;
  padding: 6px 0;
  font-size: 14px;
}
.detail-label {
  flex: 0 0 130px;
  color: var(--text-secondary);
}
.detail-value {
  flex: 1;
  color: var(--text);
  word-break: break-word;
}
.detail-actions {
  padding: 16px 18px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  border-top: 1px solid var(--border);
  background: var(--bg);
}

/* =========================================================================
 * Avatars (animal/client) + en-tete profil
 * ========================================================================= */
.avatar {
  flex: 0 0 auto;
  width: 48px; height: 48px;
  border-radius: 50%;
  background: var(--brand-light);
  color: var(--brand-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 18px;
  overflow: hidden;
  text-transform: uppercase;
}
.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.avatar-lg {
  width: 80px; height: 80px;
  font-size: 28px;
}
.profile-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(135deg, #fff 0%, #faf5ec 100%);
}
.profile-header-main h3 {
  margin: 0;
  font-size: 19px;
  color: var(--text);
}
.profile-header-sub {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* Sub-list (animal dans le client) plus dense */
.list-item-avatar {
  flex: 0 0 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.list-item-avatar .avatar {
  width: 40px; height: 40px;
  font-size: 15px;
}

/* Avatar avec image de race (fallback initiales si pas d'image) */
.avatar.avatar-race {
  position: relative;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
}
.avatar.avatar-race img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  inset: 0;
}
.avatar.avatar-race .avatar-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

/* Badge vaccin (statut + ratio) */
.vaccin-badge {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  margin-right: 8px;
  white-space: nowrap;
}
.vaccin-badge-text { text-transform: uppercase; letter-spacing: .03em; }
.vaccin-badge-ratio {
  background: rgba(255,255,255,.55);
  padding: 1px 7px;
  border-radius: 8px;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}
.vaccin-badge-ok      { background: #dcfce7; color: #166534; }
.vaccin-badge-partial { background: #fef3c7; color: #92400e; }
.vaccin-badge-none    { background: #fee2e2; color: #991b1b; }

/* Section titles dans une card */
.card-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  border-top: 1px solid var(--border);
}
.card-section-title:first-of-type { border-top: none; }
.card-section-title h4 {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-secondary);
}
.card-section-count {
  font-size: 12px;
  color: var(--text-tertiary);
  background: var(--surface);
  border-radius: 10px;
  padding: 2px 8px;
}

/* Stat tile (compteurs petit format) */
.stat-row {
  display: flex;
  gap: 12px;
  padding: 14px 18px;
  flex-wrap: wrap;
}
.stat-tile {
  flex: 1;
  min-width: 110px;
  padding: 10px 14px;
  background: var(--bg);
  border-radius: 10px;
  text-align: center;
}
.stat-tile-value {
  font-size: 22px;
  font-weight: 700;
  color: var(--brand);
}
.stat-tile-label {
  font-size: 11px;
  text-transform: uppercase;
  color: var(--text-tertiary);
  letter-spacing: .04em;
  margin-top: 2px;
}

/* =========================================================================
 * Topbar avec status (save indicator) en sous-titre
 * ========================================================================= */
.topbar-with-status .topbar-title-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.topbar-status {
  font-size: 11px;
  color: var(--text-tertiary);
  font-weight: 500;
  letter-spacing: .02em;
}
.topbar-status.is-dirty { color: var(--brand); }
.topbar-status.is-saving { color: var(--brand); }
.topbar-status.is-saved { color: var(--success); }
.topbar-status.is-error { color: var(--danger); }

/* =========================================================================
 * Fiches forms (ff-) : sections + champs tactiles
 * ========================================================================= */
.ff-form { padding-bottom: 80px; }

.ff-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  margin-bottom: 16px;
  overflow: hidden;
}
/* Section header avec flag + compteur + chevron toggle (collapsable).
   Cible tactile : >= 44px de hauteur effective grace au padding 14px sur 16px font. */
.ff-section-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  user-select: none;
  transition: background 0.12s;
}
.ff-section-header:hover {
  background: rgba(192, 129, 58, 0.04);
}
.ff-section-header:focus-visible {
  outline: 2px solid var(--brand, #C0813A);
  outline-offset: -2px;
}
.ff-section-title {
  flex: 1;
  margin: 0;
  font-size: 16px;
  color: var(--brand-dark, #8a5a28);
  font-weight: 600;
}
/* Conservation de l'ancien selecteur h3 au cas ou (legacy) */
.ff-section-header h3 {
  margin: 0;
  font-size: 16px;
  color: var(--brand-dark);
}
.ff-section-count {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary, #6b7280);
  background: var(--bg-secondary, #f3f4f6);
  padding: 3px 10px;
  border-radius: 12px;
  white-space: nowrap;
}
.ff-section-intro {
  margin: 4px 18px 0;
  font-size: 13px;
  color: var(--text-secondary);
}
.ff-section-body {
  padding: 6px 0;
}

/* Flag (icone d'etat de completion) dans le header */
.ff-flag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  flex-shrink: 0;
}
.ff-flag-check   { background: #d1fae5; color: #16a34a; }
.ff-flag-warning { background: #fef3c7; color: #d97706; }
.ff-flag-danger  { background: #fee2e2; color: #dc2626; }
.ff-flag-pencil  { background: #e5e7eb; color: #6b7280; }

/* Chevron + collapse */
.ff-chevron {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  transition: transform 0.18s ease;
  color: var(--text-secondary, #6b7280);
}
.ff-section.is-collapsed .ff-chevron {
  transform: rotate(-90deg);
}
.ff-section.is-collapsed .ff-section-body {
  display: none;
}
/* Etat visuel global du bloc selon completion */
.ff-section[data-ff-state="empty"] {
  border-left: 3px solid #dc2626;
}
.ff-section[data-ff-state="partial"],
.ff-section[data-ff-state="warning"] {
  border-left: 3px solid #d97706;
}
.ff-section[data-ff-state="complete"] {
  border-left: 3px solid #16a34a;
}

.ff-field {
  padding: 14px 18px;
  border-bottom: 1px dotted var(--border);
}
.ff-field:last-child { border-bottom: none; }

.ff-label {
  display: block;
  font-weight: 600;
  font-size: 15px;
  color: var(--text);
  margin-bottom: 6px;
}
.ff-sublabel {
  display: block;
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.ff-hint {
  display: block;
  font-size: 12px;
  color: var(--text-tertiary);
  margin-bottom: 8px;
}

/* Pastilles tactiles (yesno, radio, scale4, frequency) */
.ff-pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}
.ff-pill {
  flex: 0 0 auto;
  min-height: 44px;
  padding: 9px 18px;
  border: 1.5px solid var(--border);
  border-radius: 22px;
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  transition: background .15s, border-color .15s, color .15s, transform .1s;
  cursor: pointer;
}
.ff-pill:active { transform: scale(.96); }
.ff-pill.is-on {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  font-weight: 600;
}
.ff-pill.is-on.is-off {
  background: var(--text-secondary);
  border-color: var(--text-secondary);
}

/* Inputs (text + date + textarea) */
.ff-input {
  width: 100%;
  padding: 12px 14px;
  font-size: 16px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  margin-top: 4px;
  font-family: inherit;
}
.ff-input:focus {
  outline: none;
  border-color: var(--brand);
}
.ff-textarea {
  resize: vertical;
  min-height: 60px;
}
.ff-textarea-large {
  min-height: 120px;
}
.ff-input-date {
  max-width: 220px;
}
.ff-detail {
  margin-top: 12px;
}

/* Vaccine field (compact) */
.ff-vaccine {
  padding: 14px 18px;
}
.ff-vaccine-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.ff-vaccine-name {
  flex: 1;
  min-width: 200px;
  font-weight: 600;
  font-size: 15px;
}
.ff-vaccine-toggle { /* alias .ff-pill */ }
.ff-vaccine-date {
  margin-top: 12px;
}

/* Veto select trigger */
.ff-veto-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  font-size: 15px;
  color: var(--text);
  cursor: pointer;
  min-height: 48px;
  text-align: left;
}
.ff-veto-trigger:active {
  background: var(--bg);
}
.ff-veto-label {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ff-veto-chevron {
  flex: 0 0 auto;
  color: var(--text-tertiary);
  font-size: 22px;
  line-height: 1;
}

/* Modale picker veto */
.ff-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.4);
  z-index: 10000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
  animation: ffOverlayIn .2s ease;
}
.ff-modal {
  background: var(--surface);
  width: 100%;
  max-width: 720px;
  max-height: 90vh;
  border-radius: 16px 16px 0 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: ffModalIn .25s ease;
}
.ff-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}
.ff-modal-header h3 {
  margin: 0;
  font-size: 16px;
}
.ff-modal-search {
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}
.ff-modal-list {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

@keyframes ffOverlayIn { from { opacity: 0 } to { opacity: 1 } }
@keyframes ffModalIn  { from { transform: translateY(40%); opacity: 0 } to { transform: translateY(0); opacity: 1 } }

/* Formulaire dans bottom-sheet (cas modale email) */
.email-form { margin-top: 8px; }
.email-form label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.email-form input[type="email"] {
  width: 100%;
  padding: 14px 16px;
  font-size: 16px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
}
.email-form input[type="email"]:focus {
  outline: none;
  border-color: var(--brand);
}

/* Confirm actions en 2 colonnes si modale email (boutons inline) */
.confirm-actions .btn[data-email-action] { flex: 1; }
@media (max-width: 480px) {
  .confirm-actions .btn[data-email-action] { width: 100%; }
}

/* Bottom-sheet de confirmation tactile */
.confirm-overlay { padding: 0; }
.confirm-sheet {
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  background: var(--surface);
  border-radius: 16px 16px 0 0;
  padding: 22px 22px calc(22px + env(safe-area-inset-bottom));
  animation: ffModalIn .25s ease;
}
.confirm-title {
  margin: 0 0 8px;
  font-size: 18px;
  color: var(--text);
}
.confirm-message {
  margin: 0 0 16px;
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
}
.confirm-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.confirm-actions .btn { width: 100%; }

/* Card repliable (details/summary) pour l'aperçu contrat */
.contract-preview-collapsible {
  cursor: default;
}
.contract-preview-collapsible > summary {
  cursor: pointer;
  list-style: none;
  user-select: none;
  -webkit-user-select: none;
}
.contract-preview-collapsible > summary::-webkit-details-marker { display: none; }
.contract-preview-collapsible > summary::marker { content: ''; }
.card-header-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 52px;
}
.summary-chevron {
  font-size: 28px;
  font-weight: 300;
  color: var(--text-tertiary);
  line-height: 1;
  transition: transform .2s;
  display: inline-block;
}
.contract-preview-collapsible[open] .summary-chevron {
  transform: rotate(90deg);
}

/* =========================================================================
 * Apercu contrat (vue contract-preview)
 * ========================================================================= */
.contract-preview {
  background: #fff;
  color: #1f2937;
  padding: 20px 24px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 14px;
  line-height: 1.6;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin: 12px 18px;
  max-height: 60vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.contract-preview h1 {
  font-size: 22px;
  margin: 0 0 16px;
  color: var(--brand-dark);
  border-bottom: 2px solid var(--brand);
  padding-bottom: 8px;
}
.contract-preview h2 {
  font-size: 16px;
  margin: 18px 0 8px;
  color: var(--text);
  font-weight: 600;
}
.contract-preview p, .contract-preview ul {
  margin: 8px 0;
}
.contract-preview ul { padding-left: 24px; }
.contract-preview strong { color: var(--brand-dark); }
.contract-preview em { color: #6b7280; }

/* Champs éditables (vars contrat) */
.contract-var-row {
  display: flex;
  gap: 14px;
  margin: 12px 18px 0;
  flex-wrap: wrap;
}
.contract-var-row > .contract-var { margin: 0; flex: 1; min-width: 140px; }

.contract-var {
  margin: 12px 18px;
}
.contract-var label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 4px;
}
.contract-var-input-wrap {
  display: flex;
  gap: 8px;
  align-items: center;
}
.contract-var input,
.contract-var textarea {
  width: 100%;
  padding: 12px 14px;
  font-size: 16px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  text-align: left;
}
.contract-var input:focus,
.contract-var textarea:focus {
  outline: none;
  border-color: var(--brand);
}
.contract-var input[type="number"] {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.contract-var .ff-hint {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-top: 4px;
}

/* Largeurs compactes */
.contract-var-narrow { flex: 0 0 110px; min-width: 110px; }
.contract-var-narrow input { max-width: 80px; }
.contract-var-medium { flex: 0 0 160px; min-width: 160px; }
.contract-var-medium input { max-width: 120px; }

/* Bouton générer dates aligné avec l'input */
.contract-gen-dates-btn {
  flex: 0 0 auto;
  white-space: nowrap;
  margin-left: 4px;
}

/* Liste des dates générées */
.contract-gen-dates-list { margin: 8px 18px 0; }
.contract-dates-ul {
  list-style: none;
  margin: 6px 0 12px;
  padding: 0;
  background: var(--bg);
  border-radius: 8px;
  border: 1px solid var(--border);
  max-height: 280px;
  overflow-y: auto;
}
.contract-dates-ul li {
  padding: 8px 14px;
  border-bottom: 1px dotted var(--border);
  font-size: 14px;
  color: var(--text);
}
.contract-dates-ul li:last-child { border-bottom: none; }
.contract-dates-ul li::first-letter { text-transform: uppercase; }

/* btn-outline (utilisé pour "Générer les dates") */
.btn-outline {
  background: transparent;
  color: var(--brand);
  border: 1.5px solid var(--brand);
}
.btn-outline:hover:not(:disabled) { background: color-mix(in srgb, var(--brand) 8%, transparent); }

/* =========================================================================
 * Signature canvas (vue contract-sign)
 * ========================================================================= */
.signature-wrap {
  background: #fff;
  border: 2px dashed var(--brand);
  border-radius: 12px;
  padding: 12px;
  margin: 12px 0;
  position: relative;
}
.signature-canvas {
  display: block;
  width: 100%;
  height: 260px;
  background: #ffffff;
  border-radius: 8px;
  touch-action: none;
  cursor: crosshair;
}
.signature-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 8px;
}

/* Toggle de consentement RGPD (signature) — bouton tactile robuste,
 * remplace le <input type=checkbox> dont le rendu est imprévisible sur iOS. */
.consent-row {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  flex-wrap: wrap;
}
.consent-toggle {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 24px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  min-height: 44px;
  transition: background .15s, border-color .15s, color .15s, transform .1s;
  user-select: none;
}
.consent-toggle:active { transform: scale(.97); }
.consent-toggle-knob {
  display: inline-block;
  width: 18px; height: 18px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--surface);
  position: relative;
}
.consent-toggle.is-on {
  background: color-mix(in srgb, var(--success) 12%, var(--surface));
  border-color: var(--success);
  color: var(--success);
}
.consent-toggle.is-on .consent-toggle-knob {
  background: var(--success);
  border-color: var(--success);
}
.consent-toggle.is-on .consent-toggle-knob::after {
  content: "✓";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
}
.consent-text {
  flex: 1;
  min-width: 220px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-secondary);
}

/* Iframe pour apercu PDF (vue contract-done) */
.contract-pdf-frame {
  display: block;
  width: 100%;
  height: 60vh;
  border: none;
  background: #525659;
}

/* Placeholder PDF iOS (Safari ne rend pas embed/iframe inline) */
.contract-pdf-ios-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 40px 24px;
  background: #1f2937;
  color: #f3f4f6;
  text-align: center;
}
.contract-pdf-ios-icon {
  width: 72px;
  height: 72px;
  border-radius: 12px;
  background: var(--brand);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 24px;
  letter-spacing: 1px;
}
.contract-pdf-ios-title {
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  max-width: 90%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.contract-pdf-ios-size {
  font-size: 13px;
  color: #9ca3af;
}
.contract-pdf-ios-placeholder .btn {
  min-width: 200px;
  margin-top: 4px;
}
.contract-pdf-ios-hint {
  font-size: 12px;
  color: #9ca3af;
  line-height: 1.5;
  max-width: 440px;
  margin-top: 4px;
}

/* =========================================================================
 * Modal "Choisir un contrat" : bottom-sheet avec grid de cards tactiles
 * ========================================================================= */
.contract-choose-overlay {
  padding: 0;
}
.contract-choose-sheet {
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  background: var(--surface);
  border-radius: 16px 16px 0 0;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  animation: ffModalIn .25s ease;
}
.contract-choose-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 22px;
  border-bottom: 1px solid var(--border);
}
.contract-choose-header h3 {
  margin: 0;
  font-size: 18px;
  color: var(--text);
}
.contract-choose-sub {
  padding: 10px 22px;
  font-size: 13px;
  color: var(--text-secondary);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.contract-choose-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
  padding: 18px 22px calc(22px + env(safe-area-inset-bottom));
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.contract-card {
  display: flex;
  flex-direction: column;
  text-align: left;
  background: var(--surface);
  border: 2px solid color-mix(in srgb, var(--text-primary) 14%, transparent);
  border-radius: 14px;
  padding: 16px;
  gap: 8px;
  cursor: pointer;
  transition: transform .12s, box-shadow .15s, border-color .15s;
  box-shadow: 0 1px 2px rgba(0,0,0,.04), 0 2px 6px rgba(0,0,0,.04);
  min-height: 140px;
}
.contract-card:hover { transform: translateY(-2px); border-color: var(--brand); box-shadow: var(--shadow-md); }
.contract-card:active { transform: scale(.97); }

.contract-card-icon {
  width: 40px; height: 40px;
  background: var(--brand-light);
  color: var(--brand-dark);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 20px;
}
.contract-card-body { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.contract-card-title {
  font-weight: 700;
  color: var(--text);
  font-size: 15px;
  line-height: 1.3;
}
.contract-card-cat {
  font-size: 11px;
  text-transform: uppercase;
  color: var(--brand);
  font-weight: 600;
  letter-spacing: .04em;
}
.contract-card-desc {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.4;
  margin-top: 2px;
}
.contract-card-price {
  margin-top: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--brand-dark);
}

/* =========================================================================
 * Vue MAINTENANCE
 * ========================================================================= */
.view-maintenance {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  padding: 20px;
}
.maintenance-card {
  text-align: center;
  background: var(--surface);
  padding: 40px 30px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  max-width: 420px;
}
.maintenance-card h1 {
  color: var(--brand-dark);
  margin: 0 0 12px;
}
.maintenance-card p {
  margin: 8px 0;
  color: var(--text-secondary);
}

/* ========================================================================
   Cards Fiche client / Fiche animal sur la pré-visite (recap d'état)
   ======================================================================== */
.pv-fiche-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}
@media (min-width: 700px) {
  .pv-fiche-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.pv-fiche-card {
  display: flex;
  flex-direction: column;
  width: 100%;
  text-align: left;
  background: var(--surface, #fff);
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 12px;
  padding: 16px;
  gap: 12px;
  cursor: pointer;
  transition: transform 0.12s, box-shadow 0.12s, border-color 0.12s;
  font-family: inherit;
}
.pv-fiche-card:hover {
  transform: translateY(-1px);
  border-color: var(--brand, #C0813A);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.06);
}
.pv-fiche-card:active {
  transform: translateY(0);
}

/* Bordure gauche colore selon etat global */
.pv-fiche-card-complete { border-left: 4px solid #16a34a; }
.pv-fiche-card-partial  { border-left: 4px solid #d97706; }
.pv-fiche-card-empty    { border-left: 4px solid #dc2626; }

.pv-fiche-card-header {
  display: flex;
  align-items: center;
  gap: 14px;
}
.pv-fiche-card-big-flag {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.pv-fiche-big-check   { background: #d1fae5; color: #16a34a; }
.pv-fiche-big-warning { background: #fef3c7; color: #d97706; }
.pv-fiche-big-danger  { background: #fee2e2; color: #dc2626; }

.pv-fiche-card-title-block {
  flex: 1;
  min-width: 0;
}
.pv-fiche-card-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary, #1A1A1A);
  margin-bottom: 2px;
}
.pv-fiche-card-subtitle {
  font-size: 13px;
  color: var(--text-secondary, #6b7280);
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pv-fiche-card-state-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary, #6b7280);
}
.pv-fiche-card-complete .pv-fiche-card-state-label { color: #16a34a; }
.pv-fiche-card-partial  .pv-fiche-card-state-label { color: #d97706; }
.pv-fiche-card-empty    .pv-fiche-card-state-label { color: #dc2626; }

/* Liste des blocs internes */
.pv-fiche-card-sections {
  display: flex;
  flex-direction: column;
  gap: 6px;
  border-top: 1px solid var(--border, #e5e7eb);
  padding-top: 12px;
}
.pv-fiche-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  font-size: 13px;
}
.pv-fiche-row-flag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  flex-shrink: 0;
}
.pv-fiche-row-check   { background: #d1fae5; color: #16a34a; }
.pv-fiche-row-warning { background: #fef3c7; color: #d97706; }
.pv-fiche-row-danger  { background: #fee2e2; color: #dc2626; }
.pv-fiche-row-pencil  { background: #e5e7eb; color: #6b7280; }

.pv-fiche-row-title {
  flex: 1;
  color: var(--text-primary, #1A1A1A);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pv-fiche-row-count {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary, #6b7280);
  background: var(--bg-secondary, #f3f4f6);
  padding: 2px 8px;
  border-radius: 10px;
  white-space: nowrap;
  flex-shrink: 0;
}
.pv-fiche-card-empty .pv-fiche-card-sections,
.pv-fiche-card-empty .pv-fiche-card-state-label {
  /* L'agent voit immediatement que rien n'a ete renseigne */
}
.pv-fiche-card-empty-text {
  color: var(--text-secondary, #6b7280);
  font-style: italic;
  font-size: 13px;
  padding: 8px 0;
}

/* ========================================================================
   Vaccin "info pour les nuls" : icone (i) + modal pedagogique
   ======================================================================== */
.ff-vaccin-info-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  margin-left: 6px;
  border: none;
  background: var(--bg-secondary, #f3f4f6);
  color: var(--brand, #C0813A);
  border-radius: 50%;
  cursor: pointer;
  vertical-align: middle;
  transition: background 0.12s, transform 0.12s;
}
.ff-vaccin-info-btn:hover {
  background: rgba(192, 129, 58, 0.18);
  transform: scale(1.06);
}
.ff-vaccin-info-btn:active {
  transform: scale(0.96);
}

/* Modal pédagogique : overlay full-screen tactile */
.ff-vaccin-info-overlay {
  z-index: 1000;
}
.ff-vaccin-info-modal {
  max-width: 540px;
  margin: auto;
}
.ff-vaccin-info-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px 24px 16px;
  gap: 16px;
}
.ff-vaccin-info-illu {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}
.ff-vaccin-info-glyph {
  font-size: 44px;
  line-height: 1;
}
.ff-vaccin-info-level {
  display: inline-block;
  padding: 4px 14px;
  border-radius: 14px;
  background: var(--bg-secondary, #f3f4f6);
  color: var(--text-secondary, #6b7280);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.ff-vaccin-info-text {
  width: 100%;
  font-size: 15px;
  line-height: 1.55;
  color: var(--text-primary, #1A1A1A);
}
.ff-vaccin-info-text p {
  margin: 0 0 12px;
}
.ff-vaccin-info-text p:last-child {
  margin-bottom: 0;
}
.ff-vaccin-info-footer {
  padding: 12px 24px 20px;
  border-top: 1px solid var(--border, #e5e7eb);
}
.ff-vaccin-info-footer .btn {
  width: 100%;
}

/* ========================================================================
   Vaccin : ligne date + boutons copier/coller + bloc "Reste / Rappel"
   ======================================================================== */
.ff-vaccine-date-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.ff-vaccine-date-row .ff-input-date {
  flex: 1;
  min-width: 0;
}
.ff-vaccin-clip-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--border, #e5e7eb);
  background: var(--bg-secondary, #f3f4f6);
  color: var(--text-secondary, #6b7280);
  border-radius: 8px;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.12s, color 0.12s, transform 0.12s;
}
.ff-vaccin-clip-btn:hover {
  background: rgba(192, 129, 58, 0.12);
  color: var(--brand, #C0813A);
}
.ff-vaccin-clip-btn:active {
  transform: scale(0.94);
}
.ff-vaccin-clip-btn.is-flash {
  background: #d1fae5;
  color: #16a34a;
  transform: scale(1.08);
}
.ff-vaccin-clip-btn-paste {
  background: rgba(192, 129, 58, 0.16);
  color: var(--brand, #C0813A);
  border-color: rgba(192, 129, 58, 0.30);
}

/* Bloc "Prochain rappel..." : inline a droite de la date.
   Sur ecran etroit (< 600px) bascule sous la date pour preserver la lisibilite.
   La ligne ff-vaccine-date-row passe en flex-wrap pour permettre ce comportement. */
.ff-vaccine-date-row {
  flex-wrap: wrap;
}
.ff-vaccin-remain {
  flex: 1 1 auto;
  min-width: 0;
  display: inline-flex;
  align-items: center;
}
.ff-vaccin-remain-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.ff-vaccin-remain-ok      { background: #d1fae5; color: #15803d; }
.ff-vaccin-remain-soon    { background: #fef3c7; color: #b45309; }
.ff-vaccin-remain-expired { background: #fee2e2; color: #b91c1c; }
@media (max-width: 600px) {
  .ff-vaccin-remain {
    flex: 1 1 100%;
    margin-top: 4px;
  }
}

/* =========================================================================
 * Pre-visite - Header 3 zones (client / date / status)
 * ========================================================================= */
.pv-header {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  margin-bottom: 16px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
}
.pv-header-client {
  justify-self: start;
  font-size: 18px;
  font-weight: 700;
  color: #111827;
}
.pv-header-date {
  justify-self: center;
  font-size: 15px;
  font-weight: 600;
  color: #374151;
  text-align: center;
}
.pv-header-status {
  justify-self: end;
}
@media (max-width: 640px) {
  .pv-header {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .pv-header-client,
  .pv-header-date,
  .pv-header-status {
    justify-self: center;
  }
}

/* =========================================================================
 * Pre-visite - Grille 2 cards (RDV + Animal)
 * ========================================================================= */
.pv-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 18px;
}
@media (max-width: 700px) {
  .pv-info-grid { grid-template-columns: 1fr; }
}
.pv-info-card {
  display: grid;
  grid-template-columns: 64px 1fr;
  grid-template-rows: auto 1fr auto;
  gap: 0 14px;
  padding: 14px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
}
.pv-info-card-icon {
  grid-row: 1 / span 2;
  width: 64px;
  height: 64px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}
.pv-info-icon-rdv    { background: linear-gradient(135deg, #0ea5e9, #0369a1); }
.pv-info-icon-animal { background: linear-gradient(135deg, #f97316, #c2410c); }

/* Silhouette animal realiste : SVG noir d'origine -> blanc force par filtre,
 * pour ressortir sur le fond orange de la card animal. */
.pv-animal-silhouette {
  width: 42px;
  height: 42px;
  object-fit: contain;
  filter: brightness(0) invert(1);
  pointer-events: none;
}
.pv-info-card-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}
.pv-info-card-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #6b7280;
}
.pv-info-card-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  font-size: 14px;
  color: #111827;
  min-width: 0;
}
.pv-info-card-row strong { font-weight: 700; }
.pv-info-card-label {
  color: #6b7280;
  font-weight: 500;
}
.pv-info-card-value { font-weight: 600; }
.pv-info-card-sub {
  font-size: 13px;
  color: #6b7280;
  margin-top: 2px;
}
.pv-info-card-actions {
  grid-column: 1 / -1;
  margin-top: 10px;
  display: flex;
  justify-content: flex-end;
}

/* =========================================================================
 * Pre-visite - Bouton actions principales sur la meme ligne
 * ========================================================================= */
/* Annuler a gauche en taille naturelle, Marquer realisee aligne a droite
 * (margin-left:auto). Plus de flex stretch : sur iPad on a la place. */
.pv-actions-row {
  display: flex;
  gap: 10px;
  margin-top: 16px;
  align-items: center;
}
.pv-actions-row .btn { flex: 0 0 auto; }
.pv-actions-row .btn-primary,
.pv-actions-row .btn-large {
  margin-left: auto;
  min-width: 220px;
}
@media (max-width: 480px) {
  .pv-actions-row { flex-direction: column; align-items: stretch; }
  .pv-actions-row .btn,
  .pv-actions-row .btn-primary,
  .pv-actions-row .btn-large {
    margin-left: 0;
    min-width: 0;
  }
}

/* =========================================================================
 * Modal "Modifier client / animal lie"
 * ========================================================================= */
.pv-edit-link-modal { max-width: 460px; }
.pv-edit-link-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
}
.pv-edit-link-intro {
  margin: 0 0 6px 0;
  font-size: 14px;
  color: #374151;
}
.pv-edit-link-action {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  text-align: left;
  cursor: pointer;
  transition: background .15s, border-color .15s, transform .05s;
}
.pv-edit-link-action:hover {
  background: #f3f4f6;
  border-color: #d1d5db;
}
.pv-edit-link-action:active { transform: scale(.99); }
.pv-edit-link-action-icon {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: 10px;
  background: #ea580c;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pv-edit-link-action-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.pv-edit-link-action-title {
  font-size: 15px;
  font-weight: 600;
  color: #111827;
}
.pv-edit-link-action-sub {
  font-size: 13px;
  color: #6b7280;
}

/* =========================================================================
 * Modal "Confirmer pre-visite realisee" : date, heure, duree, adresse
 * ========================================================================= */
.pv-mark-done-modal { max-width: 480px; }
.pv-mark-done-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
}
.pv-mark-done-intro {
  margin: 0 0 4px 0;
  font-size: 13px;
  color: #6b7280;
  line-height: 1.4;
}
.pv-mark-done-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.pv-mark-done-row label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #6b7280;
}
.pv-mark-done-row-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.pv-mark-done-row-2col > div {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.pv-mark-done-err {
  margin: 4px 0 0 0;
  font-size: 13px;
}
.pv-mark-done-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 12px 16px;
  border-top: 1px solid #f3f4f6;
}
.pv-mark-done-footer .btn { flex: 0 0 auto; }
.pv-mark-done-footer .btn-primary { min-width: 160px; }

/* =========================================================================
 * Modal "Modifier les infos rapidement" (client / animal) - formulaire inline
 * ========================================================================= */
.pv-inline-edit-modal { max-width: 560px; }
.pv-inline-edit-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  max-height: 70vh;
  overflow-y: auto;
}
.pv-inline-edit-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.pv-inline-edit-row label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #6b7280;
}
.pv-inline-edit-row-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.pv-inline-edit-row-3col {
  display: grid;
  grid-template-columns: 110px 1fr 1fr;
  gap: 10px;
}
.pv-inline-edit-row-2col > div,
.pv-inline-edit-row-3col > div {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.pv-inline-edit-check {
  justify-content: flex-end;
}
.pv-inline-edit-check-label {
  display: flex !important;
  flex-direction: row !important;
  align-items: center;
  gap: 8px;
  font-size: 13px !important;
  text-transform: none !important;
  letter-spacing: normal !important;
  color: #374151 !important;
  font-weight: 500 !important;
  padding-top: 26px;
  cursor: pointer;
}
.pv-inline-edit-check-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
}
@media (max-width: 600px) {
  .pv-inline-edit-row-2col,
  .pv-inline-edit-row-3col { grid-template-columns: 1fr; }
  .pv-inline-edit-check-label { padding-top: 0; }
}

/* List items reutilises par les pickers client/animal */
.ff-modal-list .list-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 12px 14px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  margin-bottom: 6px;
  cursor: pointer;
  text-align: left;
  transition: background .15s, border-color .15s;
}
.ff-modal-list .list-item:hover {
  background: #f9fafb;
  border-color: #d1d5db;
}
.ff-modal-list .list-item-main { flex: 1; min-width: 0; }
.ff-modal-list .list-item-title {
  font-size: 14px;
  font-weight: 600;
  color: #111827;
}
.ff-modal-list .list-item-sub {
  font-size: 12px;
  color: #6b7280;
  margin-top: 2px;
}
.ff-modal-list .list-item-chevron {
  color: #9ca3af;
  font-size: 22px;
  line-height: 1;
}
.ff-modal-list .list-placeholder,
.ff-modal-list .list-empty {
  padding: 24px 16px;
  text-align: center;
  color: #6b7280;
  font-size: 14px;
}
.ff-modal-search {
  padding: 10px 16px 0 16px;
}
.ff-modal-search .search-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  font-size: 14px;
}
