/* ==========================================================================
   KALILOU Atelier — feuille de style unique
   Thèmes clair/sombre, mise en page responsive (mobile → desktop), impression.
   ========================================================================== */

/* --- Jetons de design ---------------------------------------------------- */
:root {
  --brand: #123458;
  --brand-600: #16406c;
  --brand-300: #4a7fb5;
  --accent: #f59e0b;

  --primary: #2563eb;
  --success: #059669;
  --warning: #d97706;
  --danger: #dc2626;
  --info: #0284c7;
  --neutral: #64748b;

  --bg: #f4f6fa;
  --bg-elev: #ffffff;
  --bg-soft: #eef2f8;
  --bg-inset: #f8fafc;
  --sidebar-bg: #0f2440;
  --sidebar-fg: #c9d8ea;
  --sidebar-fg-strong: #ffffff;
  --sidebar-active: #1d4e86;

  --fg: #0f172a;
  --fg-muted: #5a6b83;
  --fg-faint: #8798ae;
  --line: #dde5ef;
  --line-strong: #c3d0e0;

  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 18px;
  --shadow-sm: 0 1px 2px rgba(15, 36, 64, .07), 0 1px 3px rgba(15, 36, 64, .05);
  --shadow: 0 3px 12px rgba(15, 36, 64, .09), 0 1px 3px rgba(15, 36, 64, .05);
  --shadow-lg: 0 18px 48px rgba(15, 36, 64, .20);

  --sidebar-w: 264px;
  --topbar-h: 58px;
  --font: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --mono: "Cascadia Mono", "SF Mono", Consolas, monospace;
}

:root[data-theme="dark"] {
  --bg: #0b1220;
  --bg-elev: #131e31;
  --bg-soft: #182741;
  --bg-inset: #0f1a2c;
  --sidebar-bg: #0a1424;
  --sidebar-fg: #9db0c9;
  --sidebar-fg-strong: #f1f6fc;
  --sidebar-active: #1c3f6b;

  --fg: #e8eff8;
  --fg-muted: #9db0c9;
  --fg-faint: #6c7f99;
  --line: #23334d;
  --line-strong: #31456a;

  --primary: #3b82f6;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #38bdf8;
  --neutral: #7d8ea6;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow: 0 4px 14px rgba(0, 0, 0, .35);
  --shadow-lg: 0 20px 50px rgba(0, 0, 0, .55);
}

