/* FoxOps — La Fox Box. Mobile d'abord. */
:root {
  --fox: #E56825;
  --fox-dark: #c4531a;
  --fox-deep: #8f3a10;
  --fox-soft: #fdeee5;
  --fox-tint: #fff7f2;
  --ink: #1f1a17;
  --ink-2: #5b524c;
  --ink-3: #8a817b;
  --line: #ebe3dd;
  --bg: #f7f3f0;
  --card: #ffffff;
  --ok: #1f8a4c;
  --ok-soft: #e4f5ea;
  --warn: #b7791f;
  --warn-soft: #fdf3dc;
  --bad: #c0392b;
  --bad-soft: #fbe7e4;
  --info-soft: #e8eef8;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(31, 26, 23, .06), 0 4px 14px rgba(31, 26, 23, .05);
  --tap: 48px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.45;
  color: var(--ink);
  background: var(--bg);
}
body.role-technician { padding-bottom: calc(72px + env(safe-area-inset-bottom)); }
a { color: var(--fox-dark); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5rem; }
h1 { font-size: 1.45rem; }
h2 { font-size: 1.12rem; }
h3 { font-size: 1rem; }
p { margin: 0 0 .75rem; }
.muted { color: var(--ink-3); }
.small { font-size: .875rem; }
.nowrap { white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Barre supérieure ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: var(--fox);
  color: #fff;
  padding: 10px 16px;
  padding-top: calc(10px + env(safe-area-inset-top));
  display: flex; align-items: center; gap: 12px;
  box-shadow: 0 2px 10px rgba(143, 58, 16, .25);
}
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-weight: 700; letter-spacing: .2px; }
.brand img { width: 34px; height: 34px; }
.brand small { display: block; font-weight: 500; opacity: .85; font-size: .72rem; letter-spacing: .4px; text-transform: uppercase; }
.topbar .spacer { flex: 1; }
.topbar .who { font-size: .85rem; opacity: .95; text-align: right; display: none; }
.topbar form { margin: 0; }
.btn-ghost-light {
  background: rgba(255, 255, 255, .16); color: #fff; border: 1px solid rgba(255, 255, 255, .35);
  border-radius: 10px; padding: 8px 12px; font: inherit; font-size: .85rem; cursor: pointer; min-height: 40px;
  text-decoration: none; display: inline-flex; align-items: center;
}
.btn-ghost-light:hover { background: rgba(255, 255, 255, .26); }

/* Navigation administrateur : défilement horizontal sur mobile */
.adminnav {
  background: #fff; border-bottom: 1px solid var(--line);
  overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none;
  position: sticky; top: calc(58px + env(safe-area-inset-top)); z-index: 15;
}
.adminnav::-webkit-scrollbar { display: none; }
.adminnav ul { list-style: none; margin: 0 auto; padding: 8px 12px; display: flex; gap: 6px; max-width: 1100px; }
.adminnav a {
  display: block; padding: 9px 14px; border-radius: 999px; text-decoration: none; color: var(--ink-2);
  white-space: nowrap; font-weight: 600; font-size: .92rem;
}
.adminnav a.active { background: var(--fox-soft); color: var(--fox-deep); }
.adminnav .badge { margin-left: 4px; }

/* Navigation technicien : barre d'onglets en bas */
.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 20;
  background: #fff; border-top: 1px solid var(--line);
  display: grid; grid-template-columns: repeat(2, 1fr);
  padding-bottom: env(safe-area-inset-bottom);
}
.tabbar a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-height: 62px; text-decoration: none; color: var(--ink-3); font-size: .75rem; font-weight: 600;
}
.tabbar a svg { width: 24px; height: 24px; }
.tabbar a.active { color: var(--fox); }

