/* =========================================================================
   FREECOM WIFI — interface inspirée de Mikhmon (barre du haut fixe, menu latéral
   repliable, tuiles colorées, cartes à en-tête), version moderne.
   Thèmes : dark (défaut, esprit Mikhmon), light, blue, green, pink, freecom.
   Icônes : Tabler Icons (MIT) · Graphiques : Chart.js (MIT) — hébergés localement.
   ========================================================================= */

/* ---------- Jetons communs ---------- */
:root {
  --brand: #2B5BA8;
  --accent: #8CC63F;
  --c-blue: #20a8d8;
  --c-green: #4dbd74;
  --c-yellow: #f9b115;
  --c-red: #f86c6b;
  --c-purple: #7c69ef;
  --c-cyan: #39c2d7;
  --ok: #3aa55d;
  --bad: #e5534b;
  --warn: #d68910;
  --info: #2d8fd5;
  --radius: 12px;
  --radius-sm: 8px;
  --nav-h: 56px;
  --side-w: 250px;
  --side-mini: 66px;
  --f-display: "Bricolage Grotesque", "Segoe UI", sans-serif;
  --f-body: "Instrument Sans", "Segoe UI", sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
}

/* ---------- Thème sombre (Mikhmon) ---------- */
[data-theme="dark"] {
  color-scheme: dark;
  --bg: #2a3036;
  --bg-pattern: rgba(255, 255, 255, .025);
  --panel: #353c43;
  --panel-2: #2f353b;
  --line: #23282c;
  --line-soft: #2e3439;
  --hover: #3c444c;
  --text: #e4e7ea;
  --muted: #a3adb7;
  --faint: #7d8791;
  --input: #2b3137;
  --nav-bg: #3a4149;
  --nav-text: #e4e7ea;
  --side-bg: #3a4149;
  --side-text: #c8ced3;
  --side-group: #7f8a95;
  --side-hover: rgba(32, 168, 216, .16);
  --side-active: #20a8d8;
  --side-active-text: #fff;
  --primary: #20a8d8;
  --primary-text: #fff;
  --shadow: 0 1px 2px rgba(0, 0, 0, .25), 0 10px 26px -18px rgba(0, 0, 0, .7);
  --hero: linear-gradient(135deg, #1b7fa6, #20a8d8);
}

/* ---------- Thème clair ---------- */
[data-theme="light"], [data-theme="blue"], [data-theme="green"], [data-theme="pink"], [data-theme="freecom"] {
  color-scheme: light;
  --bg: #eef1f4;
  --bg-pattern: rgba(20, 30, 50, .045);
  --panel: #ffffff;
  --panel-2: #f6f8fa;
  --line: #dde2e7;
  --line-soft: #edf0f3;
  --hover: #f3f6f9;
  --text: #1f2a37;
  --muted: #5f6b7a;
  --faint: #8b95a2;
  --input: #fbfcfd;
  --shadow: 0 1px 2px rgba(20, 30, 50, .05), 0 10px 26px -18px rgba(20, 30, 50, .35);
}
[data-theme="light"] {
  --nav-bg: #ffffff;
  --nav-text: #2f353a;
  --side-bg: #ffffff;
  --side-text: #3c4650;
  --side-group: #97a1ab;
  --side-hover: rgba(32, 168, 216, .1);
  --side-active: #20a8d8;
  --side-active-text: #fff;
  --primary: #20a8d8;
  --primary-text: #fff;
  --hero: linear-gradient(135deg, #1b8fbf, #20a8d8);
}
[data-theme="blue"] {
  --nav-bg: #1d4f91;
  --nav-text: #fff;
  --side-bg: #173f74;
  --side-text: #d3e1f5;
  --side-group: #8aa6cd;
  --side-hover: rgba(255, 255, 255, .1);
  --side-active: #3b8beb;
  --side-active-text: #fff;
  --primary: #1f6fd1;
  --primary-text: #fff;
  --hero: linear-gradient(135deg, #173f74, #2b7de0);
}
[data-theme="green"] {
  --nav-bg: #2e7d4f;
  --nav-text: #fff;
  --side-bg: #256642;
  --side-text: #d6efdf;
  --side-group: #8fc4a3;
  --side-hover: rgba(255, 255, 255, .1);
  --side-active: #4dbd74;
  --side-active-text: #fff;
  --primary: #2f9a5a;
  --primary-text: #fff;
  --hero: linear-gradient(135deg, #256642, #3fae6a);
}
[data-theme="pink"] {
  --nav-bg: #b83280;
  --nav-text: #fff;
  --side-bg: #97266a;
  --side-text: #f8d9ea;
  --side-group: #e39cc5;
  --side-hover: rgba(255, 255, 255, .12);
  --side-active: #e83e8c;
  --side-active-text: #fff;
  --primary: #d63384;
  --primary-text: #fff;
  --hero: linear-gradient(135deg, #97266a, #e83e8c);
}
[data-theme="freecom"] {
  --nav-bg: #0B1730;
  --nav-text: #fff;
  --side-bg: #0e1d3b;
  --side-text: #c9d3e6;
  --side-group: #6479A3;
  --side-hover: rgba(255, 255, 255, .07);
  --side-active: var(--accent);
  --side-active-text: #0B1730;
  --primary: var(--brand);
  --primary-text: #fff;
  --hero: linear-gradient(135deg, #0B1730, var(--brand));
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 15px/1.5 var(--f-body);
  color: var(--text);
  background: radial-gradient(circle at 1px 1px, var(--bg-pattern) 1px, transparent 0) 0 0 / 22px 22px, var(--bg);
  -webkit-font-smoothing: antialiased;
  padding-top: var(--nav-h);
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { font-family: var(--f-display); letter-spacing: -.015em; margin: 0; line-height: 1.2; }
h2 { font-size: 1.05rem; font-weight: 700; }
h3 { font-size: .98rem; font-weight: 700; }
code, .mono { font-family: var(--f-mono); }
code { background: var(--panel-2); border: 1px solid var(--line); padding: 0 5px; border-radius: 5px; font-size: .85em; }
.ti { line-height: 1; vertical-align: -0.12em; }
hr { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: .84rem; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.center { text-align: center; }
.stack { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row-between { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
[hidden] { display: none !important; }
::selection { background: color-mix(in srgb, var(--primary) 35%, transparent); }

/* ---------- Barre du haut (Mikhmon) ---------- */
.navbar {
  position: fixed; inset: 0 0 auto 0; height: var(--nav-h); z-index: 60;
  display: flex; align-items: center; gap: 6px; padding: 0 12px;
  background: var(--nav-bg); color: var(--nav-text);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 80%, transparent);
  box-shadow: 0 2px 10px -6px rgba(0, 0, 0, .4);
}
.nav-btn {
  position: relative; display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 10px;
  border: 0; background: transparent; color: inherit; cursor: pointer; text-decoration: none !important;
}
.nav-btn:hover { background: color-mix(in srgb, var(--nav-text) 12%, transparent); }
.nav-brand { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none !important; margin-left: 4px; min-width: 0; }
.nav-picto { width: 30px; height: auto; filter: drop-shadow(0 3px 8px rgba(140, 198, 63, .4)); }
.nav-logo { width: 34px; height: 34px; object-fit: contain; background: #fff; border-radius: 8px; padding: 2px; }
.nav-brand strong { display: block; font-family: var(--f-display); font-size: 1rem; line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 220px; }
.nav-brand small { display: block; font-size: .72rem; opacity: .7; }
.nav-spacer { flex: 1; }
.nav-cta {
  display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px; border-radius: 99px; margin-right: 4px;
  background: var(--accent); color: #0B1730; font-weight: 700; font-size: .88rem; text-decoration: none !important;
  box-shadow: 0 4px 14px -6px color-mix(in srgb, var(--accent) 80%, transparent);
}
.nav-cta:hover { filter: brightness(1.06); }
.nav-clock { display: inline-flex; gap: 6px; align-items: center; font-size: .85rem; opacity: .85; padding: 0 8px; font-variant-numeric: tabular-nums; }
.nav-dot { position: absolute; top: 4px; right: 3px; min-width: 18px; height: 18px; border-radius: 99px; background: var(--c-red); color: #fff; font-size: .66rem; display: grid; place-items: center; padding: 0 4px; border: 2px solid var(--nav-bg); }
.nav-user { display: flex; align-items: center; gap: 8px; border: 0; background: transparent; color: inherit; cursor: pointer; padding: 4px 6px; border-radius: 10px; font: inherit; text-align: left; }
.nav-user:hover { background: color-mix(in srgb, var(--nav-text) 10%, transparent); }
.nav-user strong { display: block; font-size: .85rem; line-height: 1.15; max-width: 140px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-user small { display: block; font-size: .7rem; opacity: .7; }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(135deg, var(--accent), var(--c-blue)); color: #0B1730; font-weight: 800; font-family: var(--f-display); flex: none; }

/* Menus déroulants */
.dropdown { position: relative; }
.dropdown-menu {
  position: absolute; top: calc(100% + 8px); right: 0; min-width: 210px; z-index: 70; display: none;
  background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 12px; padding: 6px;
  box-shadow: 0 20px 50px -18px rgba(0, 0, 0, .55);
}
.dropdown.open .dropdown-menu { display: block; animation: pop .14s ease both; }
@keyframes pop { from { opacity: 0; transform: translateY(-4px) scale(.98); } }
.dropdown-menu a, .dropdown-menu button {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border-radius: 8px; border: 0; background: transparent;
  color: var(--text); font: 500 .9rem var(--f-body); cursor: pointer; text-decoration: none !important; text-align: left;
}
.dropdown-menu a:hover, .dropdown-menu button:hover { background: var(--hover); }
.dropdown-menu form { margin: 0; }
.dropdown-title { font-size: .7rem; text-transform: uppercase; letter-spacing: .12em; color: var(--faint); padding: 6px 10px 4px; font-weight: 700; }
.theme-opt.is-on { background: var(--hover); font-weight: 700; }
.swatch { width: 22px; height: 22px; border-radius: 7px; flex: none; border: 1px solid rgba(0, 0, 0, .15); }
.sw-dark { background: linear-gradient(135deg, #3a4149 50%, #20a8d8 50%); }
.sw-light { background: linear-gradient(135deg, #ffffff 50%, #20a8d8 50%); }
.sw-blue { background: linear-gradient(135deg, #1d4f91 50%, #3b8beb 50%); }
.sw-green { background: linear-gradient(135deg, #2e7d4f 50%, #4dbd74 50%); }
.sw-pink { background: linear-gradient(135deg, #b83280 50%, #e83e8c 50%); }
.sw-freecom { background: linear-gradient(135deg, #0B1730 50%, #8CC63F 50%); }

/* ---------- Menu latéral (repliable, façon Mikhmon) ---------- */
.sidenav {
  position: fixed; top: var(--nav-h); bottom: 0; left: 0; width: var(--side-w); z-index: 50;
  display: flex; flex-direction: column; background: var(--side-bg); color: var(--side-text);
  border-right: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
  transition: width .22s ease, transform .22s ease;
}
.side-nav { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 8px 10px 16px; scrollbar-width: thin; }
.side-group { font-size: .66rem; text-transform: uppercase; letter-spacing: .14em; color: var(--side-group); padding: 14px 10px 5px; font-weight: 700; white-space: nowrap; }
.side-link {
  position: relative; display: flex; align-items: center; gap: 12px; padding: 9px 10px; margin: 2px 0; border-radius: 9px;
  color: var(--side-text); font-weight: 500; font-size: .9rem; white-space: nowrap; transition: background .15s, color .15s;
}
.side-link:hover { background: var(--side-hover); color: inherit; text-decoration: none; }
.side-link.is-active { background: var(--side-active); color: var(--side-active-text); box-shadow: 0 6px 16px -10px var(--side-active); }
.side-link.is-cta:not(.is-active) { border: 1px dashed color-mix(in srgb, var(--accent) 70%, transparent); }
.side-link .ico { width: 22px; text-align: center; flex: none; }
.pill-count { margin-left: auto; background: var(--c-red); color: #fff; font-size: .68rem; border-radius: 99px; padding: 1px 7px; }
.side-foot { padding: 10px 16px; font-size: .72rem; color: var(--side-group); border-top: 1px solid color-mix(in srgb, var(--side-text) 12%, transparent); white-space: nowrap; }

body.side-mini .sidenav { width: var(--side-mini); }
body.side-mini .side-txt, body.side-mini .side-group span, body.side-mini .pill-count { display: none; }
body.side-mini .side-group { padding: 8px 0 2px; border-top: 1px solid color-mix(in srgb, var(--side-text) 10%, transparent); margin-top: 6px; }
body.side-mini .side-link { justify-content: center; padding: 10px 0; }
body.side-mini .main { margin-left: var(--side-mini); }

.main { margin-left: var(--side-w); min-width: 0; transition: margin-left .22s ease; }
.page-head { display: flex; align-items: flex-end; gap: 14px; padding: 20px 26px 10px; flex-wrap: wrap; }
.page-title { flex: 1; min-width: 200px; }
.page-title h1 { font-size: clamp(1.35rem, 2.2vw, 1.8rem); font-weight: 800; }
.crumb { font-size: .8rem; color: var(--muted); margin-bottom: 4px; }
.crumb a { color: var(--muted); }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.content { padding: 6px 26px 46px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; animation: rise .3s ease both; }
@keyframes rise { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }
.scrim { display: none; }

/* ---------- Bannières & messages ---------- */
.banner { margin: 0 26px 8px; padding: 10px 14px; border-radius: var(--radius-sm); display: flex; gap: 8px; align-items: center; font-size: .9rem; }
.banner-info { background: color-mix(in srgb, var(--info) 14%, var(--panel)); color: color-mix(in srgb, var(--info) 70%, var(--text)); }
.banner-warn { background: color-mix(in srgb, var(--warn) 16%, var(--panel)); color: color-mix(in srgb, var(--warn) 70%, var(--text)); }
.flashes { padding: 0 26px; display: grid; gap: 8px; }
.flash { display: flex; gap: 10px; align-items: flex-start; padding: 11px 14px; border-radius: var(--radius-sm); font-weight: 500; border-left: 4px solid; animation: rise .3s ease both; background: var(--panel); box-shadow: var(--shadow); }
.flash-success { border-color: var(--ok); color: color-mix(in srgb, var(--ok) 65%, var(--text)); }
.flash-error { border-color: var(--bad); color: color-mix(in srgb, var(--bad) 70%, var(--text)); }
.flash-info { border-color: var(--info); color: color-mix(in srgb, var(--info) 65%, var(--text)); }
.flash-warning { border-color: var(--warn); color: color-mix(in srgb, var(--warn) 70%, var(--text)); }

/* ---------- Cartes (en-tête façon Mikhmon) ---------- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); min-width: 0; }
.card-h {
  display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 18px; flex-wrap: wrap;
  background: var(--panel-2); border-bottom: 1px solid var(--line); border-radius: var(--radius) var(--radius) 0 0;
}
.card-h h2 { display: flex; align-items: center; gap: 8px; }
.card-h h2::before { content: ""; width: 4px; height: 16px; border-radius: 4px; background: var(--primary); flex: none; }
.card-h p { margin: 2px 0 0; color: var(--muted); font-size: .83rem; }
details.card > summary.card-h { list-style: none; }
details.card:not([open]) > summary.card-h { border-bottom: 0; border-radius: var(--radius); }
.card-b { padding: 16px 18px; }
.card-b.flush { padding: 0; }
.grid { display: grid; gap: 18px; grid-template-columns: minmax(0, 1fr); }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-main { grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); }

/* ---------- Tuiles statistiques (boîtes colorées Mikhmon) ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(175px, 100%), 1fr)); gap: 14px; }
.kpi {
  position: relative; overflow: hidden; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 15px 16px 13px; box-shadow: var(--shadow); animation: rise .4s ease both; color: var(--text); text-decoration: none !important; display: block;
}
.kpi:nth-child(2) { animation-delay: .04s; } .kpi:nth-child(3) { animation-delay: .08s; } .kpi:nth-child(4) { animation-delay: .12s; } .kpi:nth-child(5) { animation-delay: .16s; } .kpi:nth-child(6) { animation-delay: .2s; }
.kpi-label { font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; font-weight: 700; color: var(--muted); }
.kpi-value { font-family: var(--f-display); font-weight: 800; font-size: clamp(1.45rem, 2.4vw, 1.95rem); letter-spacing: -.02em; line-height: 1.1; margin-top: 6px; font-variant-numeric: tabular-nums; }
.kpi-value small { font-size: .5em; opacity: .75; font-weight: 600; letter-spacing: 0; }
.kpi-sub { font-size: .8rem; color: var(--muted); margin-top: 4px; }
.kpi-ico { position: absolute; right: 10px; bottom: 4px; font-size: 64px !important; opacity: .16; transform: rotate(-8deg); transition: transform .25s, opacity .25s; }
a.kpi:hover .kpi-ico { transform: rotate(0) scale(1.06); opacity: .26; }
a.kpi:hover { transform: translateY(-2px); transition: transform .15s; }
.kpi.is-hero, .kpi.c-blue, .kpi.c-green, .kpi.c-yellow, .kpi.c-red, .kpi.c-purple, .kpi.c-cyan { border-color: transparent; color: #fff; }
.kpi.is-hero .kpi-label, .kpi.is-hero .kpi-sub, .kpi[class*="c-"] .kpi-label, .kpi[class*="c-"] .kpi-sub { color: rgba(255, 255, 255, .85); }
.kpi.is-hero { background: var(--hero); }
.kpi.c-blue { background: linear-gradient(135deg, #1b8fbf, #20a8d8 60%, #4cc3ec); }
.kpi.c-green { background: linear-gradient(135deg, #36a15d, #4dbd74 60%, #72d196); }
.kpi.c-yellow { background: linear-gradient(135deg, #e09b00, #f9b115 60%, #ffcb52); }
.kpi.c-red { background: linear-gradient(135deg, #e04b4a, #f86c6b 60%, #ff9695); }
.kpi.c-purple { background: linear-gradient(135deg, #5b4bd1, #7c69ef 60%, #a193ff); }
.kpi.c-cyan { background: linear-gradient(135deg, #1ea5ba, #39c2d7 60%, #6fdbeb); }
.kpi-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }

/* Boîtes d'information (icône + texte, rangée du haut Mikhmon) */
.infoboxes { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); gap: 14px; }
.infobox { display: flex; gap: 14px; align-items: center; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; box-shadow: var(--shadow); }
.infobox-ico { width: 54px; height: 54px; border-radius: 12px; display: grid; place-items: center; flex: none; color: #fff; }
.infobox-ico .ti { font-size: 28px !important; }
.infobox-txt { font-size: .85rem; line-height: 1.45; min-width: 0; }
.infobox-txt b { font-family: var(--f-display); font-size: 1.02rem; }
.bg-blue { background: var(--c-blue); } .bg-green { background: var(--c-green); } .bg-yellow { background: var(--c-yellow); }
.bg-red { background: var(--c-red); } .bg-purple { background: var(--c-purple); } .bg-cyan { background: var(--c-cyan); }

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 8px 14px; border-radius: 9px; border: 1px solid var(--line);
  background: var(--panel); color: var(--text); font: 600 .88rem var(--f-body); cursor: pointer; text-decoration: none !important;
  transition: transform .08s, background .15s, border-color .15s, box-shadow .15s, filter .15s; white-space: nowrap;
}
.btn:hover { border-color: var(--primary); color: var(--text); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible, .field input:focus-visible, .field select:focus-visible, .field textarea:focus-visible, .input:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--primary) 40%, transparent); outline-offset: 1px;
}
.btn-primary { background: var(--primary); color: var(--primary-text); border-color: var(--primary); box-shadow: 0 6px 16px -10px var(--primary); }
.btn-primary:hover { filter: brightness(1.08); color: var(--primary-text); }
.btn-accent { background: var(--accent); color: #0B1730; border-color: var(--accent); box-shadow: 0 6px 16px -10px var(--accent); }
.btn-accent:hover { filter: brightness(1.06); color: #0B1730; border-color: var(--accent); }
.btn-danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 45%, transparent); background: transparent; }
.btn-danger:hover { background: var(--bad); color: #fff; border-color: var(--bad); }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-ghost:hover { background: var(--hover); border-color: transparent; }
.btn-sm { padding: 5px 10px; font-size: .8rem; border-radius: 8px; }
.btn-lg { padding: 12px 20px; font-size: 1rem; }
.btn[disabled], .btn:disabled { opacity: .5; pointer-events: none; }
.icon-btn { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; border: 0; background: transparent; color: inherit; cursor: pointer; }
.icon-btn:hover { background: var(--hover); }
form.inline { display: inline; }

/* ---------- Formulaires ---------- */
.form-grid { display: grid; gap: 13px 15px; grid-template-columns: repeat(auto-fit, minmax(min(205px, 100%), 1fr)); }
.field { display: grid; gap: 5px; min-width: 0; }
.field.span-2 { grid-column: span 2; }
.field.span-all { grid-column: 1 / -1; }
.field label, .label { font-size: .78rem; font-weight: 700; color: var(--muted); }
.field input, .field select, .field textarea, .input {
  width: 100%; padding: 9px 11px; border-radius: 9px; border: 1px solid var(--line); background: var(--input); color: var(--text); font: 500 .93rem var(--f-body);
}
.field input:focus, .field select:focus, .field textarea:focus, .input:focus { border-color: var(--primary); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 20%, transparent); }
.field textarea { min-height: 90px; resize: vertical; }
.field .hint { font-size: .76rem; color: var(--faint); }
.field input[type=color] { padding: 3px; height: 40px; }
.check { display: flex; gap: 9px; align-items: flex-start; font-weight: 500; cursor: pointer; }
.check input { margin-top: 3px; accent-color: var(--primary); width: 16px; height: 16px; flex: none; }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; margin-top: 4px; }
.fieldset { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 15px; margin: 0; }
.fieldset legend { font-weight: 700; font-size: .82rem; padding: 0 6px; color: var(--muted); }
.choice-cards { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(min(190px, 100%), 1fr)); }
.choice { position: relative; border: 1.5px solid var(--line); border-radius: 12px; padding: 12px 14px 12px 40px; cursor: pointer; background: var(--input); transition: border-color .15s, background .15s; display: block; }
.choice input { position: absolute; left: 14px; top: 15px; accent-color: var(--primary); }
.choice strong { display: block; font-size: .92rem; }
.choice span { font-size: .8rem; color: var(--muted); }
.choice:has(input:checked) { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 9%, var(--panel)); }
.choice:has(input:disabled) { opacity: .5; cursor: not-allowed; }

/* ---------- Filtres ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; padding: 12px 18px; border-bottom: 1px solid var(--line); background: var(--panel-2); }
.card > .filters:first-child { border-radius: var(--radius) var(--radius) 0 0; }
.filters .field { min-width: 140px; flex: 1 1 140px; max-width: 240px; }
.filters .field input, .filters .field select { padding: 7px 10px; font-size: .86rem; }
.seg { display: inline-flex; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 3px; gap: 2px; flex-wrap: wrap; box-shadow: var(--shadow); }
.seg a { padding: 5px 12px; border-radius: 7px; color: var(--muted); font-weight: 600; font-size: .83rem; text-decoration: none; }
.seg a:hover { color: var(--text); }
.seg a.is-on { background: var(--primary); color: var(--primary-text); }

/* ---------- Tableaux ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.t { width: 100%; border-collapse: collapse; font-size: .89rem; }
.t th { text-align: left; font-size: .7rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 700; padding: 9px 14px; border-bottom: 1px solid var(--line); background: var(--panel-2); white-space: nowrap; }
.t td { padding: 10px 14px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.t tbody tr { transition: background .12s; }
.t tbody tr:hover td { background: var(--hover); }
.t tr:last-child td { border-bottom: 0; }
.t .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.t td.actions { text-align: right; white-space: nowrap; }
.t tfoot td { font-weight: 700; background: var(--panel-2); border-top: 1px solid var(--line); }
.code { font-family: var(--f-mono); font-weight: 700; letter-spacing: .04em; font-size: .87rem; }
.empty { padding: 36px 20px; text-align: center; color: var(--muted); }
.empty .ico { opacity: .35; display: block; margin: 0 auto 8px; }
.pager { display: flex; gap: 6px; justify-content: space-between; align-items: center; padding: 10px 18px; border-top: 1px solid var(--line); font-size: .84rem; color: var(--muted); flex-wrap: wrap; }

/* ---------- Badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 99px; font-size: .74rem; font-weight: 700; background: color-mix(in srgb, var(--muted) 16%, transparent); color: var(--muted); white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.plain::before { display: none; }
.b-ok, .s-online, .s-active, .s-completed, .s-done, .s-present, .s-delivered, .s-paid { background: color-mix(in srgb, var(--ok) 17%, transparent); color: var(--ok); }
.b-bad, .s-offline, .s-cancelled, .s-suspended, .s-failed { background: color-mix(in srgb, var(--bad) 17%, transparent); color: var(--bad); }
.b-warn, .s-assigned, .s-past_due, .s-pending, .s-unconfirmed, .s-disabled, .s-error, .s-running { background: color-mix(in srgb, var(--warn) 18%, transparent); color: var(--warn); }
.b-info, .s-sold, .s-trial { background: color-mix(in srgb, var(--info) 17%, transparent); color: var(--info); }
.s-available { background: color-mix(in srgb, var(--c-green) 15%, transparent); color: color-mix(in srgb, var(--c-green) 75%, var(--text)); }
.s-expired, .s-unknown, .s-removed, .s-absent { background: color-mix(in srgb, var(--faint) 16%, transparent); color: var(--faint); }
.sev-critical { background: var(--bad); color: #fff; }
.sev-warning { background: color-mix(in srgb, var(--warn) 20%, transparent); color: var(--warn); }
.sev-info { background: color-mix(in srgb, var(--info) 18%, transparent); color: var(--info); }

/* ---------- Graphiques ---------- */
.chart { width: 100%; min-height: 240px; position: relative; }
.chart canvas { width: 100% !important; height: 250px !important; }
.chart svg { width: 100%; height: 240px; display: block; overflow: visible; }
.chart .axis { stroke: var(--line); }
.chart .grid-l { stroke: var(--line-soft); stroke-dasharray: 3 4; }
.chart text { font: 600 10.5px var(--f-body); fill: var(--faint); }
.chart .bar { fill: var(--primary); }
.chart .bar.is-hover { fill: var(--accent); }
.chart .line { fill: none; stroke: var(--primary); stroke-width: 2.5; }
.chart .area { fill: url(#area-grad); }
.chart-tip { position: absolute; pointer-events: none; background: #111827; color: #fff; padding: 6px 10px; border-radius: 8px; font-size: .8rem; white-space: nowrap; transform: translate(-50%, -110%); opacity: 0; transition: opacity .12s; z-index: 3; }
.chart-tip.on { opacity: 1; }
.hbars { display: grid; gap: 11px; }
.hbar { display: grid; grid-template-columns: minmax(90px, 150px) 1fr auto; gap: 10px; align-items: center; font-size: .85rem; }
.hbar-track { height: 9px; border-radius: 99px; background: var(--panel-2); border: 1px solid var(--line-soft); overflow: hidden; }
.hbar-fill { height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--primary), var(--accent)); transform-origin: left; animation: grow .8s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes grow { from { transform: scaleX(0); } }
.hbar b { font-variant-numeric: tabular-nums; }

/* ---------- Routeurs ---------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(270px, 100%), 1fr)); gap: 16px; }
.tile { background: var(--panel); border: 1px solid var(--line); border-top: 3px solid var(--c-green); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); display: grid; gap: 10px; position: relative; overflow: hidden; }
.tile-h { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.tile-h h3 a { color: var(--text); }
.tile .sig { position: absolute; right: 12px; bottom: 6px; opacity: .08; }
.tile .sig .ti { font-size: 70px !important; }
.tile.is-offline { border-top-color: var(--c-red); }
.meta { display: grid; grid-template-columns: auto 1fr; gap: 3px 12px; font-size: .84rem; margin: 0; }
.meta dt { color: var(--muted); }
.meta dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.pulse { width: 9px; height: 9px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 50%, transparent); animation: pulse 2s infinite; display: inline-block; }
.pulse.off { background: var(--bad); animation: none; }
@keyframes pulse { 70% { box-shadow: 0 0 0 8px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }

/* ---------- Tickets (talons perforés) ---------- */
.stubs { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(220px, 100%), 1fr)); gap: 12px; }
.stub { position: relative; background: #fff; color: #1f2a37; border: 1.5px dashed #c5ccd4; border-radius: 12px; padding: 12px 14px 12px 20px; overflow: hidden; break-inside: avoid; display: block; }
.stub::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 7px; background: var(--c, var(--brand)); }
.stub::after { content: ""; position: absolute; right: -9px; top: 50%; width: 18px; height: 18px; border-radius: 50%; background: var(--bg); border: 1.5px dashed #c5ccd4; transform: translateY(-50%); }
.stub-top { display: flex; justify-content: space-between; gap: 8px; font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--brand); }
.stub-offer { font-size: .8rem; color: #5f6b7a; }
.stub-code { font-family: var(--f-mono); font-weight: 700; font-size: 1.35rem; letter-spacing: .08em; color: #0B1730; margin: 4px 0 2px; }
.stub-pass { font-family: var(--f-mono); font-size: .9rem; }
.stub-meta { font-size: .72rem; color: #5f6b7a; }

/* ---------- Point de vente ---------- */
.pos { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(min(300px, 100%), 1fr); gap: 18px; align-items: start; }
.offer-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(165px, 100%), 1fr)); gap: 10px; }
.offer-card { position: relative; border: 1.5px solid var(--line); border-radius: 14px; padding: 14px; cursor: pointer; background: var(--input); transition: transform .12s, border-color .12s, box-shadow .12s; display: grid; gap: 3px; }
.offer-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.offer-card input { position: absolute; opacity: 0; }
.offer-card::before { content: ""; height: 5px; border-radius: 99px; background: var(--c, var(--brand)); margin-bottom: 6px; }
.offer-card strong { font-family: var(--f-display); font-size: 1rem; }
.offer-card .price { font-family: var(--f-display); font-weight: 800; font-size: 1.25rem; }
.offer-card .stock { font-size: .76rem; color: var(--muted); }
.offer-card:has(input:checked) { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 30%, transparent); }
.offer-card.is-empty { opacity: .45; cursor: not-allowed; }
.qty { display: flex; align-items: stretch; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; width: fit-content; }
.qty button { width: 44px; border: 0; background: var(--panel-2); color: var(--text); font-size: 1.2rem; cursor: pointer; font-weight: 700; }
.qty input { width: 70px; text-align: center; border: 0; font: 700 1.2rem var(--f-display); padding: 8px 0; background: var(--input); color: var(--text); }
.total-box { background: var(--hero); color: #fff; border-radius: var(--radius); padding: 18px 20px; display: grid; gap: 6px; box-shadow: var(--shadow); }
.total-box .big { font-family: var(--f-display); font-weight: 800; font-size: 2.2rem; letter-spacing: -.03em; }
.total-box .ln { display: flex; justify-content: space-between; color: rgba(255, 255, 255, .8); font-size: .88rem; }

/* ---------- Vérification ---------- */
.verdict { border-radius: var(--radius); padding: 18px 20px; display: flex; gap: 16px; align-items: flex-start; border: 1px solid; background: var(--panel); }
.verdict h2 { font-size: 1.35rem; }
.verdict-valid { border-color: var(--ok); background: color-mix(in srgb, var(--ok) 12%, var(--panel)); }
.verdict-invalid { border-color: var(--bad); background: color-mix(in srgb, var(--bad) 12%, var(--panel)); }
.verdict-unconfirmed { border-color: var(--warn); background: color-mix(in srgb, var(--warn) 13%, var(--panel)); }
.verdict .v-ico { width: 50px; height: 50px; border-radius: 14px; display: grid; place-items: center; flex: none; color: #fff; }
.verdict-valid .v-ico { background: var(--ok); } .verdict-invalid .v-ico { background: var(--bad); } .verdict-unconfirmed .v-ico { background: var(--warn); }

/* ---------- Chronologie ---------- */
.timeline { list-style: none; margin: 0; padding: 0; display: grid; }
.timeline li { position: relative; padding: 0 0 15px 22px; font-size: .87rem; }
.timeline li::before { content: ""; position: absolute; left: 3px; top: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--panel); border: 2px solid var(--primary); }
.timeline li::after { content: ""; position: absolute; left: 8px; top: 19px; bottom: 0; width: 1px; background: var(--line); }
.timeline li:last-child::after { display: none; }
.timeline time { display: block; font-size: .75rem; color: var(--faint); }

/* ---------- Script / code ---------- */
pre.script { background: #1b2026; color: #d7e3fa; padding: 14px 16px; border-radius: var(--radius-sm); overflow-x: auto; font: 500 .8rem/1.6 var(--f-mono); white-space: pre; margin: 0; border: 1px solid #0f1317; }
pre.script .c { color: #7c93c0; }
.copy-wrap { position: relative; }
.copy-wrap pre.script { white-space: pre-wrap; word-break: break-all; padding-right: 90px; }
.copy-wrap .btn { position: absolute; top: 8px; right: 8px; background: rgba(255, 255, 255, .12); color: #fff; border-color: transparent; }

/* ---------- Onglets ---------- */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); padding: 0 10px; overflow-x: auto; background: var(--panel-2); border-radius: var(--radius) var(--radius) 0 0; }
.tabs a { padding: 11px 12px; color: var(--muted); font-weight: 600; font-size: .88rem; border-bottom: 2px solid transparent; white-space: nowrap; text-decoration: none; }
.tabs a:hover { color: var(--text); }
.tabs a.is-on { color: var(--text); border-color: var(--primary); }

/* ---------- Dialogues ---------- */
dialog { border: 1px solid var(--line); border-radius: var(--radius); padding: 0; width: min(540px, calc(100vw - 32px)); background: var(--panel); color: var(--text); box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .6); }
dialog::backdrop { background: rgba(10, 14, 20, .55); backdrop-filter: blur(2px); }
dialog[open] { animation: pop .16s ease both; }

/* ---------- Matrice de permissions ---------- */
.matrix th, .matrix td { text-align: center; }
.matrix td:first-child, .matrix th:first-child { text-align: left; }
.matrix .grp td { background: var(--panel-2); font-weight: 700; font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }

/* ---------- Pages publiques ---------- */
body.guest { padding-top: 0; background: #0B1730; }
.guest-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.guest-hero { position: relative; overflow: hidden; padding: 56px; display: flex; flex-direction: column; justify-content: flex-end; color: #fff;
  background: radial-gradient(90% 70% at 20% 10%, rgba(43, 91, 168, .55), transparent 60%), radial-gradient(60% 60% at 90% 90%, rgba(140, 198, 63, .25), transparent 60%), #0B1730; }
.waves { position: absolute; left: 50%; top: 42%; }
.waves span { position: absolute; left: 50%; top: 50%; border: 1.5px solid rgba(140, 198, 63, .35); border-radius: 50%; transform: translate(-50%, -50%); animation: wave 5s linear infinite; opacity: 0; }
.waves span:nth-child(2) { animation-delay: 1.25s; } .waves span:nth-child(3) { animation-delay: 2.5s; } .waves span:nth-child(4) { animation-delay: 3.75s; }
@keyframes wave { 0% { width: 60px; height: 60px; opacity: .9; } 100% { width: 760px; height: 760px; opacity: 0; } }
.hero-picto { position: absolute; left: 50%; top: 42%; width: 120px; transform: translate(-50%, -50%); filter: drop-shadow(0 12px 40px rgba(140, 198, 63, .5)); }
.hero-copy { position: relative; max-width: 520px; }
.hero-copy h2 { font-size: clamp(1.9rem, 3.4vw, 2.9rem); font-weight: 800; line-height: 1.05; }
.hero-copy ul { list-style: none; padding: 0; margin: 20px 0 0; display: grid; gap: 8px; color: #b7c5e2; }
.hero-copy li::before { content: "▸ "; color: #8CC63F; }
.eyebrow { font-weight: 800; letter-spacing: .24em; font-size: .74rem; color: var(--accent); margin: 0 0 10px; }
.guest-panel { background: var(--bg); padding: 56px clamp(24px, 6vw, 80px); display: flex; flex-direction: column; justify-content: center; gap: 16px; }
.guest-panel h1 { font-size: 2rem; font-weight: 800; }
.guest-panel .sub { color: var(--muted); margin: 6px 0 16px; }
.guest-form { display: grid; gap: 14px; max-width: 440px; }
.demo-box { max-width: 440px; border: 1px dashed var(--line); border-radius: 12px; padding: 12px 14px; font-size: .84rem; color: var(--muted); background: var(--panel); }
.guest .flash { max-width: 440px; }

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-main, .pos { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 960px) {
  .sidenav { transform: translateX(-100%); width: var(--side-w) !important; box-shadow: 20px 0 40px -20px rgba(0, 0, 0, .5); }
  body.side-open .sidenav { transform: none; }
  body.side-open .scrim { display: block; position: fixed; inset: var(--nav-h) 0 0 0; background: rgba(10, 14, 20, .5); z-index: 45; }
  body.side-mini .side-txt, body.side-mini .side-group span { display: inline; }
  body.side-mini .side-link { justify-content: flex-start; padding: 9px 10px; }
  .main, body.side-mini .main { margin-left: 0; }
  .page-head { padding: 14px 16px 8px; }
  .content { padding: 6px 16px 40px; }
  .flashes { padding: 0 16px; }
  .banner { margin: 0 16px 8px; }
  .g2, .g3 { grid-template-columns: minmax(0, 1fr); }
  .nav-clock, .nav-user-txt { display: none; }
  .guest-wrap { grid-template-columns: minmax(0, 1fr); }
  .guest-hero { min-height: 230px; padding: 26px; }
  .hero-copy ul { display: none; }
  .guest-panel { padding: 30px 18px; }
}
@media (max-width: 620px) {
  .nav-brand small, .nav-cta span { display: none; }
  .nav-brand strong { max-width: 130px; }
  .nav-cta { padding: 0 11px; }
  .g4 { grid-template-columns: minmax(0, 1fr); }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi-value { font-size: 1.35rem; }
  .field.span-2 { grid-column: auto; }
  .card-h, .card-b { padding-left: 14px; padding-right: 14px; }
  .filters { padding: 10px 14px; }
  .filters .field { max-width: none; }
  table.t.stack-sm thead { display: none; }
  table.t.stack-sm, .t.stack-sm tbody, .t.stack-sm tr, .t.stack-sm td { display: block; width: 100%; }
  .t.stack-sm tr { border-bottom: 1px solid var(--line); padding: 8px 4px; }
  .t.stack-sm td { border: 0; padding: 4px 12px; display: flex; justify-content: space-between; gap: 12px; text-align: right; }
  .t.stack-sm td::before { content: attr(data-l); font-size: .7rem; font-weight: 700; text-transform: uppercase; color: var(--muted); text-align: left; }
  .t.stack-sm td.actions { justify-content: flex-end; }
  .t.stack-sm td.actions::before, .t.stack-sm td:not([data-l])::before { content: none; }
  .page-actions { width: 100%; }
}

/* ---------- Impression ---------- */
@media print {
  @page { size: A4; margin: 10mm; }
  :root, html, body { background: #fff !important; color-scheme: light !important; }
  body { padding: 0; }
  .navbar, .sidenav, .page-head, .flashes, .banner, .no-print, .scrim { display: none !important; }
  .main { margin: 0 !important; }
  .content { padding: 0; animation: none; }
  .card { box-shadow: none; border: 0; }
  .stubs { grid-template-columns: repeat(4, 1fr); gap: 6px; }
  .stub { padding: 8px 10px 8px 16px; }
  .stub::after { background: #fff; }
  .stub-code { font-size: 1.05rem; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
.kpis-tight { grid-template-columns: repeat(auto-fit, minmax(min(135px, 100%), 1fr)); gap: 12px; }
.kpis-tight .kpi-value { font-size: clamp(1.3rem, 2vw, 1.7rem); }
@media (max-width: 620px) {
  .offer-pick { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .navbar { gap: 2px; padding: 0 6px; }
  .nav-btn { width: 36px; }
  .nav-brand strong { max-width: 110px; }
  .pos aside { position: static !important; }
  .hbar { grid-template-columns: minmax(70px, 110px) 1fr auto; font-size: .8rem; }
}

/* ---------- Abonnement ---------- */
.step { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--primary); color: var(--primary-text); font-size: .85rem; font-weight: 800; }
.card-h h2:has(.step)::before { display: none; }
.plans { grid-template-columns: repeat(auto-fill, minmax(min(210px, 100%), 1fr)); }
.plan-feats { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 4px; font-size: .82rem; color: var(--muted); }
.plan-feats li.off { opacity: .45; text-decoration: line-through; }
.method-choice { border-left: 5px solid var(--mc, var(--primary)); }
.pay-panel { border: 1px dashed var(--line); border-radius: 12px; padding: 14px 16px; background: var(--panel-2); display: grid; gap: 12px; }
.pay-panel p { margin: 0; }
.pay-steps { margin: 0; padding-left: 20px; display: grid; gap: 6px; }
.pay-amount { color: var(--ok); font-size: 1.05rem; }

/* ---------- Pages façon Mikhmon (profils utilisateurs) ---------- */
.mk-head h2 { font-size: 1.15rem; }
.mk-head h2::before { display: none; }
.mk-head h2 a { font-size: .95rem; font-weight: 600; }
.mk-sep { color: var(--faint); font-weight: 400; margin: 0 4px; }
.mk-search { width: 200px; padding: 6px 10px; font-size: .85rem; }
.mk-table th { font-size: .74rem; line-height: 1.2; vertical-align: bottom; }
.mk-table td { padding: 8px 12px; }
.mk-table tr.mk-off td { opacity: .5; }
.mk-ico { display: inline-grid; place-items: center; width: 26px; height: 26px; border: 0; background: transparent; color: var(--primary); cursor: pointer; border-radius: 6px; vertical-align: middle; }
.mk-ico:hover { background: var(--hover); }
.mk-del { color: var(--c-red); }
.mk-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; vertical-align: middle; margin: 0 2px; }
.mk-ftable { width: 100%; border-collapse: collapse; }
.mk-ftable td { padding: 7px 0; border-top: 1px solid var(--line-soft); vertical-align: middle; }
.mk-ftable td:first-child { width: 38%; padding-right: 14px; font-weight: 600; color: var(--muted); font-size: .9rem; }
.mk-ftable tr:first-child td { border-top: 0; }
.mk-ftable tr[hidden] { display: none; }
.mk-btn-warning { background: var(--c-yellow); border-color: var(--c-yellow); color: #1f2a37; }
.mk-btn-warning:hover { filter: brightness(1.05); border-color: var(--c-yellow); color: #1f2a37; }
@media (max-width: 620px) { .mk-search { width: 100%; } .mk-ftable td:first-child { width: 42%; } }

/* =========================================================================
   Finitions v2 — interface plus nette et moderne, pensée mobile d'abord
   ========================================================================= */
:root { --radius: 16px; --radius-sm: 10px; --bn-h: 64px; --ease: cubic-bezier(.2, .8, .2, 1); }
[data-theme="dark"] { --bg: #252a2f; --panel: #30363c; --panel-2: #2b3136; --line: #20252a; --line-soft: #2a2f35; --hover: #383f46; }
[data-theme]:not([data-theme="dark"]) { --bg: #f1f4f8; --panel-2: #f8fafc; --line: #e3e8ee; --line-soft: #eef2f6; }
body { background:
  radial-gradient(1200px 600px at 100% -10%, color-mix(in srgb, var(--primary) 9%, transparent), transparent 60%),
  radial-gradient(900px 500px at -10% 110%, color-mix(in srgb, var(--accent) 7%, transparent), transparent 60%),
  radial-gradient(circle at 1px 1px, var(--bg-pattern) 1px, transparent 0) 0 0 / 22px 22px, var(--bg);
  background-attachment: fixed; }

/* Barre du haut « verre dépoli » */
.navbar { background: color-mix(in srgb, var(--nav-bg) 86%, transparent); backdrop-filter: saturate(160%) blur(14px); -webkit-backdrop-filter: saturate(160%) blur(14px); }
.nav-brand strong { letter-spacing: -.01em; }

/* Sélecteur de WiFi zone */
.zone-switch { margin-left: 10px; }
.zone-btn { display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 10px 0 12px; border-radius: 99px; cursor: pointer; font: 600 .86rem var(--f-body);
  color: inherit; background: color-mix(in srgb, var(--nav-text) 8%, transparent); border: 1px solid color-mix(in srgb, var(--nav-text) 16%, transparent); transition: background .15s; }
.zone-btn:hover { background: color-mix(in srgb, var(--nav-text) 14%, transparent); }
.zone-btn.is-on { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.zone-name { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.zone-menu { left: 0; right: auto; min-width: min(270px, 90vw); max-height: 70vh; overflow-y: auto; }
.zone-menu button { align-items: center; }
.zone-menu button span:last-child { display: grid; line-height: 1.25; }
.zone-menu small { color: var(--faint); font-size: .75rem; font-weight: 500; }
.zone-menu button.is-on { background: color-mix(in srgb, var(--primary) 12%, transparent); }

/* Cartes et tuiles : relief doux, survol vivant */
.card, .kpi, .tile, .infobox { transition: box-shadow .25s var(--ease), transform .25s var(--ease), border-color .25s; }
.tile:hover, .infobox:hover, a.kpi:hover { box-shadow: 0 2px 4px rgba(0, 0, 0, .06), 0 18px 40px -24px rgba(0, 0, 0, .45); transform: translateY(-2px); }
.card-h { background: linear-gradient(180deg, var(--panel-2), color-mix(in srgb, var(--panel-2) 60%, var(--panel))); }
.page-title h1 { background: linear-gradient(90deg, var(--text) 60%, color-mix(in srgb, var(--primary) 70%, var(--text))); -webkit-background-clip: text; background-clip: text; color: transparent; }
.side-link { transition: background .18s, color .18s, transform .18s var(--ease); }
.side-link:hover { transform: translateX(2px); }
.btn { transition: transform .1s, background .18s, border-color .18s, box-shadow .18s, filter .18s; }
.btn-primary:hover, .btn-accent:hover { transform: translateY(-1px); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--muted) 35%, transparent); border-radius: 99px; border: 2px solid transparent; background-clip: padding-box; }

/* Barre de navigation basse (smartphones) */
.bottom-nav { display: none; }
@media (max-width: 960px) {
  body { padding-bottom: calc(var(--bn-h) + env(safe-area-inset-bottom)); }
  .bottom-nav { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; position: fixed; left: 0; right: 0; bottom: 0; z-index: 55;
    height: calc(var(--bn-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
    background: color-mix(in srgb, var(--panel) 90%, transparent); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid var(--line); box-shadow: 0 -8px 24px -18px rgba(0, 0, 0, .5); }
  .bottom-nav a, .bottom-nav button { display: grid; place-items: center; align-content: center; gap: 2px; color: var(--muted); font: 600 .68rem var(--f-body);
    text-decoration: none !important; border: 0; background: transparent; cursor: pointer; }
  .bottom-nav a.is-active { color: var(--primary); }
  .bottom-nav .bn-cta .ico { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 16px; margin-top: -18px;
    background: var(--accent); color: #0B1730; box-shadow: 0 10px 22px -10px var(--accent); }
  .bottom-nav .bn-cta { color: var(--text); }
  .sidenav { bottom: calc(var(--bn-h) + env(safe-area-inset-bottom)); }
  .nav-cta { display: none; }
  .zone-switch { margin-left: 4px; }
  .zone-name { max-width: 120px; }
  .page-title h1 { font-size: 1.35rem; }
  /* Évite le zoom automatique d'iOS sur les champs */
  .field input, .field select, .field textarea, .input, .qty input { font-size: 16px; }
  .btn { min-height: 42px; }
  .btn-sm { min-height: 36px; }
  .chart canvas { height: 210px !important; }
  /* Dialogues en feuille glissante */
  dialog { width: 100vw; max-width: 100vw; margin: auto 0 0; border-radius: 20px 20px 0 0; max-height: 92vh; }
  dialog[open] { animation: sheet .25s var(--ease) both; }
  @keyframes sheet { from { transform: translateY(40px); opacity: .6; } }
  .pos aside { position: static !important; }
}
@media (max-width: 620px) {
  .nav-brand span, .nav-clock { display: none; }
  .zone-name { max-width: 150px; }
  .nav-user-txt { display: none; }
  .content { gap: 14px; }
  .kpi { padding: 13px 14px 11px; }
  .kpi-ico { font-size: 48px !important; }
  .infoboxes { grid-template-columns: minmax(0, 1fr); }
  .infobox-ico { width: 46px; height: 46px; }
  .seg { width: 100%; overflow-x: auto; flex-wrap: nowrap; }
  .seg a { white-space: nowrap; }
  .row-between > .row { width: 100%; }
  /* Tableaux en fiches */
  .t.stack-sm tbody { display: grid; gap: 10px; padding: 10px; }
  .t.stack-sm tr { border: 1px solid var(--line); border-radius: 14px; background: var(--panel); padding: 8px 2px; box-shadow: var(--shadow); }
  .t.stack-sm tr:hover td { background: transparent; }
  .t.stack-sm td { padding: 5px 12px; min-height: 30px; align-items: center; }
  .card-b.flush .t.stack-sm { background: var(--panel-2); }
  .mk-table { min-width: 760px; }
  .tabs a { padding: 12px 10px; }
  .pager { justify-content: center; }
  .total-box .big { font-size: 1.9rem; }
  .form-actions { position: sticky; bottom: calc(var(--bn-h) + env(safe-area-inset-bottom) + 6px); background: color-mix(in srgb, var(--panel) 92%, transparent); padding: 8px; border-radius: 12px; }
  .form-actions .btn { flex: 1; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* Tableau de bord mobile façon Mikhmon : tuiles Hotspot en premier, infos en bandeau glissant */
@media (max-width: 960px) {
  .content:has(.dash-hotspot) > * { order: 10; }
  .content:has(.dash-hotspot) > .dash-hotspot { order: 1; }
  .content:has(.dash-hotspot) > .dash-ann { order: 2; }
  .content:has(.dash-hotspot) > .dash-info { order: 3; }
  body:has(.dash-hotspot) .banner-sub { display: none; }
  .dash-hotspot .kpis-tight { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .dash-info { display: flex; overflow-x: auto; gap: 10px; padding: 2px 2px 6px; scroll-snap-type: x mandatory; scrollbar-width: none; }
  .dash-info::-webkit-scrollbar { display: none; }
  .dash-info .infobox { flex: 0 0 min(84%, 320px); scroll-snap-align: start; padding: 10px 12px; }
  .dash-info .infobox-ico { width: 42px; height: 42px; border-radius: 11px; }
  .dash-info .infobox-ico .ti { font-size: 22px !important; }
  .dash-info .infobox-txt { font-size: .8rem; }
}

/* Garde-fous anti-débordement horizontal (petits écrans) */
html, body { overflow-x: clip; }
.main, .content > *, .card, .card-b, .kpi, .infobox, .tile { min-width: 0; }
.kpi-value, .infobox-txt, .card-h h2, .row-between b { overflow-wrap: anywhere; }
img, svg, canvas, video { max-width: 100%; }
@media (max-width: 420px) {
  .zone-name { max-width: 96px; }
  .navbar { padding: 0 4px; }
  .nav-btn { width: 34px; height: 34px; }
  .avatar { width: 30px; height: 30px; font-size: .85rem; }
  .content { padding: 6px 12px 36px; }
  .page-head { padding: 12px 12px 6px; }
  .flashes { padding: 0 12px; }
  .card-h, .card-b { padding-left: 12px; padding-right: 12px; }
  .kpi-label { font-size: .66rem; letter-spacing: .05em; }
  .kpi-sub { font-size: .74rem; }
  .kpis-tight .kpi-value { font-size: 1.25rem; }
  .row-between b[style*="font-size:1.5rem"] { font-size: 1.2rem !important; }
  .hbar { grid-template-columns: minmax(64px, 96px) minmax(0, 1fr) auto; gap: 8px; font-size: .78rem; }
  .bottom-nav a, .bottom-nav button { font-size: .62rem; }
}
@media (max-width: 620px) {
  pre.script { white-space: pre-wrap; word-break: break-word; font-size: .74rem; }
  summary.btn { white-space: normal; text-align: left; height: auto; min-height: 42px; padding-top: 8px; padding-bottom: 8px; }
  .choice-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .choice { padding: 10px 10px 10px 34px; }
  .choice input { left: 11px; top: 13px; }
  .method-choice, .pay-panel { grid-column: 1 / -1; }
  .chart { min-height: 210px; }
}
code { overflow-wrap: anywhere; }

/* ---------- Impression des tickets (modèles) ---------- */
.print-bar { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; align-items: center; }
.tk { display: grid; gap: 8px; color: #111827; }
.tk-item { background: #fff; border: 1.4px dashed #9aa4b2; border-radius: 10px; padding: 8px 10px 7px 14px; position: relative; overflow: hidden; break-inside: avoid; page-break-inside: avoid; }
.tk-item::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 6px; background: var(--c, #2B5BA8); }
.tk-head { display: flex; justify-content: space-between; gap: 6px; font-size: .68rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.tk-brand { color: #2B5BA8; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tk-price { color: #111827; white-space: nowrap; }
.tk-body { display: flex; gap: 8px; align-items: center; justify-content: space-between; margin: 3px 0; }
.tk-main { min-width: 0; flex: 1; }
.tk-offer { font-size: .72rem; color: #4b5563; }
.tk-lbl { font-size: .52rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: #9ca3af; margin-top: 2px; }
.tk-code { font: 700 1.15rem/1.15 var(--f-mono); letter-spacing: .06em; color: #0B1730; word-break: break-all; }
.tk-code.tk-sm { font-size: .9rem; }
.tk-meta { font-size: .6rem; color: #4b5563; margin-top: 2px; }
.tk-qr { width: 64px; height: 64px; flex: none; }
.tk-qr svg { width: 100%; height: 100%; display: block; }
.tk-foot { font-size: .56rem; color: #6b7280; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tk-standard { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.tk-compact { grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: 5px; }
.tk-compact .tk-code { font-size: .95rem; }
.tk-compact .tk-qr { width: 48px; height: 48px; }
.tk-compact .tk-foot, .tk-compact .tk-meta { display: none; }
.tk-thermal58, .tk-thermal80 { grid-template-columns: minmax(0, 1fr); width: 58mm; max-width: 100%; margin: 0 auto; gap: 0; }
.tk-thermal80 { width: 80mm; }
.tk-thermal58 .tk-item, .tk-thermal80 .tk-item { border: 0; border-bottom: 1.4px dashed #111; border-radius: 0; padding: 6px 2px 8px; text-align: center; }
.tk-thermal58 .tk-item::before, .tk-thermal80 .tk-item::before { display: none; }
.tk-thermal58 .tk-body, .tk-thermal80 .tk-body { flex-direction: column; }
.tk-thermal58 .tk-head, .tk-thermal80 .tk-head { justify-content: center; flex-direction: column; align-items: center; }
.tk-thermal58 .tk-qr, .tk-thermal80 .tk-qr { width: 30mm; height: 30mm; }
.tk-thermal80 .tk-code { font-size: 1.4rem; }
.tk-thermal58 *, .tk-thermal80 * { color: #000 !important; }
@media print {
  .tk-standard { grid-template-columns: repeat(4, 1fr); gap: 5px; }
  .tk-compact { grid-template-columns: repeat(5, 1fr); gap: 4px; }
  .tk-thermal58, .tk-thermal80 { width: 100%; }
  .tk-item { box-shadow: none; }
}

/* Paramètres — partage de la boutique en ligne */
.shop-share { display: flex; gap: 14px; align-items: center; margin-top: 12px; padding: 12px; border: 1px dashed var(--line); border-radius: var(--radius-sm); }
.shop-share .qr { flex: none; width: 96px; height: 96px; padding: 6px; background: #fff; border-radius: 8px; }
.shop-share .qr svg { width: 100%; height: 100%; display: block; }
@media (max-width: 480px) { .shop-share { flex-direction: column; align-items: flex-start; } }
/* ===================== Génération de tickets (assistant + aperçu) ===================== */
.gen { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; align-items: start; }
.gen-main { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; min-width: 0; }
.gen-h { display: flex; gap: 14px; align-items: flex-start; padding: 16px 18px 4px; }
.gen-h h2 { margin: 0; font: 700 1.02rem var(--f-display); }
.gen-h p { margin: 2px 0 0; font-size: .8rem; color: var(--muted); }
.gen-num { flex: none; width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; font: 800 .9rem var(--f-display);
  background: color-mix(in srgb, var(--primary) 16%, transparent); color: var(--primary); }
.gen-body { padding: 14px 18px 18px; display: grid; gap: 16px; }
.gen-label { display: flex; align-items: baseline; gap: 6px; font-size: .78rem; font-weight: 600; color: var(--muted); margin-bottom: 7px; }
.gen-label b { color: var(--text); font-family: var(--f-mono); font-size: .9rem; }

/* Offres */
.gen-offers { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(170px, 100%), 1fr)); gap: 10px; padding: 14px 18px 18px; }
.gen-offer { --c: var(--primary); position: relative; display: grid; gap: 4px; padding: 14px 14px 12px 18px; border-radius: 14px; cursor: pointer;
  background: var(--input); border: 1.5px solid var(--line); overflow: hidden; transition: transform .14s, border-color .14s, box-shadow .14s; }
.gen-offer::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--c); }
.gen-offer input { position: absolute; opacity: 0; pointer-events: none; }
.gen-offer:hover { transform: translateY(-2px); }
.gen-offer:has(input:checked) { border-color: var(--c); box-shadow: 0 10px 24px -14px var(--c), 0 0 0 1px var(--c) inset;
  background: color-mix(in srgb, var(--c) 9%, var(--input)); }
.gen-offer:has(input:focus-visible) { outline: 2px solid var(--c); outline-offset: 2px; }
.gen-offer-name { font-weight: 700; font-size: .9rem; padding-right: 22px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gen-offer-price { font: 800 1.35rem/1.1 var(--f-display); letter-spacing: -.02em; }
.gen-offer-price small { font-size: .7rem; font-weight: 700; color: var(--muted); letter-spacing: 0; }
.gen-offer-meta { display: flex; flex-wrap: wrap; gap: 2px 10px; font-size: .74rem; color: var(--muted); }
.gen-offer-meta .ti { color: var(--c); }
.gen-tick { position: absolute; top: 10px; right: 10px; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center;
  background: var(--c); color: #fff; transform: scale(0); transition: transform .2s cubic-bezier(.3, 1.6, .5, 1); }
.gen-offer:has(input:checked) .gen-tick { transform: scale(1); }

/* Quantité */
.gen-qty { display: grid; gap: 10px; }
.gen-stepper { display: grid; grid-template-columns: 48px minmax(0, 1fr) 48px; max-width: 320px; border: 1.5px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--input); }
.gen-stepper input { border: 0 !important; background: transparent !important; text-align: center; font: 800 1.6rem var(--f-display); padding: 8px 0; box-shadow: none !important; -moz-appearance: textfield; appearance: textfield; min-width: 0; color: var(--text); }
.gen-stepper input::-webkit-inner-spin-button, .gen-stepper input::-webkit-outer-spin-button { -webkit-appearance: none; }
.gen-stepper:focus-within { border-color: var(--primary); }
.gen-stepper-btn { border: 0; background: transparent; color: var(--muted); cursor: pointer; display: grid; place-items: center; transition: background .12s, color .12s; }
.gen-stepper-btn:hover { background: var(--hover); color: var(--text); }
.gen-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.gen-chip { border: 1.5px solid var(--line); background: transparent; color: var(--muted); border-radius: 99px; padding: 5px 13px; font: 600 .8rem var(--f-body); cursor: pointer; transition: all .12s; }
.gen-chip:hover { color: var(--text); border-color: var(--muted); }
.gen-chip.is-on { background: var(--primary); border-color: var(--primary); color: var(--primary-text); }
.gen-quota { display: grid; gap: 5px; font-size: .76rem; color: var(--muted); max-width: 320px; }
.gen-quota-bar { height: 6px; border-radius: 99px; background: var(--line); overflow: hidden; }
.gen-quota-bar span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--primary), var(--accent)); }

/* Format */
.gen-format { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; padding-top: 14px; border-top: 1px dashed var(--line); }
.gen-field { min-width: 0; }
.gen-seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; padding: 3px; gap: 3px; border-radius: 12px; background: var(--input); border: 1px solid var(--line); }
.gen-seg label { position: relative; cursor: pointer; min-width: 0; }
.gen-seg input { position: absolute; opacity: 0; pointer-events: none; }
.gen-seg span { display: flex; align-items: center; justify-content: center; gap: 5px; padding: 8px 6px; border-radius: 9px; font-size: .8rem; font-weight: 600; color: var(--muted); text-align: center; transition: all .14s; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gen-seg input:checked + span { background: var(--panel); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, .18); }
.gen-seg input:focus-visible + span { outline: 2px solid var(--primary); }
.gen-range { width: 100%; accent-color: var(--primary); margin: 10px 0 0; }
.gen-field input.mono { text-transform: uppercase; letter-spacing: .1em; }
.gen-field.field .gen-label { margin-bottom: 7px; }
.gen-field.field input { width: 100%; }

/* Portée / envoi */
.gen-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.gen-tiles.is-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.gen-tile { position: relative; display: grid; justify-items: start; align-content: start; gap: 4px; padding: 14px; border-radius: 14px; cursor: pointer; background: var(--input);
  border: 1.5px solid var(--line); transition: border-color .14s, background .14s; min-width: 0; }
.gen-tile input { position: absolute; opacity: 0; pointer-events: none; }
.gen-tile > .ti { color: var(--muted); margin-bottom: 4px; }
.gen-tile strong { font-size: .88rem; }
.gen-tile span { font-size: .76rem; color: var(--muted); line-height: 1.4; }
.gen-tile.is-row { grid-template-columns: auto minmax(0, 1fr); gap: 12px; align-items: start; }
.gen-tile.is-row > .ti { margin: 2px 0 0; }
.gen-tile.is-row > span { display: grid; gap: 3px; }
.gen-tile.is-row > span strong { color: var(--text); }
.gen-tile:has(input:checked) { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 9%, var(--input)); }
.gen-tile:has(input:checked) > .ti { color: var(--primary); }
.gen-tile:has(input:focus-visible) { outline: 2px solid var(--primary); outline-offset: 2px; }
.gen-tile:has(input:disabled) { opacity: .45; cursor: not-allowed; }
.gen-zones { display: flex; flex-wrap: wrap; gap: 8px; }
.gen-zones[hidden] { display: none; }
.gen-zone { position: relative; }
.gen-zone input { position: absolute; opacity: 0; pointer-events: none; }
.gen-zone span { display: inline-flex; align-items: center; gap: 6px; padding: 7px 13px; border-radius: 99px; border: 1.5px solid var(--line); font-size: .82rem; font-weight: 600; cursor: pointer; transition: all .14s; }
.gen-zone small { color: var(--muted); font-weight: 500; }
.gen-zone input:checked + span { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 14%, transparent); }
.gen-zone input:checked + span .ti { color: var(--primary); }
.gen-zone input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: 2px; }

/* Récapitulatif + aperçu du ticket */
.gen-side { position: sticky; top: calc(var(--nav-h) + 16px); }
.gen-summary { padding: 18px; display: grid; gap: 14px; }
.gen-ticket { --c: var(--primary); border-radius: 16px; background: #fffdf8; color: #14202f; overflow: hidden; box-shadow: 0 16px 30px -18px rgba(0, 0, 0, .6); }
.gen-ticket-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 12px 14px; color: #fff;
  background: linear-gradient(135deg, var(--c), color-mix(in srgb, var(--c) 55%, #0b1220)); transition: background .25s; }
.gen-ticket-brand { font: 700 .74rem var(--f-body); letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gen-ticket-price { font: 800 1.05rem var(--f-display); white-space: nowrap; }
.gen-ticket-cut { position: relative; border-top: 2px dashed #d9d2c3; margin: 0 12px; }
.gen-ticket-cut::before, .gen-ticket-cut::after { content: ""; position: absolute; top: -9px; width: 16px; height: 16px; border-radius: 50%; background: var(--panel); }
.gen-ticket-cut::before { left: -21px; } .gen-ticket-cut::after { right: -21px; }
.gen-ticket-code { display: grid; justify-items: center; gap: 3px; padding: 14px 12px 8px; }
.gen-ticket-code small { font-size: .68rem; color: #6b7686; text-transform: uppercase; letter-spacing: .1em; }
.gen-ticket-code > b { font-size: 1.5rem; letter-spacing: .12em; word-break: break-all; text-align: center; line-height: 1.2; color: #14202f; }
.gen-ticket-code .gen-ticket-pass { text-transform: none; letter-spacing: 0; font-size: .74rem; }
.gen-ticket-pass[hidden] { display: none; }
.gen-ticket-foot { display: flex; justify-content: space-between; gap: 8px; padding: 8px 14px 12px; font-size: .74rem; color: #4d5868; }
.gen-ticket-foot span:first-child { font-weight: 700; color: var(--c); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gen-ticket-hint { margin: -6px 0 0; font-size: .72rem; color: var(--faint); text-align: center; }
.gen-recap { margin: 0; display: grid; gap: 8px; }
.gen-recap div { display: flex; justify-content: space-between; gap: 10px; font-size: .84rem; }
.gen-recap dt { color: var(--muted); flex: none; }
.gen-recap dd { margin: 0; font-weight: 600; text-align: right; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gen-total { display: flex; justify-content: space-between; align-items: baseline; padding-top: 12px; border-top: 1px dashed var(--line); }
.gen-total span { font-size: .8rem; color: var(--muted); }
.gen-total b { font: 800 1.45rem var(--f-display); letter-spacing: -.02em; }
.gen-submit { width: 100%; justify-content: center; }
.gen-mbar { display: none; }

@media (max-width: 1100px) {
  .gen { grid-template-columns: minmax(0, 1fr); }
  .gen-side { position: static; }
  .gen-summary { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 20px; align-items: start; }
  .gen-summary > .gen-ticket { grid-column: 1; grid-row: 1 / span 3; }
  .gen-summary > .gen-ticket-hint { grid-column: 1; grid-row: 4; margin: 0; }
  .gen-summary > .gen-recap, .gen-summary > .gen-total, .gen-summary > .gen-submit { grid-column: 2; }
}
@media (max-width: 620px) {
  .gen { gap: 14px; }
  .gen-main { gap: 14px; }
  .gen-h { padding: 14px 14px 2px; }
  .gen-body, .gen-offers { padding-left: 14px; padding-right: 14px; }
  .gen-offers { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .gen-offer { padding: 12px 10px 10px 14px; }
  .gen-offer-price { font-size: 1.15rem; }
  .gen-format { grid-template-columns: minmax(0, 1fr); }
  .gen-stepper { max-width: none; }
  .gen-chips { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 5px; }
  .gen-chip { padding: 6px 0; }
  .gen-quota { max-width: none; }
  .gen-tiles { gap: 6px; }
  .gen-tile { padding: 12px 6px; justify-items: center; text-align: center; }
  .gen-tile:not(.is-row) > span { display: none; }
  .gen-tile strong { font-size: .78rem; }
  .gen-tiles.is-2 { grid-template-columns: minmax(0, 1fr); }
  .gen-tile.is-row { justify-items: start; text-align: left; padding: 12px; }
  .gen-summary { grid-template-columns: minmax(0, 1fr); }
  .gen-summary > * { grid-column: 1 !important; grid-row: auto !important; }
  .gen-summary .gen-submit { display: none; }
  .gen-mbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; position: sticky; bottom: calc(var(--bn-h) + env(safe-area-inset-bottom) + 8px);
    z-index: 20; padding: 10px 10px 10px 16px; border-radius: 16px; border: 1px solid var(--line);
    background: color-mix(in srgb, var(--panel) 92%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); box-shadow: 0 14px 30px -14px rgba(0, 0, 0, .55); }
  .gen-mbar div { display: grid; line-height: 1.15; }
  .gen-mbar small { font-size: .72rem; color: var(--muted); }
  .gen-mbar b { font: 800 1.15rem var(--f-display); }
}

/* ===================== Accès à distance (Winbox / WebFig / équipements) ===================== */
.remote-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; padding: 4px 18px 18px; }
.remote-tile { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border-radius: 14px; background: var(--input); border: 1px solid var(--line); min-width: 0; }
.remote-ico { flex: none; width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center;
  background: color-mix(in srgb, var(--primary) 14%, transparent); color: var(--primary); }
.remote-body { display: grid; gap: 6px; justify-items: start; min-width: 0; }
.remote-body strong { font: 700 .95rem var(--f-display); }
.remote-body p { margin: 0; font-size: .8rem; color: var(--muted); }
.remote-addr { display: flex; align-items: center; gap: 4px; max-width: 100%; }
.remote-addr code { font: 700 .92rem var(--f-mono); padding: 6px 10px; border-radius: 8px; background: var(--panel); border: 1px dashed var(--primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.remote-wait { color: var(--warn); font-weight: 600; }

.page-intro { display: flex; gap: 16px; align-items: flex-start; justify-content: space-between; margin-bottom: 14px; }
.page-intro p { margin: 0; max-width: 780px; font-size: .86rem; }
.dev-filter select { min-width: 200px; }
.dev-router .card-h h2 { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.dev-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(330px, 100%), 1fr)); gap: 10px; padding: 4px 18px 18px; }
.dev { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 14px; background: var(--input); border: 1px solid var(--line); min-width: 0; transition: border-color .15s; }
.dev:hover { border-color: color-mix(in srgb, var(--primary) 50%, var(--line)); }
.dev-ico { position: relative; flex: none; width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--panel); color: var(--primary); }
.dev-dot { position: absolute; right: -3px; bottom: -3px; width: 12px; height: 12px; border-radius: 50%; background: var(--ok); border: 2px solid var(--input); box-shadow: 0 0 10px color-mix(in srgb, var(--ok) 60%, transparent); }
.dev.is-down .dev-dot { background: var(--bad); box-shadow: none; }
.dev.is-down .dev-ico { color: var(--muted); }
.dev-body { display: grid; gap: 2px; min-width: 0; flex: 1; }
.dev-body strong { font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dev-body .mono { font-size: .78rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dev-actions { display: flex; gap: 4px; align-items: center; flex: none; }
.dev-actions form { margin: 0; }

@media (max-width: 960px) { .remote-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 620px) {
  .remote-grid, .dev-grid { padding: 4px 14px 14px; }
  .page-intro { flex-direction: column; }
  .dev-filter, .dev-filter select { width: 100%; }
  .dev { flex-wrap: wrap; }
  .dev-actions { width: 100%; justify-content: flex-end; }
}

/* ===================== Studio de portail captif (agent IA) ===================== */
.studio { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 22px; align-items: start; }
.studio-stage { position: relative; display: grid; justify-items: center; gap: 16px; padding: 28px 16px 20px; border-radius: 22px; overflow: hidden;
  background: radial-gradient(120% 90% at 50% 0%, color-mix(in srgb, var(--primary) 18%, var(--panel)) 0%, var(--panel) 55%);
  border: 1px solid var(--line); min-width: 0; }
.studio-glow { position: absolute; width: 460px; height: 460px; top: -120px; left: 50%; transform: translateX(-50%); border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--accent) 22%, transparent), transparent 65%); filter: blur(10px); pointer-events: none; }

.phone { position: relative; width: 340px; max-width: 100%; aspect-ratio: 9 / 18.5; border-radius: 44px; padding: 12px; background: #0b0d12;
  box-shadow: 0 0 0 2px #2a2f3a, 0 40px 80px -30px rgba(0, 0, 0, .75), inset 0 0 0 1px rgba(255, 255, 255, .06); }
.phone-notch { position: absolute; top: 18px; left: 50%; transform: translateX(-50%); width: 92px; height: 24px; border-radius: 99px; background: #000; z-index: 3; }
.phone-screen { position: relative; width: 100%; height: 100%; border-radius: 34px; overflow: hidden; background: #fff; }
.phone-screen iframe { width: 100%; height: 100%; border: 0; display: block; background: #fff; }
.phone-empty { height: 100%; display: grid; place-content: center; justify-items: center; gap: 10px; padding: 30px; text-align: center; color: #5b6576;
  background: repeating-linear-gradient(135deg, #f6f7fb 0 14px, #eff1f7 14px 28px); }
.phone-empty b { color: #1d2433; font: 800 1.05rem var(--f-display); }
.phone-empty span { font-size: .85rem; }
.phone-empty-ico { width: 64px; height: 64px; border-radius: 20px; display: grid; place-items: center; background: #fff; color: var(--primary); box-shadow: 0 10px 24px -12px rgba(0, 0, 0, .35); }

/* Génération en cours : squelette animé + messages */
.phone-busy { position: absolute; inset: 0; z-index: 2; display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 64px 24px 24px;
  background: linear-gradient(160deg, #10131c, #1b2030); }
.phone-busy[hidden] { display: none; }
.sk { border-radius: 12px; background: linear-gradient(90deg, rgba(255,255,255,.06) 0%, rgba(255,255,255,.16) 40%, rgba(255,255,255,.06) 80%);
  background-size: 260% 100%; animation: sk 1.4s ease-in-out infinite; }
.sk-logo { width: 64px; height: 64px; border-radius: 20px; }
.sk-h { width: 70%; height: 22px; } .sk-p { width: 50%; height: 12px; }
.sk-input { width: 100%; height: 50px; margin-top: 14px; } .sk-btn { width: 100%; height: 50px; background-color: color-mix(in srgb, var(--accent) 35%, transparent); }
.sk-row { width: 100%; height: 38px; }
@keyframes sk { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }
.phone-busy-msg { margin: auto 0 0; color: #d7dcea; font-size: .82rem; text-align: center; min-height: 2.4em; transition: opacity .3s; }

.stage-caption { position: relative; display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px 10px; text-align: center; max-width: 520px; }
.stage-caption b { font: 800 1.05rem var(--f-display); }

.versions { position: relative; display: flex; gap: 8px; max-width: 100%; overflow-x: auto; padding: 4px 2px 6px; scrollbar-width: thin; }
.ver { flex: none; display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px; border-radius: 99px; background: var(--input);
  border: 1.5px solid var(--line); color: var(--text); text-decoration: none !important; font-size: .8rem; font-weight: 600; transition: border-color .15s; }
.ver:hover { border-color: color-mix(in srgb, var(--primary) 55%, var(--line)); }
.ver.is-on { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 14%, var(--input)); }
.ver-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }
.ver.is-failed .ver-dot { background: var(--bad); } .ver.is-generating .ver-dot { background: var(--warn); animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .3; } }
.ver-name { max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ver-live { color: var(--ok); display: inline-flex; }
.ver-sub { font-size: .68rem; color: var(--faint); font-weight: 500; }

/* Panneau */
.studio-panel { display: grid; gap: 14px; position: sticky; top: calc(var(--nav-h) + 16px); min-width: 0; }
.sp-card { padding: 16px; display: grid; gap: 12px; }
.sp-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.sp-head h2 { margin: 0; font: 700 1rem var(--f-display); display: flex; align-items: center; gap: 8px; }
.sp-quota { font: 700 .72rem var(--f-mono); padding: 3px 8px; border-radius: 99px; background: var(--input); color: var(--muted); }
.sp-card textarea, .sp-inline input { width: 100%; box-sizing: border-box; resize: vertical; font: 500 .92rem/1.45 var(--f-body); color: var(--text);
  background: var(--input); border: 1.5px solid var(--line); border-radius: 14px; padding: 12px 14px; outline: none; transition: border-color .15s, box-shadow .15s; }
.sp-card textarea:focus, .sp-inline input:focus { border-color: var(--primary); box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 16%, transparent); }
.moods { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
.mood { display: grid; gap: 6px; justify-items: start; padding: 7px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--input);
  color: var(--text); font: 600 .74rem var(--f-body); cursor: pointer; text-align: left; transition: transform .12s, border-color .12s; }
.mood:hover { transform: translateY(-1px); }
.mood-sw { width: 100%; height: 30px; border-radius: 8px; background: var(--sw); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .08); }
.mood.is-on { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 22%, transparent); }
.auto-blocks { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.pill { position: relative; }
.pill input { position: absolute; opacity: 0; pointer-events: none; }
.pill span { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 99px; font-size: .74rem; font-weight: 600; cursor: pointer;
  border: 1.5px dashed var(--line); color: var(--faint); text-decoration: line-through; transition: all .12s; }
.pill input:checked + span { border-style: solid; border-color: color-mix(in srgb, var(--ok) 50%, var(--line)); color: var(--text); text-decoration: none;
  background: color-mix(in srgb, var(--ok) 10%, transparent); }
.pill input:focus-visible + span { outline: 2px solid var(--primary); }
.sp-go { width: 100%; justify-content: center; }
.sp-go.is-busy { pointer-events: none; opacity: .75; }
.sp-error { margin: 0; padding: 10px 12px; border-radius: 10px; font-size: .82rem; color: var(--bad); background: color-mix(in srgb, var(--bad) 10%, transparent); }
.sp-error[hidden] { display: none; }
.refine { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1.5px solid var(--line); background: var(--input); color: var(--text); border-radius: 99px; padding: 5px 11px; font: 600 .76rem var(--f-body); cursor: pointer; transition: all .12s; }
.chip:hover { border-color: var(--primary); color: var(--primary); }
.sp-inline { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.sp-inline .btn { width: 46px; padding: 0; justify-content: center; border-radius: 14px; }
.sp-target { margin: 0; }
.sp-routers { display: flex; flex-wrap: wrap; gap: 6px; }
.sp-routers[hidden] { display: none; }
.sp-links { display: flex; justify-content: space-between; gap: 10px; padding: 0 4px; font-size: .8rem; }
.sp-links a { color: var(--muted); display: inline-flex; gap: 5px; align-items: center; }
.sp-links form { margin: 0; }
.link-btn { border: 0; background: none; padding: 0; color: var(--muted); font: inherit; cursor: pointer; display: inline-flex; gap: 5px; align-items: center; }
.link-btn:hover, .sp-links a:hover { color: var(--text); }
.sp-reset { text-align: center; font-size: .8rem; }

@media (max-width: 1100px) {
  .studio { grid-template-columns: minmax(0, 1fr); }
  .studio-panel { position: static; }
}
@media (max-width: 620px) {
  .studio-stage { padding: 18px 10px 14px; border-radius: 18px; }
  .phone { width: 290px; border-radius: 38px; padding: 10px; }
  .phone-screen { border-radius: 29px; }
  .moods { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) { .sk, .ver.is-generating .ver-dot { animation: none; } }

/* Studio : choix de la zone de l'aperçu */
.stage-zone { position: relative; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: center; font-size: .82rem; color: var(--muted); }
.stage-zone label { display: inline-flex; align-items: center; gap: 5px; font-weight: 600; }
.stage-zone select { font: 600 .85rem var(--f-body); color: var(--text); background: var(--input); border: 1.5px solid var(--line); border-radius: 99px; padding: 6px 12px; max-width: 260px; }

/* ===================== Liste des routeurs ===================== */
.fleet { display: flex; align-items: center; gap: 14px 18px; flex-wrap: wrap; padding: 16px 20px; margin-bottom: 16px; border-radius: 18px;
  background: linear-gradient(120deg, color-mix(in srgb, var(--primary) 14%, var(--panel)), var(--panel) 60%); border: 1px solid var(--line); }
.fleet-kpi { display: flex; align-items: center; gap: 14px; }
.fleet-kpi strong { display: block; font: 800 1.05rem var(--f-display); }
.fleet-kpi span { font-size: .78rem; color: var(--muted); }
.fleet-ring { --p: 0; position: relative; flex: none; width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; align-content: center; grid-auto-flow: column;
  background: conic-gradient(var(--ok) calc(var(--p) * 1%), color-mix(in srgb, var(--bad) 55%, var(--line)) 0); }
.fleet-ring::before { content: ""; position: absolute; inset: 6px; border-radius: 50%; background: var(--panel); }
.fleet-ring b, .fleet-ring small { position: relative; }
.fleet-ring b { font: 800 1.3rem var(--f-display); }
.fleet-ring small { font-size: .78rem; color: var(--muted); font-weight: 700; }
.fleet-stats { display: flex; gap: 10px; flex-wrap: wrap; }
.fleet-stat { display: grid; grid-template-columns: auto auto; column-gap: 8px; align-items: center; padding: 8px 12px; border-radius: 14px; background: var(--input); border: 1px solid var(--line); }
.fleet-stat .ti { grid-row: span 2; color: var(--primary); }
.fleet-stat b { font: 800 1.15rem/1 var(--f-display); }
.fleet-stat span { font-size: .72rem; color: var(--muted); }
.fleet-stat.is-bad .ti, .fleet-stat.is-bad b { color: var(--bad); }
.fleet-stat.is-warn .ti, .fleet-stat.is-warn b { color: var(--warn); }
.fleet-add { margin-left: auto; white-space: nowrap; }
.fleet-kpi span { white-space: nowrap; }

.rt-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.rt-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.rt-tab { display: inline-flex; align-items: center; gap: 7px; padding: 7px 13px; border-radius: 99px; border: 1.5px solid var(--line); background: var(--panel);
  color: var(--muted); font-size: .82rem; font-weight: 600; text-decoration: none !important; transition: all .14s; }
.rt-tab span { min-width: 22px; padding: 1px 6px; border-radius: 99px; background: var(--input); font: 700 .72rem var(--f-mono); text-align: center; }
.rt-tab:hover { color: var(--text); border-color: var(--muted); }
.rt-tab.is-on { color: var(--text); border-color: var(--primary); background: color-mix(in srgb, var(--primary) 12%, var(--panel)); }
.rt-tab.st-offline span { background: color-mix(in srgb, var(--bad) 18%, transparent); color: var(--bad); }
.rt-tab.st-online span { background: color-mix(in srgb, var(--ok) 18%, transparent); color: var(--ok); }
.rt-tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.rt-tools form { margin: 0; }
.rt-search { display: flex; align-items: center; gap: 8px; padding: 0 12px; height: 38px; border-radius: 99px; border: 1.5px solid var(--line); background: var(--panel); color: var(--muted); }
.rt-search:focus-within { border-color: var(--primary); }
.rt-search input { border: 0; outline: 0; background: transparent; color: var(--text); font: 500 .88rem var(--f-body); width: 190px; }
.rt-zone { height: 38px; border-radius: 99px; border: 1.5px solid var(--line); background: var(--panel); color: var(--text); font: 600 .84rem var(--f-body); padding: 0 12px; }

.rt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(330px, 100%), 1fr)); gap: 14px; }
.rt { position: relative; display: flex; flex-direction: column; gap: 12px; padding: 16px; border-radius: 18px; background: var(--panel); border: 1px solid var(--line);
  box-shadow: var(--shadow); transition: transform .15s, border-color .15s; overflow: hidden; }
.rt::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--ok); }
.rt.st-offline::before { background: var(--bad); } .rt.st-unknown::before, .rt.st-error::before { background: var(--warn); }
.rt:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--primary) 40%, var(--line)); }
.rt-head { display: flex; align-items: center; gap: 12px; }
.rt-avatar { position: relative; flex: none; width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center;
  background: color-mix(in srgb, var(--ok) 14%, var(--input)); color: var(--ok); }
.rt.st-offline .rt-avatar { background: color-mix(in srgb, var(--bad) 14%, var(--input)); color: var(--bad); }
.rt.st-unknown .rt-avatar, .rt.st-error .rt-avatar { background: color-mix(in srgb, var(--warn) 14%, var(--input)); color: var(--warn); }
.rt-pulse { position: absolute; right: -3px; top: -3px; width: 11px; height: 11px; border-radius: 50%; background: var(--ok); border: 2px solid var(--panel); }
.rt.st-online .rt-pulse { animation: rt-pulse 2s ease-out infinite; }
.rt:not(.st-online) .rt-pulse { background: var(--bad); }
.rt.st-unknown .rt-pulse, .rt.st-error .rt-pulse { background: var(--warn); }
@keyframes rt-pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 60%, transparent); } 100% { box-shadow: 0 0 0 9px transparent; } }
.rt-title { min-width: 0; flex: 1; }
.rt-title h3 { margin: 0; font: 700 1rem/1.2 var(--f-display); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rt-title h3 a { color: inherit; text-decoration: none; }
.rt-title h3 a:hover { color: var(--primary); }
.rt-title span { display: flex; align-items: center; gap: 3px; font-size: .78rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rt-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.rt-stats > div { display: grid; gap: 2px; padding: 10px 12px; border-radius: 12px; background: var(--input); }
.rt-stats b { font: 800 1.25rem/1 var(--f-display); }
.rt-stats span { font-size: .7rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
.rt-bar { display: block; height: 4px; border-radius: 99px; background: var(--line); overflow: hidden; margin-top: 4px; }
.rt-bar i { display: block; height: 100%; background: var(--ok); border-radius: inherit; }
.rt-bar i.is-warn { background: var(--warn); } .rt-bar i.is-bad { background: var(--bad); }
.rt-meta { margin: 0; font-size: .78rem; color: var(--muted); }
.rt-demo { padding: 1px 6px; border-radius: 6px; background: color-mix(in srgb, var(--info) 15%, transparent); color: var(--info); font-weight: 700; font-size: .7rem; }
.rt-alert { display: flex; gap: 8px; align-items: flex-start; padding: 8px 10px; border-radius: 10px; font-size: .78rem; line-height: 1.4; }
.rt-alert .ti { flex: none; margin-top: 1px; }
.rt-alert small { display: block; opacity: .85; margin-top: 2px; }
.rt-alert.is-bad { background: color-mix(in srgb, var(--bad) 11%, transparent); color: color-mix(in srgb, var(--bad) 80%, var(--text)); }
.rt-alert.is-warn { background: color-mix(in srgb, var(--warn) 12%, transparent); color: color-mix(in srgb, var(--warn) 85%, var(--text)); }
.rt-alert.is-ok { background: var(--input); color: var(--muted); }
.rt-actions { display: flex; gap: 6px; align-items: center; margin-top: auto; padding-top: 4px; }
.rt-actions .btn-primary { flex: 1; justify-content: center; }
.rt-actions form { margin: 0; }
.rt-none { text-align: center; color: var(--muted); padding: 30px 0; }
.rt-none[hidden], .rt[hidden] { display: none; }

@media (max-width: 620px) {
  .fleet { padding: 14px; gap: 12px; }
  .fleet-stats { width: 100%; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .fleet-stat { padding: 8px; grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .fleet-stat .ti { grid-row: auto; }
  .fleet-add { width: 100%; justify-content: center; margin-left: 0; }
  .rt-toolbar { flex-direction: column; align-items: stretch; }
  .rt-tabs { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 2px; }
  .rt-tab { flex: none; }
  .rt-tools { display: grid; grid-template-columns: minmax(0, 1fr); }
  .rt-search input { width: 100%; }
  .rt-zone { width: 100%; }
}
@media (prefers-reduced-motion: reduce) { .rt.st-online .rt-pulse { animation: none; } }

/* ===================== Profils utilisateurs (offres) ===================== */
.of-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.of-stats { display: flex; gap: 8px; flex-wrap: wrap; }
.of-stat { display: grid; grid-template-columns: auto auto; column-gap: 8px; align-items: center; padding: 8px 12px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); }
.of-stat .ti { grid-row: span 2; color: var(--primary); }
.of-stat b { font: 800 1.15rem/1 var(--f-display); }
.of-stat span { font-size: .72rem; color: var(--muted); }
.of-stat.is-warn .ti, .of-stat.is-warn b { color: var(--warn); }
.of-tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.of-view { display: flex; padding: 3px; gap: 2px; border-radius: 99px; border: 1.5px solid var(--line); background: var(--panel); }
.of-view button { width: 34px; height: 30px; border: 0; border-radius: 99px; background: transparent; color: var(--muted); cursor: pointer; display: grid; place-items: center; }
.of-view button.is-on { background: var(--primary); color: var(--primary-text); }

/* Deux vues : cartes (par défaut) / tableau Mikhmon */
.of-wrap .of-table { display: none; }
.of-wrap.is-table .of-grid { display: none; }
.of-wrap.is-table .of-table { display: block; }

.of-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: 14px; }
.of { --c: var(--primary); position: relative; display: flex; flex-direction: column; gap: 12px; padding: 16px 16px 14px 20px; border-radius: 18px;
  background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow); overflow: hidden; transition: transform .15s, border-color .15s; }
.of::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--c); }
.of:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--c) 45%, var(--line)); }
.of.is-off { opacity: .6; }
.of[hidden], tr[hidden] { display: none; }
.of-head { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.of-name { min-width: 0; }
.of-name h3 { margin: 0; font: 800 1.08rem/1.2 var(--f-display); }
.of-name span { font-size: .74rem; color: var(--muted); }
.of-price { text-align: right; flex: none; display: grid; justify-items: end; line-height: 1; }
.of-price b { font: 800 1.55rem var(--f-display); color: var(--c); letter-spacing: -.02em; }
.of-price small { font-size: .68rem; font-weight: 700; color: var(--muted); margin-top: 2px; }
.of-price em { font-style: normal; font-size: .68rem; color: var(--faint); margin-top: 4px; }
.of-specs { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.of-specs li { display: grid; grid-template-columns: auto 1fr; column-gap: 7px; padding: 8px 10px; border-radius: 12px; background: var(--input); align-items: center; }
.of-specs .ti { grid-row: span 2; color: var(--c); }
.of-specs span { font-size: .66rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; }
.of-specs b { font-size: .84rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.of-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.of-tags span { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 99px; font-size: .72rem; font-weight: 600; background: color-mix(in srgb, var(--c) 12%, transparent); color: var(--text); }
.of-stock { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 12px; border: 1px dashed var(--line); font-size: .82rem; }
.of-stock b { font: 800 1rem var(--f-display); }
.of-stock span { color: var(--muted); }
.of-stock.is-low { border-color: var(--warn); background: color-mix(in srgb, var(--warn) 8%, transparent); }
.of-stock.is-low b { color: var(--warn); }
.of-actions { display: flex; gap: 6px; margin-top: auto; }
.of-actions .btn-primary { flex: 1; justify-content: center; }
.of-actions form { margin: 0; margin-left: auto; }

.of-table .mk-table td, .of-table .mk-table th { padding-left: 9px; padding-right: 9px; }
.of-table .mk-table th { white-space: normal; line-height: 1.25; vertical-align: bottom; }
.of-pill { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: .74rem; font-weight: 600; background: var(--input); color: var(--muted); white-space: nowrap; }
.of-pill.is-on { background: color-mix(in srgb, var(--ok) 15%, transparent); color: var(--ok); }
.of-low { color: var(--warn); }

@media (max-width: 620px) {
  .of-top { flex-direction: column; align-items: stretch; }
  .of-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .of-tools { display: grid; grid-template-columns: minmax(0, 1fr) auto; }
  .of-tools .btn-primary { grid-column: 1 / -1; justify-content: center; }
  .of-tools .rt-search input { width: 100%; }
}
.of-table .mk-table td:first-child { white-space: nowrap; }
.of-table .mk-table td:first-child .mk-ico, .of-table .mk-table td:first-child form { display: inline-flex; vertical-align: middle; }

/* =====================================================================================
   Accessibilité & lisibilité au soleil (audit ECC a11y-architect, WCAG 2.2 AA)
   ===================================================================================== */

/* Textes secondaires et intitulés de menu lisibles (≥ 4,5:1) */
[data-theme="dark"] { --faint: #a0aab4; --side-group: #aab4bd; --focus: #ffd54a; }
[data-theme]:not([data-theme="dark"]) { --faint: #626d7b; --focus: #0b5f8a; }
[data-theme="light"] { --side-group: #6b7683; }

/* Boutons et éléments « pleins » : fond assombri pour que le texte blanc reste lisible (≥ 4,5:1) sur tous les thèmes */
:root { --primary-solid: color-mix(in srgb, var(--primary) 72%, #000); }
.btn-primary, .seg a.is-on, .gen-chip.is-on, .of-view button.is-on, .rt-tab.is-on span, .total-box { --btn-bg: var(--primary-solid); }
.btn-primary { background: var(--primary-solid); border-color: var(--primary-solid); color: #fff; }
.btn-primary:hover { background: color-mix(in srgb, var(--primary) 62%, #000); }
.seg a.is-on, .gen-chip.is-on, .of-view button.is-on { background: var(--primary-solid); border-color: var(--primary-solid); color: #fff; }
.side-link.is-active { background: var(--primary-solid) !important; color: #fff !important; }
/* Liens et icônes : version contrastée de la couleur principale selon le fond */
/* (liens de texte simples uniquement : jamais les boutons, onglets, pastilles ou tuiles) */
[data-theme]:not([data-theme="dark"]) :where(.content, .card-b, .card-h, td, dd, p) a:not([class]), [data-theme]:not([data-theme="dark"]) .mk-ico { color: color-mix(in srgb, var(--primary) 70%, #000); }
[data-theme="dark"] :where(.content, .card-b, .card-h, td, dd, p) a:not([class]), [data-theme="dark"] .mk-ico { color: color-mix(in srgb, var(--primary) 75%, #fff); }

/* Tuiles de chiffres : fonds assez foncés pour le texte blanc (au soleil), texte foncé sur le jaune */
.kpi.c-blue { background: linear-gradient(135deg, #086886, #0b7ea6); }
.kpi.c-green { background: linear-gradient(135deg, #1d6b3d, #26804b); }
.kpi.c-cyan { background: linear-gradient(135deg, #0e6473, #12798b); }
.kpi.c-red { background: linear-gradient(135deg, #b62f2f, #cf3736); }
.kpi.c-purple { background: linear-gradient(135deg, #4a3bb8, #5b4bd1); }
.kpi.c-yellow { background: linear-gradient(135deg, #f0a500, #ffc233); color: #1f1600; }
.kpi.is-hero .kpi-label, .kpi.is-hero .kpi-sub, .kpi[class*="c-"] .kpi-label, .kpi[class*="c-"] .kpi-sub { color: rgba(255, 255, 255, .95); }
.kpi.c-yellow .kpi-label, .kpi.c-yellow .kpi-sub, .kpi.c-yellow .kpi-value { color: #1f1600 !important; }

/* Badges d'état : texte mélangé à la couleur du texte (≥ 4,5:1), jamais la couleur brute sur son propre fond */
.b-ok, .s-online, .s-active, .s-completed, .s-done, .s-present, .s-delivered, .s-paid, .pay-amount, .ver-live { color: color-mix(in srgb, var(--ok) 45%, var(--text)); }
.b-bad, .s-offline, .s-cancelled, .s-suspended, .s-failed, .btn-danger { color: color-mix(in srgb, var(--bad) 45%, var(--text)); }
.b-warn, .s-assigned, .s-past_due, .s-pending, .s-unconfirmed, .s-disabled, .s-error, .s-running, .sev-warning, .remote-wait { color: color-mix(in srgb, var(--warn) 45%, var(--text)); }
.s-expired, .s-unknown, .s-removed, .s-absent { color: var(--muted); }
.flash-error { color: color-mix(in srgb, var(--bad) 45%, var(--text)); }
.badge { font-size: .78rem; }

/* Focus clavier toujours visible (3px, couleur contrastée), y compris sur les composants personnalisés */
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible,
.field input:focus-visible, .field select:focus-visible, .field textarea:focus-visible, .auth-input input:focus-visible,
.sp-card textarea:focus-visible, .rt-search input:focus-visible { outline: 3px solid var(--focus) !important; outline-offset: 2px; }
.offer-card:has(input:focus-visible), .gen-offer:has(input:focus-visible), .gen-tile:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 3px; }
.gen-seg input:focus-visible + span, .pill input:focus-visible + span, .gen-zone input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }
.navbar :focus-visible, .sidenav .side-link.is-active:focus-visible { outline-color: #fff !important; }

/* Champs obligatoires signalés */
.field:has(:required) > label::after { content: " *"; color: color-mix(in srgb, var(--bad) 60%, var(--text)); font-weight: 700; }

/* Tailles de texte plancher (≈ 12 px) */
.bottom-nav a, .bottom-nav button { font-size: .75rem !important; }
.kpi-label, .side-group, .t th, .dropdown-title { font-size: .75rem !important; }
.field label { font-size: .85rem; }

/* Cibles tactiles ≥ 44 px sur écran tactile */
@media (pointer: coarse) {
  .btn-sm, .icon-btn, .nav-btn, .mk-ico, .of-view button, .auth-eye { min-width: 44px; min-height: 44px; }
  .seg a, .gen-chip, .pill span, .rt-tab, .chip { min-height: 44px; display: inline-flex; align-items: center; }
  .mk-ico { margin: 0 2px; display: inline-flex; align-items: center; justify-content: center; }
  .t input[type=checkbox] { width: 24px; height: 24px; }
}

/* Menu latéral mobile fermé : hors de l'ordre de tabulation */
@media (max-width: 960px) {
  .sidenav { visibility: hidden; transition: transform .22s var(--ease, ease), visibility 0s .22s; }
  body.side-open .sidenav { visibility: visible; transition-delay: 0s; }
}

/* Lien d'évitement et texte réservé aux lecteurs d'écran */
.skip { position: absolute; left: 8px; top: -80px; z-index: 200; background: #fff; color: #000 !important; padding: 10px 14px; border-radius: 8px; font-weight: 700; }
.skip:focus { top: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; padding: 0; }

/* =====================================================================================
   Thème « Plein soleil » : contraste renforcé pour l'extérieur (texte quasi noir, bordures franches)
   ===================================================================================== */
[data-theme="sun"] {
  --bg: #f4f1ea; --bg-pattern: transparent; --panel: #ffffff; --panel-2: #faf8f3; --line: #b9b3a6; --line-soft: #d9d4c9;
  --hover: #efe9dc; --input: #ffffff; --text: #111827; --muted: #374151; --faint: #4b5563;
  --primary: #0b6c90; --primary-text: #fff; --primary-solid: #0b6c90; --focus: #b45309;
  --ok: #15803d; --bad: #b91c1c; --warn: #b45309; --info: #1d4ed8;
  --side-bg: #ffffff; --side-text: #111827; --side-group: #4b5563; --side-hover: #efe9dc;
  --side-active: #0b6c90; --side-active-text: #fff;
  --nav-bg: #ffffff; --nav-text: #111827; --hero: linear-gradient(135deg, #0a5673, #0b6c90);
  --shadow: 0 1px 2px rgba(0, 0, 0, .12);
  color-scheme: light;
}
.sw-sun { background: linear-gradient(135deg, #fff7d6 50%, #111827 50%); }
[data-theme="sun"] .card, [data-theme="sun"] .kpi, [data-theme="sun"] .rt, [data-theme="sun"] .of, [data-theme="sun"] .fleet { border-width: 1.5px; border-color: var(--line); }
[data-theme="sun"] .field input, [data-theme="sun"] .field select, [data-theme="sun"] .field textarea { border: 2px solid #6b7280; }
[data-theme="sun"] body, [data-theme="sun"] .content { font-weight: 500; }
@media (prefers-contrast: more) {
  :root:not([data-theme="sun"]) { --faint: var(--muted); }
}

/* =====================================================================================
   Mobile : barre du haut allégée, barre du bas pour le pouce, formulaires (audit ECC)
   ===================================================================================== */

/* Animations d'entrée courtes (téléphones d'entrée de gamme) */
.content, .flash, .kpi { animation-duration: .12s !important; }
.kpi:nth-child(n) { animation-delay: 0s !important; }

/* Bloc compte + thème dans le menu : téléphone uniquement */
.side-account { display: none; }

@media (max-width: 620px) {
  /* Barre du haut : logo, zone, alertes. Thème / compte / horloge passent dans le menu ; le burger est en bas */
  .navbar .dropdown:has(.theme-menu), .navbar .dropdown:has(.nav-user), .navbar .nav-clock { display: none !important; }
  body.has-bn .navbar > .nav-btn[data-toggle-side] { display: none; }
  .navbar { gap: 8px; padding-left: 12px; }
  .zone-btn { max-width: 46vw; }

  /* Compte + thème : une seule ligne repliée ; ouverte, actions et thèmes compacts */
  .side-account { display: block; padding: 10px 12px; margin-bottom: 4px; border-bottom: 1px solid color-mix(in srgb, var(--side-text, var(--text)) 14%, transparent); }
  .sa-user { display: flex; align-items: center; gap: 10px; list-style: none; cursor: pointer; padding: 4px; border-radius: 12px; }
  .sa-user::-webkit-details-marker { display: none; }
  .sa-user .avatar { width: 38px; height: 38px; font-size: 1rem; flex: none; }
  .sa-who { flex: 1; min-width: 0; display: grid; line-height: 1.2; }
  .sa-who strong { font: 700 .98rem var(--f-display); color: var(--side-text, var(--text)); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .sa-who small { color: color-mix(in srgb, var(--side-text, var(--text)) 60%, transparent); font-size: .76rem; }
  .sa-toggle { display: inline-flex; align-items: center; gap: 6px; padding: 5px 8px; border-radius: 99px; color: var(--side-text, var(--text));
    background: color-mix(in srgb, var(--side-text, var(--text)) 12%, transparent); }
  .sa-toggle .swatch { width: 18px; height: 18px; }
  .sa-toggle .ti { transition: transform .2s; }
  .side-account[open] .sa-toggle .ti { transform: rotate(180deg); }
  .side-account[open] > :not(summary) { animation: sa-in .18s ease-out; }
  @keyframes sa-in { from { opacity: 0; transform: translateY(-4px); } }
  .sa-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin-top: 10px; }
  .sa-actions form { margin: 0; display: contents; }
  .sa-actions a, .sa-actions button { display: grid; justify-items: center; align-content: center; gap: 2px; min-height: 48px; padding: 4px 2px; border-radius: 10px; min-width: 0;
    background: color-mix(in srgb, var(--side-text, var(--text)) 10%, transparent); border: 0; color: var(--side-text, var(--text));
    font: 600 .72rem var(--f-body); text-decoration: none !important; cursor: pointer; white-space: nowrap; }
  .sa-actions button { color: #ff9b9b; }
  .sa-themes { display: grid; grid-template-columns: repeat(auto-fit, minmax(28px, 1fr)); gap: 2px; margin-top: 8px; }
  .sa-lbl { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .sa-themes .theme-opt { display: grid; place-items: center; height: 34px; padding: 0; border-radius: 10px; background: transparent; border: 2px solid transparent; cursor: pointer; }
  .sa-themes .theme-opt.is-on { border-color: var(--accent, var(--primary)); }
  .sa-themes .swatch { width: 22px; height: 22px; }
  .sa-tl { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

  /* Barre du bas : pastille pleine sur l'onglet actif, icônes plus grandes, bouton Vendre mis en avant */
  .bottom-nav a, .bottom-nav button { gap: 3px; }
  .bottom-nav a .ti, .bottom-nav button .ti { font-size: 24px !important; }
  .bottom-nav a.is-active:not(.bn-cta) { color: var(--text); }
  .bottom-nav a.is-active:not(.bn-cta) .ti { display: grid; place-items: center; width: 52px; height: 30px; border-radius: 99px;
    background: color-mix(in srgb, var(--primary) 22%, transparent); color: var(--primary); }
  .bottom-nav .bn-cta.is-active .ico, .bottom-nav .bn-cta.is-active > .ti { box-shadow: 0 0 0 3px var(--panel), 0 0 0 5px var(--accent); }

  /* Formulaires : une colonne, gros champs, bouton d'enregistrement toujours accessible */
  .field input:not([type=checkbox]):not([type=radio]):not([type=color]):not([type=file]), .field select, .field textarea { min-height: 48px; font-size: 16px; }
  .form-grid { grid-template-columns: minmax(0, 1fr) !important; }
  .form-actions { position: sticky; bottom: calc(var(--bn-h) + env(safe-area-inset-bottom) + 8px); z-index: 20; margin: 4px -4px 0;
    padding: 10px; border-radius: 16px; border: 1px solid var(--line); background: color-mix(in srgb, var(--panel) 94%, transparent);
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); box-shadow: 0 10px 24px -14px rgba(0, 0, 0, .5); }
  body:not(.has-bn) .form-actions { bottom: calc(env(safe-area-inset-bottom) + 8px); }
  .form-actions .btn { flex: 1; justify-content: center; min-height: 48px; }
}

/* ===================== Modèle d'impression « Mini » (repris de HB) : 6 tickets par ligne en A4 ===================== */
.tk-mini { display: grid; grid-template-columns: repeat(auto-fill, 32mm); gap: 1mm; justify-content: start; background: #fff; padding: 2mm; border-radius: 8px; color: #111; }
.mv { --b: #254685; --band: #1d4ed8; --bt: #fff; --t: #03328a;
  position: relative; width: 32mm; height: 17mm; box-sizing: border-box; padding: 1mm 1.2mm; border: 1px solid var(--b); background: #fff; overflow: hidden;
  font-family: var(--f-body), "Segoe UI", Arial, sans-serif; display: grid; grid-template-rows: auto 1fr auto; break-inside: avoid;
  -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.mv.is-up { height: 21.5mm; grid-template-rows: auto auto auto auto auto 1fr; }
.mv::before { content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: repeating-linear-gradient(45deg, color-mix(in srgb, var(--b) 5%, transparent) 0 4px, transparent 4px 8px); }
.mv > * { position: relative; }
.mv-head { display: flex; align-items: center; gap: 1mm; border-bottom: 1px solid var(--b); padding-bottom: .4mm; color: var(--b); }
.mv-head .ti { font-size: 9px; flex: none; }
.mv-zone { flex: 1; min-width: 0; text-align: center; font-size: 6.4px; font-weight: 700; color: var(--t); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: .2px; }
.mv-code { align-self: center; margin: .5mm .6mm; padding: .3mm .5mm; background: var(--band); color: var(--bt); text-align: center; white-space: nowrap;
  font: 700 10.5px/1.2 var(--f-mono), Consolas, monospace; letter-spacing: .4px; }
.mv.is-up .mv-code { font-size: 9px; margin: .2mm .6mm; }
.mv-code.is-long { font-size: 8px; letter-spacing: 0; overflow: hidden; text-overflow: clip; }
.mv-info { word-spacing: 1px; }
.mv-tag { font-size: 5.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .3px; color: var(--t); margin-left: .8mm; }
.mv-info { display: flex; justify-content: center; gap: 2.5mm; font-size: 7.5px; color: var(--t); white-space: nowrap; }
.mv-info b { font-weight: 700; }
/* Couleurs (HB : 100 F jaune, 200 F bleu, 500 F rouge ; user/pass violet, marine, rouge, doré) */
.mv-jaune { --band: #ffd400; --bt: #111; }
.mv-bleu { --band: #1d4ed8; }
.mv-rouge { --band: #dc2626; --b: #991b1b; --t: #7f1d1d; }
.mv-violet { --band: #7c3aed; --b: #5b21b6; --t: #5b21b6; }
.mv-marine { --band: #1e3a8a; --b: #1e3a8a; --t: #1e3a8a; }
.mv-or { --band: #b45309; --b: #92400e; --t: #92400e; }
.mv-dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; background: var(--band); }
.mv-colors a { display: inline-flex; align-items: center; }
@media print {
  .tk-mini { padding: 0; gap: .8mm; border-radius: 0; }
  @page { margin: 6mm; }
}

/* Etat de la configuration FREECOM sur le routeur */
.text-ok { color: var(--ok); font-weight: 600; }
.text-warn { color: var(--warn); font-weight: 600; }

/* Winbox en un clic */
.wb-status { margin: 0; font-size: .8rem; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.wb-status.is-wait { color: var(--warn); }
.wb-status.is-wait::before { content: ''; width: 12px; height: 12px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: wb-spin .8s linear infinite; }
.wb-status.is-ok { color: var(--ok); }
.wb-status.is-err { color: var(--bad); }
.wb-info { display: grid; gap: 4px; max-width: 100%; }
.wb-help { padding: 8px 10px; border-radius: 10px; background: var(--panel); border: 1px dashed var(--primary); }
@keyframes wb-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .wb-status.is-wait::before { animation: none; } }

/* ── Accessibilité, passe ECC (a11y-architect) : contrastes WCAG 2.2 AA ─────────────────────── */
/* Hiérarchie du texte : muted (6:1) > faint (4,7:1), réellement distincts */
[data-theme]:not([data-theme="dark"]):not([data-theme="sun"]) { --muted: #4b5563; --faint: #5b6573; }
[data-theme="dark"] { --faint: #9099a4; }
/* Couleurs de texte d'état (valeurs lisibles, jamais la couleur brute) */
:root { --bad-text: #b42318; --ok-text: #1e6b3a; --warn-text: #8a5300; --chart: #0b7ea6; --chart-hover: #b45309; --field-border: #77808d; }
[data-theme="dark"] { --bad-text: #ff8a80; --ok-text: #6fd08c; --warn-text: #f0b64a; --chart: #20a8d8; --chart-hover: #f0b64a; --field-border: #7d8791; }
[data-theme="sun"] { --chart: #0b5f8a; --field-border: #6b7280; }
/* Titres de groupe du menu latéral dans les thèmes colorés */
[data-theme="blue"] { --side-group: #b4c8e6; }
[data-theme="green"] { --side-group: #bfe3cc; }
[data-theme="pink"] { --side-group: #f5c2de; }
[data-theme="freecom"] { --side-group: #93a8cf; }
/* Carte « Chiffre d'affaires » : blanc lisible sur tout le dégradé */
[data-theme="light"], [data-theme="dark"] { --hero: linear-gradient(135deg, #0a5673, #0e7aa3); }
/* Badges et pastilles restants */
.b-info, .s-sold, .s-trial, .sev-info { color: color-mix(in srgb, var(--info) 45%, var(--text)); }
.s-available, .of-pill.is-on, .rt-tab.st-online span { color: color-mix(in srgb, var(--ok) 45%, var(--text)); }
.of-low { color: color-mix(in srgb, var(--warn) 45%, var(--text)); }
.sev-critical { background: #c62828; }
.pill-count { background: #c62828; font-size: .75rem; }
.flash-warning { color: color-mix(in srgb, var(--warn) 50%, var(--text)); }
.t-bad { color: var(--bad-text); } .t-ok { color: var(--ok-text); } .t-warn { color: var(--warn-text); }
/* Champs de formulaire : bordure visible (≥ 3:1) */
.field input:not([type="checkbox"]):not([type="radio"]):not([type="range"]), .field select, .field textarea, .input { border-color: var(--field-border); }
.field input:hover, .field select:hover, .field textarea:hover { border-color: color-mix(in srgb, var(--field-border) 60%, var(--text)); }
.hbar-fill { background: linear-gradient(90deg, var(--chart), color-mix(in srgb, var(--chart) 60%, var(--accent))); }
/* Erreurs rattachées aux champs */
.field .field-error { color: var(--bad-text); font-size: .85rem; display: flex; gap: 6px; align-items: center; margin: 4px 0 0; }
.field [aria-invalid="true"] { border-color: var(--bad-text) !important; border-width: 2px; }
/* Petits textes */
.t.stack-sm td::before { font-size: .75rem; }

/* ── Design, passe ECC (design-quality) ─────────────────────────────────────────────────────── */
/* Codes et références : couleur de marque assombrie (lisible), police à chasse fixe */
[data-theme]:not([data-theme="dark"]) a.code { color: color-mix(in srgb, var(--primary) 68%, #000); }
[data-theme="dark"] a.code { color: color-mix(in srgb, var(--primary) 75%, #fff); }
a.code { font-weight: 700; }

/* Motif « souche de ticket » : encoches latérales + pointillés, rappel des tickets imprimés */
.total-box, .kpi.is-hero {
  -webkit-mask: radial-gradient(circle 9px at 0 50%, #0000 97%, #000) left / 51% 100% no-repeat, radial-gradient(circle 9px at 100% 50%, #0000 97%, #000) right / 51% 100% no-repeat;
          mask: radial-gradient(circle 9px at 0 50%, #0000 97%, #000) left / 51% 100% no-repeat, radial-gradient(circle 9px at 100% 50%, #0000 97%, #000) right / 51% 100% no-repeat;
}
.total-box { padding: 20px 24px; }
.total-box .big { border-top: 2px dashed rgba(255, 255, 255, .35); padding-top: 10px; margin-top: 4px; font-variant-numeric: tabular-nums; }
.total-box .tb-meta { color: rgba(255, 255, 255, .88); font-weight: 600; }
.total-box .tb-stock { color: #fff; font-weight: 700; display: flex; align-items: center; gap: 6px; }
.total-box .tb-stock:not(:empty)::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: #b9f27c; box-shadow: 0 0 0 3px rgba(185, 242, 124, .25); }
.pos-aside { position: sticky; top: calc(var(--nav-h) + 16px); align-self: start; }

/* Tuiles de chiffres : la tuile principale domine, pas de tuile orpheline sur mobile */
@media (min-width: 961px) {
  .kpis:not(.kpis-tight):has(> .kpi.is-hero) { grid-template-columns: repeat(auto-fit, minmax(135px, 1fr)); }
  .kpis:not(.kpis-tight) > .kpi.is-hero { grid-column: span 2; }
}
@media (max-width: 620px) { .kpis > .kpi:last-child:nth-child(odd) { grid-column: 1 / -1; } }
.kpis-tight .kpi-ico { font-size: 44px !important; opacity: .13; right: 8px; bottom: 6px; }
.kpis-tight .kpi-sub { padding-right: 38px; }
.kpi .kpi-value { font-variant-numeric: tabular-nums; }

/* Grilles : les cartes ne s'étirent plus en panneaux vides (sauf le tableau de bord) */
.g-main { align-items: start; }
.g-main.dash-hotspot { align-items: stretch; }
.dash-hotspot > .card { display: flex; flex-direction: column; }
.dash-hotspot > .card > .card-b { flex: 1; display: grid; align-content: center; }

/* Tableaux : colonnes courtes sur une ligne, tirets discrets */
.t td.nw, .t th.nw { white-space: nowrap; }
@media (max-width: 620px) { .t.stack-sm td.nw { white-space: normal; } }
.t td.num, .t th.num { font-variant-numeric: tabular-nums; }

/* Menu latéral : « Vendre » mis en avant sans ressembler à un élément sélectionné */
.side-link.is-cta:not(.is-active) { border: 0; }
.side-link.is-cta .ico { color: var(--accent); }
.side-link.is-cta:not(.is-active) .side-txt { font-weight: 700; }
.side-nav { -webkit-mask-image: linear-gradient(#000 calc(100% - 22px), transparent); mask-image: linear-gradient(#000 calc(100% - 22px), transparent); }

/* Alertes : rail de gravité, pastille teintée (fini le rouge plein partout) */
.alert-row { display: flex; gap: 14px; align-items: flex-start; padding: 14px 20px 14px 16px; border-bottom: 1px solid var(--line); border-left: 4px solid var(--sev, var(--line)); }
.alert-row.sev-critical-rail { --sev: var(--bad); }
.alert-row.sev-warning-rail { --sev: var(--warn); }
.alert-row.sev-info-rail { --sev: var(--info); }
.alert-row.is-resolved { opacity: .55; --sev: var(--line); }
.alert-row .alert-sev { min-width: 82px; justify-content: center; }
.alert-main { flex: 1; min-width: 0; display: grid; gap: 2px; }
.alert-title { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.alert-title .badge { white-space: nowrap; }
.badge.sev-critical { background: color-mix(in srgb, var(--bad) 14%, transparent); color: var(--bad-text); border: 1px solid color-mix(in srgb, var(--bad) 35%, transparent); }
@media (max-width: 620px) { .alert-row { flex-wrap: wrap; } .alert-row form { margin-left: auto; } }

/* Contrôles natifs habillés */
input[type="file"] { font: inherit; font-size: .86rem; color: var(--muted); max-width: 100%; }
input[type="file"]::file-selector-button { font: 600 .85rem var(--f-body, inherit); margin-right: 10px; padding: 8px 14px; border-radius: var(--radius-sm); border: 1px solid var(--field-border); background: var(--panel-2); color: var(--text); cursor: pointer; }
input[type="file"]::file-selector-button:hover { border-color: var(--primary); }
.field input[type="color"] { width: 64px; height: 42px; padding: 4px; border-radius: var(--radius-sm); cursor: pointer; }
.filters .field:has(input[type="search"]), .filters .field:has(input[name="q"]) { flex: 2 1 220px; max-width: 320px; }

/* États vides et pages d'erreur */
.empty-state { max-width: 560px; margin: 6vh auto 0; text-align: center; display: grid; justify-items: center; gap: 8px; padding: 36px 28px; }
.empty-state .es-ico { width: 72px; height: 72px; border-radius: 22px; display: grid; place-items: center; color: var(--primary); background: color-mix(in srgb, var(--primary) 12%, transparent); transform: rotate(-6deg); }
.empty-state .es-code { margin: 6px 0 0; font: 700 .8rem var(--f-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--bad-text); }
.empty-state h2 { margin: 0; font-family: var(--f-display); font-size: 1.6rem; }
.empty-state p { margin: 0; max-width: 42ch; }
.es-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 10px; }
.empty > .ti, .empty > i { display: inline-grid; place-items: center; width: 60px; height: 60px; border-radius: 18px; background: color-mix(in srgb, var(--primary) 10%, transparent); color: var(--primary); margin-bottom: 4px; }
@media (prefers-reduced-motion: reduce) { .empty-state .es-ico { transform: none; } }
@media (max-width: 620px) {
  /* Filtres : deux champs par ligne, jamais de débordement */
  .filters .field { flex: 1 1 calc(50% - 5px); min-width: 0; max-width: none; }
  .filters .field input, .filters .field select { width: 100%; min-width: 0; }
  /* Tables en cartes : pastille de couleur collée à son texte */
  .t.stack-sm td .kpi-dot { margin-left: auto; margin-right: -6px; align-self: center; }
}

/* Impression : aucun élément de l'application (menu du bas, barres, bulles, boutons) sur le papier */
@media print {
  .bottom-nav, .navbar, .sidenav, .side-account, .scrim, .flashes, .banner, .no-print, .toast, .pwa-install,
  .page-head, .skip-link, [data-wb-status], .form-actions { display: none !important; }
  body, body.has-bn { padding: 0 !important; margin: 0 !important; background: #fff !important; }
  .main, .content { margin: 0 !important; padding: 0 !important; max-width: none !important; }
  .card { box-shadow: none !important; border: 0 !important; background: #fff !important; }
}

/* ══ Simplicité : icônes, gros boutons, moins de texte (utilisateurs peu habitués à lire) ══════════ */
/* Tuiles d'actions (icône au-dessus, un seul mot) */
.acts { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 10px; }
.acts > form { display: contents; }
.act { display: grid; justify-items: center; align-content: center; gap: 6px; min-height: 84px; padding: 12px 8px; border-radius: 16px;
  background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow); color: var(--text); font: 700 .85rem var(--f-body, inherit);
  text-decoration: none !important; cursor: pointer; text-align: center; transition: transform .12s, border-color .15s, background .15s; }
.act .ti { color: var(--primary-solid, var(--primary)); }
.act:hover { border-color: var(--primary); transform: translateY(-2px); }
.act:active { transform: scale(.97); }
.act-primary { background: var(--primary-solid, var(--primary)); border-color: transparent; color: #fff; }
.act-primary .ti { color: #fff; }

/* Bouton « Filtrer » (mobile) : les filtres sont repliés tant qu'on ne les demande pas */
.filters-toggle { display: none; }
@media (max-width: 620px) {
  .filters-toggle { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 48px; border-radius: 12px;
    border: 1px dashed var(--field-border); background: var(--panel); color: var(--text); font: 700 .95rem var(--f-body, inherit); cursor: pointer; }
  .filters-toggle .n { background: var(--primary-solid, var(--primary)); color: #fff; border-radius: 99px; padding: 0 8px; font-size: .8rem; }
  form.filters.is-folded > :not(.filters-toggle) { display: none !important; }
  form.filters.is-folded { padding: 10px 12px; }

  /* Moins de texte : descriptions de cartes et aides masquées sur téléphone */
  .card-h > div > p:not(.keep), .card-h > p:not(.keep), .hint:not(.keep), .page-intro { display: none !important; }

  /* Gros boutons */
  .btn { min-height: 48px; font-size: .95rem; }
  .btn-sm { min-height: 44px; }
  .card-h .btn, .form-actions .btn, .card-b > .btn { justify-content: center; }

  /* Listes en cartes : titre en gros, lignes vides masquées, infos secondaires sous la valeur */
  .t.stack-sm td.is-empty { display: none !important; }
  .t.stack-sm td.td-head { justify-content: flex-start; font-size: 1.05rem; font-weight: 800; padding-top: 10px; }
  .t.stack-sm td.td-head::before { content: none; }
  .t.stack-sm td { flex-wrap: wrap; align-items: baseline; }
  .t.stack-sm td > div, .t.stack-sm td > .faint { flex-basis: 100%; text-align: right; }
  .t.stack-sm td.td-head > div { text-align: left; }

  /* Alertes : message limité à 3 lignes */
  .alert-main .small.muted { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
}
/* Portées d'un ticket (page Fédérations) */
.scopes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.scope { display: grid; justify-items: center; gap: 4px; text-align: center; padding: 14px 8px; border-radius: 16px; background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow); }
.scope .ti { color: var(--primary-solid, var(--primary)); }
.scope b { font-size: .9rem; } .scope span { font-size: .78rem; color: var(--muted); }
.scope.is-fed { border-color: color-mix(in srgb, var(--accent) 60%, var(--line)); }
@media (max-width: 620px) {
  /* Case à cocher de sélection : dans le coin de la carte, pas sur une ligne à part */
  .t.stack-sm tr { position: relative; }
  .t.stack-sm td.td-check { position: absolute; top: 8px; right: 6px; width: auto; padding: 4px; }
  .t.stack-sm td.td-check input { width: 24px; height: 24px; }
}

/* ══ Page Routeurs : simple, icônes, gros boutons ═══════════════════════════════════════════════ */
.rs-sum { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.rs-k { display: grid; justify-items: center; gap: 2px; padding: 14px 8px 12px; border-radius: 18px; background: var(--panel); border: 2px solid var(--line);
  box-shadow: var(--shadow); color: var(--text); text-decoration: none !important; text-align: center; transition: transform .12s, border-color .15s; --k: var(--primary-solid, var(--primary)); }
.rs-k .ti { color: var(--k); }
.rs-k b { font: 800 1.9rem/1.1 var(--f-display); letter-spacing: -.02em; }
.rs-k span { font-size: .85rem; font-weight: 700; color: var(--muted); }
.rs-k.is-ok { --k: var(--ok-text); } .rs-k.is-bad { --k: var(--bad-text); } .rs-k.is-warn { --k: var(--warn-text); } .rs-k.is-info { --k: var(--info); }
a.rs-k:hover { transform: translateY(-2px); border-color: var(--k); }
.rs-k.is-on { border-color: var(--k); background: color-mix(in srgb, var(--k) 9%, var(--panel)); }

.rs-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 16px 0; }
.rs-bar .rt-search { flex: 1 1 220px; }
.rs-bar .rt-search input, .rs-bar .rt-zone { min-height: 48px; font-size: 1rem; }
.rs-add { min-height: 48px; margin-left: auto; font-size: 1rem; }

.rc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: 14px; }
.rc { display: grid; gap: 12px; align-content: start; padding: 16px; border-radius: 20px; background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow);
  border-top: 5px solid var(--st); --st: var(--line); }
.rc.st-online { --st: var(--ok); } .rc.st-offline { --st: var(--bad); } .rc.st-unknown { --st: var(--warn); }
.rc[hidden] { display: none; }
.rc-head { display: flex; gap: 12px; align-items: center; color: var(--text); text-decoration: none !important; min-width: 0; }
.rc-ico { flex: none; width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; color: #fff; background: var(--st); }
.rc.st-online .rc-ico { background: color-mix(in srgb, var(--ok) 85%, #000); }
.rc-id { display: grid; min-width: 0; }
.rc-id b { font: 800 1.15rem/1.2 var(--f-display); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rc-id small { color: var(--muted); font-size: .85rem; display: flex; align-items: center; gap: 4px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.rc-big { display: flex; align-items: baseline; gap: 8px; }
.rc-big .ti { color: var(--ok-text); align-self: center; }
.rc-big b { font: 800 2.1rem/1 var(--f-display); letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.rc-big span { color: var(--muted); font-weight: 700; }
.rc-meters { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.rc-m { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 6px; font-size: .78rem; }
.rc-m em { font-style: normal; font-weight: 700; color: var(--muted); }
.rc-m > i { height: 6px; border-radius: 99px; background: var(--line-soft); overflow: hidden; }
.rc-m > i > i { display: block; height: 100%; border-radius: 99px; background: var(--ok); }
.rc-m > i > i.is-warn { background: var(--warn); } .rc-m > i > i.is-bad { background: var(--bad); }
.rc-m strong { font-variant-numeric: tabular-nums; }
.rc-msg { display: flex; align-items: center; gap: 8px; padding: 12px; border-radius: 14px; font-weight: 800; font-size: 1rem; }
.rc-msg.is-bad { color: var(--bad-text); background: color-mix(in srgb, var(--bad) 10%, transparent); }
.rc-msg.is-warn { color: var(--warn-text); background: color-mix(in srgb, var(--warn) 12%, transparent); }
.rc-chip { justify-self: start; display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 99px; font-size: .8rem; font-weight: 700;
  color: var(--warn-text); background: color-mix(in srgb, var(--warn) 12%, transparent); }
.rc-acts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 2px; }
.rc-acts > form { display: contents; }
.rc-b { display: grid; justify-items: center; gap: 3px; min-height: 60px; padding: 8px 4px; border-radius: 14px; border: 1px solid var(--line); background: var(--panel-2);
  color: var(--text); font: 700 .82rem var(--f-body, inherit); text-decoration: none !important; cursor: pointer; align-content: center; }
.rc-b .ti { color: var(--primary-solid, var(--primary)); }
.rc-b:hover { border-color: var(--primary); }
.rc-b.is-main { background: var(--primary-solid, var(--primary)); border-color: transparent; color: #fff; }
.rc-b.is-main .ti { color: #fff; }
.rc-b.is-busy { opacity: .7; pointer-events: none; }
.rc .wb-status { margin: -4px 0 0; }
.rs-foot { margin: 16px 0 0; text-align: center; font-size: .85rem; }
@media (max-width: 620px) {
  .rs-sum { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .rs-add { flex: 1 1 100%; justify-content: center; }
  .rs-bar .rt-zone { flex: 1 1 100%; }
}

/* Moins de texte aussi sur ordinateur : les descriptions sous les titres de cartes et les introductions
   de page sont retirées (les aides des champs restent) */
.card-h > div > p:not(.keep), .card-h > p:not(.keep), .page-intro { display: none !important; }
.card-h { min-height: 56px; }
/* Mot de passe affiché à la demande (Paramètres) */
details.reveal { margin-top: 6px; font-size: .85rem; }
details.reveal summary { cursor: pointer; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
details.reveal code { font-size: 1rem; padding: 4px 8px; border-radius: 8px; background: var(--panel-2); border: 1px dashed var(--field-border); }

/* Option à grosse icône (case à cocher lisible sans lire la phrase) */
.toggle-card { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 16px; border: 2px solid var(--line); background: var(--panel); cursor: pointer; }
.toggle-card input { width: 26px; height: 26px; flex: none; accent-color: var(--primary-solid, var(--primary)); }
.toggle-card .tc-ico { flex: none; width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; color: var(--muted); background: var(--panel-2); }
.toggle-card .tc-txt { display: grid; gap: 2px; } .toggle-card .tc-txt small { color: var(--muted); }
.toggle-card:has(input:checked) { border-color: var(--ok); }
.toggle-card:has(input:checked) .tc-ico { color: #fff; background: color-mix(in srgb, var(--ok) 85%, #000); }

/* ══ Générer des utilisateurs (disposition identique à Mikhmon) ══════════════════════════════════ */
.mk-gen { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.mk-gen .card-h h2 { display: flex; align-items: center; gap: 8px; }
.mkg-loader { font-size: .8rem; color: var(--warn-text); font-weight: 600; display: inline-flex; align-items: center; gap: 4px; }
.mkg-loader .ti { animation: wb-spin .8s linear infinite; }
.mkg-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.mkb { display: inline-flex; align-items: center; gap: 6px; min-height: 42px; padding: 0 16px; border-radius: 10px; border: 0; cursor: pointer;
  font: 700 .9rem var(--f-body, inherit); color: #fff; text-decoration: none !important; box-shadow: 0 6px 14px -8px rgb(0 0 0 / .45); transition: transform .12s, filter .15s; }
.mkb:hover { transform: translateY(-1px); filter: brightness(1.06); }
.mkb:active { transform: scale(.97); }
.mkb-warn { background: #d98a00; } .mkb-pink { background: #c2185b; } .mkb-primary { background: var(--primary-solid, var(--primary)); }
.mkb-dark { background: #4b5563; } .mkb-red { background: #c62828; } .mkb-info { background: #0e7490; }
.mkb.is-busy { opacity: .7; pointer-events: none; }
.mkg-table { width: 100%; border-collapse: collapse; }
.mkg-table th, .mkg-table td { padding: 9px 10px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; text-align: left; }
.mkg-table th { width: 32%; font-weight: 700; color: var(--muted); font-size: .9rem; white-space: nowrap; }
.mkg-table input, .mkg-table select { width: 100%; min-height: 44px; padding: 8px 12px; border-radius: 10px; border: 1px solid var(--field-border); background: var(--input, var(--panel)); color: var(--text); font: inherit; font-size: 1rem; box-sizing: border-box; }
.mkg-table input[readonly] { background: var(--panel-2); color: var(--muted); border-style: dashed; }
.mkg-table input[type="number"] { max-width: 180px; }
.mkg-note { display: inline-block; margin-left: 10px; font-size: .8rem; color: var(--muted); }
.mkg-valid { display: flex; flex-wrap: wrap; gap: 8px 18px; padding: 14px 10px !important; background: color-mix(in srgb, var(--primary) 7%, transparent); border-radius: 12px; font-size: .92rem; }
.mkg-valid span { display: inline-flex; align-items: center; gap: 6px; } .mkg-valid .ti { color: var(--primary-solid, var(--primary)); }
.mkg-kv { width: 100%; border-collapse: collapse; font-size: .9rem; }
.mkg-kv td { padding: 8px 6px; border-bottom: 1px solid var(--line-soft); }
.mkg-kv td:first-child { color: var(--muted); font-weight: 600; width: 45%; }
.mkg-kv td:last-child { font-weight: 700; text-align: right; }
.mkg-last-acts { display: flex; gap: 8px; margin: 14px 0 6px; flex-wrap: wrap; }
.mkg-help { margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--line); font-size: .82rem; color: var(--muted); }
.mkg-help p { margin: 4px 0; display: flex; gap: 6px; align-items: baseline; }
@media (max-width: 960px) { .mk-gen { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 620px) {
  .mkg-table th, .mkg-table td { display: block; width: 100%; border: 0; padding: 4px 0; }
  .mkg-table tr { display: block; padding: 8px 0; border-bottom: 1px solid var(--line-soft); }
  .mkg-table input[type="number"] { max-width: none; }
  .mkg-note { margin: 4px 0 0; display: block; }
  .mkg-actions .mkb { flex: 1 1 calc(33% - 8px); justify-content: center; }
}
.mkg-table td.mkg-valid-td { padding: 12px 0 0; border: 0; }
.mkg-valid { padding: 14px 16px !important; }
.mkg-valid span { gap: 6px; white-space: nowrap; }
.mkg-help p { display: block; }
.mkg-help p .ti { vertical-align: -2px; margin-right: 4px; }

/* ══ Tickets (disposition « Users » de Mikhmon) ══════════════════════════════════════════════════ */
.mku-head h2 { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.mku-count { font: 700 .8rem var(--f-mono); padding: 2px 10px; border-radius: 99px; background: color-mix(in srgb, var(--primary) 14%, transparent); color: var(--primary-solid, var(--primary)); }
.mku-links { display: inline-flex; flex-wrap: wrap; gap: 4px 14px; font: 600 .88rem var(--f-body, inherit); margin-left: 6px; }
.mku-links a { display: inline-flex; align-items: center; gap: 4px; }
.mku-links a + a::before { content: '|'; color: var(--line); margin-right: 10px; }
.mku-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.mku-group { display: flex; flex-wrap: wrap; align-items: stretch; }
.mku-group > * { min-height: 42px; border: 1px solid var(--field-border); background: var(--input, var(--panel)); color: var(--text); font: inherit; font-size: .92rem; padding: 0 12px; margin-left: -1px; }
.mku-group > :first-child { border-radius: 10px 0 0 10px; margin-left: 0; }
.mku-group > :last-child { border-radius: 0 10px 10px 0; }
.mku-group > :only-child { border-radius: 10px; }
.mku-group input[type="search"] { width: 190px; }
.mku-comment { max-width: 320px; }
.mku-print { display: flex; flex-wrap: wrap; gap: 8px; margin-left: auto; }
.mku-hint { font-size: .82rem; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.mku-bulk { display: flex; align-items: center; gap: 12px; padding: 10px 20px; background: color-mix(in srgb, var(--warn) 12%, transparent); }
.mku-bulk[hidden] { display: none; }
.mku-scroll { max-height: 75vh; overflow: auto; border-top: 1px solid var(--line); }
.mku-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.mku-table thead th { position: sticky; top: 0; z-index: 1; background: var(--panel-2); text-align: left; padding: 10px 12px; font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); border-bottom: 1px solid var(--line); white-space: nowrap; }
.mku-table td { padding: 8px 12px; border-bottom: 1px solid var(--line-soft); white-space: nowrap; }
.mku-table .c { text-align: center; }
.mku-table tbody tr:hover { background: var(--hover, color-mix(in srgb, var(--primary) 5%, transparent)); }
.mku-table td .ti { vertical-align: -2px; }
.mku-name { font-weight: 800; }
.mku-table tr.st-expired td, .mku-table tr.st-cancelled td { opacity: .6; }
@media (max-width: 620px) {
  .mku-bar { flex-direction: column; align-items: stretch; }
  .mku-group { flex-direction: column; }
  .mku-group > * { margin: 0 0 -1px; border-radius: 0 !important; width: 100%; min-height: 48px; }
  .mku-group > :first-child { border-radius: 10px 10px 0 0 !important; }
  .mku-group > :last-child { border-radius: 0 0 10px 10px !important; }
  .mku-group > :only-child { border-radius: 10px !important; }
  .mku-group input[type="search"], .mku-comment { width: 100%; max-width: none; }
  .mku-print { margin: 0; } .mku-print .mkb { flex: 1 1 30%; justify-content: center; }
  .mku-scroll { max-height: none; overflow: visible; }
  .mku-table td { white-space: normal; }
}
@media (max-width: 620px) {
  /* Carte : le titre (code, nom…) toujours en premier, avec la place pour la case à cocher */
  .t.stack-sm tbody tr { display: flex; flex-direction: column; }
  .t.stack-sm td.td-head { order: -1; padding-right: 44px; }
  .t.stack-sm tr:has(td.td-check) td:not(.td-check):not(.td-head) { padding-right: 12px; }
}

/* ══ Profils utilisateurs (liste « User Profile » de Mikhmon) ═══════════════════════════════════ */
.mk-prof .card-h h2 { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.mkp-scroll { max-height: 75vh; overflow: auto; border: 1px solid var(--line); border-radius: 12px; }
.mkp-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.mkp-table thead th { position: sticky; top: 0; z-index: 1; background: var(--panel-2); text-align: left; vertical-align: middle; padding: 10px 12px;
  font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); border: 1px solid var(--line); line-height: 1.25; }
.mkp-table td { padding: 10px 12px; border: 1px solid var(--line-soft); white-space: nowrap; vertical-align: middle; }
.mkp-table .c { text-align: center; } .mkp-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.mkp-table tbody tr:hover { background: color-mix(in srgb, var(--primary) 5%, transparent); }
.mkp-table tr.is-off td { opacity: .6; }
.mkp-table td a { font-weight: 700; display: inline-flex; align-items: center; gap: 6px; }
.mkp-acts { display: flex; gap: 14px; justify-content: center; align-items: center; }
.mkp-ico { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; border: 0; background: transparent; cursor: pointer; color: var(--primary-solid, var(--primary)); }
.mkp-ico:hover { background: color-mix(in srgb, var(--primary) 10%, transparent); }
.mkp-ico.is-del { color: var(--bad-text); }
.mkp-ico.is-del:hover { background: color-mix(in srgb, var(--bad) 12%, transparent); }
.mkp-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; }
.mkp-dot.is-on { background: #2e9e47; box-shadow: 0 0 0 3px rgb(46 158 71 / .18); } .mkp-dot.is-off { background: #e8871a; }
@media (max-width: 620px) {
  .mkp-scroll { max-height: none; overflow: visible; border: 0; }
  .mkp-table td { white-space: normal; border: 0; }
  .mkp-table td.mkp-acts-td { order: 99; } .mkp-table td.mkp-acts-td .mkp-acts { justify-content: flex-end; }
}
.mkp-table thead th { white-space: nowrap; }
.mkp-table td, .mkp-table th { padding-left: 10px; padding-right: 10px; }

/* ══ Vouchers (boîtes par profil de Mikhmon) ═════════════════════════════════════════════════════ */
.mk-vouch { margin-bottom: 18px; }
.mk-vouch .card-h h2, .mk-prof .card-h h2 { display: flex; align-items: center; gap: 8px 12px; flex-wrap: wrap; }
.mkv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr)); gap: 14px; }
.mkv-box { display: flex; align-items: stretch; min-height: 96px; border-radius: 14px; overflow: hidden; color: #fff;
  background: var(--c); box-shadow: 0 10px 22px -14px var(--c); transition: transform .12s; }
.mkv-box:hover { transform: translateY(-2px); }
.mkv-box.is-off { filter: grayscale(.6); opacity: .75; }
.mkv-ico { flex: none; width: 84px; display: grid; place-items: center; background: rgb(0 0 0 / .14); color: #fff !important; }
.mkv-area { padding: 12px 14px; display: grid; align-content: space-between; gap: 6px; min-width: 0; }
.mkv-area h3 { margin: 0; font: 700 1rem/1.3 var(--f-display); overflow: hidden; text-overflow: ellipsis; }
.mkv-area h3 span { font: 800 1.35rem var(--f-display); }
.mkv-links { display: flex; gap: 14px; flex-wrap: wrap; }
.mkv-links a { color: #fff !important; font-weight: 700; font-size: .88rem; display: inline-flex; align-items: center; gap: 5px; opacity: .92; }
.mkv-links a:hover { opacity: 1; text-decoration: underline; }
.mkp-table td.mkp-wrap { white-space: normal; min-width: 150px; }

/* ══ Tableau de bord (disposition du Dashboard de Mikhmon) ═══════════════════════════════════════ */
.mkd-row3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px; }
.mkd-info { display: flex; align-items: stretch; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); overflow: hidden; min-height: 92px; }
.mkd-info > div { padding: 12px 14px; font-size: .9rem; line-height: 1.55; min-width: 0; }
.mkd-info b { font-weight: 800; }
.mkd-ico { flex: none; width: 76px; display: grid; place-items: center; color: #fff; background: var(--primary-solid, var(--primary)); }
.mkd-row3 .mkd-info:nth-child(2) .mkd-ico { background: #7b4fc9; }
.mkd-row3 .mkd-info:nth-child(3) .mkd-ico { background: #0e9aa7; }
.mkd-income .mkd-ico { background: #2e9e47; }
.mkd-main { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.mkd-left, .mkd-right { display: grid; gap: 16px; min-width: 0; }
.mkd-main .card-h h2 { display: flex; align-items: center; gap: 8px; }
.mkd-main .card-h h2 a { display: inline-flex; align-items: center; gap: 8px; color: inherit; }
.mkd-boxes { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.mkd-box { display: grid; gap: 8px; padding: 14px 16px; min-height: 104px; border-radius: 14px; color: #fff !important; text-decoration: none !important;
  box-shadow: 0 10px 22px -14px rgb(0 0 0 / .55); transition: transform .12s; align-content: space-between; }
.mkd-box:hover { transform: translateY(-2px); }
.mkd-box h1 { margin: 0; font: 800 2rem/1.1 var(--f-display); display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.mkd-box h1 small { font-size: .95rem; font-weight: 700; opacity: .9; }
.mkd-box h1 .ti { align-self: center; }
.mkd-box div { font-weight: 700; font-size: .88rem; display: flex; align-items: center; gap: 6px; opacity: .95; }
.mkd-box.bg-blue { background: #1f77d0; } .mkd-box.bg-green { background: #2e9e47; } .mkd-box.bg-yellow { background: #e0a800; } .mkd-box.bg-red { background: #d9443a; }
.mkd-log { max-height: 440px; overflow: auto; border: 1px solid var(--line); border-radius: 10px; }
.mkd-log table { width: 100%; border-collapse: collapse; font-size: .8rem; }
.mkd-log th { position: sticky; top: 0; background: var(--panel-2); text-align: left; padding: 7px 8px; font-size: .72rem; text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--line); }
.mkd-log td { padding: 6px 8px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
.mkd-log td .ti { vertical-align: -2px; }
.t-info { color: var(--info); } .t-muted { color: var(--muted); }
@media (max-width: 1100px) { .mkd-boxes { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 960px) { .mkd-main { grid-template-columns: minmax(0, 1fr); } .mkd-row3 { grid-template-columns: minmax(0, 1fr); } }
.mkd-box .mkd-sub { font-size: .8rem; font-weight: 600; opacity: .9; padding-top: 6px; border-top: 1px dashed rgb(255 255 255 / .45); }

/* ══ Caisse ══════════════════════════════════════════════════════════════════════════════════════ */
.cx-periods { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.cx-periods > a { padding: 10px 16px; border-radius: 99px; border: 1px solid var(--line); background: var(--panel); color: var(--text); font-weight: 700; font-size: .9rem; text-decoration: none !important; }
.cx-periods > a.is-on { background: var(--primary-solid, var(--primary)); border-color: transparent; color: #fff; }
.cx-dates { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.cx-dates input { min-height: 42px; border-radius: 10px; border: 1px solid var(--field-border); background: var(--panel); color: var(--text); padding: 0 10px; font: inherit; }
.cx-dates span { color: var(--muted); }
.cx-sum { display: grid; grid-template-columns: minmax(0, 1.6fr) repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 14px; }
.cx-bal { grid-row: span 2; display: grid; align-content: center; gap: 4px; padding: 18px 20px; border-radius: 18px; color: #fff;
  background: linear-gradient(135deg, #0a5673, #0e7aa3); box-shadow: 0 14px 30px -18px #0a5673; }
.cx-bal.is-neg { background: linear-gradient(135deg, #8f1d1d, #c62828); }
.cx-bal .cx-lab { display: flex; align-items: center; gap: 6px; font-weight: 700; opacity: .9; }
.cx-bal b { font: 800 clamp(1.8rem, 3.2vw, 2.6rem)/1.1 var(--f-display); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.cx-bal b small { font-size: .45em; opacity: .85; }
.cx-bal .cx-per { font-size: .85rem; opacity: .85; }
.cx-io, .cx-meth { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 16px; background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow); }
.cx-io div, .cx-meth div { display: grid; min-width: 0; }
.cx-io span, .cx-meth span { font-size: .8rem; font-weight: 700; color: var(--muted); }
.cx-io b, .cx-meth b { font: 800 1.35rem var(--f-display); font-variant-numeric: tabular-nums; }
.cx-arrow { flex: none; width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; color: #fff; }
.cx-io.is-in .cx-arrow { background: #2e9e47; } .cx-io.is-in b { color: var(--ok-text); }
.cx-io.is-out .cx-arrow { background: #d9443a; } .cx-io.is-out b { color: var(--bad-text); }
.cx-meth > .ti { flex: none; width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--panel-2); color: var(--primary-solid, var(--primary)); }
.cx-acts { margin-bottom: 16px; }
.act.cx-in { background: #2e9e47; color: #fff; border-color: transparent; } .act.cx-in .ti { color: #fff; }
.act.cx-out { background: #d9443a; color: #fff; border-color: transparent; } .act.cx-out .ti { color: #fff; }
.cx-card .card-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.cx-card .card-h h2 { display: flex; align-items: center; gap: 8px; }
.cx-filter summary { list-style: none; cursor: pointer; }
.cx-filter summary::-webkit-details-marker { display: none; }
.cx-filter-f { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.cx-filter-f select { min-height: 42px; border-radius: 10px; border: 1px solid var(--field-border); background: var(--panel); color: var(--text); padding: 0 10px; font: inherit; }
.cx-day + .cx-day { margin-top: 16px; }
.cx-dayh { display: flex; justify-content: space-between; align-items: baseline; padding: 6px 4px 8px; border-bottom: 2px solid var(--line); font-size: .95rem; }
.cx-dayh span { font-weight: 800; font-variant-numeric: tabular-nums; }
.cx-list { list-style: none; margin: 0; padding: 0; }
.cx-row { display: flex; align-items: center; gap: 12px; padding: 12px 4px; border-bottom: 1px solid var(--line-soft); }
.cx-cat { flex: none; width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; }
.cx-row.is-in .cx-cat { color: #1e6b3a; background: color-mix(in srgb, #2e9e47 14%, transparent); }
.cx-row.is-out .cx-cat { color: #b42318; background: color-mix(in srgb, #d9443a 14%, transparent); }
[data-theme="dark"] .cx-row.is-in .cx-cat { color: var(--ok-text); } [data-theme="dark"] .cx-row.is-out .cx-cat { color: var(--bad-text); }
.cx-main { flex: 1; display: grid; gap: 2px; min-width: 0; }
.cx-main b { font-size: .95rem; }
.cx-note { font-size: .88rem; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cx-meta { font-size: .78rem; color: var(--muted); }
.cx-meta .ti { vertical-align: -2px; }
.cx-amt { flex: none; font: 800 1.1rem var(--f-display); font-variant-numeric: tabular-nums; white-space: nowrap; }
.cx-row.is-in .cx-amt { color: var(--ok-text); } .cx-row.is-out .cx-amt { color: var(--bad-text); }
@media (max-width: 760px) {
  .cx-sum { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cx-bal { grid-column: 1 / -1; grid-row: auto; }
  .cx-dates { margin-left: 0; width: 100%; } .cx-dates input { flex: 1; }
  .cx-periods > a { flex: 1 1 auto; text-align: center; }
  .cx-note { white-space: normal; }
}
@media (min-width: 761px) { .cx-sum { grid-template-columns: minmax(0, 1.3fr) repeat(2, minmax(0, 1fr)); } }
.cx-io b, .cx-meth b { white-space: nowrap; }

/* ══ Fiche de connexion à l'application MikroTik (téléphones) ═══════════════════════════════════ */
dialog.wb-sheet { width: min(460px, calc(100vw - 20px)); border: 0; border-radius: 22px; padding: 0; background: var(--panel); color: var(--text); box-shadow: 0 30px 70px -20px rgb(0 0 0 / .6); }
dialog.wb-sheet::backdrop { background: rgb(8 12 20 / .55); }
@media (max-width: 620px) { dialog.wb-sheet { margin: auto 10px 10px; } }
.wbs-head { display: flex; align-items: center; gap: 12px; padding: 16px 16px 10px; }
.wbs-logo { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: #2e9e47; color: #fff; font-size: 26px; }
.wbs-head div { flex: 1; display: grid; } .wbs-head b { font: 800 1.1rem var(--f-display); } .wbs-head small { color: var(--muted); }
.wbs-x { width: 40px; height: 40px; border-radius: 12px; border: 0; background: var(--panel-2); color: var(--text); cursor: pointer; font-size: 20px; }
.wbs-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; list-style: none; margin: 0; padding: 0 16px 12px; counter-reset: s; }
.wbs-steps li { counter-increment: s; display: grid; justify-items: center; gap: 4px; text-align: center; font-size: .75rem; font-weight: 700; color: var(--muted); padding: 8px 4px; border-radius: 12px; background: var(--panel-2); }
.wbs-steps li::before { content: counter(s); width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--primary-solid, var(--primary)); color: #fff; font-size: .75rem; }
.wbs-steps li .ti { font-size: 20px; color: var(--primary-solid, var(--primary)); }
.wbs-rows { display: grid; gap: 8px; padding: 0 16px; }
.wbs-row { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 14px; border: 1px solid var(--line); }
.wbs-ico { flex: none; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: color-mix(in srgb, var(--primary) 12%, transparent); color: var(--primary-solid, var(--primary)); font-size: 20px; }
.wbs-val { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; column-gap: 6px; }
.wbs-val small { flex-basis: 100%; font-size: .72rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.wbs-val b { font-size: 1.02rem; overflow-wrap: anywhere; }
.wbs-eye { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 18px; padding: 2px; }
.wbs-copy { flex: none; min-height: 44px; padding: 0 14px; border-radius: 12px; border: 0; background: var(--primary-solid, var(--primary)); color: #fff; font: 700 .9rem var(--f-body, inherit); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.wbs-copy.is-ok { background: #2e9e47; }
.wbs-open { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 14px 16px 8px; min-height: 56px; border-radius: 16px; background: #2e9e47; color: #fff !important;
  font: 800 1.05rem var(--f-display); text-decoration: none !important; box-shadow: 0 12px 24px -14px #2e9e47; }
.wbs-note { margin: 0 16px 16px; text-align: center; font-size: .82rem; color: var(--muted); }
.mkg-inline { display: flex; gap: 8px; } .mkg-inline select { max-width: 110px; } .mkg-table input[type="number"][name="data_limit"] { max-width: none; }

/* ---------- Rapports ---------- */
.rp-dl { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.rp-period { display: flex; align-items: center; gap: 8px; font-size: 1.05rem; }
.rp-xls { background: #1d6f42 !important; border-color: #1d6f42 !important; color: #fff !important; min-height: 50px; padding: 0 22px; font-size: 1rem; font-weight: 800; border-radius: 14px; display: inline-flex; align-items: center; gap: 10px; }
.rp-xls:hover { background: #185c37 !important; }
.rp-d { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 99px; font-weight: 800; font-size: .82rem; background: rgba(255, 255, 255, .22); }
.kpi.c-yellow .rp-d { background: rgba(0, 0, 0, .08); }
.rp-ins { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; margin-bottom: 16px; }
.rp-in { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 16px; background: var(--panel); border: 1px solid var(--line); }
.rp-in-ico { flex: none; display: grid; place-items: center; width: 46px; height: 46px; border-radius: 14px; background: color-mix(in srgb, var(--primary) 14%, transparent); color: var(--primary); }
.rp-in.is-warn { border-color: #f0a500; background: color-mix(in srgb, #f0a500 10%, var(--panel)); }
.rp-in.is-warn .rp-in-ico { background: #f0a500; color: #1f1600; }
.rp-in-t { font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; font-weight: 700; color: var(--muted); }
.rp-in-v { font-weight: 800; font-size: 1.12rem; line-height: 1.25; margin: 2px 0; overflow-wrap: anywhere; }
.rp-in-s { font-size: .82rem; color: var(--muted); }
.rp-days tr.is-zero td { color: var(--muted); }
.rp-days tbody { max-height: none; }
.rp-bar { position: relative; min-width: 90px; height: 22px; border-radius: 7px; background: var(--line-soft, #eef2f5); overflow: hidden; }
.rp-bar i { position: absolute; inset: 0 auto 0 0; width: var(--w); background: color-mix(in srgb, var(--primary) 35%, transparent); border-radius: 7px; }
.rp-bar span { position: relative; display: block; padding: 0 8px; line-height: 22px; font-size: .8rem; font-weight: 700; text-align: right; }
@media (max-width: 640px) {
  .rp-dl { flex-direction: column; align-items: stretch; }
  .rp-xls { justify-content: center; width: 100%; }
  .rp-ins { grid-template-columns: 1fr; }
}
@media (max-width: 640px) { .rp-days .rp-x { display: none; } .rp-days td, .rp-days th { padding: 10px 12px; } }

/* ---------- Mon abonnement ---------- */
.bl-hero { --bc: #26804b; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 20px; padding: 20px 22px; border-radius: 20px; margin-bottom: 14px; color: #fff;
  background: linear-gradient(135deg, color-mix(in srgb, var(--bc) 82%, #000), var(--bc)); box-shadow: var(--shadow); }
.bl-hero.is-warn { --bc: #c98400; }
.bl-hero.is-bad { --bc: #c62828; }
.bl-ring { width: 108px; height: 108px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(#fff calc(var(--p) * 1%), rgba(255, 255, 255, .22) 0); }
.bl-ring > div { width: 86px; height: 86px; border-radius: 50%; display: grid; place-items: center; align-content: center; background: color-mix(in srgb, var(--bc) 88%, #000); }
.bl-ring b { font-family: var(--f-display); font-size: 2rem; font-weight: 800; line-height: 1; }
.bl-ring span { font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; opacity: .85; }
.bl-plan { font-family: var(--f-display); font-size: 1.6rem; font-weight: 800; line-height: 1.15; overflow-wrap: anywhere; }
.bl-st { display: inline-block; vertical-align: middle; font-size: .78rem; font-weight: 800; padding: 3px 10px; border-radius: 99px; background: rgba(255, 255, 255, .22); letter-spacing: .02em; }
.bl-end { display: flex; align-items: center; gap: 6px; margin-top: 6px; font-size: 1rem; }
.bl-hint { margin-top: 4px; opacity: .9; font-size: .92rem; }
.bl-cta { display: grid; gap: 8px; }
.bl-go { background: #fff !important; color: var(--bc) !important; border-color: #fff !important; font-weight: 800; min-height: 52px; padding: 0 22px; border-radius: 14px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.bl-help { background: rgba(255, 255, 255, .16) !important; color: #fff !important; border-color: rgba(255, 255, 255, .35) !important; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
#renew { scroll-margin-top: 80px; }
@media (max-width: 640px) {
  .bl-hero { grid-template-columns: auto minmax(0, 1fr); gap: 14px; padding: 16px; }
  .bl-ring { width: 88px; height: 88px; } .bl-ring > div { width: 70px; height: 70px; } .bl-ring b { font-size: 1.6rem; }
  .bl-plan { font-size: 1.3rem; }
  .bl-cta { grid-column: 1 / -1; grid-template-columns: 1fr auto; }
}
@media (max-width: 640px) {
  .rp-ins.bl-tips { grid-template-columns: 1fr 1fr; gap: 8px; }
  .bl-tips .rp-in { padding: 12px; gap: 0; }
  .bl-tips .rp-in-ico { display: none; }
  .bl-tips .rp-in-v { font-size: 1rem; }
}

/* Mini (HB) : exactement 100 tickets par feuille A4 (5 colonnes x 20 lignes, marges 5 mm) */
.mv-page { grid-template-columns: repeat(5, 39mm); grid-auto-rows: 13.5mm; gap: .6mm; width: max-content; max-width: 100%; margin-bottom: 4mm; }
.mv-page .mv { width: 39mm; height: 13.5mm; padding: .7mm 1mm; }
/* Chiffres agrandis (« XX XX XX XX ») sans changer la taille du ticket : 8 car. 15 px, 10 car. 14 px, 11-12 car. 11 px */
.mv-page .mv-code { margin: .2mm .8mm; padding: .2mm .4mm; font-size: 15px; line-height: 1.1; letter-spacing: .2px; }
.mv-page .mv-code.is-long { font-size: 14px; letter-spacing: 0; }
.mv-page .mv-code.is-xlong { font-size: 11px; letter-spacing: 0; overflow: hidden; text-overflow: clip; }
.mv-page .mv.is-up { height: 13.5mm; grid-template-rows: auto auto auto 1fr; }
.mv-page .mv.is-up .mv-tag { display: none; }
.mv-page .mv.is-up .mv-code { font-size: 10px; margin: .1mm .8mm; padding: 0 .4mm; line-height: 1.1; }
.mv-page .mv.is-up .mv-code.is-long, .mv-page .mv.is-up .mv-code.is-xlong { font-size: 9px; }
.mv-pno { margin: 6px 0 4px; font-size: .8rem; font-weight: 700; color: var(--muted); display: flex; align-items: center; gap: 6px; }
@media print {
  .mv-page { width: 200mm; height: 286mm; grid-template-columns: repeat(5, 1fr); grid-template-rows: repeat(20, 1fr); grid-auto-rows: auto;
    gap: .6mm; margin: 0; padding: 0; overflow: hidden; break-after: page; page-break-after: always; }
  .mv-page:last-of-type { break-after: auto; page-break-after: auto; }
  .mv-page .mv { width: auto; height: auto; }
}
@media (max-width: 640px) {
  .mv-page { grid-template-columns: repeat(auto-fill, 39mm); width: auto; }
}
.mv-page .mv.is-up .mv-code { position: relative; padding-left: 3mm; }
.mv-page .mv.is-up .mv-code::before { content: attr(data-k); position: absolute; left: .6mm; top: 50%; transform: translateY(-50%); font: 700 5.5px/1 var(--f-body), Arial, sans-serif; opacity: .8; }

/* Reprise d'un routeur existant (Mikhmon) */
.ad-hero { display: flex; align-items: center; gap: 16px; padding: 18px 20px; border-radius: 18px; margin-bottom: 14px; color: #fff; background: var(--hero); }
.ad-hero h2 { margin: 0; font-size: 1.35rem; color: #fff; }
.ad-hero p { margin: 4px 0 0; display: flex; align-items: center; gap: 6px; opacity: .92; }
.ad-ico { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 16px; background: rgba(255, 255, 255, .16); flex: none; }
.ad-go { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; align-items: center; margin: 16px 0 8px; }
.ad-go form { margin: 0; }
@media (max-width: 640px) { .ad-go { flex-direction: column-reverse; align-items: stretch; } .ad-go .btn { width: 100%; justify-content: center; } }
.mkp-zone { display: inline-flex; align-items: center; gap: 3px; margin-left: 6px; padding: 1px 7px; border-radius: 99px; font-size: .72rem; font-weight: 700; background: color-mix(in srgb, var(--primary) 14%, transparent); color: var(--primary); white-space: nowrap; }

/* Mon abonnement : un routeur = une ligne à cocher */
.bl-routers { display: grid; gap: 10px; }
.bl-r { --c: #26804b; display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; border: 2px solid var(--line); background: var(--input); cursor: pointer; }
.bl-r.is-warn { --c: #c98400; } .bl-r.is-bad { --c: #c62828; }
.bl-r:has(input:checked) { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 8%, var(--panel)); }
.bl-r input { width: 22px; height: 22px; accent-color: var(--primary); }
.bl-r-ico { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; color: #fff; background: var(--c); }
.bl-r-main { display: grid; min-width: 0; }
.bl-r-main b { overflow-wrap: anywhere; }
.bl-r-main small { color: var(--muted); }
.bl-r-tag { font-size: .75rem; font-weight: 800; padding: 3px 9px; border-radius: 99px; color: #fff; background: var(--c); white-space: nowrap; }
@media (max-width: 640px) { .bl-r { grid-template-columns: auto auto minmax(0, 1fr); } .bl-r-tag { grid-column: 3; justify-self: start; } }
.banner-bad { background: color-mix(in srgb, #c62828 14%, var(--panel)); border-color: #c62828; color: var(--text); }
.bl-banner { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; text-decoration: none !important; font-weight: 600; }
.bl-banner span { flex: 1; min-width: 200px; }
.bl-banner-go { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 10px; background: var(--primary-solid, var(--primary)); color: #fff; white-space: nowrap; }
.banner-bad .bl-banner-go { background: #c62828; }

/* Vouchers : en-tête de la WiFi zone affichée */
.vz-head { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; padding: 14px 18px; margin-bottom: 14px; border-radius: 16px; background: var(--panel); border: 1px solid var(--line); }
.vz-ico { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 14px; background: var(--primary-solid, var(--primary)); color: #fff; flex: none; }
.vz-name { display: grid; min-width: 0; }
.vz-name small { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; color: var(--muted); }
.vz-name b { font: 800 1.2rem var(--f-display); overflow-wrap: anywhere; }
.vz-stats { display: flex; gap: 8px; margin-left: auto; flex-wrap: wrap; }
.vz-stats > div { display: grid; text-align: center; min-width: 84px; padding: 6px 12px; border-radius: 12px; background: var(--input); }
.vz-stats b { font: 800 1.15rem var(--f-display); }
.vz-stats small { font-size: .74rem; color: var(--muted); }
.vz-stats .is-ok b { color: var(--ok-text, #26804b); }
.vz-stats .is-sold b { color: var(--primary); }
.vz-gen { min-height: 46px; }
.vz-shared { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 99px; background: color-mix(in srgb, var(--accent, #b45309) 14%, transparent); font-weight: 700; }
@media (max-width: 640px) { .vz-stats { margin-left: 0; width: 100%; } .vz-stats > div { flex: 1; min-width: 0; } .vz-gen { width: 100%; justify-content: center; } }

/* Bouton d'ajout bien visible (vert, comme « Vendre ») */
.btn-add { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; min-height: 46px; padding: 0 20px; border-radius: 14px;
  background: linear-gradient(135deg, #9fd34f, #6aa62a); color: #0b1730 !important; font: 800 1rem var(--f-display); text-decoration: none !important; white-space: nowrap;
  box-shadow: 0 10px 22px -12px rgba(106, 166, 42, .95), inset 0 -3px 0 rgba(0, 0, 0, .12); transition: transform .15s, filter .15s; animation: addPulse 2.4s ease-in-out 3; }
.btn-add:hover { transform: translateY(-2px); filter: brightness(1.05); }
.btn-add .ti { font-size: 20px; }
@keyframes addPulse { 0%, 100% { box-shadow: 0 10px 22px -12px rgba(106, 166, 42, .95), 0 0 0 0 rgba(140, 198, 63, .55); } 50% { box-shadow: 0 10px 22px -12px rgba(106, 166, 42, .95), 0 0 0 9px rgba(140, 198, 63, 0); } }
@media (max-width: 640px) { .card-h:has(.btn-add) { flex-wrap: wrap; gap: 10px; } .btn-add { width: 100%; justify-content: center; } }
@media (prefers-reduced-motion: reduce) { .btn-add { animation: none; } }

/* Installation de l'application (PWA) */
.side-install { display: flex; align-items: center; gap: 8px; width: 100%; margin-bottom: 8px; padding: 9px 10px; border: 0; border-radius: 10px;
  background: var(--accent); color: #0B1730; font: 700 .8rem var(--f-body); cursor: pointer; }
.side-install[hidden] { display: none; }
.pwa-bar { position: fixed; left: 10px; right: 10px; bottom: calc(var(--bn-h, 64px) + env(safe-area-inset-bottom) + 10px); z-index: 56;
  display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 12px; border-radius: 18px; background: var(--panel); color: var(--text);
  border: 1px solid var(--line); box-shadow: 0 18px 40px -16px rgb(0 0 0 / .55); animation: pwa-in .35s cubic-bezier(.2, .9, .3, 1.2); }
.pwa-bar img { border-radius: 11px; flex: none; }
.pwa-bar span { flex: 1; display: grid; line-height: 1.2; min-width: 0; }
.pwa-bar b { font: 800 .95rem var(--f-display); }
.pwa-bar small { color: var(--muted); font-size: .74rem; }
.pwa-go { flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 14px; border: 0; border-radius: 12px;
  background: var(--accent); color: #0B1730; font: 800 .9rem var(--f-body); cursor: pointer; }
.pwa-x { flex: none; width: 36px; height: 36px; border: 0; border-radius: 10px; background: var(--panel-2); color: var(--muted); font-size: 18px; cursor: pointer; }
@media (min-width: 961px) { .pwa-bar { display: none; } }
@keyframes pwa-in { from { transform: translateY(24px); opacity: 0; } }
.pwa-steps { list-style: none; margin: 0; padding: 4px 16px 18px; display: grid; gap: 10px; }
.pwa-steps li { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 14px; background: var(--panel-2); }
.pwa-steps i { width: 40px; height: 40px; flex: none; display: grid; place-items: center; border-radius: 12px; background: var(--accent); color: #0B1730; font-size: 22px; }
.auth-install { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 48px; margin: 14px 0 0;
  border: 1.5px dashed var(--accent); border-radius: 14px; background: transparent; color: inherit; font: 700 .9rem var(--f-body); cursor: pointer; }
.auth-install[hidden] { display: none; }
.sync-live { display: inline-flex; align-items: center; gap: 4px; margin-left: 8px; padding: 2px 8px; border-radius: 99px; font: 700 .72rem var(--f-body);
  background: color-mix(in srgb, var(--accent) 22%, transparent); color: var(--text); vertical-align: middle; }
.sync-live .ico, .sync-live i { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Admin : routeurs à approuver */
.ad-new { color: var(--warn-text, #b7791f); }
.ad-row-new { background: color-mix(in srgb, var(--warn) 9%, transparent); }
.ad-pay { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; align-items: end; border-top: 1px solid var(--line); }
.ad-newcard { border: 1.5px solid color-mix(in srgb, var(--warn) 55%, transparent); }

/* Admin connecté en tant que gérant (comme HB) */
.imp-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 0 0 14px; padding: 12px 16px;
  border: 1.5px solid #f59e0b; border-radius: 14px; background: linear-gradient(135deg, #fffbeb, #fef3c7); color: #92400e; font-size: .9rem; }
.imp-bar > span { display: block; line-height: 1.45; }
.imp-bar > span .ti { vertical-align: -4px; margin-right: 4px; }
.imp-back { background: #92400e; color: #fff; border: 0; }
.imp-open { display: flex; justify-content: flex-end; margin-bottom: 12px; }
@media (max-width: 620px) { .imp-bar form, .imp-bar .btn { width: 100%; } }

/* Génération : confirmation d'envoi par routeur */
.gen-sync { display: grid; gap: 10px; margin: 12px 0 4px; }
.gen-sync:empty { display: none; }
.gs-row { padding: 10px 12px; border-radius: 12px; background: var(--panel-2); }
.gs-name { font-weight: 700; font-size: .85rem; margin-bottom: 6px; }
.gs-bar { height: 8px; border-radius: 99px; background: color-mix(in srgb, var(--text) 10%, transparent); overflow: hidden; }
.gs-bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--primary), var(--accent)); transition: width .5s ease; }
.gs-line { margin-top: 6px; font-size: .82rem; }
.gs-line span { color: var(--muted); }
.gs-ok { color: var(--ok, #2f9e44); }
.gs-off { color: var(--warn-text, #b7791f); }
.gs-note { margin: 0; font-size: .82rem; color: var(--muted); }

/* Filigrane « point de vente » sur les tickets imprimés : les lots des revendeurs ne se mélangent pas.
   Taille adaptée à la longueur du nom (--wl), pour rester dans le ticket. */
.tk-item > .wm, .mv > .wm { position: absolute; inset: 0; z-index: 0; display: flex; align-items: center; justify-content: center; pointer-events: none;
  font: 900 min(24px, calc(300px / var(--wl, 10)))/1 var(--f-body), "Segoe UI", Arial, sans-serif; letter-spacing: .06em; white-space: nowrap;
  color: rgba(15, 23, 42, .15) !important; transform: rotate(-20deg); -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.tk-item > :not(.wm) { position: relative; z-index: 1; }
/* Mini (HB) : au-dessus de la bande colorée du code, en teinte mêlée (le code reste lisible) */
.mv > .wm { z-index: 3; font-size: min(10px, calc(150px / var(--wl, 10))); letter-spacing: .03em; color: rgba(0, 0, 0, .24) !important; mix-blend-mode: multiply; transform: rotate(-12deg); }
.tk-compact .tk-item > .wm { font-size: min(18px, calc(220px / var(--wl, 10))); }
.tk-thermal58 .tk-item > .wm { font-size: min(20px, calc(200px / var(--wl, 10))); color: rgba(0, 0, 0, .18) !important; }
.tk-thermal80 .tk-item > .wm { font-size: min(24px, calc(280px / var(--wl, 10))); color: rgba(0, 0, 0, .18) !important; }

/* Profils du routeur : prix comme Mikhmon */
.hp-noprice td { background: color-mix(in srgb, var(--warn) 8%, transparent); }
.hp-miss { color: var(--warn-text, #b7791f); font-weight: 700; font-size: .85rem; }
