.commissioning-counts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; padding: 16px; }
.commissioning-counts > div { border: 1px solid #d9e1eb; border-radius: 8px; padding: 12px 16px; }
.commissioning-counts p { font-size: 1.5rem; font-weight: 700; margin: 6px 0 0; }
.commissioning-list { padding: 16px; }
.commissioning-list .related-item { flex-wrap: wrap; gap: 12px; }
.commissioning-list .related-item > div { flex: 1 1 260px; }
.commissioning-list small { display: block; margin-top: 6px; }
@media (max-width: 650px) { .commissioning-counts { grid-template-columns: 1fr; } }
:root {
  color-scheme: light;
  --bg: #edf3f9;
  --surface: #fff;
  --surface-soft: #e4edf6;
  --surface-muted: #f5f9fd;
  --border: #d1dfec;
  --border-strong: #acc3d8;
  --text: #203e52;
  --text-muted: #526c7e;
  --text-faint: #7891a8;
  --accent: #0a74b4;
  --accent-strong: #05527f;
  --accent-soft: #dcedf9;
  --positive: #166e49;
  --positive-soft: #dbf0e5;
  --warning: #8e5400;
  --warning-soft: #fae9cf;
  --negative: #a02a1e;
  --negative-soft: #f9e0dd;
  --shadow: 0 1px 2px rgb(10 30 46 / 6%), 0 8px 24px -12px rgb(10 30 46 / 18%);
  --card-shadow: var(--shadow);
  --raised-shadow: 0 24px 60px -20px rgb(10 30 46 / 35%);
  --sidebar-width: 252px;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #04141f; --surface: #0a2130; --surface-soft: #0f2d40; --surface-muted: #0c2739;
  --border: #1a4058; --border-strong: #2a5c7c; --text: #e2eff8; --text-muted: #98b7cc; --text-faint: #6a8ca6;
  --accent: #45b4e8; --accent-strong: #a9dcf6; --accent-soft: #0d3750;
  --positive: #57c692; --positive-soft: #0c3729; --warning: #e2a54b; --warning-soft: #3b2c0f;
  --negative: #f0857a; --negative-soft: #3e1a16;
  --shadow: 0 1px 2px rgb(0 0 0 / 40%), 0 8px 24px -12px rgb(0 0 0 / 60%);
  --card-shadow: var(--shadow); --raised-shadow: 0 24px 60px -20px rgb(0 0 0 / 80%);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #04141f; --surface: #0a2130; --surface-soft: #0f2d40; --surface-muted: #0c2739;
    --border: #1a4058; --border-strong: #2a5c7c; --text: #e2eff8; --text-muted: #98b7cc; --text-faint: #6a8ca6;
    --accent: #45b4e8; --accent-strong: #a9dcf6; --accent-soft: #0d3750;
    --positive: #57c692; --positive-soft: #0c3729; --warning: #e2a54b; --warning-soft: #3b2c0f;
    --negative: #f0857a; --negative-soft: #3e1a16;
    --shadow: 0 1px 2px rgb(0 0 0 / 40%), 0 8px 24px -12px rgb(0 0 0 / 60%);
    --card-shadow: var(--shadow); --raised-shadow: 0 24px 60px -20px rgb(0 0 0 / 80%);
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-width: 320px; height: 100%; background: var(--bg); }
body {
  min-width: 320px;
  height: 100%;
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font: 14px/1.5 "IBM Plex Sans", ui-sans-serif, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; }
button { color: inherit; }
a { color: inherit; }
svg { display: block; }

.app-shell { min-height: 100vh; }
.sidebar {
  position: fixed;
  z-index: 20;
  inset: 0 auto 0 0;
  display: flex;
  width: var(--sidebar-width);
  flex-direction: column;
  padding: 0 0 18px;
  overflow-y: auto;
  background: var(--surface);
  border-right: 1px solid var(--border);
}
.sidebar-top { display: flex; min-height: 68px; align-items: center; gap: 7px; padding: 0 14px 0 18px; }
.brand {
  display: flex;
  min-width: 0;
  min-height: 68px;
  flex: 1;
  align-items: center;
  gap: 10px;
  padding: 18px 0 14px;
  margin: 0;
  text-decoration: none;
}
.brand-icon, .brand-word { position: relative; display: block; overflow: hidden; flex: none; }
.brand-icon { width: 34px; height: 34px; }
.brand-icon img { position: absolute; display: block; width: 68px; max-width: none; height: auto; top: -3px; left: -20px; }
.brand-title { display: flex; min-width: 0; flex-direction: column; gap: 1px; }
.brand-word { width: 120px; height: 21px; }
.brand-word img { position: absolute; display: block; width: 136px; max-width: none; height: auto; top: -74px; left: -8px; }
.brand-subtitle { color: var(--text-faint); font-size: 10px; letter-spacing: .07em; text-transform: uppercase; white-space: nowrap; }
.workspace-label {
  margin: 4px 18px 10px;
  color: var(--text-faint);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .12em;
}
.navigation { display: grid; gap: 7px; }
.nav-group { display: grid; gap: 1px; padding: 4px 10px 0; }
.nav-heading {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 7px;
  margin: 0;
  padding: 7px 8px;
  color: var(--text-faint);
  border: 0;
  border-radius: 7px;
  background: transparent;
  text-align: left;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.nav-heading:hover { background: var(--surface-soft); color: var(--text-muted); }
.nav-heading svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.nav-heading[aria-expanded="false"] svg { transform: rotate(-90deg); }
.nav-list { display: flex; flex-direction: column; gap: 1px; padding-bottom: 4px; }
.nav-group.is-closed .nav-list { display: none; }
.nav-item {
  display: flex;
  min-height: 34px;
  align-items: center;
  gap: 10px;
  padding: 7px 9px;
  color: var(--text-muted);
  border: 0;
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
  text-align: left;
  font-size: 13.5px;
  font-weight: 500;
  transition: background .16s ease, color .16s ease;
}
.nav-item:hover { color: var(--text); background: var(--surface-soft); }
a.nav-item { text-decoration: none; width: 100%; }
.nav-item[aria-current="page"] {
  color: var(--accent-strong);
  background: var(--accent-soft);
  font-weight: 600;
  box-shadow: none;
}
.nav-item:disabled, .nav-item[aria-disabled="true"] { cursor: not-allowed; opacity: .48; }
.nav-item:disabled:hover { color: var(--text-muted); background: transparent; }
.nav-item svg {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.65;
}
.nav-count {
  margin-left: auto;
  color: var(--text-faint);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}
.sidebar-bottom { display: grid; gap: 14px; margin-top: auto; padding: 12px 14px 0; border-top: 1px solid var(--border); }
.source-status {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 11px 10px;
  color: var(--text-muted);
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 9px;
  font-size: 11px;
  line-height: 1.55;
}
.source-status strong { color: var(--text); font-weight: 600; }
.status-dot {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  margin-top: 5px;
  background: var(--positive);
  border-radius: 50%;
}
.sidebar-doc {
  display: flex;
  justify-content: space-between;
  padding: 0 10px;
  color: var(--text-muted);
  font-size: 12px;
  text-decoration: none;
}
.sidebar-doc:hover { color: var(--accent-strong); }

.sidebar-collapse { flex: none; }
.sidebar-collapse-button {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  color: var(--text-faint);
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  cursor: pointer;
}
.sidebar-collapse-button:hover { color: var(--text-muted); background: var(--surface-soft); }
.sidebar-collapse-button svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.app-shell.is-collapsed { --sidebar-width: 72px; }
.app-shell.is-collapsed .sidebar { padding-right: 0; padding-left: 0; }
.app-shell.is-collapsed .sidebar-top { flex-direction: column; gap: 7px; padding: 16px 0 10px; }
.app-shell.is-collapsed .brand { min-height: 0; flex: none; justify-content: center; padding: 0; }
.app-shell.is-collapsed .brand-title { display: none; }
.app-shell.is-collapsed .workspace-label,
.app-shell.is-collapsed .nav-heading,
.app-shell.is-collapsed .nav-item span,
.app-shell.is-collapsed .sidebar-bottom { display: none; }
.app-shell.is-collapsed .navigation { gap: 7px; }
.app-shell.is-collapsed .nav-group { padding: 6px 9px 0; }
.app-shell.is-collapsed .nav-group.is-closed .nav-list { display: flex; }
.app-shell.is-collapsed .nav-group + .nav-group { margin-top: 7px; padding-top: 9px; border-top: 1px solid var(--border); }
.app-shell.is-collapsed .nav-item { justify-content: center; padding-right: 0; padding-left: 0; }
.app-shell.is-collapsed .sidebar-collapse-button svg { transform: rotate(180deg); }
.main-column { transition: margin-left .2s ease; }
.sidebar { transition: width .2s ease, padding .2s ease; }

.main-column { min-height: 100vh; margin-left: var(--sidebar-width); }
.topbar {
  position: sticky;
  z-index: 10;
  top: 0;
  display: flex;
  min-height: 52px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 10px 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.breadcrumb {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 9px;
  color: var(--text-muted);
  font-size: 12px;
  white-space: nowrap;
}
.breadcrumb-section {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  min-height: 25px;
  padding: 0 9px;
  color: var(--accent-strong);
  background: var(--accent-soft);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .045em;
  text-transform: uppercase;
}
.breadcrumb-separator { flex: 0 0 auto; color: var(--text-faint); font-size: 16px; line-height: 1; }
.breadcrumb-current { overflow: hidden; color: var(--text); font-size: 13px; font-weight: 650; text-overflow: ellipsis; }
.breadcrumb-detail { flex: 0 0 auto; color: var(--text-muted); font-size: 11px; }
.topbar-right { display: flex; flex: 0 1 auto; align-items: center; gap: 9px; }
.search-wrap { position: relative; width: min(300px, 35vw); flex: 0 1 auto; }
.global-search {
  display: flex;
  width: 100%;
  min-width: 0;
  height: 36px;
  align-items: center;
  gap: 9px;
  padding: 0 9px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.global-search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.global-search svg, .icon-button svg {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}
.global-search svg { color: var(--text-faint); }
.global-search input {
  width: 100%;
  min-width: 0;
  padding: 0;
  color: var(--text);
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 12px;
}
.global-search input::placeholder { color: var(--text-faint); }
.search-shortcut {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  cursor: pointer;
}
.search-shortcut:hover kbd { color: var(--accent-strong); border-color: var(--accent); }
.search-shortcut:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
kbd {
  padding: 1px 4px;
  color: var(--text-faint);
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 3px;
  font: 10px/1.5 ui-monospace, monospace;
  white-space: nowrap;
}
.icon-button {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  place-items: center;
  color: var(--text-muted);
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
}
.icon-button:hover { color: var(--text); border-color: var(--border); background: var(--surface); }
.topbar-logout { flex: 0 0 auto; margin: 0; }
.logout-button {
  display: inline-flex;
  width: auto;
  min-width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 11px;
  color: var(--accent-strong);
  border-color: var(--border);
  background: var(--surface-soft);
  font-size: 12px;
  font-weight: 650;
  white-space: nowrap;
}
.logout-button svg { width: 18px; height: 18px; }
.logout-button:hover { color: var(--accent-strong); border-color: var(--accent); background: var(--accent-soft); }
.logout-button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.menu-toggle {
  display: grid;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  place-items: center;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  cursor: pointer;
}
.menu-toggle:hover { color: var(--text); background: var(--surface-soft); }
.menu-toggle svg { width: 20px; height: 20px; }
.menu-toggle .sidebar-toggle-mobile { display: none; }
.menu-toggle .sidebar-toggle-arrow { transform-origin: 13.5px 12px; transition: transform .18s ease; }
.menu-toggle.is-collapsed .sidebar-toggle-arrow { transform: rotate(180deg); }
.search-results {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 30;
  width: min(460px, calc(100vw - 32px));
  max-height: min(70vh, 540px);
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow);
}
.search-results[hidden] { display: none; }
.search-group { border-bottom: 1px solid var(--border); }
.search-group:last-child { border-bottom: 0; }
.search-group-heading { display: flex; align-items: center; justify-content: space-between; padding: 9px 14px; color: var(--text-muted); background: var(--surface-soft); font-size: 11px; }
.search-group-heading strong span { color: var(--text-faint); font-weight: 500; }
.search-group-heading button { padding: 0; color: var(--accent-strong); border: 0; background: transparent; cursor: pointer; font-size: 11px; font-weight: 600; }
.search-group-heading button:hover { text-decoration: underline; }
.search-result {
  display: grid;
  width: 100%;
  gap: 3px;
  padding: 10px 14px;
  border: 0;
  border-bottom: 1px solid var(--border);
  background: transparent;
  cursor: pointer;
  text-align: left;
}
.search-result:last-child { border-bottom: 0; }
.search-result:hover { background: var(--surface-soft); }
.search-result-title { font-weight: 600; }
.search-result-meta { color: var(--text-muted); font-size: 11px; }
.search-empty { padding: 18px; color: var(--text-muted); font-size: 12px; }

main { width: 100%; max-width: 1280px; margin: 0 auto; padding: 22px 20px 60px; }
.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}
.eyebrow {
  margin: 0 0 6px;
  color: var(--accent-strong);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
}
h1, h2, h3, p { margin-top: 0; }
h1 {
  margin-bottom: 0;
  font: 600 clamp(26px, 3vw, 32px)/1.18 "Archivo", ui-sans-serif, sans-serif;
  letter-spacing: -.01em;
}
h2 {
  margin-bottom: 0;
  font: 600 17px/1.35 "Archivo", ui-sans-serif, sans-serif;
  letter-spacing: -.01em;
}
h3 { margin-bottom: 0; font-size: 13px; font-weight: 650; }
.page-description { max-width: 70ch; margin: 8px 0 0; color: var(--text-muted); font-size: 13px; }
.eyebrow + h1 + .page-description { margin-top: 7px; }
.page-action {
  display: inline-flex;
  min-height: 35px;
  align-items: center;
  gap: 7px;
  padding: 7px 11px;
  color: var(--accent-strong);
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
}
.page-action:hover { border-color: var(--accent); background: var(--accent-soft); }
.page-action svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.7; }

.notice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0 0 20px;
  padding: 13px 15px;
  color: var(--text-muted);
  background: var(--accent-soft);
  border: 1px solid var(--border);
  border-radius: 9px;
  font-size: 12px;
}
.notice strong { color: var(--text); }
.notice-icon {
  display: grid;
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  place-items: center;
  color: var(--accent-strong);
  border: 1px solid currentColor;
  border-radius: 50%;
  font: 700 11px/1 ui-sans-serif, sans-serif;
}

.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 23px; }
.metric-card {
  min-height: 120px;
  padding: 17px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--card-shadow);
}
.metric-top { display: flex; align-items: center; justify-content: space-between; color: var(--text-muted); font-size: 12px; }
.metric-value {
  display: block;
  margin-top: 13px;
  font: 600 28px/1 "Archivo", ui-sans-serif, sans-serif;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.035em;
}
.metric-note { display: block; margin-top: 6px; color: var(--text-faint); font-size: 11px; }
.metric-symbol {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  color: var(--accent-strong);
  background: var(--accent-soft);
  border-radius: 8px;
}
.metric-symbol svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.6; }

.content-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(260px, .9fr); gap: 16px; align-items: start; }
.regie-fact-group { margin-top: 22px; }
.regie-fact-group:first-of-type { margin-top: 0; }
.regie-fact-group > h2 { margin-bottom: 11px; color: var(--text-muted); font-size: 15px; }
.regie-fact-group .metric-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-bottom: 0; }
.panel {
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--card-shadow);
}
.panel-header { display: flex; min-height: 57px; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.panel-header p { margin: 3px 0 0; color: var(--text-muted); font-size: 12px; }
.panel-link { color: var(--accent-strong); font-size: 12px; font-weight: 600; text-decoration: none; white-space: nowrap; }
.panel-link:hover { text-decoration: underline; }
.dataset-list { display: grid; }
.dataset-row {
  display: flex;
  min-height: 55px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}
.dataset-row:last-child { border-bottom: 0; }
.dataset-row:hover { background: var(--surface-soft); }
.dataset-name { font-size: 13px; font-weight: 600; }
.dataset-detail { display: block; margin-top: 2px; color: var(--text-faint); font-size: 11px; }
.dataset-count { color: var(--text-muted); font: 500 12px ui-monospace, monospace; white-space: nowrap; }
.rule-list { display: grid; }
.rule-row { display: grid; grid-template-columns: 9px 1fr; gap: 10px; padding: 13px 16px; border-bottom: 1px solid var(--border); }
.rule-row:last-child { border-bottom: 0; }
.rule-indicator { width: 7px; height: 7px; margin-top: 6px; background: var(--warning); border-radius: 50%; }
.rule-row strong { display: block; font-size: 12px; }
.rule-row span { display: block; margin-top: 3px; color: var(--text-muted); font-size: 11px; line-height: 1.5; }
.catalog-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-items: start; }
.catalog-group { overflow: hidden; }
.catalog-row {
  display: flex;
  width: 100%;
  min-height: 54px;
  align-items: center;
  gap: 11px;
  padding: 9px 15px;
  border: 0;
  border-bottom: 1px solid var(--border);
  background: transparent;
  cursor: pointer;
  text-align: left;
}
.catalog-row:last-child { border-bottom: 0; }
.catalog-row:hover { background: var(--surface-soft); }
.catalog-icon { color: var(--accent-strong); }
.catalog-icon svg, .catalog-arrow { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.6; }
.catalog-label { display: grid; min-width: 0; gap: 1px; }
.catalog-label strong { font-size: 12px; font-weight: 600; }
.catalog-label small { color: var(--text-faint); font-size: 10px; }
.catalog-row .dataset-count { margin-left: auto; }
.catalog-arrow { color: var(--text-faint); }

