/* =============================================================================
   MONETIK - console de back-office.
   Palette pétrole sur neutres ardoise, IBM Plex Sans / Mono, menu « encre ».
   ========================================================================== */

@font-face { font-family: 'IBM Plex Sans'; font-weight: 400; font-style: normal; font-display: swap; src: url("../fonts/ibm-plex-sans-400.77bc02670657.woff2") format('woff2'); }
@font-face { font-family: 'IBM Plex Sans'; font-weight: 500; font-style: normal; font-display: swap; src: url("../fonts/ibm-plex-sans-500.f7016cd446d2.woff2") format('woff2'); }
@font-face { font-family: 'IBM Plex Sans'; font-weight: 600; font-style: normal; font-display: swap; src: url("../fonts/ibm-plex-sans-600.196e3cbc5fee.woff2") format('woff2'); }
@font-face { font-family: 'IBM Plex Mono'; font-weight: 400; font-style: normal; font-display: swap; src: url("../fonts/ibm-plex-mono-400.79936b18df9f.woff2") format('woff2'); }
@font-face { font-family: 'IBM Plex Mono'; font-weight: 500; font-style: normal; font-display: swap; src: url("../fonts/ibm-plex-mono-500.b1c8a895f5fd.woff2") format('woff2'); }
@font-face { font-family: 'Material Symbols Outlined'; font-weight: 400; font-style: normal; font-display: block; src: url("../fonts/material-symbols-outlined.5271877d4798.woff2") format('woff2'); }

:root {
  --primary: #0e5e6f;
  --primary-strong: #0a4654;
  --primary-container: #dcecef;
  --on-primary-container: #08323c;
  --info-container: #e4eef1;
  --error: #b3261e;
  --error-strong: #8f1d17;
  --error-container: #fbe6e3;
  --on-error-container: #5c0f0a;
  --success: #17663a;
  --success-container: #dff1e5;
  --on-success-container: #0b3a1f;
  --warning: #8a5a00;
  --warning-container: #fbefd4;
  --on-warning-container: #3d2700;

  --surface: #f3f5f6;
  --raised: #ffffff;
  --surface-container: #e9edf0;
  --surface-low: #f6f8f9;
  --on-surface: #0f1c22;
  --muted: #56646c;
  --outline: #8a979e;
  --line: #e0e5e8;
  --line-strong: #cfd7dc;

  --ink: #0b1a21;
  --ink-raised: #12252e;
  --ink-line: rgba(186, 214, 224, .1);
  --on-ink: #e6eef1;
  --on-ink-muted: #8ea3ad;
  --ink-accent: #7fd0df;

  --r-s: 6px;
  --r-m: 10px;
  --r-l: 14px;
  --shadow: 0 1px 2px rgba(11, 26, 33, .04), 0 2px 8px -2px rgba(11, 26, 33, .06);
  --shadow-overlay: 0 4px 12px rgba(11, 26, 33, .08), 0 24px 48px -12px rgba(11, 26, 33, .22);
  --ease: cubic-bezier(.2, .7, .2, 1);
  --font: 'IBM Plex Sans', system-ui, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--surface);
  color: var(--on-surface);
  font: 400 14px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; letter-spacing: -.015em; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