/* --- Réinitialisation ---------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--fg);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}
h1, h2, h3, h4 { margin: 0; line-height: 1.25; font-weight: 650; letter-spacing: -.01em; }
p { margin: 0 0 .6em; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 4px; }
[hidden] { display: none !important; }
abbr[title] { text-decoration: none; }
.req { color: var(--danger); font-weight: 700; }

.skiplink {
  position: absolute; left: -9999px; top: 8px; z-index: 999;
  background: var(--bg-elev); padding: .6rem 1rem; border-radius: var(--radius-sm); box-shadow: var(--shadow);
}
.skiplink:focus { left: 8px; }

/* --- Écran de démarrage -------------------------------------------------- */
.boot {
  position: fixed; inset: 0; display: grid; place-content: center; justify-items: center; gap: .9rem;
  background: var(--bg); z-index: 100;
}
.boot__logo { color: var(--brand); opacity: .9; }
:root[data-theme="dark"] .boot__logo { color: var(--brand-300); }
.boot__name { font-size: 1.25rem; font-weight: 750; letter-spacing: -.02em; }
.boot__name span { color: var(--fg-muted); font-weight: 500; }
.boot__spin {
  width: 26px; height: 26px; border-radius: 50%;
  border: 3px solid var(--line); border-top-color: var(--primary);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* --- Coquille applicative ------------------------------------------------ */
.app { display: flex; min-height: 100dvh; }

.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w); z-index: 60;
  display: flex; flex-direction: column;
  background: var(--sidebar-bg); color: var(--sidebar-fg);
  border-right: 1px solid rgba(255, 255, 255, .06);
}
.sidebar__brand {
  display: flex; align-items: center; gap: .65rem; padding: .85rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, .08); min-height: var(--topbar-h);
}
.brandmark {
  display: grid; place-items: center; width: 34px; height: 34px; flex: 0 0 34px;
  border-radius: 10px; background: linear-gradient(140deg, var(--accent), #ea7c0b); color: #26150a;
}
.brandtext { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.brandtext strong { color: var(--sidebar-fg-strong); font-size: .98rem; letter-spacing: -.01em;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brandtext small { font-size: .69rem; color: var(--sidebar-fg); opacity: .72; text-transform: uppercase; letter-spacing: .06em; }
/* Sélecteurs renforcés : `.btn` est déclaré plus bas et l'emporterait sinon. */
.sidebar .sidebar__close { display: none; margin-left: auto; color: var(--sidebar-fg); }

.sidebar__nav { flex: 1; overflow-y: auto; padding: .6rem .55rem 1rem; scrollbar-width: thin; }
.navgroup { margin-bottom: .55rem; }
.navgroup__title {
  font-size: .655rem; text-transform: uppercase; letter-spacing: .1em; font-weight: 700;
  color: var(--sidebar-fg); opacity: .5; padding: .55rem .7rem .3rem;
}
.navitem {
  display: flex; align-items: center; gap: .65rem; padding: .5rem .7rem; margin-bottom: 1px;
  border-radius: var(--radius-sm); color: var(--sidebar-fg); font-size: .875rem; font-weight: 500;
  transition: background .12s, color .12s;
}
.navitem:hover { background: rgba(255, 255, 255, .07); color: var(--sidebar-fg-strong); text-decoration: none; }
.navitem.is-active { background: var(--sidebar-active); color: #fff; font-weight: 600; box-shadow: inset 3px 0 0 var(--accent); }
.navitem__label { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.navitem__badge {
  min-width: 20px; height: 19px; padding: 0 .35rem; border-radius: 10px;
  background: var(--accent); color: #26150a; font-size: .68rem; font-weight: 800;
  display: grid; place-items: center;
}
.navitem.is-active .navitem__badge { background: #fff; color: var(--sidebar-active); }

.sidebar__foot { padding: .7rem; border-top: 1px solid rgba(255, 255, 255, .08); display: grid; gap: .5rem; }
.userchip { display: flex; align-items: center; gap: .6rem; padding: .4rem; border-radius: var(--radius-sm); color: var(--sidebar-fg); }
.userchip:hover { background: rgba(255, 255, 255, .07); text-decoration: none; }
.userchip__id { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.userchip__id strong { color: var(--sidebar-fg-strong); font-size: .85rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.userchip__id small { font-size: .7rem; opacity: .75; }
.sidebar__foot .btn--ghost { color: var(--sidebar-fg); border-color: rgba(255, 255, 255, .14); }
.sidebar__foot .btn--ghost:hover { background: rgba(255, 255, 255, .09); color: #fff; }

.shellmain { flex: 1; min-width: 0; margin-left: var(--sidebar-w); display: flex; flex-direction: column; min-height: 100dvh; }

.topbar {
  position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: .5rem;
  height: var(--topbar-h); padding: 0 1rem;
  background: color-mix(in srgb, var(--bg-elev) 88%, transparent);
  backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
}
.topbar__spacer { flex: 1; }
.topbar__tools { display: flex; align-items: center; gap: .3rem; }
.topbar .topbar__burger { display: none; }
.netstate {
  display: inline-flex; align-items: center; gap: .35rem; padding: .25rem .6rem; border-radius: 20px;
  background: color-mix(in srgb, var(--warning) 16%, transparent); color: var(--warning);
  font-size: .76rem; font-weight: 650;
}

.main { flex: 1; min-width: 0; }
.view { max-width: 1360px; margin: 0 auto; padding: 1.15rem 1.15rem 3.5rem; }
.pagepad { padding: 2rem 0; }

.mobilenav { display: none; }
.scrim { position: fixed; inset: 0; background: rgba(6, 14, 26, .55); z-index: 55; backdrop-filter: blur(2px); }

/* --- En-tête de page ----------------------------------------------------- */
.pagehead {
  display: flex; flex-wrap: wrap; gap: .8rem; align-items: flex-start; justify-content: space-between;
  margin-bottom: 1.1rem;
}
.pagehead__main { display: flex; gap: .6rem; align-items: flex-start; min-width: 0; }
.pagehead__title { font-size: 1.42rem; font-weight: 700; }
.pagehead__sub { margin: .15rem 0 0; color: var(--fg-muted); font-size: .885rem; }
.pagehead__actions { display: flex; flex-wrap: wrap; gap: .45rem; }
.pagehead__tags { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .45rem; }

/* --- Boutons ------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  padding: .5rem .85rem; border-radius: var(--radius-sm); border: 1px solid transparent;
  background: var(--bg-soft); color: var(--fg); font-size: .86rem; font-weight: 600;
  cursor: pointer; white-space: nowrap; transition: background .13s, border-color .13s, transform .06s, opacity .13s;
  text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn--primary { background: var(--primary); color: #fff; }
.btn--primary:hover { background: color-mix(in srgb, var(--primary) 85%, #000); }
.btn--success { background: var(--success); color: #fff; }
.btn--success:hover { background: color-mix(in srgb, var(--success) 85%, #000); }
.btn--danger { background: var(--danger); color: #fff; }
.btn--danger:hover { background: color-mix(in srgb, var(--danger) 85%, #000); }
.btn--warning { background: var(--warning); color: #fff; }
.btn--accent { background: var(--accent); color: #26150a; }
.btn--ghost { background: transparent; border-color: var(--line-strong); color: var(--fg); }
.btn--ghost:hover { background: var(--bg-soft); }
.btn--subtle { background: var(--bg-soft); color: var(--fg-muted); }
.btn--subtle:hover { color: var(--fg); }
.btn--sm { padding: .32rem .6rem; font-size: .79rem; gap: .3rem; }
.btn--lg { padding: .68rem 1.2rem; font-size: .95rem; }
.btn--icon { padding: .45rem; width: 36px; height: 36px; }
.btn--icon.btn--sm { width: 30px; height: 30px; padding: .25rem; }
.btn--full { width: 100%; }
.btnrow { display: flex; flex-wrap: wrap; gap: .45rem; }
.ico { flex: 0 0 auto; }

/* --- Cartes -------------------------------------------------------------- */
.card {
  background: var(--bg-elev); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); overflow: hidden; margin-bottom: 1rem;
}
.card__head {
  display: flex; align-items: center; justify-content: space-between; gap: .6rem;
  padding: .7rem 1rem; border-bottom: 1px solid var(--line); background: var(--bg-inset);
}
.card__head h2 { font-size: .93rem; font-weight: 680; display: flex; align-items: center; gap: .45rem; color: var(--fg); }
.card__actions { display: flex; gap: .35rem; flex-wrap: wrap; }
.card__body { padding: 1rem; }
.card__body > :last-child { margin-bottom: 0; }
.card--flush .card__body { padding: 0; }

.grid { display: grid; gap: 1rem; }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
/* 168px : permet deux tuiles de front sur un téléphone de 390 px de large. */
.grid--4 { grid-template-columns: repeat(auto-fit, minmax(168px, 1fr)); }
.grid--sidebar { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; }
@media (max-width: 1080px) { .grid--sidebar { grid-template-columns: 1fr; } }

/* --- Tuiles de statistiques --------------------------------------------- */
.stat {
  display: flex; gap: .75rem; align-items: flex-start; padding: .9rem;
  background: var(--bg-elev); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); color: inherit; transition: border-color .13s, transform .13s;
}
a.stat:hover { text-decoration: none; border-color: var(--primary); transform: translateY(-1px); }
.stat__icon { display: grid; place-items: center; width: 38px; height: 38px; flex: 0 0 38px; border-radius: 10px; }
.stat__icon--primary { background: color-mix(in srgb, var(--primary) 14%, transparent); color: var(--primary); }
.stat__icon--success { background: color-mix(in srgb, var(--success) 14%, transparent); color: var(--success); }
.stat__icon--warning { background: color-mix(in srgb, var(--warning) 16%, transparent); color: var(--warning); }
.stat__icon--danger  { background: color-mix(in srgb, var(--danger) 14%, transparent);  color: var(--danger); }
.stat__icon--info    { background: color-mix(in srgb, var(--info) 14%, transparent);    color: var(--info); }
.stat__icon--neutral { background: color-mix(in srgb, var(--neutral) 16%, transparent); color: var(--neutral); }
.stat__body { display: flex; flex-direction: column; min-width: 0; }
.stat__label { font-size: .755rem; color: var(--fg-muted); text-transform: uppercase; letter-spacing: .05em; font-weight: 650; }
.stat__value { font-size: 1.4rem; font-weight: 720; letter-spacing: -.02em; line-height: 1.15; font-variant-numeric: tabular-nums; }
.stat__sub { font-size: .765rem; color: var(--fg-faint); }
.stat__trend { font-size: .73rem; font-weight: 700; margin-top: .1rem; }
.stat__trend--up { color: var(--success); }
.stat__trend--down { color: var(--danger); }

/* --- Badges & pastilles -------------------------------------------------- */
.badge {
  display: inline-flex; align-items: center; gap: .28rem; padding: .16rem .5rem;
  border-radius: 20px; font-size: .735rem; font-weight: 650; white-space: nowrap; line-height: 1.5;
  background: color-mix(in srgb, var(--neutral) 15%, transparent); color: var(--neutral);
}
.badge--primary { background: color-mix(in srgb, var(--primary) 14%, transparent); color: var(--primary); }
.badge--success { background: color-mix(in srgb, var(--success) 15%, transparent); color: var(--success); }
.badge--warning { background: color-mix(in srgb, var(--warning) 18%, transparent); color: var(--warning); }
.badge--danger  { background: color-mix(in srgb, var(--danger) 14%, transparent);  color: var(--danger); }
.badge--info    { background: color-mix(in srgb, var(--info) 15%, transparent);    color: var(--info); }
:root[data-theme="dark"] .badge { background: color-mix(in srgb, var(--neutral) 26%, transparent); }
:root[data-theme="dark"] .badge--primary { background: color-mix(in srgb, var(--primary) 24%, transparent); }
:root[data-theme="dark"] .badge--success { background: color-mix(in srgb, var(--success) 24%, transparent); }
:root[data-theme="dark"] .badge--warning { background: color-mix(in srgb, var(--warning) 26%, transparent); }
:root[data-theme="dark"] .badge--danger  { background: color-mix(in srgb, var(--danger) 24%, transparent); }
:root[data-theme="dark"] .badge--info    { background: color-mix(in srgb, var(--info) 24%, transparent); }

.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--neutral); }
.dot--success { background: var(--success); } .dot--warning { background: var(--warning); }
.dot--danger { background: var(--danger); }   .dot--info { background: var(--info); }
.dot--primary { background: var(--primary); }

.avatar {
  display: inline-grid; place-items: center; width: var(--sz, 34px); height: var(--sz, 34px);
  border-radius: 50%; background: color-mix(in srgb, var(--primary) 15%, transparent); color: var(--primary);
  font-size: calc(var(--sz, 34px) * .38); font-weight: 750; flex: 0 0 auto; letter-spacing: .02em;
}

.pbar { display: block; height: 6px; border-radius: 4px; background: var(--bg-soft); overflow: hidden; min-width: 60px; }
.pbar__fill { display: block; height: 100%; border-radius: 4px; background: var(--primary); transition: width .3s; }
.pbar__fill--success { background: var(--success); } .pbar__fill--warning { background: var(--warning); }
.pbar__fill--danger { background: var(--danger); }   .pbar__fill--info { background: var(--info); }

/* --- Tableaux ------------------------------------------------------------ */
.tablewrap { display: flex; flex-direction: column; }
.tabletools {
  display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; justify-content: space-between;
  padding: .7rem 1rem; border-bottom: 1px solid var(--line); background: var(--bg-inset);
}
.tabletools__right { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.tabletools__count { font-size: .78rem; color: var(--fg-muted); font-variant-numeric: tabular-nums; }
.searchbox { display: flex; align-items: center; gap: .4rem; flex: 1 1 220px; max-width: 380px;
  background: var(--bg-elev); border: 1px solid var(--line-strong); border-radius: var(--radius-sm); padding: 0 .55rem; color: var(--fg-faint); }
.searchbox:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 16%, transparent); }
.searchbox__input { flex: 1; border: 0; background: none; padding: .42rem 0; outline: none; font-size: .87rem; min-width: 0; }

.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; font-size: .865rem; }
.table th, .table td { padding: .58rem .8rem; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table thead th { background: var(--bg-inset); font-size: .74rem; text-transform: uppercase; letter-spacing: .05em;
  color: var(--fg-muted); font-weight: 700; white-space: nowrap; position: sticky; top: 0; z-index: 2; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr.is-clickable { cursor: pointer; }
.table tbody tr.is-clickable:hover { background: var(--bg-soft); }
.table--dense th, .table--dense td { padding: .38rem .6rem; font-size: .82rem; }
.ta-right { text-align: right !important; font-variant-numeric: tabular-nums; }
.ta-center { text-align: center !important; }
.th-sort { background: none; border: 0; padding: 0; font: inherit; color: inherit; cursor: pointer;
  display: inline-flex; align-items: center; gap: .25rem; text-transform: inherit; letter-spacing: inherit; }
.th-sort:hover { color: var(--fg); }
.th-sort.is-active { color: var(--primary); }
.th-sort__arrow { font-size: .62rem; opacity: .6; }
.cell-strong { font-weight: 650; }
.cell-sub { display: block; font-size: .765rem; color: var(--fg-muted); }
.cell-mono { font-family: var(--mono); font-size: .8rem; }
.cell-actions { display: flex; gap: .2rem; justify-content: flex-end; }

.pager { display: flex; align-items: center; justify-content: center; gap: .8rem; padding: .7rem; border-top: 1px solid var(--line); }
.pager__info { font-size: .8rem; color: var(--fg-muted); }

/* --- États vides --------------------------------------------------------- */
.empty { display: grid; justify-items: center; gap: .5rem; padding: 2.6rem 1.5rem; text-align: center; color: var(--fg-muted); }
.empty h3 { font-size: 1rem; color: var(--fg); }
.empty p { max-width: 46ch; font-size: .875rem; margin: 0; }
.empty .btn { margin-top: .5rem; }
.empty > .ico { color: var(--fg-faint); opacity: .55; }

/* --- Formulaires --------------------------------------------------------- */
.form { display: grid; grid-template-columns: repeat(6, 1fr); gap: .85rem; }
.field { display: flex; flex-direction: column; gap: .28rem; min-width: 0; }
.field--full { grid-column: span 6; }
.field--half { grid-column: span 3; }
.field--third { grid-column: span 2; }
.field--twothird { grid-column: span 4; }
@media (max-width: 620px) { .field--half, .field--third, .field--twothird { grid-column: span 6; } }
.field__label { font-size: .785rem; font-weight: 650; color: var(--fg-muted); }
.field__help { font-size: .745rem; color: var(--fg-faint); line-height: 1.4; }
.field__error { font-size: .755rem; color: var(--danger); font-weight: 600; }
.field__static { padding: .45rem 0; font-weight: 600; }
.field.is-invalid .input { border-color: var(--danger); }
.form__section { grid-column: span 6; margin-top: .35rem; padding-top: .6rem; border-top: 1px solid var(--line); }
.form__section:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.form__section h3 { font-size: .83rem; text-transform: uppercase; letter-spacing: .06em; color: var(--fg-muted); }
.form__section p { font-size: .78rem; color: var(--fg-faint); margin: .2rem 0 0; }
.form__hint-top { font-size: .82rem; color: var(--fg-muted); background: var(--bg-inset);
  border-left: 3px solid var(--info); padding: .5rem .7rem; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; margin: 0 0 .9rem; }

.input {
  width: 100%; padding: .48rem .6rem; border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  background: var(--bg-elev); color: var(--fg); font-size: .875rem; transition: border-color .13s, box-shadow .13s;
}
.input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 16%, transparent); }
.input:read-only, .input:disabled { background: var(--bg-soft); color: var(--fg-muted); }
textarea.input { resize: vertical; min-height: 62px; }
select.input { appearance: none; background-image:
  linear-gradient(45deg, transparent 50%, var(--fg-muted) 50%), linear-gradient(135deg, var(--fg-muted) 50%, transparent 50%);
  background-position: calc(100% - 15px) 52%, calc(100% - 10px) 52%; background-size: 5px 5px; background-repeat: no-repeat;
  padding-right: 1.8rem; }
.input-affix { display: flex; align-items: stretch; }
.input-affix .input { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.input-affix__suffix { display: grid; place-items: center; padding: 0 .6rem; font-size: .78rem; font-weight: 650;
  color: var(--fg-muted); background: var(--bg-soft); border: 1px solid var(--line-strong); border-left: 0;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }

.switch { display: flex; align-items: center; gap: .55rem; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch__track { width: 38px; height: 21px; border-radius: 12px; background: var(--line-strong); position: relative; transition: background .15s; flex: 0 0 auto; }
.switch__dot { position: absolute; top: 2.5px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.3); }
.switch input:checked + .switch__track { background: var(--success); }
.switch input:checked + .switch__track .switch__dot { transform: translateX(16px); }
.switch input:focus-visible + .switch__track { outline: 2px solid var(--primary); outline-offset: 2px; }
.switch__label { font-size: .87rem; font-weight: 550; }

.checkgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: .3rem;
  max-height: 260px; overflow-y: auto; padding: .5rem; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--bg-inset); }
.checkgrid__item { display: flex; align-items: center; gap: .45rem; font-size: .82rem; padding: .18rem .3rem; border-radius: 5px; cursor: pointer; }
.checkgrid__item:hover { background: var(--bg-soft); }
.checkgrid__item input { accent-color: var(--primary); }

.radiogrid { display: grid; gap: .45rem; }
.radiogrid__item { display: flex; gap: .6rem; align-items: flex-start; padding: .6rem .7rem; cursor: pointer;
  border: 1.5px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--bg-elev); transition: border-color .13s, background .13s; }
.radiogrid__item:hover { border-color: var(--primary); }
.radiogrid__item.is-on { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 7%, transparent); }
.radiogrid__item input { accent-color: var(--primary); margin-top: .18rem; }
.radiogrid__body { display: flex; flex-direction: column; }
.radiogrid__body strong { font-size: .875rem; font-weight: 640; }
.radiogrid__body small { font-size: .765rem; color: var(--fg-muted); }