.table-toolbar { display: flex; align-items: center; gap: 9px; padding: 13px 14px; border-bottom: 1px solid var(--border); }
.table-search {
  width: min(330px, 100%);
  height: 37px;
  padding: 0 10px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  outline: 0;
  font-size: 12px;
}
.table-search:focus, .table-filter:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.table-filter {
  max-width: 210px;
  height: 37px;
  padding: 0 28px 0 9px;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  outline: 0;
  font-size: 12px;
}
.result-count { margin-left: auto; color: var(--text-muted); font-size: 11px; white-space: nowrap; }
.table-wrap { width: 100%; overflow: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; }
thead th {
  position: sticky;
  z-index: 1;
  top: 0;
  padding: 12px 14px;
  color: var(--text-faint);
  background: var(--surface-soft);
  border-bottom: 1px solid var(--border);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .075em;
  text-transform: uppercase;
  white-space: nowrap;
}
thead th button {
  padding: 0;
  color: inherit;
  border: 0;
  background: transparent;
  cursor: pointer;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
}
thead th button:hover { color: var(--accent-strong); }
tbody tr { border-bottom: 1px solid var(--border); cursor: pointer; transition: background .12s ease; }
tbody tr:last-child { border-bottom: 0; }
tbody tr:hover { background: var(--surface-soft); }
tbody td { max-width: 300px; padding: 12px 14px; overflow: hidden; color: var(--text-muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
tbody td:first-child { color: var(--accent-strong); font: 500 11px ui-monospace, SFMono-Regular, Menlo, monospace; }
.table-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 51px; padding: 8px 14px; border-top: 1px solid var(--border); color: var(--text-muted); font-size: 11px; }
.pagination { display: flex; align-items: center; gap: 7px; }
.pagination button {
  min-width: 30px;
  height: 30px;
  padding: 0 7px;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface);
  cursor: pointer;
  font-size: 11px;
}
.pagination button:hover:not(:disabled) { color: var(--accent-strong); border-color: var(--accent); }
.pagination button:disabled { cursor: default; opacity: .45; }
.empty-table { padding: 36px 15px; color: var(--text-muted); text-align: center; }

.contract-directory { display: grid; gap: 16px; }
.contract-kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.contract-kpi {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  align-items: center;
  gap: 13px;
  min-height: 88px;
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--card-shadow);
}
.contract-kpi-signal { width: 9px; height: 9px; border-radius: 50%; background: var(--positive); }
.contract-kpi--terminated .contract-kpi-signal { background: var(--negative); }
.contract-kpi-label { display: block; color: var(--text-muted); font-size: 12px; font-weight: 600; }
.contract-kpi small { display: block; margin-top: 3px; color: var(--text-faint); font-size: 10px; }
.contract-kpi-value { color: var(--text); font: 650 30px/1 "Archivo", ui-sans-serif, sans-serif; font-variant-numeric: tabular-nums; }
.contract-search-panel { overflow: hidden; }
.contract-search-control { padding: 14px 16px 8px; }
.contract-search-panel .table-search { width: min(620px, 100%); height: 42px; }
.contract-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.contract-search-content { padding: 0 16px 14px; }
.contract-search-hint { margin: 0; padding: 8px 0 4px; color: var(--text-muted); font-size: 12px; }
.contract-search-results { max-height: 420px; overflow: auto; border-top: 1px solid var(--border); }
.contract-search-result {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 16px;
  min-height: 66px;
  padding: 11px 4px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}
