/* Renal Care admin panel. French, left to right. Colours from the site's design tokens, font of the site (Inter). */

@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url(fonts/inter-latin-wght-normal.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url(fonts/inter-latin-ext-wght-normal.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  --navy: #0b2540; --navy-deep: #071a2e; --navy-raised: #12324f; --navy-line: #1b4566;
  --on-navy: #eef6fb; --on-navy-muted: #a9c3d6; --accent-on-navy: #9fd3ef;
  --blue: #006fa5; --blue-hover: #005783; --blue-active: #004063; --blue-tint: #e6f2f9; --blue-soft: #dcf2ff;
  --ink: #0b2540; --ink-2: #3e4950; --ink-3: #5d686f;
  --page: #f3f7fa; --card: #ffffff; --sunken: #eef4f8; --hover: #f6fafc;
  --line: #dde4e9; --line-input: #c5d0d7; --line-strong: #778289;
  --red: #b6292d; --red-text: #901e21; --red-bg: #ffebe7; --red-line: #f3c7c2;
  --green: #17803d; --green-text: #0f602c; --green-bg: #e7f8ec; --green-line: #b9e6c8;
  --amber-text: #7a4a00; --amber-bg: #fff3d6; --amber-line: #f2d793;
  --blood: #c0353b; --dialysate: #30a3dc;
  --radius-sm: 8px; --radius: 10px; --radius-lg: 14px; --radius-xl: 18px;
  --shadow-card: 0 1px 2px rgb(11 37 64 / 0.05), 0 4px 16px rgb(11 37 64 / 0.05);
  --shadow-pop: 0 18px 48px rgb(11 37 64 / 0.24);
  --ring: 0 0 0 3px rgb(0 111 165 / 0.18);
  --font: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  --sidebar-w: 272px;
  --topbar-h: 64px;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 400 14.5px/1.6 var(--font); color: var(--ink); background: var(--page); }
img, svg { display: block; max-width: 100%; }
a { color: var(--blue); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--blue-hover); }
h1, h2, h3, h4 { margin: 0; line-height: 1.35; font-weight: 700; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid rgb(0 111 165 / 0.45); outline-offset: 2px; }
::selection { background: var(--blue-soft); }

