/* ═══════════════════════════════════════════════════════════
   Inspect-Incendie — design de l'application (clair + sombre)
   ═══════════════════════════════════════════════════════════ */
:root {
  --brand: #C0141C; --brand-d: #9A0D14; --brand-dd: #6E080D; --flame: #F57A00;
  --bg: #F3F3F5; --card: #FFFFFF; --card-2: #F8F8FA; --elev: #FFFFFF;
  --ink: #17171A; --ink-2: #4B4B53; --ink-3: #8A8A93; --line: #E6E6EA; --line-2: #F0F0F3;
  --accent: var(--brand); --accent-bg: #FDECEC; --accent-ring: rgba(192, 20, 28, .18);
  --ok: #16A34A; --ok-bg: #E8F7EE; --ok-ink: #0E6B32;
  --no: #DC2626; --no-bg: #FDECEC; --no-ink: #9B1C1C;
  --na: #6B6B75; --na-bg: #EFEFF2; --na-ink: #3F3F46;
  --warn: #D97706; --warn-bg: #FEF3E2; --info: #2563EB; --info-bg: #E8EFFD; --violet: #7C3AED; --violet-bg: #F1EAFE;
  --shadow: 0 1px 2px rgba(16, 16, 20, .04), 0 2px 8px rgba(16, 16, 20, .04);
  --shadow-l: 0 20px 60px rgba(16, 16, 20, .22);
  --r: 18px; --r-m: 14px; --r-s: 10px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI Variable", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px); --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0E0E10; --card: #18181B; --card-2: #1F1F23; --elev: #222226;
  --ink: #F4F4F5; --ink-2: #C4C4CC; --ink-3: #8B8B95; --line: #2B2B31; --line-2: #222227;
  --accent: #F0444B; --accent-bg: rgba(240, 68, 75, .14); --accent-ring: rgba(240, 68, 75, .28);
  --ok: #22C55E; --ok-bg: rgba(34, 197, 94, .14); --ok-ink: #6EE7A0;
  --no: #F0444B; --no-bg: rgba(240, 68, 75, .14); --no-ink: #FDA4A8;
  --na: #9A9AA5; --na-bg: rgba(154, 154, 165, .14); --na-ink: #D4D4DA;
  --warn: #F59E0B; --warn-bg: rgba(245, 158, 11, .14); --info: #60A5FA; --info-bg: rgba(96, 165, 250, .14); --violet: #A78BFA; --violet-bg: rgba(167, 139, 250, .14);
  --shadow: 0 1px 2px rgba(0, 0, 0, .3); --shadow-l: 0 20px 60px rgba(0, 0, 0, .6);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { font: 15px/1.45 var(--font); color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { margin: 0; letter-spacing: -.015em; }
.ic { width: 20px; height: 20px; flex: none; }
.boot { display: grid; place-items: center; height: 100vh; color: var(--ink-3); }
.muted { color: var(--ink-3); } .small { font-size: 13px; } .nowrap { white-space: nowrap; } .hidden { display: none !important; }

/* ── Coquille ────────────────────────────── */
.shell { display: grid; grid-template-columns: 252px minmax(0, 1fr); min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; background: var(--card); border-right: 1px solid var(--line); z-index: 20; }
.side-brand { background: var(--brand); padding: 18px 16px 16px; display: block; }
.side-brand img { width: 100%; display: block; }
.side-brand small { display: block; color: rgba(255,255,255,.85); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; text-align: center; margin-top: 6px; font-weight: 600; }
.nav { display: flex; flex-direction: column; gap: 2px; padding: 14px 10px; flex: 1; overflow-y: auto; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 12px; color: var(--ink-2); font-weight: 550; font-size: 14.5px; transition: background .15s, color .15s; }
.nav a:hover { background: var(--card-2); color: var(--ink); }
.nav a.on { background: var(--accent-bg); color: var(--accent); }
.nav .sep { height: 1px; background: var(--line); margin: 10px 8px; }
.side-foot { border-top: 1px solid var(--line); padding: 12px; display: flex; align-items: center; gap: 10px; }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 13px; flex: none; }
.side-foot .who { flex: 1; min-width: 0; }
.side-foot .who b { display: block; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-foot .who small { color: var(--ink-3); font-size: 12px; display: flex; align-items: center; gap: 6px; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--warn); display: inline-block; }
.dot.on { background: var(--ok); }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 14px; padding: 26px 32px 18px; flex-wrap: wrap; }
.topbar .title { display: flex; align-items: center; gap: 14px; flex: 1; min-width: 220px; }
.topbar .title .ti { width: 44px; height: 44px; border-radius: 14px; background: var(--accent-bg); color: var(--accent); display: grid; place-items: center; flex: none; }
.topbar h1 { font-size: 26px; font-weight: 750; }
.topbar p { margin: 2px 0 0; color: var(--ink-3); font-size: 14px; }
.topbar .actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.content { padding: 0 32px 48px; }
.appbar, .tabbar { display: none; }