.photofield { display: flex; gap: .7rem; align-items: center; }
.photofield__preview { width: 76px; height: 76px; border-radius: var(--radius-sm); overflow: hidden; flex: 0 0 76px;
  background: var(--bg-soft); border: 1px dashed var(--line-strong); display: grid; place-items: center; color: var(--fg-faint); }
.photofield__preview img { width: 100%; height: 100%; object-fit: cover; }
.photofield__actions { display: flex; flex-direction: column; gap: .35rem; align-items: flex-start; }
.filefield__name { font-size: .82rem; color: var(--fg-muted); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* --- Modales ------------------------------------------------------------- */
.modals-root { position: relative; z-index: 90; }
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(6, 14, 26, .55); backdrop-filter: blur(3px);
  display: grid; place-items: center; padding: 1rem; z-index: 90; opacity: 0; transition: opacity .18s;
  overflow-y: auto;
}
.modal-backdrop.is-in { opacity: 1; }
.modal {
  background: var(--bg-elev); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  width: min(100%, 620px); max-height: calc(100dvh - 2rem); display: flex; flex-direction: column;
  transform: translateY(12px) scale(.985); transition: transform .18s; border: 1px solid var(--line);
}
.modal-backdrop.is-in .modal { transform: none; }
.modal--sm { width: min(100%, 430px); }
.modal--lg { width: min(100%, 880px); }
.modal--xl { width: min(100%, 1160px); }
.modal__head { display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .9rem 1.1rem; border-bottom: 1px solid var(--line); }
.modal__head h2 { font-size: 1.02rem; }
.modal__x { background: none; border: 0; cursor: pointer; color: var(--fg-muted); padding: .25rem; border-radius: 6px; display: grid; }
.modal__x:hover { background: var(--bg-soft); color: var(--fg); }
.modal__body { padding: 1.1rem; overflow-y: auto; flex: 1; }
.modal__foot { display: flex; justify-content: flex-end; gap: .5rem; padding: .8rem 1.1rem;
  border-top: 1px solid var(--line); background: var(--bg-inset); border-radius: 0 0 var(--radius-lg) var(--radius-lg); flex-wrap: wrap; }