::selection { background: #bfe3ea; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
* { scrollbar-width: thin; scrollbar-color: #c6d0d5 transparent; }

.icon {
  font-family: 'Material Symbols Outlined';
  font-weight: normal;
  font-style: normal;
  font-size: 20px;
  line-height: 1;
  display: inline-block;
  width: 1em;
  height: 1em;
  overflow: hidden;
  white-space: nowrap;
  direction: ltr;
  letter-spacing: normal;
  text-transform: none;
  font-feature-settings: 'liga';
  -webkit-font-smoothing: antialiased;
  flex: none;
  user-select: none;
}
.icon.sm { font-size: 17px; }
.icon.lg { font-size: 24px; }

.mono { font-family: var(--mono); font-size: .93em; letter-spacing: -.01em; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }
.strong { font-weight: 600; }
.spacer { flex: 1 1 auto; }
.text-error { color: var(--error); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.eyebrow { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.grid-2, .grid-3, .grid-4 { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.split { display: grid; gap: 16px; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); align-items: start; }
.split-side { display: grid; gap: 16px; grid-template-columns: 360px minmax(0, 1fr); align-items: start; }
.split-wide { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr) 420px; align-items: start; }
@media (max-width: 1200px) { .split, .split-side, .split-wide { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 1100px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 700px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: minmax(0, 1fr); } }

/* -------------------------------------------------------------------------- */
/* Cadre : menu latéral (encre) et barre supérieure                           */
/* -------------------------------------------------------------------------- */

.skip-link {
  position: absolute; left: 12px; top: -48px; z-index: 100;
  padding: 8px 14px; border-radius: var(--r-m);
  background: var(--ink); color: #fff; font-weight: 500;
  transition: top 150ms var(--ease);
}
.skip-link:focus { top: 12px; }

.shell { display: grid; grid-template-columns: 256px minmax(0, 1fr); min-height: 100dvh; }
.shell.collapsed { grid-template-columns: 0 minmax(0, 1fr); }
.shell.collapsed .sidebar { visibility: hidden; }

.sidebar {
  position: sticky; top: 0; height: 100dvh; overflow-y: auto;
  display: flex; flex-direction: column;
  background: radial-gradient(120% 40% at 0% 0%, rgba(127, 208, 223, .07), transparent 70%), var(--ink);
  color: var(--on-ink);
  scrollbar-color: #2a3f48 transparent;
}
@media (min-width: 768px) and (max-width: 1199px) { .shell { grid-template-columns: 236px minmax(0, 1fr); } }

.brand { display: flex; align-items: center; gap: 12px; padding: 18px 20px 14px; color: inherit; }
.brand:hover { text-decoration: none; }
.brand__text { display: flex; flex-direction: column; }
.brand__name { font-size: 15px; font-weight: 600; letter-spacing: .14em; }
.brand__tagline { font-size: 12px; color: var(--on-ink-muted); }

.logo { flex: none; display: block; }
.logo .tile { fill: var(--primary); }
.logo .stroke { fill: none; stroke: #fff; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.logo .dot { fill: var(--ink-accent); }

.nav { flex: 1; padding: 4px 12px 16px; }
.nav__section + .nav__section { margin-top: 10px; }
.nav__title { padding: 6px 12px 4px; font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: #5f7680; }
.nav__item {
  position: relative; display: flex; align-items: center; gap: 12px;
  height: 34px; padding: 0 10px 0 12px; border-radius: 8px;
  color: #b7c6cd; font-size: 13.5px;
  transition: background-color 150ms var(--ease), color 150ms var(--ease);
}
.nav__item .icon { font-size: 19px; color: #6f8792; transition: color 150ms var(--ease); }
.nav__item:hover { background: rgba(186, 214, 224, .06); color: #fff; text-decoration: none; }
.nav__item:hover .icon { color: #b7c6cd; }
.nav__item:focus-visible { outline: 2px solid var(--ink-accent); outline-offset: -2px; }
.nav__item.active { background: var(--ink-raised); color: #fff; font-weight: 500; box-shadow: inset 0 0 0 1px var(--ink-line); }
.nav__item.active .icon { color: var(--ink-accent); }
.nav__item.active::before {
  content: ''; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px;
  border-radius: 0 3px 3px 0; background: var(--ink-accent);
}
.nav__label { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav__count {
  min-width: 20px; padding: 0 6px; border-radius: 6px;
  background: rgba(186, 214, 224, .12); color: #d6e2e7;
  font-size: 11.5px; font-weight: 600; line-height: 20px; text-align: center; font-variant-numeric: tabular-nums;
}
.nav__count.urgent { background: #c4382e; color: #fff; }

.rail-footer { display: flex; flex-direction: column; gap: 10px; padding: 14px 16px 18px; border-top: 1px solid var(--ink-line); }
.env {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--r-m);
  background: rgba(240, 180, 70, .08); box-shadow: inset 0 0 0 1px rgba(240, 180, 70, .18);
}
.env > span:last-child { display: flex; flex-direction: column; }
.env__name { font-size: 12.5px; font-weight: 600; color: #f3cf86; }
.env__hint { font-size: 11.5px; color: var(--on-ink-muted); }
.env__pulse { flex: none; width: 8px; height: 8px; border-radius: 50%; background: #f0b446; animation: pulse 2.4s var(--ease) infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(240, 180, 70, .45); } 70%, 100% { box-shadow: 0 0 0 7px rgba(240, 180, 70, 0); } }
.pci { display: flex; align-items: center; gap: 8px; padding: 0 4px; font-size: 11.5px; color: #6f8792; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 8px; height: 60px; padding: 0 20px 0 12px;
  background: rgba(243, 245, 246, .86); backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.crumbs { display: flex; align-items: center; gap: 4px; min-width: 0; font-size: 13.5px; }
.crumbs__section { color: var(--muted); white-space: nowrap; }
.crumbs__page { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crumbs .icon { font-size: 18px; color: var(--outline); }
.demo-badge {
  display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: 7px;
  background: var(--warning-container); color: var(--on-warning-container); font-size: 12.5px; font-weight: 500;
}
.shell:not(.collapsed) .demo-badge { display: none; }

.user { position: relative; margin-left: 4px; }
.user > summary {
  display: flex; align-items: center; gap: 10px; height: 44px; padding: 0 6px 0 4px;
  border-radius: var(--r-m); cursor: pointer; list-style: none; transition: background-color 150ms var(--ease);
}
.user > summary::-webkit-details-marker { display: none; }
.user > summary:hover { background: var(--surface-container); }
.user__text { display: flex; flex-direction: column; line-height: 1.2; }
.user__name { font-size: 13px; font-weight: 600; }
.user__role { font-size: 11.5px; color: var(--muted); }
.user .icon { color: var(--muted); }
.user__menu {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; min-width: 250px;
  background: var(--raised); border: 1px solid var(--line); border-radius: var(--r-m); box-shadow: var(--shadow-overlay);
}
.user__head { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.user__roles { margin-top: 2px; font-size: 12px; color: var(--muted); }
.menu-item {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 11px 16px;
  border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer;
}
.menu-item:hover { background: var(--surface-low); }
.avatar {
  display: inline-grid; place-items: center; flex: none; width: 32px; height: 32px; border-radius: 9px;
  background: var(--ink); color: var(--ink-accent); font-size: 12px; font-weight: 600; letter-spacing: .04em;
}
.avatar.lg { width: 40px; height: 40px; border-radius: 11px; font-size: 14px; }
@media (max-width: 600px) { .user__text, .crumbs__section, .crumbs .icon { display: none; } }

.page { width: 100%; max-width: 1440px; margin: 0 auto; padding: 28px 32px 56px; animation: page-in 260ms var(--ease) both; }
@keyframes page-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@media (max-width: 700px) { .page { padding: 20px 16px 40px; } }

/* Petits écrans : menu en surimpression. */
.scrim { display: none; }
@media (max-width: 767px) {
  .shell, .shell.collapsed { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; left: 0; top: 0; z-index: 40; width: 272px; transform: translateX(-100%); transition: transform 220ms var(--ease); visibility: visible !important; }
  .shell.menu-open .sidebar { transform: none; box-shadow: var(--shadow-overlay); }
  .shell.menu-open .scrim { display: block; position: fixed; inset: 0; z-index: 35; background: rgba(11, 26, 33, .42); }
  .shell .demo-badge { display: inline-flex; }
}

/* -------------------------------------------------------------------------- */
/* En-tête de page                                                            */
/* -------------------------------------------------------------------------- */

.page-header { margin-bottom: 24px; }
.page-header__back { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 10px; font-size: 13px; color: var(--muted); }
.page-header__back:hover { color: var(--on-surface); text-decoration: none; }
.page-header__row { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px 24px; }
.page-header h1 { font-size: 26px; line-height: 32px; font-weight: 600; letter-spacing: -.022em; }
.page-header p { margin-top: 6px; max-width: 72ch; color: var(--muted); }
.page-header__meta { margin-top: 10px; }
.page-header__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

/* -------------------------------------------------------------------------- */
/* Cartes                                                                     */
/* -------------------------------------------------------------------------- */

.card { background: var(--raised); border: 1px solid var(--line); border-radius: var(--r-l); box-shadow: var(--shadow); }
.card.clip { overflow: hidden; }
.card__header { display: flex; align-items: center; gap: 12px; padding: 18px 20px 12px; }
.card__titles { flex: 1; min-width: 0; }
.card__title { font-size: 15px; line-height: 22px; font-weight: 600; }
.card__subtitle { margin-top: 2px; font-size: 13px; color: var(--muted); }
.card__body { padding: 0 20px 20px; }
.card__body:first-child { padding-top: 18px; }
.card__footer { padding: 12px 20px; border-top: 1px solid var(--line); }
.card > .note { margin: 12px 20px; }

/* -------------------------------------------------------------------------- */
/* Boutons                                                                    */
/* -------------------------------------------------------------------------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 38px; padding: 0 16px; border: 1px solid transparent; border-radius: var(--r-m);
  font: 500 13.5px/1 var(--font); white-space: nowrap; cursor: pointer; text-decoration: none !important;
  transition: background-color 150ms var(--ease), border-color 150ms var(--ease), color 150ms var(--ease), transform 120ms var(--ease);
}
.btn .icon { font-size: 18px; }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled, .btn[aria-disabled='true'] { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--primary-strong); }
.btn-outline { background: var(--raised); border-color: var(--line-strong); color: var(--on-surface); }
.btn-outline:hover:not(:disabled) { border-color: var(--outline); background: var(--surface-low); }
.btn-text { background: transparent; color: var(--primary); padding: 0 10px; }
.btn-text:hover:not(:disabled) { background: var(--primary-container); }
.btn-danger { background: var(--error); color: #fff; }
.btn-danger:hover:not(:disabled) { background: var(--error-strong); }
.btn-danger-outline { background: var(--raised); border-color: #eab8b3; color: var(--error); }
.btn-danger-outline:hover:not(:disabled) { background: var(--error-container); }
.btn-danger-text { background: transparent; color: var(--error); padding: 0 10px; }
.btn-danger-text:hover:not(:disabled) { background: var(--error-container); }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover:not(:disabled) { background: #10502d; }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; }
.btn-lg { height: 46px; padding: 0 22px; font-size: 14.5px; }
.btn-block { width: 100%; }
.icon-btn {
  display: inline-grid; place-items: center; width: 38px; height: 38px; border: 0; border-radius: var(--r-m);
  background: transparent; color: var(--muted); cursor: pointer; transition: background-color 150ms var(--ease);
}
.icon-btn:hover { background: var(--surface-container); color: var(--on-surface); }
form.inline { display: inline; }

/* -------------------------------------------------------------------------- */
/* Formulaires                                                                */
/* -------------------------------------------------------------------------- */

.form-grid { display: grid; gap: 14px 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
.form-grid .full { grid-column: 1 / -1; }
.form-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 700px) { .form-grid, .form-grid.cols-3 { grid-template-columns: minmax(0, 1fr); } }

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .field__label { font-size: 13px; font-weight: 500; }
.field__label .opt { font-weight: 400; color: var(--muted); }
.field__help { font-size: 12px; color: var(--muted); }
.field__error { font-size: 12px; color: var(--error); }

.input, select.input, textarea.input {
  width: 100%; height: 42px; padding: 0 12px;
  border: 1px solid var(--line-strong); border-radius: var(--r-m); background: var(--raised);
  color: var(--on-surface); font: 400 14px var(--font);
  transition: border-color 150ms var(--ease), box-shadow 150ms var(--ease);
}
textarea.input { height: auto; min-height: 84px; padding: 10px 12px; line-height: 1.45; resize: vertical; }
select.input {
  appearance: none; padding-right: 34px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 4.5 6 8l3.5-3.5' fill='none' stroke='%2356646c' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}
.input:hover { border-color: var(--outline); }
.input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(14, 94, 111, .14); }
.input.mono { font-family: var(--mono); letter-spacing: .02em; }
.input[aria-invalid='true'] { border-color: var(--error); }
.input-group { position: relative; display: flex; align-items: center; }
.input-group > .icon { position: absolute; left: 12px; color: var(--muted); pointer-events: none; }
.input-group > .input { padding-left: 40px; }
.input-group > .suffix { position: absolute; right: 12px; font-size: 13px; color: var(--muted); pointer-events: none; }
.input-group > .reveal { position: absolute; right: 4px; }
.check { display: inline-flex; align-items: center; gap: 10px; min-height: 42px; cursor: pointer; font-size: 14px; }
.check input { width: 18px; height: 18px; accent-color: var(--primary); }

/* Barre de filtres au-dessus d'un tableau. */
.toolbar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 12px; padding: 16px 20px; }
.toolbar .field { width: 220px; }
.toolbar .field.wide { flex: 1 1 280px; width: auto; }
.toolbar .input, .toolbar .btn { height: 40px; }
@media (max-width: 700px) { .toolbar .field { width: 100%; } }

/* Segments (choix exclusif). */
.segmented { display: inline-flex; flex-wrap: wrap; border: 1px solid var(--line-strong); border-radius: var(--r-m); overflow: hidden; background: var(--raised); }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented label, .segmented a {
  display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 14px;
  font-size: 13px; font-weight: 500; color: var(--on-surface); cursor: pointer; text-decoration: none;
  transition: background-color 150ms var(--ease);
}
.segmented label + label, .segmented a + a { border-left: 1px solid var(--line); }
.segmented label:hover, .segmented a:hover { background: var(--surface-low); }
.segmented input:checked + label, .segmented a.active { background: var(--ink); color: #fff; }
.segmented input:focus-visible + label { outline: 2px solid var(--primary); outline-offset: -2px; }

/* -------------------------------------------------------------------------- */
/* Tableaux                                                                   */
/* -------------------------------------------------------------------------- */

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
.table th {
  height: 40px; padding: 0 12px; text-align: left; white-space: nowrap;
  font-size: 12px; font-weight: 500; letter-spacing: .01em; color: var(--muted);
  background: var(--surface-low); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  position: sticky; top: 0;
}
.table td { padding: 9px 12px; line-height: 18px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table th:first-child, .table td:first-child { padding-left: 20px; }
.table th:last-child, .table td:last-child { padding-right: 20px; }
.table th.num, .table td.num { text-align: right; }
.table tbody tr { transition: background-color 120ms var(--ease); }
.table tbody tr:hover { background: var(--surface-low); }
.table tr[data-href] { cursor: pointer; }
.table tr[data-href]:hover td:first-child { box-shadow: inset 2px 0 0 var(--primary); }
.table tr.inactive td { opacity: .5; }
.table .sub { display: block; font-size: 12px; color: var(--muted); }
.table-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 20px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }

/* Liste de propriétés. */
.kv { display: grid; gap: 18px 24px; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); margin: 0; }
.kv dt { margin-bottom: 3px; font-size: 12px; color: var(--muted); }
.kv dd { margin: 0; font-weight: 500; }

/* -------------------------------------------------------------------------- */
/* Pastilles, codes, messages                                                 */
/* -------------------------------------------------------------------------- */

.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px 0 7px;
  border-radius: 6px; font-size: 12px; font-weight: 500; white-space: nowrap; vertical-align: middle;
}
.chip::before { content: ''; flex: none; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.chip.success { background: var(--success-container); color: #155c34; }
.chip.error { background: var(--error-container); color: #9c1f18; }
.chip.warning { background: var(--warning-container); color: #7a4f00; }
.chip.info { background: var(--info-container); color: #0c4c5a; }
.chip.primary { background: var(--primary-container); color: var(--on-primary-container); }
.chip.neutral { background: var(--surface-container); color: var(--muted); }

.rc { display: inline-flex; align-items: center; gap: 8px; }
.rc__code {
  min-width: 26px; padding: 1px 6px; border-radius: 5px; text-align: center;
  font: 500 12px/18px var(--mono); background: var(--error-container); color: #9c1f18;
  box-shadow: inset 0 0 0 1px rgba(179, 38, 30, .14);
}
.rc__code.ok { background: var(--success-container); color: #155c34; box-shadow: inset 0 0 0 1px rgba(23, 102, 58, .14); }
.rc__label { font-size: 13px; color: var(--muted); }

.note {
  display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; border-radius: var(--r-m);
  border: 1px solid #c7e0e6; background: var(--primary-container); color: var(--on-primary-container);
  font-size: 13.5px; line-height: 20px;
}
.note .icon { margin-top: 0; }
.note a { color: inherit; font-weight: 600; text-decoration: underline; }
.note.warn { background: var(--warning-container); border-color: #f0d9a4; color: var(--on-warning-container); }
.note.error { background: var(--error-container); border-color: #f1c4be; color: var(--on-error-container); }
.note.success { background: var(--success-container); border-color: #b9dfc6; color: var(--on-success-container); }

.empty { display: flex; flex-direction: column; align-items: center; padding: 48px 24px 52px; text-align: center; }
.empty .icon {
  display: grid; place-items: center; width: 52px; height: 52px; margin-bottom: 14px; border-radius: 14px;
  font-size: 26px; color: var(--primary); background: var(--primary-container); box-shadow: inset 0 0 0 1px #c7e0e6;
}
.empty__title { font-size: 15px; font-weight: 600; }
.empty__text { margin-top: 6px; max-width: 46ch; color: var(--muted); }

/* Notifications. */
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 60; display: flex; flex-direction: column; gap: 8px; max-width: min(440px, calc(100vw - 40px)); }
.toast {
  display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; border-radius: var(--r-m);
  background: var(--ink); color: #fff; box-shadow: var(--shadow-overlay); font-size: 13.5px;
  animation: toast-in 260ms var(--ease) both;
}
.toast.success { background: #0f4a2a; }
.toast.error { background: #7a1712; }
.toast .icon-btn { width: 24px; height: 24px; margin-left: auto; color: rgba(255, 255, 255, .7); }
.toast .icon-btn:hover { background: rgba(255, 255, 255, .1); color: #fff; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* -------------------------------------------------------------------------- */
/* Onglets                                                                    */
/* -------------------------------------------------------------------------- */

.tabs { display: flex; gap: 4px; padding: 0 12px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tab {
  position: relative; display: inline-flex; align-items: center; gap: 8px; height: 46px; padding: 0 12px;
  border: 0; background: none; color: var(--muted); font: 500 14px var(--font); white-space: nowrap; cursor: pointer;
  text-decoration: none !important;
}
.tab:hover { color: var(--on-surface); }
.tab[aria-selected='true'] { color: var(--primary); }
.tab[aria-selected='true']::after { content: ''; position: absolute; left: 8px; right: 8px; bottom: -1px; height: 2px; border-radius: 2px 2px 0 0; background: var(--primary); }
.tab .count { min-width: 20px; padding: 0 6px; border-radius: 6px; background: var(--surface-container); color: var(--muted); font-size: 11.5px; line-height: 18px; text-align: center; }
.tab-panel[hidden] { display: none; }

/* -------------------------------------------------------------------------- */
/* Fenêtres (dialog) et panneau latéral                                       */
/* -------------------------------------------------------------------------- */

dialog.dialog {
  width: min(560px, calc(100vw - 32px)); max-height: calc(100dvh - 48px); padding: 0;
  border: 0; border-radius: var(--r-l); background: var(--raised); color: inherit; box-shadow: var(--shadow-overlay);
}
dialog.dialog.wide { width: min(760px, calc(100vw - 32px)); }
dialog.dialog::backdrop { background: rgba(11, 26, 33, .42); }
dialog.dialog[open] { animation: dialog-in 200ms var(--ease) both; }
@keyframes dialog-in { from { opacity: 0; transform: translateY(8px) scale(.99); } to { opacity: 1; transform: none; } }
.dialog > form, .dialog > .dialog__inner { display: flex; flex-direction: column; max-height: calc(100dvh - 48px); }
.dialog__head { display: flex; align-items: flex-start; gap: 12px; padding: 22px 16px 6px 24px; }
.dialog__head h2 { flex: 1; font-size: 18px; line-height: 26px; font-weight: 600; }
.dialog__body { padding: 8px 24px 8px; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; }
.dialog__body > p { color: var(--muted); }
.dialog__actions { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 24px 20px; }

dialog.panel {
  position: fixed; inset: 0 0 0 auto; margin: 0; width: min(580px, 100vw); height: 100dvh; max-height: none; max-width: none;
  padding: 0; border: 0; border-radius: var(--r-l) 0 0 var(--r-l); background: var(--raised); color: inherit; box-shadow: var(--shadow-overlay);
}
dialog.panel::backdrop { background: rgba(11, 26, 33, .42); }
dialog.panel[open] { animation: panel-in 240ms var(--ease) both; }
@keyframes panel-in { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }
.panel__inner { display: flex; flex-direction: column; height: 100%; }
.panel__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 22px 16px 14px 24px; border-bottom: 1px solid var(--line); }
.panel__head h2 { margin-bottom: 8px; font-size: 20px; font-weight: 600; }
.panel__body { flex: 1; overflow-y: auto; padding: 20px 24px; display: flex; flex-direction: column; gap: 20px; }
.panel__foot { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; padding: 14px 24px 18px; border-top: 1px solid var(--line); }
.amount-box { padding: 16px 18px; border-radius: var(--r-m); background: var(--surface-low); border: 1px solid var(--line); }
.amount-box__value { font-size: 28px; line-height: 36px; font-weight: 500; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.quote { padding: 12px 14px; border-left: 3px solid var(--line); border-radius: 0 var(--r-s) var(--r-s) 0; background: var(--surface-low); }

/* -------------------------------------------------------------------------- */
/* Tableau de bord                                                            */
/* -------------------------------------------------------------------------- */

.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); background: var(--raised); border: 1px solid var(--line); border-radius: var(--r-l); box-shadow: var(--shadow); }
.kpi { position: relative; min-width: 0; padding: 18px 22px 20px; }
.kpi + .kpi { border-left: 1px solid var(--line); }
.kpi__label { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.kpi__label .icon { font-size: 17px; color: var(--primary); }
.kpi__value { margin-top: 10px; font-size: 32px; line-height: 38px; font-weight: 500; letter-spacing: -.03em; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi__value.money { font-size: 28px; }
.kpi__sub { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin-top: 6px; font-size: 12.5px; color: var(--muted); }
.kpi__sub .dot ~ .dot { margin-left: 8px; }
.kpi.warn .kpi__label .icon { color: var(--warning); }
.kpi.warn::after { content: ''; position: absolute; left: 22px; right: 22px; top: 0; height: 2px; border-radius: 0 0 2px 2px; background: #d79b2a; }
@media (max-width: 1100px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi:nth-child(3) { border-left: 0; }
  .kpi:nth-child(n + 3) { border-top: 1px solid var(--line); }
}
@media (max-width: 600px) { .kpis { grid-template-columns: minmax(0, 1fr); } .kpi + .kpi { border-left: 0; border-top: 1px solid var(--line); } }
.meter { height: 6px; margin-top: 14px; border-radius: 3px; background: var(--error-container); overflow: hidden; }
.meter > span { display: block; height: 100%; border-radius: 3px; background: var(--success); }
.dot { display: inline-block; flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--outline); }
.dot.ok { background: #2e9a5c; }
.dot.ko { background: #c4382e; }
.dot.warn { background: #d79b2a; }

.linklist { padding: 0 8px 10px; }
.linklist__item {
  display: flex; align-items: center; gap: 12px; min-height: 42px; padding: 4px 8px 4px 12px; border-radius: var(--r-m);
  color: inherit; font-size: 13px; line-height: 17px; transition: background-color 120ms var(--ease);
}
.linklist__item + .linklist__item { box-shadow: inset 0 1px 0 var(--line); }
.linklist__item:hover { background: var(--surface-low); text-decoration: none; }
.linklist__item:hover, .linklist__item:hover + .linklist__item { box-shadow: none; }
.linklist__item > .icon { font-size: 18px; color: var(--outline); opacity: .5; transition: opacity 120ms, transform 120ms var(--ease); }
.linklist__item:hover > .icon { opacity: 1; transform: translateX(2px); }
.linklist__dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: #2e9a5c; }
.linklist__label { flex: 1; min-width: 0; }
.linklist__count { min-width: 24px; padding: 0 7px; border-radius: 6px; font-size: 12.5px; font-weight: 600; line-height: 22px; text-align: center; background: var(--surface-container); color: var(--muted); }
.linklist__item.ok .linklist__label { color: var(--muted); }
.linklist__item.warn .linklist__dot { background: #d79b2a; }
.linklist__item.warn .linklist__count { background: var(--warning-container); color: var(--on-warning-container); }
.linklist__item.critical .linklist__dot { background: #c4382e; box-shadow: 0 0 0 3px rgba(196, 56, 46, .15); }
.linklist__item.critical .linklist__label { font-weight: 500; }
.linklist__item.critical .linklist__count { background: #c4382e; color: #fff; }
.figure-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px; border-radius: var(--r-m); color: inherit; }
.figure-row:hover { background: var(--surface-low); text-decoration: none; }
.figure-row + .figure-row { box-shadow: inset 0 1px 0 var(--line); }
.figure-row__label { display: flex; align-items: center; gap: 10px; font-size: 13.5px; color: var(--muted); }
.figure-row__value { font-size: 22px; font-weight: 500; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat { padding: 16px 18px; border-radius: var(--r-m); background: var(--surface-low); border: 1px solid var(--line); }
.stat__label { font-size: 13px; color: var(--muted); }
.stat__value { margin-top: 6px; font-size: 22px; font-weight: 500; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.chart-box { position: relative; }

/* -------------------------------------------------------------------------- */
/* Visuel de carte et terminal simulé                                         */
/* -------------------------------------------------------------------------- */

.card-visual {
  position: relative; display: flex; flex-direction: column; justify-content: space-between;
  aspect-ratio: 1.586; max-width: 360px; padding: 22px 24px; border-radius: 16px; overflow: hidden; color: #fff;
  background: radial-gradient(120% 90% at 100% 0%, rgba(127, 208, 223, .32), transparent 55%), linear-gradient(150deg, #155f6f, #0b3943 72%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .14), 0 2px 6px rgba(11, 26, 33, .12), 0 18px 36px -14px rgba(8, 50, 60, .55);
}
.card-visual.inactive { background: radial-gradient(120% 90% at 100% 0%, rgba(255, 255, 255, .12), transparent 55%), linear-gradient(150deg, #6c7981, #3c4950 72%); }
.card-visual__top { display: flex; justify-content: space-between; font-size: 13px; letter-spacing: .2em; }
.card-visual__top strong { font-style: italic; letter-spacing: .02em; }
.card-visual__chip { width: 44px; height: 32px; border-radius: 6px; background: linear-gradient(135deg, #e9d3a0, #b8955a); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .15); }
.card-visual__pan { font: 500 19px var(--mono); letter-spacing: .08em; }
.card-visual__bottom { display: flex; justify-content: space-between; align-items: flex-end; font-size: 13px; }
.card-visual__bottom small { display: block; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; opacity: .7; }
.card-visual__stamp { position: absolute; top: 56px; right: 20px; padding: 2px 8px; border: 2px solid rgba(255, 255, 255, .85); border-radius: 4px; transform: rotate(-8deg); font-size: 12px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; }

.terminal { padding: 16px; border-radius: 28px; background: linear-gradient(180deg, #1b3039, var(--ink)); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08), 0 24px 48px -18px rgba(11, 26, 33, .55); }
.terminal__top { display: flex; justify-content: space-between; padding: 0 8px 12px; color: var(--on-ink-muted); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; }
.terminal__top .up { color: #7ee2a1; }
.terminal__top .down { color: #f3cf86; }
.terminal__screen { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 250px; padding: 24px; border-radius: 18px; background: #071216; box-shadow: inset 0 0 0 1px var(--ink-line); color: #fff; text-align: center; }
.terminal__screen.ok { background: #0f4a2a; }
.terminal__screen.ko { background: #7a1712; }
.terminal__screen .small { font-size: 13px; opacity: .8; }
.terminal__screen .big { font-size: 26px; font-weight: 500; font-variant-numeric: tabular-nums; }
.terminal__screen .icon { font-size: 52px; }

/* Chronologie. */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 18px 26px; }
.timeline li::before { content: ''; position: absolute; left: 5px; top: 18px; bottom: -2px; width: 2px; background: var(--line); }
.timeline li:last-child::before { display: none; }
.timeline li::after { content: ''; position: absolute; left: 0; top: 5px; width: 12px; height: 12px; border-radius: 50%; background: var(--primary); box-shadow: 0 0 0 3px var(--raised); }
.timeline li.ko::after { background: #c4382e; }
.timeline li.warn::after { background: #d79b2a; }
.timeline__title { font-weight: 500; }
.timeline__meta { font-size: 12px; color: var(--muted); }

/* Page de connexion. */
.login { min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); background: var(--raised); }
.login__intro {
  position: relative; display: flex; flex-direction: column; justify-content: space-between; gap: 40px; padding: 40px 56px; overflow: hidden; color: var(--on-ink);
  background: radial-gradient(70% 55% at 85% 20%, rgba(127, 208, 223, .12), transparent 70%), radial-gradient(60% 50% at 10% 100%, rgba(14, 94, 111, .45), transparent 70%), var(--ink);
}
.login__intro > :not(.login__grid) { position: relative; }
.login__grid { position: absolute; inset: 0; background-image: linear-gradient(rgba(186, 214, 224, .05) 1px, transparent 1px), linear-gradient(90deg, rgba(186, 214, 224, .05) 1px, transparent 1px); background-size: 32px 32px; mask-image: radial-gradient(80% 70% at 60% 40%, #000 30%, transparent 85%); }
.login__brand { display: flex; align-items: center; gap: 12px; font-size: 15px; font-weight: 600; letter-spacing: .16em; }
.login__eyebrow { margin-bottom: 14px; font-size: 12px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-accent); }
.login__title { max-width: 520px; font-size: clamp(28px, 2.6vw, 38px); line-height: 1.15; font-weight: 500; letter-spacing: -.025em; text-wrap: balance; }
.login__facts { display: flex; flex-wrap: wrap; gap: 10px 24px; margin: 0; padding: 0; list-style: none; font-size: 13px; color: var(--on-ink-muted); }
.login__facts li { display: flex; align-items: center; gap: 8px; }
.login__facts .icon { font-size: 17px; color: var(--ink-accent); }
.login-visual { position: relative; margin-top: 44px; height: 230px; }
.login-visual__card {
  position: absolute; left: 0; top: 0; width: 340px; height: 212px; padding: 22px 24px; display: flex; flex-direction: column; justify-content: space-between; border-radius: 16px;
  background: radial-gradient(120% 90% at 100% 0%, rgba(127, 208, 223, .35), transparent 55%), linear-gradient(150deg, #155f6f, #0b3943 70%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .14), 0 30px 60px -20px rgba(0, 0, 0, .6); transform: rotate(-4deg);
}
.login-visual__pan { font: 500 19px var(--mono); letter-spacing: .08em; color: #fff; }
.login-visual__foot { font-size: 12px; color: rgba(230, 238, 241, .7); }
.login-visual__trace {
  position: absolute; left: 236px; top: 136px; min-width: 210px; padding: 14px 16px; border-radius: 12px;
  background: rgba(18, 37, 46, .82); backdrop-filter: blur(8px); box-shadow: inset 0 0 0 1px var(--ink-line), 0 20px 40px -16px rgba(0, 0, 0, .55);
  font: 12.5px var(--mono);
}
.login-visual__trace > div { display: flex; justify-content: space-between; gap: 18px; padding: 3px 0; }
.login-visual__trace .k { color: var(--on-ink-muted); }
.login-visual__trace .ok { color: #7ee2a1; }
@media (max-width: 1180px) { .login-visual__trace { left: 180px; } }
.login__panel { display: grid; place-items: center; padding: 40px 24px; }
.login__form { width: 100%; max-width: 380px; }
.login__panel-brand { display: none; align-items: center; gap: 10px; margin-bottom: 40px; font-size: 14px; font-weight: 600; letter-spacing: .16em; }
.login__form h1 { font-size: 28px; line-height: 36px; font-weight: 600; letter-spacing: -.02em; }
.login__lead { margin: 6px 0 28px; color: var(--muted); }
.login__form .field + .field { margin-top: 16px; }
.login__form .btn { margin-top: 22px; }
.login__legal { display: flex; gap: 10px; margin-top: 32px; padding-top: 20px; border-top: 1px solid var(--line); font-size: 12.5px; line-height: 18px; color: var(--muted); }
.login__legal .icon { font-size: 18px; color: var(--primary); }
@media (max-width: 959px) { .login { grid-template-columns: minmax(0, 1fr); } .login__intro { display: none; } .login__panel-brand { display: flex; } }

.error-page { display: grid; place-items: center; min-height: 60vh; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

.input[readonly] { background: var(--surface-low); color: var(--muted); cursor: default; }
.rc { white-space: nowrap; }
.segmented { align-self: flex-start; max-width: 100%; }