.contract-search-result:last-child { border-bottom: 0; }
.contract-search-result:hover, .contract-search-result:focus-visible { background: var(--surface-soft); }
.contract-search-result:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: 6px; }
.contract-result-main { display: grid; min-width: 0; gap: 3px; }
.contract-result-main strong { overflow: hidden; color: var(--text); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.contract-result-main > span { color: var(--text-muted); font-size: 11px; }
.contract-result-details { display: flex; min-width: 0; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px; color: var(--text-muted); font-size: 10px; }
.contract-result-status { padding: 3px 8px; background: var(--surface-soft); border-radius: 999px; white-space: nowrap; }
.contract-result-status.is-active { color: var(--positive); background: var(--positive-soft); }
.contract-result-status.is-terminated { color: var(--negative); background: var(--negative-soft); }
.contract-search-open { display: inline-flex; justify-self: center; align-items: center; gap: 6px; padding: 7px 9px; color: var(--accent-strong); border: 1px solid var(--border); border-radius: 7px; background: var(--surface); font-size: 10px; font-weight: 700; white-space: nowrap; transition: border-color .15s ease, background .15s ease; }
.contract-search-open svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.contract-search-result:hover .contract-search-open, .contract-search-result:focus-visible .contract-search-open { border-color: var(--accent); background: var(--accent-soft); }
.contract-search-more { margin: 8px 0 0; color: var(--text-faint); font-size: 11px; text-align: right; }
.contract-distributions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.contract-distribution-panel { min-width: 0; overflow: hidden; }
.contract-new-contracts-panel { grid-column: 1 / -1; min-width: 0; overflow: hidden; }
.contract-donut-body { display: grid; grid-template-columns: 136px minmax(0, 1fr); align-items: center; gap: 16px; padding: 16px; }
.contract-donut-visual { position: relative; width: 136px; height: 136px; }
.contract-donut-svg { display: block; width: 136px; height: 136px; overflow: visible; }
.contract-donut-track, .contract-donut-arc { fill: none; stroke-width: 12; }
.contract-donut-track { stroke: var(--surface-soft); }
.contract-donut-arc { stroke: var(--contract-donut-tone); }
.contract-donut-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; pointer-events: none; text-align: center; }
.contract-donut-total { color: var(--text); font: 650 19px/1.1 "Archivo", ui-sans-serif, sans-serif; }
.contract-donut-caption { color: var(--text-faint); font: 10px/1.2 "IBM Plex Sans", ui-sans-serif, sans-serif; }
.contract-distribution-panel .panel-header { flex-wrap: nowrap; align-items: flex-start; }
.contract-distribution-panel .panel-header > div { flex: 1 1 auto; min-width: 0; }
.contract-distribution-panel .panel-header p { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.contract-new-contracts-heading { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.contract-simulation-badge { display: inline-flex; align-items: center; min-height: 20px; padding: 2px 7px; color: var(--warning); background: var(--warning-soft); border-radius: 999px; font-size: 9px; font-weight: 700; line-height: 1.2; white-space: nowrap; }
.contract-donut-city-control, .contract-new-contracts-year-control { display: flex; justify-content: flex-end; min-width: 0; pointer-events: auto; }
.contract-donut-city-control { flex: 0 0 150px; }
.contract-new-contracts-year-control { flex: 0 0 110px; }
.contract-donut-city-select, .contract-new-contracts-year-select { max-width: 100%; height: 34px; margin: 0; padding: 0 8px; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 6px; font: 600 11px/1 "IBM Plex Sans", ui-sans-serif, sans-serif; text-align: left; text-overflow: ellipsis; cursor: pointer; }
.contract-donut-city-select { width: 150px; }
.contract-new-contracts-year-select { width: 110px; }
.contract-donut-city-current { max-width: 170px; overflow: hidden; color: var(--text-muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.contract-monthly-chart { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); align-items: end; gap: 10px; padding: 18px 20px 14px; }
.contract-monthly-column { display: grid; grid-template-rows: 16px 112px auto; gap: 6px; min-width: 0; text-align: center; }
.contract-monthly-value { overflow: hidden; color: var(--text-muted); font-size: 11px; font-variant-numeric: tabular-nums; line-height: 14px; text-overflow: clip; white-space: nowrap; }
.contract-monthly-track { position: relative; display: block; height: 112px; overflow: hidden; background: var(--surface-soft); border-radius: 4px 4px 0 0; }
.contract-monthly-bar { position: absolute; right: 0; bottom: 0; left: 0; display: block; width: 100%; background: var(--accent); border-radius: 4px 4px 0 0; transition: height .18s ease; }
.contract-monthly-delta { position: absolute; left: 50%; overflow: hidden; max-width: 100%; font-size: 9px; font-variant-numeric: tabular-nums; line-height: 12px; text-overflow: clip; white-space: nowrap; transform: translateX(-50%); }
.contract-monthly-delta.is-positive { color: var(--positive); }
.contract-monthly-delta.is-negative { color: var(--negative); }
.contract-monthly-delta.is-neutral, .contract-monthly-delta.is-unavailable { color: var(--text-faint); }
.contract-monthly-label { overflow: hidden; color: var(--text-muted); font-size: 10px; line-height: 14px; text-overflow: clip; white-space: nowrap; }
.contract-monthly-note, .contract-monthly-empty { margin: 0; padding: 0 20px 14px; color: var(--text-faint); font-size: 11px; }
.contract-monthly-empty { padding: 22px 20px; }
.contract-premium-sheet { display: grid; gap: 16px; }
.contract-sheet-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; }
.contract-sheet-hero { overflow: hidden; padding: 22px 24px 0; border-top: 3px solid var(--accent); }
.contract-sheet-hero-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.contract-sheet-kicker { display: block; margin-bottom: 7px; color: var(--accent-strong); font-size: 10px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; }
.contract-sheet-hero h2 { font-size: clamp(21px, 2.4vw, 27px); }
.contract-sheet-holder { margin: 6px 0 0; color: var(--text); font-size: 14px; font-weight: 600; }
.contract-sheet-address { margin: 3px 0 0; color: var(--text-muted); font-size: 12px; }
.contract-sheet-status { flex: 0 0 auto; padding: 6px 11px; border-radius: 999px; background: var(--surface-soft); color: var(--text-muted); font-size: 11px; font-weight: 700; }
.contract-sheet-status.is-active { color: var(--positive); background: var(--positive-soft); }
.contract-sheet-status.is-terminated { color: var(--negative); background: var(--negative-soft); }
.contract-sheet-status.is-pending { color: var(--warning); background: var(--warning-soft); }
.contract-sheet-quickfacts { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0; margin-top: 20px; border-top: 1px solid var(--border); }
.contract-sheet-quickfact { display: grid; min-width: 0; gap: 5px; padding: 14px 16px 16px 0; }
.contract-sheet-quickfact + .contract-sheet-quickfact { padding-left: 16px; border-left: 1px solid var(--border); }
.contract-sheet-quickfact span { color: var(--text-faint); font-size: 10px; font-weight: 700; letter-spacing: .045em; text-transform: uppercase; }
.contract-sheet-quickfact strong { overflow: hidden; color: var(--text); font-size: 12px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.contract-premium-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(280px, .8fr); align-items: stretch; gap: 16px; }
.contract-sheet-field-groups { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.contract-sheet-field-group { min-width: 0; padding: 17px 18px; border-bottom: 1px solid var(--border); }
.contract-sheet-field-group:nth-child(odd) { border-right: 1px solid var(--border); }
.contract-sheet-field-group h3 { margin: 0 0 9px; color: var(--text-muted); font-size: 11px; letter-spacing: .045em; text-transform: uppercase; }
.contract-sheet-field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.contract-sheet-field { display: grid; min-width: 0; gap: 4px; padding: 9px 10px; background: var(--surface-muted); border-radius: 7px; }
.contract-sheet-field-label { color: var(--text-faint); font-size: 10px; font-weight: 650; }
.contract-sheet-field-value { overflow-wrap: anywhere; color: var(--text); font-size: 12px; font-weight: 550; }
.contract-sheet-field-value.is-mono { color: var(--accent-strong); font: 500 11px ui-monospace, SFMono-Regular, Menlo, monospace; }
.contract-sheet-related-list { padding: 4px 15px 10px; }
.contract-linked-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.contract-linked-row:last-child { border-bottom: 0; }
.contract-linked-row > div { display: grid; min-width: 0; gap: 3px; }
.contract-linked-row strong { overflow-wrap: anywhere; color: var(--text); font-size: 12px; font-weight: 650; }
.contract-linked-row span { color: var(--text-muted); font-size: 11px; }
.contract-linked-row button, .contract-linked-heading button { flex: 0 0 auto; padding: 5px 8px; color: var(--accent-strong); border: 1px solid var(--border); border-radius: 6px; background: var(--surface); cursor: pointer; font-size: 10px; font-weight: 600; }
.contract-linked-row button:hover, .contract-linked-heading button:hover { border-color: var(--accent); background: var(--accent-soft); }
.contract-linked-group { padding: 10px 0 4px; border-bottom: 1px solid var(--border); }
.contract-linked-group:last-child { border-bottom: 0; }
.contract-linked-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.contract-linked-heading strong { color: var(--text); font-size: 11px; }
.contract-linked-heading strong span { color: var(--text-faint); font-weight: 500; }
.contract-linked-heading button { margin-left: auto; }
.contract-sheet-consumption { overflow: hidden; }
.contract-consumption-summary { padding: 0 18px 14px; }
.contract-consumption-cmj { display: grid; gap: 3px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-muted); }
.contract-consumption-cmj > span { color: var(--text-faint); font-size: 10px; font-weight: 700; letter-spacing: .035em; text-transform: uppercase; }
.contract-consumption-cmj > strong { color: var(--accent-strong); font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }
.contract-consumption-cmj > small { color: var(--text-muted); font-size: 10px; }
.contract-consumption-cmj.is-unavailable > strong { color: var(--text-muted); font-size: 14px; }
.contract-consumption-chart { display: grid; grid-template-columns: repeat(var(--bar-count), minmax(0, 1fr)); align-items: end; gap: clamp(5px, 1vw, 12px); min-height: 150px; padding: 0 18px; }
.contract-consumption-column { display: grid; grid-template-rows: 16px minmax(82px, 1fr) auto; align-items: end; gap: 5px; min-width: 0; padding: 0; color: inherit; border: 0; background: transparent; font: inherit; text-align: center; cursor: pointer; }
.contract-consumption-column:hover .contract-consumption-bar, .contract-consumption-column.is-selected .contract-consumption-bar { background: var(--accent-strong); }
.contract-consumption-column:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 5px; }
.contract-consumption-value { overflow: hidden; color: var(--text-muted); font-size: 10px; font-variant-numeric: tabular-nums; text-overflow: ellipsis; white-space: nowrap; }
.contract-consumption-track { display: flex; align-items: end; justify-content: center; height: 100%; min-height: 82px; border-bottom: 1px solid var(--border); }
.contract-consumption-bar { width: min(52px, 76%); height: var(--bar-height); min-height: 2px; border-radius: 5px 5px 0 0; background: var(--accent); }
.contract-consumption-date { color: var(--text-faint); font-size: 9px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.contract-consumption-empty, .contract-consumption-method { margin: 0; padding: 12px 18px; color: var(--text-muted); font-size: 11px; }
.contract-consumption-method { padding-top: 10px; color: var(--text-faint); font-size: 10px; }
.point-kpi--meter .contract-kpi-signal { background: var(--accent); }
.point-search-control { display: flex; align-items: center; gap: 10px; }
.point-search-control .table-search { flex: 1 1 auto; width: auto; min-width: 0; }
.point-status-filter { flex: 0 0 190px; min-width: 0; }
.point-status-filter select {
  width: 100%;
  height: 42px;
  padding: 0 11px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 7px;
  font: 500 12px/1 "IBM Plex Sans", ui-sans-serif, sans-serif;
}
.contract-result-status.is-suspended, .contract-sheet-status.is-suspended {
  color: var(--warning);
  background: var(--warning-soft);
}
.point-status-active { --contract-donut-tone: var(--positive); }
.point-status-suspended { --contract-donut-tone: var(--warning); }
.point-status-terminated { --contract-donut-tone: var(--negative); }
.point-status-unknown { --contract-donut-tone: var(--text-faint); }
.point-usage-content { padding: 13px 18px 16px; }
.point-usage-list { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.point-usage-row { display: grid; grid-template-columns: minmax(105px, .8fr) minmax(80px, 1.6fr) auto; align-items: center; gap: 10px; }
.point-usage-row-label { display: flex; min-width: 0; align-items: center; justify-content: space-between; gap: 8px; color: var(--text-muted); font-size: 11px; }
.point-usage-row-label span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.point-usage-row-label strong { color: var(--text); font-variant-numeric: tabular-nums; }
.point-usage-track { height: 8px; overflow: hidden; background: var(--surface-soft); border-radius: 999px; }
.point-usage-track span { display: block; width: var(--point-usage-width); height: 100%; background: var(--accent); border-radius: inherit; }
.point-usage-row > small { min-width: 68px; color: var(--text-faint); font-size: 9px; text-align: right; white-space: nowrap; }
.point-usage-empty { margin: 0; color: var(--text-muted); font-size: 11px; }
.point-detail-hero-side { display: grid; justify-items: end; gap: 10px; }
.point-detail-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; }
.point-detail-actions .record-action { margin: 0; }
@media (max-width: 900px) {
  .contract-premium-grid { grid-template-columns: 1fr; }
}
@media (max-width: 650px) {
  .contract-sheet-actions { justify-content: flex-start; }
  .contract-sheet-hero { padding: 18px 16px 0; }
  .contract-sheet-hero-top { flex-direction: column; gap: 12px; }
  .contract-sheet-quickfacts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .contract-sheet-quickfact { padding-right: 10px; }
  .contract-sheet-quickfact + .contract-sheet-quickfact { padding-left: 10px; }
  .contract-sheet-quickfact:nth-child(odd) { padding-left: 0; border-left: 0; }
  .contract-sheet-quickfact:nth-child(n+3) { border-top: 1px solid var(--border); }
  .contract-sheet-field-groups { grid-template-columns: 1fr; }
  .contract-sheet-field-group:nth-child(odd) { border-right: 0; }
}
@media (max-width: 440px) {
  .contract-sheet-quickfact { padding: 12px 8px 12px 0; }
  .contract-sheet-quickfact + .contract-sheet-quickfact { padding-left: 8px; }
  .contract-sheet-field-grid { grid-template-columns: 1fr; }
  .contract-consumption-summary { padding: 0 12px 12px; }
  .contract-consumption-chart { gap: 4px; padding: 0 12px; }
  .contract-consumption-value { font-size: 9px; }
  .contract-consumption-date { font-size: 8px; }
}
.contract-donut-legend { display: grid; gap: 8px; min-width: 0; margin: 0; padding: 0; list-style: none; }
.contract-donut-legend-row { display: grid; grid-template-columns: 8px minmax(0, 1fr) auto; align-items: center; gap: 8px; min-width: 0; }
.contract-donut-swatch { width: 8px; height: 8px; border-radius: 50%; background: var(--contract-donut-tone); }
.contract-donut-label { overflow: hidden; color: var(--text); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.contract-donut-label small { display: block; margin-top: 1px; color: var(--text-faint); font-size: 9px; }
.contract-donut-legend-row > strong { color: var(--text-muted); font-size: 10px; font-variant-numeric: tabular-nums; }
.contract-donut-tone-0 { --contract-donut-tone: #705A86; }
.contract-donut-tone-1 { --contract-donut-tone: #3D7B76; }
.contract-donut-tone-2 { --contract-donut-tone: #A36F85; }
.contract-donut-tone-3 { --contract-donut-tone: #B06F52; }
.contract-donut-tone-4 { --contract-donut-tone: #75864F; }
.contract-donut-tone-5 { --contract-donut-tone: #526F91; }
.contract-donut-tone-6 { --contract-donut-tone: #897A68; }
.contract-donut-tone-7 { --contract-donut-tone: #81687B; }
.contract-donut-tone-8 { --contract-donut-tone: #5E828D; }
.contract-donut-usage-domestique { --contract-donut-tone: #57B4E5; }
.contract-donut-usage-industriel { --contract-donut-tone: #164B85; }

.detail-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: -4px 0 16px;
  padding: 0;
  color: var(--accent-strong);
  border: 0;
  background: transparent;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
}
.detail-back:hover { text-decoration: underline; }
.record-action { background: var(--accent-strong); color: white; border: 0; border-radius: 8px; padding: 10px 15px; cursor: pointer; font-weight: 650; }
.record-action:disabled { opacity: .55; cursor: wait; }
.comparison-panel { margin-top: 18px; }
.reference-context, .operations-context { margin-top: 16px; padding-bottom: 14px; }
.reference-context > p, .operations-context > p, .operations-context > h3 { margin: 12px 16px; }
.reference-context-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 330px), 1fr)); gap: 12px; padding: 14px; }
.reference-context-row { min-width: 0; padding: 12px; border: 1px solid var(--border); border-radius: 8px; }
.reference-context-record { display: grid; gap: 4px; }
.reference-context-record span, .reference-context-empty, .reference-context-note { color: var(--text-muted); font-size: 12px; }
.reference-context-links, .reference-context-history ul, .operations-context-list { list-style: none; margin: 0; padding: 10px 16px; }
.reference-context-links li, .reference-context-history li, .operations-context-list li { padding: 7px 0; border-bottom: 1px solid var(--border); overflow-wrap: anywhere; }
.reference-context-links li:last-child, .operations-context-list li:last-child { border-bottom: 0; }
.reference-context-links span, .operations-context-list span { margin-right: 8px; }
.reference-context button, .operations-context button { padding: 3px; color: var(--accent-strong); border: 0; background: none; cursor: pointer; text-align: left; }
.reference-context button:hover, .operations-context button:hover { text-decoration: underline; }
.reference-context-detail, .operations-context-links { display: grid; gap: 8px; }
.reference-context-detail .reference-context { margin-top: 0; }
.reference-context-detail { margin-top: 16px; }
.operations-context .notice { margin: 14px 16px; }
.operations-context-list li { display: grid; gap: 4px; }
.comparison-panel .notice { margin: 14px; }
.comparison-panel small, .invoice-document small { display: block; color: var(--text-muted); font-weight: 400; }
.comparison-panel .panel-link, .invoice-document .panel-link, .panel-link[data-issued-invoice] { background: none; border: 0; padding: 3px 0; cursor: pointer; text-align: left; }
.invoice-controls { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.invoice-document { max-width: 900px; margin: 0 auto; padding: clamp(20px, 5vw, 54px); color: #142b3d; background: white; border: 1px solid #cbd8e3; box-shadow: var(--shadow); }
.invoice-document h2 { font-size: 15px; margin: 0 0 10px; }
.invoice-document section { margin: 24px 0; }
.invoice-document .invoice-label { font-weight: 700; letter-spacing: .08em; font-size: 11px; color: #185f89; }
.invoice-head, .invoice-columns { display: flex; justify-content: space-between; gap: 24px; }
.invoice-head { padding: 20px 0; border-bottom: 2px solid #185f89; }
.invoice-head h1 { text-align: right; }
.invoice-head p { margin: 8px 0 0; }
.invoice-logo { width: 135px; max-width: 100%; }
.invoice-notice { padding: 12px; margin-top: 20px; background: #eaf3f9; border-left: 3px solid #185f89; }
.invoice-columns > section { width: 50%; }
.invoice-document table { width: 100%; border-collapse: collapse; }
.invoice-document th, .invoice-document td { padding: 9px 6px; border-bottom: 1px solid #d2dfeb; text-align: left; }
.invoice-document .invoice-totals { margin-left: auto; max-width: 360px; }
.invoice-totals dl { display: grid; grid-template-columns: 1fr auto; gap: 5px 18px; }
.invoice-totals dd { margin: 0; text-align: right; }
.invoice-document footer { border-top: 1px solid #d2dfeb; padding-top: 12px; font-size: 11px; }
@media (max-width: 600px) {
  .invoice-head, .invoice-columns { flex-direction: column; }
  .invoice-head h1 { text-align: left; }
  .invoice-columns > section { width: 100%; margin: 8px 0; }
}
@media print {
  body { background: #fff; }
  .sidebar, .topbar, .invoice-controls, .toast, .invoice-document .panel-link { display: none !important; }
  .main-column { margin: 0; }
  main { max-width: none; padding: 0; }
  main > :not(#page-content) { display: none !important; }
  .invoice-document { max-width: none; border: 0; box-shadow: none; padding: 12mm; }
  .invoice-document tr { break-inside: avoid; }
  .invoice-document section { break-inside: avoid; }
  #page-content > :not(.invoice-document) { display: none !important; }
}

/* v32 Facturation: one clear reading-to-lot workspace, with recorded pieces
   kept visually distinct from the supporting operational forms. */
.billing-v32-notice {
  display: flex; gap: 14px; align-items: flex-start; margin: 0 0 14px;
  padding: 14px 17px; color: var(--text-muted); background: var(--accent-soft);
  border: 1px solid var(--border-strong); border-left: 4px solid var(--accent);
  border-radius: 9px; font-size: 12px;
}
.billing-v32-notice strong { flex: 0 0 auto; color: var(--accent-strong); font-size: 13px; }
.billing-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 17px; }
.billing-workspace { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(250px, .72fr); gap: 15px; align-items: start; margin-bottom: 17px; }
.billing-lot-panel { overflow: hidden; }
.billing-lot-panel .panel-header { align-items: flex-start; padding: 17px 19px; }
.billing-lot-panel .panel-header .eyebrow, .billing-lot-card .eyebrow { margin: 0 0 4px; }
.billing-lot-panel .panel-header p:last-child { margin: 5px 0 0; color: var(--text-muted); font-size: 12px; }
.billing-step { flex: none; padding: 5px 9px; color: var(--accent-strong); background: var(--accent-soft); border-radius: 99px; font-size: 10px; font-weight: 700; }
.billing-preview-form { display: grid; grid-template-columns: minmax(0, 1fr) minmax(180px, .48fr); gap: 14px; align-items: end; padding: 17px 19px 19px; }
.billing-preview-form .record-field:first-child { grid-row: span 2; }
.billing-preview-form .record-field small { display: block; margin-top: 3px; color: var(--text-faint); font-weight: 400; }
.billing-preview-form .record-action { min-height: 40px; }
.billing-lot-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; margin: 0 17px 14px; border: 1px solid var(--border); border-radius: 9px; overflow: hidden; background: var(--border); }
.billing-lot-summary > div { display: grid; gap: 5px; padding: 12px; background: var(--surface-muted); }
.billing-lot-summary span, .billing-source-note span { color: var(--text-faint); font-size: 10px; text-transform: uppercase; letter-spacing: .05em; }
.billing-lot-summary strong { font: 600 16px/1.25 "Archivo", sans-serif; font-variant-numeric: tabular-nums; }
.billing-lot-panel > details, .billing-lot-panel > .record-form-footer { margin: 0 17px 10px; }
.billing-lot-panel > details { padding: 11px 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-muted); }
.billing-lot-panel > details summary { cursor: pointer; font-weight: 600; }
.billing-lot-panel > details ul { margin-bottom: 0; color: var(--text-muted); font-size: 12px; }
.billing-side { display: grid; gap: 13px; }
.billing-lot-card { overflow: hidden; }
.billing-lot-card .panel-header { min-height: 48px; padding: 11px 14px; }
.billing-mode-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 11px; margin: 0 0 15px; }
.billing-mode-card {
  display: grid; grid-template-columns: 34px minmax(0, 1fr); align-items: center; column-gap: 11px;
  min-height: 86px; padding: 14px; color: var(--text); text-align: left;
  border: 1px solid var(--border); border-radius: 11px; background: var(--surface);
  cursor: pointer; transition: border-color .14s ease, background .14s ease, transform .14s ease;
}
.billing-mode-card:hover { border-color: var(--accent); transform: translateY(-1px); }
.billing-mode-card.is-active { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.billing-mode-number {
  display: grid; place-items: center; grid-row: span 2; width: 34px; height: 34px;
  color: var(--accent-strong); border-radius: 10px; background: var(--surface);
  font: 700 12px/1 "Archivo", sans-serif;
}
.billing-mode-card strong { align-self: end; font-size: 13px; }
.billing-mode-card small { align-self: start; margin-top: 3px; color: var(--text-muted); font-size: 11px; }
.billing-main-flow { min-width: 0; }
.billing-flow-panel { overflow: hidden; }
.billing-flow-panel > .panel-header { padding: 17px 19px; }
.billing-flow-panel > .panel-header p:last-child { margin: 5px 0 0; color: var(--text-muted); font-size: 12px; }
.billing-unitary-form, .billing-credit-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; padding: 17px 19px 19px; }
.billing-unitary-form .record-field, .billing-credit-form .record-field { min-width: 0; }
.billing-unitary-controls { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; padding: 17px 19px 10px; }
.billing-unitary-point-row, .billing-unitary-period-row { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-items: stretch; }
.billing-client-match {
  display: flex; min-width: 0; flex-direction: column; justify-content: center; gap: 5px; padding: 13px 15px;
  border: 1px solid var(--border); border-radius: 10px; background: linear-gradient(135deg, var(--surface-muted), var(--surface));
}
.billing-client-match > span, .billing-period-days > span, .billing-unitary-meta span {
  color: var(--text-faint); font-size: 10px; font-weight: 650; letter-spacing: .06em; text-transform: uppercase;
}
.billing-client-match strong { color: var(--text); font: 600 15px/1.3 "Archivo", sans-serif; }
.billing-client-match strong.is-empty { color: var(--text-muted); font-size: 13px; font-weight: 550; line-height: 1.4; }
.billing-client-match small { color: var(--text-muted); font-size: 11px; line-height: 1.4; }
.billing-period-days {
  display: grid; align-content: center; gap: 5px; padding: 11px 14px; border: 1px solid var(--border-strong);
  border-radius: 9px; background: var(--accent-soft);
}
.billing-period-days strong { color: var(--accent-strong); font: 700 17px/1.2 "Archivo", sans-serif; font-variant-numeric: tabular-nums; }
.billing-period-days small { color: var(--text-muted); font-size: 10px; line-height: 1.35; }
.billing-price-ticket, .billing-credit-form > .record-field:nth-child(3),
.billing-credit-lines, .billing-credit-note, .billing-warsmann-note, .billing-unitary-form > button,
.billing-credit-form > button { grid-column: 1 / -1; }
.billing-price-ticket {
  display: grid; gap: 4px; padding: 12px 14px; border: 1px solid var(--border);
  border-radius: 9px; background: var(--surface-muted);
}
.billing-price-ticket > span { color: var(--text-faint); font-size: 10px; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; }
.billing-price-ticket strong { color: var(--text); font-size: 13px; }
.billing-price-ticket small, .billing-unitary-form .record-field small { color: var(--text-muted); font-size: 11px; }
.billing-preview-result { margin: 0 17px 17px; padding: 13px; border: 1px solid var(--border-strong); border-radius: 10px; background: var(--surface-muted); }
.billing-preview-result .billing-lot-summary { margin: 0 0 12px; }
.billing-preview-result > ul { color: var(--text-muted); font-size: 12px; }
.billing-preview-result > .record-action { margin-top: 4px; }
.billing-unitary-meta { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; margin: 0 0 12px; overflow: hidden; border: 1px solid var(--border); border-radius: 9px; background: var(--border); }
.billing-unitary-meta > div { display: grid; align-content: center; gap: 5px; min-width: 0; padding: 10px 12px; background: var(--surface); }
.billing-unitary-meta strong { overflow-wrap: anywhere; font: 600 12px/1.35 "Archivo", sans-serif; }
.billing-work-route { margin: 0 19px 19px; overflow: hidden; border: 1px solid var(--border-strong); border-radius: 12px; background: var(--surface); }
.billing-work-route-intro { display: grid; gap: 5px; padding: 15px 17px; border-bottom: 1px solid var(--border); background: var(--surface-muted); }
.billing-work-route-intro > span { color: var(--accent-strong); font-size: 10px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; }
.billing-work-route-intro > strong { color: var(--text); font: 650 15px/1.3 "Archivo", sans-serif; }
.billing-work-route-intro > small, .billing-work-tariffs { color: var(--text-muted); font-size: 11px; line-height: 1.5; }
.billing-work-tariffs { margin: 12px 16px 0; padding: 9px 11px; border: 1px solid var(--border); border-radius: 8px; }
.billing-work-tariffs summary { color: var(--text); cursor: pointer; font-weight: 650; }
.billing-work-lines { grid-column: 1 / -1; }
.billing-works-form { padding-top: 14px; }
.billing-credit-lines { min-width: 0; margin: 0; padding: 11px 13px 13px; border: 1px solid var(--border); border-radius: 9px; }
.billing-credit-lines legend { padding: 0 5px; color: var(--text); font-size: 12px; font-weight: 650; }
.billing-credit-line { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 9px 0; border-bottom: 1px solid var(--border); }
.billing-credit-line:last-of-type { border-bottom: 0; }
.billing-credit-line span { display: grid; gap: 3px; min-width: 0; }
.billing-credit-line strong { overflow: hidden; font-size: 12px; text-overflow: ellipsis; }
.billing-credit-line small { color: var(--text-muted); font-size: 10px; }
.billing-credit-line input { width: 125px; flex: 0 0 125px; }
.billing-credit-note, .billing-warsmann-note { margin: 0; color: var(--text-muted); font-size: 12px; }
.billing-warsmann-note { padding: 10px 12px; border-radius: 8px; background: var(--accent-soft); }

/* Operational demandes: compact service inbox with a horizontal state rail. */
.demande-queue-controls {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin: 0 0 13px; padding: 5px; background: var(--surface-soft);
  border: 1px solid var(--border); border-radius: 10px;
}
.demande-tabs { display: flex; gap: 4px; }
.demande-tabs button {
  min-height: 34px; padding: 7px 14px; color: var(--text-muted);
  border: 1px solid transparent; border-radius: 7px; background: transparent;
  cursor: pointer; font-size: 12px; font-weight: 600;
}
.demande-tabs button[aria-selected="true"] {
  color: var(--accent-strong); background: var(--surface); border-color: var(--border);
  box-shadow: 0 1px 2px rgb(10 30 46 / 5%);
}
.demande-queue-switches { display: flex; align-items: center; gap: 12px; padding-right: 5px; }
.demande-switch { display: inline-flex; align-items: center; gap: 7px; color: var(--text-muted); font-size: 11px; font-weight: 600; cursor: pointer; }
.demande-switch input { accent-color: var(--accent); }
.demande-queue-switches select {
  min-height: 31px; padding: 4px 25px 4px 9px; color: var(--text);
  border: 1px solid var(--border); border-radius: 7px; background: var(--surface); font-size: 11px;
}
.demande-pipeline {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 15px;
}
.demande-stage {
  display: grid; min-height: 86px; grid-template-columns: 1fr auto; grid-template-rows: auto 1fr;
  gap: 5px 8px; align-items: center; padding: 12px 14px; color: var(--text);
  border: 1px solid var(--border); border-top: 3px solid var(--border-strong);
  border-radius: 9px; background: var(--surface); cursor: pointer; text-align: left;
  transition: border-color .16s ease, background .16s ease, transform .16s ease;
}
.demande-stage:hover { transform: translateY(-1px); border-color: var(--accent); }
.demande-stage.is-active { background: var(--accent-soft); border-color: var(--accent); }
.demande-stage.recu { border-top-color: #5b83a0; }
.demande-stage.en_cours { border-top-color: var(--accent); }
.demande-stage.attente { border-top-color: var(--warning); }
.demande-stage.clos { border-top-color: var(--positive); }
.demande-stage-index { color: var(--text-faint); font: 500 10px "IBM Plex Mono", monospace; }
.demande-stage-label { grid-column: 1; color: var(--text-muted); font-size: 11px; font-weight: 600; }
.demande-stage strong { grid-column: 2; grid-row: 1 / span 2; color: var(--text); font: 600 25px/1 "Archivo", sans-serif; font-variant-numeric: tabular-nums; }
.demande-workspace { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(340px, .95fr); gap: 14px; align-items: start; }
.demande-list-panel, .demande-detail-panel { overflow: hidden; }
.demande-list-panel .panel-header { min-height: 66px; padding: 14px 17px; }
.demande-list-panel .panel-header .eyebrow { margin: 0 0 3px; }
.demande-total { color: var(--text-faint); font: 500 11px "IBM Plex Mono", monospace; white-space: nowrap; }
.demande-list { display: grid; }
.demande-row {
  display: grid; width: 100%; min-height: 67px; grid-template-columns: 8px minmax(0, 1fr) auto;
  gap: 0 11px; align-items: center; padding: 10px 15px; color: var(--text);
  border: 0; border-bottom: 1px solid var(--border); background: transparent;
  cursor: pointer; text-align: left; transition: background .14s ease;
}
.demande-row:last-child { border-bottom: 0; }
.demande-row:hover, .demande-row.is-selected { background: var(--surface-soft); }
.demande-row.is-selected { box-shadow: inset 3px 0 var(--accent); }
.demande-row-mark { width: 6px; height: 6px; grid-row: 1 / span 2; border-radius: 50%; background: #5b83a0; }
.demande-row-mark.en_cours { background: var(--accent); }
.demande-row-mark.attente { background: var(--warning); }
.demande-row-mark.clos { background: var(--positive); }
.demande-row-copy { display: grid; min-width: 0; gap: 3px; }
.demande-row-copy strong { overflow: hidden; color: var(--text); font-size: 12px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.demande-row-copy small { overflow: hidden; color: var(--text-faint); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.demande-row-status { justify-self: end; padding: 4px 7px; color: #496b82; background: #e7eff4; border-radius: 99px; font-size: 9px; font-weight: 700; white-space: nowrap; }
.demande-row-status.en_cours { color: var(--accent-strong); background: var(--accent-soft); }
.demande-row-status.attente { color: var(--warning); background: var(--warning-soft); }
.demande-row-status.clos { color: var(--positive); background: var(--positive-soft); }
.demande-row-date { grid-column: 2 / 4; margin-top: 4px; color: var(--text-faint); font-size: 10px; }
.demande-detail-inner { padding: 19px; }
.demande-detail-heading { padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.demande-detail-kicker { display: flex; align-items: center; gap: 9px; margin-bottom: 9px; }
.demande-id { color: var(--text-faint); font: 500 10px "IBM Plex Mono", monospace; }
.demande-detail-heading h2 { font-size: 19px; overflow-wrap: anywhere; }
.demande-detail-heading > p:last-child { margin: 6px 0 0; color: var(--text-muted); font-size: 11px; }
.demande-facts { display: flex; flex-wrap: wrap; gap: 20px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.demande-facts div { display: grid; gap: 4px; }
.demande-facts small, .demande-note small { color: var(--text-faint); font-size: 9px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; }
.demande-facts strong { color: var(--text-muted); font-size: 11px; font-weight: 600; }
.demande-description { padding: 15px 0 12px; }
.demande-description h3, .demande-actions h3, .demande-history h3 { margin-bottom: 7px; font-size: 11px; }
.demande-description p, .demande-note p { margin: 0; color: var(--text-muted); font-size: 12px; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }
.demande-note { margin: 0 0 10px; padding: 10px 12px; background: var(--surface-muted); border-left: 2px solid var(--warning); border-radius: 0 7px 7px 0; }
.demande-note p { margin-top: 4px; }
.demande-readonly-note { margin: 4px 0 12px; padding: 9px 11px; color: var(--text-muted); background: var(--surface-soft); border: 1px solid var(--border); border-radius: 7px; font-size: 10px; }
.demande-actions { padding: 13px 0 15px; border-top: 1px solid var(--border); }
.demande-actions form { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.demande-action-field { display: grid; gap: 5px; color: var(--text-faint); font-size: 10px; font-weight: 600; }
.demande-action-field input, .demande-action-field select {
  width: 100%; min-height: 34px; padding: 7px 9px; color: var(--text);
  border: 1px solid var(--border); border-radius: 7px; outline: 0; background: var(--surface); font-size: 11px;
}
.demande-action-field input:focus, .demande-action-field select:focus, .demande-form input:focus, .demande-form textarea:focus, .demande-form select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.demande-action-buttons { display: flex; grid-column: 1 / -1; flex-wrap: wrap; gap: 7px; padding-top: 2px; }
.demande-action-buttons .page-action, .demande-action-buttons .record-action { min-height: 32px; padding: 6px 10px; font-size: 10px; }
.demande-history { padding-top: 14px; border-top: 1px solid var(--border); }
.demande-history-head { display: flex; align-items: center; justify-content: space-between; }
.demande-history-head span { color: var(--text-faint); font-size: 10px; }
.demande-history ol { display: grid; gap: 0; margin: 5px 0 0; padding: 0; list-style: none; }
.demande-history li { position: relative; display: grid; grid-template-columns: 10px 1fr; gap: 9px; padding: 9px 0; }
.demande-history li:not(:last-child)::after { position: absolute; top: 17px; bottom: -5px; left: 3px; width: 1px; background: var(--border); content: ""; }
.demande-history-dot { z-index: 1; width: 7px; height: 7px; margin-top: 4px; background: var(--accent); border: 1px solid var(--surface); border-radius: 50%; }
.demande-history li strong { display: block; font-size: 10px; }
.demande-history li p { margin: 2px 0; color: var(--text-muted); font-size: 10px; }
.demande-history li small { color: var(--text-faint); font-size: 9px; }
.demande-history-empty { margin: 6px 0 0; color: var(--text-faint); font-size: 11px; }
.demande-detail-empty, .demande-empty { display: grid; justify-items: center; padding: 42px 20px; color: var(--text-muted); text-align: center; }
.demande-detail-emblem { display: grid; width: 38px; height: 38px; place-items: center; margin-bottom: 12px; color: var(--accent-strong); background: var(--accent-soft); border-radius: 10px; font: 600 16px "Archivo", sans-serif; }
.demande-detail-empty h2 { font-size: 15px; }
.demande-detail-empty p, .demande-empty p { max-width: 34ch; margin: 6px 0 0; color: var(--text-faint); font-size: 11px; }
.demande-empty { min-height: 220px; }
.demande-empty-rule { width: 28px; height: 2px; margin-bottom: 15px; background: var(--border-strong); }
.demande-empty strong { color: var(--text-muted); font-size: 12px; }
.demande-form { display: grid; gap: 13px; margin-top: 17px; }
.demande-form > label { display: grid; gap: 6px; color: var(--text-muted); font-size: 11px; font-weight: 600; }
.demande-form input, .demande-form select, .demande-form textarea {
  width: 100%; min-height: 37px; padding: 8px 10px; color: var(--text);
  border: 1px solid var(--border); border-radius: 7px; outline: 0; background: var(--surface); font-size: 12px;
}
.demande-form textarea { resize: vertical; }
.demande-form-actions { display: flex; justify-content: flex-end; gap: 8px; padding-top: 3px; }
.demande-optional { margin-left: 5px; color: var(--text-faint); font-size: 9px; font-weight: 400; }
.demande-form-error, .demande-inline-error { padding: 9px 11px; color: var(--negative); background: var(--negative-soft); border-radius: 7px; font-size: 11px; }
.demande-form-error { margin: 12px 0 0; }
.demande-inline-error { margin-bottom: 12px; }
.demande-inline-error button { margin-left: 6px; padding: 0; color: inherit; border: 0; background: transparent; cursor: pointer; font-weight: 700; text-decoration: underline; }
.demande-error { padding: 20px; }
.demande-error p { color: var(--text-muted); }
.demandes-skeleton, .demande-detail-skeleton { display: grid; gap: 10px; }
.demandes-skeleton { grid-template-columns: repeat(3, 1fr); }
.demandes-skeleton i, .demande-detail-skeleton i { display: block; height: 78px; border-radius: 9px; background: var(--surface-soft); animation: demande-pulse 1.4s ease-in-out infinite alternate; }
.demande-detail-skeleton { padding: 20px; }
.demande-detail-skeleton i { height: 24px; }
.demande-detail-skeleton i:first-child { height: 54px; }
@keyframes demande-pulse { to { opacity: .5; } }
@media (max-width: 900px) {
  .demande-workspace { grid-template-columns: 1fr; }
  .demande-detail-panel { min-height: 300px; }
}
@media (max-width: 620px) {
  .demande-queue-controls { align-items: stretch; flex-direction: column; }
  .demande-queue-switches { justify-content: space-between; padding: 0 6px 4px; }
  .demande-tabs button { flex: 1; }
  .demande-pipeline { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
  .demande-stage { min-height: 70px; padding: 10px; }
  .demande-row { grid-template-columns: 7px minmax(0, 1fr) auto; gap: 0 8px; padding: 10px; }
  .demande-row-status { font-size: 8px; }
  .demande-detail-inner { padding: 15px; }
  .demande-actions form { grid-template-columns: 1fr; }
  .demande-action-buttons { grid-column: 1; }
  .page-heading:has(.page-action) { align-items: flex-start; }
}

/* v32-style operational request list and case detail. */
.demande-summary-header {
  display: flex; align-items: center; justify-content: space-between;
  margin: 3px 0 10px;
}
.demande-summary-header h2 { margin: 0; font-size: 16px; }
.demande-kpis {
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px; margin-bottom: 13px;
}
.demande-kpis .demande-stage {
  min-height: 70px; grid-template-columns: 1fr auto; grid-template-rows: auto auto;
  gap: 3px 8px; padding: 10px 12px; border-top-width: 2px;
}
.demande-kpis .demande-stage-index { font-size: 9px; }
.demande-kpis .demande-stage-label { grid-row: 2; font-size: 10px; }
.demande-kpis .demande-stage strong {
  grid-row: 1 / span 2; font-size: 22px;
}
.demande-stage.all { border-top-color: var(--border-strong); }
.demande-toolbar { display: grid; grid-template-columns: minmax(0, 1fr) minmax(230px, 300px); gap: 10px; margin-bottom: 12px; }
.demande-toolbar .demande-queue-controls { min-width: 0; margin: 0; }
.demande-queue-controls { flex-wrap: wrap; }
.demande-queue-switches { flex-wrap: wrap; }
.demande-queue-switches select { max-width: 210px; }
.demande-search {
  display: flex; min-width: 0; align-items: center; gap: 8px; padding: 0 11px;
  border: 1px solid var(--border); border-radius: 9px; background: var(--surface);
}
.demande-search svg { width: 16px; height: 16px; flex: 0 0 auto; color: var(--text-faint); fill: none; stroke: currentColor; stroke-width: 1.8; }
.demande-search input {
  width: 100%; min-width: 0; height: 36px; padding: 0; color: var(--text);
  border: 0; outline: 0; background: transparent; font-size: 11px;
}
.demande-search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.demande-list-panel { overflow: hidden; }
.demande-table-wrap { overflow-x: auto; }
.demande-table { width: 100%; min-width: 760px; border-collapse: collapse; }
.demande-table th {
  padding: 11px 13px; color: var(--text-faint); border-bottom: 1px solid var(--border);
  background: var(--surface-soft); font-size: 9px; font-weight: 700; letter-spacing: .06em;
  text-align: left; text-transform: uppercase; white-space: nowrap;
}
.demande-table td { padding: 12px 13px; color: var(--text-muted); border-bottom: 1px solid var(--border); font-size: 11px; vertical-align: middle; }
.demande-table-row:last-child td { border-bottom: 0; }
.demande-table-row { cursor: pointer; }
.demande-table-row:hover { background: var(--surface-soft); }
.demande-table td > strong, .demande-table td > small { display: block; }
.demande-table td > strong { color: var(--text); font-size: 11px; }
.demande-table td > small, .demande-open-link small { margin-top: 3px; color: var(--text-faint); font-size: 9px; }
.demande-open-link {
  display: grid; gap: 2px; padding: 0; color: var(--accent-strong); border: 0;
  background: transparent; cursor: pointer; text-align: left;
}
.demande-open-link:hover strong { text-decoration: underline; }
.demande-client-id { color: var(--text); font: 500 10px "IBM Plex Mono", monospace; }
.demande-muted { color: var(--text-faint); font-size: 10px; }
.demande-progress-label { display: block; max-width: 220px; overflow: hidden; color: var(--text-muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.demande-progress {
  display: block; width: 100%; min-width: 55px; height: 4px; overflow: hidden;
  margin-top: 6px; border-radius: 99px; background: var(--surface-muted);
}
.demande-progress i { display: block; height: 100%; border-radius: inherit; background: var(--accent); }
.demande-create-panel { max-width: 830px; padding: 22px; }
.demande-create-form { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.demande-create-form > label:nth-of-type(n+3),
.demande-create-form .demande-form-hint,
.demande-create-form .demande-form-actions { grid-column: 1 / -1; }
.demande-form-hint { margin: -5px 0 0; color: var(--text-faint); font-size: 10px; line-height: 1.5; }
.demande-assignment-panel {
  display: grid; grid-column: 1 / -1; gap: 11px; padding: 13px;
  border: 1px solid var(--border); border-radius: 9px; background: var(--surface-soft);
}
.demande-assignment-panel > div > strong { color: var(--text); font-size: 11px; }
.demande-route-steps {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 7px; margin: 9px 0 0; padding: 0; list-style: none;
}
.demande-route-steps li {
  display: flex; min-width: 0; align-items: flex-start; gap: 7px; padding: 7px;
  border: 1px solid var(--border); border-radius: 7px; background: var(--surface);
}
.demande-route-steps li > span {
  display: grid; width: 18px; height: 18px; flex: 0 0 auto; place-items: center;
  border-radius: 50%; color: var(--accent-strong); background: var(--accent-soft);
  font-size: 9px; font-weight: 700;
}
.demande-route-steps li strong, .demande-route-steps li small { display: block; }
.demande-route-steps li strong { color: var(--text); font-size: 10px; }
.demande-route-steps li small { margin-top: 3px; color: var(--text-faint); font-size: 9px; }
.demande-assignment-toggle {
  position: relative; display: flex; width: fit-content; min-height: 34px;
  align-items: center; gap: 10px; color: var(--text); font-size: 10px;
  font-weight: 600; cursor: pointer;
}
.demande-assignment-toggle input {
  position: absolute; z-index: 1; top: 50%; left: 0; width: 38px; height: 22px; min-height: 22px;
  margin: 0; padding: 0; transform: translateY(-50%); opacity: 0; border: 0; cursor: inherit;
}
.demande-assignment-switch {
  position: relative; display: inline-flex; width: 38px; height: 22px; flex: 0 0 38px;
  align-items: center; border: 1px solid var(--border-strong); border-radius: 999px;
  background: var(--border-strong); transition: background .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.demande-assignment-switch > span {
  display: block; width: 16px; height: 16px; margin-left: 2px; border-radius: 50%;
  background: var(--surface); box-shadow: 0 1px 3px rgba(15, 35, 55, .24);
  transition: transform .18s ease;
}
.demande-assignment-toggle input:checked + .demande-assignment-switch {
  border-color: var(--accent); background: var(--accent);
}
.demande-assignment-toggle input:checked + .demande-assignment-switch > span { transform: translateX(16px); }
.demande-assignment-toggle input:focus-visible + .demande-assignment-switch {
  outline: 3px solid var(--accent-soft); outline-offset: 2px;
}
.demande-assignment-toggle input:disabled + .demande-assignment-switch { opacity: .45; }
.demande-assignment-toggle.is-disabled { cursor: not-allowed; opacity: .65; }
.demande-assignment-label { line-height: 1.4; }
.demande-assignment-field { display: grid; gap: 5px; color: var(--text-muted); font-size: 10px; font-weight: 600; }
.demande-assignment-field input, .demande-assignment-field select {
  width: 100%; min-height: 35px; padding: 7px 9px; color: var(--text);
  border: 1px solid var(--border); border-radius: 7px; outline: 0;
  background: var(--surface); font: inherit; font-size: 11px; font-weight: 400;
}
.demande-assignment-field input:focus, .demande-assignment-field select:focus {
  border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft);
}
.demande-contract-lookup { display: grid; grid-column: 1 / -1; gap: 8px; }
.demande-contract-lookup > label { color: var(--text-muted); font-size: 11px; font-weight: 600; }
.demande-contract-controls { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.demande-contract-controls .page-action { margin: 0; white-space: nowrap; }
.demande-contract-result { padding: 13px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface-soft); }
.demande-contract-result h3 { margin: 0 0 10px; color: var(--text); font-size: 12px; }
.demande-contract-clients { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 10px; }
.demande-contract-clients article { min-width: 0; padding: 10px; border: 1px solid var(--border); border-radius: 7px; background: var(--surface); }
.demande-contract-clients strong, .demande-contract-clients small { display: block; overflow-wrap: anywhere; }
.demande-contract-clients strong { color: var(--text); font-size: 11px; }
.demande-contract-clients small, .demande-contract-clients p { margin: 4px 0 0; color: var(--text-faint); font-size: 10px; overflow-wrap: anywhere; }
.demande-contract-message, .demande-contract-error { margin: 0; font-size: 10px; }
.demande-contract-message { color: var(--text-muted); }
.demande-contract-error { color: var(--negative); }
.demande-contract-number { color: var(--text); font: 600 10px "IBM Plex Mono", monospace; }
.demande-detail-page { padding: 21px; }
.demande-detail-topbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 16px; }
.demande-detail-heading {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 14px;
  padding-bottom: 16px; border-bottom: 1px solid var(--border);
}
.demande-detail-heading h2 { margin: 3px 0; color: var(--text); font-size: 20px; }
.demande-detail-heading p:last-child { margin: 4px 0 0; color: var(--text-muted); font-size: 11px; }
.demande-detail-overview {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px; padding: 15px 0; border-bottom: 1px solid var(--border);
}
.demande-detail-overview > div { display: grid; min-width: 0; gap: 4px; }
.demande-detail-overview small, .demande-case-facts dt {
  color: var(--text-faint); font-size: 9px; font-weight: 700; letter-spacing: .05em;
  text-transform: uppercase;
}
.demande-detail-overview strong { overflow-wrap: anywhere; color: var(--text-muted); font-size: 11px; }
.demande-current-step {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 7px 13px;
  align-items: end; padding: 14px 0;
}
.demande-current-step > div { display: grid; gap: 4px; }
.demande-current-step > div strong { color: var(--text); font-size: 12px; }
.demande-progress-value { color: var(--text-muted); font: 500 10px "IBM Plex Mono", monospace; }
.demande-current-step > .demande-progress { grid-column: 1 / -1; margin-top: 0; }
.demande-stage-flow {
  display: flex; gap: 0; overflow-x: auto; margin-bottom: 17px;
  padding: 12px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
}
.demande-flow-step {
  position: relative; display: grid; min-width: 155px; flex: 1 0 155px;
  grid-template-columns: 25px minmax(0, 1fr); gap: 8px; align-items: start; padding: 0 10px;
}
.demande-flow-step + .demande-flow-step::before {
  position: absolute; top: 11px; right: calc(100% - 8px); width: 16px; height: 1px;
  background: var(--border-strong); content: "";
}
.demande-flow-index {
  display: grid; width: 23px; height: 23px; place-items: center; color: var(--text-faint);
  border: 1px solid var(--border); border-radius: 50%; background: var(--surface); font-size: 10px;
}
.demande-flow-step.is-done .demande-flow-index, .demande-flow-step.is-current .demande-flow-index {
  color: #fff; border-color: var(--accent); background: var(--accent);
}
.demande-flow-step > div { display: grid; gap: 4px; }
.demande-flow-step strong { color: var(--text-muted); font-size: 10px; line-height: 1.4; }
.demande-flow-step.is-current strong { color: var(--accent-strong); }
.demande-flow-step small { color: var(--text-faint); font-size: 9px; line-height: 1.4; }
.demande-detail-columns { display: grid; grid-template-columns: minmax(0, 1fr) minmax(270px, 320px); gap: 19px; align-items: start; }
.demande-detail-main, .demande-detail-side { display: grid; min-width: 0; gap: 15px; }
.demande-description h2, .demande-history h2, .demande-actions h2, .demande-case-facts h2 { margin: 0 0 8px; font-size: 12px; }
.demande-description p, .demande-note p { margin: 0; color: var(--text-muted); font-size: 11px; line-height: 1.65; white-space: pre-wrap; overflow-wrap: anywhere; }
.demande-history { padding-top: 14px; border-top: 1px solid var(--border); }
.demande-history-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.demande-history-head span { color: var(--text-faint); font-size: 10px; }
.demande-history ol { display: grid; gap: 0; margin: 8px 0 0; padding: 0; list-style: none; }
.demande-history li { display: grid; grid-template-columns: 80px minmax(0, 1fr); gap: 11px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.demande-history li:last-child { border-bottom: 0; }
.demande-history time { color: var(--text-faint); font-size: 9px; }
.demande-history li strong { color: var(--text); font-size: 10px; }
.demande-history li p { margin: 3px 0; color: var(--text-muted); font-size: 10px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.demande-history li small { color: var(--text-faint); font-size: 9px; }
.demande-history-empty { margin: 6px 0 0; color: var(--text-faint); font-size: 11px; }
.demande-case-facts { padding: 14px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface-soft); }
.demande-case-facts dl { display: grid; grid-template-columns: minmax(65px, .7fr) minmax(0, 1.3fr); gap: 8px; margin: 0; }
.demande-case-facts dd { margin: 0; color: var(--text); font-size: 10px; overflow-wrap: anywhere; }
.demande-note { margin: 0; padding: 10px 12px; border-left: 2px solid var(--warning); border-radius: 0 7px 7px 0; background: var(--surface-muted); }
.demande-note small { color: var(--text-faint); font-size: 9px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.demande-note p { margin-top: 4px; }
.demande-next-stage { grid-column: 1 / -1; margin: 0; color: var(--text-muted); font-size: 10px; }
.demande-next-stage .demande-action-field { margin-top: 9px; }
.demande-actions { padding-top: 14px; border-top: 1px solid var(--border); }
.demande-actions form { display: grid; grid-template-columns: minmax(0, 1fr); gap: 9px; }
.demande-actions .demande-action-field { display: grid; gap: 5px; color: var(--text-faint); font-size: 10px; font-weight: 600; }
.demande-action-field input, .demande-action-field select, .demande-action-field textarea {
  width: 100%; min-height: 34px; padding: 7px 9px; color: var(--text);
  border: 1px solid var(--border); border-radius: 7px; outline: 0;
  background: var(--surface); font: inherit; font-size: 11px; font-weight: 400;
}
.demande-action-field textarea { resize: vertical; line-height: 1.45; }
.demande-action-field input:focus, .demande-action-field select:focus, .demande-action-field textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.demande-action-buttons { display: flex; flex-wrap: wrap; gap: 7px; padding-top: 3px; }
.demande-action-buttons .page-action, .demande-action-buttons .record-action { min-height: 33px; padding: 6px 10px; font-size: 10px; }
.demande-detail-empty { display: grid; justify-items: center; padding: 42px 20px; color: var(--text-muted); text-align: center; }
.demande-detail-empty h2 { font-size: 15px; }
.demande-detail-empty p { max-width: 34ch; margin: 6px 0 0; color: var(--text-faint); font-size: 11px; }
.demande-form-hint { margin: -5px 0 0; color: var(--text-faint); font-size: 10px; line-height: 1.5; }
@media (max-width: 1050px) {
  .demande-toolbar { grid-template-columns: 1fr; }
  .demande-detail-columns { grid-template-columns: minmax(0, 1fr); }
  .demande-detail-side { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
  .demande-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
  .demande-kpis .demande-stage:first-child { grid-column: 1 / -1; }
  .demande-queue-controls { align-items: stretch; flex-direction: column; }
  .demande-queue-switches { justify-content: flex-start; padding: 0 5px 4px; }
  .demande-detail-page { padding: 14px; }
  .demande-detail-overview { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .demande-detail-side { grid-template-columns: minmax(0, 1fr); }
  .demande-detail-topbar { align-items: flex-start; flex-direction: column; }
  .demande-create-panel { padding: 15px; }
  .demande-create-form { grid-template-columns: minmax(0, 1fr); }
  .demande-create-form > label, .demande-create-form > label:nth-of-type(n+3),
  .demande-create-form .demande-form-hint, .demande-create-form .demande-form-actions,
  .demande-create-form .demande-contract-lookup { grid-column: 1; }
  .demande-contract-controls { grid-template-columns: minmax(0, 1fr); }
  .demande-contract-controls .page-action { justify-self: start; }
  .demande-history li { grid-template-columns: 62px minmax(0, 1fr); gap: 8px; }
}
@media (max-width: 620px) {
  .billing-mode-cards { grid-template-columns: minmax(0, 1fr); gap: 7px; }
  .billing-mode-card { min-height: 70px; }
  .billing-unitary-form, .billing-credit-form { grid-template-columns: minmax(0, 1fr); padding: 14px; }
  .billing-unitary-controls { grid-template-columns: minmax(0, 1fr); padding: 14px 14px 9px; }
  .billing-unitary-point-row, .billing-unitary-period-row { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .billing-unitary-meta { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .billing-work-route { margin: 0 14px 14px; }
  .billing-work-lines { grid-column: 1; }
  .billing-price-ticket, .billing-credit-form > .record-field:nth-child(3),
  .billing-credit-lines, .billing-credit-note, .billing-warsmann-note, .billing-unitary-form > button,
  .billing-credit-form > button { grid-column: 1; }
  .billing-credit-line { align-items: flex-start; flex-direction: column; gap: 7px; }
  .billing-credit-line input { width: 100%; flex-basis: auto; }
  .billing-preview-result { margin: 0 10px 12px; padding: 10px; }
}
.billing-source-note { display: grid; gap: 4px; padding: 13px 15px; border-bottom: 1px solid var(--border); }
.billing-source-note b { font-size: 12px; }
.billing-counts { display: grid; grid-template-columns: repeat(3, 1fr); }
.billing-counts > div { display: grid; gap: 2px; padding: 12px 8px; text-align: center; border-right: 1px solid var(--border); }
.billing-counts > div:last-child { border-right: 0; }
.billing-counts strong { font: 600 19px/1 "Archivo", sans-serif; font-variant-numeric: tabular-nums; }
.billing-counts span { color: var(--text-faint); font-size: 10px; }
.billing-guidance { margin: 0; padding: 8px 17px 13px 31px; color: var(--text-muted); font-size: 11px; }
.billing-guidance li { padding: 4px 0; }
.billing-issued-panel { margin-bottom: 16px; }
.billing-issued-panel .panel-header { align-items: center; }
.billing-issued-panel .panel-header .eyebrow { margin: 0 0 2px; }
.billing-issued-panel .panel-header p:last-child { margin: 4px 0 0; color: var(--text-muted); font-size: 11px; }
.billing-lots-list { padding: 12px 18px 18px; }
.billing-lot-entry { border: 1px solid var(--border); border-radius: 8px; margin-bottom: 8px; }
.billing-lot-entry summary { display: flex; flex-wrap: wrap; gap: 8px 18px; justify-content: space-between; padding: 13px 15px; cursor: pointer; }
.billing-lot-entry summary span { color: var(--text-muted); font-size: 12px; }
.billing-lot-detail { border-top: 1px solid var(--border); padding: 12px 15px; }
.billing-lot-detail .related-item { border-top: 1px solid var(--border); }
.billing-secondary { margin: 0 0 17px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-muted); }
.billing-secondary > summary { padding: 13px 16px; cursor: pointer; color: var(--accent-strong); font-size: 12px; font-weight: 650; }
.billing-secondary-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; padding: 0 13px 13px; }
.billing-secondary-grid > .panel { min-width: 0; }

/* Printable v32-inspired invoice: A4 sheets with natural content height, so
   long line tables continue instead of colliding with a pinned footer. */
.invoice-document { max-width: 900px; padding: 0; overflow: visible; background: #eef3f5; }
.invoice-document .invoice-page {
  box-sizing: border-box; position: relative; display: flex; flex-direction: column;
  width: 100%; min-height: 1120px;
  margin: 0 auto 15px; padding: 35px 42px 34px; color: #193447; background: #fff;
  border-bottom: 1px solid #d6e0e5;
}
.invoice-document .invoice-page h2 { margin: 17px 0 8px; color: #174c6b; font: 600 13px/1.3 "Archivo", sans-serif; }
.invoice-document .invoice-page section { margin: 14px 0; }
.invoice-document .invoice-label { display: inline-flex; padding: 5px 9px; border-radius: 4px; color: #164f70; background: #e1f0f7; font-size: 9px; font-weight: 700; letter-spacing: .055em; }
.invoice-document.is-demo .invoice-label { color: #7a4710; background: #f8e9cc; }
.invoice-document .invoice-head { display: flex; align-items: center; gap: 22px; min-height: 110px; padding: 18px 0; border-bottom: 2px solid #1b789f; }
.invoice-document .invoice-brand { display: flex; flex: 1 1 52%; align-items: flex-start; gap: 14px; min-width: 0; }
.invoice-document .invoice-brand > div { min-width: 0; }
.invoice-document .invoice-brand strong { display: block; color: #164e6b; font: 700 17px/1.2 "Archivo", sans-serif; }
.invoice-document .invoice-brand p { margin: 5px 0; color: #577181; font-size: 10px; }
.invoice-document .invoice-brand span { font-size: 9px; }
.invoice-document .invoice-logo { flex: 0 0 auto; width: 86px; max-height: 58px; object-fit: contain; }
.invoice-document .invoice-title { flex: 0 0 44%; min-width: 0; text-align: right; }
.invoice-document .invoice-title h1 { margin: 0 0 9px; color: #164e6b; text-transform: uppercase; font: 700 19px/1.25 "Archivo", sans-serif; }
.invoice-document .invoice-title > p { margin: 7px 0 0; color: #577181; font-size: 10px; }
.invoice-contract { display: inline-grid; gap: 4px; min-width: 145px; padding: 7px 10px; border: 1px solid #b9ced8; border-radius: 4px; text-align: left; }
.invoice-contract span { color: #577181; font-size: 8px; }
.invoice-contract b { color: #164e6b; font-size: 12px; }
.invoice-document .invoice-notice { margin-top: 11px; padding: 8px 10px; font-size: 9px; }
.invoice-demo-stamp { margin: 9px 0; padding: 7px 10px; border: 1px dashed #a66b18; color: #814f10; font-size: 9px; font-weight: 700; text-align: center; letter-spacing: .08em; }
.invoice-document .invoice-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; margin: 12px 0; }
.invoice-document .invoice-columns > section { min-width: 0; margin: 0; padding: 11px; border: 1px solid #d7e2e8; border-radius: 5px; overflow-wrap: anywhere; }
.invoice-document .invoice-columns h2 { margin: 0 0 7px; }
.invoice-document .invoice-columns p { margin: 6px 0; font-size: 10px; }
.invoice-document .invoice-recipient > strong { font-size: 13px; }
.invoice-source-tag { color: #5c7482; font-size: 9px; }
.invoice-unavailable { display: inline-block; margin: 3px 0; padding: 5px 7px; color: #735623; background: #fbf4e7; font-size: 8px; overflow-wrap: anywhere; }
.invoice-amount-highlight { display: grid; grid-template-columns: minmax(180px, .72fr) minmax(0, 1.28fr); gap: 16px; align-items: center; padding: 13px 15px; border: 1px solid #c5d7df; border-left: 4px solid #1b789f; background: #f4f8fa; }
.invoice-amount-highlight > div:first-child > span { display: block; color: #577181; font-size: 9px; font-weight: 700; text-transform: uppercase; }
.invoice-amount-highlight > div:first-child > strong { display: block; margin-top: 5px; color: #124d69; font: 700 23px/1.2 "Archivo", sans-serif; font-variant-numeric: tabular-nums; }
.invoice-amount-highlight > div:first-child > strong small { font-size: 11px; }
.invoice-amount-highlight > div:first-child > p { margin: 6px 0 0; color: #577181; font-size: 9px; }
.invoice-document .invoice-simple-breakdown h2 { margin: 0 0 6px; font-size: 10px; }
.invoice-simple-line { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; border-bottom: 1px solid #dde6ea; font-size: 9px; }
.invoice-simple-line span { min-width: 0; }
.invoice-simple-line strong { flex: 0 0 auto; font-variant-numeric: tabular-nums; }
.invoice-document .invoice-totals { max-width: 370px; margin: 11px 0 11px auto; padding: 9px 12px; border: 1px solid #d7e2e8; border-radius: 5px; }
.invoice-document .invoice-totals h2 { margin: 0 0 7px; }
.invoice-document .invoice-totals dl { gap: 3px 15px; margin: 0; font-size: 10px; }
.invoice-document .invoice-totals dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.invoice-document .invoice-totals dt small { margin: 1px 0 3px; font-size: 8px; }
.invoice-payment-summary { padding: 9px 12px; border-left: 3px solid #74a9bf; background: #f0f6f8; }
.invoice-payment-summary h2 { margin: 0 0 6px !important; }
.invoice-payment-summary p { margin: 4px 0; font-size: 9px; }
.invoice-head-min { display: flex; justify-content: space-between; gap: 15px; margin-bottom: 15px; padding: 0 0 9px; border-bottom: 1px solid #b8cbd5; color: #526d7d; font-size: 9px; }
.invoice-head-min strong { color: #164e6b; }
.invoice-document .invoice-page-two > h2 { margin-top: 14px; }
.invoice-tech-grid, .invoice-source-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 9px 0 14px; border: 1px solid #d7e2e8; }
.invoice-tech-grid { grid-auto-flow: row; }
.invoice-tech-grid > div, .invoice-source-grid > p { display: grid; gap: 3px; min-width: 0; margin: 0; padding: 8px 9px; border-bottom: 1px solid #d7e2e8; font-size: 9px; overflow-wrap: anywhere; }
.invoice-tech-grid > div:nth-child(odd), .invoice-source-grid > p:nth-child(odd) { border-right: 1px solid #d7e2e8; }
.invoice-tech-grid span, .invoice-source-grid b { color: #637d8b; font-size: 8px; text-transform: uppercase; letter-spacing: .04em; }
.invoice-tech-grid b, .invoice-source-grid span { font-weight: 500; }
.invoice-document .invoice-lines { margin: 10px 0; overflow: visible; }
.invoice-document .invoice-lines table { width: 100%; table-layout: fixed; border-collapse: collapse; font-size: 8px; }
.invoice-document .invoice-lines th { color: #36586b; background: #edf4f7; font-size: 7px; font-weight: 700; }
.invoice-document .invoice-lines th, .invoice-document .invoice-lines td { padding: 5px 4px; border: 1px solid #dce5e9; vertical-align: top; overflow-wrap: anywhere; }
.invoice-document .invoice-lines small { font-size: 7px; }
.invoice-legal-note { margin: 12px 0; padding: 9px 11px; border-left: 3px solid #bd8a39; background: #fbf5e9; color: #675635; font-size: 8px; }
.invoice-document .invoice-page footer { display: flex; justify-content: space-between; gap: 12px; margin-top: auto; padding-top: 8px; color: #55707f; font-size: 8px; border-top: 1px solid #d5e0e5; }
@media (max-width: 760px) {
  .billing-workspace { grid-template-columns: minmax(0, 1fr); }
  .billing-side { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .billing-secondary-grid { grid-template-columns: minmax(0, 1fr); }
  .invoice-document .invoice-page { min-height: auto; padding: 24px 20px; }
}
@media (max-width: 540px) {
  .invoice-document .invoice-head { align-items: flex-start; flex-direction: column; gap: 11px; }
  .invoice-document .invoice-brand { width: 100%; }
  .invoice-document .invoice-title { width: 100%; text-align: left; }
  .invoice-document .invoice-title h1, .invoice-document .invoice-title > p { text-align: left; }
  .invoice-document .invoice-columns, .invoice-document .invoice-amount-highlight,
  .invoice-tech-grid, .invoice-source-grid { grid-template-columns: minmax(0, 1fr); }
  .invoice-document .invoice-columns > section { width: auto; }
  .invoice-tech-grid > div:nth-child(odd), .invoice-source-grid > p:nth-child(odd) { border-right: 0; }
}
@media print {
  @page { size: A4; margin: 0; }
  body { background: #fff; }
  .sidebar, .topbar, .invoice-controls, .toast, .invoice-document .panel-link { display: none !important; }
  .main-column { margin: 0; }
  main { max-width: none; padding: 0; }
  main > :not(#page-content), #page-content > :not(.invoice-document) { display: none !important; }
  .invoice-document { width: 210mm; max-width: none; margin: 0; overflow: visible; background: #fff; border: 0; box-shadow: none; }
  .invoice-document .invoice-page {
    width: 210mm; min-height: 297mm; max-height: none; margin: 0; padding: 10mm 12mm;
    overflow: visible; border: 0; box-shadow: none; break-after: page; page-break-after: always;
  }
  .invoice-document .invoice-page:last-child { break-after: auto; page-break-after: auto; }
  .invoice-document .invoice-page footer { break-inside: avoid; page-break-inside: avoid; }
  .invoice-document .invoice-lines tr { break-inside: avoid; page-break-inside: avoid; }
  .invoice-document .invoice-lines { overflow: visible; }
  .invoice-document .invoice-payment-summary, .invoice-document .invoice-amount-highlight,
  .invoice-document .invoice-columns > section, .invoice-document .invoice-tech-grid > div {
    break-inside: avoid; page-break-inside: avoid;
  }
  .invoice-document .invoice-page-two { break-before: page; page-break-before: always; }
  .invoice-document .invoice-notice, .invoice-document .invoice-label { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
}
.record-editor { padding: 20px; }
.point-edit-code-panel { max-width: 560px; padding: 20px; }
.point-edit-code-card { display: flex; flex-direction: column; align-items: center; gap: 8px; margin-bottom: 20px; padding: 18px; border: 1px solid var(--border); border-radius: 8px; }
.point-edit-code-card > span { color: var(--text-muted); font-size: 12px; font-weight: 600; }
.point-edit-code-card strong { color: var(--text); font: 700 28px ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .14em; }
.point-edit-code-card small { color: var(--text-faint); font-size: 11px; }
#point-edit-code-input { text-transform: uppercase; letter-spacing: .08em; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.point-edit-code-error { margin: 8px 0 0; color: #a12727; font-weight: 600; }
.record-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.record-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; color: var(--text-muted); font-size: 12px; }
.record-field input, .record-field select { width: 100%; box-sizing: border-box; padding: 10px; border: 1px solid var(--border); border-radius: 7px; background: var(--surface); color: var(--text); }
.record-field input[readonly] { opacity: .65; }
.record-form-footer { margin-top: 20px; display: flex; align-items: center; gap: 20px; }
#form-error { color: #a12727; font-weight: 600; }
.record-history { margin-top: 18px; padding: 18px; }
.record-history h2 { font-size: 16px; }
.record-history details { border-top: 1px solid var(--border); padding: 12px 0; }
.record-history summary { cursor: pointer; }
.record-history dl { display: grid; grid-template-columns: 170px 1fr; gap: 7px; font-size: 12px; overflow-wrap: anywhere; }
.record-history dt { font-weight: 600; }
.detail-layout { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(240px, .8fr); gap: 16px; align-items: start; }
.detail-card { overflow: hidden; }
.detail-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.detail-field { min-width: 0; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.detail-field:nth-child(odd) { border-right: 1px solid var(--border); }
.detail-field-label { display: block; margin-bottom: 6px; color: var(--text-faint); font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.detail-field-value { display: block; overflow-wrap: anywhere; color: var(--text); font-size: 13px; }
.detail-field-value.mono { color: var(--accent-strong); font: 500 12px ui-monospace, SFMono-Regular, Menlo, monospace; }
.related-list { display: grid; }
.related-group { border-top: 1px solid var(--border); }
.related-group:first-child { border-top: 0; }
.related-group-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 11px 14px; background: var(--surface-soft); }
.related-group-heading strong { font-size: 12px; }
.related-group-heading strong span { color: var(--text-faint); font-weight: 500; }
.related-group-heading button { padding: 0; color: var(--accent-strong); border: 0; background: transparent; cursor: pointer; font-size: 11px; font-weight: 600; }
.related-group-heading button:hover { text-decoration: underline; }
.related-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 14px; border-bottom: 1px solid var(--border); }
.related-item:last-child { border-bottom: 0; }
.related-item strong { display: block; font-size: 11px; }
.related-item span { display: block; margin-top: 2px; color: var(--text-muted); font-size: 11px; }
.related-item button { padding: 6px 9px; color: var(--accent-strong); border: 1px solid var(--border); border-radius: 7px; background: var(--surface); cursor: pointer; font-size: 11px; white-space: nowrap; }
.related-item button:hover { border-color: var(--accent); background: var(--accent-soft); }
.no-related { padding: 15px; color: var(--text-muted); font-size: 12px; }
.client-detail-layout { grid-template-columns: minmax(0, 1.12fr) minmax(290px, .88fr); }
.client-detail-layout .panel-header { align-items: flex-start; }
.client-field-groups { padding: 4px 14px 12px; }
.client-field-section { padding: 13px 0 5px; border-bottom: 1px solid var(--border); }
.client-field-section:last-of-type { border-bottom: 0; }
.client-field-section > h3 { margin: 0 2px 5px; color: var(--accent-strong); font-size: 10px; font-weight: 700; letter-spacing: .075em; text-transform: uppercase; }
.client-field-section .detail-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.client-field-section .detail-field { padding: 8px 9px; border: 0; }
.client-field-section .detail-field-label { margin-bottom: 3px; font-size: 9px; }
.client-field-section .detail-field-value { font-size: 12px; }
.client-empty-fields { border-top: 1px solid var(--border); padding: 11px 2px 2px; }
.client-empty-fields summary { display: flex; align-items: center; gap: 8px; color: var(--text-muted); cursor: pointer; font-size: 11px; font-weight: 600; list-style-position: inside; }
.client-empty-fields summary span { color: var(--text-faint); font: 11px ui-monospace, SFMono-Regular, Menlo, monospace; }
.client-empty-fields .detail-fields { margin-top: 8px; }
.client-empty-fields .detail-field { padding: 8px 9px; border: 0; }
.client-relations .related-group-heading { align-items: flex-start; padding: 10px 14px; }
.client-relations .related-group-heading > div { min-width: 0; }
.client-relations .related-group-heading strong { display: block; }
.client-relations .related-group-heading strong span { margin-left: 4px; }
.client-relations .related-group-heading small { display: block; margin-top: 3px; color: var(--text-muted); font-size: 10px; line-height: 1.4; }
.client-relations .related-item { padding: 10px 14px; }

.rules-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.rule-card { padding: 19px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--card-shadow); }
.metric-card, .content-grid > .panel:last-child, .rule-card { box-shadow: var(--raised-shadow); }
.rule-card p { margin: 8px 0 0; color: var(--text-muted); font-size: 12px; }
.rule-card .rule-value { margin-top: 14px; color: var(--accent-strong); font: 650 24px/1 ui-sans-serif, system-ui, sans-serif; }
.rule-emphasis { border-left: 2px solid var(--accent); }
.document-links { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 16px; }

.loading-state { display: grid; min-height: 300px; place-content: center; justify-items: center; gap: 12px; color: var(--text-muted); font-size: 12px; }
.loading-state p { margin: 0; }
.loader { width: 22px; height: 22px; border: 2px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.error-state { max-width: 620px; margin: 12vh auto; padding: 22px; background: var(--surface); border: 1px solid var(--negative); border-radius: 10px; }
.error-state p { margin: 9px 0 0; color: var(--text-muted); font-size: 12px; }
.error-state code { display: inline-block; margin-top: 12px; padding: 6px 8px; color: var(--negative); background: var(--negative-soft); border-radius: 4px; font-size: 11px; }
.toast { position: fixed; z-index: 60; right: 22px; bottom: 20px; max-width: min(420px, calc(100vw - 32px)); padding: 10px 14px; color: #fff; background: #152640; border-radius: 8px; box-shadow: var(--shadow); font-size: 12px; opacity: 0; pointer-events: none; transform: translateY(8px); transition: opacity .18s ease, transform .18s ease; }
.toast.visible { opacity: 1; transform: translateY(0); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

@media (max-width: 1050px) {
  main { padding-right: 20px; padding-left: 20px; }
  .topbar { padding-right: 20px; padding-left: 20px; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .regie-fact-group .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .content-grid { grid-template-columns: minmax(0, 1.2fr) minmax(230px, .8fr); }
}
@media (max-width: 760px) {
  .sidebar { width: min(290px, 85vw); box-shadow: var(--shadow); transform: translateX(-105%); transition: transform .2s ease; }
  .sidebar.is-open { transform: translateX(0); }
  .app-shell.is-collapsed .sidebar { width: min(290px, 85vw); padding: 0 0 18px; }
  .app-shell.is-collapsed .sidebar-top { flex-direction: row; gap: 7px; padding: 0 14px 0 18px; }
  .app-shell.is-collapsed .brand { min-height: 68px; height: 68px; flex: 1; justify-content: flex-start; overflow: visible; padding: 18px 0 14px; }
  .app-shell.is-collapsed .brand-title { display: flex; }
  .app-shell.is-collapsed .brand-icon img { width: 68px; height: auto; max-width: none; }
  .app-shell.is-collapsed .brand-word img { width: 136px; height: auto; max-width: none; }
  .app-shell.is-collapsed .nav-group.is-closed .nav-list { display: none; }
  .app-shell.is-collapsed .workspace-label,
  .app-shell.is-collapsed .nav-heading,
  .app-shell.is-collapsed .nav-item span,
  .app-shell.is-collapsed .sidebar-bottom { display: revert; }
  .app-shell.is-collapsed .sidebar-bottom { display: grid; }
  .app-shell.is-collapsed .navigation { gap: 7px; }
  .app-shell.is-collapsed .nav-item { justify-content: flex-start; padding: 7px 9px; }
  .sidebar-collapse { display: none; }
  .main-column { margin-left: 0; }
  .topbar { height: 58px; gap: 10px; padding: 0 16px; }
  .menu-toggle { display: grid; }
  .breadcrumb { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .topbar-right { margin-left: auto; }
  .search-wrap { width: min(230px, 45vw); }
  .global-search kbd { display: none; }
  .theme-toggle { display: none; }
  .logout-button { width: 34px; height: 34px; padding: 0; }
  .logout-button span { display: none; }
  .menu-toggle .sidebar-toggle-desktop { display: none; }
  .menu-toggle .sidebar-toggle-mobile { display: block; }
  main { padding: 16px 16px 60px; }
  .content-grid, .detail-layout, .catalog-grid { grid-template-columns: 1fr; }
  .client-detail-layout { grid-template-columns: 1fr; }
  .contract-distributions { grid-template-columns: 1fr; }
  .contract-donut-body { grid-template-columns: 136px minmax(0, 1fr); }
}
@media (max-width: 520px) {
  .topbar { gap: 6px; padding: 0 10px; }
  .breadcrumb { flex: 1; gap: 5px; font-size: 10px; }
  .breadcrumb-section { min-height: 22px; padding: 0 6px; font-size: 8px; }
  .breadcrumb-current { font-size: 11px; }
  .breadcrumb-detail { font-size: 9px; }
  .topbar-right { gap: 4px; }
  .search-wrap { width: min(165px, 42vw); }
  .global-search { height: 33px; gap: 5px; padding: 0 7px; }
  .global-search input { font-size: 10px; }
  .logout-button { width: 32px; height: 32px; }
  .metric-grid { gap: 9px; }
  .regie-fact-group .metric-grid { grid-template-columns: 1fr; }
  .metric-card { min-height: 105px; padding: 13px; }
  .metric-value { font-size: 23px; }
  .page-heading { align-items: flex-start; }
  .page-heading .page-action { display: none; }
  .page-heading [data-demande-create] { display: inline-flex; }
  .table-toolbar { flex-wrap: wrap; }
  .table-search { width: 100%; }
   .contract-donut-city-control { flex-basis: 132px; }
  .contract-donut-city-select { width: 132px; font-size: 10px; }
   .contract-new-contracts-year-control { flex-basis: 96px; }
   .contract-new-contracts-year-select { width: 96px; font-size: 10px; }
   .contract-monthly-chart { gap: 4px; padding: 14px 8px 10px; }
   .contract-monthly-column { grid-template-rows: 14px 92px auto; gap: 4px; }
   .contract-monthly-track { height: 92px; }
   .contract-monthly-value, .contract-monthly-label { font-size: 9px; }
   .contract-monthly-delta { font-size: 8px; }
  .result-count { width: 100%; margin: 0; }
  .detail-fields, .rules-grid { grid-template-columns: 1fr; }
  .client-field-section .detail-fields { grid-template-columns: 1fr; }
  .record-fields { grid-template-columns: 1fr; }
  .detail-field:nth-child(odd) { border-right: 0; }
  .table-footer { align-items: flex-start; flex-direction: column; }
  .table-wrap table { min-width: 610px; }
  .contract-kpis { grid-template-columns: 1fr; }
  .contract-donut-body { grid-template-columns: 110px minmax(0, 1fr); gap: 11px; padding: 13px; }
  .contract-donut-svg { width: 110px; height: 110px; }
  .contract-search-result { grid-template-columns: minmax(0, 1fr); align-items: stretch; gap: 8px; }
  .contract-result-details { justify-content: flex-start; }
  .point-search-control { align-items: stretch; flex-direction: column; }
  .point-status-filter { flex-basis: auto; width: 100%; }
  .point-detail-hero-side { justify-items: start; }
  .point-detail-actions { justify-content: flex-start; }
  .point-usage-row { grid-template-columns: minmax(0, 1fr) auto; gap: 5px 10px; }
  .point-usage-track { grid-column: 1 / 2; }
  .point-usage-row > small { grid-column: 2; grid-row: 1 / span 2; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

.page-heading .record-action { flex: 0 0 auto; }
.intervention-calendar, .intervention-form-panel, .intervention-client-panel { margin-top: 16px; }
.intervention-form { padding: 18px; }
.intervention-form .record-field textarea,
.intervention-action-form .record-field textarea {
  width: 100%;
  min-height: 76px;
  padding: 10px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 7px;
  resize: vertical;
}
.intervention-form .record-field textarea:focus,
.intervention-action-form .record-field textarea:focus {
  outline: 2px solid var(--accent-soft);
  border-color: var(--accent);
}
.intervention-client-fields { display: contents; }
.intervention-form-comment { grid-column: 1 / -1; }
.intervention-form .record-form-footer,
.intervention-action-form .record-form-footer { justify-content: flex-end; gap: 9px; }
.intervention-error, .intervention-inline-error { color: var(--negative); font-size: 12px; }
.intervention-conflict { color: var(--negative) !important; font-size: 12px; font-weight: 600; }
.intervention-card-conflict { border-color: var(--negative); }
.intervention-load-error { align-items: center; justify-content: space-between; }
.intervention-load-error .page-action { flex: 0 0 auto; }
.intervention-calendar-toolbar {
  display: flex;
  min-height: 68px;
  align-items: center;
  gap: 16px;
  padding: 12px 15px;
  border-bottom: 1px solid var(--border);
}
.intervention-range-toggle { display: inline-flex; padding: 3px; background: var(--surface-soft); border-radius: 8px; }
.intervention-range-toggle button {
  min-height: 30px;
  padding: 5px 11px;
  color: var(--text-muted);
  border: 0;
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
  font-size: 12px;
}
.intervention-range-toggle button[aria-pressed="true"] { color: var(--accent-strong); background: var(--surface); box-shadow: var(--shadow); font-weight: 650; }
.intervention-date-controls { display: flex; align-items: flex-end; gap: 7px; }
.intervention-date-controls .record-field { width: min(215px, 38vw); }
.intervention-date-controls .record-field input { min-height: 35px; padding: 6px 9px; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 7px; }
.intervention-date-controls .record-field span { font-size: 10px; }
.intervention-count { margin-left: auto; color: var(--text-muted); font-size: 12px; white-space: nowrap; }
.intervention-agenda { padding: 6px 15px 15px; }
.intervention-day { margin-top: 14px; }
.intervention-day > h2 { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0 10px; color: var(--text); font-size: 14px; text-transform: capitalize; }
.intervention-day > h2 span { color: var(--text-faint); font: 500 11px/1.4 "IBM Plex Sans", sans-serif; text-transform: none; }
.intervention-card { margin-top: 9px; padding: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 9px; }
.intervention-card-main { display: grid; grid-template-columns: 100px minmax(0, 1fr); gap: 14px; }
.intervention-card-date { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; color: var(--accent-strong); font-size: 12px; }
.intervention-card-date span { color: var(--text-muted); font-variant-numeric: tabular-nums; }
.intervention-card-content { min-width: 0; }
.intervention-card-heading { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.intervention-card-heading h3 { font-size: 14px; }
.intervention-card-content > p { margin: 4px 0; color: var(--text-muted); font-size: 12px; }
.intervention-card-content .intervention-location { color: var(--text); }
.intervention-card-content .intervention-comment { margin-top: 9px; white-space: pre-wrap; overflow-wrap: anywhere; }
.intervention-status { padding: 3px 8px; border-radius: 20px; background: var(--accent-soft); color: var(--accent-strong); font-size: 10px; font-weight: 650; }
.intervention-status-reportee { background: var(--warning-soft); color: var(--warning); }
.intervention-status-realisee { background: var(--positive-soft); color: var(--positive); }
.intervention-card-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 11px; }
.intervention-card-actions .page-action, .intervention-card-actions .record-action { min-height: 32px; padding: 6px 10px; font-size: 11px; }
.intervention-action-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 13px; padding: 13px; background: var(--surface-muted); border: 1px solid var(--border); border-radius: 8px; }
.intervention-action-form .record-field input { min-height: 36px; padding: 8px; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 7px; }
.intervention-action-form .record-field small { color: var(--text-faint); font-size: 10px; }
.intervention-action-form .record-form-footer, .intervention-action-form .intervention-error { grid-column: 1 / -1; }
.intervention-events { margin-top: 9px; color: var(--text-muted); font-size: 11px; }
.intervention-events summary { cursor: pointer; }
.intervention-events ul { padding-left: 17px; }
.intervention-events li { padding: 5px 0; }
.intervention-events li span { display: block; white-space: pre-wrap; }
.intervention-empty { display: grid; gap: 5px; padding: 34px 16px; color: var(--text-muted); text-align: center; }
.intervention-empty strong { color: var(--text); }
.intervention-refreshing { margin: 0; padding: 7px 15px 0; color: var(--text-faint); font-size: 11px; }
.intervention-client-list { margin: 0; padding: 8px 15px; list-style: none; }
.intervention-client-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.intervention-client-list li:last-child { border-bottom: 0; }
.intervention-client-list li strong, .intervention-client-list li span, .intervention-client-list li small { display: block; }
.intervention-client-list li strong { font-size: 12px; }
.intervention-client-list li span, .intervention-client-list li small { margin-top: 3px; color: var(--text-muted); font-size: 11px; }
.intervention-client-list .panel-link { flex: 0 0 auto; }
@media (max-width: 700px) {
  .intervention-calendar-toolbar { align-items: flex-start; flex-wrap: wrap; gap: 10px; }
  .intervention-count { margin: auto 0 0 auto; }
  .intervention-card-main { grid-template-columns: 1fr; gap: 7px; }
  .intervention-card-date { flex-direction: row; gap: 8px; }
}
@media (max-width: 520px) {
  .page-heading .record-action { display: inline-flex; }
  .intervention-action-form { grid-template-columns: 1fr; }
  .intervention-form-comment { grid-column: auto; }
  .intervention-client-list li { align-items: flex-start; flex-direction: column; }
  .intervention-load-error { align-items: flex-start; flex-direction: column; }
}

/* ===== v32 : variables d'alias ===== */
:root {
  --text-2: var(--text-muted); --text-3: var(--text-faint);
  --surface-2: var(--surface-soft); --surface-3: var(--surface-muted);
  --accent-ink: var(--accent-strong); --accent-line: var(--accent-soft);
  --ok: var(--positive); --ok-soft: var(--positive-soft);
  --warn: var(--warning); --warn-soft: var(--warning-soft);
  --crit: var(--negative); --crit-soft: var(--negative-soft);
  --r: 10px; --shadow-lg: var(--raised-shadow);
}

/* ===== layout v32 ===== */
.app{display:flex; width:100%; height:100vh; height:100dvh; min-height:0; overflow:hidden; position:relative}
.side{position:absolute; left:0; top:0; bottom:0; width:252px; z-index:40; background:var(--surface);
  border-right:1px solid var(--border); display:flex; flex-direction:column; overflow-y:auto; overflow-x:hidden;
  padding-bottom:env(safe-area-inset-bottom,0px); transition:width .22s ease, box-shadow .22s ease}
.main{height:100%; min-height:0; margin-left:252px; flex:1; min-width:0; display:flex; flex-direction:column; overflow:hidden; transition:margin-left .22s ease}
.scroll{flex:1; min-height:0; overflow:auto; overscroll-behavior:contain}

/* repli rail */
.app.rail .side{width:58px}
.app.rail .main{margin-left:58px}
.app.rail .side:focus-within{width:252px; box-shadow:var(--shadow-lg)}
.app.rail .side:not(:focus-within) .brand{justify-content:center; padding:18px 0 14px}
 .app.rail .side:not(:focus-within) .brand-lockup,
.app.rail .side:not(:focus-within) .grphead,
.app.rail .side:not(:focus-within) .navbtn span:not(.tag),
.app.rail .side:not(:focus-within) .who,
.app.rail .side:not(:focus-within) .pinbtn{display:none}
.app.rail .side:not(:focus-within) .navbtn{justify-content:center; padding:9px 0; position:relative}
.app.rail .side:not(:focus-within) .navgrp{padding:6px 9px 0}
.app.rail .side:not(:focus-within) .navgrp.ferme .navlist{display:flex}
.app.rail .side:not(:focus-within) .navgrp+.navgrp{margin-top:7px; padding-top:9px; border-top:1px solid var(--border)}
.app.rail .side:not(:focus-within) .navbtn .tag{position:absolute; top:3px; right:6px; margin:0;
  width:7px; height:7px; padding:0; font-size:0; line-height:0; overflow:hidden}
.app.rail .side:not(:focus-within) .side-foot{justify-content:center; padding:12px 0}

/* marque et navigation */
.brand{display:flex; flex:none; align-items:center; gap:10px; padding:18px 18px 14px}
.brand-symbol, .brand-wordmark{position:relative; display:block; flex:none; overflow:hidden}
.brand-symbol{width:40px; height:40px}
.brand-symbol img{position:absolute; top:-3px; left:-20px; display:block; width:80px; max-width:none; height:auto}
.brand-lockup{display:flex; min-width:0; flex:0 1 136px; flex-direction:column; gap:0}
.brand-wordmark{width:136px; height:24px}
.brand-wordmark img{position:absolute; top:-81px; left:-5px; display:block; width:146px; max-width:none; height:auto}
.brand-subtitle{display:block; color:var(--text-3); font-size:9px; letter-spacing:.075em; line-height:1; text-transform:uppercase; white-space:nowrap}
.mot-img{display:block; height:var(--mh,20px); width:auto; margin-bottom:2px}
.navgrp{padding:4px 10px 0}
.grphead{display:flex; align-items:center; gap:7px; width:100%; border:0; background:transparent; cursor:pointer;
  font-size:10px; font-weight:700; letter-spacing:.12em; text-transform:uppercase; color:var(--text-3);
  padding:7px 8px; border-radius:7px}
.grphead:hover{background:var(--surface-2); color:var(--text-2)}
.grphead svg{flex:0 0 13px; transition:transform .18s ease; opacity:.8}
.grphead .tag{margin-left:auto; font-size:10px; font-weight:700; padding:1px 6px; border-radius:99px;
  background:var(--crit-soft); color:var(--crit); letter-spacing:0}
.navgrp.ferme .grphead svg{transform:rotate(-90deg)}
.navgrp.ferme .navlist{display:none}
.navlist{display:flex; flex-direction:column; gap:1px; padding-bottom:4px}
.navbtn{display:flex; align-items:center; gap:10px; width:100%; text-align:left; padding:7px 9px; border:0; border-radius:8px;
  background:transparent; cursor:pointer; color:var(--text-2); font-size:13.5px; font-weight:500}
.navbtn:hover{background:var(--surface-2); color:var(--text)}
.navbtn.on{background:var(--accent-line); color:var(--accent-ink); font-weight:600}
.navbtn svg{flex:0 0 17px; opacity:.85}
.navbtn .tag{margin-left:auto; font-size:11px; font-weight:600; padding:1px 6px; border-radius:99px; background:var(--crit-soft); color:var(--crit)}
.navbtn.on .tag{background:var(--surface)}
.side-foot{margin-top:auto; padding:12px 14px; border-top:1px solid var(--border); display:flex; align-items:center; gap:8px}
.who{display:flex; flex-direction:column; line-height:1.25; min-width:0}
.who b{font-size:12.5px; font-weight:600}
.who span{font-size:11px; color:var(--text-3); white-space:nowrap; overflow:hidden; text-overflow:ellipsis}
.avatar{width:28px; height:28px; flex:0 0 28px; border-radius:99px; background:var(--accent-line); color:var(--accent-ink);
  display:grid; place-items:center; font-size:11px; font-weight:700; font-family:"Archivo",sans-serif}
.pinbtn{margin-left:auto; border:0; background:transparent; color:var(--text-3); cursor:pointer;
  padding:4px; border-radius:7px; display:grid; place-items:center; flex:0 0 auto}
.pinbtn:hover{background:var(--surface-2); color:var(--text-2)}
.pinbtn[aria-pressed="true"]{color:var(--accent); background:var(--accent-line)}
@media (max-width:900px){.pinbtn{display:none}}
.sidescrim{display:none}
@media (max-width:900px){
  .menu-toggle{display:grid}
  .side{position:fixed; z-index:70; top:0; bottom:0; left:0; width:252px;
    transform:translateX(-100%); transition:transform .2s ease;
    box-shadow:var(--shadow-lg); padding-top:env(safe-area-inset-top,0px)}
  .side.open{transform:none}
  .main,.app.rail .main{margin-left:0}
  .app.rail .side{width:252px}
  .sidescrim.on{display:block; position:fixed; inset:0; background:rgba(6,26,32,.4); z-index:65}
}

/* ===== aperçu PDF ===== */
.pdfover{position:fixed; inset:0; z-index:200; background:#2A3942; display:flex; flex-direction:column}
:root[data-theme="dark"] .pdfover{background:#04141F}
.pdftoolbar{display:flex; align-items:center; gap:8px; padding:9px 14px; background:var(--surface);
  border-bottom:1px solid var(--border); flex:0 0 auto; padding-top:calc(9px + env(safe-area-inset-top,0px)); flex-wrap:wrap}
.pdftitle{font-size:13px; font-weight:600}
.pdfscroll{flex:1; overflow:auto; padding:20px 12px 40px; display:flex; justify-content:center}
.pdfpage{width:210mm; height:296.8mm; flex:0 0 296.8mm; overflow:hidden; background:#fff; color:#16222b; padding:12mm 13mm 9mm;
  box-shadow:0 10px 40px rgba(0,0,0,.45); position:relative; display:flex; flex-direction:column;
  font-family:"IBM Plex Sans",Arial,sans-serif; font-size:9.2pt; line-height:1.4}
.pdfpage *{box-sizing:border-box}
.pdf-head{display:flex; justify-content:space-between; align-items:flex-start; gap:10mm; padding-bottom:4mm; border-bottom:1.6px solid #0A74B4}
.pdf-ident{display:flex; gap:4mm; align-items:flex-start}
.pdf-logo{flex:0 0 auto; display:block}
.pdf-logo svg{display:block; width:100%; height:auto}
.pdf-logo .logo-img{height:11.5mm}
.pdf-marque{font-family:"Archivo",Arial,sans-serif; font-size:16pt; font-weight:700; letter-spacing:-.02em; line-height:1.05; color:#0A74B4}
.pdf-marque .mot-img{height:5.4mm; margin-bottom:.8mm}
.pdf-regie{font-family:"Archivo",Arial,sans-serif; font-size:10pt; font-weight:600; color:#16222b}
.pdf-mini{font-size:7.6pt; color:#6B7F8C; line-height:1.35}
.pdf-lab{font-size:7.8pt; font-weight:700; color:#6B7F8C; text-transform:uppercase; letter-spacing:.04em; margin-bottom:.8mm; margin-top:3.5mm}
.pdf-lab:first-child{margin-top:0}
.pdf-titre h1{font-family:"Archivo",Arial,sans-serif; font-size:15pt; font-weight:700; margin:0 0 2.2mm; text-align:right; letter-spacing:-.02em}
.pdf-titre h1.avoir{color:#A02A1E}
.pdf-boite{border:1.2px solid #0A74B4; border-radius:2mm; padding:1.2mm 3mm; display:flex; gap:3mm; align-items:baseline; justify-content:flex-end}
.pdf-boite span{font-size:7.6pt; color:#6B7F8C}
.pdf-boite b{font-family:"IBM Plex Mono",monospace; font-size:11pt; letter-spacing:.03em}
.pdf-recto{display:grid; grid-template-columns:58mm 1fr; gap:6mm; margin:3mm 0 0; flex:0 0 auto; max-height:152mm}
.pdf-bloc2{display:grid; grid-template-columns:58mm 1fr; gap:6mm; margin:3mm 0 0; flex:0 0 auto}
.pdf-col-g{border-right:.5px solid #D5DFE6; padding-right:5mm; overflow:hidden}
.pdf-col-g .pdf-lab{margin-top:3.5mm}
.pdf-col-g .pdf-lab:first-child{margin-top:0}
.pdf-coord{font-size:7.8pt; line-height:1.45; color:#16222b}
.pdf-coord a{color:#0A74B4; text-decoration:underline}
.pdf-coord .pdf-mini{display:block; margin-top:.8mm}
.pdf-tel{font-family:"Archivo",Arial,sans-serif; font-size:10pt; color:#0A74B4}
.pdf-urg{color:#A02A1E; font-weight:600}
.pdf-message{margin-top:4mm; border:1px solid #0A74B4; border-radius:2mm; padding:2mm 2.5mm; background:#F7FBFE}
.pdf-message-t{font-family:"Archivo",Arial,sans-serif; font-size:8.5pt; font-weight:700; color:#0A74B4;
  text-decoration:underline; margin-bottom:1.5mm}
.pdf-message p{margin:0 0 1.2mm; font-size:6.5pt; line-height:1.32; color:#16222b; text-align:justify}
.pdf-message p:last-child{margin-bottom:0}
.pdf-adressage{margin-bottom:3mm}
.pdf-barres{width:58mm; height:9mm; margin:0 0 2.5mm auto}
.pdf-destinataire{font-family:"IBM Plex Mono",monospace; font-size:8.2pt; line-height:1.38; padding-left:18mm}
.pdf-mandant{margin-top:1.8mm; padding-top:1.2mm; border-top:.4px solid #D5DFE6;
  font-size:6.9pt; line-height:1.35; color:#6B7F8C}
.pdf-mandant b{color:#16222b}
.pdf-h2{font-family:"Archivo",Arial,sans-serif; font-size:10pt; font-weight:700; color:#0A74B4;
  margin:3.5mm 0 1.8mm; padding-bottom:1mm; border-bottom:.5px solid #D5DFE6}
.pdf-simplifiee{display:grid; grid-template-columns:1fr 26mm; gap:3mm; align-items:center}
.pdf-aregler{border:1.4px solid #0A74B4; border-radius:2mm; padding:1.6mm 3.5mm; background:#F2F8FD; display:inline-block}
.pdf-montant{display:block; font-family:"Archivo",Arial,sans-serif; font-size:15pt; font-weight:700; color:#05527F; letter-spacing:-.02em; line-height:1.1}
.pdf-ttc{font-size:8pt; font-weight:600; margin-left:2mm; color:#0A74B4}
.pdf-detailsimple{margin-top:2mm}
.pdf-detailsimple .pdf-lab{margin-bottom:1.2mm}
.pdf-ligne-simple{display:grid; grid-template-columns:3mm 1fr auto 9mm; gap:2mm; align-items:baseline;
  font-size:7.5pt; padding:.25mm 0}
.pdf-carre{width:2.4mm; height:2.4mm; border-radius:.5mm; display:inline-block; vertical-align:-.15mm}
.pdf-detail tr.fam .pdf-carre{margin-right:2mm}
.pdf-ligne-simple .pdf-v{font-weight:600; font-variant-numeric:tabular-nums}
.pdf-ligne-simple .pdf-pc{text-align:right; color:#6B7F8C; font-size:7.4pt}
.pdf-donut{display:flex; align-items:center; justify-content:center}
.pdf-donut svg{width:100%; height:auto}
.pdf-conso{display:grid; grid-template-columns:1fr 1fr; gap:4mm; align-items:start}
.pdf-conso .pdf-lab{margin-top:2mm}
.pdf-conso .pdf-mini{font-size:7.1pt; line-height:1.28}
.pdf-conso>.div>.pdf-lab:first-child{margin-top:0}
.pdf-histo{display:flex; align-items:flex-end; gap:2mm; height:20mm; margin-top:1.5mm;
  border-bottom:.5px solid #D5DFE6; padding-bottom:.8mm}
.pdf-hcol{flex:1; display:flex; flex-direction:column; align-items:center; justify-content:flex-end; gap:.6mm}
.pdf-hval{font-size:6.6pt; font-weight:600; color:#0A74B4; font-variant-numeric:tabular-nums}
.pdf-hbar{width:100%; max-width:8mm; background:#9FC9E4; border-radius:.5mm .5mm 0 0}
.pdf-hbar.now{background:#0A74B4}
.pdf-hlab{font-size:5.9pt; color:#6B7F8C; text-align:center; line-height:1.2}
.pdf-gros{font-family:"Archivo",Arial,sans-serif; font-size:13pt; font-weight:700; color:#16222b; line-height:1.1}
.pdf-delta{margin-top:1.5mm; border:.5px solid #D5DFE6; border-radius:1.5mm; padding:1.5mm 2mm; background:#F7FAFC}
.pdf-delta-l{display:flex; justify-content:space-between; gap:3mm; font-size:7.2pt; padding:.3mm 0}
.pdf-delta-l b{font-variant-numeric:tabular-nums}
.pdf-delta-l.tot{border-top:.5px solid #C7D6E0; margin-top:.8mm; padding-top:.8mm; font-weight:700; color:#05527F}
.pdf-payer{margin-top:2.5mm; flex:0 0 auto}
.pdf-payer-t{font-family:"Archivo",Arial,sans-serif; font-size:9.5pt; font-weight:700; color:#0A74B4; margin-bottom:1.5mm}
.pdf-paiement{margin:0; padding-left:3.5mm; font-size:6.7pt; line-height:1.3; columns:2; column-gap:5mm}
.pdf-paiement li{margin-bottom:.6mm; break-inside:avoid}
.pdf-mentions-r{font-style:italic}
.pdf-recours{display:grid; grid-template-columns:repeat(3,1fr); gap:4mm; margin-top:2.2mm;
  border-top:.5px solid #D5DFE6; padding-top:1.8mm; font-size:6.2pt; line-height:1.28; color:#16222b}
.pdf-recours .pdf-lab{display:block; margin-bottom:.6mm}
.pdf-executoire{margin:1.6mm 0 0; font-size:6pt; line-height:1.3; color:#6B7F8C; text-align:justify}
.pdf-decoupe{position:relative; margin:2.5mm 0 1.8mm; margin-top:auto; flex:0 0 auto;
  border-top:1px dashed #6B7F8C; display:flex; align-items:center; justify-content:center}
.pdf-decoupe span{position:absolute; top:-1.7mm; background:#fff; padding:0 2.5mm;
  font-size:6.6pt; color:#0A74B4; letter-spacing:.04em}
.pdf-talon{display:grid; grid-template-columns:1.25fr 1fr; gap:5mm; flex:0 0 auto}
.pdf-talon-g{border:1px solid #6B7F8C; border-radius:1.5mm; padding:1.8mm 2.2mm}
.pdf-talon.prelev .pdf-talon-g{border-color:#0A74B4; background:#F7FBFE}
.pdf-talon-d{border:1px solid #6B7F8C; border-radius:1.5mm; padding:1.8mm 2.2mm; display:flex; flex-direction:column}
.pdf-talon-t{font-family:"Archivo",Arial,sans-serif; font-size:8.6pt; font-weight:700; color:#0A74B4; margin-bottom:1.2mm}
.pdf-talon-p{margin:0 0 1.5mm; font-size:7.4pt; line-height:1.45}
.pdf-mandat{margin:0 0 1.2mm; font-size:5pt; line-height:1.24; color:#6B7F8C; text-align:justify}
.pdf-mandat-l{display:flex; gap:2mm; align-items:flex-end; margin-bottom:1.3mm}
.pdf-mandat-l span{font-size:6.6pt; color:#6B7F8C; letter-spacing:.05em; text-transform:uppercase; flex:0 0 auto}
.pdf-mandat-l i{flex:1; border-bottom:.6px solid #6B7F8C; height:3.5mm}
.pdf-signature{display:flex; gap:4mm; margin-top:1.6mm}
.pdf-signature span{flex:1; border-top:.6px solid #6B7F8C; padding-top:1mm; font-size:6.6pt; color:#6B7F8C; letter-spacing:.05em}
.pdf-tip-mt{display:flex; justify-content:space-between; align-items:baseline; margin:2mm 0;
  border-top:.5px solid #D5DFE6; border-bottom:.5px solid #D5DFE6; padding:1.5mm 0}
.pdf-tip-mt b{font-family:"Archivo",Arial,sans-serif; font-size:12pt; font-variant-numeric:tabular-nums}
.pdf-centre{margin-top:auto; font-family:"IBM Plex Mono",monospace; font-size:7.1pt; line-height:1.45; letter-spacing:.04em}
.pdf-optique{margin-top:1.6mm; font-family:"IBM Plex Mono",monospace; font-size:7.3pt; letter-spacing:.1em;
  line-height:1.4; text-align:center; flex:0 0 auto}
.pdf-montant-tip{font-family:"Archivo",Arial,sans-serif; font-size:14pt; font-weight:700; font-variant-numeric:tabular-nums}
.pdf-head-min{display:flex; justify-content:space-between; font-size:8pt; color:#6B7F8C;
  padding-bottom:3mm; border-bottom:1px solid #D5DFE6; margin-bottom:2mm}
.pdf-tech,.pdf-detail{width:100%; border-collapse:collapse; font-size:8.2pt; table-layout:fixed}
.pdf-tech{font-size:7.4pt}
.pdf-tech th{font-size:6.5pt; white-space:normal; word-break:normal; padding:1.4mm 1.5mm; line-height:1.2}
.pdf-tech col.c1{width:13%}.pdf-tech col.c2{width:12%}.pdf-tech col.c3{width:9%}.pdf-tech col.c4{width:9%}
.pdf-tech col.c5{width:9%}.pdf-tech col.c6{width:13%}.pdf-tech col.c7{width:15%}.pdf-tech col.c8{width:10%}.pdf-tech col.c9{width:10%}
.pdf-detail col.d1{width:27%}.pdf-detail col.d2{width:13%}.pdf-detail col.d3{width:11%}.pdf-detail col.d4{width:11%}
.pdf-detail col.d5{width:13%}.pdf-detail col.d6{width:9%}.pdf-detail col.d7{width:16%}
.pdf-tech th,.pdf-detail th{background:#F2F8FD; color:#05527F; font-weight:700; font-size:6.9pt; text-align:left;
  overflow-wrap:normal; word-break:keep-all; padding:1.8mm 2mm; border:1px solid #D5DFE6; line-height:1.25}
.pdf-tech td{padding:2mm; border:1px solid #D5DFE6; font-variant-numeric:tabular-nums}
.pdf-tech .r,.pdf-detail .r{text-align:right}
.pdf-tech thead th,.pdf-detail thead th,.pdf-tech thead th.r,.pdf-detail thead th.r{text-align:center}
.pdf-tech tbody td,.pdf-tech tbody td.r{text-align:center}
.pdf-detail td{padding:1.5mm 2mm; border-bottom:1px solid #EAF1F6; font-variant-numeric:tabular-nums}
.pdf-detail tr.fam td{background:#F7FAFC; font-family:"Archivo",Arial,sans-serif; font-weight:700; font-size:8.4pt;
  border-top:1px solid #C7D6E0; border-bottom:1px solid #C7D6E0}
.pdf-detail tr.section-total td{background:#F7FAFC; border-top:1px solid #C7D6E0; border-bottom:1px solid #C7D6E0;
  font-family:"Archivo",Arial,sans-serif; font-weight:700}
.pdf-detail td.ind{padding-left:6mm}
.pdf-detail td.pt{color:#6B7F8C; font-size:7.6pt}
.pdf-detail tr.sep td{height:2mm; border:0}
.pdf-detail tr.tot td{font-weight:700; border-bottom:0; padding-top:1.5mm}
.pdf-detail tr.pdf-tva-head td{color:#05527F; font-weight:700; border-bottom:0; padding-top:2mm; padding-bottom:.8mm}
.pdf-detail tr.pdf-tva-row td{color:#596D79; font-size:7.6pt; border-bottom:0; padding-top:.8mm; padding-bottom:.8mm}
.pdf-detail tr.total-lines td{font-weight:700; font-size:8.8pt; border-top:1.4px solid #536B7A; padding-top:2mm}
.pdf-detail tr.grand td{font-family:"Archivo",Arial,sans-serif; font-weight:700; font-size:11pt;
  border-top:1.6px solid #0A74B4; border-bottom:0; padding-top:2.5mm; color:#05527F}
.pdf-motif{font-size:8.2pt; margin:2mm 0 0; color:#6B7F8C}
.pdf-avoir-motif{margin:5mm 0; border-left:3px solid #A02A1E; background:#FDF4F3; padding:3mm 4mm; border-radius:0 2mm 2mm 0}
.pdf-motif-txt{font-size:9.6pt; font-weight:600}
.pdf-avoir-suite{margin-top:5mm; font-size:8.4pt; line-height:1.5}
.pdf-avoir-suite p{margin:1.5mm 0}
.pdf-mentions{margin-top:auto; padding-top:5mm; font-size:6.9pt; color:#6B7F8C; line-height:1.4}
.pdf-mentions p{margin:0 0 1.5mm}
.pdf-pied{display:flex; justify-content:space-between; font-size:6.5pt; color:#6B7F8C;
  border-top:1px solid #D5DFE6; padding-top:1.5mm; margin-top:2mm; flex:0 0 auto}
.etq-tete .logo-img{--lh:13px}
.ab-push-h .logo-img{height:14px}
.pt-marque .mot-img,.pt-marque .logo-img{filter:brightness(0) invert(1)}
.pdf-logo .logo-img{height:11.5mm}
@media (max-width:760px){.pdf-bloc2,.pdf-conso{grid-template-columns:1fr}.pdf-simplifiee{grid-template-columns:1fr}}
@media print{
  @page{size:A4; margin:0}
  .pdfover{position:static!important; background:#fff!important; display:block!important}
  .pdftoolbar{display:none!important}
  .pdfscroll{overflow:visible!important; padding:0!important; display:block!important}
  .pdfpage{box-shadow:none!important; margin:0!important; page-break-after:always; break-after:page;
    width:210mm; height:296.8mm; overflow:hidden}
  .pdfpage:last-child{page-break-after:auto; break-after:auto}
}
.recovery-legal-notice { margin-top: 14px; }
.recovery-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 16px 0;
}
.recovery-summary article {
  display: grid;
  gap: 6px;
  padding: 15px 17px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.recovery-summary span { color: var(--text-muted); font-size: 12px; }
.recovery-summary strong { color: var(--text); font-size: 22px; font-variant-numeric: tabular-nums; }
.recovery-tabs { display: flex; gap: 7px; padding: 4px 0 10px; overflow-x: auto; }
.recovery-tab {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 37px;
  padding: 7px 11px;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  white-space: nowrap;
  cursor: pointer;
}
.recovery-tab span { color: var(--text-faint); font-size: 11px; font-variant-numeric: tabular-nums; }
.recovery-tab.is-active { color: var(--accent-strong); background: var(--accent-soft); border-color: var(--accent); font-weight: 650; }
.recovery-list { display: grid; gap: 11px; margin-top: 8px; }
.recovery-card { padding: 16px; }
.recovery-card-main { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 12px; }
.recovery-select { align-self: start; padding-top: 5px; }
.recovery-select input, .recovery-attestation input { accent-color: var(--accent); }
.recovery-card-body { min-width: 0; }
.recovery-card-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.recovery-card-heading h2 { margin: 2px 0 0; font-size: 16px; }
.recovery-eyebrow { margin: 0; color: var(--accent-strong); font-size: 11px; font-weight: 650; }
.recovery-balance { color: var(--text); font-size: 18px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.recovery-card-meta { margin: 7px 0 0; color: var(--text-muted); font-size: 12px; overflow-wrap: anywhere; }
.recovery-invoice-link { padding: 0; color: var(--accent-strong); border: 0; background: transparent; font: inherit; font-weight: 650; cursor: pointer; }
.recovery-actions { display: grid; gap: 9px; margin-top: 14px; }
.recovery-action-form, .recovery-bulk-form {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.recovery-action-form .record-field, .recovery-bulk-form .record-field { flex: 1 1 260px; }
.recovery-action-form input, .recovery-bulk-form input:not([type="checkbox"]) {
  width: 100%;
  min-height: 36px;
  padding: 8px 10px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 7px;
}
.recovery-attestation { display: flex; flex: 1 1 300px; align-items: flex-start; gap: 8px; color: var(--text-muted); font-size: 11px; line-height: 1.5; }
.recovery-attestation input { flex: 0 0 auto; margin-top: 2px; }
.recovery-card-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.recovery-history { margin-top: 12px; color: var(--text-muted); font-size: 12px; }
.recovery-history summary { cursor: pointer; }
.recovery-history ol { display: grid; gap: 7px; padding-left: 18px; }
.recovery-history li { padding-left: 2px; }
.recovery-history li span, .recovery-history li small { display: block; margin-top: 2px; }
.recovery-history li .page-action { margin-top: 5px; }
.recovery-bulk-form { margin: 8px 0 14px; }
.recovery-empty { padding: 28px; color: var(--text-muted); text-align: center; }
.recovery-empty strong { color: var(--text); }
.recovery-empty p { max-width: 650px; margin: 8px auto 0; font-size: 12px; }
.recovery-print-preview { margin-top: 18px; }
.recovery-print-actions { display: flex; gap: 8px; }
.recovery-print-sheet {
  max-width: 850px;
  margin: 12px auto;
  padding: 36px;
  color: #1b2938;
  background: #fff;
  border: 1px solid #d9e0e7;
  border-radius: 8px;
}
.recovery-print-kicker { color: #48627d; font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.recovery-print-sheet h1 { margin: 10px 0; font-size: 26px; }
.recovery-print-issuer { padding-bottom: 12px; border-bottom: 1px solid #d9e0e7; }
.recovery-print-issuer > strong { display: block; margin-bottom: 4px; font-size: 15px; }
.recovery-print-issuer > div { font-size: 11px; line-height: 1.7; overflow-wrap: anywhere; }
.recovery-letter-recipient { margin: 28px 0 10px auto; width: min(100%, 340px); line-height: 1.6; }
.recovery-letter-recipient strong, .recovery-letter-recipient div { display: block; }
.recovery-letter-date { margin: 20px 0; text-align: right; }
.recovery-letter > p { line-height: 1.65; }
.recovery-letter-signature { margin-top: 34px; line-height: 1.6; }
.recovery-letter-signature p:last-child { margin-top: 36px; }
.recovery-issuer-unavailable { color: #64748b; font-style: italic; }
.recovery-print-status { padding: 10px 12px; background: #f1f5f9; border-left: 3px solid #587ba0; font-size: 12px; }
.recovery-print-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 20px; margin: 24px 0; }
.recovery-print-grid div { border-bottom: 1px solid #d9e0e7; padding-bottom: 7px; }
.recovery-print-grid dt { color: #526577; font-size: 11px; }
.recovery-print-grid dd { margin: 3px 0 0; font-size: 13px; font-weight: 600; overflow-wrap: anywhere; }
.recovery-print-checklist { margin-top: 28px; padding: 16px; background: #f8fafc; border: 1px solid #d9e0e7; }
.recovery-print-checklist h2 { margin: 0 0 8px; font-size: 15px; }
.recovery-print-checklist li, .recovery-print-checklist p { font-size: 12px; line-height: 1.55; }
@media (max-width: 760px) {
  .recovery-summary { grid-template-columns: 1fr; }
  .recovery-card-heading { flex-direction: column; }
  .recovery-print-grid { grid-template-columns: 1fr; }
  .recovery-print-sheet { padding: 22px; }
}
@media print {
  body:has(.recovery-print-preview) * { visibility: hidden !important; }
  .recovery-print-preview, .recovery-print-preview * { visibility: visible !important; }
  .recovery-print-preview { position: absolute; inset: 0; width: 100%; margin: 0; }
  .recovery-print-sheet {
    max-width: none;
    min-height: 265mm;
    margin: 0;
    padding: 15mm;
    border: 0;
    border-radius: 0;
    page-break-after: always;
    break-after: page;
  }
  .no-print { display: none !important; }
  .recovery-print-sheet:last-child { page-break-after: auto; break-after: auto; }
}

.admin-heading { align-items: center; }
.admin-account-count, .admin-role {
  flex: none; padding: 7px 11px; border: 1px solid var(--border); border-radius: 999px;
  background: var(--surface); color: var(--text-muted); font-size: 12px; font-weight: 650;
}
.admin-user-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.admin-user-card { min-width: 0; padding: 0; overflow: hidden; }
.admin-user-header {
  display: flex; align-items: center; gap: 12px; padding: 18px 20px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.admin-avatar {
  display: grid; width: 42px; height: 42px; flex: 0 0 42px; place-items: center;
  border-radius: 50%; background: var(--accent-soft); color: var(--accent-strong);
  font: 700 13px "Archivo", sans-serif;
}
.admin-user-identity { min-width: 0; flex: 1; }
.admin-user-identity h2 { margin: 0; color: var(--text); font: 650 16px "Archivo", sans-serif; }
.admin-user-identity p { overflow: hidden; margin: 4px 0 0; color: var(--text-muted); font-size: 12px; text-overflow: ellipsis; }
.admin-module-list { padding: 4px 20px 8px; }
.admin-module-row {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px;
  padding: 12px 0; border-bottom: 1px solid var(--border);
}
.admin-module-row:last-child { border-bottom: 0; }
.admin-module-copy { display: grid; min-width: 0; gap: 3px; }
.admin-module-copy strong { color: var(--text); font-size: 13px; }
.admin-module-copy small { color: var(--text-muted); font-size: 11px; line-height: 1.4; }
.admin-access-state { color: var(--text-faint); font-size: 10px; font-weight: 650; text-transform: uppercase; letter-spacing: .05em; }
.admin-access-state.is-exception { color: var(--accent-strong); }
.admin-module-controls { display: flex; min-width: 145px; flex-direction: column; align-items: flex-end; gap: 5px; }
.admin-switch {
  position: relative; width: 42px; height: 24px; padding: 0; border: 1px solid var(--border-strong);
  border-radius: 99px; background: var(--surface-soft); cursor: pointer; transition: background .16s, border-color .16s;
}
.admin-switch span {
  position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%;
  background: var(--text-faint); transition: transform .16s, background .16s;
}
.admin-switch.is-on { border-color: var(--accent); background: var(--accent); }
.admin-switch.is-on span { transform: translateX(18px); background: white; }
.admin-switch:focus-visible, .admin-full-link:focus-visible, .admin-reset-link:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 40%, transparent); outline-offset: 2px;
}
.admin-switch:disabled { cursor: not-allowed; opacity: .5; }
.admin-full-link, .admin-reset-link {
  padding: 0; border: 0; background: transparent; color: var(--accent-strong); cursor: pointer;
  font: 600 10px "IBM Plex Sans", sans-serif; text-align: right;
}
.admin-full-link:hover, .admin-reset-link:hover { text-decoration: underline; }
.admin-locked { color: var(--text-faint); font-size: 10px; }
.admin-account-status {
  flex: none; padding: 5px 8px; border-radius: 999px; background: var(--negative-soft);
  color: var(--negative); font-size: 10px; font-weight: 700;
}
.admin-account-toggle {
  flex: none; padding: 7px 10px; border: 1px solid var(--negative);
  border-radius: 6px; background: transparent; color: var(--negative); cursor: pointer;
  font: 600 11px "IBM Plex Sans", sans-serif;
}
.admin-account-toggle.is-reactivate {
  border-color: var(--positive); color: var(--positive);
}
.admin-account-toggle:disabled { cursor: wait; opacity: .6; }
.admin-account-toggle:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 40%, transparent); outline-offset: 2px;
}
.admin-explainer {
  display: flex; flex-direction: column; gap: 4px; margin: 0 0 16px; padding: 13px 16px;
  border-left: 3px solid var(--accent); border-radius: 7px; background: var(--surface);
  color: var(--text-muted); font-size: 12px;
}
.admin-explainer strong { color: var(--text); }
.admin-footnote, .admin-journal-count { margin: 12px 2px 0; color: var(--text-faint); font-size: 11px; }
.admin-inline-error, .admin-error { color: var(--negative); }
.admin-error { padding: 18px; }
.admin-error h2, .admin-empty h2 { margin: 0 0 6px; font-size: 15px; }
.admin-error p, .admin-empty p { margin: 0; color: var(--text-muted); font-size: 12px; }
.admin-empty { padding: 22px; color: var(--text); }
.admin-filters {
  display: flex; flex-wrap: wrap; align-items: end; gap: 10px; margin: 0 0 14px;
  padding: 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface);
}
.admin-filters label { display: grid; min-width: 145px; gap: 5px; color: var(--text-muted); font-size: 11px; font-weight: 600; }
.admin-filters select, .admin-filters input {
  min-height: 36px; padding: 7px 9px; border: 1px solid var(--border-strong); border-radius: 6px;
  background: var(--surface); color: var(--text); font: inherit; font-size: 12px;
}
.admin-journal { overflow: hidden; }
.admin-table-wrap { overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.admin-table th, .admin-table td { padding: 12px 14px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.admin-table th { color: var(--text-muted); background: var(--surface-muted); font-size: 10px; text-transform: uppercase; letter-spacing: .06em; }
.admin-table td { color: var(--text); }
.admin-event-type { font-weight: 600; }
.admin-outcome { display: inline-flex; padding: 3px 7px; border-radius: 999px; background: var(--positive-soft); color: var(--positive); font-size: 10px; font-weight: 700; }
.admin-outcome.is-denied { background: var(--negative-soft); color: var(--negative); }
.admin-skeleton { display: grid; gap: 10px; }
.admin-skeleton i { display: block; height: 76px; border-radius: 9px; background: linear-gradient(90deg, var(--surface-soft), var(--surface), var(--surface-soft)); }
@media (max-width: 900px) { .admin-user-list { grid-template-columns: 1fr; } }
@media (max-width: 620px) {
  .admin-heading { align-items: flex-start; }
  .admin-user-header { flex-wrap: wrap; padding: 15px; }
  .admin-user-header .admin-role { margin-left: 54px; }
  .admin-module-list { padding-right: 15px; padding-left: 15px; }
  .admin-module-row { grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
  .admin-module-controls { min-width: 118px; }
  .admin-filters { align-items: stretch; }
  .admin-filters label { flex: 1 1 130px; }
  .admin-table thead { display: none; }
  .admin-table, .admin-table tbody, .admin-table tr, .admin-table td { display: block; width: 100%; }
  .admin-table tr { padding: 8px 12px; border-bottom: 1px solid var(--border); }
  .admin-table td { display: grid; grid-template-columns: 115px minmax(0, 1fr); gap: 8px; padding: 5px 0; border: 0; }
  .admin-table td::before { content: attr(data-label); color: var(--text-muted); font-size: 10px; font-weight: 650; }
}

.admin-heading { align-items: flex-end; }
.admin-user-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.admin-user-card { padding: 0 0 14px; overflow: hidden; }
.admin-user-header { min-height: 68px; padding: 13px 18px 9px; border-bottom: 0; }
.admin-user-identity h2 { font-size: 15px; }
.admin-user-identity p { margin-top: 2px; }
.admin-user-menu-heading {
  margin: 10px 18px 9px;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .075em;
  text-transform: uppercase;
}
.admin-module-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  gap: 9px;
  padding: 0 18px;
}
.admin-module-row {
  min-height: 88px;
  grid-template-columns: minmax(0, 1fr) 86px;
  align-items: center;
  gap: 10px;
  padding: 10px 11px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface-muted);
}
.admin-module-row:last-child { border-bottom: 1px solid var(--border); }
.admin-module-copy { gap: 2px; }
.admin-module-copy strong { font-size: 12px; }
.admin-module-copy small { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.admin-access-state { font-size: 9px; }
.admin-module-controls { width: 86px; min-width: 0; gap: 6px; }
.admin-full-link, .admin-reset-link { max-width: 100%; white-space: normal; overflow-wrap: anywhere; line-height: 1.2; }
.admin-locked { max-width: 100%; text-align: right; overflow-wrap: anywhere; }
.admin-user-note { margin: 11px 18px 0; color: var(--text-faint); font-size: 10px; }
@media (max-width: 620px) {
  .admin-heading { align-items: flex-start; }
  .admin-user-header { flex-wrap: nowrap; padding: 12px 14px 8px; }
  .admin-user-header .admin-role { margin-left: auto; }
  .admin-user-menu-heading { margin-right: 14px; margin-left: 14px; }
  .admin-module-grid { grid-template-columns: minmax(0, 1fr); padding: 0 14px; }
  .admin-module-row { grid-template-columns: minmax(0, 1fr) 86px; gap: 8px; }
  .admin-module-controls { min-width: 0; }
  .admin-user-note { margin-right: 14px; margin-left: 14px; }
}