.modal__msg { margin: 0; font-size: .92rem; }

/* --- Notifications ------------------------------------------------------- */
.toasts { position: fixed; bottom: 1rem; right: 1rem; z-index: 120; display: flex; flex-direction: column; gap: .5rem;
  max-width: min(400px, calc(100vw - 2rem)); pointer-events: none; }
.toast {
  display: flex; align-items: flex-start; gap: .55rem; padding: .65rem .8rem; border-radius: var(--radius-sm);
  background: var(--bg-elev); border: 1px solid var(--line); border-left: 3px solid var(--info);
  box-shadow: var(--shadow-lg); font-size: .86rem; pointer-events: auto;
  transform: translateX(110%); transition: transform .25s cubic-bezier(.2,.8,.3,1); color: var(--fg);
}
.toast.is-in { transform: none; }
.toast--success { border-left-color: var(--success); } .toast--success > .ico { color: var(--success); }
.toast--error   { border-left-color: var(--danger); }  .toast--error > .ico { color: var(--danger); }
.toast--warning { border-left-color: var(--warning); } .toast--warning > .ico { color: var(--warning); }
.toast--info > .ico { color: var(--info); }
.toast span { flex: 1; line-height: 1.45; }
.toast__x { background: none; border: 0; cursor: pointer; color: var(--fg-faint); padding: 0; display: grid; }
.toast__x:hover { color: var(--fg); }
@media (max-width: 640px) { .toasts { bottom: calc(62px + env(safe-area-inset-bottom, 0px) + .6rem); left: .6rem; right: .6rem; max-width: none; } }

