:root {
  --bg: oklch(98.26% 0.0095 299.24);
  --surface: oklch(100% 0 89.88);
  --fg: oklch(24.6% 0.0426 273.16);
  --muted: oklch(39.77% 0.0268 287.98);
  --border: oklch(82.86% 0.0265 293.06);
  --accent: oklch(48.35% 0.2165 274.69);
  --accent-2: oklch(56.79% 0.2113 276.71);
  --accent-soft: oklch(95.5% 0.028 276.71);
  --navy: #1a1f35;
  --red: #ba1a1a;
  --orange: #b45309;
  --yellow: #8a6d00;
  --green: #18794e;
  --font-display: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --font-mono: 'Space Grotesk', ui-monospace, 'JetBrains Mono', Menlo, monospace;
  --shadow: 0 24px 60px -32px rgba(26, 31, 53, 0.18);
}

* {
  box-sizing: border-box;
}

html {
  min-block-size: 100%;
  background: #faf8ff;
}

body {
  min-block-size: 100%;
  margin: 0;
  color: var(--fg);
  background: var(--bg);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.55;
  text-rendering: geometricPrecision;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select {
  font: inherit;
}

.sidebar {
  position: fixed;
  inset-block: 0;
  inset-inline-start: 0;
  z-index: 20;
  inline-size: 240px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px 16px;
  background: rgba(255, 255, 255, 0.86);
  border-inline-end: 0.5px solid rgba(26, 31, 53, 0.12);
  overflow-y: auto;
  scrollbar-width: thin;
}

.brand {
  display: grid;
  gap: 14px;
  padding-block-end: 18px;
  border-block-end: 0.5px solid rgba(26, 31, 53, 0.1);
}

.brand img {
  inline-size: 120px;
  block-size: auto;
  object-fit: contain;
}

.product-mark {
  display: grid;
  gap: 3px;
}

.product-mark strong {
  color: var(--navy);
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.product-mark span {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.nav {
  display: grid;
  gap: 6px;
}

.nav-item {
  display: grid;
  grid-template-columns: 28px 1fr;
  align-items: center;
  gap: 8px;
  min-block-size: 40px;
  padding: 9px 12px;
  color: var(--muted);
  border: 0.5px solid transparent;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.nav-item:hover {
  border-color: rgba(26, 31, 53, 0.12);
  background: rgba(255, 255, 255, 0.72);
}

.nav-item.active {
  color: var(--accent);
  background: var(--accent-soft);
  border-color: color-mix(in oklch, var(--accent) 34%, white);
}

.nav-item .number {
  font-variant-numeric: tabular-nums;
}

.sidebar-footer {
  margin-block-start: auto;
  padding: 14px 12px;
  color: var(--muted);
  border: 0.5px solid rgba(26, 31, 53, 0.1);
  border-radius: 12px;
  font-size: 12px;
}

.sidebar-footer b {
  display: block;
  color: var(--fg);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.main {
  margin-inline-start: 240px;
  padding: 14px 32px 36px;
}

.page {
  max-inline-size: 1220px;
  margin-inline: auto;
}

.page-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: start;
  margin-block-end: 10px;
}

.page-head--compact {
  grid-template-columns: 1fr;
  margin-block-end: 8px;
}

.eyebrow,
.label {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
  color: var(--navy);
  font-family: var(--font-display);
  line-height: 1.15;
  letter-spacing: -0.01em;
}

h1 {
  max-inline-size: 780px;
  margin-block-start: 0;
  font-size: clamp(24px, 2.4vw, 32px);
  font-weight: 400;
}

.page-subtitle {
  margin: 3px 0 0;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

h2 {
  font-size: 19px;
  font-weight: 600;
}

h3 {
  font-size: 17px;
  font-weight: 600;
}

.lede {
  max-inline-size: 760px;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 15px;
}

.head-meta {
  min-inline-size: 220px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.54);
  border: 0.5px solid rgba(26, 31, 53, 0.1);
  border-radius: 14px;
}

.head-meta span {
  display: block;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.head-meta strong {
  display: block;
  margin-block-start: 5px;
  color: var(--fg);
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 500;
}

.grid {
  display: grid;
  gap: 12px;
}

.grid > * {
  min-inline-size: 0;
}

.grid.kpis {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-block-end: 12px;
}

.grid.two {
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 0.65fr);
}

.grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.card {
  background: var(--surface);
  border: 0.5px solid rgba(26, 31, 53, 0.12);
  border-radius: 14px;
  box-shadow: var(--shadow);
}

.card-pad {
  padding: 16px 18px;
}

.card-head {
  display: flex;
  gap: 12px;
  align-items: start;
  justify-content: space-between;
  margin-block-end: 10px;
}

.index {
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.kpi {
  min-block-size: auto;
  padding: 14px 16px;
}

.kpi .value {
  margin-block-start: 12px;
  color: var(--navy);
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: 400;
  line-height: 1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.kpi .value.kpi-statement {
  margin-block-start: 0;
  font-size: clamp(16px, 1.55vw, 22px);
  line-height: 1.2;
  letter-spacing: 0;
}

.kpi p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12.5px;
}

.toolbar,
.filterbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-block-end: 16px;
}

.filterbar button,
.ghost-button,
.download {
  min-block-size: 34px;
  padding: 8px 13px;
  color: var(--fg);
  background: rgba(255, 255, 255, 0.64);
  border: 0.5px solid rgba(26, 31, 53, 0.14);
  border-radius: 999px;
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.filterbar button.active,
.ghost-button.primary {
  color: white;
  background: var(--accent);
  border-color: var(--accent);
}

.search {
  min-inline-size: min(100%, 320px);
  padding: 10px 13px;
  color: var(--fg);
  background: white;
  border: 0.5px solid rgba(26, 31, 53, 0.14);
  border-radius: 10px;
  outline: none;
}

.search:focus {
  border-color: var(--accent);
}

.table-wrap {
  overflow: auto;
  border: 0.5px solid rgba(26, 31, 53, 0.1);
  border-radius: 12px;
}

table {
  inline-size: 100%;
  min-inline-size: 760px;
  border-collapse: collapse;
  background: white;
}

th,
td {
  padding: 14px 16px;
  border-block-end: 0.5px solid rgba(26, 31, 53, 0.1);
  text-align: start;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

td {
  color: var(--fg);
  font-size: 14px;
}

tr:last-child td {
  border-block-end: 0;
}

.mono,
.date {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.muted {
  color: var(--muted);
}

.chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-block-size: 24px;
  padding: 4px 9px;
  border: 0.5px solid currentColor;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
}

.chip.red {
  color: var(--red);
  background: #fff1f0;
}

.chip.orange {
  color: var(--orange);
  background: #fff7ed;
}

.chip.blue {
  color: #2563eb;
  background: #eff6ff;
}

.chip.yellow {
  color: var(--yellow);
  background: #fffbea;
}

.chip.green {
  color: var(--green);
  background: #eefbf3;
}

.chip.purple {
  color: var(--accent);
  background: var(--accent-soft);
}

.chip.subtle {
  color: var(--muted);
  background: rgba(26, 31, 53, 0.04);
  border-color: rgba(26, 31, 53, 0.16);
}

.list {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.list li {
  display: grid;
  gap: 4px;
  padding: 14px 0;
  border-block-end: 0.5px solid rgba(26, 31, 53, 0.1);
}

.list li:last-child {
  border-block-end: 0;
}

.list strong {
  color: var(--navy);
}

.list-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.card-subtitle {
  max-inline-size: 280px;
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.dashboard-alerts .table-wrap {
  overflow-x: hidden;
}

.dashboard-alerts table {
  min-inline-size: 0;
  table-layout: fixed;
}

.dashboard-alerts th,
.dashboard-alerts td {
  padding: 11px 10px;
  font-size: 12px;
  line-height: 1.35;
}

.dashboard-alerts .col-priority { inline-size: 16%; }
.dashboard-alerts .col-date     { inline-size: 20%; }
.dashboard-alerts .col-service  { inline-size: 26%; }
.dashboard-alerts .col-owner    { inline-size: 22%; }
.dashboard-alerts .col-status   { inline-size: 16%; }

.line-note {
  display: block;
  margin-block-start: 3px;
  font-size: 11px;
}

.reserves-table-card {
  margin-block-start: 18px;
}

.reserves-table-card .table-wrap {
  overflow-x: hidden;
}

.client-table {
  min-inline-size: 0;
  table-layout: fixed;
}

.client-table th,
.client-table td {
  padding: 12px 10px;
  font-size: 12px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.client-table .col-num    { inline-size: 6%; }
.client-table .col-theme  { inline-size: 13%; }
.client-table .col-reserve { inline-size: 29%; }
.client-table .col-owner  { inline-size: 10%; }
.client-table .col-date   { inline-size: 9%; }
.client-table .col-status { inline-size: 9%; }
.client-table .col-source { inline-size: 14%; }
.client-table .col-proof  { inline-size: 10%; }

.table-sub {
  display: block;
  margin-block-start: 4px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
}

.table-source {
  display: block;
  margin-block-end: 4px;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  line-height: 1.25;
  text-transform: uppercase;
}

.doc-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-inline-size: 100%;
  min-block-size: 26px;
  padding: 5px 9px;
  color: var(--accent);
  background: var(--accent-soft);
  border: 0.5px solid color-mix(in oklch, var(--accent) 35%, white);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.2;
  text-align: center;
  text-transform: uppercase;
}

.doc-link:hover {
  color: white;
  background: var(--accent);
  border-color: var(--accent);
}

.timeline {
  position: relative;
  display: grid;
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.timeline li {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 14px;
  padding-block-end: 14px;
  border-block-end: 0.5px solid rgba(26, 31, 53, 0.1);
}

.timeline li > span {
  min-inline-size: 0;
  overflow-wrap: anywhere;
}

.timeline li:last-child {
  padding-block-end: 0;
  border-block-end: 0;
}

.directory {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.person-card,
.doc-card {
  display: grid;
  gap: 12px;
  padding: 18px;
  background: white;
  border: 0.5px solid rgba(26, 31, 53, 0.1);
  border-radius: 12px;
}

.person-top,
.doc-top {
  display: flex;
  gap: 12px;
  align-items: start;
  justify-content: space-between;
}

.interv-cell {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.interv-badge,
.avatar {
  --badge-top: #63a7ff;
  --badge-mid: #2563eb;
  --badge-bottom: #173b91;
  --badge-text: #ffffff;
  --badge-border: rgba(219, 234, 254, 0.86);
  --badge-glow: rgba(37, 99, 235, 0.28);
  --badge-text-shadow: 0 1px 2px rgba(7, 18, 48, 0.34);
  position: relative;
  isolation: isolate;
  display: inline-grid;
  place-items: center;
  inline-size: 34px;
  block-size: 34px;
  flex: 0 0 auto;
  overflow: hidden;
  color: var(--badge-text);
  background:
    radial-gradient(circle at 32% 16%, rgba(255, 255, 255, 0.9), transparent 22%),
    radial-gradient(circle at 72% 86%, rgba(255, 255, 255, 0.16), transparent 30%),
    linear-gradient(145deg, var(--badge-top), var(--badge-mid) 68%, var(--badge-bottom));
  border: 1px solid var(--badge-border);
  border-radius: 999px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.78),
    inset 0 -10px 16px rgba(12, 18, 34, 0.16),
    0 9px 20px var(--badge-glow),
    0 1px 2px rgba(26, 31, 53, 0.18);
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1;
  text-transform: uppercase;
  text-shadow: var(--badge-text-shadow);
  transform: translateZ(0);
  transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

.interv-badge::before,
.avatar::before {
  content: "";
  position: absolute;
  inset: 2px 4px auto;
  block-size: 38%;
  border-radius: 999px 999px 14px 14px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(255, 255, 255, 0));
  opacity: 0.78;
  pointer-events: none;
}

.interv-badge::after,
.avatar::after {
  content: "";
  position: absolute;
  inset: -55%;
  background: linear-gradient(105deg, transparent 42%, rgba(255, 255, 255, 0.62) 50%, transparent 58%);
  opacity: 0;
  transform: translateX(-62%) rotate(8deg);
  transition: transform 0.42s ease, opacity 0.22s ease;
  pointer-events: none;
}

.interv-badge:hover,
.avatar:hover {
  filter: saturate(1.08);
  transform: translateY(-1px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.76),
    inset 0 -10px 16px rgba(12, 18, 34, 0.16),
    0 12px 26px var(--badge-glow),
    0 2px 5px rgba(26, 31, 53, 0.18);
}

.interv-badge:hover::after,
.avatar:hover::after {
  opacity: 1;
  transform: translateX(62%) rotate(8deg);
}

.prestataire-badge {
  inline-size: 50px;
  block-size: 50px;
  font-size: 13.5px;
}

@media (prefers-reduced-motion: reduce) {
  .interv-badge,
  .avatar,
  .interv-badge::after,
  .avatar::after {
    transition: none;
  }
}

.doc-icon {
  display: grid;
  place-items: center;
  inline-size: 42px;
  block-size: 54px;
  color: var(--accent);
  background: var(--accent-soft);
  border: 0.5px solid color-mix(in oklch, var(--accent) 35%, white);
  border-radius: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
}

.notice {
  padding: 18px;
  color: var(--fg);
  background: var(--accent-soft);
  border: 0.5px solid color-mix(in oklch, var(--accent) 35%, white);
  border-radius: 14px;
}

.notice strong {
  display: block;
  margin-block-end: 6px;
  color: var(--accent);
  font-family: var(--font-display);
  font-size: 20px;
}

[hidden] {
  display: none !important;
}

@media (max-width: 1100px) {
  .grid.kpis,
  .grid.three,
  .grid.two,
  .directory {
    grid-template-columns: 1fr 1fr;
  }

  .page-head {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .sidebar {
    position: sticky;
    inset-block-start: 0;
    inline-size: 100%;
    block-size: auto;
    padding: 14px 16px;
    border-inline-end: 0;
    border-block-end: 0.5px solid rgba(26, 31, 53, 0.12);
  }

  .brand {
    grid-template-columns: 132px 1fr;
    align-items: center;
    padding-block-end: 10px;
  }

  .nav {
    grid-auto-flow: column;
    grid-auto-columns: max-content;
    overflow-x: auto;
    padding-block-end: 4px;
  }

  .nav-item {
    inline-size: max-content;
  }

  .sidebar-footer {
    display: none;
  }

  .main {
    margin-inline-start: 0;
    padding: 28px 24px 48px;
  }

  .grid.kpis,
  .grid.three,
  .grid.two,
  .directory {
    grid-template-columns: 1fr;
  }

  .dashboard-alerts .table-wrap {
    max-inline-size: 100%;
    border: 0;
    overflow: visible;
  }

  .dashboard-alerts table,
  .dashboard-alerts tbody,
  .dashboard-alerts tr,
  .dashboard-alerts td {
    display: block;
    inline-size: 100%;
    min-inline-size: 0;
    max-inline-size: 100%;
  }

  .dashboard-alerts thead,
  .dashboard-alerts colgroup {
    display: none;
  }

  .dashboard-alerts tr {
    margin-block-end: 10px;
    padding: 12px;
    background: white;
    border: 0.5px solid rgba(26, 31, 53, 0.1);
    border-radius: 10px;
  }

  .dashboard-alerts td {
    display: grid;
    grid-template-columns: minmax(82px, 100px) minmax(0, 1fr);
    gap: 10px;
    padding: 7px 0;
    border-block-end: 0;
    overflow-wrap: anywhere;
  }

  .dashboard-alerts .chip,
  .site-banner .chip,
  .card-head .chip {
    max-inline-size: 100%;
    white-space: normal;
    text-align: start;
  }

  .site-banner .chip {
    display: block;
    inline-size: 100%;
    text-align: center;
    overflow-wrap: anywhere;
  }

  .dashboard-alerts td::before {
    content: attr(data-label);
    color: var(--muted);
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }

  .reserves-table-card .table-wrap {
    border: 0;
    overflow: visible;
  }

  .client-table,
  .client-table tbody,
  .client-table tr,
  .client-table td {
    display: block;
    inline-size: 100%;
    min-inline-size: 0;
    max-inline-size: 100%;
  }

  .client-table thead,
  .client-table colgroup {
    display: none;
  }

  .client-table tr {
    margin-block-end: 10px;
    padding: 12px;
    background: white;
    border: 0.5px solid rgba(26, 31, 53, 0.1);
    border-radius: 10px;
  }

  .client-table td {
    display: grid;
    grid-template-columns: minmax(82px, 100px) minmax(0, 1fr);
    gap: 10px;
    padding: 7px 0;
    border-block-end: 0;
  }

  .client-table td::before {
    content: attr(data-label);
    color: var(--muted);
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }
}

/* ── KPI favorable ─────────────────────────────────────────── */
.kpi-favorable {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: linear-gradient(135deg, #00a844 0%, #007d32 55%, #00b894 100%) !important;
  border-color: transparent !important;
  box-shadow: 0 0 0 1px rgba(0,168,68,0.35), 0 8px 32px -4px rgba(0,125,50,0.6), 0 0 48px -8px rgba(0,168,68,0.35) !important;
}

/* ── Sidebar partner (CS logo) ─────────────────────────────── */
.sidebar-partner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: #edf2fe;
  border: 1px solid rgba(67, 67, 213, 0.22);
  border-radius: 12px;
}

.sidebar-partner img {
  inline-size: 36px;
  block-size: 36px;
  object-fit: contain;
  flex-shrink: 0;
}

.sidebar-partner span {
  color: #1e293b;
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  line-height: 1.25;
}

/* ── Site banner ───────────────────────────────────────────── */
.site-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-block-end: 8px;
  padding: 7px 14px;
  background: rgba(255, 255, 255, 0.7);
  border: 0.5px solid rgba(26, 31, 53, 0.1);
  border-radius: 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.banner-date {
  margin-inline-start: auto;
  color: var(--muted);
  font-size: 11px;
}

/* ── Commission hero ───────────────────────────────────────── */
.hero-commission {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 32px;
  margin-block-end: 18px;
  background: linear-gradient(135deg, var(--accent-soft) 0%, rgba(255,255,255,0.9) 100%);
  border: 0.5px solid color-mix(in oklch, var(--accent) 30%, white);
}

.hero-commission p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.favorable-badge {
  display: grid;
  place-items: center;
  min-inline-size: 96px;
  padding: 14px 18px;
  background: var(--green);
  color: white;
  border-radius: 14px;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-align: center;
  line-height: 1.3;
  flex-shrink: 0;
  animation: badge-in 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes badge-in {
  from { opacity: 0; transform: scale(0.8); }
  to   { opacity: 1; transform: scale(1); }
}

/* ── Action grid (commission) ──────────────────────────────── */
.action-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.action-card {
  display: grid;
  gap: 6px;
  padding: 16px;
  background: var(--accent-soft);
  border: 0.5px solid color-mix(in oklch, var(--accent) 25%, white);
  border-radius: 10px;
}

.action-card strong {
  color: var(--navy);
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
}

.action-card span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

/* ── Analytics grid ────────────────────────────────────────── */
.grid.analytics {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-block-end: 10px;
}

/* ── Progress bar (réserves) ───────────────────────────────── */
.progress-track {
  block-size: 10px;
  background: rgba(26, 31, 53, 0.08);
  border-radius: 999px;
  overflow: hidden;
  margin-block: 16px 20px;
}

.progress-fill {
  block-size: 100%;
  inline-size: var(--value, 0%);
  background: var(--accent);
  border-radius: 999px;
  transition: inline-size 0.6s ease;
}

.stat-strip {
  display: flex;
  gap: 16px;
}

.mini-stat {
  display: grid;
  gap: 2px;
  text-align: center;
}

.mini-stat strong {
  color: var(--navy);
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 500;
  line-height: 1;
}

.mini-stat span {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* ── Bar chart ─────────────────────────────────────────────── */
.bar-chart {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  block-size: 130px;
  padding-block-start: 12px;
}

.bar-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex: 1;
}

.bar-item .bar {
  inline-size: 100%;
  block-size: var(--h, 40px);
  background: var(--accent);
  border-radius: 4px 4px 0 0;
  opacity: 0.7;
}

.bar-item .bar.green {
  background: var(--green);
}

.bar-item span {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
}

.bar-item strong {
  color: var(--navy);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
}

/* ── Donut chart ───────────────────────────────────────────── */
.chart-layout {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}

.donut {
  inline-size: 120px;
  block-size: 120px;
  flex-shrink: 0;
  transform: rotate(-90deg);
}

.donut-track {
  fill: none;
  stroke: rgba(26, 31, 53, 0.08);
  stroke-width: 18;
}

.donut-segment {
  fill: none;
  stroke-width: 18;
  stroke-linecap: butt;
}

.legend {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 13px;
  color: var(--fg);
}

.legend li {
  display: flex;
  align-items: center;
  gap: 8px;
}

.dot {
  display: inline-block;
  inline-size: 10px;
  block-size: 10px;
  border-radius: 999px;
  flex-shrink: 0;
}

.dot.green  { background: var(--green); }
.dot.orange { background: var(--orange); }
.dot.red    { background: var(--red); }
.dot.yellow { background: var(--yellow); }

/* ── Timeline rail (échéances) ─────────────────────────────── */
.timeline-rail {
  display: flex;
  gap: 0;
  overflow-x: auto;
  padding-block: 8px 4px;
}

.milestone {
  display: grid;
  gap: 4px;
  min-inline-size: 140px;
  padding: 14px 16px;
  border-inline-end: 0.5px solid rgba(26, 31, 53, 0.1);
  font-size: 13px;
}

.milestone:last-child {
  border-inline-end: 0;
}

.milestone strong {
  color: var(--navy);
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
}

.milestone span {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11px;
}

.milestone.red    { border-block-start: 3px solid var(--red); }
.milestone.orange { border-block-start: 3px solid var(--orange); }
.milestone.yellow { border-block-start: 3px solid var(--yellow); }
.milestone.green  { border-block-start: 3px solid var(--green); }

/* ── Responsive additions ──────────────────────────────────── */
@media (max-width: 1100px) {
  .grid.analytics,
  .action-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .hero-commission {
    flex-direction: column;
    align-items: flex-start;
  }
  .chart-layout {
    flex-direction: column;
  }
  .grid.analytics {
    grid-template-columns: 1fr;
  }

  .card-head {
    flex-wrap: wrap;
  }

  .site-banner {
    display: grid;
    align-items: start;
  }

  .site-banner > * {
    min-inline-size: 0;
    overflow-wrap: anywhere;
  }

  .banner-date {
    margin-inline-start: 0;
  }
}

/* ═══════════════════════════════════════════════════════════
   MOBILE REDESIGN — 768px
   Remplace le nav horizontal par un drawer hamburger
   ═══════════════════════════════════════════════════════════ */

/* Hamburger drawer — toujours en fixed, caché par défaut */
.mobile-bar    { display: none; }
/* L'indicateur n'a de style qu'en mobile : sans cette règle, son texte s'affichait en haut à gauche sur ordinateur. */
.mobile-ptr-indicator { display: none; }
.mobile-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 20, 50, 0.52);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 35;
  cursor: pointer;
  animation: overlay-in 0.28s ease both;
}
body.nav-open .mobile-overlay { display: block; }

@keyframes overlay-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* DÉPASSÉ — poids visuel rouge discret */
.chip.red {
  box-shadow: 0 0 0 2px rgba(186, 26, 26, 0.15);
  font-weight: 800;
}

@media (max-width: 768px) {

  /* ── Body offset pour la barre fixe ── */
  html,
  body {
    overscroll-behavior-y: auto;
  }

  body {
    padding-block-start: 60px;
  }

  /* ── Indicateur tactile Pull-to-Refresh ── */
  .mobile-ptr-indicator {
    position: fixed;
    inset-block-start: 68px;
    inset-inline-start: 50%;
    z-index: 29;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 14px;
    border-radius: 999px;
    background: rgba(26, 31, 53, 0.92);
    color: #ffffff;
    font-family: var(--font-sans);
    font-size: 12px;
    font-weight: 600;
    box-shadow: 0 8px 24px rgba(26, 31, 53, 0.25);
    pointer-events: none;
    opacity: 0;
    transform: translate(-50%, -16px);
    transition: opacity 0.18s ease, transform 0.18s ease;
  }

  .mobile-ptr-indicator.is-ready {
    background: var(--accent, #b0271f);
  }

  .mobile-ptr-indicator.is-visible,
  .mobile-ptr-indicator.is-ready {
    opacity: 1;
  }

  .mobile-ptr-spinner {
    width: 13px;
    height: 13px;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #ffffff;
    border-radius: 50%;
  }

  .mobile-ptr-indicator.is-ready .mobile-ptr-spinner,
  .mobile-ptr-indicator.is-refreshing .mobile-ptr-spinner {
    animation: document-spin 0.7s linear infinite;
  }

  /* ── Barre mobile top (frosted glass) ── */
  .mobile-bar {
    display: flex;
    position: fixed;
    inset-block-start: 0;
    inset-inline: 0;
    z-index: 30;
    block-size: 60px;
    padding-inline: 14px;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(24px) saturate(160%);
    -webkit-backdrop-filter: blur(24px) saturate(160%);
    border-block-end: 0.5px solid rgba(26, 31, 53, 0.1);
    box-shadow: 0 1px 16px -2px rgba(26, 31, 53, 0.1);
  }

  .mobile-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }

  .mobile-brand:active {
    opacity: 0.75;
  }

  .mobile-brand img {
    block-size: 36px;
    inline-size: auto;
    object-fit: contain;
  }

  .mobile-brand span {
    color: var(--navy);
    font-family: var(--font-display);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: -0.01em;
  }

  /* ── Bouton hamburger → X ── */
  .hamburger {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5.5px;
    inline-size: 40px;
    block-size: 40px;
    padding: 10px;
    background: rgba(26, 31, 53, 0.05);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }

  .hamburger span {
    display: block;
    block-size: 2px;
    background: var(--navy);
    border-radius: 2px;
    transform-origin: center;
    transition: transform 0.34s cubic-bezier(0.34, 1.56, 0.64, 1),
                opacity   0.22s ease,
                width     0.22s ease;
  }

  body.nav-open .hamburger span:nth-child(1) { transform: translateY(7.5px) rotate(45deg); }
  body.nav-open .hamburger span:nth-child(2) { opacity: 0; transform: scaleX(0); }
  body.nav-open .hamburger span:nth-child(3) { transform: translateY(-7.5px) rotate(-45deg); }

  /* Brand : logo au-dessus, texte en dessous */
  .sidebar .brand {
    grid-template-columns: 1fr !important;
    gap: 6px;
  }
  .sidebar .brand img {
    inline-size: 40px !important;
    block-size: auto;
  }
  .sidebar .product-mark {
    width: 100%;
  }
  .sidebar .product-mark strong,
  .sidebar .product-mark span {
    display: block;
    white-space: normal;
    word-break: break-word;
  }

  /* ── Sidebar = drawer depuis la gauche ── */
  /* Annule les règles du breakpoint 900px */
  .sidebar {
    position: fixed !important;
    inset-block: 0 !important;
    inset-inline-start: 0 !important;
    inline-size: 272px !important;
    block-size: 100% !important;
    z-index: 40;
    overflow-y: auto;
    padding: 24px 16px !important;
    background: rgba(255, 255, 255, 0.98) !important;
    border-inline-end: 0.5px solid rgba(26, 31, 53, 0.12) !important;
    border-block-end: none !important;
    transform: translateX(-100%);
    transition: transform 0.38s cubic-bezier(0.34, 1.15, 0.64, 1),
                box-shadow 0.38s ease;
    gap: 20px !important;
  }

  body.nav-open .sidebar {
    transform: translateX(0);
    box-shadow: 20px 0 60px -8px rgba(26, 31, 53, 0.25);
  }

  /* Nav vertical dans le drawer */
  .nav {
    grid-auto-flow: unset !important;
    grid-auto-columns: unset !important;
    overflow-x: unset !important;
    grid-template-columns: 1fr !important;
  }

  .nav-item {
    inline-size: auto !important;
    min-block-size: 46px;
    font-size: 13px;
  }

  .nav-item.active {
    border-inline-start: 3px solid var(--accent);
    padding-inline-start: 10px;
  }

  .sidebar-footer { display: block !important; }

  /* ── Main content ── */
  .main {
    margin-inline-start: 0 !important;
    padding: 18px 14px 64px !important;
  }

  /* ── Page head ── */
  .page-head {
    grid-template-columns: 1fr;
    margin-block-end: 18px;
  }

  .head-meta { display: none; }

  h1 {
    font-size: clamp(24px, 6.5vw, 32px);
    margin-block-start: 6px;
  }

  h2 { font-size: 18px; }

  .lede {
    font-size: 14px;
    margin-block-start: 8px;
  }

  .eyebrow, .label {
    font-size: 11.5px;
  }

  th  { font-size: 11.5px; }
  td  { font-size: 13px; }

  .chip { font-size: 10.5px; }

  /* ── KPI 2×2 (pas 4 en colonne) ── */
  .grid.kpis {
    grid-template-columns: 1fr 1fr !important;
    gap: 10px;
    margin-block-end: 12px;
  }

  .kpi {
    min-block-size: 110px;
    padding: 16px 14px;
    border-radius: 14px;
    position: relative;
    overflow: hidden;
  }

  /* Barre couleur en haut de chaque KPI */
  .kpi::after {
    content: '';
    position: absolute;
    inset-block-start: 0;
    inset-inline: 0;
    block-size: 3px;
    background: linear-gradient(90deg, var(--accent) 0%, color-mix(in oklch, var(--accent) 55%, white) 100%);
    border-radius: 14px 14px 0 0;
  }

  .kpi-favorable::after { background: linear-gradient(90deg, #00c853, #1de9b6); }

  .kpi .value {
    font-size: 34px;
    margin-block-start: 10px;
  }

  .kpi .value.kpi-statement {
    font-size: clamp(14px, 3.5vw, 18px);
    margin-block-start: 8px;
  }

  .kpi p {
    font-size: 12px;
    margin-block-start: 6px;
  }

  /* ── Grilles ── */
  .grid.two,
  .grid.three,
  .grid.analytics,
  .directory {
    grid-template-columns: 1fr !important;
    gap: 12px;
  }

  /* ── Cartes — animation d'entrée staggerée ── */
  @keyframes mobile-card-in {
    from { opacity: 0; transform: translateY(18px); }
    to   { opacity: 1; transform: translateY(0); }
  }

  .card {
    border-radius: 16px;
    box-shadow: 0 3px 20px -6px rgba(26, 31, 53, 0.14);
    animation: mobile-card-in 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
  }

  .grid > .card:nth-child(1) { animation-delay: 0.04s; }
  .grid > .card:nth-child(2) { animation-delay: 0.09s; }
  .grid > .card:nth-child(3) { animation-delay: 0.14s; }
  .grid > .card:nth-child(4) { animation-delay: 0.18s; }
  .grid > .card:nth-child(5) { animation-delay: 0.22s; }

  /* ── Banner site ── */
  .site-banner {
    flex-direction: column;
    gap: 7px;
    padding: 10px 12px;
    border-radius: 12px;
    margin-block-end: 16px;
    font-size: 11px;
  }

  /* ── Padding cartes ── */
  .card-pad { padding: 18px 16px; }

  /* ── Card-head ── */
  .card-head { margin-block-end: 14px; gap: 10px; }

  /* ── Timeline ── */
  .timeline li { grid-template-columns: 72px 1fr; gap: 10px; }

  /* ── Annuaire prestataires ── */
  .directory { grid-template-columns: 1fr !important; }

  /* ── Commission hero ── */
  .hero-commission { flex-direction: column; padding: 22px 18px; }

  /* ── Action grid ── */
  .action-grid { grid-template-columns: 1fr; }

  /* ── Donut chart ── */
  .chart-layout { flex-direction: column; align-items: flex-start; }

  /* ── Progress panel ── */
  .progress-panel .stat-strip { flex-wrap: wrap; gap: 12px; }

  /* ── Filtres ── */
  .filterbar { gap: 7px; }
  .filterbar button { font-size: 10.5px; padding: 7px 11px; }

  /* ── Formulaire de recherche ── */
  .search { min-inline-size: 100%; }
}

/* ── KPI link ───────────────────────────────────────────────── */
.kpi-link {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--accent);
  text-decoration: none;
  margin-block-start: auto;
  padding-block-start: 10px;
  opacity: 0.8;
  transition: opacity 0.15s ease;
}
.kpi-link:hover { opacity: 1; text-decoration: underline; }

/* ── Animated donut chart (côte à côte compact) ─────────── */
.addonut-wrap {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 18px;
  padding-block: 2px 0;
}

.addonut-svg-area {
  position: relative;
  width: 148px;
  height: 148px;
  flex-shrink: 0;
}

.addonut-svg {
  width: 148px;
  height: 148px;
  transform: rotate(-90deg);
  overflow: visible;
}

.addonut-track {
  fill: transparent;
  stroke: rgba(26, 31, 53, 0.07);
  stroke-width: 18;
}

.addonut-seg {
  fill: transparent;
  stroke-width: 18;
  stroke-linecap: round;
  cursor: pointer;
  transition: opacity 0.2s ease, filter 0.2s ease;
}

.addonut-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  gap: 1px;
}

.addonut-center span {
  font-size: 9px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.addonut-center strong {
  font-size: 27px;
  font-weight: 700;
  font-family: var(--font-display);
  color: var(--navy);
  line-height: 1;
}

.addonut-center em {
  font-style: normal;
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
  min-height: 14px;
}

.addonut-legend {
  list-style: none;
  padding: 0;
  margin: 0;
  flex: 1;
  min-width: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.addonut-legend-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s ease;
  animation: legend-slide-in 0.4s ease backwards;
}

@keyframes legend-slide-in {
  from { opacity: 0; transform: translateX(-10px); }
  to   { opacity: 1; transform: translateX(0); }
}

.addonut-legend-item:hover { background: rgba(26, 31, 53, 0.05); }

.addonut-legend-left {
  display: flex;
  align-items: center;
  gap: 8px;
}
.addonut-legend-left > span { font-size: 12.5px; font-weight: 500; color: var(--navy); }

.addonut-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}

.addonut-legend-item > strong {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
  font-family: var(--font-mono);
}

/* ── Donut clickable ─────────────────────────────────────── */
.addonut-clickable {
  cursor: pointer;
}
.addonut-clickable:hover .addonut-svg-area {
  filter: drop-shadow(0 4px 16px rgba(26,31,53,0.12));
  transition: filter 0.2s ease;
}

/* ── KPI barchart card (span 2 dans la grille 4 colonnes) ── */
.kpi-chart-card {
  grid-column: span 2;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.kpi-chart-hd {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.kpi-chart-title {
  display: block;
  margin-block-start: 2px;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  color: var(--navy);
  line-height: 1.1;
}

.kpi-bar-row {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  flex: 1;
  min-block-size: 64px;
}

.kpi-bar-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  flex: 1;
  opacity: 0;
  animation: kpi-col-in 0.35s ease forwards;
}

@keyframes kpi-col-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.kpi-bar-value {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  color: var(--navy);
  min-height: 13px;
}

.kpi-bar-track {
  width: 100%;
  height: 46px;
  display: flex;
  align-items: flex-end;
}

.kpi-bar-fill {
  width: 100%;
  height: var(--pct, 3%);
  background: var(--accent);
  border-radius: 4px 4px 2px 2px;
  transform-origin: center bottom;
  animation: bar-grow-kpi 0.65s cubic-bezier(0.34, 1.4, 0.64, 1) backwards;
  transition: opacity 0.2s ease;
}

.kpi-bar-fill:hover { opacity: 0.75; }

.kpi-bar-zero {
  background: rgba(26, 31, 53, 0.1);
  border-radius: 3px;
}

@keyframes bar-grow-kpi {
  from { transform: scaleY(0); }
  to   { transform: scaleY(1); }
}

.kpi-bar-label {
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.03em;
}

/* ── Conformité card ─────────────────────────────────────── */
.conformite-display {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-block-start: 0;
}

.conformite-pct {
  font-family: var(--font-display);
  font-size: 38px;
  font-weight: 800;
  color: var(--navy);
  line-height: 1;
  letter-spacing: -0.03em;
}

.conformite-bar-wrap {
  height: 8px;
  background: rgba(26, 31, 53, 0.08);
  border-radius: 8px;
  overflow: hidden;
}

.conformite-bar {
  height: 100%;
  width: var(--pct, 0%);
  background: var(--green);
  border-radius: 8px;
  transition: width 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.conformite-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* ── Sante globale — barre épaisse + sous-scores ────────── */
.sante-bar-wrap {
  height: 11px !important;
  border-radius: 8px !important;
  margin-block: 2px 6px !important;
}

.sante-sub-scores {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: rgba(26, 31, 53, 0.03);
  border: 0.5px solid rgba(26, 31, 53, 0.08);
  border-radius: 10px;
}

.sante-sub-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sante-sub-item:last-child {
  text-align: right;
}

.sante-sub-label {
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.sante-sub-val {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--navy);
  line-height: 1;
}

.sante-sub-divider {
  width: 1px;
  height: 26px;
  background: rgba(26, 31, 53, 0.12);
  flex-shrink: 0;
}

/* ── Réserves panel — texte compact ─────────────────────── */
#reserves-panel-list li { padding: 10px 0; gap: 3px; }
#reserves-panel-list .list-title { font-size: 13px; font-weight: 600; }
#reserves-panel-list .muted { font-size: 12px; line-height: 1.4; }

/* ── Brand logo cliquable ────────────────────────────────── */
.brand { cursor: pointer; }
.brand:hover .product-mark strong { color: var(--accent); transition: color 0.15s ease; }

/* ── Reserves mini (dans carte conformité) ───────────────── */
.reserves-mini {
  margin-block-start: 14px;
  padding-block-start: 14px;
  border-block-start: 0.5px solid rgba(26, 31, 53, 0.1);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.reserves-mini-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.reserves-mini-pct-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.reserves-mini-pct {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 800;
  color: var(--navy);
  line-height: 1;
  letter-spacing: -0.03em;
}

.reserves-mini-suffix {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.reserves-mini-bar {
  height: 100%;
  width: var(--pct, 0%);
  background: var(--green);
  border-radius: 8px;
  transition: width 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Jauge semi-circulaire réserves ──────────────────────── */
.reserves-kpi {
  display: flex;
  flex-direction: column;
  padding: 14px 16px 12px;
}

.reserves-kpi-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-block-end: 2px;
}

.res-gauge-wrap {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  flex: 1;
  padding-block-end: 14px;
}

.res-gauge-svg {
  width: 100%;
  max-width: 116px;
  overflow: visible;
}

.res-gauge-track {
  fill: none;
  stroke: rgba(26, 31, 53, 0.07);
  stroke-width: 18;
  stroke-linecap: round;
}

.res-gauge-fill {
  fill: none;
  stroke: var(--green);
  stroke-width: 18;
  stroke-linecap: round;
  stroke-dasharray: 0 220;
  transition: stroke-dasharray 1s cubic-bezier(0.4, 0, 0.2, 1);
}

.res-gauge-label {
  position: absolute;
  bottom: -2px;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  pointer-events: none;
  white-space: nowrap;
}

.res-gauge-label strong {
  display: block;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  color: var(--navy);
  line-height: 1;
}

.res-gauge-label span {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.res-kpi-stats {
  display: flex;
  justify-content: space-between;
  margin-block: 0;
}

.res-stat {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.res-stat--green { text-align: right; }

.res-stat strong {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  color: var(--red);
  line-height: 1;
}

.res-stat--green strong { color: var(--green); }

.res-stat span {
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* ── Mobile overrides pour nouveaux composants ───────────── */
@media (max-width: 768px) {
  .kpi-chart-card { grid-column: span 2; min-block-size: auto; }
  .kpi-bar-row    { min-block-size: 62px; }
  .kpi-bar-track  { height: 48px; }
  .conformite-pct { font-size: 36px; }
}

@media (max-width: 480px) {
  .addonut-wrap { gap: 12px; }
  .addonut-svg-area, .addonut-svg { width: 128px; height: 128px; }
  .addonut-center strong { font-size: 23px; }
  .kpi-bar-label { font-size: 9px; }
  .kpi-bar-value { font-size: 10px; }
}


/* ── Document link icon (trombone) ───────────────────────── */
a.doc-link-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  text-decoration: none;
  padding: 2px;
  border-radius: 4px;
  transition: color .15s, background .15s;
}
a.doc-link-icon:hover {
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}
.icon-clip { display: block; flex-shrink: 0; }

/* ── Dashboard mobile : rappels réglementaires compacts ───── */
@media (max-width: 900px) {
  .dashboard-alerts .table-wrap {
    border: 0;
    overflow: visible;
  }

  .dashboard-alerts tbody {
    display: grid;
    gap: 8px;
  }

  .dashboard-alerts tr {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, max-content) auto minmax(0, 1fr);
    grid-template-areas:
      "date status ."
      "service service service"
      "owner owner owner";
    gap: 5px 10px;
    margin-block-end: 0;
    padding: 10px 12px;
    align-items: center;
    background: white;
    border: 0.5px solid rgba(26, 31, 53, 0.1);
    border-radius: 10px;
  }

  .dashboard-alerts td {
    display: block;
    inline-size: auto;
    min-inline-size: 0;
    max-inline-size: 100%;
    padding: 0;
    border-block-end: 0;
    overflow-wrap: normal;
  }

  .dashboard-alerts td[colspan] {
    grid-column: 1 / -1;
    text-align: center;
   }

  .dashboard-alerts td::before {
    content: none;
  }

  .dashboard-alerts .alert-date {
    grid-area: date;
    display: inline-flex;
    flex-wrap: wrap;
    gap: 4px 7px;
    align-items: baseline;
    color: var(--muted);
    font-size: 11px;
  }

  .dashboard-alerts .alert-date .date {
    color: var(--navy);
    font-size: 11.5px;
    font-weight: 700;
  }

  .dashboard-alerts .line-note {
    display: inline;
    margin-block-start: 0;
    font-size: 10.5px;
  }

  .dashboard-alerts .alert-service {
    grid-area: service;
    color: var(--fg);
    font-size: 13px;
    font-weight: 700;
    line-height: 1.25;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .dashboard-alerts .alert-owner {
    grid-area: owner;
  }

  .dashboard-alerts .alert-status {
    grid-area: status;
    justify-self: start;
  }

  .dashboard-alerts .alert-status .chip {
    min-block-size: 22px;
    padding: 3px 7px;
    font-size: 9.5px;
    white-space: nowrap;
  }

  .dashboard-alerts .alert-owner-inline {
    display: inline-flex;
    max-inline-size: 100%;
    min-inline-size: 0;
    gap: 7px;
    vertical-align: middle;
  }

  .dashboard-alerts .alert-owner-inline .interv-badge {
    inline-size: 30px;
    block-size: 30px;
    font-size: 9.5px;
  }

  .dashboard-alerts .alert-owner-name {
    min-inline-size: 0;
    overflow: hidden;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .dashboard-alerts .alert-owner-empty {
    color: var(--muted);
    font-size: 11px;
    font-style: italic;
  }
}

@media (max-width: 768px) {
  .dashboard-alerts.card-pad {
    padding: 14px 12px 12px;
  }

  .dashboard-alerts .card-head {
    margin-block-end: 10px;
  }
}

/* ── Édition PDF du registre (bouton de la barre latérale) ───── */
.sidebar-export {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  color: #fff;
  background: #B0271F;
  border-radius: 12px;
  text-decoration: none;
  box-shadow: 0 6px 18px -8px rgba(176, 39, 31, 0.7);
  transition: background 0.15s ease, transform 0.15s ease;
}
.sidebar-export:hover { background: #95201A; transform: translateY(-1px); }
.sidebar-export svg { flex-shrink: 0; }
.sidebar-export span { display: grid; line-height: 1.25; }
.sidebar-export b { font-size: 13px; font-weight: 700; }
.sidebar-export small { font-size: 10.5px; opacity: 0.85; }

/* ── Volet latéral compact (écrans d'ordinateur) ─────────────
   Le volet dépassait 830 px de haut : sur un portable à 100 %, le bas et le
   bouton PDF sortaient de l'écran. Tout est resserré, et le bloc du bas
   (bouton PDF, Nexum) reste collé en bas du volet, même quand il défile. */
@media (min-width: 901px) {
  .sidebar { gap: 10px; padding: 14px 14px 0; }
  .brand { gap: 8px; padding-block-end: 12px; }
  .brand img { inline-size: 92px; }
  .product-mark strong { font-size: 15px; }
  .nav { gap: 3px; }
  .nav-item { min-block-size: 34px; padding: 6px 12px; }
  .sidebar-bottom {
    position: sticky;
    inset-block-end: 0;
    margin-block-start: auto;
    display: grid;
    gap: 8px;
    padding: 10px 0 14px;
    background: linear-gradient(to bottom, rgba(255,255,255,0), #fff 14px);
  }
  .sidebar-bottom .sidebar-footer { margin: 0; padding: 8px 12px; font-size: 11px; }
  .sidebar-bottom .sidebar-partner { padding: 8px 12px; }
  .sidebar-bottom .sidebar-partner img { inline-size: 30px; block-size: 30px; }
}
@media (min-width: 901px) and (max-height: 700px) {
  .brand img { inline-size: 72px; }
  .product-mark span { display: none; }
  .nav-item { min-block-size: 31px; padding-block: 4px; }
  .sidebar-bottom .sidebar-footer { display: none; }
}
@media (max-width: 900px) {
  .sidebar-bottom { display: grid; gap: 10px; }
}

/* ── Tableau de bord : bandeau « À traiter » ───────────────────
   Compact et visible : total, une pastille par entreprise, prochaine date limite.
   Le détail reste replié sous le bandeau. */
.todo-banner {
  --todo-bg: linear-gradient(118deg, #b45309 0%, #92400e 100%);
  margin-block-end: 12px;
  color: #fff;
  background: var(--todo-bg);
  border-radius: 14px;
  box-shadow: 0 14px 34px -18px rgba(146, 64, 14, 0.75);
  overflow: hidden;
}
.todo-banner.is-urgent {
  --todo-bg: linear-gradient(118deg, #c0261c 0%, #8e1b14 100%);
  box-shadow: 0 14px 34px -18px rgba(142, 27, 20, 0.8);
}
.todo-banner.is-clear {
  --todo-bg: linear-gradient(118deg, #1f8a5a 0%, #166c46 100%);
  box-shadow: 0 14px 34px -18px rgba(22, 108, 70, 0.7);
}
.todo-banner.is-loading { opacity: 0.55; }
.todo-banner-main {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  padding: 12px 18px;
  background: var(--todo-bg);
}
.todo-total { display: flex; align-items: center; gap: 12px; }
.todo-icon {
  position: relative;
  display: grid;
  place-items: center;
  inline-size: 36px;
  block-size: 36px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #fff;
  color: #b42318;
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 800;
}
.todo-banner.is-clear .todo-icon { color: #166c46; font-size: 0; }
.todo-banner.is-clear .todo-icon::before { content: '✓'; font-size: 18px; }
.todo-banner.is-urgent .todo-icon::after {
  content: '';
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.7);
  animation: todo-pulse 1.8s ease-out infinite;
}
@keyframes todo-pulse {
  from { transform: scale(0.85); opacity: 1; }
  to   { transform: scale(1.35); opacity: 0; }
}
.todo-total-text { display: grid; line-height: 1.1; }
.todo-total-text strong { font-family: var(--font-mono); font-size: 28px; font-weight: 800; letter-spacing: -0.02em; }
.todo-total-label { font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.todo-total-sub { margin-top: 2px; font-size: 11.5px; opacity: 0.88; }
.todo-side { display: grid; gap: 6px; min-width: 0; }
.todo-companies { display: flex; flex-wrap: wrap; gap: 6px; }
.todo-company {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 6px 5px 11px;
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background 0.15s ease;
}
.todo-company:hover { background: rgba(255, 255, 255, 0.26); }
.todo-company.is-active { background: #fff; color: #8e1b14; }
.todo-company-count {
  display: inline-grid;
  place-items: center;
  min-inline-size: 20px;
  block-size: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: #fff;
  color: #8e1b14;
  font-size: 11px;
  font-weight: 800;
}
.todo-company.is-active .todo-company-count { background: #8e1b14; color: #fff; }
.todo-next { font-size: 12.5px; opacity: 0.95; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.todo-next-label { font-size: 10.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; opacity: 0.8; }
.todo-toggle {
  padding: 9px 16px;
  border: 0;
  border-radius: 999px;
  background: #fff;
  color: #8e1b14;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: 0 6px 16px -10px rgba(0, 0, 0, 0.5);
}
.todo-toggle:hover { background: #fff5f4; }
.todo-panel { padding: 6px 16px 12px; background: #fff; color: var(--fg); }
.todo-filter { display: flex; align-items: center; gap: 10px; padding: 10px 6px 4px; font-size: 13px; color: var(--muted); }
.todo-clear { padding: 3px 10px; border: 0.5px solid rgba(26, 31, 53, 0.2); border-radius: 999px; background: #fff; font-size: 12px; font-weight: 600; cursor: pointer; }
.todo-list { list-style: none; margin: 0; padding: 0; }
.todo-item { border-bottom: 0.5px solid rgba(26, 31, 53, 0.1); }
.todo-item:last-child { border-bottom: 0; }
.todo-link {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr) 150px 16px;
  align-items: center;
  gap: 14px;
  padding: 10px 6px;
  color: inherit;
  text-decoration: none;
  border-radius: 8px;
  transition: background 0.15s ease;
}
.todo-link:hover { background: rgba(26, 31, 53, 0.035); }
.todo-type { justify-self: start; font-size: 10px; white-space: nowrap; }
.todo-main { display: grid; gap: 2px; min-width: 0; }
.todo-title { font-size: 14px; font-weight: 600; color: var(--fg); overflow-wrap: anywhere; }
.todo-detail { font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.todo-owner { min-width: 0; font-size: 12px; }
.todo-when { font-family: var(--font-mono); font-size: 12px; font-weight: 600; color: var(--muted); text-align: end; white-space: nowrap; }
.todo-when.is-late { color: var(--red); }
.todo-when.is-soon { color: var(--orange); }
.todo-arrow { color: var(--muted); }
@media (max-width: 1100px) {
  .todo-banner-main { grid-template-columns: auto minmax(0, 1fr); }
  .todo-toggle { grid-column: 1 / -1; justify-self: start; }
  .todo-link { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "type when" "main main"; row-gap: 6px; }
  .todo-type { grid-area: type; }
  .todo-when { grid-area: when; }
  .todo-main { grid-area: main; }
  .todo-owner { grid-area: owner; }
  .todo-arrow { display: none; }
}
.todo-toggle-short { display: none; }
@media (max-width: 640px) {
  /* Le bouton remonte sur la ligne du total : une ligne de moins sur téléphone. */
  .todo-banner-main { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "total toggle" "side side"; gap: 12px; padding: 14px 16px; }
  .todo-total { grid-area: total; }
  .todo-side { grid-area: side; }
  .todo-toggle { grid-area: toggle; justify-self: end; align-self: start; padding: 8px 13px; font-size: 12px; }
  .todo-toggle-long { display: none; }
  .todo-toggle-short { display: inline; }
  .todo-next { white-space: normal; }
}
@media (prefers-reduced-motion: reduce) {
  .todo-banner.is-urgent .todo-icon::after { animation: none; }
}
@media print {
  .todo-banner { box-shadow: none !important; }
  .todo-toggle, .todo-filter { display: none !important; }
  .todo-panel { display: block !important; }
  .todo-banner .todo-icon::after { display: none !important; }
}

/* ═══════════════════════════════════════════════════════════
   CONTRATS — tableau en cartes sous 1100px (plus de scroll horizontal)
   ═══════════════════════════════════════════════════════════ */
.contracts-table {
  min-inline-size: 0;
}

.contracts-table th,
.contracts-table td {
  padding: 12px 10px;
}

.contracts-table .chip {
  white-space: normal;
}

@media (max-width: 1100px) {
  .contracts-table-wrap {
    border: 0;
    overflow: visible;
  }

  .contracts-table,
  .contracts-table tbody,
  .contracts-table tr,
  .contracts-table td {
    display: block;
    inline-size: 100%;
    min-inline-size: 0;
    max-inline-size: 100%;
  }

  .contracts-table thead {
    display: none;
  }

  .contracts-table tbody {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
    background: transparent;
  }

  .contracts-table tr {
    padding: 14px 16px;
    background: white;
    border: 0.5px solid rgba(26, 31, 53, 0.1);
    border-radius: 12px;
  }

  .contracts-table td {
    display: grid;
    grid-template-columns: 112px minmax(0, 1fr);
    gap: 10px;
    align-items: baseline;
    padding: 6px 0;
    border-block-end: 0;
    overflow-wrap: anywhere;
  }

  .contracts-table td::before {
    content: attr(data-label);
    color: var(--muted);
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }

  /* L'intitulé sert de titre de carte */
  .contracts-table td[data-label="Intitulé"] {
    display: block;
    padding-block: 0 8px;
    margin-block-end: 4px;
    border-block-end: 0.5px solid rgba(26, 31, 53, 0.1);
    font-size: 15px !important;
    font-weight: 600;
  }

  .contracts-table td[data-label="Intitulé"]::before {
    content: none;
  }

  .contracts-table .chip {
    justify-self: start;
    white-space: normal;
  }
}

/* ═══════════════════════════════════════════════════════════
   IMPRESSION — Ctrl+P / Enregistrer en PDF
   Neutralise la navigation et les mises en page mobiles
   (une page A4 fait moins de 900px de large et déclencherait
   sinon les règles responsive).
   ═══════════════════════════════════════════════════════════ */
@page {
  size: A4;
  margin: 12mm 10mm;
}

@media print {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  html,
  body {
    background: white !important;
    padding: 0 !important;
    font-size: 11px;
  }

  .sidebar,
  .mobile-bar,
  .mobile-overlay,
  .mobile-ptr-indicator,
  .hamburger,
  button,
  input,
  select,
  .doc-filter-pill,
  .search {
    display: none !important;
  }

  .main {
    margin: 0 !important;
    padding: 0 !important;
  }

  .page {
    max-inline-size: none !important;
  }

  .site-banner {
    margin-block-end: 10px;
    border: 0.5px solid #999;
    background: white !important;
  }

  .page-head {
    margin-block-end: 12px;
    break-after: avoid;
  }

  .page-head h1 {
    font-size: 22px;
  }

  .card {
    box-shadow: none !important;
    border: 0.5px solid #bbb !important;
    border-radius: 6px !important;
    padding: 12px !important;
  }

  .card-head,
  h2,
  h3 {
    break-after: avoid;
  }

  /* Les blocs côte à côte s'empilent : une demi-page A4 est trop étroite */
  .grid.two,
  .grid.analytics {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }

  /* Annuaire en colonnes : une grille ne se découpe pas entre deux pages */
  .directory {
    display: block !important;
    columns: 2;
    column-gap: 10px;
  }

  .directory > .person-card {
    display: grid !important;
    break-inside: avoid;
    margin-block-end: 10px;
  }

  .grid.three,
  .grid.kpis,
  .echeances-cards-grid,
  .res-cards-grid {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px !important;
  }

  .doc-card,
  .ech-card,
  .res-card,
  .kpi,
  tr {
    break-inside: avoid;
  }

  /* Pastilles d'initiales : sans relief ni transformation (sinon décalées à l'impression) */
  .interv-badge,
  .avatar {
    box-shadow: none !important;
    transform: none !important;
    filter: none !important;
  }

  .interv-badge::before,
  .interv-badge::after,
  .avatar::before,
  .avatar::after {
    display: none !important;
  }

  .prestataire-badge {
    inline-size: 34px !important;
    block-size: 34px !important;
    font-size: 10.5px !important;
  }

  .kpi-bar-col {
    opacity: 1 !important;
  }

  /* Tableaux : toujours en tableau, jamais en cartes, sans scroll */
  .table-wrap {
    overflow: visible !important;
    border: 0.5px solid #bbb !important;
    border-radius: 0 !important;
  }

  table,
  .client-table,
  .dashboard-alerts table,
  .contracts-table {
    display: table !important;
    inline-size: 100% !important;
    min-inline-size: 0 !important;
    table-layout: auto;
  }

  thead,
  .client-table thead,
  .dashboard-alerts thead,
  .contracts-table thead {
    display: table-header-group !important;
  }

  tbody,
  .client-table tbody,
  .dashboard-alerts tbody,
  .contracts-table tbody {
    display: table-row-group !important;
    inline-size: auto !important;
  }

  tr,
  .client-table tr,
  .dashboard-alerts tr,
  .contracts-table tr {
    display: table-row !important;
    inline-size: auto !important;
    padding: 0 !important;
    border: 0 !important;
    break-inside: avoid;
  }

  th,
  td,
  .client-table td,
  .dashboard-alerts td,
  .contracts-table td {
    display: table-cell !important;
    inline-size: auto !important;
    min-inline-size: 0 !important;
    max-inline-size: none !important;
    padding: 5px 6px !important;
    font-size: 9.5px !important;
    border-block-end: 0.5px solid #ccc !important;
    overflow-wrap: break-word !important;
    word-break: normal !important;
  }

  td::before {
    content: none !important;
  }

  .contracts-table td[data-label="Intitulé"] {
    margin: 0 !important;
    font-weight: 600;
  }

  .chip,
  .download {
    padding: 1px 6px !important;
    font-size: 9px !important;
    white-space: nowrap !important;
  }

  /* Seul le type de contrat, libellé long, passe à la ligne entre les mots */
  .contracts-table td[data-label="Type"] .chip {
    white-space: normal !important;
  }

  a {
    color: inherit !important;
    text-decoration: none !important;
  }

  .history-document-modal {
    display: none !important;
  }
}

/* ══════════════════════════════════════════════════════════════════════════
   Visionneuse officielle en superposition (architecture « La Mémoire du Feu »)
   ══════════════════════════════════════════════════════════════════════════ */

@keyframes visionneuse-entree {
  from {
    opacity: 0;
    transform: scale(0.98) translateY(6px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes document-spin {
  to {
    transform: rotate(360deg);
  }
}

.history-document-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(10, 8, 7, 0.84);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(0.65rem, 2vw, 1.5rem);
  font-family: 'Manrope', system-ui, -apple-system, sans-serif;
}

.document-viewer-card {
  position: relative;
  width: 100%;
  max-width: 78rem;
  height: min(94vh, 940px);
  display: flex;
  flex-direction: column;
  background: #14110f;
  border: 1px solid rgba(245, 242, 235, 0.16);
  border-radius: 12px;
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.85), 0 0 0 1px rgba(255, 255, 255, 0.05);
  overflow: hidden;
  animation: visionneuse-entree 0.2s ease-out;
}

.document-viewer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  padding: 0.8rem 1.15rem;
  background: #1a1614;
  border-bottom: 1px solid rgba(245, 242, 235, 0.1);
  flex-shrink: 0;
}

.document-viewer-meta {
  display: flex;
  flex-direction: column;
  gap: 0.22rem;
  min-width: 0;
  flex: 1;
}

.document-viewer-badge-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
  font-size: 0.75rem;
}

.document-viewer-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.18rem 0.58rem;
  border-radius: 9999px;
  background: rgba(139, 92, 246, 0.16);
  border: 1px solid rgba(139, 92, 246, 0.42);
  color: #c4b5fd;
  font-weight: 600;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.document-viewer-badge-dot {
  flex-shrink: 0;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #a78bfa;
  box-shadow: 0 0 6px #8b5cf6;
}

.document-viewer-format {
  flex-shrink: 0;
  color: rgba(245, 242, 235, 0.58);
  font-size: 0.72rem;
  white-space: nowrap;
}

.document-viewer-title {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 600;
  color: #f5f2eb;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

.document-viewer-toolbar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.document-viewer-pagination {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 6px;
  padding: 0.15rem 0.5rem 0.15rem 0.2rem;
}

.document-viewer-page-input {
  width: 4.4ch;
  padding: 0.2rem 0.2rem;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  color: #ffd895;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.document-viewer-page-input:hover {
  border-color: rgba(255, 255, 255, 0.2);
}

.document-viewer-page-input:focus {
  outline: none;
  border-color: rgba(224, 168, 88, 0.8);
  background: rgba(0, 0, 0, 0.35);
}

.document-viewer-page-total {
  font-size: 0.78rem;
  font-weight: 600;
  color: rgba(245, 242, 235, 0.7);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.document-viewer-zoom-controls {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 6px;
  padding: 0.15rem 0.3rem;
}

.document-viewer-zoom-btn,
.document-viewer-zoom-level {
  background: transparent;
  border: none;
  color: #f5f2eb;
  padding: 0.25rem 0.45rem;
  font: inherit;
  font-size: 0.75rem;
  cursor: pointer;
  border-radius: 4px;
  transition: background 0.15s ease;
}

.document-viewer-zoom-level {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: rgba(245, 242, 235, 0.85);
}

.document-viewer-zoom-btn:hover:not(:disabled),
.document-viewer-zoom-level:hover {
  background: rgba(255, 255, 255, 0.15);
}

.document-viewer-zoom-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.document-viewer-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
  padding: 0.42rem 0.75rem;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #f5f2eb;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.18s ease;
  cursor: pointer;
  white-space: nowrap;
}

.document-viewer-action-btn:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.3);
  color: #ffffff;
}

.document-viewer-action-btn.is-active {
  background: rgba(139, 92, 246, 0.24);
  border-color: rgba(167, 139, 250, 0.65);
  color: #e9d5ff;
}

.document-viewer-action-open {
  color: #ffda9e;
  border-color: rgba(224, 168, 88, 0.35);
  background: rgba(224, 168, 88, 0.1);
}

.document-viewer-action-open:hover {
  background: rgba(224, 168, 88, 0.22);
  border-color: rgba(224, 168, 88, 0.6);
  color: #ffffff;
}

.document-viewer-close-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #f5f2eb;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
  margin-left: 0.15rem;
}

.document-viewer-close-btn:hover {
  background: rgba(239, 68, 68, 0.22);
  border-color: rgba(239, 68, 68, 0.6);
  color: #ffffff;
  transform: scale(1.05);
}

.document-viewer-btn-icon {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

.document-viewer-body {
  position: relative;
  flex: 1;
  min-height: 0;
  width: 100%;
  background: #110e0d;
  overflow: hidden;
  display: flex;
}

/* ── Volet Sommaire latéral (Chapitres & Pièces) ── */
.document-viewer-toc-drawer {
  width: 310px;
  max-width: 82vw;
  height: 100%;
  background: #171311;
  border-right: 1px solid rgba(245, 242, 235, 0.1);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  z-index: 4;
}

.document-viewer-toc-drawer[hidden] {
  display: none !important;
}

.document-viewer-toc-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.7rem 0.95rem;
  border-bottom: 1px solid rgba(245, 242, 235, 0.08);
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(245, 242, 235, 0.7);
}

.document-viewer-toc-list {
  flex: 1;
  overflow-y: auto;
  padding: 0.45rem;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.document-viewer-toc-item {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  border-radius: 6px;
  padding: 0.42rem 0.6rem;
  color: rgba(245, 242, 235, 0.88);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.14s ease, color 0.14s ease;
}

.document-viewer-toc-item.is-sub {
  padding-left: 1.25rem;
  font-size: 0.73rem;
  font-weight: 400;
  color: rgba(245, 242, 235, 0.68);
}

.document-viewer-toc-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.document-viewer-toc-item.is-current {
  background: rgba(224, 168, 88, 0.16);
  color: #ffd895;
}

.document-viewer-toc-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.document-viewer-toc-page {
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
  font-size: 0.7rem;
  color: rgba(245, 242, 235, 0.45);
}

.document-viewer-canvas-scroll {
  position: relative;
  flex: 1;
  min-width: 0;
  height: 100%;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  touch-action: pan-x pan-y;
  padding: 1.25rem 1rem;
  box-sizing: border-box;
  cursor: grab;
}

.document-viewer-canvas-scroll.is-grabbing,
.document-viewer-canvas-scroll.is-grabbing * {
  cursor: grabbing !important;
  user-select: none !important;
}

.document-viewer-canvas-scroll:focus-visible {
  outline: 2px solid rgba(224, 168, 88, 0.7);
  outline-offset: -2px;
}

.document-viewer-pages {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.85rem;
  width: max-content;
  min-width: 100%;
  transform-origin: 0 0;
}

.document-viewer-page {
  position: relative;
  flex-shrink: 0;
  background: #ffffff;
  border-radius: 4px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.75), 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.document-viewer-page::before {
  content: "";
  position: absolute;
  top: calc(50% - 18px);
  left: calc(50% - 18px);
  width: 36px;
  height: 36px;
  box-sizing: border-box;
  border-radius: 50%;
  border: 3px solid rgba(0, 0, 0, 0.08);
  border-top-color: var(--red, #b3261e);
  animation: document-viewer-spin 0.8s linear infinite;
}

.document-viewer-page::after {
  content: "Page " attr(data-page);
  position: absolute;
  top: calc(50% + 28px);
  left: 0;
  right: 0;
  text-align: center;
  color: rgba(0, 0, 0, 0.3);
  font-size: 0.8rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.document-viewer-page.is-rendered::before,
.document-viewer-page.is-rendered::after {
  display: none;
}

@keyframes document-viewer-spin {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .document-viewer-page::before { animation-duration: 2.4s; }
}

.document-viewer-canvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 4px;
}

.document-viewer-page .textLayer {
  position: absolute;
  text-align: initial;
  inset: 0;
  overflow: clip;
  opacity: 1;
  line-height: 1;
  -webkit-text-size-adjust: none;
  text-size-adjust: none;
  forced-color-adjust: none;
  transform-origin: 0 0;
  caret-color: CanvasText;
  z-index: 1;
}

.document-viewer-page .textLayer :is(span, br) {
  color: transparent;
  position: absolute;
  white-space: pre;
  cursor: inherit;
  transform-origin: 0% 0%;
}

.document-viewer-page .textLayer ::selection {
  background: rgba(0, 90, 200, 0.3);
}

/* Couche de liens internes PDF (Sommaire cliquable, puces Pxx-yy, retour Sommaire) */
.document-viewer-link-layer {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

.document-viewer-pdf-link {
  position: absolute;
  pointer-events: auto;
  cursor: pointer;
  border-radius: 3px;
  transition: background 0.12s ease;
}

.document-viewer-pdf-link:hover {
  background: rgba(176, 39, 31, 0.14);
  box-shadow: 0 0 0 1px rgba(176, 39, 31, 0.35);
}

/* Écran de chargement en superposition */
.document-viewer-loading {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.85rem;
  padding: 2rem;
  background: radial-gradient(circle at center, #1f1a18 0%, #0d0a09 100%);
  text-align: center;
  color: #f5f2eb;
}

.document-viewer-loading[hidden] {
  display: none !important;
}

.document-viewer-spinner .spinner-ring {
  width: 46px;
  height: 46px;
  border: 3px solid rgba(139, 92, 246, 0.2);
  border-top-color: #a78bfa;
  border-right-color: #e0a858;
  border-radius: 50%;
  animation: document-spin 0.85s linear infinite;
}

.document-viewer-loading-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: #f5f2eb;
  margin: 0;
}

.document-viewer-progress-bar-wrap {
  width: 100%;
  max-width: 280px;
  height: 7px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  overflow: hidden;
  position: relative;
  margin: 0.2rem 0;
}

.document-viewer-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #a78bfa, #e0a858);
  transition: width 0.2s ease-out;
}

.document-viewer-progress-text {
  font-size: 0.78rem;
  color: #ffd895;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.document-viewer-steps {
  list-style: none;
  margin: 0.35rem 0 0;
  padding: 0.65rem 1rem;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: grid;
  gap: 0.45rem;
  text-align: left;
  font-size: 0.78rem;
  width: min(340px, 100%);
}

.document-viewer-steps li {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  color: rgba(245, 242, 235, 0.48);
}

.document-viewer-steps li::before {
  content: '';
  flex: 0 0 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.2);
}

.document-viewer-steps li.is-active {
  color: #f5f2eb;
  font-weight: 600;
}

.document-viewer-steps li.is-active::before {
  border-color: #e0a858;
  border-top-color: transparent;
  animation: document-spin 0.8s linear infinite;
}

.document-viewer-steps li.is-done {
  color: rgba(245, 242, 235, 0.85);
}

.document-viewer-steps li.is-done::before {
  border-color: #22c55e;
  background: #22c55e;
}

.document-viewer-loading-hint {
  font-size: 0.8rem;
  color: rgba(245, 242, 235, 0.62);
  max-width: 28rem;
  line-height: 1.45;
  margin: 0;
}

.document-viewer-loading-direct-btn {
  margin-top: 0.35rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.9rem;
  border-radius: 6px;
  background: rgba(224, 168, 88, 0.15);
  border: 1px solid rgba(224, 168, 88, 0.4);
  color: #ffd895;
  font-size: 0.8rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.document-viewer-loading-direct-btn:hover {
  background: rgba(224, 168, 88, 0.28);
  color: #ffffff;
}

.document-viewer-error {
  position: absolute;
  inset: 0;
  z-index: 6;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 2rem;
  background: #161311;
  text-align: center;
  color: #f5f2eb;
}

.document-viewer-error[hidden] {
  display: none !important;
}

.document-viewer-error-title {
  font-size: 1rem;
  font-weight: 600;
  color: #fca5a5;
  margin: 0;
}

.document-viewer-error-hint {
  font-size: 0.82rem;
  color: rgba(245, 242, 235, 0.7);
  max-width: 26rem;
  margin: 0;
}

.document-viewer-error-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.5rem;
  flex-wrap: wrap;
  justify-content: center;
}

.document-viewer-footer-mobile {
  display: none;
}

@media (max-width: 1080px) and (min-width: 681px) {
  .document-viewer-action-label {
    display: none;
  }
}

@keyframes share-glow-pulse {
  0%, 100% {
    box-shadow: 0 0 14px rgba(139, 92, 246, 0.65), 0 0 4px rgba(196, 181, 253, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.35);
  }
  50% {
    box-shadow: 0 0 22px rgba(139, 92, 246, 0.92), 0 0 8px rgba(216, 180, 254, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.5);
  }
}

.document-viewer-action-share {
  background: linear-gradient(135deg, #8b5cf6 0%, #6d28d9 100%);
  border-color: rgba(216, 180, 254, 0.85);
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 0 16px rgba(139, 92, 246, 0.65), 0 0 4px rgba(196, 181, 253, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.35);
  animation: share-glow-pulse 2.6s ease-in-out infinite;
}

.document-viewer-action-share:hover {
  background: linear-gradient(135deg, #9f75ff 0%, #7c3aed 100%);
  border-color: #ffffff;
  color: #ffffff;
  box-shadow: 0 0 24px rgba(167, 139, 250, 0.95), 0 0 8px rgba(255, 255, 255, 0.65);
  transform: translateY(-1px);
}

.document-viewer-action-download {
  background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
  border-color: rgba(125, 211, 252, 0.75);
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 4px 14px rgba(14, 165, 233, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.document-viewer-action-download:hover {
  background: linear-gradient(135deg, #38bdf8 0%, #0369a1 100%);
  border-color: #e0f2fe;
  color: #ffffff;
  box-shadow: 0 6px 18px rgba(56, 189, 248, 0.55);
  transform: translateY(-1px);
}

.document-viewer-share-backdrop {
  position: absolute;
  inset: 0;
  z-index: 9;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  background: rgba(12, 10, 9, 0.78);
  backdrop-filter: blur(5px);
}

.document-viewer-share-backdrop[hidden] {
  display: none !important;
}

.document-viewer-share-modal {
  width: 100%;
  max-width: 450px;
  background: #1c1816;
  border: 1px solid rgba(245, 242, 235, 0.16);
  border-radius: 14px;
  padding: 1.15rem 1.25rem;
  box-shadow: 0 24px 56px rgba(0, 0, 0, 0.65);
  color: #f5f2eb;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.document-viewer-share-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.document-viewer-share-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: #ffffff;
}

.document-viewer-share-close {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(245, 242, 235, 0.75);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
}

.document-viewer-share-close:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
}

.document-viewer-share-desc {
  margin: 0;
  font-size: 0.8rem;
  line-height: 1.48;
  color: rgba(245, 242, 235, 0.76);
}

.document-viewer-share-url-box {
  display: flex;
  gap: 0.45rem;
  align-items: stretch;
}

.document-viewer-share-input {
  flex: 1;
  min-width: 0;
  background: rgba(0, 0, 0, 0.36);
  border: 1px solid rgba(245, 242, 235, 0.16);
  border-radius: 8px;
  padding: 0.55rem 0.75rem;
  color: #f5f2eb;
  font-family: var(--font-mono, monospace);
  font-size: 0.76rem;
}

.document-viewer-share-copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0 0.9rem;
  border-radius: 8px;
  border: 1px solid rgba(224, 168, 88, 0.5);
  background: rgba(224, 168, 88, 0.18);
  color: #ffd895;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.16s ease;
}

.document-viewer-share-copy-btn:hover {
  background: rgba(224, 168, 88, 0.3);
  color: #ffffff;
}

.document-viewer-share-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.document-viewer-share-actions-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.document-viewer-share-action-primary,
.document-viewer-share-action-whatsapp,
.document-viewer-share-action-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  width: 100%;
  padding: 0.62rem 0.8rem;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.16s ease;
  box-sizing: border-box;
}

.document-viewer-share-action-primary {
  background: linear-gradient(135deg, #7c3aed, #6d28d9);
  border: 1px solid rgba(167, 139, 250, 0.5);
  color: #ffffff;
}

.document-viewer-share-action-primary:hover {
  filter: brightness(1.1);
}

.document-viewer-share-action-Primary[hidden],
.document-viewer-share-action-primary[hidden] {
  display: none !important;
}

.document-viewer-share-action-whatsapp {
  background: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
  border: 1px solid rgba(134, 239, 172, 0.5);
  color: #ffffff;
}

.document-viewer-share-action-whatsapp:hover {
  background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
  color: #ffffff;
}

.document-viewer-share-action-secondary {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: rgba(245, 242, 235, 0.92);
}

.document-viewer-share-action-secondary:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
}

.document-viewer-mobile-share {
  background: linear-gradient(135deg, #8b5cf6 0%, #6d28d9 100%) !important;
  border-color: rgba(216, 180, 254, 0.85) !important;
  color: #ffffff !important;
  box-shadow: 0 0 14px rgba(139, 92, 246, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.35) !important;
}

.document-viewer-mobile-download {
  background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%) !important;
  border-color: rgba(125, 211, 252, 0.75) !important;
  color: #ffffff !important;
  box-shadow: 0 3px 10px rgba(14, 165, 233, 0.4) !important;
}

@media (max-width: 680px) {
  .history-document-modal {
    padding: 0;
  }

  .document-viewer-card {
    border-radius: 0;
    height: 100dvh;
    max-height: 100dvh;
    border: none;
  }

  .document-viewer-header {
    padding: 0.65rem 0.85rem;
  }

  .document-viewer-toolbar {
    display: none;
  }

  .document-viewer-toc-drawer {
    position: absolute;
    inset: 0 auto 0 0;
    z-index: 8;
    box-shadow: 12px 0 36px rgba(0, 0, 0, 0.65);
  }

  .document-viewer-canvas-scroll {
    padding: 0.65rem 0.35rem;
  }

  .document-viewer-share-url-box {
    flex-direction: column;
  }

  .document-viewer-share-actions-row {
    grid-template-columns: 1fr;
  }

  .document-viewer-share-copy-btn {
    height: 40px;
    justify-content: center;
  }

  .document-viewer-footer-mobile {
    display: flex;
    padding: 0.45rem 0.5rem calc(0.45rem + env(safe-area-inset-bottom, 0px));
    background: #14110f;
    border-top: 1px solid rgba(245, 242, 235, 0.12);
    flex-shrink: 0;
  }

  .document-viewer-mobile-actions {
    display: flex;
    gap: 0.35rem;
    width: 100%;
    align-items: center;
  }

  .document-viewer-mobile-btn {
    flex: 1;
    min-width: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 38px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #f5f2eb;
    font: inherit;
    font-size: 0.76rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
  }
}


/* ── Épuration (27/09/2026) : intitulés en petites capitales redondants avec les titres ── */
.page-head .eyebrow, .card-head .label { display: none; }

/* Tableau de bord : dernières interventions */
.dernieres-interv { list-style: none; margin: 10px 0 0; padding: 0; }
.dernieres-interv li { display: grid; grid-template-columns: 78px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 9px 0; border-top: 1px solid rgba(26, 31, 53, 0.07); font-size: 13px; }
.dernieres-interv li:first-child { border-top: 0; }
.dernieres-interv .di-date { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 12px; }
.dernieres-interv .di-nom { font-weight: 600; min-width: 0; }
.dernieres-interv .di-nom small { display: block; font-weight: 400; color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dernieres-interv .di-vide { display: block; color: var(--muted); }

/* Tableau de bord : prochaine commission */
.prochaine-comm .pc-date { font-size: 18px; font-weight: 700; color: var(--navy); margin: 6px 0 14px; font-family: var(--font-display); }
.prochaine-comm .pc-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.prochaine-comm .pc-stats div { background: rgba(26, 31, 53, 0.035); border-radius: 12px; padding: 12px 14px; }
.prochaine-comm .pc-stats strong { display: block; font-size: 28px; font-family: var(--font-display); color: var(--navy); line-height: 1.1; }
.prochaine-comm .pc-stats strong.orange { color: var(--orange); }
.prochaine-comm .pc-stats span { font-size: 12px; color: var(--muted); }
.prochaine-comm .pc-vide { color: var(--muted); }
/* Compteurs d'en-tête : redondants avec les listes et filtres de chaque page */
.page-head .head-meta { display: none; }

/* Panneau latéral de détail */
.pnl-fond { position: fixed; inset: 0; background: rgba(26, 31, 53, 0.28); z-index: 90; }
.pnl { position: fixed; top: 0; right: 0; bottom: 0; width: min(440px, 100vw); background: var(--surface); box-shadow: -20px 0 50px -20px rgba(26, 31, 53, 0.35); z-index: 91; overflow-y: auto; padding: 26px 24px 30px; transform: translateX(105%); visibility: hidden; transition: transform .22s ease; }
.pnl.ouvert { transform: none; visibility: visible; }
.pnl-fermer { position: absolute; top: 14px; right: 14px; width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--border); background: var(--surface); font-size: 20px; line-height: 1; cursor: pointer; color: var(--navy); }
.pnl .pnl-sur { font-size: 12px; color: var(--muted); font-weight: 600; }
.pnl h2 { margin: 8px 40px 10px 0; font-size: 20px; line-height: 1.25; }
.pnl dl { display: grid; grid-template-columns: 120px 1fr; gap: 8px 12px; margin: 18px 0; font-size: 13px; }
.pnl dt { color: var(--muted); }
.pnl dd { margin: 0; }
.pnl .pnl-texte { font-size: 13px; line-height: 1.55; background: rgba(26, 31, 53, 0.035); border-radius: 10px; padding: 12px 14px; white-space: pre-line; }
.pnl h3 { font-size: 13px; margin: 22px 0 8px; color: var(--navy); }
.pnl .pnl-ligne { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid rgba(26, 31, 53, 0.07); font-size: 13px; }
.pnl .pnl-ligne small { color: var(--muted); white-space: nowrap; }
.pnl a { color: var(--accent); text-decoration: none; }
.pnl a:hover { text-decoration: underline; }
.pnl .pnl-vide { color: var(--muted); font-size: 13px; }
tr.pnl-cliquable { cursor: pointer; }
tr.pnl-cliquable:hover td { background: rgba(26, 31, 53, 0.03); }
@media (max-width: 760px) {
  .pnl { top: auto; width: 100vw; max-height: 88vh; border-radius: 18px 18px 0 0; transform: translateY(105%); }
  .pnl dl { grid-template-columns: 105px 1fr; }
}

/* Carte « Préparer la prochaine commission » : halo lumineux, renforcé au survol pour inviter au clic */
.carte-prepa { cursor: pointer; border: 1px solid rgba(139, 156, 255, 0.55) !important;
  box-shadow: 0 0 0 1px rgba(139, 156, 255, 0.2), 0 0 22px rgba(124, 140, 255, 0.4), 0 0 60px -10px rgba(139, 92, 246, 0.45) !important;
  transition: box-shadow .2s ease, transform .2s ease; }
.carte-prepa:hover, .carte-prepa:focus-visible { transform: translateY(-2px); outline: none;
  box-shadow: 0 0 0 1px rgba(165, 178, 255, 0.55), 0 0 34px rgba(124, 140, 255, 0.75), 0 0 90px -8px rgba(139, 92, 246, 0.75) !important; }

/* Avis de dépôt d'un justificatif */
.ncis-avis { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 120; max-width: min(560px, calc(100vw - 32px));
  padding: 12px 18px; border-radius: 12px; font-size: 14px; font-weight: 600; color: #fff; background: #1f6f4f; box-shadow: 0 16px 40px -12px rgba(0, 0, 0, 0.5); }
.ncis-avis.erreur { background: #9b1c1c; }
.bouton-deposer { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px; border: 1px solid rgba(139, 156, 255, 0.55);
  background: transparent; color: var(--accent); font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; }
.bouton-deposer:hover { background: var(--accent-soft); }
.icone-deposer { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; border: 1px solid var(--border); background: transparent; color: var(--accent); cursor: pointer; flex-shrink: 0; }
.icone-deposer:hover { background: var(--accent-soft); }

/* Tableau de bord : suivi réglementaire (obligations et réserves), dépôt, commission */
.suivi-duo { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 6px; }
.suivi-moitie { cursor: pointer; border-radius: 12px; padding: 10px 12px; background: rgba(127, 127, 127, 0.04); border: 1px solid var(--border); transition: background .15s ease; }
.suivi-moitie:hover { background: rgba(127, 127, 127, 0.08); }
.suivi-moitie-tete { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 10px; }
.suivi-moitie-tete h3 { margin: 0; font-size: 14px; color: var(--navy); }
.suivi-moitie .addonut-wrap { flex-direction: row; align-items: center; gap: 14px; }
.suivi-moitie .addonut-svg-area, .suivi-moitie .addonut-svg { width: 112px; height: 112px; }
.suivi-moitie .addonut-center strong { font-size: 24px; }
.suivi-moitie .addonut-legend { flex: 1; min-width: 0; }
.suivi-moitie .addonut-legend-item { padding: 4px 6px; }
@media (max-width: 760px) { .suivi-duo { grid-template-columns: 1fr; } }
.depot-carte { cursor: pointer; border: 1.5px dashed rgba(139, 156, 255, 0.55) !important; transition: background .15s ease, border-color .15s ease; }
.depot-carte:hover, .depot-carte.survol, .depot-carte:focus-visible { outline: none; background: rgba(139, 156, 255, 0.08) !important; border-color: var(--accent) !important; }
.depot-cible { display: grid; justify-items: center; gap: 6px; padding: 18px 8px 8px; text-align: center; color: var(--accent); }
.depot-cible strong { font-size: 17px; color: var(--navy); font-family: var(--font-display); }
.depot-cible span { font-size: 13px; color: var(--muted); }
.depot-cible small { font-size: 12px; color: var(--muted); }
.prochaine-comm .pc-quand { margin: -8px 0 14px; font-size: 14px; color: var(--muted); font-weight: 600; }
.prochaine-comm .pc-avis { margin: 14px 0 0; font-size: 13px; color: var(--muted); }
.prochaine-comm .pc-avis b.vert { color: var(--green); }
.prochaine-comm .pc-avis b.rouge { color: var(--red); }
.grid.analytics.rangee-suivi { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); }
.rangee-suivi .kpi-chart-card { grid-column: auto !important; }
.suivi-moitie { min-width: 0; overflow: hidden; }
.suivi-moitie .res-gauge-wrap { max-width: 220px; margin: 0 auto; }
@media (max-width: 1100px) { .grid.analytics.rangee-suivi { grid-template-columns: 1fr; } }

/* Barre latérale : une seule mention Nexum */
.sidebar-footer { display: none !important; }
/* Tableau de bord plus compact */
.rangee-suivi .card-pad { padding-block: 14px; }
.rangee-suivi .card-head { margin-bottom: 6px; }
.dernieres-interv li { padding: 7px 0; }

/* Tableau de bord : commission et dépôt resserrés */
.carte-prepa .prochaine-comm .pc-date { margin: 2px 0 10px; }
.carte-prepa .prochaine-comm .pc-avis { margin-top: 10px; }
.depot-cible { padding: 4px 8px 0; gap: 4px; }
.depot-cible svg { width: 28px; height: 28px; }

/* Barre latérale : bouton PDF sur une ligne */
.sidebar-export { align-items: center; gap: 8px; padding-block: 10px; }
.sidebar-export small { display: none !important; }
.sidebar-export b { white-space: nowrap; font-size: 13px; }

/* Bandeau « Suivi à jour » : rien en retard, les échéances proches annoncées sans alarme */
.todo-banner.is-clear #todo-count:empty { display: none; }
.todo-banner.is-clear .todo-total-label { font-size: 22px; letter-spacing: 0; text-transform: none; font-family: var(--font-display); }
.todo-banner.is-clear .todo-total-sub { font-size: 13px; }
.todo-banner.is-clear .todo-side { justify-items: end; text-align: right; }
.todo-banner.is-clear .todo-toggle { color: #166c46; text-decoration: none; }
.todo-banner.is-clear .todo-toggle:hover { background: #f1fbf6; }
.todo-prep { display: inline-flex; align-items: center; padding: 6px 12px; border-radius: 999px; background: #f2c94c; color: #3b2f00; font-size: 12.5px; font-weight: 700; text-decoration: none; }
@media (max-width: 760px) { .todo-banner.is-clear .todo-side { justify-items: start; text-align: left; } }
