/* =========================================================================
   DigiCare — Réseaux de soins
   Complète Bootstrap 5.3 : surcharge des variables Bootstrap (couleurs,
   typo, rayons) + quelques composants métier. La grille, l'espacement et
   le responsive restent 100 % Bootstrap (container, row, col-*, gap-*…).
   ========================================================================= */

:root {
  --brand: #0b7a63;
  --brand-dark: #08654f;
  --brand-soft: #e4f4ee;
  --brand-soft-2: #d3efe2;
  --accent: #105ea0;
  --accent-dark: #0c4c83;
  --accent-soft: #e8f1f9;
  --ink: #14293d;
  --muted: #5f7385;
  --line: #e2eaf0;
  --surface-2: #e0ebf4;
  --success-ink: #14915f;
  --danger-ink: #d64550;

  --bs-font-sans-serif: "Plus Jakarta Sans", "Google Sans", Inter, system-ui, sans-serif;
  --bs-body-font-family: var(--bs-font-sans-serif);
  --bs-body-font-size: .9rem;
  --bs-body-color: var(--ink);
  --bs-body-color-rgb: 20, 41, 61;
  --bs-body-bg: #e8f2fb;
  --bs-secondary-color: var(--muted);
  --bs-border-color: var(--line);
  --bs-border-radius: .625rem;
  --bs-border-radius-lg: .875rem;
  --bs-primary: var(--brand);
  --bs-primary-rgb: 11, 122, 99;
  --bs-link-color: var(--accent);
  --bs-link-color-rgb: 16, 94, 160;
  --bs-link-hover-color: var(--accent-dark);
  --bs-success: var(--success-ink);
  --bs-success-rgb: 20, 145, 95;
  --bs-danger: var(--danger-ink);
  --bs-danger-rgb: 214, 69, 80;
  --bs-warning-rgb: 217, 140, 20;
}