/* --- Onglets ------------------------------------------------------------- */
.tabs { display: flex; gap: .15rem; border-bottom: 1px solid var(--line); margin-bottom: 1rem; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs__item { padding: .55rem .85rem; font-size: .865rem; font-weight: 600; color: var(--fg-muted);
  border-bottom: 2.5px solid transparent; white-space: nowrap; display: inline-flex; align-items: center; gap: .4rem; }
.tabs__item:hover { color: var(--fg); text-decoration: none; }
.tabs__item.is-active { color: var(--primary); border-bottom-color: var(--primary); }
.tabs__count { background: var(--bg-soft); border-radius: 10px; padding: 0 .38rem; font-size: .72rem; font-weight: 700; }
.tabs__item.is-active .tabs__count { background: color-mix(in srgb, var(--primary) 15%, transparent); color: var(--primary); }

/* --- Listes de définition ----------------------------------------------- */
.deflist { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: .1rem .9rem; margin: 0; }
.deflist > div { padding: .42rem 0; border-bottom: 1px solid var(--line); min-width: 0; }
.deflist dt { font-size: .735rem; color: var(--fg-muted); text-transform: uppercase; letter-spacing: .045em; font-weight: 650; }
.deflist dd { margin: .1rem 0 0; font-size: .885rem; font-weight: 550; word-break: break-word; }

/* --- Fil chronologique --------------------------------------------------- */
.timeline { list-style: none; margin: 0; padding: 0 0 0 1.1rem; position: relative; }
.timeline::before { content: ''; position: absolute; left: 4px; top: 6px; bottom: 6px; width: 2px; background: var(--line); }
.timeline__item { position: relative; padding: 0 0 .95rem .5rem; }
.timeline__item:last-child { padding-bottom: 0; }
.timeline__dot { position: absolute; left: -1.1rem; top: 5px; width: 10px; height: 10px; border-radius: 50%;
  background: var(--neutral); border: 2px solid var(--bg-elev); box-shadow: 0 0 0 2px var(--line); }
.timeline__item--success .timeline__dot { background: var(--success); }
.timeline__item--warning .timeline__dot { background: var(--warning); }
.timeline__item--danger  .timeline__dot { background: var(--danger); }
.timeline__item--info    .timeline__dot { background: var(--info); }
.timeline__item--primary .timeline__dot { background: var(--primary); }
.timeline__title { font-size: .875rem; font-weight: 650; }
.timeline__text { font-size: .825rem; color: var(--fg-muted); margin-top: .1rem; }
.timeline__meta { font-size: .745rem; color: var(--fg-faint); margin-top: .12rem; }

/* --- Graphiques ---------------------------------------------------------- */
.chart { margin: 0; }
.chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart figcaption, .chart__title { font-size: .8rem; font-weight: 650; color: var(--fg-muted); margin-bottom: .5rem; }
.chart__empty { text-align: center; color: var(--fg-faint); font-size: .85rem; padding: 2rem 0; margin: 0; }
.chart__grid { stroke: var(--line); stroke-width: 1; stroke-dasharray: 3 3; }
.chart__axis, .chart__label { fill: var(--fg-muted); font-size: 10.5px; font-family: var(--font); }
.chart__barval { fill: #fff; font-size: 10px; font-weight: 700; font-family: var(--font); }
.chart__bar { transition: opacity .13s; }
.chart__barg:hover .chart__bar { opacity: .8; }
.chart__dot { stroke: var(--bg-elev); stroke-width: 1.5; }
.chart__donuttotal { fill: var(--fg); font-size: 17px; font-weight: 750; font-family: var(--font); }
.chart__donutsub { fill: var(--fg-muted); font-size: 10px; font-family: var(--font); }
.chart__donutrow { display: flex; gap: 1.2rem; align-items: center; flex-wrap: wrap; }
.chart__donutrow svg { width: auto; flex: 0 0 auto; }
.chart__legend { list-style: none; display: flex; flex-wrap: wrap; gap: .35rem .9rem; padding: .6rem 0 0; margin: 0; font-size: .8rem; }
.chart__legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: .35rem; vertical-align: -1px; }
.chart__legend--list { flex-direction: column; flex: 1; min-width: 170px; gap: .28rem; padding: 0; }
.chart__legend--list li { display: flex; align-items: center; gap: .3rem; }
.chart__legend--list span { flex: 1; color: var(--fg-muted); }
.chart__legend--list b { font-variant-numeric: tabular-nums; }

.hbars { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.hbar { display: grid; grid-template-columns: minmax(90px, 150px) 1fr auto; gap: .6rem; align-items: center; font-size: .82rem; }
.hbar__label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--fg-muted); }
.hbar__track { height: 9px; border-radius: 5px; background: var(--bg-soft); overflow: hidden; }
.hbar__fill { display: block; height: 100%; border-radius: 5px; transition: width .35s; }
.hbar__value { font-variant-numeric: tabular-nums; font-weight: 650; white-space: nowrap; }
@media (max-width: 520px) { .hbar { grid-template-columns: 1fr auto; } .hbar__track { grid-column: 1 / -1; } }

