/* Thème Mettam Radiocom – complète Bootstrap 5.3 */
:root {
  --marque: #0F2341;
  --marque-2: #1B3766;          /* survol */
  --marque-clair: #E8EDF6;      /* fonds teintés */
  --encre-marque: var(--marque); /* titres et textes couleur marque */
  --surface: #fff;              /* cartes, champs */
  --surface-2: #F8FAFC;         /* en-têtes de tableau, zones grisées */
  --accent: #3B82F6;            /* liens, focus */
  --gris-logo: #999999;
  --fond: #F4F6FA;
  --texte: #1E293B;
  --texte-doux: #64748B;
  --bordure: #E2E8F0;
  --rayon: 14px;
  --ombre: 0 1px 2px rgba(15, 35, 65, .05), 0 2px 8px rgba(15, 35, 65, .06);
  --sidebar: 252px;

  --bs-body-font-family: "Segoe UI", "Inter", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --bs-body-bg: var(--fond);
  --bs-body-color: var(--texte);
  --bs-primary: var(--marque);
  --bs-primary-rgb: 15, 35, 65;
  --bs-link-color: #1E4FA8;
  --bs-link-color-rgb: 30, 79, 168;
  --bs-link-hover-color: var(--marque);
  --bs-border-color: var(--bordure);
  --bs-border-radius: 10px;
}

body { background: var(--fond); font-size: .94rem; -webkit-font-smoothing: antialiased; }
a { text-decoration: none; }
a:hover { text-decoration: underline; }
h1, .h1, h2, .h2, h3, .h3, h4, .h4 { color: var(--encre-marque); font-weight: 650; letter-spacing: -.01em; }

