* { box-sizing: border-box; }
:root {
  --primary: #2D18FA;
  --primary-light: #EEEBFF;
  --primary-dark: #2614D5;
  --sidebar-bg: #12152b;
  --sidebar-bg-hover: #1c2040;
  --ink: #1f2430;
  --muted: #6b7280;
  --border: #e8e9f0;
}
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #f6f7fb;
  color: var(--ink);
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
svg.icon { display: inline-block; vertical-align: middle; flex-shrink: 0; }

.app-shell { display: flex; min-height: 100vh; }

/* ===================================================================
   Sidebar
   =================================================================== */
.sidebar {
  width: 252px;
  background: var(--sidebar-bg);
  color: #aab0c6;
  padding: 0 0 16px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
}
/* [ajouté 07/10] Menu plus long (Offres, Comparateur, Cotations, Commandes, Factures) : sur grand écran il reste fixe et défile seul, pour que « Déconnexion » reste atteignable. */
@media (min-width: 769px) {
  .sidebar { position: sticky; top: 0; height: 100vh; overflow-y: auto; align-self: flex-start; }
}
.sidebar .brand {
  display: flex; align-items: center; gap: 10px;
  padding: 18px 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  margin-bottom: 10px;
}
/* [remplacé 05/10, intégration du logo réel] .brand-mark/.brand-text (carré "S" + texte) remplacés par le vrai logo Suivora360 (icône + wordmark, fond blanc recoloré en blanc pour la sidebar sombre — voir logo-suivora360.md). */
.sidebar .brand-logo { height: 30px; width: auto; max-width: 100%; flex-shrink: 0; display: block; }
.sidebar .brand-tagline { font-size: 11px; color: #7d84a0; padding: 0 20px 10px; margin-top: -2px; }
.sidebar .brand-close { margin-left: auto; background: none; border: none; color: #aab0c6; font-size: 18px; cursor: pointer; display: none; }
.sidebar .org-name { font-size: 12px; color: #7d84a0; padding: 0 20px 14px; }
.sidebar nav { flex: 1; padding: 0 12px; }
.sidebar nav a {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 12px;
  color: #aab0c6;
  font-size: 13.5px;
  border-radius: 9px;
  margin-bottom: 2px;
}
.sidebar nav a svg { opacity: .85; }
.sidebar nav a:hover { background: var(--sidebar-bg-hover); text-decoration: none; color: #fff; }
.sidebar nav a.active { background: var(--primary); color: #fff; font-weight: 600; }
.sidebar nav a.active svg { opacity: 1; }
.sidebar .section-label { padding: 16px 12px 6px; font-size: 10.5px; text-transform: uppercase; color: #565d7a; letter-spacing: .06em; font-weight: 700; }
.sidebar .user-box { margin-top: auto; padding: 14px 16px 4px; border-top: 1px solid rgba(255,255,255,.08); display: flex; align-items: center; gap: 10px; }
.sidebar .user-box .ub-avatar { width: 34px; height: 34px; border-radius: 999px; background: var(--primary-light); color: var(--primary); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; flex-shrink: 0; }
.sidebar .user-box .ub-name { font-size: 13px; color: #fff; font-weight: 600; line-height: 1.3; }
.sidebar .user-box .role { color: #7d84a0; font-size: 11.5px; }
.sidebar form { margin: 8px 16px 0; }
.sidebar button.logout {
  width: 100%; padding: 8px; background: transparent; color: #aab0c6; border: 1px solid rgba(255,255,255,.12);
  border-radius: 8px; cursor: pointer; font-size: 12.5px; display: flex; align-items: center; justify-content: center; gap: 6px;
}
.sidebar button.logout:hover { background: var(--sidebar-bg-hover); color: #fff; }

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.content { padding: 28px 32px; }

h1 { font-size: 25px; margin: 0 0 4px; letter-spacing: -.01em; }
h2 { font-size: 16px; margin: 0 0 14px; }
.subtitle { color: var(--muted); font-size: 14px; margin-bottom: 24px; }

.btn {
  display: inline-flex; align-items: center; gap: 7px; padding: 9px 16px; border-radius: 8px; border: none;
  background: var(--primary); color: #fff; font-size: 14px; cursor: pointer; font-weight: 600;
}
.btn:hover { background: var(--primary-dark); text-decoration: none; }
.btn-secondary { background: #eef0f4; color: #333; }
.btn-secondary:hover { background: #e2e4ea; }
.btn-danger { background: #b91c1c; color: #fff; }
.btn-danger:hover { background: #991b1b; }
.btn-sm { padding: 5px 10px; font-size: 12px; }

.card { background: #fff; border-radius: 14px; padding: 20px 22px; box-shadow: 0 1px 2px rgba(16,24,40,.05), 0 1px 1px rgba(16,24,40,.03); margin-bottom: 20px; border: 1px solid var(--border); }

.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 16px; margin-bottom: 24px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 900px) { .grid-2 { grid-template-columns: 1fr; } }

.bar-chart { display: flex; align-items: flex-end; gap: 10px; height: 140px; padding-top: 10px; }
.bar-chart .bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; }
.bar-chart .bar { width: 100%; max-width: 34px; background: var(--primary); border-radius: 4px 4px 0 0; min-height: 2px; }
.bar-chart .bar-n { font-size: 12px; font-weight: 600; margin-bottom: 4px; }
.bar-chart .bar-label { font-size: 11px; color: #888; margin-top: 6px; }

.kpi-note { font-size: 12px; color: #999; margin-top: 4px; }
.stat-tile { background: #fff; border-radius: 12px; padding: 18px 20px; box-shadow: 0 1px 2px rgba(0,0,0,.05); border: 1px solid var(--border); }
.stat-tile .value { font-size: 28px; font-weight: 700; }
.stat-tile .label { font-size: 13px; color: #666; margin-top: 4px; }
.stat-tile-link { display: block; text-decoration: none; color: inherit; transition: box-shadow .15s, transform .15s; }
.stat-tile-link:hover { box-shadow: 0 4px 10px rgba(0,0,0,.08); transform: translateY(-1px); }

table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 12px; overflow: hidden; }
th, td { padding: 13px 14px; text-align: left; font-size: 13.5px; border-bottom: 1px solid #f0f1f6; }
th { background: #fafbfd; font-weight: 600; color: #6b7280; font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: #fafbfd; }
tr.row-clickable, tr[onclick] { cursor: pointer; }
tr.row-clickable:hover td, tr[onclick]:hover td { background: #f8f7ff; }
td.col-arrow, th.col-arrow { width: 28px; text-align: right; padding-left: 4px; padding-right: 16px; }

/* Petite flèche d'affordance "cliquable" utilisée en fin de ligne/carte */
.row-arrow { display: inline-flex; align-items: center; justify-content: center; color: #9ca3af; transition: transform .15s, color .15s; }
.row-arrow svg { width: 16px; height: 16px; }
tr:hover .row-arrow, a:hover .row-arrow, li:hover .row-arrow, .hover-arrow:hover .row-arrow { color: var(--primary); transform: translateX(2px); }

/* Avatar rond à initiales colorées (collaborateurs) */
.avatar-circle { display: inline-flex; align-items: center; justify-content: center; border-radius: 999px; font-weight: 700; flex-shrink: 0; }
.avatar-with-name { display: flex; align-items: center; gap: 10px; }

/* Vignette carrée colorée générique (remplace les photos produit absentes) */
.thumb-icon { width: 40px; height: 40px; border-radius: 9px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; background: var(--primary-light); color: var(--primary); }

.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.badge-yellow { background: #fef3c7; color: #92400e; }
.badge-blue { background: #dbeafe; color: #1e40af; }
.badge-green { background: #d1fae5; color: #065f46; }
.badge-red { background: #fee2e2; color: #991b1b; }
.badge-orange { background: #ffedd5; color: #9a3412; }
.badge-gray { background: #f1f2f5; color: #4b5563; }

.form-group { margin-bottom: 12px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
label { display: block; font-size: 12.5px; font-weight: 600; margin-bottom: 4px; color: #333; }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=number], input[type=tel], textarea, select {
  width: 100%; padding: 6px 10px; border: 1px solid #d7dae0; border-radius: 6px; font-size: 13px; font-family: inherit; line-height: 1.35;
}
input[type=text], input[type=email], input[type=password], input[type=date], input[type=number], input[type=tel], select { height: 34px; }
select, textarea, input[type=text], input[type=email], input[type=password], input[type=date], input[type=number], input[type=tel] { background-color: #fff; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }
textarea { resize: vertical; }

.alert { padding: 12px 16px; border-radius: 8px; margin-bottom: 20px; font-size: 14px; }
.alert-succes { background: #d1fae5; color: #065f46; }
.alert-erreur { background: #fee2e2; color: #991b1b; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid #e5e7eb; margin-bottom: 20px; }
.tabs a { padding: 10px 4px; margin-right: 20px; font-size: 14px; color: #666; border-bottom: 2px solid transparent; }
.tabs a.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }

.detail-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; }
/* [corrigé 04/10] Ce retour à une seule colonne sous 900px ne s'appliquait
   en réalité jamais : il était défini plus haut dans le fichier (ancienne
   position), et la règle de base ci-dessus (sans condition media), placée
   après lui dans le fichier, l'emportait systématiquement dans la cascade à
   spécificité égale — quel que soit la largeur d'écran. Repéré en testant le
   tableau de bord sur mobile (ses 2 colonnes ne s'empilaient jamais), mais
   touche 7 écrans au total (Dashboard, Commandes, Consultations, Cotations,
   Dossiers, Demandes). Règle désormais placée après la règle de base qu'elle
   doit surcharger, pour qu'elle s'applique réellement. */
@media (max-width: 900px) { .detail-grid { grid-template-columns: 1fr; } }
.info-row { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid #f1f2f5; font-size: 14px; }
.info-row:last-child { border-bottom: none; }
.info-row .label { color: #666; }
.empty-state { color: #999; font-size: 14px; padding: 20px 0; text-align: center; }

.stage-select { padding: 6px 10px; border-radius: 6px; border: 1px solid #d7dae0; font-weight: 600; }

.access-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.access-grid label { display: flex; align-items: center; gap: 6px; font-weight: 400; background: #f7f8fa; padding: 6px 10px; border-radius: 6px; }
.access-grid input { width: auto; }

/* ===================================================================
   Barre supérieure (topbar) — organisation active + notifications + profil
   =================================================================== */
.topbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 32px; background: #fff; border-bottom: 1px solid var(--border); gap: 16px; flex-wrap: wrap;
}
.topbar .topbar-org {
  display: flex; align-items: center; gap: 8px; font-weight: 600; color: #333; font-size: 13.5px;
  background: #fff; border: 1px solid var(--border); padding: 8px 14px; border-radius: 10px;
}
.topbar .topbar-org svg { color: var(--primary); }
.topbar .topbar-filiale { display: flex; align-items: center; gap: 8px; margin: 0; background: #f1efff; border: 1px solid #d9d4ff; padding: 5px 6px 5px 12px; border-radius: 10px; }
.topbar .topbar-filiale label { margin: 0; font-size: 12.5px; font-weight: 700; color: var(--primary); }
.topbar .topbar-filiale select { width: auto; max-width: 200px; padding: 6px 10px; font-size: 13px; font-weight: 600; border-radius: 8px; background: #fff; }
.topbar .topbar-right { display: flex; align-items: center; gap: 12px; }
.topbar .bell-link {
  position: relative; color: #555; text-decoration: none; width: 38px; height: 38px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center; border: 1px solid var(--border);
}
.topbar .bell-link:hover { background: #f7f8fa; }
.topbar .bell-dot { position: absolute; top: -5px; right: -5px; background: #dc2626; color: #fff; font-size: 10px; font-weight: 700; border-radius: 999px; padding: 1px 5px; border: 2px solid #fff; }
.topbar .avatar { width: 36px; height: 36px; border-radius: 999px; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; text-decoration: none; }

/* ===================================================================
   Module Pilotage — palette violette dédiée + composants (spec Pilotage v2)
   =================================================================== */
:root { --pilotage-violet: var(--primary); --pilotage-violet-light: var(--primary-light); }

.pilotage-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 6px; }
.pilotage-header h1 { color: var(--ink); }
.pilotage-actions { display: flex; align-items: center; gap: 10px; }
.btn-pilotage { background: var(--pilotage-violet); }
.btn-pilotage:hover { background: var(--primary-dark); }

.pilotage-tabs { display: flex; gap: 4px; border-bottom: 1px solid #e5e7eb; margin: 18px 0 20px; }
.pilotage-tabs a { padding: 10px 18px; font-size: 14px; font-weight: 600; color: #666; border-bottom: 2px solid transparent; border-radius: 6px 6px 0 0; }
.pilotage-tabs a.active { color: var(--pilotage-violet); border-bottom-color: var(--pilotage-violet); }
.pilotage-tabs a:hover { text-decoration: none; background: #f7f8fa; }

.filter-bar { background: #fff; border-radius: 14px; padding: 16px 20px; box-shadow: 0 1px 2px rgba(0,0,0,.05); margin-bottom: 20px; border: 1px solid var(--border); }
.filter-bar form { display: flex; gap: 14px; flex-wrap: wrap; align-items: flex-end; }
.filter-bar .f-group { display: flex; flex-direction: column; gap: 5px; min-width: 165px; flex: 1; }
.filter-bar .f-group label { font-size: 11px; text-transform: uppercase; letter-spacing: .03em; color: #888; margin: 0; font-weight: 700; }
.filter-bar .f-group .f-input-wrap { position: relative; display: flex; align-items: center; }
.filter-bar .f-group .f-input-wrap svg { position: absolute; left: 11px; color: var(--primary); pointer-events: none; }
.filter-bar .f-group .f-input-wrap select,
.filter-bar .f-group .f-input-wrap input { padding-left: 34px; }
.filter-bar .f-group select, .filter-bar .f-group input {
  padding: 9px 12px; font-size: 13px; border-radius: 999px; border: 1px solid #e2e4ee; background: #fafbfd; font-weight: 600; color: #2b2f3d;
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}
.filter-bar .f-group input[type=date] { background-image: none; }
.filter-bar .f-actions { display: flex; gap: 8px; }
.filter-bar .f-custom-dates { display: none; gap: 10px; }
.filter-bar .f-custom-dates.show { display: flex; }
.filter-bar .period-label { font-size: 12px; color: #777; margin-top: 10px; display: flex; align-items: center; gap: 6px; }

.kpi-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin-bottom: 20px; }
.kpi-card { background: #fff; border-radius: 14px; padding: 18px 20px; box-shadow: 0 1px 2px rgba(0,0,0,.05); display: flex; gap: 14px; align-items: flex-start; cursor: default; border: 1px solid var(--border); }
.kpi-card.clickable { cursor: pointer; transition: box-shadow .15s, transform .15s, border-color .15s; }
.kpi-card.clickable:hover { box-shadow: 0 6px 16px rgba(80,54,245,.12); transform: translateY(-1px); border-color: #d9d4fb; }
.kpi-icon { width: 44px; height: 44px; border-radius: 11px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; background: var(--pilotage-violet-light); color: var(--primary); }
.kpi-icon.green { background: #d1fae5; color: #059669; }
.kpi-icon.blue { background: #dbeafe; color: #2563eb; }
.kpi-icon.orange { background: #ffedd5; color: #c2410c; }
.kpi-icon.red { background: #fee2e2; color: #dc2626; }
.kpi-icon.teal { background: #ccfbf1; color: #0d9488; }
.kpi-body { min-width: 0; }
.kpi-body .kpi-label { font-size: 13px; color: #666; display: flex; align-items: center; gap: 5px; }
.kpi-body .kpi-value { font-size: 24px; font-weight: 700; margin-top: 2px; color: var(--ink); }
.kpi-body .kpi-sub { font-size: 12px; color: #999; margin-top: 3px; }
.kpi-body .kpi-warn, .card > .kpi-warn { font-size: 11px; color: #b45309; margin-top: 3px; display: flex; align-items: center; gap: 4px; }
.card > .kpi-warn { margin-top: 10px; }
.kpi-body .kpi-link { font-size: 11.5px; color: var(--primary); font-weight: 700; margin-top: 4px; display: inline-flex; align-items: center; gap: 4px; }
/* [ajouté 05/10, report de la maquette] Note de portée sous une rangée de KPI (ex. liste Demandes) — précise la période/le périmètre des chiffres affichés. */
.scope-note { font-size: 12px; color: #888; margin: -12px 0 18px; }

/* [ajouté 05/10, report de la maquette] Bandeau d'infos compact en tête de
   fiche (ex. demande) — remplace une série de kv-row verticales par des
   blocs horizontaux pour les champs de suivi les plus consultés. */
.info-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); background: #fafbfd; border: 1px solid var(--border); border-radius: 14px; margin: 18px 0 20px; }
.info-strip .ii { display: flex; gap: 10px; align-items: flex-start; padding: 16px 20px; border-right: 1px solid var(--border); }
.info-strip .ii:last-child { border-right: none; }
.info-strip .ii svg { color: var(--primary); margin-top: 1px; flex-shrink: 0; }
.info-strip .ii .il { font-size: 11px; text-transform: uppercase; letter-spacing: .03em; color: #888; font-weight: 700; }
.info-strip .ii .iv { font-size: 13.5px; font-weight: 600; color: var(--ink); margin-top: 2px; }
@media (max-width: 720px) {
  .info-strip { grid-template-columns: 1fr 1fr; }
  .info-strip .ii:nth-child(2n) { border-right: none; }
}

/* Badge de tendance (comparaison vs période précédente) — cartes KPI Pilotage */
.trend-badge { display: inline-flex; align-items: center; gap: 3px; font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 999px; vertical-align: middle; }
.trend-badge.trend-up { background: #d1fae5; color: #059669; }
.trend-badge.trend-down { background: #fee2e2; color: #dc2626; }
.trend-badge.trend-flat { background: #f1f2f5; color: #6b7280; }

/* Carte Alertes (tableau de bord) — ce qui traîne au-delà d'un seuil */
.alert-card { border-color: #fecaca; }

/* Points d'attention rentabilité (Pilotage — Vue générale, aide à la décision) */
.reco-list { display: flex; flex-direction: column; gap: 10px; }
.reco-item { display: flex; gap: 10px; padding: 12px 14px; border-radius: 10px; background: #fef2f2; border: 1px solid #fecaca; }
.reco-item.niveau-info { background: #eff6ff; border-color: #bfdbfe; }
.reco-item .reco-icon { flex-shrink: 0; width: 30px; height: 30px; border-radius: 8px; display: flex; align-items: center; justify-content: center; background: #fee2e2; color: #b91c1c; }
.reco-item.niveau-info .reco-icon { background: #dbeafe; color: #1d4ed8; }
.reco-item .reco-body { flex: 1; min-width: 0; }
.reco-item .reco-titre { font-weight: 700; font-size: 13.5px; color: var(--ink); margin-bottom: 2px; }
.reco-item .reco-message { font-size: 12.5px; color: #555; line-height: 1.4; }

/* Info-bulle CSS pure (spec : chaque carte a une infobulle expliquant son calcul) */
.info-tip { display: inline-flex; align-items: center; justify-content: center; width: 15px; height: 15px; border-radius: 999px; background: #e5e7eb; color: #666; font-size: 10px; font-weight: 700; font-style: normal; cursor: help; position: relative; }
.info-tip:hover::after, .info-tip:focus::after { content: attr(data-tip); position: absolute; left: 50%; bottom: 130%; transform: translateX(-50%); background: #1f2430; color: #fff; font-size: 11px; font-weight: 400; line-height: 1.4; padding: 8px 10px; border-radius: 6px; width: 240px; white-space: normal; z-index: 20; box-shadow: 0 4px 12px rgba(0,0,0,.2); }

.chart-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 20px; }
@media (max-width: 1100px) { .chart-row { grid-template-columns: 1fr; } }

.hbar-list .hbar-item { margin-bottom: 18px; }
.hbar-list .hbar-item:last-child { margin-bottom: 0; }
.hbar-list .hbar-label { font-size: 13.5px; font-weight: 700; margin-bottom: 7px; display: flex; justify-content: space-between; cursor: pointer; color: var(--ink); }
.hbar-list .hbar-row { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.hbar-list .hbar-track { flex: 1; background: #f1f2f8; border-radius: 999px; height: 9px; overflow: hidden; }
.hbar-list .hbar-fill { height: 100%; border-radius: 999px; background: var(--pilotage-violet); }
.hbar-list .hbar-fill.secondary { background: #cfcbfb; }
.hbar-list .hbar-value { font-size: 12.5px; color: #666; font-weight: 600; min-width: 72px; text-align: right; flex-shrink: 0; }
.hbar-list .hbar-value.cell-na { color: #b45309; font-weight: 500; min-width: 0; }

.donut-wrap { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; justify-content: center; }
.donut { width: 172px; height: 172px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.donut-center { width: 112px; height: 112px; border-radius: 50%; background: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.donut-center .val { font-size: 17px; font-weight: 700; }
.donut-center .lbl { font-size: 10.5px; color: #888; }
.donut-legend { display: flex; flex-direction: column; gap: 11px; }
.donut-legend .leg-item { display: flex; align-items: center; gap: 9px; font-size: 13px; cursor: pointer; font-weight: 600; }
.donut-legend .dot { width: 10px; height: 10px; border-radius: 999px; flex-shrink: 0; }
.donut-legend .leg-val { color: #888; font-size: 12px; margin-left: auto; padding-left: 14px; font-weight: 700; }

.linechart-svg { width: 100%; height: auto; }
.linechart-legend { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 10px; font-size: 12px; }
.linechart-legend .leg-item { display: flex; align-items: center; gap: 6px; font-weight: 600; }
.linechart-legend .dot { width: 9px; height: 9px; border-radius: 999px; }

.pilotage-table td.num, .pilotage-table th.num { text-align: right; }
.pilotage-table tr.row-clickable { cursor: pointer; }
.pilotage-table tr.row-total td { font-weight: 700; background: #fafbfc; border-top: 2px solid #e5e7eb; }
.pilotage-table .lien-detail { font-size: 12px; text-align: right; white-space: nowrap; }
.pilotage-table .cell-na { color: #b45309; font-style: italic; font-size: 12.5px; }

.direction-banner { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: #6b7280; background: #f7f8fa; padding: 8px 14px; border-radius: 8px; }
.direction-banner strong { color: #444; }

.explication-block .exp-item { display: flex; gap: 12px; margin-bottom: 16px; }
.explication-block .exp-item:last-child { margin-bottom: 0; }
.explication-block .exp-icon { width: 34px; height: 34px; border-radius: 9px; background: var(--pilotage-violet-light); color: var(--primary); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.explication-block .exp-title { font-weight: 700; font-size: 13.5px; }
.explication-block .exp-text { font-size: 12.5px; color: #777; }
.explication-block .exp-link { font-size: 12.5px; font-weight: 700; display: flex; align-items: center; gap: 5px; margin-top: 6px; }

.empty-donnees { text-align: center; padding: 30px 20px; color: #888; }
.empty-donnees .icon { font-size: 30px; margin-bottom: 8px; }

.badge-fictif { background: #fef3c7; color: #92400e; font-size: 11px; padding: 4px 10px; border-radius: 999px; font-weight: 700; }

/* Onglet "Détail" : panneau latéral avec sélecteur + stats + CTA */
.detail-panel-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.detail-panel-stat { text-align: right; }
.detail-panel-stat .v { font-weight: 700; font-size: 16px; }
.detail-panel-stat .l { color: #888; font-size: 12px; }

/* ===================================================================
   Tableau de bord — cartes & timeline (maquette v2)
   =================================================================== */
.dash-kpi-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; margin-bottom: 20px; }
.dash-kpi { background: #fff; border-radius: 14px; padding: 18px 20px; box-shadow: 0 1px 2px rgba(0,0,0,.05); display: flex; gap: 13px; align-items: center; text-decoration: none; color: inherit; transition: box-shadow .15s, transform .15s, border-color .15s; border: 1px solid var(--border); }
.dash-kpi:hover { box-shadow: 0 6px 16px rgba(80,54,245,.12); transform: translateY(-1px); text-decoration: none; border-color: #d9d4fb; }
.dash-kpi .dk-icon { width: 46px; height: 46px; border-radius: 12px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.dash-kpi .dk-value { font-size: 24px; font-weight: 700; line-height: 1.2; }
.dash-kpi .dk-label { font-size: 12.5px; color: #666; font-weight: 600; }
.dash-kpi .dk-link { font-size: 11.5px; color: var(--pilotage-violet); font-weight: 700; margin-top: 3px; display: flex; align-items: center; gap: 4px; }

.ops-row { background: #fff; border-radius: 14px; padding: 16px 20px; box-shadow: 0 1px 2px rgba(0,0,0,.05); margin-bottom: 20px; display: flex; align-items: center; gap: 4px; border: 1px solid var(--border); }
.ops-row h2 { font-size: 14px; margin: 0; white-space: nowrap; color: #444; display: flex; align-items: center; gap: 8px; margin-right: 12px; }
.ops-row h2 svg { color: var(--primary); }
.ops-items { display: flex; align-items: center; flex-wrap: wrap; flex: 1; }
.ops-item { display: flex; align-items: center; gap: 9px; padding: 8px 14px; text-decoration: none; color: #333; }
.ops-item:hover { text-decoration: none; }
.ops-item:hover .oi-n { color: var(--primary); }
.ops-item .oi-icon { width: 32px; height: 32px; border-radius: 9px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.ops-item .oi-n { font-weight: 700; font-size: 16px; transition: color .15s; }
.ops-item .oi-label { font-size: 11.5px; color: #777; }
.ops-sep { color: #d5d7e2; padding: 0 2px; display: flex; align-items: center; }
.ops-sep svg { width: 16px; height: 16px; }

/* [ajouté 04/10, maquette de référence de Marie Laure] Grille du tableau de
   bord sous les indicateurs : sur ordinateur, une grille 2 colonnes où
   "Suivi des opérations" occupe toute la largeur en haut et "Actions
   prioritaires" (gauche) s'étend sur la hauteur des 3 cartes de droite —
   tout aligné sur les mêmes colonnes/marges que la ligne d'indicateurs
   au-dessus (même conteneur, pas de largeur ou marge spécifique à ce bloc).
   Sur téléphone, passage en colonne unique en flexbox pour pouvoir réordonner
   les blocs sans dupliquer de HTML : "Actions prioritaires" d'abord, puis
   "Suivi des opérations" (repliable, cf. .ops-collapse), puis le reste —
   demande explicite de Marie Laure ("Placer le récapitulatif des opérations
   dans un bloc repliable après les priorités"). */
.dash-grid { display: grid; grid-template-columns: 2fr 1fr; grid-template-rows: auto auto auto auto; gap: 20px; }
.dash-grid > .dg-ops { grid-column: 1 / -1; grid-row: 1; margin-bottom: 0; }
.dash-grid > .dg-actions { grid-column: 1; grid-row: 2 / span 3; margin-bottom: 0; }
.dash-grid > .dg-echeances { grid-column: 2; grid-row: 2; margin-bottom: 0; }
.dash-grid > .dg-demandes { grid-column: 2; grid-row: 3; margin-bottom: 0; }
.dash-grid > .dg-livraisons { grid-column: 2; grid-row: 4; margin-bottom: 0; }
@media (max-width: 900px) {
  .dash-grid { display: flex; flex-direction: column; grid-template-columns: none; }
  .dash-grid > .dg-actions { order: 1; }
  .dash-grid > .dg-ops { order: 2; }
  .dash-grid > .dg-echeances { order: 3; }
  .dash-grid > .dg-demandes { order: 4; }
  .dash-grid > .dg-livraisons { order: 5; }
}

/* [ajouté 04/10] "Suivi des opérations" replié par défaut sur téléphone
   uniquement (le triangle <summary> est masqué et le clic désactivé au-delà
   de 900px, pour conserver exactement le rendu "bandeau toujours visible"
   existant sur ordinateur). */
.ops-collapse { display: flex; align-items: center; }
.ops-collapse summary { list-style: none; cursor: default; display: flex; align-items: center; margin-right: 12px; }
.ops-collapse summary::-webkit-details-marker { display: none; }
.ops-collapse summary::marker { content: ''; }
.ops-collapse summary h2 { margin-right: 0; }
.ops-collapse .ops-chevron { display: none; margin-left: 10px; flex-shrink: 0; color: #999; }
.ops-collapse .ops-chevron svg { transform: rotate(-90deg); transition: transform .15s; }
.ops-collapse:not([open]) .ops-chevron svg { transform: rotate(90deg); }
.ops-collapse:not([open]) .ops-items { display: none; }
@media (max-width: 900px) {
  .ops-collapse { display: block; }
  .ops-collapse summary { cursor: pointer; margin-right: 0; }
  .ops-collapse .ops-chevron { display: inline-flex; }
}

/* [ajouté 04/10] Carte "Actions prioritaires" — fusion des anciens blocs
   Alertes + Mes priorités en une seule liste à onglets (En retard /
   Aujourd'hui / À venir), chaque demande/commande/cotation/offre n'y
   apparaissant qu'une fois (voir DashboardController::construireActionsPrioritaires). */
.prio-tabs { display: flex; gap: 4px; margin: 2px 0 14px; border-bottom: 1px solid #eef0f4; }
.prio-tab { background: none; border: none; padding: 9px 14px 11px; font-size: 13px; font-weight: 600; color: #888; cursor: pointer; border-bottom: 2px solid transparent; display: flex; align-items: center; gap: 7px; }
.prio-tab.active { color: var(--pilotage-violet); border-bottom-color: var(--pilotage-violet); }
.prio-tab .prio-tab-count { background: #f1f2f5; color: #666; font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 999px; }
.prio-tab.active .prio-tab-count { background: #EEEBFF; color: var(--pilotage-violet); }
.prio-list { list-style: none; margin: 0; padding: 0; }
.prio-item { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid #f1f2f5; cursor: pointer; }
.prio-item:last-child { border-bottom: none; }
.prio-type { width: 34px; height: 34px; border-radius: 9px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.prio-main { flex: 1.1 1 180px; min-width: 0; }
.prio-main .pm-title { font-weight: 600; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.prio-main .pm-ref { font-size: 11.5px; color: #888; }
.prio-action { flex: 1.4 1 200px; min-width: 0; font-size: 13px; color: #333; }
.prio-side { flex-shrink: 0; text-align: right; font-size: 12px; color: #666; min-width: 108px; }
.prio-side .ps-echeance { display: block; font-weight: 600; }
.prio-side .ps-resp { display: block; color: #999; font-size: 11.5px; margin-top: 2px; }
.prio-more-toggle { margin-top: 10px; background: none; border: none; color: var(--pilotage-violet); font-weight: 600; font-size: 12.5px; cursor: pointer; padding: 0; display: flex; align-items: center; gap: 4px; text-decoration: none; }
.prio-more-toggle svg { transform: rotate(90deg); }
@media (max-width: 700px) {
  .prio-item { flex-wrap: wrap; }
  .prio-action { flex-basis: 100%; order: 3; margin-top: 4px; }
  .prio-side { flex-basis: 100%; order: 4; text-align: left; margin-top: 4px; display: flex; gap: 14px; min-width: 0; }
}

.dossier-cell { display: flex; align-items: center; gap: 12px; }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid #f1f2f5; cursor: pointer; }
.timeline li:last-child { border-bottom: none; }
.timeline .tl-date { width: 46px; text-align: center; flex-shrink: 0; }
.timeline .tl-date .d { font-size: 17px; font-weight: 700; line-height: 1.1; }
.timeline .tl-date .m { font-size: 10.5px; color: #888; text-transform: uppercase; }
.timeline .tl-dot { width: 8px; height: 8px; border-radius: 999px; flex-shrink: 0; }
.timeline .tl-body { flex: 1; min-width: 0; }
.timeline .tl-title { font-weight: 600; font-size: 13.5px; }
.timeline .tl-sub { font-size: 12px; color: #888; }

/* [ajouté 04/10] Liste compacte pour la colonne de droite du tableau de bord
   (Dernières demandes, Livraisons à suivre) — même rythme que .timeline
   (ligne + séparateur fin) mais avec une puce icône colorée au lieu d'un
   bloc date, pour du contenu qui n'a pas de date "hero" à mettre en avant. */
.feed-list { list-style: none; margin: 0; padding: 0; }
.feed-list li { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid #f1f2f5; cursor: pointer; }
.feed-list li:last-child { border-bottom: none; }
.feed-list .fl-icon { width: 36px; height: 36px; border-radius: 10px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.feed-list .fl-body { flex: 1; min-width: 0; }
.feed-list .fl-title { font-weight: 600; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.feed-list .fl-sub { font-size: 12px; color: #888; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.feed-list .fl-meta { font-size: 11.5px; color: #999; flex-shrink: 0; text-align: right; line-height: 1.5; }

/* [ajouté 04/10] Tronque un intitulé long sur une seule ligne plutôt que de
   le laisser retourner à la ligne, sans jamais imposer de largeur fixe en
   pixels (la largeur dépend du conteneur flex parent — important sur
   téléphone, où une largeur fixe type 420px dépasserait le viewport). */
.truncate { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

@media (max-width: 768px) {
  .sidebar.sidebar-collapsible { position: fixed; top: 0; left: 0; bottom: 0; z-index: 50; transition: transform .2s ease; overflow-y: auto; }
  .sidebar.sidebar-collapsible.sidebar-hidden { transform: translateX(-100%); }
  .sidebar.sidebar-collapsible.sidebar-open { transform: translateX(0); box-shadow: 4px 0 16px rgba(0,0,0,.25); }
  .sidebar .brand-close { display: inline-block !important; }
  .content { padding: 16px; }
  .grid-3, .kpi-row, .dash-kpi-row { grid-template-columns: 1fr 1fr; }
  .chart-row { grid-template-columns: 1fr; }
  .filter-bar form { flex-direction: column; align-items: stretch; }
  .filter-bar .f-group { min-width: 0; }
  .ops-row { flex-direction: column; align-items: stretch; }
  .ops-items { flex-direction: column; align-items: stretch; }
  .ops-sep { display: none; }
  .donut-wrap { flex-direction: column; }
  table.responsive-cards thead { display: none; }
  table.responsive-cards, table.responsive-cards tbody, table.responsive-cards tr, table.responsive-cards td { display: block; width: 100%; }
  table.responsive-cards tr { margin-bottom: 10px; border: 1px solid #eef0f4; border-radius: 8px; padding: 6px 0; }
  table.responsive-cards td { border-bottom: none; padding: 6px 14px; text-align: right !important; }
  table.responsive-cards td::before { content: attr(data-label); float: left; font-weight: 600; color: #666; }
  table.responsive-cards td.col-arrow { display: none; }
  .topbar { padding: 12px 16px; }
}

@media (max-width: 480px) {
  .grid-3, .kpi-row, .grid-2 { grid-template-columns: 1fr; }
  /* [corrigé 04/10] .dash-kpi-row exclu volontairement : la maquette demande
     une grille 2×2 pour les 4 indicateurs du tableau de bord jusqu'aux plus
     petits écrans, pas un empilement vertical. La règle à 768px (2 colonnes)
     reste donc la dernière à s'appliquer pour ce composant. */

  /* [corrigé 04/10] Sur un écran étroit, "référence · statut" pouvait
     dépasser la largeur disponible (ex. "DEM-2026-00017 · À qualifier") :
     le badge de statut se retrouvait tronqué en "..." par l'ellipsis plutôt
     que de rester lisible. On autorise le retour à la ligne ici seulement
     (desktop/tablette gardent une ligne unique, où ça ne pose pas problème). */
  .feed-list .fl-sub { white-space: normal; }
}

/* [ajouté 04/10, refonte du module Demandes] Libellé au-dessus de la valeur,
   alignés à gauche — remplace .info-row (libellé à gauche / valeur plaquée
   à droite par justify-content:space-between) UNIQUEMENT dans les vues du
   module Demandes, pour corriger le chevauchement sur les messages longs
   sans toucher .info-row ailleurs dans l'application (Dossiers, Clients,
   Fournisseurs... non revus dans ce tour de travail). */
.kv-row { padding: 8px 0; border-bottom: 1px solid #f1f2f5; font-size: 14px; }
.kv-row:last-child { border-bottom: none; }
.kv-row .label { display: block; color: #666; font-size: 11.5px; text-transform: uppercase; letter-spacing: .02em; margin-bottom: 3px; }
.kv-row .value { display: block; text-align: left; }

/* [ajouté 04/10, refonte du module Demandes] Lien de type bouton texte
   (ex. "Créer rapidement un client") — même couleur qu'un lien classique
   mais rendu comme <button> pour rester actionnable au clavier sans
   dépendre d'une vraie navigation. */
.btn-link { background: none; border: none; padding: 0; color: var(--primary); font-weight: 600; font-size: inherit; cursor: pointer; text-decoration: underline; }

/* [ajouté 04/10] Onglets "Formulaire / Documents & affectation" du
   formulaire Demandes (création/modification) : sur ordinateur, les deux
   panneaux restent côte à côte (le bandeau d'onglets ne sert à rien et est
   masqué) ; sur mobile, un seul panneau visible à la fois — le JS de la vue
   bascule juste `display`, rien n'est jamais retiré du DOM, donc aucune
   saisie n'est perdue en changeant d'onglet. */
.form-tabs { display: none; gap: 4px; margin-bottom: 14px; border-bottom: 1px solid var(--border); }
.form-tabs .ft-btn { background: none; border: none; padding: 9px 14px 11px; font-size: 13px; font-weight: 600; color: #888; cursor: pointer; border-bottom: 2px solid transparent; }
.form-tabs .ft-btn.active { color: var(--primary); border-bottom-color: var(--primary); }
@media (max-width: 900px) {
  .form-tabs { display: flex; }
}

/* [ajouté 06/10, report de la maquette Dossiers] .kv-row (ajoutée pour
   Demandes le 04/10, voir note ci-dessus) est désormais aussi utilisée par
   la fiche Dossier (onglets Synthèse/Besoin) — même raison : libellé
   au-dessus de la valeur, pas de chevauchement sur les contenus longs. */

/* [ajouté 06/10, corrigé 06/10 pour coller précisément aux valeurs de
   shared.css de la maquette Dossiers] Onglets de la fiche Dossier
   (Synthèse / Besoin / Achats et offres / Cotations client / Exécution /
   Documents / Équipe et historique) — vraies pages (lien ?onglet=...), pas
   un simple bascule JS, la fiche étant trop volumineuse pour tout garder
   chargé en même temps. */
.dos-tabs { display: flex; gap: 2px; border-bottom: 1px solid #e5e7eb; margin: 18px 0 22px; flex-wrap: wrap; }
.dos-tab { padding: 11px 18px; font-size: 13.5px; font-weight: 600; color: #666; border-bottom: 2px solid transparent; }
.dos-tab:hover { text-decoration: none; background: #f7f8fa; }
.dos-tab.active { color: var(--primary); border-bottom-color: var(--primary); }

/* [ajouté 06/10] Bandeau d'en-tête de la fiche Dossier (Activité,
   Responsable, Priorité, Échéances) — même esprit que .info-strip côté
   Demandes (05/10), adapté aux champs du Dossier. Valeurs reprises à
   l'identique du <style> local de Synthese.dc.html (maquette). */
.fiche-header-meta { display: flex; flex-wrap: wrap; gap: 18px 28px; margin-top: 10px; }
.fhm-item { font-size: 12.5px; }
.fhm-item .fhm-label { color: #888; font-size: 11px; }
.fhm-item .fhm-value { color: var(--ink); font-weight: 600; margin-top: 2px; }

/* [ajouté 06/10] Grille de cartes de l'onglet Synthèse — idem, reprises à
   l'identique du <style> local de Synthese.dc.html (maquette). */
.fiche-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 980px) { .fiche-grid { grid-template-columns: 1fr; } }
.card-link-hint { font-size: 12px; color: var(--primary); font-weight: 600; text-decoration: none; }
.badge-purple { background: #ede9fe; color: #5b21b6; }

/* [ajouté 06/10, corrigé 06/10 pour coller précisément aux valeurs de
   shared.css de la maquette Dossiers] Progression du dossier adaptée au
   type (onglet Synthèse et onglet Exécution) — remplace les divs stylées
   en inline déjà utilisées sur l'ancienne fiche Dossier à une seule page
   (mini-stepper "Avancement du dossier", conservé pour compatibilité
   visuelle sur la liste des dossiers). */
.phase-stepper { display: flex; align-items: flex-start; margin: 4px 0 22px; }
.phase-step { display: flex; flex-direction: column; align-items: center; flex: 1; position: relative; text-align: center; }
.phase-step .ps-dot { width: 26px; height: 26px; border-radius: 999px; background: #fff; border: 2.5px solid #d1d3dd; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; color: #9ca3af; z-index: 1; }
.phase-step.done .ps-dot { background: #16a34a; border-color: #16a34a; color: #fff; }
.phase-step.current .ps-dot { background: var(--primary); border-color: var(--primary); color: #fff; }
.phase-step .ps-line { position: absolute; top: 13px; left: calc(-50% + 13px); width: 100%; height: 2.5px; background: #d1d3dd; z-index: 0; }
.phase-step:first-child .ps-line { display: none; }
.phase-step.done .ps-line, .phase-step.current .ps-line { background: #16a34a; }
.phase-step .ps-label { font-size: 11.5px; color: #666; margin-top: 7px; max-width: 110px; line-height: 1.3; }
.phase-step.current .ps-label { color: var(--primary); font-weight: 700; }
.phase-step.done .ps-label { color: #16a34a; font-weight: 600; }

/* [ajouté 06/10] Onglet Besoin — citation du message d'origine (non
   modifiable) et badge "À préciser" du tableau Articles, repris à
   l'identique du <style> local de Besoin.dc.html (maquette). */
.quote-block { background: #f7f8fa; border-left: 3px solid var(--border); border-radius: 0 8px 8px 0; padding: 12px 16px; font-size: 13.5px; color: #444; font-style: italic; margin-bottom: 16px; }
.a-preciser { font-size: 11.5px; font-weight: 700; color: #b45309; background: #fffbeb; border: 1px solid #fde68a; padding: 1px 7px; border-radius: 999px; }

/* [ajouté 06/10] Onglet Exécution (Prestation) — case "Visite terrain" et
   grille de photos, repris à l'identique du <style> local de
   ExecutionPrestation.dc.html (maquette). */
.checkbox-field { display: flex; align-items: center; gap: 8px; height: 38px; }
.checkbox-field input { width: 16px; height: 16px; margin: 0; }
.checkbox-field span { font-size: 13px; color: #333; }
.photo-grid { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.photo-thumb { width: 84px; height: 64px; border-radius: 8px; object-fit: cover; display: block; }
.photo-ph { width: 84px; height: 64px; border-radius: 8px; background: #eef0f4; display: flex; align-items: center; justify-content: center; color: #aab0c6; }

/* [ajouté 06/10, étape 2 du découpage Dossiers] Sous-onglets de "Achats et
   offres" (Consultations / Offres reçues / Comparaison) — repris à
   l'identique du <style> local de AchatsConsultations.dc.html (maquette).
   Valeurs copiées verbatim de shared.css. */
.sub-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.sub-tab { padding: 9px 16px; border-radius: 9px; font-size: 13px; font-weight: 600; color: #555; background: #eef0f4; border: none; cursor: pointer; }
.sub-tab.active { background: var(--primary); color: #fff; }

/* [ajouté 06/10, étape 2 du découpage Dossiers] Bandeau d'information
   contextuelle (ex: rappel sur le statut d'une consultation) — repris à
   l'identique de shared.css (maquette). */
.info-note { display: flex; gap: 8px; align-items: flex-start; background: #eef4ff; border: 1px solid #cfe0fb; color: #1e4ea8; border-radius: 10px; padding: 10px 12px; font-size: 12.5px; }
.info-note svg { flex-shrink: 0; margin-top: 1px; }

/* [ajouté 06/10, étape 2 du découpage Dossiers] Tableau "liste" utilisé
   par les sous-onglets Consultations/Offres reçues — repris à l'identique
   de shared.css (maquette), distinct du tableau transposé du Comparateur
   (qui reste en style inline, non touché). */
.table-scroll { overflow-x: auto; }
.dtable { width: 100%; border-collapse: collapse; }
.dtable thead th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .03em; color: #888; font-weight: 700; padding: 12px 16px; border-bottom: 1px solid var(--border); background: #fafbfd; }
.dtable tbody td { padding: 13px 16px; border-bottom: 1px solid var(--border); font-size: 13.5px; vertical-align: middle; }
.dtable tbody tr:hover { background: #fafbfd; }
.dtable tbody tr:last-child td { border-bottom: none; }
.row-title { font-weight: 600; color: var(--ink); }

/* [ajouté 06/10, étape 3 du découpage Dossiers] Versions de cotation —
   copié à l'identique de la maquette (Cotations.dc.html). */
.cot-version { border:1px solid var(--border, #e5e7eb); border-radius:12px; padding:16px 18px; margin-bottom:14px; }
.cot-version.current { border-color: var(--primary, #4f46e5); background: var(--primary-light, #eef2ff); }
.cot-version-head { display:flex; justify-content:space-between; align-items:center; flex-wrap:wrap; gap:8px; margin-bottom:8px; }
.cot-version-head .cv-title { font-weight:700; font-size:14px; color:var(--ink, #1f2937); }
.hint { font-size: 12px; color: #888; margin-top: 4px; } /* [ajouté 06/10, étape 3] copié de la maquette (shared.css) */

/* [ajouté 06/10, étape 4 du découpage Dossiers] Documents + Équipe et
   historique — copié de la maquette (shared.css / Documents.dc.html).
   La frise s'appelle .dos-timeline car .timeline existe déjà (Tableau de
   bord) avec un autre style. */
.doc-cat-head { font-size:12px; font-weight:700; color:#888; letter-spacing:.02em; padding:14px 22px 6px; }
.visibility-tag { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; }
.visibility-tag.interne { background: #f1f2f5; color: #4b5563; }
.visibility-tag.client { background: #eef4ff; color: #1e4ea8; }
.avatar-sm { width: 26px; height: 26px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; color: #fff; margin-right: 8px; vertical-align: middle; }
.dos-timeline { position: relative; padding-left: 22px; }
.dos-timeline::before { content: ""; position: absolute; left: 5px; top: 4px; bottom: 4px; width: 2px; background: var(--border); }
.dos-timeline .tl-item { position: relative; padding-bottom: 20px; }
.dos-timeline .tl-item:last-child { padding-bottom: 0; }
.dos-timeline .tl-item::before { content: ""; position: absolute; left: -22px; top: 3px; width: 10px; height: 10px; border-radius: 999px; background: var(--primary); border: 2px solid #fff; box-shadow: 0 0 0 2px var(--primary-light); }
.dos-timeline .tl-date { font-size: 11.5px; color: #888; }
.dos-timeline .tl-title { font-size: 13.5px; font-weight: 600; color: var(--ink); margin-top: 1px; }
.dos-timeline .tl-author { font-size: 12px; color: #888; margin-top: 1px; }

/* [ajouté 06/10, étape 5 du découpage Dossiers] Budget prévisionnel vs réalisé — valeurs de shared.css (maquette) */
.budget-row { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1.6fr; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid #f1f2f5; font-size: 13.5px; }
.budget-row:last-child { border-bottom: none; }
.budget-row .bl { font-weight: 600; color: var(--ink); display: flex; align-items: center; gap: 8px; }
.budget-row .bl svg { color: var(--primary); flex-shrink: 0; }
.budget-row .bv { color: #888; font-size: 12px; }
.budget-row .bv strong { color: var(--ink); font-size: 13.5px; display: block; }
.budget-row .bv input { display: block; width: 100%; margin-top: 2px; }
.budget-total { display: flex; justify-content: space-between; align-items: center; padding: 14px 0 4px; font-size: 14px; font-weight: 700; color: var(--ink); border-top: 2px solid var(--border); margin-top: 6px; }
@media (max-width: 700px) { .budget-row { grid-template-columns: 1fr 1fr; } .budget-row .bl { grid-column: 1 / -1; } }

/* [ajouté 06/10, étape 6 du découpage Dossiers] Bandeau d'alerte ambre — valeurs de shared.css (maquette) */
.amber-alert { display: flex; gap: 8px; align-items: flex-start; background: #fffbeb; border: 1px solid #fde68a; color: #92400e; border-radius: 10px; padding: 10px 14px; font-size: 13px; margin: 10px 0; }
.amber-alert svg { flex-shrink: 0; margin-top: 1px; }

/* [ajouté 06/10] Page Sécurité — filtres sur une ligne qui passe à la ligne */
.filtres-securite { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 14px 16px; }
.filtres-securite select, .filtres-securite input { width: auto; max-width: 100%; margin: 0; }
.filtres-securite input[type=text] { flex: 1 1 200px; }

/* ==========================================================================
   [ajouté 08/10] Version mobile — éviter le débordement horizontal et les
   longs défilements : cartes compactes en 2 colonnes, indicateurs 2×2,
   onglets défilables, filtres repliés, bandeau du haut sur une ligne.
   Tout ce bloc ne s'applique qu'aux écrans ≤ 768 px (le bureau est inchangé).
   ========================================================================== */
@media (max-width: 768px) {
  /* Rien ne doit élargir la page (sinon le téléphone la dézoome) */
  .content { overflow-x: clip; }
  .content img, .content svg { max-width: 100%; }
  .form-row, .form-row > *, .form-group, .card, .ft-panel { min-width: 0; }
  .form-row { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0 10px; }
  input, select, textarea { max-width: 100%; min-width: 0; }

  /* Rangées d'onglets : une seule ligne qui défile au doigt */
  .prio-tabs, .form-tabs, .dos-tabs, .dos-onglets, .sub-tabs { overflow-x: auto; flex-wrap: nowrap; white-space: nowrap; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .prio-tabs::-webkit-scrollbar, .form-tabs::-webkit-scrollbar, .dos-tabs::-webkit-scrollbar, .dos-onglets::-webkit-scrollbar { display: none; }
  .prio-tab, .dos-tab, .ft-btn { flex-shrink: 0; }

  /* Tableaux qui ne sont pas des cartes : défilement horizontal interne (pas de la page) */
  .content table:not(.responsive-cards) { display: block; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }

  /* Bandeau du haut : une ligne, sans empilement */
  .topbar { flex-wrap: nowrap; gap: 8px; padding: 10px 12px; }
  .topbar > div:first-child { min-width: 0; flex: 1; gap: 8px; }
  .topbar .topbar-org { max-width: 120px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; padding: 7px 9px; font-size: 12.5px; }
  .topbar .topbar-org svg { display: none; }
  .topbar .topbar-filiale { min-width: 0; padding: 4px 6px; }
  .topbar .topbar-filiale label { display: none; }
  .topbar .topbar-filiale select { max-width: 130px; font-size: 12.5px; }
  .topbar .topbar-right { gap: 8px; flex-shrink: 0; }

  /* Titres et boutons d'en-tête : boutons côte à côte, plus petits */
  .content h1 { font-size: 21px; }
  .content .btn { padding: 8px 12px; font-size: 13px; }

  /* Indicateurs : grille 2×2 compacte au lieu d'une pile de 4 cartes */
  .kpi-row, .dash-kpi-row { grid-template-columns: 1fr 1fr; gap: 8px; }
  .kpi-card { padding: 10px 12px; gap: 9px; align-items: center; }
  .kpi-icon { width: 34px; height: 34px; border-radius: 9px; }
  .kpi-icon svg { width: 17px; height: 17px; }
  .kpi-card .kpi-label { font-size: 11.5px; line-height: 1.25; }
  .kpi-card .kpi-value { font-size: 20px; }
  .content .dos-tuiles { grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 10px 0; }
  .content .dos-tuile { flex-direction: column; align-items: flex-start; gap: 4px; padding: 10px; }
  .content .dos-tuile .pastille { display: none; }
  .content .dos-tuile .lib { font-size: 11.5px; }
  .content .dos-tuile .val { font-size: 22px; }
  .content .dos-tuile .aide { display: none; }
  .scope-note { font-size: 11px; margin: 4px 0 8px; }

  /* Filtres repliés : mobile.js ajoute le bouton « Plus de filtres » et marque les champs à cacher */
  .filter-bar { padding: 10px 12px; }
  .mob-cache { display: none !important; }
  .btn-filtres { width: 100%; margin: 6px 0 10px; }
  .filtres-mobile { margin-bottom: 8px !important; gap: 8px !important; }
  .filtres-mobile .form-group, .filtres-mobile .champ, .filtres-mobile .f-group { flex: 1 1 100%; min-width: 0; }
  .filtres-mobile input[type=text], .filtres-mobile input[type=search] { max-width: none !important; width: 100%; }

  /* Pastilles de 3 chiffres (Clients, etc.) : 3 sur une ligne, compactes */
  .grid-3:has(> .stat-tile) { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .stat-tile { padding: 10px 12px; }
  .stat-tile .value { font-size: 22px; }
  .stat-tile .label { font-size: 11.5px; margin-top: 2px; }

  /* Fiche dossier / liste dossiers : l'icône de dossier n'est pas utile sur téléphone et décalait le titre */
  .dos-titre .puce { display: none !important; }

  /* Cartes accordéon des fiches : le titre ouvre/ferme la carte (mobile.js) */
  .card.acc > h2:first-child { display: flex; align-items: center; justify-content: space-between; gap: 8px; cursor: pointer; margin-bottom: 0; }
  .card.acc > h2:first-child::after { content: ''; width: 8px; height: 8px; border-right: 2px solid #888; border-bottom: 2px solid #888; transform: rotate(45deg); margin-right: 4px; transition: transform .15s; flex-shrink: 0; }
  .card.acc.acc-ferme > h2:first-child::after { transform: rotate(-45deg); }
  .card.acc.acc-ferme > *:not(h2:first-child) { display: none !important; }
  .card.acc:not(.acc-ferme) > h2:first-child { margin-bottom: 10px; }
  .card.acc { padding-top: 14px; padding-bottom: 14px; }

  /* Listes en cartes : 2 colonnes, libellé minuscule au-dessus, pas de colonne « Actions » */
  table.responsive-cards { background: transparent; }
  table.responsive-cards tr { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 8px; padding: 10px 12px; margin-bottom: 8px; background: #fff; }
  table.responsive-cards td { padding: 3px 0; text-align: left !important; min-width: 0; overflow-wrap: anywhere; font-size: 13px; }
  table.responsive-cards td::before { display: block; float: none; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .02em; color: #8a8fa3; margin-bottom: 1px; }
  table.responsive-cards td:first-child, table.responsive-cards td:nth-child(2) { grid-column: 1 / -1; }
  table.responsive-cards.liste-cartes td:first-child::before { display: none; }
  table.responsive-cards td[data-label="Actions"], table.responsive-cards td[data-label=""] { display: none; }
  table.responsive-cards td .badge { white-space: nowrap; }
  table.responsive-cards td.mob-vide { display: none; }
  table.responsive-cards td:has(.btn) { grid-column: 1 / -1; }
  table.responsive-cards td .btn { white-space: normal; }
}
@media (max-width: 480px) {
  /* Les indicateurs restent en 2×2 (la règle à 480 px les empilait) */
  .kpi-row { grid-template-columns: 1fr 1fr; }
}

/* [08/10] mobile : filtres sur une ligne + suite des listes */
@media (max-width: 768px) {
  form.filtres-mobile { display: flex; flex-wrap: wrap; gap: 8px; align-items: stretch; }
  form.filtres-mobile > .mob-recherche { flex: 1 1 100%; margin-bottom: 0; }
  form.filtres-mobile > .btn, form.filtres-mobile > button { flex: 1 1 0; width: auto; margin: 0; }
  form.filtres-mobile > .btn-filtres-in { order: 5; }
  .btn-suite { width: 100%; margin: 2px 0 12px; }
  table.responsive-cards.liste-cartes td:nth-child(2)::before { display: none; }
  table.responsive-cards tr.mob-cache { display: none; }
}

@media (max-width: 768px) {
  form.filtres-mobile > .champ:has(button[type=submit]), form.filtres-mobile > div:has(> button[type=submit]) { flex: 1 1 0; min-width: 0; margin: 0; }
  form.filtres-mobile > .champ:has(button[type=submit]) .btn, form.filtres-mobile > div:has(> button[type=submit]) .btn { width: 100%; justify-content: center; }
  form.filtres-mobile > .btn-filtres-in { margin: 0; }
}

@media (max-width: 768px) {
  .filter-bar form:not(.filtres-mobile) { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 10px; align-items: end; }
  .filter-bar form:not(.filtres-mobile) .f-group { min-width: 0; }
  .filter-bar form:not(.filtres-mobile) .f-custom-dates.show, .filter-bar form:not(.filtres-mobile) .f-actions { grid-column: 1 / -1; }
  .filter-bar .f-group .f-input-wrap select { padding-top: 8px; padding-bottom: 8px; font-size: 13px; }
}

/* [08/10] Tableau de bord : plus de grand vide sous « Actions prioritaires » (bureau) + suivi des opérations en grille (mobile) */
@media (min-width: 769px) {
  .dash-grid { grid-auto-flow: row; align-items: start; }
  .dash-grid { grid-template-rows: auto repeat(6, auto); row-gap: 0; }
  .dash-grid > .dg-ops { margin-bottom: 20px; }
  .dash-grid > .dg-actions { grid-column: 1; grid-row: 2 / span 3; margin-bottom: 20px; }
  .dash-grid > .dg-livraisons { grid-column: 1; grid-row: 5 / span 2; }
  .dash-grid > .dg-echeances { grid-column: 2; grid-row: 2 / span 2; margin-bottom: 20px; }
  .dash-grid > .dg-demandes { grid-column: 2; grid-row: 4 / span 3; }
}
@media (max-width: 768px) {
  .dg-ops .ops-items { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; }
  .dg-ops .ops-sep { display: none; }
  .dg-ops .ops-item { flex-direction: column; align-items: flex-start; gap: 6px; padding: 10px; border: 1px solid #eef0f4; border-radius: 10px; background: #fafbff; min-width: 0; }
  .dg-ops .ops-item .oi-icon { width: 28px; height: 28px; border-radius: 8px; }
  .dg-ops .ops-item .oi-n { font-size: 18px; line-height: 1.1; }
  .dg-ops .ops-item .oi-label { font-size: 11px; }
  .dg-ops.ops-row { padding: 12px 14px; }
}

/* [08/10] Mobile : texte un peu plus grand (lisibilité) ; champs à 16 px pour éviter le zoom automatique de l'iPhone */
@media (max-width: 768px) {
  body { font-size: 15px; }
  table.responsive-cards td { font-size: 14.5px; }
  table.responsive-cards td::before { font-size: 11.5px; }
  .subtitle, .card p, .card li { font-size: 14.5px; }
  .card label, .form-group label { font-size: 13.5px; }
  input[type=text], input[type=email], input[type=password], input[type=date], input[type=number], input[type=tel], input[type=search], textarea, select { font-size: 16px; }
  input[type=text], input[type=email], input[type=password], input[type=date], input[type=number], input[type=tel], select { height: 40px; }
  .badge { font-size: 12px; }
  .btn { font-size: 14.5px; }
}

/* [08/10] Menu mobile : fond assombri cliquable pour refermer */
.sidebar-fond { display: none; }
@media (max-width: 768px) {
  .sidebar-fond.visible { display: block; position: fixed; inset: 0; background: rgba(15, 17, 40, .45); z-index: 40; }
}

@media (max-width: 768px) {
  /* lignes d'articles saisies à la main : champs pleine largeur, bouton de retrait explicite */
  table.responsive-cards td input[type=text], table.responsive-cards td input[type=number], table.responsive-cards td select { width: 100% !important; }
  table.responsive-cards td .btn-retirer-ligne::after, table.responsive-cards td .remove-item::after { content: ' Retirer la ligne'; }
}

/* [10/10] Téléphone sur mobile : indicatif au-dessus, numéro pleine largeur (le champ était écrasé) */
@media (max-width: 768px) {
  .tel-champ { grid-template-columns: 1fr !important; gap: 6px !important; }
  .form-row > .form-group:has(.tel-champ), .form-group:has(.tel-champ) { grid-column: 1 / -1; }
}

/* ---- Galerie photos (galerie.js) ---- */
.gal-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(140px,1fr));gap:10px}
.gal-thumb{border:1px solid var(--border,#e3e6ec);background:#fff;border-radius:8px;padding:0;cursor:pointer;overflow:hidden;text-align:left;font:inherit}
.gal-thumb img{display:block;width:100%;aspect-ratio:1/1;object-fit:cover;background:#f1f3f6}
.gal-thumb span{display:block;padding:5px 7px;font-size:12px;color:#555;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.gal-thumb:hover,.gal-thumb:focus-visible{border-color:#2563eb;outline:none}
.gal-ov{position:fixed;inset:0;z-index:2000;background:rgba(10,12,16,.92);display:flex;align-items:center;justify-content:center}
.gal-ov[hidden]{display:none}
.gal-fig{margin:0;max-width:86vw;max-height:92vh;display:flex;flex-direction:column;align-items:center;gap:8px}
.gal-fig img{max-width:86vw;max-height:84vh;object-fit:contain;border-radius:4px}
.gal-fig figcaption{color:#e6e8ec;font-size:14px;text-align:center}
.gal-x,.gal-nav{position:absolute;border:0;background:rgba(255,255,255,.14);color:#fff;cursor:pointer;border-radius:50%;line-height:1}
.gal-x{top:12px;right:12px;width:44px;height:44px;font-size:28px}
.gal-nav{top:50%;transform:translateY(-50%);width:48px;height:48px;font-size:34px}
.gal-prev{left:10px}.gal-next{right:10px}
@media (max-width:768px){
  .gal-grid{grid-template-columns:repeat(3,1fr);gap:8px}
  .gal-fig,.gal-fig img{max-width:100vw}
  .gal-nav{width:42px;height:42px;font-size:28px}
}

.gal-cell{display:flex;flex-direction:column;gap:6px}
.gal-act{display:flex;gap:6px;flex-wrap:wrap}
.gal-act .btn{flex:1;text-align:center;padding:4px 6px;font-size:12px}