.gauge { text-align: center; }
.gauge svg { max-width: 170px; margin: 0 auto; }
.gauge__val { fill: var(--fg); font-size: 19px; font-weight: 750; font-family: var(--font); }
.gauge__label { font-size: .78rem; color: var(--fg-muted); margin-top: -.4rem; }

/* --- Composants métier --------------------------------------------------- */
/* Frise des étapes d'une intervention */
.stepper { display: flex; gap: .2rem; overflow-x: auto; padding-bottom: .3rem; scrollbar-width: thin; }
.step { flex: 1 1 0; min-width: 92px; text-align: center; position: relative; padding-top: 1.5rem; }
.step::before { content: ''; position: absolute; top: 8px; left: 0; right: 0; height: 3px; background: var(--line); }
.step:first-child::before { left: 50%; border-radius: 3px 0 0 3px; }
.step:last-child::before { right: 50%; border-radius: 0 3px 3px 0; }
.step.is-done::before, .step.is-current::before { background: var(--primary); }
.step.is-current ~ .step::before { background: var(--line); }
.step__dot { position: absolute; top: 2px; left: 50%; transform: translateX(-50%); width: 15px; height: 15px;
  border-radius: 50%; background: var(--line-strong); border: 3px solid var(--bg); }
.step.is-done .step__dot { background: var(--primary); }
.step.is-current .step__dot { background: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 25%, transparent); }
.step__label { font-size: .715rem; font-weight: 650; color: var(--fg-muted); line-height: 1.25; padding: 0 .2rem; }
.step.is-current .step__label { color: var(--fg); }
.step.is-done .step__label { color: var(--primary); }