/* ---------- Disposition : menu latéral + contenu ---------- */
.sidebar {
  background: var(--marque) !important;  /* Bootstrap rend .offcanvas-lg transparent en grand écran */
  color: #C9D3E3;
  width: var(--sidebar);
  --bs-offcanvas-width: var(--sidebar);
  --bs-offcanvas-bg: var(--marque);
}
@media (min-width: 992px) {
  .sidebar { position: fixed; inset: 0 auto 0 0; display: flex; flex-direction: column; }
  .contenu { margin-left: var(--sidebar); }
}
.sidebar .offcanvas-body { display: flex; flex-direction: column; height: 100%; padding: 0; }
.sidebar-logo { padding: 26px 22px 18px; }
.sidebar-logo img { width: 100%; max-width: 190px; height: auto; display: block; }
.sidebar-nav { padding: 8px 12px; flex: 1; overflow-y: auto; }
.sidebar-titre {
  font-size: .7rem; text-transform: uppercase; letter-spacing: .08em;
  color: #7F8FAD; padding: 16px 12px 6px;
}
.sidebar-lien {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 12px; margin: 2px 0; border-radius: 10px;
  color: #C9D3E3; font-weight: 500;
  transition: background .15s, color .15s;
}
.sidebar-lien i { font-size: 1.1rem; width: 20px; text-align: center; opacity: .9; }
.sidebar-lien:hover { background: rgba(255, 255, 255, .07); color: #fff; text-decoration: none; }
.sidebar-lien.active { background: rgba(255, 255, 255, .12); color: #fff; box-shadow: inset 3px 0 0 #fff; }
.sidebar-groupe { width: 100%; border: 0; background: none; text-align: left; }
.sidebar-groupe.actif { color: #fff; }
.sidebar-groupe .chevron { margin-left: auto; font-size: .8rem; transition: transform .2s; }
.sidebar-groupe.collapsed .chevron { transform: rotate(-90deg); }
.sidebar-sous { margin-left: 18px; padding-left: 6px; border-left: 1px solid rgba(255, 255, 255, .12); }
.sidebar-sous .sidebar-lien { padding: 7px 10px; font-size: .92rem; }
.sidebar-pied { border-top: 1px solid rgba(255, 255, 255, .08); padding: 14px 16px; }
.avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: rgba(255, 255, 255, .14); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: .85rem; flex-shrink: 0;
}
.sidebar-pied .nom { color: #fff; font-weight: 600; line-height: 1.2; }
.sidebar-pied .role { color: #8D9BB5; font-size: .78rem; }
.sidebar-pied .btn-deco { color: #C9D3E3; border: 0; background: none; padding: 6px; border-radius: 8px; }
.sidebar-pied .btn-deco:hover { background: rgba(255, 255, 255, .08); color: #fff; }

/* Barre du haut (mobile) */
.barre-mobile { background: var(--marque); padding: 10px 16px; }
.barre-mobile img { height: 30px; }
.barre-mobile .btn { color: #fff; border: 0; font-size: 1.5rem; padding: 0 4px; }

.contenu main { padding: 28px 32px 48px; max-width: 1600px; }
@media (max-width: 575.98px) { .contenu main { padding: 18px 14px 40px; } }

/* ---------- Composants ---------- */
.card { border: 0; border-radius: var(--rayon); box-shadow: var(--ombre); }
.card-header {
  background: var(--surface); border-bottom: 1px solid var(--bordure);
  padding: 14px 18px; font-weight: 600; color: var(--encre-marque);
  border-radius: var(--rayon) var(--rayon) 0 0 !important;
}
.card-body { padding: 18px; }
.card > .table-responsive, .card > table { border-radius: var(--rayon); }
.list-group-item { border-color: var(--bordure); }

.table { --bs-table-bg: transparent; margin-bottom: 0; }
.table > :not(caption) > * > * { padding: .7rem .9rem; border-bottom-color: #EEF2F7; }
.table thead th, .table .table-light th {
  background: var(--surface-2) !important; color: var(--texte-doux);
  font-size: .74rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em;
  border-bottom: 1px solid var(--bordure);
}
.table thead th a { color: inherit !important; }
.table thead th { white-space: nowrap; }

/* Barre de filtres : les listes gardent une largeur lisible */
.filtres { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 1rem; }
.filtres .form-control { flex: 1 1 260px; max-width: 380px; }
.filtres .form-select { flex: 0 1 auto; width: auto; min-width: 150px; max-width: 240px; }
.table-hover > tbody > tr:hover > * { --bs-table-bg-state: #F5F8FD; }
.table-danger { --bs-table-bg: #FEF2F2 !important; }

.btn { border-radius: 10px; font-weight: 500; padding: .45rem 1rem; }
.btn-sm { border-radius: 8px; padding: .25rem .65rem; }
.btn-primary { --bs-btn-bg: var(--marque); --bs-btn-border-color: var(--marque);
  --bs-btn-hover-bg: var(--marque-2); --bs-btn-hover-border-color: var(--marque-2);
  --bs-btn-active-bg: var(--marque-2); --bs-btn-disabled-bg: var(--marque); }
.btn-outline-primary { --bs-btn-color: var(--marque); --bs-btn-border-color: var(--marque);
  --bs-btn-hover-bg: var(--marque); --bs-btn-hover-border-color: var(--marque); }
.btn-outline-secondary { --bs-btn-color: #334155; --bs-btn-border-color: #CBD5E1;
  --bs-btn-hover-bg: #F1F5F9; --bs-btn-hover-color: #0F172A; --bs-btn-hover-border-color: #CBD5E1; }
.btn-secondary { --bs-btn-bg: #E2E8F0; --bs-btn-color: #1E293B; --bs-btn-border-color: #E2E8F0;
  --bs-btn-hover-bg: #CBD5E1; --bs-btn-hover-color: #0F172A; --bs-btn-hover-border-color: #CBD5E1; }

.form-control, .form-select { border-radius: 10px; border-color: #D5DCE6; padding: .5rem .8rem; }
.form-control-sm, .form-select-sm { border-radius: 8px; }
.form-control:focus, .form-select:focus, .form-check-input:focus {
  border-color: var(--accent); box-shadow: 0 0 0 .2rem rgba(59, 130, 246, .18);
}
.form-check-input:checked { background-color: var(--marque); border-color: var(--marque); }
.form-label { font-weight: 500; color: #334155; }

/* Badges en teintes douces */
.badge { font-weight: 600; padding: .38em .7em; border-radius: 999px; letter-spacing: .01em; }
.badge.bg-success { background: #DCFCE7 !important; color: #166534 !important; }
.badge.bg-danger { background: #FEE2E2 !important; color: #991B1B !important; }
.badge.bg-warning { background: #FEF3C7 !important; color: #92400E !important; }
.badge.bg-info { background: #E0F2FE !important; color: #075985 !important; }
.badge.bg-primary { background: var(--marque-clair) !important; color: var(--encre-marque) !important; }
.badge.bg-secondary { background: #EEF2F7 !important; color: #475569 !important; }
.badge.bg-dark { background: var(--marque) !important; color: #fff !important; }

.alert { border: 0; border-radius: 12px; }
.alert-success { background: #ECFDF5; color: #065F46; }
.alert-danger { background: #FEF2F2; color: #991B1B; }
.alert-info { background: #EFF6FF; color: #1E3A8A; }
.alert-warning { background: #FFFBEB; color: #92400E; }

.nav-tabs { border-bottom: 1px solid var(--bordure); gap: 4px; }
.nav-tabs .nav-link { border: 0; color: var(--texte-doux); font-weight: 500; border-radius: 10px 10px 0 0; }
.nav-tabs .nav-link.active { color: var(--encre-marque); background: transparent; box-shadow: inset 0 -2px 0 var(--marque); }

.progress { background: #E9EEF5; border-radius: 999px; }
.progress-bar { background: var(--marque); border-radius: 999px; }
.progress-bar.bg-success { background: #16A34A !important; }

.pagination .page-link { border-radius: 8px !important; margin: 0 2px; color: var(--encre-marque); border-color: var(--bordure); white-space: nowrap; }
.pagination { --bs-pagination-active-bg: var(--marque); --bs-pagination-active-border-color: var(--marque); --bs-pagination-active-color: #fff; }
.pagination .page-item.active .page-link { color: #fff; }

/* Indicateurs du tableau de bord */
.display-6 { font-weight: 650; color: var(--encre-marque); }
.kpi .text-muted { text-transform: uppercase; font-size: .72rem; letter-spacing: .05em; font-weight: 600; }

/* ---------- Page de connexion ---------- */
.connexion { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.connexion-marque {
  background: radial-gradient(1200px 600px at 10% 10%, #1D3A6B 0%, var(--marque) 55%);
  display: flex; flex-direction: column; justify-content: center; padding: 60px;
}
.connexion-marque img { max-width: 360px; width: 100%; }
.connexion-marque p { color: #9FB0CC; margin-top: 24px; font-size: 1.05rem; max-width: 380px; }
.connexion-form { display: flex; align-items: center; justify-content: center; padding: 40px 24px; background: #fff; }
.connexion-form form { width: 100%; max-width: 360px; }
@media (max-width: 767.98px) {
  .connexion { grid-template-columns: 1fr; }
  .connexion-marque { padding: 36px 24px; align-items: center; }
  .connexion-marque p { display: none; }
  .connexion-marque img { max-width: 220px; }
}

/* ---------- Mes tâches (fiches façon Google Keep) ---------- */
.fiches { columns: 270px; column-gap: 16px; }
.fiches-titre { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; font-weight: 600;
  color: var(--texte-doux); margin: 0 0 8px 4px; }
.fiche {
  --fond: #fff; --encre: #202124; --encre-douce: #5F6368; --trait: rgba(0, 0, 0, .1);
  background: var(--fond); color: var(--encre);
  border: 1px solid #E0E3E8; border-radius: 12px; padding: 12px 14px 6px;
  break-inside: avoid; display: inline-block; width: 100%; margin-bottom: 16px;
  transition: box-shadow .15s;
}
.fiche:hover { box-shadow: 0 1px 3px rgba(60, 64, 67, .3), 0 4px 8px 3px rgba(60, 64, 67, .15); }
.fiche.sombre { --encre: #F1F3F4; --encre-douce: #C4C9CF; --trait: rgba(255, 255, 255, .15); border-color: transparent; }
.fiche-entete { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.fiche-titre { font-size: 1.05rem; font-weight: 600; color: var(--encre); margin: 2px 0 8px; line-height: 1.3;
  overflow-wrap: anywhere; }
.fiche-btn { border: 0; background: none; color: var(--encre-douce); border-radius: 50%;
  width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center; }
.fiche-btn:hover { background: var(--trait); color: var(--encre); text-decoration: none; }
.fiche .epingle { opacity: 0; margin: -4px -6px 0 0; }
.fiche:hover .epingle, .fiche .epingle.actif { opacity: 1; }
.fiche-liste { list-style: none; padding: 0; margin: 0; }
.element { display: flex; align-items: flex-start; gap: 10px; padding: 3px 0; }
.element form { margin: 0; }
.element .form-check-input { margin-top: .2rem; cursor: pointer; background-color: transparent;
  border-color: var(--encre-douce); }
.element .form-check-input:checked { background-color: var(--encre-douce); border-color: var(--encre-douce); }
.element-texte { flex: 1; overflow-wrap: anywhere; line-height: 1.4; }
.element.fait .element-texte { text-decoration: line-through; color: var(--encre-douce); }
.element.pour-moi .element-texte { font-weight: 600; }
.element-info { font-size: .78rem; color: var(--encre-douce); }
.element-suppr { border: 0; background: none; color: var(--encre-douce); padding: 0 2px; opacity: 0; }
.element:hover .element-suppr { opacity: 1; }
.chip-pour { font-size: .72rem; border: 1px solid var(--trait); border-radius: 999px; padding: 0 7px;
  color: var(--encre-douce); white-space: nowrap; }
.fiche-ajout { display: flex; align-items: center; gap: 6px; padding: 4px 0; color: var(--encre-douce); }
.fiche-ajout input, .fiche-ajout select { background: transparent; border: 0; color: var(--encre); outline: 0; }
.fiche-ajout input { flex: 1; min-width: 0; padding: 2px 0; }
.fiche-ajout input::placeholder { color: var(--encre-douce); }
.fiche-ajout select { font-size: .78rem; color: var(--encre-douce); max-width: 90px; cursor: pointer; }
.fiche-ajout select option { color: #202124; }
.fiche-faits { border-top: 1px solid var(--trait); margin-top: 6px; padding-top: 4px; }
.fiche-faits summary { color: var(--encre-douce); font-size: .85rem; padding: 2px 0; cursor: pointer; }
.fiche-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 2px; }
.fiche .chip { font-size: .75rem; font-weight: 500; border: 1px solid var(--trait); border-radius: 999px;
  padding: 2px 10px; color: var(--encre); background: rgba(127, 127, 127, .08); }
.fiche-outils { display: flex; gap: 2px; margin: 4px -6px 0; opacity: 0; transition: opacity .15s; }
.fiche:hover .fiche-outils, .fiche:focus-within .fiche-outils { opacity: 1; }
@media (hover: none) { .fiche-outils, .fiche .epingle, .element-suppr { opacity: 1; } }
.fiche-outils form { margin: 0; }
.palette { display: flex; flex-wrap: wrap; gap: 6px; max-width: 250px; }
.pastille { width: 28px; height: 28px; border-radius: 50%; background: var(--fond); border: 2px solid rgba(0, 0, 0, .12);
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; margin: 0; }
.pastille:hover { border-color: #5F6368; }
.pastille input { display: none; }
.pastille i { opacity: 0; color: #5F6368; }
.pastille.choisie, .pastille:has(input:checked) { border-color: #A142F4; }
.pastille.choisie i, .pastille:has(input:checked) i { opacity: 1; }
/* Zone « Créer une fiche » */
.fiche.nouvelle { display: block; max-width: 600px; margin: 0 auto; padding: 12px 16px;
  box-shadow: 0 1px 2px rgba(60, 64, 67, .3), 0 2px 6px 2px rgba(60, 64, 67, .15); }
.nouvelle-titre { width: 100%; border: 0; outline: 0; background: transparent; font-size: 1.05rem;
  font-weight: 600; color: var(--encre); }
.nouvelle-titre::placeholder { color: var(--encre-douce); font-weight: 500; }
.nouvelle-suite { display: none; }
.fiche.nouvelle.ouverte .nouvelle-suite { display: block; }
.nouvelle-suite textarea { width: 100%; border: 0; outline: 0; resize: vertical; background: transparent;
  margin-top: 8px; color: var(--encre); }
/* Page de modification */
.fiche-edition { display: block; padding: 18px; }
.fiche-edition:hover { box-shadow: none; }
.edition-elements { --bs-table-color: var(--encre); }
.edition-elements thead th { background: transparent !important; color: var(--encre-douce); }
.edition-elements > :not(caption) > * > * { border-bottom-color: var(--trait); padding: .4rem .5rem; }
.edition-elements .form-control, .edition-elements .form-select { background-color: rgba(255, 255, 255, .94); border-color: transparent; }
.partage ul { list-style: none; padding: 0; margin: 0; columns: 2; }
.partage label { display: flex; gap: 8px; align-items: center; padding: 2px 0; }
.partage input { margin: 0; }

/* ---------- Devis (intranet et page client) ---------- */
.apercu-pdf { width: 100%; height: 78vh; min-height: 480px; border: 0; display: block;
  border-radius: 0 0 var(--rayon) var(--rayon); background: #E9EEF5; }
.signature-image { max-width: 100%; max-height: 120px; border: 1px dashed var(--bordure); border-radius: 8px; background: #fff; }
.page-devis { background: var(--fond); }
.devis-entete { background: var(--marque); color: #fff; display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 14px 24px; }
.devis-entete img { height: 40px; }
.devis-corps { max-width: 1500px; margin: 0 auto; padding: 24px; }
@media (max-width: 575.98px) { .devis-corps { padding: 14px; } .devis-entete img { height: 30px; } .apercu-pdf { height: 60vh; } }
.zone-signature { position: relative; height: 160px; border: 2px dashed #CBD5E1; border-radius: 12px; background: #fff;
  touch-action: none; }
.zone-signature canvas { position: absolute; inset: 0; width: 100%; height: 100%; cursor: crosshair; }
.zone-signature .consigne { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  color: #94A3B8; pointer-events: none; font-size: .9rem; }
.zone-signature.signee .consigne { display: none; }
.zone-signature.signee { border-color: var(--marque); }

/* ---------- Espace client ---------- */
.portail-nav { background: var(--marque); padding: 10px 0; }
.portail-nav .navbar-brand img { height: 34px; }
.portail-marque { color: #9FB0CC; font-size: .9rem; border-left: 1px solid rgba(255, 255, 255, .2); padding-left: 10px; }
.portail-nav .nav-link { color: #C9D3E3; font-weight: 500; border-radius: 8px; padding: 6px 12px !important; }
.portail-nav .nav-link:hover, .portail-nav .nav-link.active { color: #fff; background: rgba(255, 255, 255, .1); }
.portail-compte { font-size: .88rem; }
a.card.kpi { color: inherit; transition: transform .1s, box-shadow .15s; }
a.card.kpi:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(15, 35, 65, .12); }
.portail-action { background: var(--marque) !important; color: #fff !important; text-align: center; }
.portail-action .text-muted { color: #9FB0CC !important; }
.choix-type { display: block; cursor: pointer; margin: 0; position: relative; }
.choix-type input { position: absolute; opacity: 0; }
.choix-type span { display: flex; flex-direction: column; gap: 2px; border: 2px solid var(--bordure); border-radius: 12px;
  padding: 14px 16px; background: #fff; transition: border-color .15s, background .15s; }
.choix-type span i { font-size: 1.5rem; color: var(--encre-marque); }
.choix-type span small { color: var(--texte-doux); }
.choix-type input:checked + span { border-color: var(--marque); background: var(--marque-clair); }
.choix-type input:focus-visible + span { box-shadow: 0 0 0 .2rem rgba(59, 130, 246, .25); }
.parcours { list-style: none; padding: 0; margin: 0; }
.parcours li { position: relative; padding: 0 0 14px 26px; color: #94A3B8; font-size: .9rem; }
.parcours li::before { content: ""; position: absolute; left: 5px; top: 5px; width: 12px; height: 12px; border-radius: 50%;
  border: 2px solid #CBD5E1; background: #fff; }
.parcours li:not(:last-child)::after { content: ""; position: absolute; left: 10px; top: 19px; bottom: 0; width: 2px; background: #E2E8F0; }
.parcours li.franchie { color: var(--texte); }
.parcours li.franchie::before { background: #16A34A; border-color: #16A34A; }
.parcours li.actuelle { color: var(--encre-marque); font-weight: 650; }
.parcours li.actuelle::before { background: var(--marque); border-color: var(--marque); box-shadow: 0 0 0 4px var(--marque-clair); }
.fil { list-style: none; margin: 0; padding: 8px 18px 18px; }
.fil li { position: relative; padding: 12px 0 12px 22px; border-left: 2px solid #E2E8F0; margin-left: 6px; }
.fil li::before { content: ""; position: absolute; left: -7px; top: 17px; width: 12px; height: 12px; border-radius: 50%;
  background: #CBD5E1; border: 2px solid #fff; }
.fil li.etape::before { background: var(--marque); }
.fil li.du-client::before { background: var(--accent); }
.fil li.du-client > div:last-child:not(.d-flex) { background: #EFF6FF; border-radius: 10px; padding: 8px 12px; }

/* ---------- Flotte ---------- */
.plaque { font-family: "Segoe UI", Arial, sans-serif; letter-spacing: .04em; white-space: nowrap; }
.plaque-grande { display: inline-block; border: 2px solid var(--marque); border-left: 10px solid #1E4FA8;
  border-right: 10px solid #1E4FA8; border-radius: 6px; padding: 0 10px; background: #fff; }

/* ---------- Coût de déplacement ---------- */
.card.kpi.pv { background: var(--marque); color: #fff; }
.card.kpi.pv .small { color: #C9D3E3; }
.table-parametres td:first-child { min-width: 170px; }
.liste-suggestions { position: absolute; left: 0; right: 0; z-index: 30; background: #fff; border: 1px solid var(--bordure);
  border-radius: 10px; box-shadow: 0 10px 24px rgba(15, 35, 65, .15); margin-top: 4px; overflow: hidden; }
.liste-suggestions .suggestion { display: flex; gap: 10px; align-items: flex-start; width: 100%; text-align: left; border: 0;
  background: none; padding: 8px 12px; }
.liste-suggestions .suggestion span { display: flex; flex-direction: column; }
.liste-suggestions .suggestion small { color: var(--texte-doux); }
.liste-suggestions .suggestion:hover, .liste-suggestions .suggestion.active { background: var(--marque-clair); }
.liste-suggestions .suggestion-erreur { padding: 8px 12px; color: #991B1B; font-size: .85rem; }
.table-parametres .form-control { min-width: 80px; }

/* ---------- Boutique ---------- */
.produit-image { height: 160px; display: flex; align-items: center; justify-content: center; background: #F8FAFC;
  border-radius: var(--rayon) var(--rayon) 0 0; border-bottom: 1px solid var(--bordure); overflow: hidden; }
.produit-image img { max-width: 100%; max-height: 100%; object-fit: contain; padding: 10px; }
.produit-image i { font-size: 3rem; color: #CBD5E1; }
.produit-boutique .description { color: var(--texte-doux); }
.bandeau-boutique { color: var(--encre-marque); background: var(--marque-clair); }
.bandeau-boutique:hover { box-shadow: 0 6px 16px rgba(15, 35, 65, .12); }
.pastille-panier { background: #DC2626 !important; color: #fff !important; }

/* ---------- Contrats : compte rendu imprimable ---------- */
.rapport { background: #fff; border-radius: var(--rayon); box-shadow: var(--ombre); padding: 28px; max-width: 1100px; }
.rapport .synthese .bloc { border: 1px solid var(--bordure); border-radius: 10px; padding: 8px; font-size: .8rem; color: var(--texte-doux); }
.rapport .synthese .n { font-size: 1.6rem; font-weight: 700; color: var(--encre-marque); }
.rapport .synthese .ok .n { color: #16A34A; }
.rapport .synthese .surv .n { color: #B45309; }
.rapport .synthese .nok .n { color: #DC2626; }
.rapport .fiche-cr { break-inside: avoid; margin-bottom: 14px; font-size: .85rem; }
.rapport .table > :not(caption) > * > * { padding: .3rem .5rem; }
@media print {
  .rapport { box-shadow: none; padding: 0; max-width: none; font-size: 11px; }
  .rapport .saut-page { break-before: page; }
  .badge { border: 1px solid #999; }
}

/* ---------- Rôles et permissions ---------- */
.matrice-roles th:first-child, .matrice-roles td:first-child { min-width: 200px; }
.matrice-roles td { padding-left: .4rem !important; padding-right: .4rem !important; }
.matrice-roles .niveau { min-width: 150px; padding-right: 1.8rem; }
.detail-role { table-layout: fixed; }
.detail-role th:first-child { width: 32%; }
.detail-role th:not(:first-child):not(:last-child) { width: 12%; }
.matrice-roles .niveau-aucun { color: #94A3B8; }
.matrice-roles .niveau-lecture { background-color: #EFF6FF; }
.matrice-roles .niveau-saisie { background-color: #ECFDF5; }
.matrice-roles .niveau-complet { background-color: #DCFCE7; font-weight: 600; }
.matrice-roles .niveau-personnalise { background-color: #FEF3C7; }

.alerte-session { position: fixed; right: 16px; bottom: 16px; z-index: 2000; display: flex; align-items: center; gap: 10px;
  background: var(--marque); color: #fff; padding: 10px 14px; border-radius: 12px; box-shadow: 0 8px 24px rgba(15, 35, 65, .3); }
.alerte-session[hidden] { display: none; }

/* ---------- Bons d'intervention ---------- */
.signature-page { max-width: 760px; }
.zone-signature.grande { height: 240px; }
@media (max-width: 575.98px) { .zone-signature.grande { height: 200px; } }
.materiels-bon ul, .materiels-bon > div > div { list-style: none; padding: 0; margin: 0; max-height: 260px; overflow-y: auto; }
.materiels-bon label { display: flex; gap: 8px; align-items: flex-start; padding: 2px 0; }

/* ---------- Impression ---------- */
@media print {
  .sidebar, .barre-mobile, .no-print, .alert, .alerte-session { display: none !important; }
  .contenu { margin-left: 0 !important; }
  .contenu main { padding: 0 !important; }
  .card { box-shadow: none; }
}

/* Banane à idées */
.colonne-idees { background: var(--bs-tertiary-bg, #f1f3f6); border-radius: .75rem; padding: .75rem; min-height: 8rem; }
.colonne-idees .idee { border-left: 4px solid #f5c400; }
.colonne-validee .idee { border-left-color: #198754; }
.colonne-en_dev .idee { border-left-color: #0d6efd; }
.colonne-realisee .idee { border-left-color: #6f42c1; }
.colonne-ecartee .idee { border-left-color: #adb5bd; }

/* Calendrier des locations */
.calendrier-loc { overflow-x: auto; }
.cal-semaine { display: grid; grid-template-columns: repeat(7, minmax(6.5rem, 1fr)); grid-auto-rows: minmax(1.6rem, auto);
  border-bottom: 1px solid var(--bs-border-color); min-height: 6rem; position: relative; }
.cal-entete { min-height: 0; font-size: .75rem; font-weight: 600; text-transform: uppercase; color: var(--bs-secondary-color); }
.cal-entete > div { padding: .4rem .5rem; }
.cal-jour { border-right: 1px solid var(--bs-border-color); padding: .25rem .4rem; }
.cal-jour:nth-child(7) { border-right: 0; }
.cal-jour .num { font-size: .8rem; font-weight: 600; }
.cal-jour.hors-mois { background: var(--bs-tertiary-bg); color: var(--bs-secondary-color); }
.cal-jour.aujourdhui .num { background: #0F2341; color: #fff; border-radius: 999px; padding: 0 .4rem; }
.cal-barre { z-index: 1; margin: 1px 2px; padding: .1rem .45rem; font-size: .75rem; color: #fff; text-decoration: none;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: .25rem; border-radius: 0; }
.cal-barre.debut { border-top-left-radius: .4rem; border-bottom-left-radius: .4rem; }
.cal-barre.fin { border-top-right-radius: .4rem; border-bottom-right-radius: .4rem; }
.cal-barre:hover { color: #fff; filter: brightness(1.1); }
.statut-prevue { background: #0dcaf0; } .cal-barre.statut-prevue { color: #0F2341; }
.statut-en_cours { background: #0d6efd; } .statut-retard { background: #dc3545; }
.statut-rendue { background: #6c757d; } .statut-annulee { background: #adb5bd; }
.pastille { display: inline-block; width: .8rem; height: .8rem; border-radius: .2rem; vertical-align: -1px; }
.parc-choix { max-height: 22rem; overflow-y: auto; border: 1px solid var(--bs-border-color); border-radius: .5rem; padding: .5rem .75rem; }
.parc-ligne { padding: .2rem 0 .2rem 1.75rem; margin: 0; }
.voir-collegues { max-height: 22rem; overflow-y: auto; min-width: 15rem; }
.fiche.lecture { opacity: .95; }

/* Coffre-fort */
.liste-cases { max-height: 220px; overflow-y: auto; border: 1px solid var(--bs-border-color); border-radius: 8px; padding: 6px 10px; }
.liste-cases label { display: flex; gap: 6px; align-items: center; padding: 2px 0; font-weight: 400; }
.liste-cases input[type=checkbox] { flex: none; width: auto; margin: 0; }
.qr-coffre svg { width: 210px; height: 210px; }
.secret { font-size: .95rem; }
.element .element-suppr.text-primary { opacity: 1; }
.element-suppr:hover { color: var(--encre); text-decoration: none; }
.chip-lien { display: inline-block; font-size: .72rem; border: 1px solid var(--trait); border-radius: 999px; padding: 0 7px;
  color: var(--encre-douce); white-space: nowrap; margin-right: 3px; }
a.chip-lien:hover { color: var(--encre); text-decoration: none; background: var(--trait); }

/* ---------- Tableau de bord ---------- */
.tuile .card-body { position: relative; }
.tuile-icone { position: absolute; top: 14px; right: 14px; width: 36px; height: 36px; border-radius: 10px;
  display: grid; place-items: center; font-size: 1.1rem; }
.t-bleu { background: #DBEAFE; color: #1D4ED8; } .t-rouge { background: #FEE2E2; color: #B91C1C; }
.t-violet { background: #EDE9FE; color: #6D28D9; } .t-orange { background: #FFEDD5; color: #C2410C; }
.t-cyan { background: #CFFAFE; color: #0E7490; } .t-vert { background: #DCFCE7; color: #15803D; }
.barre-etapes { display: flex; height: 12px; border-radius: 999px; overflow: hidden; background: #E9EEF5; }
.barre-etapes a { display: block; min-width: 4px; }
.legende { color: var(--texte-doux); } .legende:hover { color: var(--encre-marque); }
.pastille { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 4px; vertical-align: -1px; }
.e-pris_en_charge { background: #3B82F6; } .e-attente_labo { background: #8B5CF6; } .e-devis { background: #F59E0B; }
.e-attente_client { background: #EAB308; } .e-expedition_fournisseur { background: #06B6D4; }
.e-attente_fournisseur { background: #F97316; } .e-intervention { background: #EC4899; }
.list-group-item.a-moi { box-shadow: inset 3px 0 0 var(--accent); background: #F5F9FF; }
.sidebar-lien-sous { padding-left: 2.4rem !important; font-size: .9em; }
.carte-facturer { border-left: 4px solid #F59E0B; }

/* ================= Mode sombre ================= */
[data-bs-theme="dark"] {
  color-scheme: dark;
  --fond: #0B1220;
  --surface: #131C2E;
  --surface-2: #19243A;
  --texte: #E2E8F0;
  --texte-doux: #94A3B8;
  --bordure: #26334A;
  --marque-clair: #1C2A47;
  --encre-marque: #DCE6F5;
  --accent: #60A5FA;
  --ombre: 0 1px 2px rgba(0, 0, 0, .35), 0 2px 10px rgba(0, 0, 0, .25);

  --bs-body-bg: var(--fond);
  --bs-body-color: var(--texte);
  --bs-secondary-color: var(--texte-doux);
  --bs-tertiary-bg: var(--surface-2);
  --bs-secondary-bg: var(--surface-2);
  --bs-emphasis-color: #F1F5F9;
  --bs-heading-color: var(--encre-marque);
  --bs-border-color: var(--bordure);
  --bs-link-color: #7AB4FF;
  --bs-link-color-rgb: 122, 180, 255;
  --bs-link-hover-color: #A9CEFF;
  --bs-link-hover-color-rgb: 169, 206, 255;
  --bs-card-bg: var(--surface);
  --bs-primary-rgb: 59, 130, 246;
}
[data-bs-theme="dark"] .card { --bs-card-bg: var(--surface); --bs-card-color: var(--texte); background: var(--surface); }
[data-bs-theme="dark"] .list-group { --bs-list-group-bg: var(--surface); --bs-list-group-color: var(--texte);
  --bs-list-group-border-color: var(--bordure); --bs-list-group-action-hover-bg: var(--surface-2); }
[data-bs-theme="dark"] .modal, [data-bs-theme="dark"] .dropdown-menu, [data-bs-theme="dark"] .offcanvas:not(.sidebar),
[data-bs-theme="dark"] .popover, [data-bs-theme="dark"] .toast { --bs-modal-bg: var(--surface); --bs-dropdown-bg: var(--surface);
  --bs-offcanvas-bg: var(--surface); --bs-popover-bg: var(--surface); --bs-toast-bg: var(--surface); }
[data-bs-theme="dark"] .text-muted { color: var(--texte-doux) !important; }
[data-bs-theme="dark"] .bg-white, [data-bs-theme="dark"] .bg-light, [data-bs-theme="dark"] .bg-body { background-color: var(--surface) !important; }
[data-bs-theme="dark"] .text-bg-light { background-color: var(--surface-2) !important; color: var(--texte) !important; }
[data-bs-theme="dark"] .text-dark:not(.badge) { color: var(--texte) !important; }
[data-bs-theme="dark"] .border { border-color: var(--bordure) !important; }

/* Tableaux */
[data-bs-theme="dark"] .table { --bs-table-color: var(--texte); --bs-table-striped-color: var(--texte); --bs-table-hover-color: var(--texte); }
[data-bs-theme="dark"] .table > :not(caption) > * > * { border-bottom-color: #1F2A3F; }
[data-bs-theme="dark"] .table-hover > tbody > tr:hover > * { --bs-table-bg-state: #1A2540; }
[data-bs-theme="dark"] .table-danger { --bs-table-bg: #3A1A22 !important; --bs-table-color: #FECACA; }
[data-bs-theme="dark"] .table-warning { --bs-table-bg: #3A2E12 !important; --bs-table-color: #FDE68A; }
[data-bs-theme="dark"] .table-success { --bs-table-bg: #13301F !important; --bs-table-color: #BBF7D0; }
[data-bs-theme="dark"] .table-light { --bs-table-bg: var(--surface-2); --bs-table-color: var(--texte); }

/* Boutons */
[data-bs-theme="dark"] .btn-primary { --bs-btn-bg: #2563EB; --bs-btn-border-color: #2563EB; --bs-btn-hover-bg: #1D4ED8;
  --bs-btn-hover-border-color: #1D4ED8; --bs-btn-active-bg: #1D4ED8; --bs-btn-disabled-bg: #2563EB; --bs-btn-disabled-border-color: #2563EB; }
[data-bs-theme="dark"] .btn-outline-primary { --bs-btn-color: #7AB4FF; --bs-btn-border-color: #3B6FB8;
  --bs-btn-hover-bg: #2563EB; --bs-btn-hover-border-color: #2563EB; --bs-btn-hover-color: #fff; }
[data-bs-theme="dark"] .btn-outline-secondary { --bs-btn-color: #CBD5E1; --bs-btn-border-color: #3A475E;
  --bs-btn-hover-bg: #223049; --bs-btn-hover-color: #F1F5F9; --bs-btn-hover-border-color: #4A5872; }
[data-bs-theme="dark"] .btn-secondary { --bs-btn-bg: #26334A; --bs-btn-color: #E2E8F0; --bs-btn-border-color: #26334A;
  --bs-btn-hover-bg: #31405B; --bs-btn-hover-color: #fff; --bs-btn-hover-border-color: #31405B; }
[data-bs-theme="dark"] .btn-light { --bs-btn-bg: var(--surface-2); --bs-btn-color: var(--texte); --bs-btn-border-color: var(--bordure);
  --bs-btn-hover-bg: #223049; --bs-btn-hover-color: #fff; }
[data-bs-theme="dark"] .btn-close { filter: invert(1) grayscale(100%) brightness(200%); }

/* Formulaires */
[data-bs-theme="dark"] .form-control, [data-bs-theme="dark"] .form-select {
  background-color: #0F1729; border-color: #2C3A53; color: var(--texte); }
[data-bs-theme="dark"] .form-control::placeholder { color: #64748B; }
[data-bs-theme="dark"] .form-control:disabled, [data-bs-theme="dark"] .form-select:disabled,
[data-bs-theme="dark"] .form-control[readonly] { background-color: var(--surface-2); }
[data-bs-theme="dark"] .form-label { color: #CBD5E1; }
[data-bs-theme="dark"] .form-check-input { background-color: #0F1729; border-color: #475569; }
[data-bs-theme="dark"] .form-check-input:checked { background-color: #2563EB; border-color: #2563EB; }
[data-bs-theme="dark"] .input-group-text { background: var(--surface-2); border-color: #2C3A53; color: var(--texte-doux); }

/* Badges et alertes : teintes sombres lisibles */
[data-bs-theme="dark"] .badge.bg-success { background: #14361F !important; color: #86EFAC !important; }
[data-bs-theme="dark"] .badge.bg-danger { background: #3F1D24 !important; color: #FCA5A5 !important; }
[data-bs-theme="dark"] .badge.bg-warning { background: #3D2F0E !important; color: #FCD34D !important; }
[data-bs-theme="dark"] .badge.bg-info { background: #0F3042 !important; color: #7DD3FC !important; }
[data-bs-theme="dark"] .badge.bg-primary { background: #1C2D4F !important; color: #A9CEFF !important; }
[data-bs-theme="dark"] .badge.bg-secondary { background: #26334A !important; color: #CBD5E1 !important; }
[data-bs-theme="dark"] .badge.bg-dark { background: #0B1220 !important; color: #E2E8F0 !important; }
[data-bs-theme="dark"] .alert-success { background: #0F2A1C; color: #A7F3D0; }
[data-bs-theme="dark"] .alert-danger { background: #2D151B; color: #FECACA; }
[data-bs-theme="dark"] .alert-info { background: #10213D; color: #BFDBFE; }
[data-bs-theme="dark"] .alert-warning { background: #2E2410; color: #FDE68A; }
[data-bs-theme="dark"] [style*="background:#fff3cd"] { background: #3D2F0E !important; color: #FCD34D !important; }

[data-bs-theme="dark"] .nav-tabs .nav-link.active { box-shadow: inset 0 -2px 0 #60A5FA; }
[data-bs-theme="dark"] .progress, [data-bs-theme="dark"] .barre-etapes { background: #223049; }
[data-bs-theme="dark"] .progress-bar { background: #3B82F6; }
[data-bs-theme="dark"] .pagination { --bs-pagination-bg: var(--surface); --bs-pagination-border-color: var(--bordure);
  --bs-pagination-active-bg: #2563EB; --bs-pagination-active-border-color: #2563EB; --bs-pagination-disabled-bg: var(--surface); }

/* Tableau de bord */
[data-bs-theme="dark"] .t-bleu { background: #172A4F; color: #93C5FD; } [data-bs-theme="dark"] .t-rouge { background: #3B1820; color: #FCA5A5; }
[data-bs-theme="dark"] .t-violet { background: #2A2050; color: #C4B5FD; } [data-bs-theme="dark"] .t-orange { background: #3A2412; color: #FDBA74; }
[data-bs-theme="dark"] .t-cyan { background: #0E3340; color: #67E8F9; } [data-bs-theme="dark"] .t-vert { background: #12331F; color: #86EFAC; }
[data-bs-theme="dark"] .list-group-item.a-moi { background: #16233D; }
[data-bs-theme="dark"] a.card.kpi:hover { box-shadow: 0 6px 18px rgba(0, 0, 0, .45); }

/* Mes tâches : les fiches gardent leurs couleurs d'origine */

/* Composants divers */
[data-bs-theme="dark"] .choix-type span, [data-bs-theme="dark"] .liste-suggestions,
[data-bs-theme="dark"] .rapport { background: var(--surface); }
[data-bs-theme="dark"] .parcours li::before { background: var(--surface); border-color: #475569; }
[data-bs-theme="dark"] .parcours li:not(:last-child)::after, [data-bs-theme="dark"] .fil li { border-color: #2C3A53; }
[data-bs-theme="dark"] .parcours li:not(:last-child)::after { background: #2C3A53; }
[data-bs-theme="dark"] .fil li::before { border-color: var(--surface); }
[data-bs-theme="dark"] .fil li.du-client > div:last-child:not(.d-flex) { background: #10213D; }
[data-bs-theme="dark"] .produit-image { background: var(--surface-2); }
[data-bs-theme="dark"] .apercu-pdf { background: #0F1729; }
[data-bs-theme="dark"] .plaque-grande { background: #F8FAFC; color: #0F2341; }
[data-bs-theme="dark"] .matrice-roles .niveau-lecture { background-color: #10213D; }
[data-bs-theme="dark"] .matrice-roles .niveau-saisie { background-color: #0F2A1C; }
[data-bs-theme="dark"] .matrice-roles .niveau-complet { background-color: #14361F; }
[data-bs-theme="dark"] .matrice-roles .niveau-personnalise { background-color: #2E2410; }
[data-bs-theme="dark"] .connexion-form { background: var(--surface); }
[data-bs-theme="dark"] .cal-jour.aujourdhui .num { background: #2563EB; }
/* Les zones de signature restent blanches : l'encre est noire */
[data-bs-theme="dark"] .zone-signature, [data-bs-theme="dark"] .signature-image { background: #fff; }
[data-bs-theme="dark"] .zone-signature .consigne { color: #64748B; }

/* Mes notes : glisser-déposer et recherche */
.element-poignee { cursor: grab; color: var(--encre-douce); opacity: .35; padding: 0 1px; margin-left: -6px; touch-action: none; }
.element:hover .element-poignee { opacity: 1; }
@media (hover: none) { .element-poignee { opacity: .7; } }
.element-fantome { opacity: .35; background: var(--trait); border-radius: 6px; }
.element-choisi { cursor: grabbing; }
.fiche-liste.js-trier { min-height: 10px; }
.recherche-notes { position: relative; }
.recherche-notes .bi-search { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--texte-doux); pointer-events: none; }
.recherche-notes input { padding-left: 2rem; width: 280px; max-width: 70vw; }
mark.surligne { background: #FDE047; color: #1E1B05; padding: 0 1px; border-radius: 3px; }
.fiche.sombre mark.surligne { background: #FACC15; color: #1E1B05; }

/* Passerelle WaveSoft : données de test reçues */
.passerelle-json { max-height: 480px; overflow: auto; padding: .75rem; border-radius: 6px; border: 1px solid var(--bs-border-color);
  background: var(--bs-tertiary-bg); color: var(--bs-body-color); white-space: pre-wrap; word-break: break-word; }

/* Resto : photo et vignettes des tickets */
.photo-resto { max-width: 100%; max-height: 70vh; border-radius: 6px; border: 1px solid var(--bs-border-color); cursor: zoom-in; }
.vignette-resto { width: 48px; height: 48px; object-fit: cover; border-radius: 6px; border: 1px solid var(--bs-border-color);
  background: var(--bs-tertiary-bg); color: var(--bs-secondary-color); }
