/* Latitude Zen Time — feuille de style unique (téléphone, espace personnel, tablette, back office) */

@font-face { font-family: "Cormorant Garamond"; font-weight: 500; font-display: swap; src: url("../fonts/cormorant-garamond-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Cormorant Garamond"; font-weight: 600; font-display: swap; src: url("../fonts/cormorant-garamond-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Nunito Sans"; font-weight: 400; font-display: swap; src: url("../fonts/nunito-sans-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Nunito Sans"; font-weight: 600; font-display: swap; src: url("../fonts/nunito-sans-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Nunito Sans"; font-weight: 700; font-display: swap; src: url("../fonts/nunito-sans-latin-700-normal.woff2") format("woff2"); }

:root {
  --violet: #5B1F78;
  --violet-dark: #3E1453;
  --violet-soft: #EFE4F3;
  --violet-mid: #8E5BA6;
  --gold: #C9A227;
  --ground: #F7F2F8;
  --card: #FFFFFF;
  --ink: #241A2B;
  --ink-2: #4A3A53;
  --muted: #6B5875;
  --line: #EEE6F1;
  --line-2: #E2D6E8;
  --ok: #1E6B3A; --ok-bg: #E3F2E8;
  --warn: #6B4E00; --warn-bg: #FFF3CC; --warn-line: #E8D48A;
  --bad: #8A1C1C; --bad-bg: #FCE4E4;
  --radius: 18px;
  --shadow: 0 8px 24px rgba(91, 31, 120, .10);
  --serif: "Cormorant Garamond", Georgia, serif;
  --sans: "Nunito Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--ground); color: var(--ink); font-family: var(--sans); font-size: 16px; line-height: 1.45; }
a { color: var(--violet); }
a:hover { color: var(--violet-dark); }
h1, h2, h3 { margin: 0; line-height: 1.2; }
p { margin: 0; }
img, svg { display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.xsmall { font-size: 13px; }
.serif { font-family: var(--serif); font-weight: 600; }
.nowrap { white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }
.pos { color: var(--ok); }
.neg { color: var(--bad); }
.stack { display: flex; flex-direction: column; gap: 12px; }
.stack-s { display: flex; flex-direction: column; gap: 6px; }
.row { display: flex; align-items: center; gap: 12px; }
.row-wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.between { justify-content: space-between; }
.grow { flex: 1 1 auto; min-width: 0; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }

/* ---------- Composants ---------- */
.card { background: var(--card); border-radius: var(--radius); padding: 20px; }
.card.raised { box-shadow: var(--shadow); }
.card h2 { font-size: 19px; }
.card-violet { background: var(--violet); color: #fff; }
.card-violet .muted, .card-violet .label { color: rgba(255, 255, 255, .85); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 20px; border-radius: 14px; border: 2px solid var(--violet); background: var(--violet); color: #fff; font-weight: 700; font-size: 16px; text-decoration: none; cursor: pointer; transition: background .15s, transform .05s; }
.btn:hover { background: var(--violet-dark); border-color: var(--violet-dark); color: #fff; }
.btn:active { transform: scale(.98); }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn-ghost { background: #fff; color: var(--violet); }
.btn-ghost:hover { background: var(--violet-soft); color: var(--violet-dark); }
.btn-text { background: transparent; border-color: transparent; color: var(--violet); }
.btn-text:hover { background: var(--violet-soft); border-color: transparent; color: var(--violet-dark); }
.btn-danger { background: #fff; color: var(--bad); border-color: var(--bad); }
.btn-danger:hover { background: var(--bad-bg); color: var(--bad); border-color: var(--bad); }
.btn-sm { min-height: 40px; padding: 0 14px; font-size: 15px; border-radius: 10px; }
.btn-block { width: 100%; }
.btn-xl { min-height: 64px; font-size: 20px; border-radius: 18px; }

.pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 13px; font-weight: 700; white-space: nowrap; }
.pill-ok { background: var(--ok-bg); color: var(--ok); }
.pill-warn { background: var(--warn-bg); color: var(--warn); }
.pill-bad { background: var(--bad-bg); color: var(--bad); }
.pill-violet { background: var(--violet-soft); color: var(--violet); }
.pill-grey { background: #F1EEF2; color: var(--ink-2); }
.dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; display: inline-block; }
.dot-on { background: #2E8B57; } .dot-pause { background: var(--gold); } .dot-off { background: #A08DAA; }

.alert { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 14px; font-size: 15px; line-height: 1.4; }
.alert svg { flex-shrink: 0; margin-top: 1px; }
.alert-warn { background: #FFF8E1; border: 1px solid var(--warn-line); color: #5A4500; }
.alert-ok { background: var(--ok-bg); color: var(--ok); }
.alert-bad { background: var(--bad-bg); color: var(--bad); }
.alert-info { background: var(--violet-soft); color: var(--violet-dark); }

.field { display: flex; flex-direction: column; gap: 6px; }
.field label, .label { font-size: 14px; font-weight: 700; color: var(--ink-2); }
.input, .field input[type=text], .field input[type=email], .field input[type=password], .field input[type=date], .field input[type=time], .field input[type=number], .field select, .field textarea {
  width: 100%; min-height: 46px; padding: 10px 12px; border: 1px solid #D6C8DD; border-radius: 12px; background: #fff; font-size: 16px;
}
.field textarea { min-height: 96px; resize: vertical; }
.field .hint { font-size: 13px; color: var(--muted); }
.checks { display: flex; flex-wrap: wrap; gap: 8px; }
.check-chip { position: relative; }
.check-chip input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.check-chip span { display: inline-flex; align-items: center; justify-content: center; min-width: 52px; min-height: 44px; padding: 0 12px; border-radius: 12px; border: 2px solid var(--line-2); font-weight: 700; color: var(--ink-2); background: #fff; }
.check-chip input:checked + span { background: var(--violet); border-color: var(--violet); color: #fff; }
.check-chip input:focus-visible + span { outline: 3px solid var(--gold); outline-offset: 2px; }

.seg { display: inline-flex; background: var(--violet-soft); border-radius: 12px; padding: 4px; gap: 4px; }
.seg a, .seg button { border: 0; background: transparent; border-radius: 9px; padding: 8px 14px; font-weight: 700; color: var(--violet); text-decoration: none; cursor: pointer; }
.seg .on { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.08); }

.timeline { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.timeline.more { grid-template-columns: repeat(auto-fill, minmax(70px, 1fr)); }
.tl { border-radius: 12px; padding: 8px 10px; background: var(--ground); display: flex; flex-direction: column; gap: 2px; }
.tl .k { font-size: 12px; color: var(--muted); }
.tl .t { font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums; }
.tl.now { background: var(--violet); color: #fff; }
.tl.now .k { color: rgba(255,255,255,.85); }
.tl.todo { background: transparent; border: 2px dashed #C9B7D1; color: var(--muted); }

.kv { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; }
.kv .k { color: var(--muted); }
.kv .v { font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; }
.sep { height: 1px; background: var(--line); margin: 4px 0; }

.gauge { position: relative; height: 14px; border-radius: 7px; background: var(--line); }
.gauge .fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 7px; background: var(--violet); max-width: 100%; }
.gauge .fill.over { background: var(--bad); }
.gauge .mark { position: absolute; top: -4px; width: 3px; height: 22px; background: var(--gold); border-radius: 2px; }

.bars { display: grid; gap: 10px; align-items: end; height: 140px; position: relative; padding-top: 8px; }
.bars.c1 { grid-template-columns: repeat(1, minmax(0, 1fr)); } .bars.c2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.bars.c3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .bars.c4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.bars.c5 { grid-template-columns: repeat(5, minmax(0, 1fr)); } .bars.c6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.bars.c7 { grid-template-columns: repeat(7, minmax(0, 1fr)); }
.bar-wrap { flex: 1; width: 100%; display: flex; align-items: flex-end; position: relative; }
.due-mark { position: absolute; left: -5px; right: -5px; height: 2px; background: var(--gold); border-radius: 1px; }
.bar-col { display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.bar { width: 100%; border-radius: 8px 8px 4px 4px; background: var(--violet); min-height: 4px; }
.bar.light { background: var(--violet-mid); }
.bar.empty { background: var(--line); }
.bar.credit { background: repeating-linear-gradient(45deg, var(--violet-soft), var(--violet-soft) 6px, #DCC9E4 6px, #DCC9E4 12px); }
.bar-col .lbl { font-size: 12px; color: var(--muted); }

.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 15px; }
table.data th { text-align: left; font-size: 13px; color: var(--muted); font-weight: 700; padding: 10px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.data td { padding: 10px 8px; border-bottom: 1px solid #F3EEF5; vertical-align: middle; }
table.data td.r, table.data th.r { text-align: right; }
table.data tr.dim td { color: var(--muted); }
table.data tr.strike td { text-decoration: line-through; color: var(--muted); }

.flash { padding: 12px 16px; border-radius: 12px; font-weight: 600; }
.flash.ok { background: var(--ok-bg); color: var(--ok); }
.flash.error { background: var(--bad-bg); color: var(--bad); }

.spinner { width: 42px; height: 42px; border-radius: 50%; border: 4px solid var(--violet-soft); border-top-color: var(--violet); animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 3s; } * { transition: none !important; } }

/* ---------- Téléphone : pointage ---------- */
.phone { max-width: 480px; margin: 0 auto; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.phone-head { background: var(--violet); color: #fff; padding: 22px 22px 54px; display: flex; flex-direction: column; gap: 14px; }
.phone-head .brand { font-family: var(--serif); font-size: 22px; font-weight: 600; }
.phone-head .hello { display: flex; align-items: center; gap: 14px; }
.phone-head .badge { width: 52px; height: 52px; border-radius: 26px; background: var(--gold); display: flex; align-items: center; justify-content: center; flex-shrink: 0; color: var(--ink); }
.phone-head .badge.wait { background: rgba(255,255,255,.15); color: #fff; }
.phone-head .title { font-size: 22px; font-weight: 700; }
.phone-main { margin-top: -32px; padding: 0 14px 22px; display: flex; flex-direction: column; gap: 12px; flex: 1; }
.phone-main > .card:first-child { box-shadow: var(--shadow); }
.choice-grid { display: grid; gap: 10px; }
.code-pad { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.code-pad button { min-height: 60px; border-radius: 14px; border: 2px solid var(--line-2); background: #fff; font-size: 24px; font-weight: 700; cursor: pointer; }
.code-pad button:active { background: var(--violet-soft); }
.code-display { display: flex; justify-content: center; gap: 12px; }
.code-display span { width: 64px; height: 76px; border-radius: 14px; border: 2px solid var(--violet); display: flex; align-items: center; justify-content: center; font-size: 36px; font-weight: 700; background: #fff; }
.center { text-align: center; align-items: center; }
.big-check { width: 72px; height: 72px; border-radius: 50%; background: var(--ok-bg); color: var(--ok); display: flex; align-items: center; justify-content: center; }

/* ---------- Espace personnel ---------- */
.me { max-width: 560px; margin: 0 auto; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.me-head { padding: 26px 20px 8px; display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; }
.me-head h1 { font-family: var(--serif); font-size: 34px; color: var(--violet); font-weight: 600; }
.me-main { padding: 6px 14px 110px; display: flex; flex-direction: column; gap: 12px; }
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; background: #fff; border-top: 1px solid var(--line); display: flex; justify-content: center; padding: 6px 6px calc(10px + env(safe-area-inset-bottom)); z-index: 5; }
.tabbar nav { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); width: 100%; max-width: 560px; }
.tabbar a { display: flex; flex-direction: column; align-items: center; gap: 3px; color: var(--muted); text-decoration: none; font-size: 12px; padding: 6px 0; border-radius: 10px; }
.tabbar a.on { color: var(--violet); font-weight: 700; }
.stat-big { white-space: nowrap; font-size: 28px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.1; }

/* ---------- Tablette murale ---------- */
.borne { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); overflow: hidden; }
.borne-left { background: var(--violet); color: #fff; padding: 5vh 4.5vw; display: flex; flex-direction: column; justify-content: space-between; gap: 24px; }
.borne-brand { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.borne-brand .name { font-family: var(--serif); font-size: clamp(22px, 2.2vw, 30px); font-weight: 600; display: flex; align-items: center; gap: 12px; }
.borne-clock { font-family: var(--serif); font-weight: 500; font-size: clamp(90px, 13vw, 190px); line-height: 1; letter-spacing: -1px; font-variant-numeric: lining-nums tabular-nums; font-feature-settings: "lnum" 1, "tnum" 1; }
.borne-date { font-size: clamp(16px, 1.6vw, 22px); opacity: .88; }
.borne-cta { display: flex; align-items: center; gap: 26px; }
.borne-cta .ring { width: clamp(90px, 9vw, 124px); height: clamp(90px, 9vw, 124px); border-radius: 50%; border: 2px solid var(--gold); display: flex; align-items: center; justify-content: center; flex-shrink: 0; animation: pulse 2.8s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(201,162,39,.45); } 50% { box-shadow: 0 0 0 16px rgba(201,162,39,0); } }
.borne-cta .big { font-size: clamp(22px, 2.4vw, 32px); font-weight: 700; }
.borne-cta .sub { font-size: clamp(15px, 1.4vw, 19px); opacity: .88; }
.borne-code { display: flex; align-items: center; gap: 18px; background: rgba(255,255,255,.1); border-radius: 18px; padding: 14px 18px; }
.borne-code .digits { font-size: clamp(40px, 4.5vw, 60px); font-weight: 700; letter-spacing: 6px; font-variant-numeric: tabular-nums; color: var(--gold); }
.borne-code .ttl { height: 6px; border-radius: 3px; background: rgba(255,255,255,.2); overflow: hidden; width: 120px; }
.borne-code .ttl i { display: block; height: 100%; background: var(--gold); transition: width 1s linear; }
.borne-right { padding: 5vh 3.5vw; display: flex; flex-direction: column; gap: 22px; overflow: hidden; }
.borne-right .caps { font-size: 14px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted); }
.borne-event { background: #fff; border-radius: 24px; padding: 28px; display: flex; flex-direction: column; gap: 20px; box-shadow: var(--shadow); animation: pop .35s ease-out; }
@keyframes pop { from { transform: scale(.96); opacity: 0; } to { transform: none; opacity: 1; } }
.borne-event .who { display: flex; align-items: center; gap: 16px; }
.avatar { width: 64px; height: 64px; border-radius: 50%; background: var(--violet-soft); color: var(--violet); display: flex; align-items: center; justify-content: center; font-size: 24px; font-weight: 700; flex-shrink: 0; }
.borne-event .hi { font-size: 26px; font-weight: 700; }
.borne-idle { border: 2px dashed var(--line-2); border-radius: 24px; padding: 28px; color: var(--muted); font-size: 18px; text-align: center; }
.presence { display: flex; flex-wrap: wrap; gap: 10px; }
.presence > span { background: #fff; border: 1px solid var(--line-2); border-radius: 999px; padding: 10px 16px; font-size: 16px; font-weight: 600; display: inline-flex; align-items: center; gap: 8px; }
.borne-enroll { background: #fff; border-radius: 24px; padding: 24px; display: flex; gap: 22px; align-items: center; box-shadow: var(--shadow); }
.borne-enroll .qr { width: 220px; height: 220px; flex-shrink: 0; background: #fff; }
.borne-enroll .qr svg { width: 100%; height: 100%; }
/* v0.2 : QR changeant (variante A), caméra (variante B), cartes, fenêtre de choix */
.borne.with-qr .borne-clock { font-size: clamp(64px, 8vw, 120px); }
.borne-qr { display: flex; align-items: center; gap: 26px; }
.borne-qr .qr { width: clamp(220px, 24vw, 330px); aspect-ratio: 1; flex-shrink: 0; background: #fff; border-radius: 22px; padding: 10px; box-shadow: 0 0 0 4px var(--gold); }
.borne-qr .qr svg { width: 100%; height: 100%; display: block; }
.borne-qr .big { font-size: clamp(22px, 2.4vw, 32px); font-weight: 700; }
.borne-qr .sub { font-size: clamp(15px, 1.4vw, 19px); opacity: .88; }
.borne-qr .ttl { height: 6px; border-radius: 3px; background: rgba(255,255,255,.2); overflow: hidden; width: 160px; margin-top: 10px; }
.borne-qr .ttl i { display: block; height: 100%; background: var(--gold); transition: width .25s linear; }
.borne.with-qr #b-how { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 20px; align-items: center; }
.borne.with-qr #b-how > .borne-qr, .borne.with-qr #b-how > .borne-none { grid-column: 1 / -1; }
.borne.with-qr #b-how > .borne-code { grid-column: 1 / -1; order: 3; padding: 10px 16px; }
.borne.with-qr .borne-code .digits { font-size: clamp(32px, 3.4vw, 44px); }
.borne.with-qr .borne-cta { gap: 14px; }
.borne.with-qr .borne-qr .qr { width: clamp(200px, 20vw, 290px); }
.borne.with-qr .borne-cta .ring { width: 64px; height: 64px; animation: none; }
.borne.with-qr .borne-cta .ring svg { width: 32px; height: 32px; }
.borne.with-qr .borne-cta .big { font-size: 18px; }
.borne.with-qr .borne-cta .sub { font-size: 14px; }
.borne-none { background: rgba(255,255,255,.12); border-radius: 16px; padding: 16px 18px; font-size: 18px; }
.btn-gold { background: var(--gold); color: var(--ink); border-color: var(--gold); }
.borne-cam { background: #fff; border-radius: 24px; padding: 16px; display: flex; gap: 18px; align-items: center; box-shadow: var(--shadow); }
.cam-frame { position: relative; width: 168px; aspect-ratio: 4 / 3; border-radius: 16px; overflow: hidden; background: var(--ink); flex-shrink: 0; }
.cam-frame video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); display: block; }
.cam-dot { position: absolute; top: 8px; right: 8px; width: 12px; height: 12px; border-radius: 50%; background: #3BB273; box-shadow: 0 0 0 3px rgba(255,255,255,.7); }
.cam-dot.hit { background: var(--gold); }
.avatar-xl { width: 76px; height: 76px; font-size: 30px; }
.borne-overlay { position: fixed; inset: 0; background: rgba(36, 26, 43, .55); display: flex; align-items: center; justify-content: center; padding: 4vh 4vw; z-index: 20; }
.borne-sheet { background: #fff; border-radius: 28px; padding: 30px; width: min(640px, 100%); box-shadow: 0 24px 60px rgba(36, 26, 43, .35); animation: pop .25s ease-out; }
.borne-sheet .who { gap: 16px; align-items: center; }
.borne-sheet .choice-grid { display: grid; gap: 12px; }
.borne-sheet .btn-xl { font-size: 24px; padding: 20px; }
.borne-sheet #b-ov-text { font-size: 19px; min-height: 1.4em; }
.method-ic { width: 46px; height: 46px; border-radius: 14px; background: var(--violet-soft); color: var(--violet); display: flex; align-items: center; justify-content: center; }
.sub-row { padding-left: 62px; }
.todo-item.dim { opacity: .6; }
.mono-inline { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; }
.qrp { display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; }
.qrp-code { width: min(78vw, 340px); aspect-ratio: 1; background: #fff; border-radius: 24px; padding: 12px; box-shadow: 0 0 0 4px var(--violet), var(--shadow); }
.qrp-code svg { width: 100%; height: 100%; display: block; }
.qrp-ttl { width: min(78vw, 340px); height: 6px; border-radius: 3px; background: var(--line-2); overflow: hidden; }
.qrp-ttl i { display: block; height: 100%; background: var(--violet); transition: width .25s linear; }
.tabbar nav.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 900px) and (orientation: portrait) {
  .borne { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .borne-qr .qr { width: clamp(220px, 46vw, 360px); }
}

/* ---------- Back office ---------- */
.admin { min-height: 100vh; display: flex; flex-wrap: wrap; }
.side { flex: 1 1 240px; max-width: 100%; background: #fff; border-right: 1px solid var(--line); padding: 24px 16px; display: flex; flex-direction: column; gap: 4px; }
.side .logo { font-family: var(--serif); font-size: 25px; font-weight: 600; color: var(--violet); padding: 0 12px 16px; }
.side a { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 12px; color: var(--ink-2); text-decoration: none; font-weight: 600; }
.side a:hover { background: var(--ground); color: var(--violet); }
.side a.on { background: var(--violet-soft); color: var(--violet); font-weight: 700; }
.side .count { margin-left: auto; background: var(--gold); color: var(--ink); font-size: 12px; font-weight: 700; border-radius: 999px; padding: 2px 8px; }
.side .foot { margin-top: auto; padding-top: 16px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; }
.side form { margin: 0; }
.side button.link { width: 100%; display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 12px; border: 0; background: transparent; color: var(--ink-2); font-weight: 600; cursor: pointer; text-align: left; }
.side button.link:hover { background: var(--ground); color: var(--violet); }
.content { flex: 999 1 560px; min-width: 0; padding: 30px clamp(16px, 3vw, 40px) 60px; display: flex; flex-direction: column; gap: 22px; }
.page-head { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; justify-content: space-between; }
.page-head h1 { font-family: var(--serif); font-size: 38px; font-weight: 600; }
.page-head .sub { color: var(--muted); font-size: 15px; }
.kpi .v { font-size: 30px; font-weight: 700; font-variant-numeric: tabular-nums; }
.kpi .k { font-size: 14px; color: var(--muted); }
.todo-item { border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.todo-item form { margin: 0; }
.cols { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.cols > .main { flex: 3 1 420px; min-width: 0; }
.cols > .aside { flex: 2 1 300px; min-width: 0; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; }
details.disclose summary { cursor: pointer; font-weight: 700; color: var(--violet); padding: 6px 0; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 14px; word-break: break-all; background: var(--ground); padding: 8px 10px; border-radius: 8px; }
.qr-box { width: 220px; height: 220px; background: #fff; padding: 8px; border: 1px solid var(--line); border-radius: 12px; }
.qr-box svg { width: 100%; height: 100%; }

/* Réglages à interrupteurs */
.set-group { background: #fff; border-radius: 20px; padding: 6px 22px; }
.set-group > h2 { margin: 16px 0 6px; font-size: 19px; }
.set-group > .intro { color: var(--muted); font-size: 14px; margin-bottom: 6px; }
.set-row { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; padding: 16px 0; border-top: 1px solid #F1EAF4; }
.set-row .txt { flex: 1 1 340px; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.set-row .title { font-size: 16px; font-weight: 700; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.set-row .desc { font-size: 14px; color: var(--ink-2); line-height: 1.45; }
.set-row .effect { font-size: 13px; color: var(--muted); }
.set-row .value input, .set-row .value select { width: 110px; min-height: 42px; padding: 8px 10px; border: 1px solid #D6C8DD; border-radius: 10px; font-weight: 700; background: #fff; }
.set-row .value.wide input { width: 260px; max-width: 100%; }
.switch { position: relative; display: inline-flex; align-items: center; gap: 12px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 56px; height: 32px; margin: 0; cursor: pointer; }
.switch .track { width: 56px; height: 32px; border-radius: 16px; background: #CFC2D6; position: relative; transition: background .15s; flex-shrink: 0; }
.switch .track::after { content: ""; position: absolute; top: 4px; left: 4px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: left .15s; }
.switch input:checked + .track { background: var(--violet); }
.switch input:checked + .track::after { left: 28px; }
.switch input:focus-visible + .track { outline: 3px solid var(--gold); outline-offset: 2px; }
.switch .state { width: 82px; font-size: 14px; font-weight: 700; color: var(--ink-2); }
.choice-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; }
.choice-card { position: relative; display: flex; flex-direction: column; gap: 6px; text-align: left; padding: 16px; border-radius: 16px; border: 2px solid var(--line-2); background: #fff; cursor: pointer; min-height: 96px; }
.choice-card input { position: absolute; opacity: 0; inset: 0; cursor: pointer; margin: 0; }
.choice-card .t { font-size: 16px; font-weight: 700; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.choice-card .d { font-size: 14px; line-height: 1.4; color: var(--ink-2); }
.choice-card:has(input:checked) { border-color: var(--violet); background: #F3EAF7; }
.choice-card:has(input:focus-visible) { outline: 3px solid var(--gold); outline-offset: 2px; }
.choice-card.preset:has(input:checked) { background: var(--violet); color: #fff; }
.choice-card.preset:has(input:checked) .d { color: rgba(255,255,255,.9); }
.choice-card.disabled { opacity: .55; cursor: not-allowed; }
.save-bar { position: sticky; bottom: 12px; display: flex; justify-content: flex-end; gap: 10px; align-items: center; background: rgba(255,255,255,.95); border: 1px solid var(--line); border-radius: 16px; padding: 10px 14px; box-shadow: var(--shadow); }

/* Pages d'authentification */
.auth { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.auth .box { width: 100%; max-width: 420px; background: #fff; border-radius: 24px; padding: 32px 28px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 18px; }
.auth h1 { font-family: var(--serif); font-size: 32px; color: var(--violet); font-weight: 600; }

@media (max-width: 720px) {
  .side { flex-direction: row; flex-wrap: wrap; padding: 12px; gap: 4px; border-right: 0; border-bottom: 1px solid var(--line); }
  .side .logo { width: 100%; padding: 4px 8px 8px; }
  .side a { padding: 8px 10px; font-size: 14px; }
  .side .foot { width: 100%; flex-direction: row; flex-wrap: wrap; margin-top: 0; padding-top: 8px; }
  .page-head h1 { font-size: 30px; }
}
@media print {
  .side, .save-bar, .actions, .tabbar { display: none !important; }
  body { background: #fff; }
  .card { break-inside: avoid; }
}
.title-lg { font-size: 26px; font-weight: 700; line-height: 1.2; }
.stats-bars { grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 4px; height: 160px; }

a.card { text-decoration: none; color: inherit; }
a.card:hover { box-shadow: var(--shadow); }
a.row { text-decoration: none; color: inherit; border-radius: 12px; }
a.row:hover strong { color: var(--violet); }
.btn.neg { color: var(--bad); }
.set-row .value.wide select { width: 320px; max-width: 100%; }

/* v0.2.1 : appairage de la tablette par code */
.pairing { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 4vh 4vw; background: var(--violet); color: #fff; }
.pairing-box { width: min(760px, 100%); display: flex; flex-direction: column; gap: 18px; text-align: center; align-items: center; }
.pairing-brand { display: flex; gap: 10px; align-items: center; font-family: var(--serif); font-size: 24px; opacity: .9; }
.pairing h1 { font-family: var(--serif); font-size: clamp(34px, 4vw, 52px); font-weight: 600; }
.pairing-lead { font-size: 20px; opacity: .9; }
.pairing-code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: clamp(54px, 9vw, 110px); font-weight: 700; letter-spacing: .08em; background: #fff; color: var(--violet); border-radius: 26px; padding: 14px 34px; box-shadow: 0 0 0 5px var(--gold); }
.pairing-ttl { width: min(420px, 80%); height: 6px; border-radius: 3px; background: rgba(255,255,255,.2); overflow: hidden; }
.pairing-ttl i { display: block; height: 100%; background: var(--gold); transition: width .5s linear; }
.pairing-steps { text-align: left; font-size: 19px; line-height: 1.5; display: flex; flex-direction: column; gap: 6px; padding-left: 1.4em; max-width: 620px; }
.pairing-state { font-size: 18px; background: rgba(255,255,255,.12); border-radius: 14px; padding: 10px 18px; }
.pairing.done .pairing-code { box-shadow: 0 0 0 5px #3BB273; }
.pairing-foot { opacity: .75; }
.pair-form { flex-basis: 100%; display: flex; flex-direction: column; gap: 6px; }
.pair-form .row { gap: 8px; flex-wrap: wrap; }
.mono-input { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; text-transform: uppercase; letter-spacing: .08em; max-width: 200px; }

/* v0.2.2 : veille de la tablette */
.borne-sleep { position: fixed; inset: 0; background: #000; z-index: 40; cursor: none; }
.sleep-clock { position: absolute; display: flex; flex-direction: column; gap: 6px; color: rgba(255,255,255,.28); transition: left 2s ease, top 2s ease; }
.sleep-clock .t { font-family: var(--serif); font-size: 64px; line-height: 1; }
.sleep-clock .h { font-size: 15px; }