/* Cartouche de visa (§16) */
.visagrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(215px, 1fr)); gap: .7rem; }
.visacard { border: 1.5px solid var(--line); border-radius: var(--radius-sm); padding: .7rem .8rem; background: var(--bg-inset); }
.visacard--vise { border-color: var(--success); background: color-mix(in srgb, var(--success) 7%, transparent); }
.visacard--refuse { border-color: var(--danger); background: color-mix(in srgb, var(--danger) 7%, transparent); }
.visacard--actif { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.visacard__rang { font-size: .68rem; text-transform: uppercase; letter-spacing: .07em; color: var(--fg-faint); font-weight: 700; }
.visacard__role { font-size: .875rem; font-weight: 680; margin: .1rem 0 .3rem; }
.visacard__who { font-size: .8rem; color: var(--fg-muted); }
.visacard__foot { margin-top: .5rem; display: flex; gap: .3rem; flex-wrap: wrap; }
.visacard__note { font-size: .78rem; font-style: italic; color: var(--fg-muted); margin-top: .35rem;
  border-left: 2px solid var(--line-strong); padding-left: .5rem; }

/* Lignes de document (devis, réception) */
.lines { width: 100%; border-collapse: collapse; font-size: .85rem; }
.lines th, .lines td { padding: .42rem .5rem; border-bottom: 1px solid var(--line); }
.lines thead th { font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; color: var(--fg-muted); text-align: left; }
.lines tfoot td { font-weight: 700; border-top: 2px solid var(--line-strong); border-bottom: 0; padding-top: .6rem; }
.lines .input { padding: .3rem .45rem; font-size: .82rem; }
.lines .ta-right { text-align: right; }

/* Comparatif fournisseurs (§6.2) */
.offer { display: grid; grid-template-columns: auto 1fr auto auto auto; gap: .6rem; align-items: center;
  padding: .55rem .7rem; border: 1.5px solid var(--line); border-radius: var(--radius-sm); margin-bottom: .4rem; background: var(--bg-elev); }
.offer.is-retenue { border-color: var(--success); background: color-mix(in srgb, var(--success) 6%, transparent); }
.offer.is-best { box-shadow: inset 3px 0 0 var(--accent); }
.offer__radio { accent-color: var(--success); width: 17px; height: 17px; }
.offer__name { font-weight: 620; font-size: .87rem; min-width: 0; }
.offer__meta { font-size: .755rem; color: var(--fg-muted); }
.offer__price { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
@media (max-width: 560px) { .offer { grid-template-columns: auto 1fr; } .offer__price, .offer__delay { grid-column: 2; } }

/* Grille de photos d'anomalies */
.photogrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: .5rem; }
.photogrid img { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: var(--radius-sm); border: 1px solid var(--line); cursor: zoom-in; }

/* Liste compacte "élément + méta + action" */
.rowlist { list-style: none; margin: 0; padding: 0; }
.rowlist li { display: flex; align-items: center; gap: .7rem; padding: .6rem 1rem; border-bottom: 1px solid var(--line); }
.rowlist li:last-child { border-bottom: 0; }
.rowlist__main { flex: 1; min-width: 0; }
.rowlist__title { font-size: .875rem; font-weight: 620; overflow: hidden; text-overflow: ellipsis; }
.rowlist__sub { font-size: .775rem; color: var(--fg-muted); }
.rowlist a.rowlist__title:hover { color: var(--primary); }

/* Bandeau d'information contextuelle */
.notice { display: flex; gap: .6rem; padding: .7rem .85rem; border-radius: var(--radius-sm); font-size: .845rem;
  background: color-mix(in srgb, var(--info) 9%, transparent); border-left: 3px solid var(--info); margin-bottom: 1rem; }
.notice--warning { background: color-mix(in srgb, var(--warning) 11%, transparent); border-left-color: var(--warning); }
.notice--danger  { background: color-mix(in srgb, var(--danger) 9%, transparent);  border-left-color: var(--danger); }
.notice--success { background: color-mix(in srgb, var(--success) 9%, transparent); border-left-color: var(--success); }
.notice > .ico { flex: 0 0 auto; margin-top: .1rem; color: var(--info); }
.notice--warning > .ico { color: var(--warning); }
.notice--danger > .ico { color: var(--danger); }
.notice--success > .ico { color: var(--success); }
.notice p { margin: 0; }
.notice strong { display: block; margin-bottom: .1rem; }

/* Barre de filtres */
.filters { display: flex; flex-wrap: wrap; gap: .5rem; align-items: flex-end; margin-bottom: 1rem;
  padding: .75rem .9rem; background: var(--bg-elev); border: 1px solid var(--line); border-radius: var(--radius); }
.filters .field { flex: 1 1 150px; min-width: 130px; gap: .2rem; }
.filters__actions { display: flex; gap: .4rem; margin-left: auto; }

/* Barre de synthèse chiffrée */
.totalsbar { display: flex; flex-wrap: wrap; gap: 1.4rem; padding: .75rem 1rem; background: var(--bg-inset);
  border-top: 1px solid var(--line); }
.totalsbar > div { display: flex; flex-direction: column; }
.totalsbar dt, .totalsbar__label { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--fg-muted); font-weight: 650; }
.totalsbar dd, .totalsbar__value { margin: 0; font-size: 1.05rem; font-weight: 720; font-variant-numeric: tabular-nums; }
.totalsbar__value--big { font-size: 1.3rem; color: var(--primary); }

/* --- Page de connexion --------------------------------------------------- */
.login { min-height: 100dvh; display: grid; grid-template-columns: 1fr; place-items: center; padding: 1.2rem;
  background: radial-gradient(1200px 600px at 15% -5%, color-mix(in srgb, var(--brand) 22%, transparent), transparent 60%), var(--bg); }
.login__card { width: min(100%, 420px); background: var(--bg-elev); border: 1px solid var(--line);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); padding: 1.7rem; }
.login__brand { display: flex; align-items: center; gap: .7rem; margin-bottom: 1.2rem; }
.login__brand .brandmark { width: 44px; height: 44px; flex-basis: 44px; border-radius: 13px; }
.login__brand h1 { font-size: 1.22rem; }
.login__brand p { font-size: .78rem; color: var(--fg-muted); margin: 0; text-transform: uppercase; letter-spacing: .06em; }
.login__err { background: color-mix(in srgb, var(--danger) 11%, transparent); color: var(--danger);
  border-radius: var(--radius-sm); padding: .55rem .7rem; font-size: .84rem; font-weight: 600; margin-bottom: .9rem; }