/* ---------- Mise en page ---------- */
.container { max-width: 1100px; margin: 0 auto; padding: 16px; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.page-head p { margin: 0; }
.back { display: inline-flex; align-items: center; gap: 4px; text-decoration: none; color: var(--ink-2); font-weight: 600; margin-bottom: 10px; min-height: 36px; }
.grid { display: grid; gap: 12px; }
.grid-2, .grid-3, .grid-4 { display: grid; gap: 12px; grid-template-columns: 1fr; }
.stats { display: grid; gap: 10px; grid-template-columns: repeat(2, 1fr); margin-bottom: 16px; }
.section { margin-top: 22px; }
.section > h2 { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.narrow { max-width: 560px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.stack > * + * { margin-top: 12px; }

/* ---------- Cartes ---------- */
.card {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  border: 1px solid var(--line); padding: 16px;
}
.card.tight { padding: 12px 14px; }
.card h2, .card h3 { margin-bottom: 8px; }
.card-link { display: block; color: inherit; text-decoration: none; transition: transform .08s ease, box-shadow .15s ease; }
.card-link:hover { box-shadow: 0 6px 20px rgba(31, 26, 23, .1); }
.card-link:active { transform: scale(.99); }
.cabin-card { display: grid; gap: 8px; }
.cabin-card .top { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.cabin-card .name { font-weight: 700; font-size: 1.05rem; }
.cabin-card .meta { display: flex; flex-wrap: wrap; gap: 6px 14px; color: var(--ink-2); font-size: .88rem; }

.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); text-decoration: none; color: inherit; display: block; }
.stat .num { font-size: 1.7rem; font-weight: 800; color: var(--fox-deep); line-height: 1; }
.stat .lbl { color: var(--ink-2); font-size: .85rem; margin-top: 6px; }
.stat.is-alert .num { color: var(--bad); }

.kv { display: grid; grid-template-columns: auto 1fr; gap: 8px 14px; margin: 0; }
.kv dt { color: var(--ink-3); font-size: .9rem; }
.kv dd { margin: 0; font-weight: 600; }

/* ---------- Badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 999px;
  font-size: .78rem; font-weight: 700; background: var(--line); color: var(--ink-2); white-space: nowrap;
}
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.bad { background: var(--bad-soft); color: var(--bad); }
.badge.fox { background: var(--fox-soft); color: var(--fox-deep); }
.badge.info { background: var(--info-soft); color: #2c4f86; }
.badge.count { background: var(--fox); color: #fff; min-width: 22px; justify-content: center; padding: 2px 7px; }

/* ---------- Jauge papier ---------- */
.paper { display: grid; gap: 6px; }
.paper .bar { height: 10px; border-radius: 999px; background: #efe8e3; overflow: hidden; }
.paper .bar > span { display: block; height: 100%; border-radius: 999px; background: var(--ok); }
.paper.medium .bar > span { background: var(--warn); }
.paper.low .bar > span { background: var(--bad); }
.paper .txt { display: flex; justify-content: space-between; font-size: .85rem; color: var(--ink-2); }
.paper.big .bar { height: 14px; }
.paper.big .txt strong { font-size: 1.35rem; color: var(--ink); }
/* largeurs par pas de 5 % (CSP stricte : pas de style inline) */
.w-0{width:0}.w-5{width:5%}.w-10{width:10%}.w-15{width:15%}.w-20{width:20%}.w-25{width:25%}.w-30{width:30%}.w-35{width:35%}.w-40{width:40%}.w-45{width:45%}.w-50{width:50%}.w-55{width:55%}.w-60{width:60%}.w-65{width:65%}.w-70{width:70%}.w-75{width:75%}.w-80{width:80%}.w-85{width:85%}.w-90{width:90%}.w-95{width:95%}.w-100{width:100%}

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: var(--tap); padding: 10px 18px; border-radius: 12px; border: 1px solid transparent;
  font: inherit; font-weight: 700; cursor: pointer; text-decoration: none; text-align: center;
  background: #fff; color: var(--ink); border-color: var(--line);
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { border-color: #d9cec6; }
.btn:disabled, .btn[aria-disabled=true] { opacity: .6; cursor: not-allowed; }
.btn-primary { background: var(--fox); color: #fff; border-color: var(--fox); }
.btn-primary:hover { background: var(--fox-dark); border-color: var(--fox-dark); }
.btn-danger { background: #fff; color: var(--bad); border-color: #f0c9c3; }
.btn-danger:hover { background: var(--bad-soft); }
.btn-success { background: #fff; color: var(--ok); border-color: #bfe3cc; }
.btn-block { display: flex; width: 100%; }
.btn-lg { min-height: 56px; font-size: 1.05rem; border-radius: 14px; }
.btn-sm { min-height: 38px; padding: 6px 12px; font-size: .88rem; border-radius: 10px; }
.cta-sticky {
  position: sticky; bottom: calc(72px + env(safe-area-inset-bottom)); z-index: 10;
  padding: 10px 0; background: linear-gradient(to top, var(--bg) 70%, rgba(247, 243, 240, 0));
}

/* ---------- Formulaires ---------- */
form { margin: 0; }
.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field label, .label { font-weight: 600; font-size: .92rem; }
.field .hint { font-size: .82rem; color: var(--ink-3); }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=tel], input[type=search], select, textarea {
  width: 100%; min-height: var(--tap); padding: 10px 12px; border-radius: 12px; border: 1px solid #d9cec6;
  background: #fff; font: inherit; font-size: 16px; color: var(--ink);
}
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus, .btn:focus-visible, a:focus-visible {
  outline: 3px solid rgba(229, 104, 37, .35); outline-offset: 1px; border-color: var(--fox);
}
fieldset { border: 0; padding: 0; margin: 0 0 14px; min-width: 0; }
legend { font-weight: 700; margin-bottom: 8px; padding: 0; }

/* Grosses cases à cocher pour les actions */
.choices { display: grid; gap: 10px; grid-template-columns: 1fr; }
.choice { position: relative; display: block; }
.choice input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.choice span {
  display: flex; align-items: center; gap: 12px; min-height: 58px; padding: 12px 14px;
  border: 2px solid var(--line); border-radius: 14px; background: #fff; font-weight: 700;
}
.choice span::before {
  content: ""; width: 24px; height: 24px; border-radius: 7px; border: 2px solid #cfc3ba; flex: none; background: #fff;
}
.choice input[type=radio] + span::before { border-radius: 50%; }
.choice input:checked + span { border-color: var(--fox); background: var(--fox-tint); color: var(--fox-deep); }
.choice input:checked + span::before {
  border-color: var(--fox); background: var(--fox) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='white' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round' d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center/18px no-repeat;
}
.choice input:focus-visible + span { outline: 3px solid rgba(229, 104, 37, .35); }
.choice small { display: block; font-weight: 500; color: var(--ink-3); font-size: .8rem; }
.choices.inline { grid-template-columns: 1fr 1fr; }

.subform { border-left: 4px solid var(--fox); background: var(--fox-tint); border-radius: 0 12px 12px 0; padding: 14px; margin: 4px 0 14px; }
.js .subform[hidden] { display: none; }

/* ---------- Alertes ---------- */
.alert { padding: 12px 14px; border-radius: 12px; margin-bottom: 12px; font-weight: 600; border: 1px solid; }
.alert.success { background: var(--ok-soft); color: #17673a; border-color: #bfe3cc; }
.alert.error { background: var(--bad-soft); color: #962d22; border-color: #f0c9c3; }
.alert.warn { background: var(--warn-soft); color: #7a5214; border-color: #f0dca8; }
.alert.info { background: var(--info-soft); color: #2c4f86; border-color: #c9d6ee; }

/* ---------- Historique ---------- */
.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.timeline li { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.timeline .head { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; align-items: baseline; }
.timeline .when { font-weight: 700; }
.timeline .tags { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0 4px; }
.timeline .roll { font-size: .88rem; color: var(--ink-2); background: var(--bg); border-radius: 10px; padding: 8px 10px; margin-top: 6px; }
.timeline .comment { margin-top: 6px; font-style: italic; color: var(--ink-2); white-space: pre-line; }

/* ---------- Listes / tableaux ---------- */
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.list li:last-child { border-bottom: 0; }
.qty { font-weight: 800; font-size: 1.15rem; min-width: 2.5ch; text-align: right; }
.qty.zero { color: var(--ink-3); }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--ink-3); font-weight: 600; font-size: .8rem; text-transform: uppercase; letter-spacing: .3px; }
tr:last-child td { border-bottom: 0; }

.tabs { display: flex; gap: 6px; overflow-x: auto; margin-bottom: 12px; scrollbar-width: none; }
.tabs a { padding: 8px 14px; border-radius: 999px; background: #fff; border: 1px solid var(--line); text-decoration: none; color: var(--ink-2); font-weight: 600; white-space: nowrap; min-height: 40px; display: inline-flex; align-items: center; gap: 6px; }
.tabs a.active { background: var(--fox); color: #fff; border-color: var(--fox); }

.filters { display: grid; gap: 10px; grid-template-columns: 1fr; margin-bottom: 14px; }
.empty { text-align: center; padding: 28px 16px; color: var(--ink-3); }
.empty strong { display: block; color: var(--ink-2); margin-bottom: 4px; }
.pager { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 14px; }
details.card > summary { cursor: pointer; font-weight: 700; list-style: none; display: flex; justify-content: space-between; align-items: center; min-height: 32px; }
details.card > summary::-webkit-details-marker { display: none; }
details.card > summary::after { content: "+"; font-size: 1.3rem; color: var(--fox); }
details.card[open] > summary::after { content: "–"; }
details.card[open] > summary { margin-bottom: 12px; }
.check-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.check-row input[type=checkbox] { width: 24px; height: 24px; accent-color: var(--fox); flex: none; }
.check-row label { flex: 1; cursor: pointer; }

/* ---------- Connexion ---------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: linear-gradient(160deg, var(--fox) 0%, var(--fox-dark) 45%, var(--bg) 45.1%); }
.login-card { width: 100%; max-width: 400px; }
.login-brand { text-align: center; color: #fff; margin-bottom: 18px; }
.login-brand img { width: 72px; height: 72px; }
.login-brand h1 { font-size: 1.6rem; margin: 8px 0 2px; }
.login-brand p { margin: 0; opacity: .9; }

/* ---------- Écrans plus larges ---------- */
@media (min-width: 640px) {
  .topbar .who { display: block; }
  .grid-2 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .stats { grid-template-columns: repeat(4, 1fr); }
  .choices { grid-template-columns: repeat(3, 1fr); }
  .filters { grid-template-columns: 2fr 1fr auto; align-items: end; }
  h1 { font-size: 1.7rem; }
}
@media (min-width: 960px) {
  .container { padding: 24px; }
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .grid-4 { grid-template-columns: repeat(4, 1fr); }
  .layout-side { display: grid; grid-template-columns: 360px 1fr; gap: 20px; align-items: start; }
  .layout-side > aside { position: sticky; top: 130px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.pre-line { white-space: pre-line; }
.row.between { justify-content: space-between; }
.cabin-card.is-maintenance { border-color: #f0c9c3; box-shadow: inset 4px 0 0 var(--bad), var(--shadow); }
.refresh { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.choices.rolls { grid-template-columns: repeat(2, 1fr); }
.choices.rolls .choice span { min-height: 54px; padding: 10px 12px; gap: 10px; flex-wrap: wrap; }
.choices.rolls .choice small { margin-left: auto; font-size: .82rem; }
.list.events li { display: block; }
details > summary.label { cursor: pointer; padding: 8px 0; }
.roll-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
.roll-tile { display: block; text-decoration: none; color: inherit; }
.roll-tile .code { font-weight: 800; }
@media (min-width: 640px) { .choices.rolls { grid-template-columns: repeat(3, 1fr); } }

/* ---------- Cartes bobines ---------- */
.roll-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); }
.roll-card { position: relative; display: block; }
.roll-card input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.roll-inner {
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 8px 10px;
  background: #fff; border: 2px solid var(--line); border-radius: 14px; text-align: center; height: 100%;
}
.roll-card.selectable { cursor: pointer; -webkit-tap-highlight-color: transparent; }
.roll-card.selectable:hover .roll-inner { border-color: #e2cfc2; }
.roll-card input:checked + .roll-inner { border-color: var(--fox); background: var(--fox-tint); box-shadow: 0 0 0 3px rgba(229, 104, 37, .18); }
.roll-card input:checked + .roll-inner::after {
  content: "✓"; position: absolute; top: 6px; right: 8px; width: 22px; height: 22px; border-radius: 50%;
  background: var(--fox); color: #fff; font-size: .8rem; font-weight: 800; display: grid; place-items: center;
}
.roll-card input:focus-visible + .roll-inner { outline: 3px solid rgba(229, 104, 37, .35); }
.roll-card.disabled { opacity: .4; pointer-events: none; }
.roll-card.ghost .roll-inner { border-style: dashed; background: transparent; justify-content: center; }
.roll-emoji { font-size: 2rem; line-height: 1; }
.roll-count strong { font-size: 1.1rem; }
.roll-count small { color: var(--ink-3); margin-left: 1px; }
.roll-bar { display: block; width: 100%; height: 8px; border-radius: 999px; background: #efe8e3; overflow: hidden; }
.roll-bar > span { display: block; height: 100%; border-radius: 999px; background: var(--ok); }
.roll-bar.medium > span { background: var(--warn); }
.roll-bar.low > span { background: var(--bad); }
.roll-tag { font-size: .72rem; font-weight: 700; color: var(--ink-3); text-transform: uppercase; letter-spacing: .3px; }
.roll-group { margin-top: 18px; }
.roll-group h3 { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.roll-wrap { position: relative; }
.roll-edit {
  position: absolute; top: 5px; left: 5px; z-index: 1; width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center; text-decoration: none; background: #fff; border: 1px solid var(--line); font-size: .8rem;
}
.move-bar {
  position: sticky; bottom: 0; z-index: 12; margin-top: 16px; padding: 12px; border-radius: 14px;
  background: #fff; border: 1px solid var(--line); box-shadow: 0 -4px 18px rgba(31, 26, 23, .08);
  display: grid; gap: 8px; grid-template-columns: 1fr;
}
@media (min-width: 640px) { .move-bar { grid-template-columns: auto 1fr auto; align-items: center; } }

/* ---------- Villes ---------- */
.city-group { margin-top: 20px; }
.city-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 1.05rem; margin-bottom: 10px; }
.stats.stats-3 { grid-template-columns: repeat(3, 1fr); }

/* ---------- Cartes d'actions (intervention) ---------- */
.action-cards { display: grid; gap: 10px; grid-template-columns: repeat(3, 1fr); }
.action-card { position: relative; display: block; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.action-card input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.action-card > span {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center;
  min-height: 118px; padding: 14px 8px; border: 2px solid var(--line); border-radius: 16px; background: #fff;
  box-shadow: var(--shadow); font-size: .92rem; line-height: 1.2;
}
.action-emoji { font-size: 2.3rem; line-height: 1; }
.action-card input:checked + span { border-color: var(--fox); background: var(--fox-tint); color: var(--fox-deep); box-shadow: 0 0 0 3px rgba(229, 104, 37, .18); }
.action-card input:checked + span::after {
  content: "✓"; position: absolute; top: 8px; right: 10px; width: 24px; height: 24px; border-radius: 50%;
  background: var(--fox); color: #fff; font-size: .85rem; font-weight: 800; display: grid; place-items: center;
}
.action-card input:focus-visible + span { outline: 3px solid rgba(229, 104, 37, .35); }
#intervention-form > fieldset { margin-bottom: 12px; }
#intervention-form .subform, .reload-summary { margin-bottom: 14px; }
.reload-summary { border-left: 4px solid var(--fox); }
.error-text { color: var(--bad); font-weight: 600; font-size: .88rem; margin: 0 0 8px; }

/* ---------- Fenêtre (bottom sheet) ---------- */
.sheet .sheet-backdrop, .sheet .sheet-close, .sheet .sheet-foot { display: none; }
.sheet .sheet-panel { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 14px; margin-bottom: 14px; }
.js .sheet { display: none; }
.js .sheet.open { display: flex; position: fixed; inset: 0; z-index: 50; align-items: flex-end; justify-content: center; }
.js .sheet.open .sheet-backdrop { display: block; position: absolute; inset: 0; background: rgba(31, 26, 23, .45); animation: fade .15s ease; }
.js .sheet.open .sheet-panel {
  position: relative; width: 100%; max-width: 640px; max-height: 92vh; display: flex; flex-direction: column;
  margin: 0; padding: 0; border-radius: 20px 20px 0 0; border: 0; animation: slideup .2s ease;
}
.js .sheet.open .sheet-close { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--bg); font-size: 1.1rem; cursor: pointer; }
.js .sheet.open .sheet-foot {
  display: grid; grid-template-columns: 1fr 2fr; gap: 10px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
}
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.js .sheet.open .sheet-head { padding: 14px 16px 10px; border-bottom: 1px solid var(--line); }
.sheet-head h2 { margin: 0; }
.js .sheet.open .sheet-body { overflow-y: auto; padding: 4px 16px 16px; -webkit-overflow-scrolling: touch; }
.step { padding-top: 14px; }
.step + .step { border-top: 1px dashed var(--line); margin-top: 14px; }
.step h3 { display: flex; align-items: center; gap: 8px; }
.step-num { width: 26px; height: 26px; border-radius: 50%; background: var(--fox); color: #fff; display: inline-grid; place-items: center; font-size: .85rem; }
.big-number { display: flex; align-items: center; gap: 10px; margin-top: 6px; }
.big-number input { max-width: 150px; font-size: 1.6rem; font-weight: 800; text-align: center; min-height: 58px; }
.big-number span { color: var(--ink-3); font-weight: 600; }
body.sheet-open { overflow: hidden; }
@keyframes slideup { from { transform: translateY(40px); opacity: .6; } to { transform: none; opacity: 1; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@media (min-width: 700px) {
  .js .sheet.open { align-items: center; }
  .js .sheet.open .sheet-panel { border-radius: 20px; }
}
@media (prefers-reduced-motion: reduce) { .sheet-panel, .sheet-backdrop { animation: none !important; } }
.roll-grid.single { grid-template-columns: minmax(0, 140px); justify-content: center; }

/* Simplification : fenêtres autonomes et résumés d'actions */
.sheet.standalone:not(.open) .sheet-foot { display: grid; grid-template-columns: 1fr 2fr; gap: 10px; }
.action-summary { border-left: 4px solid var(--fox); margin-bottom: 10px; }
.page-head h1 { margin: 0; }
.city-title { color: var(--ink-2); text-transform: uppercase; letter-spacing: .5px; font-size: .85rem; }
.paper.big .txt strong { font-size: 1.6rem; }

/* Cabines 📷, mini bobines, échange cabine ⇄ stock */
.cab-icon { margin-right: 2px; }
.mini-rolls { display: flex; flex-wrap: wrap; gap: 6px; }
.mini-roll {
  display: inline-flex; flex-direction: column; align-items: center; gap: 2px; width: 46px; padding: 4px 4px 5px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--bg); font-size: .95rem; line-height: 1;
}
.mini-roll small { font-size: .68rem; font-weight: 700; color: var(--ink-2); }
.mini-roll .roll-bar { height: 4px; }
.exchange { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 8px; }
.exchange-col { background: var(--bg); border-radius: 14px; padding: 10px; min-width: 0; }
.exchange-col h3, .exchange-col h4 { margin: 0 0 8px; font-size: .95rem; text-align: center; }
.exchange-list { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); min-height: 90px; align-content: start; }
.exchange-list:not(:has(.roll-card))::after { content: "Vide"; color: var(--ink-3); font-size: .85rem; text-align: center; padding-top: 30px; grid-column: 1 / -1; }
.roll-card.moved .roll-inner { border-style: dashed; border-color: var(--fox); background: var(--fox-tint); box-shadow: none; }
.roll-card.moved .roll-inner::after { content: "⇄"; }
.add-rolls > summary { list-style: none; }
.add-rolls > summary::-webkit-details-marker { display: none; }
.add-rolls .field label { display: grid; gap: 6px; font-weight: 600; font-size: .9rem; }

/* Vue d'ensemble admin : intervenant > ville > cabine */
.mb-16 { margin-bottom: 16px; }
.tech-section { margin-top: 16px; padding: 14px; }
.tech-section .city-group { margin-top: 12px; }
.tech-section .city-group:first-of-type { margin-top: 10px; }
.tech-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; text-decoration: none; color: inherit; }
.tech-name { font-weight: 800; font-size: 1.1rem; }
.tech-link { font-size: .85rem; color: var(--fox-dark); font-weight: 600; white-space: nowrap; }
.tech-stock { display: flex; align-items: center; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.tech-section.unassigned { border-color: #f0dca8; background: #fffbf0; }
.overview-foot { margin-top: 24px; display: grid; gap: 6px; }