body {
  background: var(--bs-body-bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1 0 auto; }
h1, h2, h3, h4, h5 { font-weight: 700; letter-spacing: -.01em; }
.text-brand { color: var(--brand) !important; }
.text-accent { color: var(--accent) !important; }
.fw-600 { font-weight: 600; }
.fs-xs { font-size: .75rem; }
.fs-sm { font-size: .82rem; }
.tabular { font-variant-numeric: tabular-nums; }

/* ---- Boutons --------------------------------------------------------- */
.btn { --bs-btn-font-weight: 600; --bs-btn-padding-y: .5rem; --bs-btn-padding-x: 1rem; --bs-btn-font-size: .9rem; --bs-btn-border-radius: .5rem; }
.btn-lg { --bs-btn-padding-y: .7rem; --bs-btn-padding-x: 1.4rem; --bs-btn-font-size: 1rem; }
.btn-primary {
  --bs-btn-bg: var(--brand); --bs-btn-border-color: var(--brand);
  --bs-btn-hover-bg: var(--brand-dark); --bs-btn-hover-border-color: var(--brand-dark);
  --bs-btn-active-bg: var(--brand-dark); --bs-btn-active-border-color: var(--brand-dark);
  --bs-btn-disabled-bg: var(--brand); --bs-btn-disabled-border-color: var(--brand);
  --bs-btn-focus-shadow-rgb: 11, 122, 99;
}
.btn-accent {
  --bs-btn-color: #fff; --bs-btn-bg: var(--accent); --bs-btn-border-color: var(--accent);
  --bs-btn-hover-color: #fff; --bs-btn-hover-bg: var(--accent-dark); --bs-btn-hover-border-color: var(--accent-dark);
  --bs-btn-active-color: #fff; --bs-btn-active-bg: var(--accent-dark); --bs-btn-active-border-color: var(--accent-dark);
  --bs-btn-focus-shadow-rgb: 16, 94, 160;
}
.btn-outline-ink {
  --bs-btn-color: var(--ink); --bs-btn-border-color: #cfd9e1; --bs-btn-bg: #fff;
  --bs-btn-hover-color: var(--ink); --bs-btn-hover-bg: var(--surface-2); --bs-btn-hover-border-color: #b8c6d1;
  --bs-btn-active-color: var(--ink); --bs-btn-active-bg: var(--surface-2); --bs-btn-active-border-color: #b8c6d1;
}
.btn-ellipsis {
  width: 2.25rem; height: 2.25rem; padding: 0; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--muted); background: transparent; border: 0;
}
.btn-ellipsis:hover, .btn-ellipsis.show { background: var(--surface-2); color: var(--ink); }
.btn-ellipsis::after { display: none; }
.btn-icon-danger { color: var(--danger-ink); width: 2.25rem; height: 2.25rem; padding: 0; border: 0; background: transparent; border-radius: 50%; }
.btn-icon-danger:hover { background: #fdecee; color: var(--danger-ink); }

/* ---- Formulaires ------------------------------------------------------ */
.form-control, .form-select { border-color: #d3dde5; border-radius: .5rem; min-height: 2.6rem; color: var(--ink); }
.form-control::placeholder { color: #93a3b1; }
.form-control:focus, .form-select:focus { border-color: var(--brand); box-shadow: 0 0 0 .2rem rgba(11, 122, 99, .15); }
.form-control-lg { min-height: 3.1rem; font-size: 1rem; }
.form-label { font-weight: 600; font-size: .82rem; margin-bottom: .35rem; }
.form-check-input:checked { background-color: var(--brand); border-color: var(--brand); }
.form-check-input:focus { border-color: var(--brand); box-shadow: 0 0 0 .2rem rgba(11, 122, 99, .15); }
.form-switch .form-check-input { width: 2.4em; height: 1.3em; }
.input-icon { position: relative; }
.input-icon > .fa-regular, .input-icon > .fa-light { position: absolute; left: .95rem; top: 50%; transform: translateY(-50%); color: #93a3b1; pointer-events: none; }
.input-icon > .form-control { padding-left: 2.6rem; }

/* ---- Cartes ------------------------------------------------------------ */
.card {
  --bs-card-border-color: var(--line);
  --bs-card-border-radius: .875rem;
  --bs-card-inner-border-radius: .8rem;
  --bs-card-cap-bg: #fff;
  --bs-card-cap-padding-y: 1rem;
  --bs-card-cap-padding-x: 1.25rem;
  --bs-card-spacer-x: 1.25rem;
  --bs-card-spacer-y: 1.15rem;
  box-shadow: 0 1px 3px rgba(20, 41, 61, .05);
  background-color: white;
}
.card-header { border-bottom-color: var(--line); }
.card-title-lg { font-size: 1.25rem; font-weight: 700; margin: 0; }

/* ---- Badges d'état ------------------------------------------------------ */
.badge { font-weight: 600; font-size: .75rem; padding: .35em .7em; border-radius: .4rem; }
.badge-active   { background: #d5f0e2; color: #157a4d; }
.badge-warning  { background: #fdf0d5; color: #a86400; }
.badge-inactive { background: #fdeaec; color: #c0333e; }
.badge-neutral  { background: #e9eef3; color: #4a5f72; }
.badge-info     { background: var(--accent-soft); color: var(--accent); }
.badge .fa-solid { font-size: .55rem; vertical-align: .1em; margin-right: .3rem; }

/* ---- Topbar / navigation ------------------------------------------------ */
.topbar { background: #fff; border-bottom: 1px solid var(--line); }
.topbar-main { min-height: 3.75rem; }
.brand { display: inline-flex; align-items: center; gap: .55rem; text-decoration: none; color: var(--ink); font-weight: 800; font-size: 1.45rem; letter-spacing: -.02em; }
.brand svg { width: 2.1rem; height: 2.1rem; flex: none; }
.brand-name { color: #12385c; }
.center-switch { border-left: 1px solid var(--line); padding-left: 1.25rem; margin-left: 1.25rem; font-weight: 600; font-size: 1rem; color: var(--ink); background: none; border-top: 0; border-right: 0; border-bottom: 0; }
.center-switch:hover { color: var(--brand); }
.bell { position: relative; width: 2.6rem; height: 2.6rem; border-radius: 50%; border: 0; background: transparent; color: var(--accent); font-size: 1.25rem; }
.bell:hover { background: var(--surface-2); }
.bell-count { position: absolute; top: .25rem; right: .2rem; min-width: 1.05rem; height: 1.05rem; border-radius: 50%; background: #e5383b; color: #fff; font-size: .62rem; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.user-toggle { display: flex; align-items: center; gap: .65rem; background: none; border: 0; text-align: left; padding: .25rem .4rem; border-radius: .6rem; color: var(--ink); }
.user-toggle:hover { background: var(--surface-2); }
.avatar { width: 2.5rem; height: 2.5rem; border-radius: 50%; background: var(--brand); color: #fff; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; flex: none; font-size: .95rem; }
.avatar-lg { width: 3.4rem; height: 3.4rem; font-size: 1.15rem; }
.avatar-soft { background: #d6e8f7; color: var(--accent); }
.avatar-brand-soft { background: var(--brand-soft-2); color: var(--brand-dark); }

.subnav { background: #fff; border-bottom: 1px solid var(--line); }
.topbar { z-index: 1030; }
.subnav .nav { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.subnav .nav::-webkit-scrollbar { display: none; }
.subnav .nav-link { display: flex; align-items: center; gap: .55rem; color: var(--ink); font-weight: 500; font-size: .88rem; padding: .95rem 1.05rem; white-space: nowrap; border-bottom: 2px solid transparent; border-radius: 0; }
.subnav .nav-link i { font-size: 1.15rem; color: #12385c; }
.subnav .nav-link:hover { color: var(--brand); }
.subnav .nav-link.active { color: var(--brand); font-weight: 600; border-bottom-color: var(--brand); }
.subnav .nav-link.active i { color: var(--brand); }
.clock { color: var(--muted); font-size: .85rem; white-space: nowrap; }

/* ---- Accueil : recherche / bandeau --------------------------------------- */
.search-title { font-size: 1.2rem; font-weight: 700; display: flex; align-items: center; gap: .6rem; margin: 0; }
.search-title i { font-size: 1.3rem; color: var(--brand); }
.scan-tile { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .5rem; min-width: 9.5rem; height: 100%; padding: 1rem; background: var(--accent-soft); border: 1px solid #d5e5f3; border-radius: .75rem; color: var(--accent); font-weight: 600; font-size: .82rem; text-align: center; line-height: 1.25; }
.scan-tile i { font-size: 2rem; }
.scan-tile:hover { background: #dcebf7; color: var(--accent-dark); }
.hero-card { position: relative; overflow: hidden; background: linear-gradient(100deg, #e3f5ec 0%, #d5efe2 100%); border: 1px solid #cdeadb; min-height: 9.75rem; }
.hero-card img { position: absolute; left: -.5rem; bottom: 0; height: 100%; width: auto; max-width: 48%; object-fit: cover; object-position: top center; }
.hero-card .hero-text { margin-left: 44%; padding: 1.4rem 1.1rem 1.4rem 0; display: flex; flex-direction: column; justify-content: center; height: 100%; }
.hero-card p { color: #0d6a55; font-weight: 700; font-size: 1.05rem; line-height: 1.3; margin: 0; }
.hero-bar { display: block; width: 2.1rem; height: 3px; border-radius: 2px; background: var(--brand); margin-top: .8rem; }
.quality-card { text-align: center; }
.quality-card i { font-size: 2.2rem; color: #12385c; }
.quality-card p { margin: .5rem 0 0; font-size: .85rem; color: var(--muted); line-height: 1.35; }

/* ---- Couverture -------------------------------------------------------- */
#coverageResult:empty { display: none; }
.cov-title { font-size: 1.35rem; font-weight: 700; margin: 0; }
.cov-label { color: var(--muted); font-size: .76rem; margin-bottom: .2rem; }
.cov-value { font-weight: 600; font-size: .92rem; }
.cov-meta { font-size: .85rem; color: var(--ink); display: flex; align-items: center; gap: .5rem; }
.cov-meta i { color: var(--accent); width: 1rem; text-align: center; }
.progress { --bs-progress-height: .5rem; --bs-progress-bg: #dfe8ee; --bs-progress-bar-bg: var(--brand); border-radius: 1rem; }
.progress-bar.bar-warning { background: #e79a1d; }
.progress-bar.bar-danger { background: var(--danger-ink); }
.text-remaining { color: var(--success-ink); font-weight: 600; }
@media (min-width: 992px) { .cov-col + .cov-col { border-left: 1px solid var(--line); padding-left: 1.5rem; } }

/* ---- Facture : tableau ---------------------------------------------------- */
.table-invoice { margin: 0; }
.table-invoice > :not(caption) > * > * { padding: .7rem .75rem; border-bottom-color: #edf2f6; vertical-align: middle; }
.table-invoice thead th, .table-flat thead th { background: var(--surface-2); font-size: .78rem; font-weight: 700; color: var(--ink); border-bottom: 0; white-space: nowrap; }
.table-invoice thead th:first-child { border-top-left-radius: .5rem; }
.table-invoice thead th:last-child { border-top-right-radius: .5rem; }
.invoice-input { min-height: 2.35rem; width: 100%; text-align: left; padding: .3rem .7rem; font-size: .88rem; border-radius: .4rem; background: #fff; }
.col-qty { width: 7rem; } .col-price { width: 9.5rem; } .col-amount { width: 8rem; } .col-actions { width: 4.5rem; }
.empty-lines { text-align: center; color: var(--muted); padding: 2.25rem 1rem; }
.empty-lines i { font-size: 2rem; color: #b4c3cf; display: block; margin-bottom: .6rem; }

/* ---- Récapitulatif financier ---------------------------------------------- */
.recap-row { display: flex; justify-content: space-between; align-items: baseline; padding: .3rem 0; font-size: .88rem; }
.recap-row strong { font-weight: 700; font-variant-numeric: tabular-nums; }
.recap-covered strong { color: var(--success-ink); }
.recap-remaining { font-weight: 700; }
.amount-due { display: flex; align-items: center; gap: 1rem; background: #e2f4e9; border: 1px solid #cdebd9; border-radius: .75rem; padding: 1rem 1.15rem; margin: .8rem 0 1.1rem; }
.amount-due > i { font-size: 2.6rem; color: var(--brand); }
.amount-due small { display: block; font-size: .8rem; color: var(--ink); margin-bottom: .1rem; }
.amount-due .amount { font-size: 1.85rem; font-weight: 800; color: var(--brand); line-height: 1.1; font-variant-numeric: tabular-nums; }
.sticky-recap { position: sticky; top: 1rem; }

/* ---- Modal prestation ----------------------------------------------------- */
.catalog-list { max-height: 21rem; overflow-y: auto; }
.catalog-item { display: flex; align-items: center; justify-content: space-between; gap: 1rem; width: 100%; text-align: left; padding: .75rem 1rem; background: #fff; border: 1px solid var(--line); border-radius: .6rem; margin-bottom: .5rem; color: var(--ink); }
.catalog-item:hover { border-color: #b7d6cc; background: #f6fbf9; }
.catalog-item.selected { border-color: var(--brand); background: var(--brand-soft); box-shadow: 0 0 0 1px var(--brand) inset; }
.catalog-item:disabled { opacity: .6; cursor: not-allowed; background: var(--surface-2, #f5f7f9); border-color: var(--line); }
.catalog-radio { flex: none; width: 1.15rem; height: 1.15rem; border: 2px solid #b4c3cf; border-radius: 50%; background: #fff; position: relative; transition: border-color .15s; }
.catalog-radio::after { content: ""; position: absolute; inset: 3px; border-radius: 50%; background: var(--brand); transform: scale(0); transition: transform .15s; }
.catalog-item:hover:not(:disabled) .catalog-radio { border-color: var(--brand); }
.catalog-item.selected .catalog-radio { border-color: var(--brand); }
.catalog-item.selected .catalog-radio::after { transform: scale(1); }
.catalog-item:disabled .catalog-radio { border-style: dashed; }
#svcPrice[readonly] { background: #eef2f5; color: var(--ink); cursor: default; }
.catalog-item .name { font-weight: 600; font-size: .9rem; }
.catalog-item .cat { font-size: .76rem; color: var(--muted); }
.chip { border: 1px solid #d3dde5; background: #fff; color: var(--ink); border-radius: 2rem; padding: .35rem .85rem; font-size: .8rem; font-weight: 600; }
.chip:hover { border-color: var(--brand); color: var(--brand); }
.chip.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.scanner { position: relative; height: 13rem; border-radius: .75rem; background: #0f2233; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.scanner::before { content: ""; width: 9rem; height: 9rem; border: 2px solid rgba(255,255,255,.85); border-radius: .75rem; }
.scanner::after { content: ""; position: absolute; left: 50%; width: 9rem; height: 2px; margin-left: -4.5rem; background: #4ce0b3; box-shadow: 0 0 10px #4ce0b3; animation: scanline 2s ease-in-out infinite alternate; }
@keyframes scanline { from { top: 36%; } to { top: 64%; } }

/* ---- Listes : cartes utilisateurs / rôles ----------------------------------- */
.person-card { height: 100%; transition: box-shadow .15s, transform .15s; }
.person-card:hover { box-shadow: 0 6px 18px rgba(20, 41, 61, .08); }
.person-card .email { color: var(--muted); font-size: .82rem; word-break: break-all; }
.role-icon { width: 2.9rem; height: 2.9rem; border-radius: .75rem; background: var(--brand-soft); color: var(--brand); display: inline-flex; align-items: center; justify-content: center; font-size: 1.3rem; flex: none; }
.stack-avatars { display: flex; }
.stack-avatars .avatar { width: 1.9rem; height: 1.9rem; font-size: .68rem; border: 2px solid #fff; margin-left: -.5rem; }
.stack-avatars .avatar:first-child { margin-left: 0; }

/* ---- Statistiques ------------------------------------------------------------ */
.stat-figure { font-size: 1.65rem; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1.15; }
.stat-figure small { font-size: .85rem; font-weight: 600; color: var(--muted); }
.stat-trend { font-size: .78rem; font-weight: 600; }
.stat-trend.up { color: var(--success-ink); } .stat-trend.down { color: var(--danger-ink); }
.bars { display: flex; align-items: flex-end; gap: .6rem; height: 13rem; padding-top: 1rem; }
.bars .bar { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; gap: .4rem; font-size: .72rem; color: var(--muted); }
.bars .bar-fill { width: 100%; max-width: 2.6rem; background: var(--brand); border-radius: .35rem .35rem 0 0; min-height: 4px; position: relative; }
.bars .bar-fill.today { background: var(--accent); }
.bars .bar-fill span { position: absolute; top: -1.15rem; left: 50%; transform: translateX(-50%); font-size: .68rem; font-weight: 700; color: var(--ink); white-space: nowrap; }
.split-bar { display: flex; height: 1.1rem; border-radius: 1rem; overflow: hidden; background: #dfe8ee; }
.split-bar .covered { background: var(--brand); } .split-bar .remaining { background: #e79a1d; }
.legend-dot { display: inline-block; width: .65rem; height: .65rem; border-radius: 50%; margin-right: .4rem; }

/* ---- Historique -------------------------------------------------------------- */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline-day { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 1rem 1.25rem .5rem; background: var(--surface-2); }
.timeline-item { display: flex; gap: .9rem; align-items: center; padding: .85rem 1.25rem; border-bottom: 1px solid #edf2f6; }
.timeline-item:last-child { border-bottom: 0; }
.timeline-icon { width: 2.5rem; height: 2.5rem; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; flex: none; font-size: 1.05rem; }
.timeline-icon.invoice { background: var(--brand-soft); color: var(--brand); }
.timeline-icon.service { background: var(--accent-soft); color: var(--accent); }
.timeline-icon.coverage { background: #fdf0d5; color: #a86400; }
.timeline-icon.operation { background: #e9eef3; color: #4a5f72; }

/* ---- Tableaux génériques ------------------------------------------------------ */
.table-flat > :not(caption) > * > * { padding: .85rem 1rem; border-bottom-color: #edf2f6; vertical-align: middle; }
.table-flat tbody tr:hover { background: #fafcfd; }
.tag { display: inline-block; background: var(--surface-2); border: 1px solid var(--line); border-radius: .4rem; padding: .15rem .55rem; font-size: .76rem; font-weight: 500; margin: .1rem .15rem .1rem 0; }
.nav-tabs { --bs-nav-tabs-link-active-color: var(--brand); --bs-nav-tabs-border-color: var(--line); --bs-nav-tabs-link-active-border-color: var(--line) var(--line) #fff; }
.nav-tabs .nav-link { font-weight: 600; color: var(--muted); padding: .8rem 1.2rem; }
.nav-tabs .nav-link:hover { color: var(--brand); }

/* ---- Rôles : permissions -------------------------------------------------------- */
.perm-group .card-header { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .85rem 1.1rem; }
.perm-group .card-header h3 { font-size: .95rem; margin: 0; display: flex; align-items: center; gap: .6rem; }
.perm-group .card-header h3 i { color: var(--brand); }
.perm-list .form-check { padding: .45rem 0 .45rem 2.7rem; margin: 0; border-bottom: 1px dashed #edf2f6; }
.perm-list .form-check:last-child { border-bottom: 0; }
.detail-list dt { color: var(--muted); font-weight: 500; font-size: .8rem; }
.detail-list dd { font-weight: 600; margin-bottom: .85rem; }
.detail-list dd:last-child { margin-bottom: 0; }

/* ---- Login ---------- */
.login-shell { min-height: 100vh; }
.login-visual { background: linear-gradient(140deg, #e3f5ec 0%, #cfeadc 100%); position: relative; overflow: hidden; }
.login-visual img { position: absolute; bottom: 0; left: 50%; transform: translateX(-50%); height: 78%; max-width: 92%; object-fit: contain; object-position: bottom; }
.login-visual .tagline { position: relative; z-index: 1; padding: 3.5rem 3rem 0; max-width: 32rem; }
.login-visual .tagline h2 { color: #0d6a55; font-size: 2rem; line-height: 1.2; }
.login-card { width: 100%; max-width: 26rem; }

/* ---- Footer -- */
.app-footer { color: var(--muted); font-size: .78rem; border-top: 1px solid var(--line); background: #fff; }
.app-footer a { color: var(--muted); text-decoration: none; }
.app-footer a:hover { color: var(--brand); }

/* ---- Dropdown / modal ---------------------------- */
.dropdown-menu { --bs-dropdown-border-color: var(--line); --bs-dropdown-border-radius: 12px; --bs-dropdown-item-padding-y: .55rem; --bs-dropdown-item-padding-x: 1rem; --bs-dropdown-link-active-bg: var(--brand); box-shadow: 0 10px 28px rgba(20, 41, 61, .12); background-color: white;}
.dropdown-item i { width: 1.3rem; color: var(--muted); }
.dropdown-item.text-danger i { color: inherit; }
.modal-content { border: 0; border-radius: 1rem; background-color: #fff; }
.modal-header { border-bottom-color: var(--line); padding: 1.1rem 1.4rem; }
.modal-footer { border-top-color: var(--line); }
.modal-title { font-weight: 700; font-size: 1.1rem; }
/* Modal de retour (création de facture) : entrée « pop » + icône animée. */
.result-modal .modal-dialog { max-width: 28rem; }
.result-modal .modal-body { padding: 2rem 1.75rem 1.25rem; }
.result-modal .modal-footer { border-top: 0; padding: 0 1.75rem 1.75rem; gap: .5rem; }
.result-modal.fade .modal-dialog { transform: scale(.85); opacity: 0; transition: transform .3s cubic-bezier(.34, 1.56, .64, 1), opacity .2s ease; }
.result-modal.show .modal-dialog { transform: none; opacity: 1; }
.result-icon { width: 4.5rem; height: 4.5rem; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 2.1rem; margin-bottom: 1rem; }
.result-icon-success { background: #e3f5ec; color: var(--success-ink); }
.result-icon-danger { background: #fdecee; color: var(--danger-ink); }
.result-modal.show .result-icon { animation: dc-result-pop .5s .15s cubic-bezier(.34, 1.56, .64, 1) both; }
.result-modal.show .result-icon-success { box-shadow: 0 0 0 0 rgba(20, 145, 95, .35); animation: dc-result-pop .5s .15s cubic-bezier(.34, 1.56, .64, 1) both, dc-result-ring 1.2s .6s ease-out; }
.result-title { font-size: 1.25rem; font-weight: 700; margin-bottom: .4rem; }
.result-amounts { margin: 1.25rem 0 0; padding: .9rem 1rem; background: var(--accent-soft); border-radius: .75rem; text-align: left; }
.result-amounts > div { display: flex; justify-content: space-between; gap: 1rem; padding: .25rem 0; }
.result-amounts dt { font-weight: 500; color: var(--muted); }
.result-amounts dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.result-amounts .is-due { border-top: 1px solid var(--line); margin-top: .25rem; padding-top: .5rem; }
.result-amounts .is-due dt, .result-amounts .is-due dd { color: var(--ink); font-weight: 700; }
@keyframes dc-result-pop { from { transform: scale(0); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes dc-result-ring { to { box-shadow: 0 0 0 1rem rgba(20, 145, 95, 0); } }
@media (prefers-reduced-motion: reduce) {
  .result-modal.fade .modal-dialog { transform: none; transition: opacity .2s ease; }
  .result-modal.show .result-icon, .result-modal.show .result-icon-success { animation: none; }
}
.confirm-icon { width: 3.4rem; height: 3.4rem; border-radius: 50%; background: #fdecee; color: var(--danger-ink); display: inline-flex; align-items: center; justify-content: center; font-size: 1.4rem; }

/* ---- Tactile / responsive ------------------------------------------------------------------ */
@media (max-width: 991.98px) {
  .btn, .form-control, .form-select { min-height: 2.9rem; }
  .btn-ellipsis { width: 2.75rem; height: 2.75rem; }
  .hero-card { min-height: 10.5rem; }
}
@media (max-width: 575.98px) {
  .center-switch { margin-left: .75rem; padding-left: .75rem; font-size: .9rem; }
  .amount-due .amount { font-size: 1.6rem; }
  .cov-title { font-size: 1.15rem; }
}
@media print {
  .topbar, .app-footer, .no-print, .toaster-container { display: none !important; }
  body { background: #fff; }
}

/* ---- Navigation secondaire (Équipe) ------------------------------------------------------ */
.nav-underline { --bs-nav-underline-link-active-color: var(--brand); --bs-nav-underline-border-width: .18rem; }
.nav-underline .nav-link { font-weight: 600; color: var(--muted); }
.nav-underline .nav-link.active { border-bottom-color: var(--brand); }
.breadcrumb { --bs-breadcrumb-divider-color: #93a3b1; font-size: .82rem; margin-bottom: .35rem; }
.breadcrumb a { color: var(--muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--brand); }

/* ---- Ajustements de fidélité ------------------------------------------------------------ */
.form-check-input { border-color: #9fb1bf; }
.cov-meta { white-space: nowrap; font-size: .82rem; gap: .45rem; }
.cov-value { font-size: .88rem; }
@media (min-width: 992px) { .cov-col + .cov-col { padding-left: 1.15rem; } .cov-col:not(:last-child) { padding-right: 1rem; } }
.h1, .h2, .h3, .h4, .h5, .h6 { font-weight: 700; }
.form-control, .form-select, .input-group-text { background-color: #fff; }
.form-control:disabled { background-color: var(--surface-2); }
.form-switch { padding-left: 3em; }
.form-switch .form-check-input { width: 2.4em; margin-left: -3em; }
.perm-list .form-check { padding-left: 3em; }
.btn-cta { --bs-btn-padding-y: .65rem; --bs-btn-padding-x: 1.1rem; white-space: nowrap; }
.recap-row { gap: .75rem; }
.recap-row strong { white-space: nowrap; }
.person-card .email { overflow-wrap: anywhere; word-break: normal; }
.btn-cta { --bs-btn-padding-x: .8rem; --bs-btn-font-size: .85rem; }
.sticky-recap .btn-cta i { margin-right: .4rem !important; }

/* Pages d'erreur */
.error-shell { min-height: 100vh; }
.error-card { width: 100%; max-width: 32rem; }
.error-code { font-size: 5rem; font-weight: 800; line-height: 1; color: #105ea0; letter-spacing: -.04em; }

/* ---- Loader de page (partials.page-loader + js/page-loader.js) ---------------------------- */
.page-loader { display: none; }
html.dc-loading .page-loader {
  position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 2000;
  display: flex; align-items: center; justify-content: center; padding: 1rem;
  background: rgba(243, 248, 251, .94); cursor: progress; touch-action: none;
  opacity: 1; visibility: visible; transition: opacity .3s ease, visibility .3s ease;
}
html.dc-loading.dc-loaded .page-loader { opacity: 0; visibility: hidden; pointer-events: none; }
html.dc-loading:not(.dc-loaded), html.dc-loading:not(.dc-loaded) body { overflow: hidden; }
.page-loader-box {
  display: flex; flex-direction: column; align-items: center; gap: .9rem;
  min-width: 10rem; padding: 1.6rem 2rem; background: #fff; border: 1px solid var(--line);
  border-radius: var(--bs-border-radius-lg); box-shadow: 0 .75rem 2rem rgba(20, 41, 61, .08);
}
.page-loader-icon {
  width: 2.75rem; height: 2.75rem; border-radius: 50%;
  border: .25rem solid var(--accent-soft); border-top-color: var(--accent);
  animation: dc-spin .8s linear infinite;
}
.page-loader-text { font-weight: 600; color: var(--ink); text-align: center; }
@keyframes dc-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .page-loader-icon { animation-duration: 1.6s; } }

/* ---- Bouton de soumission en cours (digicare.js : DC.btnLoading) -------------------------- */
.btn.is-loading { cursor: progress; }
.btn.is-loading:disabled { opacity: .8; }
.btn.is-loading .spinner-border { width: 1em; height: 1em; border-width: .15em; vertical-align: -.125em; }
.btn.is-loading .spinner-border:not(:last-child) { margin-right: .5rem; }

/* ---- Modern Select (plugins/modern-select) : thème + gabarit des champs ------------------ */
.ms-theme-brand { --ms-color: var(--brand); --ms-color-hover: var(--brand-dark); --ms-color-soft: var(--brand-soft); --ms-color-soft-2: var(--brand-soft-2); --ms-color-ring: rgba(11, 122, 99, .15); }
.ms-wrapper .ms-control { min-height: 2.6rem; border-color: #d3dde5; border-radius: .5rem; font-size: var(--bs-body-font-size); color: var(--ink); }
.modal .ms-dropdown { z-index: 1060; }