.icon { width: 20px; height: 20px; flex: none; }
.icon--sm { width: 16px; height: 16px; }
.icon--lg { width: 24px; height: 24px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; inset-inline-start: 12px; top: -60px; z-index: 100; background: var(--card); padding: 8px 14px; border-radius: var(--radius); }
.skip:focus { top: 12px; }
.muted { color: var(--ink-3); }
.small { font-size: 13px; }
.ltr { direction: ltr; unicode-bidi: isolate; }
.fr { direction: ltr; text-align: left; unicode-bidi: plaintext; }
.mono { font-family: Consolas, "Cascadia Mono", monospace; font-size: 13px; direction: ltr; unicode-bidi: isolate; }
.nowrap { white-space: nowrap; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row--end { justify-content: flex-end; }
.stack { display: grid; gap: 16px; }
.spacer { flex: 1; }
hr.sep { border: 0; border-top: 1px solid var(--line); margin: 18px 0; }

/* ---------------------------------------------------------------- shell */
.shell { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column;
  background: linear-gradient(180deg, var(--navy) 0%, var(--navy-deep) 100%); color: var(--on-navy); padding: 18px 14px;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 4px 10px 18px; border-bottom: 1px solid var(--navy-line); color: inherit; text-decoration: none; }
.brand svg { height: 36px; width: auto; }
.brand__word { direction: ltr; font-weight: 700; font-size: 19px; letter-spacing: -0.01em; line-height: 1.1; }
.brand__word .renal { color: var(--on-navy); }
.brand__word .care { color: var(--accent-on-navy); font-weight: 600; }
.brand__sub { display: block; font-size: 12px; color: var(--on-navy-muted); font-weight: 500; margin-top: 3px; }
.nav-group { margin-top: 18px; }
.nav-label { font-size: 12px; color: var(--on-navy-muted); padding: 0 12px 6px; font-weight: 600; }
.nav-link {
  position: relative; display: flex; align-items: center; gap: 12px; padding: 9px 12px; margin-block: 2px;
  border-radius: var(--radius); color: var(--on-navy); text-decoration: none; font-weight: 500; transition: background-color 0.15s;
}
.nav-link .icon { color: var(--on-navy-muted); }
.nav-link:hover { background: var(--navy-raised); color: #fff; }
.nav-link[aria-current="page"] { background: var(--navy-raised); color: #fff; font-weight: 600; }
.nav-link[aria-current="page"] .icon { color: var(--accent-on-navy); }
.nav-link[aria-current="page"]::before { content: ""; position: absolute; inset-inline-start: -14px; top: 8px; bottom: 8px; width: 4px; border-radius: 4px; background: var(--accent-on-navy); }
.nav-count { margin-inline-start: auto; min-width: 26px; height: 22px; padding: 0 7px; border-radius: 999px; display: inline-grid; place-items: center; font-size: 12px; font-weight: 600; background: rgb(255 255 255 / 0.1); color: var(--on-navy); }
.nav-count--alert { background: #f0b429; color: #3d2600; }
.sidebar__foot { margin-top: auto; padding-top: 16px; border-top: 1px solid var(--navy-line); display: grid; gap: 4px; }
.sidebar__foot form { margin: 0; }
.sidebar__foot .nav-link { width: 100%; background: none; border: 0; cursor: pointer; text-align: start; }
.sidebar__foot .nav-link:hover { background: var(--navy-raised); }
.nav-link--user span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-user { display: flex; align-items: center; gap: 10px; margin: 0; padding: 8px 12px; color: var(--on-navy); font-size: 14px; }
.nav-user .icon { color: var(--on-navy-muted); flex: none; }
.nav-user span { display: grid; min-width: 0; }
.nav-user small { color: var(--on-navy-muted); font-size: 12px; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20; height: var(--topbar-h); display: flex; align-items: center; gap: 14px; padding: 0 28px;
  background: rgb(255 255 255 / 0.92); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line);
}
.topbar .topbar__menu { display: none; }
.crumbs { display: flex; align-items: center; gap: 6px; color: var(--ink-3); font-size: 14px; min-width: 0; }
.crumbs a { color: var(--ink-3); text-decoration: none; }
.crumbs a:hover { color: var(--blue); }
.crumbs .icon { width: 14px; height: 14px; }
.crumbs strong { color: var(--ink); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar__actions { margin-inline-start: auto; display: flex; align-items: center; gap: 10px; }
.changes-pill { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 12px; border-radius: 999px; font-size: 13.5px; font-weight: 600; text-decoration: none; background: var(--amber-bg); color: var(--amber-text); border: 1px solid var(--amber-line); }
.changes-pill:hover { color: var(--amber-text); filter: brightness(0.98); }
.changes-pill--ok { background: var(--green-bg); color: var(--green-text); border-color: var(--green-line); }
.changes-pill--ok:hover { color: var(--green-text); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }

.content { width: 100%; max-width: 1320px; margin-inline: auto; padding: 28px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head h1 { font-size: 25px; letter-spacing: -0.005em; }
.page-sub { color: var(--ink-3); margin-top: 4px; font-size: 14.5px; }

/* ---------------------------------------------------------------- cards and layout */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-card); }
.card + .card { margin-top: 20px; }
.grid > .card + .card, .grid > .card, .kpi-row > .card, .events-row > .card { margin-top: 0; }
.card__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 15px 20px; border-bottom: 1px solid var(--line); }
.card__head h2 { font-size: 16px; font-weight: 700; display: flex; align-items: center; gap: 10px; }
.card__head h2 .icon { color: var(--blue); }
.card__head .card__sub { color: var(--ink-3); font-size: 13px; font-weight: 500; }
.card__body { padding: 20px; }
.card__body--flush { padding: 0; }
.card__foot { padding: 14px 20px; border-top: 1px solid var(--line); background: var(--hover); border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.grid { display: grid; gap: 20px; }
.grid--stats { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.layout-edit { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 20px; align-items: start; }
/* grid children may shrink below their longest line: long URLs and previews then ellipsize instead of widening the page */
.grid > *, .layout-edit > *, .layout-edit > aside > *, .form-grid > *, .stack > * { min-width: 0; }
.layout-edit > aside { position: sticky; top: calc(var(--topbar-h) + 20px); display: grid; gap: 20px; }
.layout-edit > aside .card + .card { margin-top: 0; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; }
.form-grid .span-2 { grid-column: 1 / -1; }

.stat { display: flex; align-items: center; gap: 14px; padding: 18px 20px; }
.stat__icon { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; background: var(--blue-tint); color: var(--blue); flex: none; }
.stat__icon--red { background: var(--red-bg); color: var(--blood); }
.stat__icon--amber { background: var(--amber-bg); color: var(--amber-text); }
.stat__icon--green { background: var(--green-bg); color: var(--green); }
.stat__num { display: block; font-size: 26px; font-weight: 700; line-height: 1.15; }
.stat__label { display: block; color: var(--ink-3); font-size: 13.5px; font-weight: 500; margin-top: 2px; }
a.stat { color: inherit; text-decoration: none; transition: background-color 0.15s; border-radius: var(--radius-lg); }
a.stat:hover { background: var(--hover); color: inherit; }

/* ---------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px;
  border-radius: var(--radius); border: 1px solid transparent; font-weight: 600; font-size: 14.5px; line-height: 1;
  cursor: pointer; text-decoration: none; white-space: nowrap; transition: background-color 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s;
}
.btn .icon { width: 18px; height: 18px; }
.btn--primary { background: var(--blue); color: #fff; box-shadow: 0 1px 2px rgb(0 64 99 / 0.2); }
.btn--primary:hover { background: var(--blue-hover); color: #fff; }
.btn--primary:active { background: var(--blue-active); }
.btn--secondary { background: var(--card); border-color: var(--line-input); color: var(--ink); }
.btn--secondary:hover { background: var(--sunken); color: var(--ink); }
.btn--ghost { background: transparent; color: var(--ink-2); }
.btn--ghost:hover { background: var(--sunken); color: var(--ink); }
.btn--danger { background: var(--card); border-color: var(--red-line); color: var(--red-text); }
.btn--danger:hover { background: var(--red-bg); color: var(--red-text); }
.btn--danger-solid { background: var(--red); color: #fff; }
.btn--danger-solid:hover { background: var(--red-text); color: #fff; }
.btn--success { background: var(--green); color: #fff; }
.btn--success:hover { background: var(--green-text); color: #fff; }
.btn--sm { height: 32px; padding: 0 11px; font-size: 13.5px; border-radius: var(--radius-sm); gap: 6px; }
.btn--sm .icon { width: 16px; height: 16px; }
.btn--lg { height: 46px; padding: 0 22px; font-size: 15.5px; }
.btn--icon { width: 36px; padding: 0; }
.btn--icon.btn--sm { width: 32px; }
.btn--block { width: 100%; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; pointer-events: none; }
.btn.is-busy { position: relative; color: transparent !important; pointer-events: none; }
.btn.is-busy::after { content: ""; position: absolute; width: 18px; height: 18px; border-radius: 50%; border: 2px solid rgb(255 255 255 / 0.5); border-top-color: #fff; animation: spin 0.8s linear infinite; }
.btn--secondary.is-busy::after { border-color: rgb(11 37 64 / 0.2); border-top-color: var(--ink); }
@keyframes spin { to { transform: rotate(360deg); } }
form.inline { display: inline; margin: 0; }

/* ---------------------------------------------------------------- forms */
.field { display: grid; gap: 6px; margin-bottom: 18px; align-content: start; }
.field:last-child { margin-bottom: 0; }
.field__label { font-size: 14px; font-weight: 600; color: var(--ink); display: flex; align-items: center; gap: 8px; }
.field__label .req { color: var(--red-text); font-weight: 700; }
.lang-tag { display: inline-flex; align-items: center; height: 19px; padding: 0 7px; border-radius: 999px; background: var(--sunken); color: var(--ink-3); font-size: 11.5px; font-weight: 600; direction: ltr; }
.field__hint { font-size: 13px; color: var(--ink-3); }
.field__error { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--red-text); font-weight: 500; }
.field__error .icon { width: 15px; height: 15px; }
.input, input[type="text"], input[type="search"], input[type="password"], input[type="url"], input[type="email"], input[type="number"], input[type="tel"], input[type="date"], select, textarea {
  width: 100%; height: 42px; padding: 0 12px; border: 1px solid var(--line-input); border-radius: var(--radius);
  background: var(--card); transition: border-color 0.15s, box-shadow 0.15s;
}
textarea { height: auto; min-height: 104px; padding: 10px 12px; line-height: 1.6; resize: vertical; }
select { padding-inline-end: 34px; appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235d686f' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-size: 18px; background-position: right 10px center; }
input:hover, select:hover, textarea:hover { border-color: var(--line-strong); }
input:focus, select:focus, textarea:focus { border-color: var(--blue); box-shadow: var(--ring); outline: none; }
[aria-invalid="true"] { border-color: var(--red) !important; }
input::placeholder, textarea::placeholder { color: #8b979f; }
.input-affix { display: flex; align-items: stretch; border: 1px solid var(--line-input); border-radius: var(--radius); background: var(--card); overflow: hidden; direction: ltr; }
.input-affix:focus-within { border-color: var(--blue); box-shadow: var(--ring); }
.input-affix span { display: flex; align-items: center; padding: 0 10px; background: var(--sunken); color: var(--ink-3); font-size: 13.5px; border-inline-end: 1px solid var(--line); white-space: nowrap; }
.input-affix input { border: 0; border-radius: 0; box-shadow: none !important; }
.counter { font-size: 12.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.counter.is-bad { color: var(--red-text); font-weight: 600; }
.counter.is-ok { color: var(--green-text); }
.check { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; }
.check input { width: 18px; height: 18px; margin-top: 3px; accent-color: var(--blue); flex: none; }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; cursor: pointer; }
.switch input { appearance: none; width: 46px; height: 26px; border-radius: 999px; background: #c5d0d7; position: relative; cursor: pointer; transition: background-color 0.2s; flex: none; margin: 0; }
.switch input::after { content: ""; position: absolute; top: 3px; inset-inline-start: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgb(0 0 0 / 0.25); transition: inset-inline-start 0.2s; }
.switch input:checked { background: var(--green); }
.switch input:checked::after { inset-inline-start: 23px; }
.switch__text strong { display: block; font-size: 14.5px; }
.switch__text span { font-size: 13px; color: var(--ink-3); }

/* ---------------------------------------------------------------- tables */
.shell > * { min-width: 0; }   /* wide tables scroll inside their card instead of widening the page */
.table-wrap { overflow-x: auto; position: relative; }   /* relative: hidden column labels stay inside the scroll area */
.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14.5px; }
.table th { text-align: start; font-size: 13px; font-weight: 600; color: var(--ink-3); background: var(--hover); padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background-color 0.12s; }
.table tbody tr:hover { background: #f8fbfd; }
.table .actions { text-align: end; white-space: nowrap; }
.table .num { text-align: end; font-variant-numeric: tabular-nums; }
.table a.row-link { color: var(--ink); font-weight: 600; text-decoration: none; }
.table a.row-link:hover { color: var(--blue); }
.thumb { width: 52px; height: 52px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: #fff; object-fit: contain; flex: none; }
.thumb--art { display: grid; place-items: center; background: var(--sunken); color: var(--ink-3); }
.cell-main { display: flex; align-items: center; gap: 12px; min-width: 0; }
.cell-main .meta { font-size: 12.5px; color: var(--ink-3); }

/* ---------------------------------------------------------------- badges, flashes, empty */
.badge { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px; border-radius: 999px; font-size: 12.5px; font-weight: 600; white-space: nowrap; background: var(--sunken); color: var(--ink-2); }
.badge .icon { width: 14px; height: 14px; }
.badge--green { background: var(--green-bg); color: var(--green-text); }
.badge--amber { background: var(--amber-bg); color: var(--amber-text); }
.badge--red { background: var(--red-bg); color: var(--red-text); }
.badge--blue { background: var(--blue-tint); color: var(--blue-active); }
.flash { display: flex; align-items: flex-start; gap: 10px; padding: 12px 16px; border-radius: var(--radius); margin-bottom: 18px; border: 1px solid; font-weight: 500; }
.flash .icon { margin-top: 2px; }
.flash--success { background: var(--green-bg); color: var(--green-text); border-color: var(--green-line); }
.flash--error { background: var(--red-bg); color: var(--red-text); border-color: var(--red-line); }
.flash--warning { background: var(--amber-bg); color: var(--amber-text); border-color: var(--amber-line); }
.flash--info { background: var(--blue-tint); color: var(--blue-active); border-color: #bfdcee; }
.flash ul { margin: 6px 0 0; padding-inline-start: 18px; }
.empty { text-align: center; padding: 48px 20px; color: var(--ink-3); }
.empty .icon { width: 40px; height: 40px; margin: 0 auto 12px; color: #9aa8b1; }
.empty h3 { color: var(--ink); font-size: 17px; margin-bottom: 6px; }

/* ---------------------------------------------------------------- filters */
.filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.filters .field { margin: 0; flex: 1 1 150px; }
.filters .field--search { flex: 1.4 1 200px; }
.search { position: relative; }
.search .icon { position: absolute; inset-inline-start: 12px; top: 50%; transform: translateY(-50%); color: var(--ink-3); width: 18px; height: 18px; pointer-events: none; }
.search input { padding-inline-start: 40px; }
.list-foot { padding: 12px 20px; color: var(--ink-3); font-size: 13.5px; border-top: 1px solid var(--line); }

/* ---------------------------------------------------------------- list selection (delete several products at once) */
.table .select { width: 44px; padding-inline-end: 0; }
.table .select input { width: 18px; height: 18px; margin: 0; accent-color: var(--blue); cursor: pointer; vertical-align: middle; }
.table tbody tr.is-selected, .table tbody tr.is-selected:hover { background: var(--blue-tint); }
.btn--ghost-danger { background: transparent; color: var(--ink-2); }
.btn--ghost-danger:hover { background: var(--red-bg); color: var(--red-text); }
.bulk-bar { position: sticky; bottom: 14px; z-index: 5; display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin: 12px 16px; padding: 10px 12px 10px 18px; background: var(--navy); color: var(--on-navy);
  border-radius: var(--radius); box-shadow: var(--shadow-pop); }
.bulk-bar__count { font-weight: 600; margin-inline-end: auto; }
.bulk-bar__clear { background: transparent; color: var(--on-navy); border-color: var(--navy-line); }
.bulk-bar__clear:hover { background: var(--navy-raised); color: #fff; }

/* ---------------------------------------------------------------- photos */
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.photo { position: relative; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; overflow: hidden; display: grid; grid-template-rows: auto 1fr; }
.photo img { width: 100%; aspect-ratio: 1; object-fit: contain; background: #fff; padding: 8px; }
.photo__bar { display: flex; align-items: center; gap: 2px; padding: 4px; border-top: 1px solid var(--line); background: var(--hover); }
.photo__bar .btn { width: 30px; height: 30px; padding: 0; }
.photo__main { position: absolute; top: 8px; inset-inline-start: 8px; }
.photo.is-dragging { opacity: 0.4; }
.photo.is-over { outline: 2px dashed var(--blue); outline-offset: 2px; }
.dropzone { display: grid; place-items: center; gap: 6px; text-align: center; min-height: 150px; padding: 18px; border: 2px dashed var(--line-input); border-radius: var(--radius); background: var(--hover); color: var(--ink-3); cursor: pointer; transition: border-color 0.15s, background-color 0.15s; }
.dropzone:hover, .dropzone.is-over { border-color: var(--blue); background: var(--blue-tint); color: var(--blue-active); }
.dropzone .icon { width: 28px; height: 28px; }
.dropzone strong { color: var(--ink); }
.dropzone--row { display: flex; justify-content: flex-start; text-align: start; min-height: 0; padding: 14px 16px; gap: 12px; }
.dropzone--row .icon { width: 22px; height: 22px; flex: none; }

/* ---------------------------------------------------------------- documents (PDF datasheets) */
.docs { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 8px; }
.docs:not(:has(li)) { display: none; }
.doc { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); }
.doc__icon { display: grid; place-items: center; width: 40px; height: 40px; flex: none; border-radius: var(--radius-sm); background: var(--red-bg); color: var(--red-text); }
.doc__main { flex: 1; min-width: 0; display: grid; gap: 4px; }
.doc__main .small { overflow-wrap: anywhere; }
.credit { font-size: 12px; color: var(--ink-3); padding: 0 8px 6px; direction: ltr; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------------------------------------------------------------- dialogs */
dialog.modal { border: 0; padding: 0; border-radius: var(--radius-xl); width: min(920px, 94vw); max-height: 88vh; box-shadow: var(--shadow-pop); color: var(--ink); }
dialog.modal::backdrop { background: rgb(7 26 46 / 0.5); }
.modal__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--card); z-index: 1; }
.modal__head h2 { font-size: 17px; }
.modal__body { padding: 20px; overflow-y: auto; max-height: calc(88vh - 140px); }
.modal__foot { padding: 14px 20px; border-top: 1px solid var(--line); display: flex; gap: 10px; justify-content: flex-end; }
.pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; }
.pick { border: 2px solid var(--line); border-radius: var(--radius); background: #fff; padding: 6px; cursor: pointer; text-align: center; font-size: 12px; color: var(--ink-3); transition: border-color 0.15s; }
.pick img { width: 100%; aspect-ratio: 1; object-fit: contain; }
.pick:hover { border-color: var(--line-strong); }
.pick[aria-pressed="true"] { border-color: var(--blue); background: var(--blue-tint); color: var(--blue-active); }
.pick span { display: block; direction: ltr; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------------------------------------------------------------- sortable lists */
.sortable { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.sortable li { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); }
.sortable li.is-dragging { opacity: 0.4; }
.sortable li.is-over { border-color: var(--blue); box-shadow: var(--ring); }
.handle { cursor: grab; color: #9aa8b1; display: grid; place-items: center; }
.handle:active { cursor: grabbing; }
.sortable .grow { flex: 1; min-width: 0; }
.sortable .grow .mono { overflow-wrap: anywhere; }

/* ---------------------------------------------------------------- rich text */
.rte { border: 1px solid var(--line-input); border-radius: var(--radius); background: var(--card); overflow: hidden; }
.rte:focus-within { border-color: var(--blue); box-shadow: var(--ring); }
.rte__bar { display: flex; gap: 2px; padding: 6px; border-bottom: 1px solid var(--line); background: var(--hover); direction: ltr; }
.rte__bar .btn { width: 34px; height: 32px; padding: 0; font-weight: 700; }
.rte__bar .btn[aria-pressed="true"] { background: var(--blue-soft); color: var(--blue-active); }
.rte__area { min-height: 170px; padding: 12px 14px; outline: none; direction: ltr; text-align: left; line-height: 1.65; }
.rte__area:empty::before { content: attr(data-placeholder); color: #8b979f; }
.rte__area p { margin: 0 0 10px; }
.rte__area ul, .rte__area ol { margin: 0 0 10px; padding-left: 22px; }

/* ---------------------------------------------------------------- search result preview */
.serp { direction: ltr; text-align: left; padding: 14px 16px; border-radius: var(--radius); background: var(--hover); border: 1px solid var(--line); font-family: Arial, sans-serif; }
.serp__url { color: #202124; font-size: 13px; display: block; margin-bottom: 2px; }
.serp__title { color: #1a0dab; font-size: 18px; line-height: 1.3; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.serp__desc { color: #4d5156; font-size: 13.5px; line-height: 1.55; margin-top: 4px; }

/* ---------------------------------------------------------------- history */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: flex; gap: 14px; padding: 14px 20px; border-bottom: 1px solid var(--line); align-items: flex-start; }
.timeline li:last-child { border-bottom: 0; }
.timeline .when { color: var(--ink-3); font-size: 13px; white-space: nowrap; }
.timeline .what { flex: 1; min-width: 0; }
.timeline .what strong { display: block; font-weight: 600; }
.diff { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.diff th, .diff td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: start; vertical-align: top; }
.diff .old { color: var(--red-text); background: #fff6f4; }
.diff .new { color: var(--green-text); background: #f3fcf5; }

/* ---------------------------------------------------------------- publishing */
.steps-pub { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; counter-reset: s; }
.step-pub { position: relative; padding: 16px 18px; border-inline-start: 1px solid var(--line); }
.step-pub:first-child { border-inline-start: 0; }
.step-pub b { display: flex; align-items: center; gap: 8px; font-size: 14.5px; }
.step-pub .n { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; background: var(--sunken); color: var(--ink-2); }
.step-pub.is-ok .n { background: var(--green); color: #fff; }
.step-pub.is-bad .n { background: var(--red); color: #fff; }
.step-pub p { font-size: 13px; color: var(--ink-3); margin-top: 6px; }
.joblog { direction: ltr; text-align: left; background: var(--navy-deep); color: #cfe3f1; border-radius: var(--radius); padding: 12px 14px; font-family: Consolas, monospace; font-size: 12.5px; line-height: 1.6; max-height: 260px; overflow-y: auto; white-space: pre-wrap; }
.bar { height: 8px; border-radius: 999px; background: var(--sunken); overflow: hidden; }
.bar > span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--dialysate), var(--blue)); transition: width 0.3s; }
.gate-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.gate-list li { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.gate-list .ok { color: var(--green); }
.gate-list .bad { color: var(--red); }

/* ---------------------------------------------------------------- icon picker, art preview */
.icon-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(46px, 1fr)); gap: 6px; }
.icon-grid label { display: grid; place-items: center; height: 46px; border: 1px solid var(--line); border-radius: var(--radius-sm); cursor: pointer; color: var(--ink-2); }
.icon-grid input { position: absolute; opacity: 0; pointer-events: none; }
.icon-grid input:checked + span { color: var(--blue-active); }
.icon-grid label:has(input:checked) { border-color: var(--blue); background: var(--blue-tint); box-shadow: var(--ring); }
.icon-grid label:has(input:focus-visible) { outline: 3px solid rgb(0 111 165 / 0.45); outline-offset: 2px; }
.art-preview { border: 1px solid var(--line); border-radius: var(--radius); background: #fff; padding: 10px; }
.art-preview img { width: 100%; height: auto; }

/* ---------------------------------------------------------------- auth pages */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(1200px 600px at 80% -10%, #164a73 0%, var(--navy) 45%, var(--navy-deep) 100%); }
.auth__card { width: min(420px, 100%); background: var(--card); border-radius: var(--radius-xl); box-shadow: var(--shadow-pop); padding: 32px; }
.auth__brand { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.auth__brand svg { height: 44px; width: auto; }
.auth__brand .brand__word .renal { color: #891721; }
.auth__brand .brand__word .care { color: var(--blue); }
.auth__brand .brand__sub { color: var(--ink-3); }
.auth h1 { font-size: 21px; margin-bottom: 6px; }
.auth p.lead { color: var(--ink-3); margin-bottom: 22px; font-size: 14.5px; }

/* ---------------------------------------------------------------- small screens */
@media (max-width: 1100px) {
  .layout-edit { grid-template-columns: 1fr; }
  .layout-edit > aside { position: static; }
  .steps-pub { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset-block: 0; inset-inline-start: 0; width: min(300px, 86vw); z-index: 50; transform: translateX(-105%); transition: transform 0.25s; box-shadow: var(--shadow-pop); }
  .sidebar.is-open { transform: none; }
  .topbar { padding: 0 16px; }
  .topbar .topbar__menu { display: inline-flex; }
  .content { padding: 18px 16px; }
  .grid--2, .grid--3, .form-grid { grid-template-columns: 1fr; }
  .changes-pill span.long { display: none; }
}
@media (max-width: 640px) {
  .hide-sm { display: none; }
  .sortable li { flex-wrap: wrap; }
  .sortable .grow { flex: 1 1 calc(100% - 110px); }
  .sortable li > .row { margin-inline-start: auto; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ---------------------------------------------------------------- home page slider screens */
.slides-list li.is-muted { opacity: 0.72; }
.slide-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.slide-badges:empty { display: none; }

.seg { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--sunken); gap: 2px; }
.seg button { border: 0; background: transparent; padding: 5px 12px; border-radius: 999px; font: 600 12.5px/1.2 var(--font); color: var(--ink-3); cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--card); color: var(--ink); box-shadow: 0 1px 2px rgb(11 37 64 / 0.12); }

/* preview of the top of the home page: same look as the site's hero (welcome text + one card of the slider) */
.hp-stage { display: grid; justify-items: center; padding: 14px; border-radius: var(--radius); background: var(--sunken); }
.hp { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); align-items: center; gap: 26px; width: 100%;
  padding: 28px 26px; border-radius: 10px; overflow: hidden; color: var(--on-navy);
  background: radial-gradient(120% 90% at 85% 10%, var(--navy-raised), var(--navy) 55%, var(--navy-deep)); }
.hp.is-phone { grid-template-columns: minmax(0, 1fr); width: 320px; max-width: 100%; padding: 22px 16px; gap: 22px; }
.hp--card-focus.is-phone .hp__copy { display: none; }
.hp__copy { display: grid; gap: 10px; align-content: center; min-width: 0; }
.hp__copy > p { margin: 0; overflow-wrap: anywhere; }
.hp__eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 10.5px; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--accent-on-navy); }
.hp__eyebrow::before { content: ""; width: 18px; height: 2px; border-radius: 2px; background: currentColor; flex: none; }
.hp__title { font-size: 25px; line-height: 1.08; font-weight: 900; letter-spacing: -0.02em; color: #fff; }
.hp.is-phone .hp__title { font-size: 22px; }
.hp__lead { font-size: 12.5px; line-height: 1.55; color: var(--on-navy-muted); }
.hp__btns { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.hp__btns:not(:has(.hp__btn:not([hidden]))) { display: none; }
.hp__btn { padding: 5px 10px; border-radius: 999px; font-size: 11px; font-weight: 700; border: 1px solid #fff; white-space: nowrap; }
.hp__btn--1 { background: #fff; color: var(--navy); }
.hp__btn--2 { color: #fff; border-color: rgb(255 255 255 / 0.55); }
.hp__stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin-top: 4px; }
.hp__stats span { display: grid; gap: 1px; padding: 7px 9px; border-radius: 8px; background: rgb(18 50 79 / 0.7); border: 1px solid var(--navy-line); }
.hp__stats small { font-size: 10px; color: var(--on-navy-muted); }
.hp__stats b { font-size: 17px; font-weight: 900; line-height: 1.15; color: #fff; font-variant-numeric: tabular-nums; }
.hp__card { display: grid; gap: 10px; padding: 10px; border-radius: 14px; min-width: 0;
  background: rgb(18 50 79 / 0.72); border: 1px solid var(--navy-line); }
.hp__media { border-radius: 10px; overflow: hidden; background: var(--navy-deep); }
.hp__media img, .hp__noimg { display: block; width: 100%; aspect-ratio: 4 / 3; }
.hp__media img { object-fit: cover; }
.hp--ratio-16-10 .hp__media img, .hp--ratio-16-10 .hp__noimg { aspect-ratio: 16 / 10; }
.hp--ratio-1-1 .hp__media img, .hp--ratio-1-1 .hp__noimg { aspect-ratio: 1; }
.hp__card--contain .hp__media:not(:has(.hp__noimg:not([hidden]))) { background: #fff; }
.hp__card--contain .hp__media img { object-fit: contain; padding: 8px; }
.hp__noimg { display: grid; place-items: center; padding: 12px; font-size: 12px; text-align: center; color: var(--on-navy-muted);
  background: repeating-linear-gradient(135deg, transparent 0 10px, rgb(255 255 255 / 0.04) 10px 20px); }
.hp__noimg[hidden] { display: none; }
.hp__cbody { display: grid; gap: 5px; padding-inline: 4px; min-width: 0; }
.hp__cbody > p { margin: 0; overflow-wrap: anywhere; }
.hp__ctitle { font-size: 17px; font-weight: 900; line-height: 1.15; letter-spacing: -0.01em; color: #fff; }
.hp__ctext { font-size: 12px; line-height: 1.5; color: var(--on-navy-muted); }
.hp__clink { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--accent-on-navy); }
.hp__clink .icon { width: 14px; height: 14px; }
.hp__bar { display: flex; align-items: center; gap: 8px; padding-inline: 4px; min-height: 26px; }
.hp__slider { display: grid; gap: 10px; min-width: 0; }
.hp__card { cursor: pointer; }
.hp__empty { margin: 0; padding: 18px 14px; border: 1px dashed var(--navy-line); border-radius: 14px; font-size: 12.5px;
  line-height: 1.5; color: var(--on-navy-muted); text-align: center; }
.hp__dots { display: flex; flex-wrap: wrap; align-items: center; gap: 0; min-width: 0; }
.hp__dots button { display: grid; place-items: center; width: 12px; height: 18px; padding: 0; border: 0; background: none; cursor: pointer; }
.hp__dots button::before { content: ""; width: 6px; height: 6px; border-radius: 999px; background: var(--on-navy-muted); opacity: 0.6; }
.hp__dots button.on { width: 22px; }
.hp__dots button.on::before { width: 18px; background: var(--accent-on-navy); opacity: 1; }
.hp__dots button:focus-visible, .hp__arrows button:focus-visible { outline: 2px solid var(--accent-on-navy); outline-offset: 1px; border-radius: 999px; }
.hp__nav, .hp__arrows { display: flex; gap: 5px; }
.hp__nav { margin-inline-start: auto; }
.hp__arrows button { padding: 0; background: transparent; cursor: pointer; }
.hp__arrows button:hover { background: var(--navy-raised); }
.hp__nav > span:not(.hp__arrows), .hp__arrows button { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 999px;
  border: 1px solid var(--navy-line); color: #fff; }
.hp__nav .icon { width: 13px; height: 13px; }

/* slider list: Visible / Masquée switch (shows the state; a click changes it), status line, actions */
.page-actions { gap: 10px; }
.slide-actions { gap: 6px; flex-wrap: nowrap; }
.vis-toggle { display: inline-flex; align-items: center; height: 32px; padding: 0 12px 0 10px; border-radius: 999px; cursor: pointer;
  font: 600 13px/1 var(--font); border: 1px solid var(--green-line); background: var(--green-bg); color: var(--green-text); white-space: nowrap; }
.vis-toggle span { display: inline-flex; align-items: center; gap: 6px; }
.vis-toggle .icon { width: 16px; height: 16px; }
.vis-toggle .vis-toggle__off { display: none; }
.vis-toggle[aria-pressed="false"] { border-color: var(--line-input); background: var(--sunken); color: var(--ink-3); }
.vis-toggle[aria-pressed="false"] .vis-toggle__on { display: none; }
.vis-toggle[aria-pressed="false"] .vis-toggle__off { display: inline-flex; }
.vis-toggle:hover { box-shadow: var(--ring); }
.vis-toggle:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.vis-toggle:disabled { opacity: 0.6; cursor: progress; }
.slider-status { margin: 0 0 12px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--green-bg); color: var(--green-text);
  border: 1px solid var(--green-line); font-size: 13.5px; }

/* product picker (slider page) */
dialog.picker { width: min(760px, 94vw); }
.picker__tools { display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: 10px; margin-bottom: 14px; }
.picker__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.picker__item { display: flex; align-items: center; gap: 12px; padding: 8px 12px; border: 1.5px solid var(--line); border-radius: var(--radius);
  cursor: pointer; background: var(--card); }
.picker__item:hover { border-color: var(--line-strong); }
.picker__item.is-checked { border-color: var(--blue); background: var(--blue-tint); }
.picker__item.is-in { cursor: default; opacity: 0.75; background: var(--sunken); }
.picker__item input { width: 18px; height: 18px; flex: none; accent-color: var(--blue); }
.picker__item .thumb { flex: none; }
.picker__text { display: grid; gap: 2px; min-width: 0; flex: 1; }
.picker__text strong { font-size: 14px; line-height: 1.3; overflow-wrap: anywhere; }
.picker__text span { font-size: 12.5px; color: var(--ink-3); }
.picker__count { margin-inline-end: auto; align-self: center; font-weight: 600; color: var(--ink-2); }
.bulk-bar__slider { background: var(--card); color: var(--navy); }
.bulk-bar__slider:hover { background: var(--blue-tint); color: var(--navy); }

/* card editor: what the card shows, photo framing */
.source-pick { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.source-pick--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.source-pick label { position: relative; display: grid; align-content: start; gap: 5px; padding: 12px 14px; border: 1.5px solid var(--line);
  border-radius: var(--radius); cursor: pointer; background: var(--card); }
.source-pick label:hover { border-color: var(--line-strong); }
.source-pick label:has(input:checked) { border-color: var(--blue); box-shadow: var(--ring); background: var(--blue-tint); }
.source-pick label:has(input:focus-visible) { outline: 2px solid var(--blue); outline-offset: 2px; }
.source-pick input { position: absolute; opacity: 0; pointer-events: none; }
.source-pick strong { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ink); }
.source-pick strong .icon { color: var(--blue); }
.source-pick span { font-size: 12.5px; line-height: 1.45; color: var(--ink-3); }
.fit-art { position: relative; display: block; height: 58px; border-radius: 8px; overflow: hidden; background: var(--navy); }
.fit-art i { position: absolute; inset: 0; background: linear-gradient(135deg, #8cc4e4, #2d6a96 70%); }
.fit-art--contain { background: #fff; border: 1px solid var(--line); }
.fit-art--contain i { inset: 9px 34%; border-radius: 4px; }
.slide-photo img { display: block; width: 100% !important; max-width: 360px; height: auto !important; aspect-ratio: 4 / 3 !important;
  object-fit: contain; border-radius: 10px; border: 1px solid var(--line); background: #fff; }
@media (max-width: 640px) {
  .picker__tools { grid-template-columns: minmax(0, 1fr); }
  .picker__item .badge { display: none; }
  .slide-actions { flex-wrap: wrap; justify-content: flex-end; }
  .page-actions { width: 100%; }
  .page-actions > * { flex: 1 1 auto; justify-content: center; }
  .hp { grid-template-columns: minmax(0, 1fr); padding: 22px 16px; }
  .hp--card-focus .hp__copy, .seg { display: none; }  /* on a phone: the card alone, no size switch */
  .source-pick, .source-pick--2 { grid-template-columns: minmax(0, 1fr); }
  .slide-actions .btn span { display: none; }
}
fieldset.choice { border: 0; padding: 0; margin: 0; min-width: 0; display: grid; gap: 6px; }
fieldset.choice legend { padding: 0; margin-bottom: 6px; }

/* ---------------------------------------------------------------- maintenance */
.maint-pill { display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 12px; border-radius: 999px;
  font-size: 13.5px; font-weight: 700; text-decoration: none; background: var(--red-bg); color: var(--red-text); border: 1px solid var(--red-line); }
.maint-pill .icon { width: 16px; height: 16px; }
.maint-status__body { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.maint-status__icon { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 14px; flex: none; }
.maint-status__icon .icon { width: 24px; height: 24px; }
.maint-status h2 { font-size: 18px; }
.maint-status p { margin-top: 4px; color: var(--ink-2); font-size: 14px; }
.maint-status__action { margin-inline-start: auto; flex: none; }
.maint-status__body > .grow { flex: 1 1 280px; min-width: 0; }
.maint-status, .maint-status + [data-job] { margin-bottom: 20px; }
.maint-status--off { border-color: var(--green-line); }
.maint-status--off .maint-status__icon { background: var(--green-bg); color: var(--green-text); }
.maint-status--on { border-color: var(--red-line); background: var(--red-bg); }
.maint-status--on .maint-status__icon { background: var(--card); color: var(--red-text); }
/* preview of the maintenance page: the site's hero background */
.mp { display: grid; gap: 10px; justify-items: start; padding: 34px 30px; border-radius: 10px; color: var(--on-navy);
  background: radial-gradient(120% 90% at 85% 10%, var(--navy-raised), var(--navy) 55%, var(--navy-deep)); }
.mp > p { margin: 0; overflow-wrap: anywhere; }
.mp__brand { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 15px; font-weight: 800; color: #fff; }
.mp__brand svg { width: 34px; height: auto; }
.mp__care { color: var(--accent-on-navy); }
.mp__eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 10.5px; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--accent-on-navy); }
.mp__eyebrow::before { content: ""; width: 18px; height: 2px; border-radius: 2px; background: currentColor; }
.mp__title { font-size: 30px; line-height: 1.08; font-weight: 900; letter-spacing: -0.02em; color: #fff; }
.mp__text { max-width: 520px; font-size: 13.5px; line-height: 1.55; color: var(--on-navy-muted); }
.mp__contact { display: grid; gap: 8px; margin-top: 4px; }
.mp__contact p { margin: 0; font-size: 12.5px; font-weight: 600; color: #fff; }
.mp__btns { display: flex; flex-wrap: wrap; gap: 6px; }
.mp__btn { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; font-size: 11.5px;
  font-weight: 700; color: #fff; border: 1px solid rgb(255 255 255 / 0.55); white-space: nowrap; }
.mp__btn .icon { width: 13px; height: 13px; }
.mp__btn--1 { background: #fff; color: var(--navy); border-color: #fff; }
@media (max-width: 640px) {
  .mp { padding: 24px 18px; }
  .mp__title { font-size: 24px; }
  .maint-status__action, .maint-status__action .btn { width: 100%; justify-content: center; }
  .maint-pill .long { display: none; }
}

/* ---------------------------------------------------------------- billing (Facturation) */
.doc-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.doc-tab { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--card); color: var(--ink-2); font-weight: 600; font-size: 14px; text-decoration: none; }
.doc-tab .icon { width: 17px; height: 17px; color: var(--ink-3); }
.doc-tab:hover { border-color: var(--line-strong); color: var(--ink); }
.doc-tab[aria-current="page"] { background: var(--navy); border-color: var(--navy); color: #fff; }
.doc-tab[aria-current="page"] .icon { color: var(--accent-on-navy); }
.doc-tab__count { font-size: 12px; font-weight: 700; padding: 1px 8px; border-radius: 999px; background: var(--sunken); color: var(--ink-3); }
.doc-tab[aria-current="page"] .doc-tab__count { background: rgb(255 255 255 / 0.16); color: #fff; }
.doc-badge { vertical-align: middle; margin-inline-start: 8px; font-size: 13px; }
.doc-editor { display: grid; gap: 20px; }
.doc-editor > .card + .card { margin-top: 0; }
.form-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid--3 .span-2 { grid-column: span 2; }
@media (max-width: 1100px) and (min-width: 761px) { .form-grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.lines-foot { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; flex-wrap: wrap; margin-top: 14px; }
.lines-totals { width: min(340px, 100%); display: grid; gap: 8px; }
.doc-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.doc-actions__hint { flex: 1 1 260px; margin: 0; }
.party-pick { flex-wrap: nowrap; gap: 8px; }
.party-pick select { flex: 1; min-width: 0; }
.lines-editor { width: 100%; border-collapse: separate; border-spacing: 0; }
.lines-editor th { font-size: 12.5px; font-weight: 600; color: var(--ink-3); text-align: start; padding: 0 6px 8px; white-space: nowrap; }
.lines-editor th.num { text-align: end; }
.lines-editor td { padding: 5px 6px; vertical-align: middle; border-top: 1px solid var(--line); }
.lines-editor tbody tr:first-child td { border-top: 0; }
.lines-editor input, .lines-editor select { height: 38px; padding: 6px 10px; }
.le-desc { min-width: 220px; width: 100%; }
.lines-editor th:first-child, .lines-editor td:first-child { width: 44%; }
.le-num { width: 96px; text-align: end; font-variant-numeric: tabular-nums; }
.le-small { width: 72px; }
.lines-editor select { width: 86px; }
.le-total { text-align: end; font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; min-width: 100px; }
.le-actions { white-space: nowrap; text-align: end; }
.le-actions .btn { width: 30px; height: 30px; }
.totals-panel { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; font-size: 14.5px; }
.totals-panel td { padding: 8px 0; border-bottom: 1px solid var(--line); }
.totals-panel td:last-child { text-align: end; font-weight: 600; }
.totals-panel .grand td { border: 0; padding-top: 12px; font-size: 19px; font-weight: 800; color: var(--ink); }
.totals-panel .exempt td:last-child { color: var(--ink-3); font-weight: 500; }
.doc-frame-wrap { padding: 0; background: var(--sunken); border-radius: 0 0 var(--radius-lg) var(--radius-lg); overflow: hidden; }
.doc-frame { display: block; width: 100%; height: 820px; border: 0; }
.doc-frame-phone { display: none; padding: 16px; margin: 0; }
.summary { display: grid; grid-template-columns: max-content 1fr; gap: 8px 14px; margin: 0; font-size: 14px; }
.summary dt { color: var(--ink-3); }
.summary dd { margin: 0; text-align: end; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.pay-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; align-items: end; margin-top: 16px;
  padding-top: 16px; border-top: 1px solid var(--line); }
.pay-form .field { margin: 0; }
.pay-form .btn { grid-column: 1 / -1; justify-self: start; }
.doc-events { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; font-size: 13.5px; }
.doc-events li { display: grid; gap: 2px; }
.status-form .row { gap: 8px; flex-wrap: nowrap; margin-top: 6px; }
.status-form select { flex: 1; min-width: 0; }
.party-docs { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.party-docs li { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; font-size: 14px; }
.party-docs li a { font-weight: 600; }
.party-docs .small { grid-column: 1; }
.party-docs .badge { grid-row: 1 / span 2; grid-column: 2; align-self: center; }
.fam-tva { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px 18px; }
.fam-tva .field { margin: 0; }
.prices-table input.price-input { width: 120px; height: 36px; text-align: end; font-variant-numeric: tabular-nums; }
.prices-table select { width: 150px; height: 36px; }
.prices-table td { padding-top: 7px; padding-bottom: 7px; }
.prefix-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.prefix-grid input { text-transform: uppercase; }
dialog.party-dialog { width: min(620px, 94vw); }
.stamp-preview { display: block; max-width: 100%; width: 220px; height: auto; margin: 4px 0 10px; padding: 8px; border: 1px dashed var(--line-input); border-radius: var(--radius); background: #fff; }
@media (max-width: 760px) {
  .lines-editor thead { display: none; }
  .lines-editor, .lines-editor tbody { display: block; }
  .lines-editor tr[data-line] { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding: 12px 0; border-top: 1px solid var(--line); }
  .lines-editor tr[data-line]:first-child { border-top: 0; padding-top: 0; }
  .lines-editor td { display: grid; gap: 4px; padding: 0; border: 0; }
  .lines-editor td[data-label]::before { content: attr(data-label); font-size: 12px; font-weight: 600; color: var(--ink-3); }
  .lines-editor td:first-child { grid-column: 1 / -1; }
  .le-num, .le-small, .lines-editor select, .le-desc { width: 100%; min-width: 0; }
  .le-total { text-align: start; align-content: end; padding-bottom: 8px; }
  .lines-editor td.le-actions { grid-column: 1 / -1; display: flex; justify-content: flex-end; gap: 6px; }
  .lines-editor th:first-child, .lines-editor td:first-child { width: auto; }
  .doc-frame { display: none; }
  .doc-frame-phone { display: block; }
  .pay-form .btn { justify-self: stretch; }
  .form-grid--3 { grid-template-columns: minmax(0, 1fr); }
  .form-grid--3 .span-2 { grid-column: auto; }
  .doc-actions .btn { flex: 1 1 100%; justify-content: center; }
  .prefix-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .party-pick .btn span { display: none; }
}

/* ---------------------------------------------------------------- phones */
.sidebar-backdrop { display: none; }
@media (max-width: 900px) {
  .sidebar-backdrop:not([hidden]) { display: block; position: fixed; inset: 0; z-index: 49; background: rgb(7 26 46 / 0.45); }
  .topbar { gap: 8px; }
  .topbar .crumbs { display: none; }
  .topbar__actions { margin-inline-start: auto; gap: 8px; }
  .topbar__preview span { display: none; }
  .topbar__preview { width: 42px; padding: 0; justify-content: center; }
  .page-head { gap: 12px; }
  .page-head h1 { font-size: 22px; }
  /* the save button of an edit screen stays at the bottom of the screen */
  [data-mobile-save] { position: fixed; inset-inline: 16px; bottom: calc(14px + env(safe-area-inset-bottom)); z-index: 40;
    height: 50px; justify-content: center; font-size: 16px; border-radius: 12px; box-shadow: 0 10px 30px rgb(11 37 64 / 0.28); }
  .content:has([data-mobile-save]) { padding-bottom: 96px; }
  .grid--stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .grid--stats .stat { padding: 14px; gap: 10px; align-items: flex-start; flex-direction: column; }
  .grid--stats .stat__num { font-size: 24px; }
  .card__head { padding: 14px 16px; }
  .card__body { padding: 16px; }
}
@media (pointer: coarse) {
  .btn--sm { height: 40px; }
  .btn--icon.btn--sm { width: 40px; }
  .nav-link { min-height: 44px; }
}

/* Accès: what the accountant sees */
.access-explain { padding: 14px 16px; border-radius: var(--radius); background: var(--blue-tint); color: var(--ink); }
.access-explain p { margin: 0 0 8px; }
.access-explain ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 14px; }
.access-explain li { display: flex; gap: 8px; align-items: flex-start; }
.access-explain li .icon { flex: none; margin-top: 2px; color: var(--green); }
.access-explain li:last-child .icon { color: var(--red); }

/* password fields: the "Afficher" button of reveal.js */
.reveal { position: relative; display: block; }
.reveal input { width: 100%; padding-inline-end: 48px; }
.reveal__btn { position: absolute; inset-inline-end: 4px; top: 50%; transform: translateY(-50%); width: 40px; height: 40px;
  display: grid; place-items: center; border: 0; border-radius: var(--radius-sm); background: none; color: var(--ink-3); cursor: pointer; }
.reveal__btn:hover { color: var(--ink); background: var(--hover); }
.reveal__btn[aria-pressed="true"] { color: var(--blue); }

/* Demandes */
.badge--violet { background: #efe9fb; color: #5a35a6; }
.req-pill { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: 999px; background: var(--blue-tint); color: var(--blue-active); font-weight: 600; font-size: 14px; text-decoration: none; }
.req-pill:hover { background: var(--blue-soft); }
.req-pill .icon { width: 16px; height: 16px; }
.req-table tr.is-unread td { background: #f5faff; }
.req-table tr.is-unread a.row-link { color: var(--blue-active); }
.req-message { white-space: pre-line; margin: 0; line-height: 1.6; }
.contact-actions { display: grid; gap: 8px; }
.tpl-body { width: 100%; font-size: 12.5px; line-height: 1.5; resize: vertical; background: var(--sunken); }
.tpl-examples { margin: 0; padding-inline-start: 18px; display: grid; gap: 4px; }
@media (max-width: 640px) { .req-pill .long { display: none; } }

/* ---------------------------------------------------------------- statistics (dashboard) */
.stats-block { margin-bottom: 24px; }
.stats-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-bottom: 14px; }
.stats-head h2 { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 18px; }
.stats-head h2 .icon { color: var(--blue); }
.seg-links { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--sunken); border: 1px solid var(--line); }
.seg-links a { padding: 5px 12px; border-radius: 999px; font-size: 13.5px; font-weight: 600; color: var(--ink-2); text-decoration: none; }
.seg-links a:hover { color: var(--ink); background: var(--card); }
.seg-links a[aria-current="page"] { background: var(--card); color: var(--blue-active); box-shadow: 0 1px 2px rgba(11, 37, 64, .12); }
.live-now { display: inline-flex; align-items: center; gap: 7px; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px var(--green-bg); }
.kpi-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin-bottom: 14px; }
.kpi { display: grid; gap: 6px; padding: 16px 18px; align-content: start; }
.kpi__label { font-size: 13.5px; font-weight: 600; color: var(--ink-3); }
.kpi__value { font-size: 30px; font-weight: 700; line-height: 1.1; color: var(--ink); letter-spacing: -.01em; }
.kpi__delta { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.kpi__delta .icon { width: 14px; height: 14px; align-self: center; }
.kpi__delta.is-up { color: var(--green-text); }
.kpi__delta.is-down { color: var(--red-text); }
.kpi__delta .muted { font-weight: 400; }
.chart-card { margin-bottom: 14px; }
.chart-card h3, .stats-grid h3 { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 16px; }
.chart-wrap { position: relative; overflow-x: auto; border-radius: var(--radius-sm); outline-offset: 4px; }
.chart-wrap:focus-visible { outline: 2px solid var(--blue); }
svg.trend { display: block; width: 100%; min-width: 680px; height: auto; font-family: var(--font); }
.trend__grid { stroke: var(--line); stroke-width: 1; }
.trend__tick { fill: var(--ink-3); font-size: 12px; font-variant-numeric: tabular-nums; }
.trend__area { fill: var(--blue); opacity: .1; }
.trend__line { fill: none; stroke: var(--blue); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.trend__dot, .trend__hover { fill: var(--blue); stroke: var(--card); stroke-width: 2; }
.trend__end { fill: var(--ink); font-size: 12.5px; font-weight: 700; }
.trend__cross { stroke: var(--line-strong); stroke-width: 1; }
.chart-tip { position: absolute; top: 8px; min-width: 150px; padding: 9px 12px; border-radius: var(--radius-sm); background: var(--card);
  border: 1px solid var(--line); box-shadow: var(--shadow-pop); font-size: 13px; pointer-events: none; z-index: 2; }
.chart-tip strong { display: block; font-size: 15px; color: var(--ink); }
.chart-tip .tip-row { display: flex; align-items: center; gap: 8px; color: var(--ink-2); }
.chart-tip .tip-key { width: 14px; height: 2px; border-radius: 2px; background: var(--blue); flex: none; }
.chart-tip .tip-date { color: var(--ink-3); font-size: 12.5px; margin-bottom: 4px; }
.table-view { margin-top: 12px; }
.table-view summary { cursor: pointer; font-size: 13.5px; font-weight: 600; color: var(--blue-active); }
.table-view .table-wrap { max-height: 320px; overflow: auto; margin-top: 10px; }
.stats-grid { margin-bottom: 14px; align-items: start; }
.meter-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.meter-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; align-items: baseline; }
.meter-list__name { font-size: 14px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.meter-list__value { font-size: 13.5px; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
.meter-list__value .muted { font-weight: 400; }
.meter { grid-column: 1 / -1; display: block; height: 8px; border-radius: 999px; background: var(--blue-tint); overflow: hidden; }
.meter > span { display: block; height: 100%; min-width: 4px; border-radius: 999px; background: var(--blue); }
.meter-list--compact { gap: 9px; }
.meter-list--compact .meter-list__name, .meter-list--compact .meter-list__value { font-size: 13px; }
.meter-list--compact .meter { height: 6px; }
.mini-title { margin: 0 0 8px; font-size: 13px; font-weight: 700; color: var(--ink-3); }
.split-lists { gap: 16px; margin-top: 6px; }
.segbar { display: flex; gap: 2px; height: 28px; }
.segbar__part { display: flex; align-items: center; min-width: 6px; padding-inline: 8px; border-radius: 4px; font-size: 12.5px;
  font-weight: 700; white-space: nowrap; }
.segbar__part--mobile { background: #006fa5; color: #ffffff; }
.segbar__part--desktop { background: #eb6834; color: #0b2540; }
.segbar__part--tablet { background: #1baf7a; color: #0b2540; }
.legend { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13.5px; color: var(--ink-2); }
.legend li { display: inline-flex; align-items: center; gap: 7px; }
.legend__swatch { width: 12px; height: 12px; border-radius: 3px; padding: 0; min-width: 0; }
.events-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; }
.event { display: grid; gap: 2px; padding: 14px 18px; }
.event__value { font-size: 22px; font-weight: 700; color: var(--ink); }
.event__label { font-size: 13px; color: var(--ink-3); font-weight: 600; }