/* ── Boutons ─────────────────────────────── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--line); background: var(--card); padding: 10px 16px; border-radius: 12px; font-weight: 650; font-size: 14px; cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s, transform .1s; min-height: 42px; color: var(--ink); }
.btn:hover { background: var(--card-2); }
.btn:active { transform: scale(.98); }
.btn .ic { width: 18px; height: 18px; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 4px 14px rgba(192, 20, 28, .25); }
.btn.primary:hover { background: var(--brand-d); }
.btn.danger { border-color: transparent; background: var(--no-bg); color: var(--no-ink); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--card-2); }
.btn.sm { padding: 6px 12px; min-height: 34px; font-size: 13px; border-radius: 10px; }
.btn.lg { min-height: 54px; font-size: 16px; border-radius: 16px; padding: 12px 22px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.icon-btn { border: 0; background: transparent; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 10px; cursor: pointer; color: var(--ink-2); flex: none; }
.icon-btn:hover { background: var(--card-2); color: var(--ink); }
.icon-btn.red:hover { color: var(--no); background: var(--no-bg); }
.link { color: var(--accent); font-weight: 650; font-size: 13.5px; cursor: pointer; background: none; border: 0; padding: 0; }

/* ── Cartes ──────────────────────────────── */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); }
.card > header { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 18px 20px 8px; }
.card > header h3 { font-size: 16px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.card .pad { padding: 14px 20px 20px; }
.grid { display: grid; gap: 18px; }
.g-main { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; }
.stack { display: flex; flex-direction: column; gap: 18px; }

/* Bannière d'accueil (style remorque) */
.hero { position: relative; overflow: hidden; border-radius: 22px; background: var(--brand); color: #fff; padding: 26px 28px; margin-bottom: 18px; display: flex; align-items: center; gap: 24px; min-height: 168px; }
.hero::after { content: ""; position: absolute; right: 24px; top: 12px; bottom: 12px; aspect-ratio: 1; background: url(../img/loupe-fond.png) center/contain no-repeat; opacity: .9; pointer-events: none; }
.hero .txt { position: relative; z-index: 1; flex: 1; min-width: 0; }
.hero h2 { font-size: 28px; font-weight: 800; letter-spacing: -.02em; }
.hero p { margin: 6px 0 16px; color: rgba(255,255,255,.88); }
.hero .acts { display: flex; gap: 10px; flex-wrap: wrap; }
.hero .btn { border: 0; }
.hero .btn.white { background: #fff; color: var(--brand); box-shadow: 0 6px 18px rgba(0,0,0,.18); }
.hero .btn.glass { background: rgba(255,255,255,.16); color: #fff; }
.hero .btn.glass:hover { background: rgba(255,255,255,.24); }
.hero img.logo { position: relative; z-index: 1; width: 300px; max-width: 34%; }

.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat { padding: 18px; display: flex; gap: 14px; align-items: center; transition: transform .15s; }
.stat:hover { transform: translateY(-1px); }
.stat .si { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; flex: none; }
.stat b { font-size: 28px; font-weight: 800; display: block; line-height: 1.05; letter-spacing: -.02em; }
.stat span { color: var(--ink-3); font-size: 13px; }
.si.red { background: var(--accent-bg); color: var(--accent); } .si.green { background: var(--ok-bg); color: var(--ok); }
.si.orange { background: var(--warn-bg); color: var(--warn); } .si.blue { background: var(--info-bg); color: var(--info); }

.types { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; padding: 6px 20px 20px; }
.type-card { border: 1px solid var(--line); border-radius: 16px; padding: 16px; background: var(--card); cursor: pointer; text-align: left; display: flex; flex-direction: column; gap: 6px; min-height: 140px; position: relative; transition: border-color .15s, box-shadow .15s, transform .15s; }
.type-card:hover { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-ring); transform: translateY(-2px); }
.type-card .ti { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; background: var(--brand); color: #fff; margin-bottom: 6px; }
.type-card .ti.dark { background: var(--ink); color: var(--card); }
.type-card b { font-size: 15px; }
.type-card span { font-size: 12.5px; color: var(--ink-3); line-height: 1.35; }
.type-card .go { position: absolute; right: 14px; top: 16px; color: var(--accent); opacity: 0; transition: opacity .15s; }
.type-card:hover .go { opacity: 1; }
.type-card.soon { opacity: .5; cursor: default; }
.type-card.soon:hover { border-color: var(--line); box-shadow: none; transform: none; }
.type-card .soon-tag { position: absolute; top: 12px; right: 12px; font-size: 10.5px; font-weight: 700; background: var(--card-2); color: var(--ink-3); padding: 3px 8px; border-radius: 20px; }

.quick a, .quick button { display: flex; align-items: center; gap: 12px; padding: 12px 20px; border: 0; border-top: 1px solid var(--line-2); width: 100%; background: none; text-align: left; cursor: pointer; }
.quick a:hover, .quick button:hover { background: var(--card-2); }
.quick .qi { width: 38px; height: 38px; border-radius: 12px; background: var(--card-2); color: var(--ink-2); display: grid; place-items: center; flex: none; }
.quick b { display: block; font-size: 14px; } .quick small { color: var(--ink-3); font-size: 12.5px; }
.quick .ic.chev { margin-left: auto; color: var(--ink-3); width: 16px; }

.due { display: flex; gap: 12px; padding: 12px 20px; border-top: 1px solid var(--line-2); align-items: center; cursor: pointer; }
.due:hover { background: var(--card-2); }
.due .d { width: 50px; flex: none; text-align: center; border-radius: 12px; background: var(--accent-bg); color: var(--accent); padding: 6px 0; line-height: 1.1; }
.due .d b { display: block; font-size: 19px; } .due .d small { font-size: 10.5px; text-transform: uppercase; font-weight: 700; }
.due .d.late { background: var(--no); color: #fff; } .due .d.ok { background: var(--card-2); color: var(--ink-2); }
.due .txt { flex: 1; min-width: 0; font-size: 13px; color: var(--ink-2); }
.due .txt b { font-size: 14px; display: block; color: var(--ink); }
.due .txt em { font-style: normal; color: var(--accent); font-weight: 650; font-size: 12.5px; }

/* ── Listes / tableaux ───────────────────── */
.tabs { display: flex; gap: 4px; padding: 10px 14px 0; overflow-x: auto; }
.tabs button { background: none; border: 0; padding: 9px 14px; font-weight: 650; color: var(--ink-3); cursor: pointer; border-radius: 10px; white-space: nowrap; display: flex; gap: 6px; align-items: center; font-size: 14px; }
.tabs button:hover { background: var(--card-2); }
.tabs button.on { color: var(--accent); background: var(--accent-bg); }
.tabs .cnt { background: var(--card-2); color: var(--ink-2); border-radius: 20px; font-size: 11.5px; padding: 1px 8px; }
.tabs button.on .cnt { background: var(--accent); color: #fff; }
.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
.t th { text-align: left; font-weight: 600; color: var(--ink-3); font-size: 12px; padding: 10px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; text-transform: uppercase; letter-spacing: .04em; }
.t td { padding: 13px 16px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.t tr:last-child td { border-bottom: 0; }
.t tr.click { cursor: pointer; } .t tr.click:hover td { background: var(--card-2); }
.t td .sub { color: var(--ink-3); font-size: 12.5px; }
.t .type-cell { display: flex; gap: 10px; align-items: center; }
.t .type-cell .ti { width: 32px; height: 32px; border-radius: 10px; background: var(--accent-bg); color: var(--accent); display: grid; place-items: center; flex: none; }
.t .type-cell .ti .ic { width: 16px; height: 16px; }
.t .row-actions { display: flex; gap: 2px; justify-content: flex-end; }
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 650; white-space: nowrap; }
.badge.gray { background: var(--na-bg); color: var(--na-ink); } .badge.green { background: var(--ok-bg); color: var(--ok-ink); }
.badge.blue { background: var(--info-bg); color: var(--info); } .badge.orange { background: var(--warn-bg); color: var(--warn); }
.badge.violet { background: var(--violet-bg); color: var(--violet); } .badge.red { background: var(--no-bg); color: var(--no-ink); }
.empty { padding: 40px 20px; text-align: center; color: var(--ink-3); }
.empty .ic { width: 36px; height: 36px; color: var(--line); margin-bottom: 6px; }
.bar { height: 6px; border-radius: 6px; background: var(--line-2); overflow: hidden; min-width: 60px; }
.bar i { display: block; height: 100%; background: var(--accent); border-radius: 6px; transition: width .3s; }
.bar.green i { background: var(--ok); }
.toolbar { display: flex; gap: 10px; padding: 14px 20px; flex-wrap: wrap; align-items: center; }
.search { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 12px; padding: 0 12px; background: var(--card-2); min-height: 42px; flex: 1; min-width: 200px; max-width: 420px; }
.search input { border: 0; outline: 0; flex: 1; padding: 8px 0; background: transparent; }
.search .ic { color: var(--ink-3); width: 18px; }

/* ── Formulaires ─────────────────────────── */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field.full, .check.full { grid-column: 1 / -1; }
.field > span { font-size: 12.5px; font-weight: 650; color: var(--ink-2); }
.req { color: var(--accent); }
input[type=text], input[type=email], input[type=tel], input[type=date], input[type=time], input[type=number], input[type=password], input:not([type]), select, textarea {
  border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; background: var(--card-2); outline: none; width: 100%; min-height: 46px; transition: border-color .15s, box-shadow .15s, background .15s; color: var(--ink); }
textarea { resize: vertical; min-height: 80px; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-ring); background: var(--card); }
input::placeholder, textarea::placeholder { color: var(--ink-3); }
.invalid { border-color: var(--no) !important; }
.check { display: flex; gap: 10px; align-items: center; font-size: 14px; }
.check input { width: 20px; height: 20px; accent-color: var(--brand); }

/* ── Modale (feuille sur mobile) ─────────── */
.modal-back { position: fixed; inset: 0; background: rgba(10,10,12,.5); display: grid; place-items: center; z-index: 100; padding: 16px; animation: fade .15s; backdrop-filter: blur(2px); }
.modal { background: var(--elev); border-radius: 22px; width: min(560px, 100%); max-height: calc(100vh - 32px); display: flex; flex-direction: column; box-shadow: var(--shadow-l); animation: pop .2s; }
.modal.wide { width: min(820px, 100%); }
.modal header { display: flex; align-items: center; justify-content: space-between; padding: 20px 22px 8px; }
.modal header h3 { font-size: 19px; }
.modal-body { padding: 8px 22px 18px; overflow-y: auto; }
.modal-body p { margin: 0 0 12px; color: var(--ink-2); }
.modal footer { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 22px calc(14px + var(--safe-b)); border-top: 1px solid var(--line-2); }
@keyframes fade { from { opacity: 0; } } @keyframes pop { from { transform: translateY(10px) scale(.98); opacity: 0; } }
@keyframes up { from { transform: translateY(100%); } }

#toasts { position: fixed; bottom: calc(24px + var(--safe-b)); left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 200; align-items: center; pointer-events: none; }
.toast { background: #17171A; color: #fff; padding: 11px 18px; border-radius: 14px; display: flex; gap: 8px; align-items: center; font-size: 14px; font-weight: 550; box-shadow: var(--shadow-l); animation: pop .2s; transition: opacity .3s, transform .3s; }
:root[data-theme="dark"] .toast { background: #F4F4F5; color: #17171A; }
.toast .ic { width: 18px; color: #4ADE80; } .toast.err .ic { color: #F87171; }
.toast.out { opacity: 0; transform: translateY(6px); }

/* ── Divers (calendrier, import, connexion) ─ */
.cal-head { display: flex; align-items: center; gap: 8px; padding: 16px 20px; }
.cal-head h3 { font-size: 18px; flex: 1; text-transform: capitalize; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: 1px solid var(--line); }
.cal .dow { padding: 9px; font-size: 12px; font-weight: 650; color: var(--ink-3); text-align: center; border-bottom: 1px solid var(--line); text-transform: uppercase; letter-spacing: .04em; }
.cal .day { min-height: 106px; border-right: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2); padding: 6px; display: flex; flex-direction: column; gap: 3px; cursor: pointer; min-width: 0; transition: background .15s; }
.cal .day:hover { background: var(--card-2); }
.cal .day:nth-child(7n) { border-right: 0; }
.cal .day.out { color: var(--ink-3); opacity: .55; }
.cal .day .num { font-size: 13px; font-weight: 650; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; }
.cal .day.today .num { background: var(--brand); color: #fff; }
.cal .ev { font-size: 11.5px; padding: 3px 7px; border-radius: 7px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 650; }
.ev.visite { background: var(--info-bg); color: var(--info); } .ev.due { background: var(--accent-bg); color: var(--accent); } .ev.fait { background: var(--ok-bg); color: var(--ok-ink); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; padding: 14px 20px; font-size: 12.5px; color: var(--ink-2); border-top: 1px solid var(--line-2); align-items: center; }
.legend b { color: var(--ink); }
.legend .ev { display: inline-block; padding: 3px 9px; border-radius: 7px; font-size: 12px; }
.drop { border: 2px dashed var(--line); border-radius: 20px; padding: 48px 20px; text-align: center; background: var(--card-2); cursor: pointer; transition: border-color .15s, background .15s; display: block; }
.drop:hover, .drop.over { border-color: var(--accent); background: var(--accent-bg); }
.drop .ic { width: 46px; height: 46px; color: var(--accent); }
.drop h3 { margin: 10px 0 4px; }
.steps { display: flex; gap: 14px; padding: 16px 20px; flex-wrap: wrap; }
.steps span { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--ink-3); font-weight: 650; }
.steps span i { width: 24px; height: 24px; border-radius: 50%; background: var(--card-2); display: grid; place-items: center; font-style: normal; font-size: 12px; }
.steps span.on { color: var(--accent); } .steps span.on i { background: var(--accent); color: #fff; }
.steps span.done { color: var(--ok); } .steps span.done i { background: var(--ok); color: #fff; }
.spinner { width: 36px; height: 36px; border: 3px solid var(--accent-bg); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; margin: 0 auto 12px; }
@keyframes spin { to { transform: rotate(360deg); } }
.kv { display: grid; grid-template-columns: 170px 1fr; gap: 8px 14px; font-size: 14px; margin: 0; }
.kv dt { color: var(--ink-3); } .kv dd { margin: 0; font-weight: 550; }
.callout { display: flex; gap: 10px; padding: 14px 16px; border-radius: 14px; background: var(--info-bg); color: var(--ink); font-size: 13.5px; align-items: flex-start; }
.callout .ic { color: var(--info); flex: none; margin-top: 1px; }
.callout.warn { background: var(--warn-bg); } .callout.warn .ic { color: var(--warn); }
.anom { display: flex; gap: 12px; padding: 11px 20px; border-top: 1px solid var(--line-2); font-size: 14px; }
.anom b { color: var(--no); min-width: 64px; }
.seg { display: inline-flex; background: var(--card-2); border: 1px solid var(--line); border-radius: 12px; padding: 3px; gap: 3px; }
.seg button { border: 0; background: transparent; padding: 0 14px; min-height: 36px; font-weight: 700; font-size: 13px; cursor: pointer; color: var(--ink-3); border-radius: 9px; }
.seg button.on { background: var(--card); color: var(--ink); box-shadow: var(--shadow); }

.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: var(--brand); position: relative; overflow: hidden; }
.login::before { content: ""; position: absolute; inset: auto -120px -160px auto; width: 620px; height: 620px; background: url(../img/loupe-fond.png) center/contain no-repeat; }
.login .card { width: min(420px, 100%); padding: 30px; position: relative; }
.login .brandbox { background: var(--brand); border-radius: 16px; padding: 16px 20px; margin-bottom: 20px; }
.login .brandbox img { width: 100%; display: block; }
.login form { display: grid; gap: 14px; }

/* ═══════════ Écran de remplissage ═══════════ */
body.fill-mode .side, body.fill-mode .tabbar, body.fill-mode .appbar, body.fill-mode .topbar { display: none !important; }
body.fill-mode .shell { grid-template-columns: minmax(0, 1fr); }
body.fill-mode .content { padding: 0; }
.fill { min-height: 100vh; display: flex; flex-direction: column; }
.fill-top { position: sticky; top: 0; z-index: 30; background: var(--brand); color: #fff; padding: calc(10px + var(--safe-t)) 18px 0; box-shadow: 0 4px 20px rgba(0,0,0,.12); }
.fill-top .row1 { display: flex; align-items: center; gap: 10px; max-width: 980px; margin: 0 auto; }
.fill-top .row1 .icon-btn { color: #fff; } .fill-top .row1 .icon-btn:hover { background: rgba(255,255,255,.14); }
.fill-top .ttl { flex: 1; min-width: 0; }
.fill-top .ttl b { display: block; font-size: 16px; font-weight: 750; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fill-top .ttl small { display: block; font-size: 12.5px; color: rgba(255,255,255,.82); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ring { width: 44px; height: 44px; position: relative; flex: none; }
.ring svg { width: 44px; height: 44px; transform: rotate(-90deg); }
.ring b { position: absolute; inset: 0; display: grid; place-items: center; font-size: 11.5px; font-weight: 800; }
.chips { display: flex; gap: 6px; overflow-x: auto; padding: 12px 0 12px; max-width: 980px; margin: 0 auto; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { border: 0; background: rgba(255,255,255,.14); color: #fff; border-radius: 999px; padding: 7px 13px; font-weight: 700; font-size: 13px; cursor: pointer; white-space: nowrap; display: flex; align-items: center; gap: 6px; flex: none; transition: background .15s; }
.chip:hover { background: rgba(255,255,255,.24); }
.chip.on { background: #fff; color: var(--brand); }
.chip .ok { width: 16px; height: 16px; border-radius: 50%; background: #22C55E; color: #fff; display: grid; place-items: center; font-size: 10px; }
.chip .n { font-weight: 600; opacity: .75; font-size: 11.5px; }

.fill-body { flex: 1; width: 100%; max-width: 980px; margin: 0 auto; padding: 22px 18px 140px; }
.sec-hero { padding: 6px 4px 18px; }
.sec-hero .code { display: inline-block; font-size: 12px; font-weight: 800; letter-spacing: .08em; color: var(--accent); background: var(--accent-bg); padding: 4px 10px; border-radius: 8px; }
.sec-hero h2 { font-size: 26px; font-weight: 800; margin-top: 10px; line-height: 1.2; letter-spacing: -.02em; }
.sec-hero p { margin: 6px 0 0; color: var(--ink-3); }
.sec-tools { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.inst-tabs { display: flex; gap: 8px; margin: 0 0 16px; overflow-x: auto; padding-bottom: 2px; }
.inst-tabs button { border: 1px solid var(--line); background: var(--card); border-radius: 12px; padding: 9px 14px; font-weight: 650; cursor: pointer; white-space: nowrap; color: var(--ink-2); }
.inst-tabs button.on { border-color: var(--accent); color: var(--accent); background: var(--accent-bg); }
.inst-tabs button.add { border-style: dashed; color: var(--accent); }

.qcards { display: flex; flex-direction: column; gap: 14px; }
.qcard { background: var(--card); border: 1.5px solid var(--line); border-radius: 20px; padding: 18px 20px; box-shadow: var(--shadow); transition: border-color .2s, box-shadow .2s, transform .2s, opacity .2s; scroll-margin-top: 150px; }
.qcard.active { border-color: var(--accent); box-shadow: 0 0 0 5px var(--accent-ring), var(--shadow); }
.qcard.done { opacity: .78; } .qcard.done:hover, .qcard.done:focus-within { opacity: 1; }
.qcard .qh { display: flex; gap: 14px; align-items: flex-start; }
.qcard .key { min-width: 38px; height: 38px; padding: 0 8px; border-radius: 12px; background: var(--card-2); color: var(--ink-2); display: grid; place-items: center; font-weight: 800; font-size: 14px; flex: none; }
.qcard.active .key { background: var(--accent); color: #fff; }
.qcard.st-oui .key { background: var(--ok-bg); color: var(--ok); } .qcard.st-non .key { background: var(--no-bg); color: var(--no); } .qcard.st-so .key { background: var(--na-bg); color: var(--na); }
.qcard .qt { font-size: 17px; font-weight: 600; line-height: 1.4; padding-top: 7px; flex: 1; }
.answers { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 16px; }
.ans { border: 1.5px solid var(--line); background: var(--card); border-radius: 14px; min-height: 54px; display: flex; align-items: center; justify-content: center; gap: 8px; font-weight: 750; font-size: 15px; cursor: pointer; color: var(--ink-2); transition: all .15s; padding: 6px 10px; }
.ans .ic { width: 22px; height: 22px; }
.ans:hover { border-color: var(--ink-3); }
.ans:active { transform: scale(.97); }
.ans.oui.on { background: var(--ok); border-color: var(--ok); color: #fff; }
.ans.non.on { background: var(--no); border-color: var(--no); color: #fff; }
.ans.so.on { background: var(--na); border-color: var(--na); color: #fff; }
.qextra { margin-top: 14px; display: grid; gap: 10px; }
.measures { display: flex; gap: 10px; flex-wrap: wrap; }
.measure { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 12px; background: var(--card-2); overflow: hidden; }
.measure input { border: 0; background: transparent; min-height: 46px; width: 110px; font-size: 17px; font-weight: 650; }
.measure input:focus { box-shadow: none; }
.measure:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-ring); }
.measure em { font-style: normal; font-weight: 800; color: var(--ink-3); padding: 0 14px; border-left: 1px solid var(--line); align-self: stretch; display: grid; place-items: center; background: var(--card); }
.defect { border-radius: 14px; background: var(--no-bg); padding: 12px; display: grid; gap: 10px; }
.defect label { font-size: 12.5px; font-weight: 700; color: var(--no-ink); }
.defect textarea { background: var(--card); min-height: 64px; }
.photos { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.photos .ph { width: 64px; height: 64px; border-radius: 12px; background: var(--card-2) center/cover; position: relative; border: 1px solid var(--line); }
.photos .ph button { position: absolute; top: -6px; right: -6px; width: 22px; height: 22px; border-radius: 50%; border: 0; background: #17171A; color: #fff; font-size: 12px; cursor: pointer; display: grid; place-items: center; }
.photos .addph { height: 40px; border: 1px dashed var(--no); color: var(--no-ink); background: transparent; border-radius: 12px; padding: 0 14px; font-weight: 700; cursor: pointer; display: flex; align-items: center; gap: 6px; }
.choices { display: grid; gap: 8px; margin-top: 14px; }
.choice { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border: 1.5px solid var(--line); border-radius: 14px; cursor: pointer; font-size: 14.5px; background: var(--card); transition: all .15s; }
.choice b { color: var(--accent); min-width: 26px; }
.choice input { display: none; }
.choice:has(input:checked) { border-color: var(--accent); background: var(--accent-bg); }
.fcard { background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 18px 20px; box-shadow: var(--shadow); margin-bottom: 14px; }
.fcard h3 { font-size: 15px; margin-bottom: 12px; display: flex; gap: 8px; align-items: center; }
.fgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.next-card { margin-top: 18px; border-radius: 20px; background: var(--brand); color: #fff; padding: 22px; display: flex; align-items: center; gap: 16px; cursor: pointer; border: 0; width: 100%; text-align: left; position: relative; overflow: hidden; }
.next-card::after { content: ""; position: absolute; right: -30px; top: -40px; width: 180px; height: 180px; background: url(../img/loupe-fond.png) center/contain no-repeat; }
.next-card small { display: block; opacity: .85; font-size: 13px; } .next-card b { font-size: 19px; }
.next-card .ic { width: 28px; height: 28px; margin-left: auto; position: relative; z-index: 1; }

/* Listes déplaçables (dispositifs, circuits) */
.dlist { display: flex; flex-direction: column; gap: 10px; }
.dcard { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 10px 12px; align-items: center; box-shadow: var(--shadow); }
.dcard .handle { cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; color: var(--ink-3); font-weight: 800; font-size: 13px; background: var(--card-2); align-self: start; }
.dcard .handle:active { cursor: grabbing; }
.dcard .body { display: grid; grid-template-columns: minmax(150px, 2fr) 150px 84px 150px 110px minmax(120px, 1.3fr); gap: 8px; align-items: center; min-width: 0; }
.dcard .body input, .dcard .body select { min-height: 42px; padding: 8px 10px; font-size: 14px; }
.dcard .acts { display: flex; align-self: start; }
.dcard.zone { background: var(--card-2); box-shadow: none; border-style: dashed; }
.dcard.zone .body { grid-template-columns: 1fr; }
.dcard.zone input { font-weight: 800; text-transform: uppercase; letter-spacing: .03em; background: transparent; border-color: transparent; }
.dcard.def { border-color: var(--no); background: var(--no-bg); }
.dcard.aux .body { grid-template-columns: minmax(0, 1fr) auto; }
.etat { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.etat button { border: 1px solid var(--line); background: var(--card); border-radius: 10px; min-height: 42px; font-weight: 800; font-size: 13px; cursor: pointer; color: var(--ink-3); }
.etat button.on.I, .etat button.on.oui { background: var(--ok); border-color: var(--ok); color: #fff; }
.etat button.on.D, .etat button.on.non { background: var(--no); border-color: var(--no); color: #fff; }
.etat button.on.NI, .etat button.on.so { background: var(--na); border-color: var(--na); color: #fff; }
.dragging { opacity: .95; box-shadow: var(--shadow-l) !important; transform: scale(1.01); position: relative; z-index: 5; }
.dtools { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.legend-card { margin-top: 16px; font-size: 13px; color: var(--ink-2); display: flex; flex-wrap: wrap; gap: 6px 16px; }
.legend-card b { color: var(--ink); }

.fill-foot { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: color-mix(in srgb, var(--card) 92%, transparent); backdrop-filter: blur(12px); border-top: 1px solid var(--line); padding: 10px 18px calc(10px + var(--safe-b)); }
.fill-foot .in { max-width: 980px; margin: 0 auto; display: flex; gap: 10px; align-items: center; }
.fill-foot .saved { flex: 1; font-size: 13px; color: var(--ink-3); display: flex; align-items: center; gap: 6px; min-width: 0; }
.fill-foot .saved .ic { width: 16px; color: var(--ok); }

.bigchoice { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.bigchoice button { border: 1.5px solid var(--line); background: var(--card); border-radius: 18px; padding: 18px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 8px; font-weight: 750; font-size: 15px; color: var(--ink-2); }
.bigchoice button .ic { width: 30px; height: 30px; }
.bigchoice button.on.oui { border-color: var(--ok); background: var(--ok-bg); color: var(--ok-ink); }
.bigchoice button.on.non { border-color: var(--no); background: var(--no-bg); color: var(--no-ink); }
.sign-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.sign-box { border: 1.5px dashed var(--line); border-radius: 16px; background: var(--card-2); position: relative; overflow: hidden; }
.sign-box canvas { width: 100%; height: 150px; display: block; touch-action: none; cursor: crosshair; }
.sign-box img { width: 100%; height: 150px; object-fit: contain; display: block; background: #fff; }
.sign-box .lbl { position: absolute; left: 12px; bottom: 8px; font-size: 12px; color: var(--ink-3); pointer-events: none; }
.sign-box .clr { position: absolute; right: 8px; top: 8px; }
.locked-note { margin-bottom: 16px; }

/* ═══════════ Responsive ═══════════ */
@media (max-width: 1280px) { .types { grid-template-columns: repeat(3, minmax(0, 1fr)); } .dcard .body { grid-template-columns: minmax(150px, 1fr) 140px 80px; } .dcard .body .etat { grid-column: span 1; } }
@media (max-width: 1100px) {
  .shell { grid-template-columns: 84px minmax(0, 1fr); }
  .side-brand { padding: 14px 10px; } .side-brand img.full, .side-brand small { display: none; } .side-brand img.mini { display: block !important; width: 44px; margin: 0 auto; border-radius: 12px; }
  .nav a span, .side-foot .who, .side-foot .theme-btn { display: none; } .nav a { justify-content: center; }
  .side-foot { justify-content: center; }
  .g-main { grid-template-columns: minmax(0, 1fr); }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero img.logo { display: none; }
}
.side-brand img.mini { display: none; }
@media (max-width: 760px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { display: none; }
  .appbar { display: flex; align-items: center; gap: 10px; padding: calc(8px + var(--safe-t)) 14px 8px; background: var(--brand); position: sticky; top: 0; z-index: 25; }
  .appbar img { height: 40px; } .appbar .sp { flex: 1; } .appbar .icon-btn { color: #fff; }
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; background: color-mix(in srgb, var(--card) 94%, transparent); backdrop-filter: blur(14px); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + var(--safe-b)); }
  .tabbar a { display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 10.5px; font-weight: 650; color: var(--ink-3); padding: 4px 0; }
  .tabbar a .ic { width: 23px; height: 23px; }
  .tabbar a.on { color: var(--accent); }
  .tabbar a.plus .ic { background: var(--brand); color: #fff; border-radius: 12px; width: 42px; height: 32px; padding: 6px 10px; }
  .topbar { padding: 18px 16px 12px; } .topbar h1 { font-size: 23px; } .topbar .title .ti { display: none; }
  .content { padding: 0 14px 110px; }
  .hero { padding: 22px; border-radius: 20px; min-height: 0; } .hero h2 { font-size: 23px; }
  .stats { gap: 10px; } .stat { padding: 14px; } .stat b { font-size: 24px; } .stat .si { width: 40px; height: 40px; }
  .types { grid-template-columns: 1fr 1fr; padding: 4px 14px 16px; }
  .form-grid { grid-template-columns: 1fr; }
  .kv { grid-template-columns: 1fr; } .kv dd { margin-bottom: 6px; }
  .cal .day { min-height: 62px; padding: 3px; } .cal .ev { font-size: 0; height: 6px; padding: 0; }
  .hide-sm, .t .hide-sm { display: none; }
  .topbar .actions { width: 100%; } .topbar .actions .btn { flex: 1; }
  .modal-back { place-items: end stretch; padding: 0; }
  .modal, .modal.wide { width: 100%; border-radius: 24px 24px 0 0; max-height: 92vh; animation: up .25s ease-out; }
  .fill-top { padding-left: 12px; padding-right: 12px; }
  .fill-body { padding: 16px 12px 130px; }
  .sec-hero h2 { font-size: 22px; }
  .qcard { padding: 16px; border-radius: 18px; }
  .qcard .qt { font-size: 16px; padding-top: 6px; }
  .ans { min-height: 52px; font-size: 14px; flex-direction: column; gap: 2px; }
  .dcard { grid-template-columns: 30px minmax(0, 1fr); }
  .dcard .acts { grid-column: 2; justify-self: end; grid-row: 1; }
  .dcard .body { grid-column: 1 / -1; grid-template-columns: 1fr 1fr; }
  .dcard .body .loc { grid-column: 1 / -1; } .dcard .body .etat { grid-column: 1 / -1; } .dcard .body .rem { grid-column: 1 / -1; }
  .dcard.zone .body, .dcard.aux .body { grid-column: 2; grid-row: 1; grid-template-columns: 1fr; }
  .dcard.zone .acts, .dcard.aux .acts { grid-column: 1 / -1; grid-row: 2; }
  .dcard.aux .body { grid-column: 1 / -1; grid-row: 2; }
  .sign-row, .bigchoice { grid-template-columns: 1fr; }
  #toasts { bottom: calc(86px + var(--safe-b)); }
}
@media (min-width: 761px) and (max-width: 1280px) { .dcard .body .etat, .dcard .body .adr, .dcard .body .rem { grid-column: auto; } .dcard .body { grid-template-columns: minmax(140px, 1.6fr) 130px 76px 130px; } .dcard .body .rem { grid-column: 1 / -1; } }
@media print { .side, .appbar, .tabbar, .topbar .actions, .fill-foot { display: none; } }
.topbar:empty { display: none; }


/* ═══ Tableau compact des composantes ═══ */
.dsum { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 12px 16px; margin-bottom: 12px; position: sticky; top: 118px; z-index: 6; box-shadow: var(--shadow); }
.dsum .tot { display: flex; align-items: baseline; gap: 6px; }
.dsum .tot b { font-size: 26px; font-weight: 800; letter-spacing: -.02em; }
.dsum .tot span { color: var(--ink-3); font-weight: 600; }
.dsum .pills { display: flex; gap: 6px; flex-wrap: wrap; }
.dsum .p { font-size: 12.5px; font-weight: 750; padding: 4px 10px; border-radius: 20px; }
.p.i { background: var(--ok-bg); color: var(--ok-ink); } .p.ni { background: var(--warn-bg); color: var(--warn); } .p.d { background: var(--no-bg); color: var(--no-ink); } .p.v { background: var(--na-bg); color: var(--na-ink); }
.dsum .dbtns { margin-left: auto; display: flex; gap: 6px; }
.dtable { background: var(--card); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; box-shadow: var(--shadow); }
.dhead, .drow { display: grid; grid-template-columns: 34px minmax(140px, 1.3fr) 62px 104px 124px minmax(100px, 1fr) minmax(120px, 1fr) 72px; gap: 6px; align-items: center; padding: 0 10px; }
.dhead { font-size: 11px; font-weight: 700; color: var(--ink-3); text-transform: uppercase; letter-spacing: .04em; padding-top: 7px; padding-bottom: 5px; background: var(--card-2); border-bottom: 1px solid var(--line); }
.drow { border-bottom: 1px solid var(--line-2); min-height: 44px; padding-top: 3px; padding-bottom: 3px; }
.drow input { min-height: 34px; padding: 5px 8px; font-size: 14px; border-radius: 8px; background: transparent; border-color: transparent; }
.drow input:hover { border-color: var(--line); }
.drow input:focus { background: var(--card); }
.drow .loc { font-weight: 600; }
.drow .typ { text-align: center; font-weight: 800; text-transform: uppercase; background: var(--card-2); border-color: var(--line); padding: 5px 4px; }
.drow .c-note { text-align: center; background: var(--card-2); border-color: var(--line); padding: 5px 2px; }
.drow .handle { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; font-size: 11.5px; font-weight: 800; color: var(--ink-3); cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; }
.drow .handle:hover { background: var(--card-2); }
.drow.def { background: color-mix(in srgb, var(--no) 16%, var(--card)); }
.drow.def .loc, .drow.def .c-rem { color: var(--no-ink); }
.drow.ni { background: color-mix(in srgb, var(--warn) 12%, var(--card)); }
.etat3 { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--line); border-radius: 9px; overflow: hidden; background: var(--card); }
.etat3 button { border: 0; border-left: 1px solid var(--line); background: transparent; min-height: 32px; font-weight: 800; font-size: 12.5px; color: var(--ink-3); cursor: pointer; padding: 0; }
.etat3 button:first-child { border-left: 0; }
.etat3 button.on.I { background: var(--ok); color: #fff; } .etat3 button.on.NI { background: var(--warn); color: #fff; } .etat3 button.on.D { background: var(--no); color: #fff; }
.racts { display: flex; justify-content: flex-end; }
.icon-btn.sm { width: 32px; height: 32px; } .icon-btn.sm .ic { width: 17px; height: 17px; }
.c-more { display: none; }
.dzone { display: flex; align-items: center; gap: 8px; background: #2A2A2E; color: #fff; padding: 6px 10px; }
:root[data-theme="dark"] .dzone { background: #34343A; }
.dzone input { background: transparent; border: 0; color: #fff; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; min-height: 36px; padding: 4px 6px; flex: 1; }
.dzone input:focus { background: rgba(255,255,255,.1); box-shadow: none; }
.dzone input::placeholder { color: rgba(255,255,255,.5); }
.dzone .handle { color: rgba(255,255,255,.7); cursor: grab; touch-action: none; width: 30px; height: 30px; display: grid; place-items: center; }
.dzone .zc { background: rgba(255,255,255,.16); border-radius: 20px; padding: 2px 9px; font-size: 12px; font-weight: 800; }
.dzone .icon-btn { color: rgba(255,255,255,.8); } .dzone .icon-btn:hover { background: rgba(255,255,255,.12); color: #fff; }
.dquick { display: grid; gap: 6px; padding: 7px 10px 10px 54px; align-items: center; border-bottom: 1px solid var(--line); background: var(--card-2); grid-template-columns: minmax(140px, 1fr) 70px auto; }
.dquick input { min-height: 36px; padding: 5px 9px; font-size: 14px; border-radius: 9px; background: var(--card); }
.dquick .qtyp { text-transform: uppercase; text-align: center; font-weight: 800; }
@media (max-width: 1100px) {
  .dhead, .drow { grid-template-columns: 30px minmax(110px, 1.2fr) 54px 88px 108px minmax(90px, 1fr) 70px; }
  .dhead .c-rem, .drow .c-rem { display: none; }
  .c-rem { display: none; } .c-more { display: grid; } .c-del { display: none; }
  .dsum { top: 112px; }
}
@media (max-width: 760px) {
  .dhead, .drow { grid-template-columns: 16px minmax(0, 1fr) 38px 52px 58px minmax(0, .85fr) 22px; gap: 3px; padding: 0 4px; }
  .c-rem { display: none; }
  .drow input { font-size: 13.5px; padding: 4px 6px; }
  .drow .handle { width: 26px; font-size: 11px; }
  .etat3 button { min-height: 32px; font-size: 12px; }
  .racts .c-more { display: grid; }
  .dquick { padding: 6px; grid-template-columns: minmax(0, 1fr) 54px auto; }
  .dsum { padding: 10px 12px; gap: 8px 12px; top: 106px; }
  .dsum .tot b { font-size: 22px; } .dsum .dbtns { margin-left: 0; width: 100%; }
}
.appbar img { height: 34px !important; margin: 4px 0; }
@media (max-width: 760px) {
  .dsum { position: static; display: grid; grid-template-columns: auto 1fr; }
  .dsum .pills { justify-content: flex-end; }
  .dsum .dbtns { grid-column: 1 / -1; }
  .dhead, .drow { grid-template-columns: 16px minmax(0, 1fr) 38px 52px 58px minmax(0, .85fr) 22px; gap: 3px; padding: 0 4px; }
  .drow .c-adr { font-weight: 700; padding: 4px 4px; background: var(--card-2); border-color: var(--line); text-align: center; font-size: 12.5px; }
  .drow .typ { padding: 4px 2px; }
  .racts .icon-btn.sm { width: 28px; }
  .dquick { grid-template-columns: minmax(0, 1fr) 46px 70px auto; }
}
.lg-list { display: grid; gap: 6px; margin-bottom: 10px; }
.lg-row { display: grid; grid-template-columns: 90px 1fr 38px; gap: 8px; align-items: center; }
.lg-row.note { grid-template-columns: 28px 1fr 38px; align-items: start; }
.lg-row.note b { padding-top: 12px; text-align: center; color: var(--ink-3); }
.lg-row input, .lg-row textarea { min-height: 40px; padding: 7px 10px; }
.lg-row textarea { min-height: 52px; }
.lg-c { text-transform: uppercase; font-weight: 800; text-align: center; }

.drow .c-adr { font-variant-numeric: tabular-nums; }
@media (min-width: 761px) { .dquick { grid-template-columns: minmax(140px, 1fr) 70px 110px auto; } }
.dquick .qadr { text-align: center; }

.drow textarea.loc { min-height: 34px; padding: 6px 8px; font-size: 14px; font-weight: 600; border-radius: 8px; background: transparent; border-color: transparent; resize: none; overflow: hidden; line-height: 1.3; }
.drow textarea.loc:hover { border-color: var(--line); }
.drow textarea.loc:focus { background: var(--card); }
.drow.def textarea.loc { color: var(--no-ink); }
@media (max-width: 760px) {
  .dhead, .drow { grid-template-columns: 16px minmax(0, 1fr) 38px 52px 58px minmax(0, .85fr) 22px; gap: 3px; padding: 0 4px; }
  .drow textarea.loc { font-size: 13px; padding: 5px 4px; }
  .drow .c-adr { font-size: 11.5px; letter-spacing: -.02em; padding: 4px 1px; }
  .drow .typ { font-size: 13px; }
  .drow .handle { width: 20px; font-size: 10.5px; }
  .etat3 button { font-size: 11.5px; }
  .racts .icon-btn.sm { width: 26px; } .racts .icon-btn.sm .ic { width: 15px; height: 15px; }
}

@media (max-width: 760px) {
  .drow .c-note { font-size: 12.5px; padding: 4px 0; font-weight: 700; }
  .drow .c-adr { font-size: 11px; }
  .drow .handle { width: 18px; font-size: 10px; }
  .etat3 button { font-size: 11px; }
  .racts .icon-btn.sm { width: 24px; }
  .dhead { font-size: 9.5px; letter-spacing: 0; }
}
@media (max-width: 760px) { .drow .typ { padding: 4px 0; font-size: 12.5px; letter-spacing: -.02em; } }
.drow, .dcard { transition: box-shadow .3s, background .3s; }
.drow.saved .handle, .dcard.saved .handle { background: var(--ok); color: #fff; }
.drow.saved .handle::after { content: "✓"; position: absolute; }
.drow .handle { position: relative; }
.drow.saved .handle { font-size: 0; }
.drow.saved .handle::after { font-size: 12px; }
#saveBtn .ic { width: 18px; }
@media (max-width: 760px) { .dtable .drow input.typ { font-size: 11.5px; padding: 0; letter-spacing: -.03em; text-align: center; } }

.drow textarea.c-note { min-height: 34px; padding: 6px 7px; font-size: 13px; border-radius: 8px; background: var(--card-2); border: 1px solid var(--line); resize: none; overflow: hidden; line-height: 1.3; text-align: left; }
@media (max-width: 760px) {
  .dhead, .drow { gap: 2px; padding: 0 3px; }
  .drow textarea.c-note { font-size: 11.5px; padding: 4px 4px; min-height: 32px; }
  .drow textarea.loc { font-size: 12.5px; padding: 4px 3px; }
  .dtable .drow input.typ { font-size: 11px; }
  .drow .c-adr { font-size: 10.5px; padding: 4px 0; }
  .etat3 button { font-size: 10.5px; min-height: 30px; }
  .drow .handle { width: 16px; font-size: 9.5px; }
  .racts .icon-btn.sm { width: 22px; } .racts .icon-btn.sm .ic { width: 14px; height: 14px; }
  .dhead { font-size: 9px; }
}
/* Une note longue agrandit seulement sa case : le reste de la ligne garde sa taille, aligné en haut */
.drow { align-items: start; }
.drow > input, .drow > .etat3, .drow > .racts, .drow > .handle { align-self: start; }
.drow > input { height: 34px; }
.drow .etat3 { height: 34px; }
.drow .etat3 button { min-height: 0; height: 100%; }
.drow .handle { margin-top: 2px; }
.drow textarea.c-note { max-height: none; }
@media (max-width: 760px) { .drow > input, .drow .etat3 { height: 32px; } }
.drow textarea.c-note { font-weight: 400; }

.hero img.logo { display: none !important; }
@media (max-width: 760px) { .hero::after { right: 16px; top: 10px; bottom: auto; width: 150px; height: 150px; } }

/* ── Écran de connexion ── */
.login2 { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px 16px calc(24px + var(--safe-b)); background: var(--bg); }
.lcard { width: min(440px, 100%); background: var(--card); border-radius: 28px; padding: 40px 32px 30px; box-shadow: 0 10px 40px rgba(16,16,20,.08); border: 1px solid var(--line); text-align: center; }
.ltile { width: 84px; height: 84px; border-radius: 24px; background: var(--brand); display: grid; place-items: center; margin: 0 auto 20px; box-shadow: 0 10px 24px rgba(192,20,28,.28); }
.lcard h1 { font-size: 30px; font-weight: 800; letter-spacing: -.02em; }
.lsub { color: var(--ink-3); margin: 6px 0 28px; font-size: 16px; }
.lcard form { display: grid; gap: 18px; text-align: left; }
.lcard .field > span { font-size: 15px; font-weight: 600; color: var(--ink); }
.lcard input { min-height: 54px; font-size: 16px; border-radius: 14px; background: var(--card); }
.pw { position: relative; }
.pw input { padding-right: 48px; }
.pw .icon-btn { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); color: var(--ink-3); }
.lcard .btn.lg { min-height: 56px; font-size: 17px; border-radius: 14px; margin-top: 4px; }
.lsecond { border: 0; background: var(--card-2); color: var(--ink-2); font-weight: 650; font-size: 15px; min-height: 52px; border-radius: 14px; cursor: pointer; }
.lsecond:hover { background: var(--line-2); }
.lmsg { margin: 0; text-align: center; font-size: 14px; color: var(--ink-3); min-height: 1em; }
.lfoot { color: var(--ink-3); font-size: 12.5px; margin-top: 20px; }
@media (max-width: 760px) { .lcard { padding: 34px 22px 24px; border-radius: 24px; } .lcard h1 { font-size: 26px; } }

/* ── Connexion v3 : fond rouge, loupe complète en filigrane ── */
.login3 { position: relative; min-height: 100vh; overflow: hidden; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; padding: calc(28px + var(--safe-t)) 18px calc(24px + var(--safe-b)); background: radial-gradient(120% 90% at 50% 20%, #D21A22 0%, #B3121B 55%, #8E0E15 100%); }
.login3 .lbg { position: absolute; left: 50%; top: 50%; width: min(118vmin, 900px); height: min(118vmin, 900px); transform: translate(-50%, -50%); background: url(../img/loupe-fond.png) center/contain no-repeat; opacity: .95; pointer-events: none; }
.lhead { position: relative; z-index: 1; text-align: center; }
.lhead img { width: min(380px, 82vw); display: block; filter: drop-shadow(0 6px 18px rgba(0,0,0,.25)); }
.lhead span { display: block; margin-top: 10px; color: rgba(255,255,255,.9); font-size: 13px; font-weight: 700; letter-spacing: .22em; text-transform: uppercase; }
.lcard3 { position: relative; z-index: 1; width: min(420px, 100%); background: var(--card); border-radius: 26px; padding: 30px 28px 24px; box-shadow: 0 24px 60px rgba(60, 0, 4, .35); }
.lcard3 h1 { font-size: 26px; font-weight: 800; letter-spacing: -.02em; }
.lcard3 .lsub { color: var(--ink-3); margin: 4px 0 22px; font-size: 15px; }
.lcard3 form { display: grid; gap: 16px; }
.lcard3 .field > span { font-size: 14.5px; font-weight: 650; color: var(--ink); }
.lcard3 input { min-height: 54px; font-size: 16px; border-radius: 14px; }
.lcard3 .btn.lg { min-height: 56px; font-size: 17px; border-radius: 14px; margin-top: 2px; }
.lfoot3 { position: relative; z-index: 1; margin: 0; color: rgba(255,255,255,.75); font-size: 12.5px; }
:root[data-theme="dark"] .login3 { background: radial-gradient(120% 90% at 50% 20%, #8E0E15 0%, #5E070C 60%, #2A0306 100%); }
@media (max-width: 760px) { .lcard3 { padding: 26px 20px 20px; border-radius: 22px; } .login3 { gap: 18px; } }
.login3 .lbg { display: none; }
.lhead { padding: 34px 0 6px; }
.lhead::before { content: ""; position: absolute; left: 50%; top: 50%; width: 300px; height: 300px; transform: translate(-50%, -54%); background: url(../img/loupe-fond.png) center/contain no-repeat; z-index: -1; }
.lhead { isolation: isolate; }
@media (max-width: 760px) { .lhead::before { width: 250px; height: 250px; } .lhead { padding: 28px 0 4px; } }
@media (min-width: 761px) { .lhead::before { width: 340px; height: 340px; } }
.lhead { min-height: 270px; display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 0; }
.lhead::before { width: 260px; height: 260px; transform: translate(-50%, -50%); }
.login3 { justify-content: flex-start; gap: 6px; }
@media (min-width: 761px) { .login3 { justify-content: center; } .lhead { min-height: 300px; } .lhead::before { width: 290px; height: 290px; } }
@media (max-width: 760px) { .lhead { min-height: 260px; } .lhead::before { width: 240px; height: 240px; } .lhead img { width: min(330px, 84vw); } }
@media (min-width: 761px) { .lhead { min-height: 250px; } .lhead::before { width: 250px; height: 250px; } .lhead img { width: 340px; } .lcard3 { padding: 26px 28px 20px; } .lcard3 form { gap: 14px; } }
.login3, :root[data-theme="dark"] .login3 { background: linear-gradient(to top, #050505 0%, #2A0507 28%, #7A0B12 62%, #C0141C 100%); }
.lcard3 h1 { margin-bottom: 18px; }