.login__demo { margin-top: 1.3rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.login__demo h2 { font-size: .74rem; text-transform: uppercase; letter-spacing: .07em; color: var(--fg-muted); margin-bottom: .5rem; }
/* Le mot de passe est sensible à la casse : il ne doit pas hériter du uppercase du titre. */
.login__demo h2 code { text-transform: none; letter-spacing: 0; font-family: var(--mono);
  background: var(--bg-soft); padding: .05rem .3rem; border-radius: 4px; color: var(--fg); }
.login__accounts { display: grid; gap: .3rem; }
.login__account { display: flex; align-items: center; gap: .55rem; padding: .4rem .55rem; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: var(--bg-inset); cursor: pointer; text-align: left; font-size: .8rem; width: 100%; }
.login__account:hover { border-color: var(--primary); background: var(--bg-soft); }
.login__account strong { display: block; font-size: .82rem; }
.login__account small { color: var(--fg-muted); font-size: .73rem; }
.login__foot { margin-top: 1.1rem; font-size: .74rem; color: var(--fg-faint); text-align: center; line-height: 1.5; }

/* --- Erreur fatale ------------------------------------------------------- */
.fatal { min-height: 100dvh; display: grid; place-content: center; justify-items: center; gap: .6rem; padding: 2rem; text-align: center; color: var(--fg-muted); }
.fatal h1 { font-size: 1.2rem; color: var(--fg); }
.fatal > .ico { color: var(--warning); }
.fatal__detail { font-family: var(--mono); font-size: .75rem; background: var(--bg-soft); padding: .6rem .8rem;
  border-radius: var(--radius-sm); max-width: 90vw; overflow-x: auto; text-align: left; }

/* --- Divers -------------------------------------------------------------- */
.muted { color: var(--fg-muted); }
.faint { color: var(--fg-faint); }
.small { font-size: .8rem; }
.strong { font-weight: 680; }
.mono { font-family: var(--mono); }
.nowrap { white-space: nowrap; }
.mt0 { margin-top: 0; } .mb0 { margin-bottom: 0; } .mt1 { margin-top: 1rem; } .mb1 { margin-bottom: 1rem; }
.flex { display: flex; gap: .5rem; align-items: center; }
.flex-between { display: flex; gap: .5rem; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.flex-wrap { flex-wrap: wrap; }
.text-success { color: var(--success); } .text-danger { color: var(--danger); }
.text-warning { color: var(--warning); } .text-primary { color: var(--primary); }
hr.sep { border: 0; border-top: 1px solid var(--line); margin: 1rem 0; }

/* --- Adaptation mobile --------------------------------------------------- */
@media (max-width: 960px) {
  .sidebar { transform: translateX(-100%); transition: transform .22s cubic-bezier(.2,.8,.3,1); box-shadow: var(--shadow-lg); }
  .sidebar.is-open { transform: none; }
  .sidebar .sidebar__close { display: grid; }
  .shellmain { margin-left: 0; }
  .topbar .topbar__burger { display: grid; }
  .view { padding: .9rem .8rem calc(74px + env(safe-area-inset-bottom, 0px)); }

  .mobilenav {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 50;
    background: color-mix(in srgb, var(--bg-elev) 94%, transparent); backdrop-filter: blur(12px);
    border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom, 0px);
  }
  .mobilenav__item { flex: 1; display: flex; flex-direction: column; align-items: center; gap: .1rem;
    padding: .45rem .2rem .5rem; font-size: .655rem; font-weight: 620; color: var(--fg-muted);
    background: none; border: 0; cursor: pointer; }
  .mobilenav__item:hover { text-decoration: none; }
  .mobilenav__item.is-active { color: var(--primary); }
  .mobilenav__item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }

  .pagehead__title { font-size: 1.2rem; }
  .card__body { padding: .8rem; }
  .modal { border-radius: var(--radius-lg) var(--radius-lg) 0 0; align-self: flex-end; max-height: 92dvh; }
  .modal-backdrop { place-items: end center; padding: 0; }
}

/* Colonnes secondaires masquées dès que la place manque */
@media (max-width: 1100px) {
  [data-hide="md"] { display: none !important; }
}

/* Tableaux en cartes sur très petit écran */
@media (max-width: 620px) {
  [data-hide="sm"], [data-hide="md"] { display: none !important; }
  .table thead { display: none; }
  .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
  .table tr { border-bottom: 1px solid var(--line); padding: .55rem .8rem; }
  .table tbody tr:last-child { border-bottom: 0; }
  .table td { border: 0; padding: .16rem 0; display: flex; justify-content: space-between; gap: .8rem; align-items: baseline; }
  .table td::before { content: attr(data-th); font-size: .7rem; text-transform: uppercase; letter-spacing: .04em;
    color: var(--fg-muted); font-weight: 700; flex: 0 0 auto; }
  .table td.ta-right { text-align: left !important; }
  .cell-actions { justify-content: flex-end; }
  .totalsbar { gap: .8rem 1.2rem; }
}

@media (min-width: 961px) { .mobilenav { display: none; } .scrim { display: none; } }

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

/* --- Impression ---------------------------------------------------------- */
@media print {
  .sidebar, .topbar, .mobilenav, .toasts, .pagehead__actions, .tabletools, .pager, .scrim, .btn { display: none !important; }
  .shellmain { margin: 0; }
  .view { max-width: none; padding: 0; }
  .card { box-shadow: none; border-color: #999; break-inside: avoid; }
  body { background: #fff; color: #000; font-size: 11px; }
}
