/* Carnet — note.optymapro.fr. Style « carnet de notes » iOS : papier, encre, une couleur d'accent par marque. */
:root {
  --bg: #F6F4EE;
  --bg-elev: #FFFFFF;
  --bg-sunken: #ECE9E1;
  --ink: #1C1B18;
  --ink-2: #5C5A53;
  --ink-3: #8E8B82;
  --line: rgba(28, 27, 24, 0.09);
  --line-strong: rgba(28, 27, 24, 0.16);
  --accent: #0A6CFF;
  --accent-soft: rgba(10, 108, 255, 0.10);
  --green: #1E9E5A;
  --green-soft: rgba(30, 158, 90, 0.12);
  --red: #E5484D;
  --red-soft: rgba(229, 72, 77, 0.10);
  --amber: #D97706;
  --amber-soft: rgba(217, 119, 6, 0.12);
  --shadow: 0 1px 2px rgba(28, 27, 24, 0.05), 0 8px 24px -12px rgba(28, 27, 24, 0.18);
  --shadow-float: 0 12px 32px -8px rgba(28, 27, 24, 0.35);
  --radius: 18px;
  --radius-sm: 12px;
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left, 0px);
  --sar: env(safe-area-inset-right, 0px);
  --brand-AZURMOVE: #0A6CFF;
  --brand-MYSPA06: #7C3AED;
  --brand-AZURSHINE: #0E93E8;
  --brand-YOOJO: #F59E0B;
  --brand-AUTRE: #6B7280;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141311;
    --bg-elev: #1F1E1B;
    --bg-sunken: #0E0D0C;
    --ink: #F2F0EA;
    --ink-2: #B5B2A9;
    --ink-3: #7E7B73;
    --line: rgba(242, 240, 234, 0.08);
    --line-strong: rgba(242, 240, 234, 0.16);
    --accent: #4D8DFF;
    --accent-soft: rgba(77, 141, 255, 0.16);
    --green: #34C77B;
    --green-soft: rgba(52, 199, 123, 0.16);
    --red: #FF6369;
    --red-soft: rgba(255, 99, 105, 0.16);
    --amber: #F5A524;
    --amber-soft: rgba(245, 165, 36, 0.16);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px -12px rgba(0, 0, 0, 0.6);
    --shadow-float: 0 12px 32px -8px rgba(0, 0, 0, 0.7);
    --brand-AZURMOVE: #4D8DFF;
    --brand-AZURSHINE: #38B0FF;
    --brand-MYSPA06: #A78BFA;
    --brand-YOOJO: #FBBF24;
    --brand-AUTRE: #9CA3AF;
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.35;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  overscroll-behavior-y: none;
  -webkit-user-select: none;
  user-select: none;
}
input, textarea, button, select { font: inherit; color: inherit; -webkit-appearance: none; appearance: none; border-radius: 0; }
input[type="search"]::-webkit-search-decoration, input[type="search"]::-webkit-search-cancel-button { -webkit-appearance: none; display: none; }
input[type="date"] { min-height: 40px; }
input[type="date"]::-webkit-date-and-time-value { text-align: left; }
input, textarea { -webkit-user-select: text; user-select: text; }
button { background: none; border: 0; padding: 0; margin: 0; cursor: pointer; color: inherit; }
a { color: var(--accent); text-decoration: none; }
[hidden] { display: none !important; }
::placeholder { color: var(--ink-3); }

#app { min-height: 100vh; min-height: 100dvh; }

/* ---------- Structure : un ou deux volets ---------- */
.shell { display: grid; grid-template-columns: 1fr; min-height: 100vh; min-height: 100dvh; }
.pane { min-height: 100vh; min-height: 100dvh; position: relative; }
.pane-list { background: var(--bg); }
.pane-detail { background: var(--bg); }
@media (min-width: 820px) {
  .shell { grid-template-columns: 400px 1fr; height: 100dvh; overflow: hidden; }
  .pane { height: 100dvh; overflow-y: auto; -webkit-overflow-scrolling: touch; }
  .pane-list { border-right: 1px solid var(--line); }
  .pane-detail { background: var(--bg-sunken); }
  .pane-detail .page { max-width: 760px; margin: 0 auto; }
  .fab { right: auto; left: 400px; margin-left: -80px; }
}

/* ---------- En-tête ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  padding: calc(var(--sat) + 8px) 16px 8px;
  background: var(--bg);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  display: flex; align-items: center; gap: 10px; min-height: calc(var(--sat) + 52px);
}
.topbar .back {
  display: inline-flex; align-items: center; gap: 2px; color: var(--accent); font-size: 17px;
  padding: 6px 8px 6px 0; margin-left: -4px;
}
.topbar .back svg { width: 22px; height: 22px; }
.topbar .title { flex: 1; text-align: center; font-weight: 600; font-size: 17px; opacity: 0; transition: opacity .2s; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar.compact .title { opacity: 1; }
.topbar .spacer { width: 64px; }
.topbar .action { color: var(--accent); font-size: 17px; padding: 6px 0; min-width: 64px; text-align: right; font-weight: 500; }
.topbar .action.icon { min-width: 0; display: inline-flex; padding: 6px; border-radius: 50%; }
.topbar .action svg { width: 24px; height: 24px; }

.hero { padding: 6px 20px 8px; }
.hero h1 { font-family: var(--font-display); font-size: 34px; font-weight: 800; letter-spacing: -0.5px; margin: 0; line-height: 1.1; }
.hero .sub { color: var(--ink-2); font-size: 15px; margin-top: 4px; }
.hero .sub b { color: var(--ink); font-weight: 600; }

/* ---------- Recherche ---------- */
.search { padding: 8px 16px 6px; position: sticky; top: calc(var(--sat) + 52px); z-index: 19; background: var(--bg); background: color-mix(in srgb, var(--bg) 82%, transparent); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px); }
.search .field {
  display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 12px;
  background: var(--bg-elev); border-radius: 14px; box-shadow: var(--shadow); border: 1px solid var(--line);
}
.search .field:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft), var(--shadow); }
.search svg { width: 20px; height: 20px; color: var(--ink-3); flex: none; }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font-size: 17px; height: 100%; }
.search .clear { width: 24px; height: 24px; border-radius: 50%; background: var(--ink-3); color: var(--bg-elev); display: inline-flex; align-items: center; justify-content: center; font-size: 14px; }

/* ---------- Puces de filtre ---------- */
.chips { display: flex; gap: 8px; padding: 6px 16px 10px; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px 0 10px;
  border-radius: 999px; background: var(--bg-elev); border: 1px solid var(--line); font-size: 14px; font-weight: 500; color: var(--ink-2);
  box-shadow: var(--shadow); transition: transform .12s, background .12s;
}
.chip:active { transform: scale(.96); }
.chip .n { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--bg-sunken); color: var(--ink-2); font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.chip.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.chip.on .n { background: rgba(255,255,255,.2); color: inherit; }
.chip.warn.on { background: var(--red); border-color: var(--red); color: #fff; }
.chip.call.on { background: var(--amber); border-color: var(--amber); color: #fff; }
.chip.ok.on { background: var(--green); border-color: var(--green); color: #fff; }

/* ---------- Liste ---------- */
.list { padding: 0 16px calc(var(--sab) + 110px); }
.section-h {
  position: sticky; top: calc(var(--sat) + 52px + 58px); z-index: 5;
  font-size: 13px; font-weight: 700; color: var(--ink-3); letter-spacing: .06em; text-transform: uppercase;
  padding: 14px 6px 6px; background: var(--bg);
}
.pane-list.nosearch .section-h { top: calc(var(--sat) + 52px); }
.group { background: var(--bg-elev); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; border: 1px solid var(--line); }
.row {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px 12px 14px; min-height: 68px;
  position: relative; text-align: left; width: 100%; transition: background .1s;
}
.row + .row::before { content: ""; position: absolute; left: 66px; right: 0; top: 0; height: 1px; background: var(--line); }
.row:active { background: var(--bg-sunken); }
.row.sel { background: var(--accent-soft); }
.avatar {
  flex: none; width: 42px; height: 42px; border-radius: 13px; display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 15px; color: #fff; letter-spacing: .02em;
  background: var(--brand-AUTRE);
}
.avatar.b-AZURMOVE { background: linear-gradient(145deg, var(--brand-AZURMOVE), #2E86FF); }
.avatar.b-MYSPA06 { background: linear-gradient(145deg, var(--brand-MYSPA06), #9F67FF); }
.avatar.b-AZURSHINE { background: linear-gradient(145deg, var(--brand-AZURSHINE), #45B4FF); }
.avatar.b-YOOJO { background: linear-gradient(145deg, var(--brand-YOOJO), #FBBF24); }
.avatar.b-AUTRE { background: linear-gradient(145deg, #6B7280, #9CA3AF); }
.row .mid { flex: 1; min-width: 0; overflow: hidden; display: flex; flex-direction: column; }
.row .name { display: block; font-weight: 600; font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .meta { display: block; color: var(--ink-2); font-size: 14px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .meta .dot { margin: 0 5px; color: var(--ink-3); }
.row .right { flex: none; display: flex; align-items: center; gap: 6px; }
.badges { display: inline-flex; gap: 3px; font-size: 20px; line-height: 1; letter-spacing: -2px; }
.badges span { display: inline-block; }
.row .chev { color: var(--ink-3); width: 18px; height: 18px; }
.row .rappel { position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--amber); }
.row .urgent { position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--red); }
mark { background: var(--amber-soft); color: inherit; border-radius: 3px; padding: 0 1px; }

.empty { text-align: center; color: var(--ink-2); padding: 60px 30px; font-size: 16px; }
.empty .big { font-size: 46px; margin-bottom: 10px; }
.illu { width: 120px; height: 120px; margin: 0 auto 8px; display: block; }
.illu .draw { stroke-dasharray: 60; stroke-dashoffset: 60; animation: draw 1.1s .2s ease forwards; }
.illu .float { animation: floaty 3s ease-in-out infinite; transform-origin: center; }
.empty b { color: var(--ink); }

/* ---------- Bouton flottant ---------- */
.fab {
  position: fixed; right: 20px; bottom: calc(var(--sab) + 22px); z-index: 30;
  width: 60px; height: 60px; border-radius: 20px; background: var(--ink); color: var(--bg);
  display: inline-flex; align-items: center; justify-content: center; box-shadow: var(--shadow-float);
  transition: transform .15s;
}
.fab:active { transform: scale(.93); }
.fab svg { width: 28px; height: 28px; }

/* ---------- Fiche ---------- */
.page { padding: 0 16px calc(var(--sab) + 40px); }
.card { background: var(--bg-elev); border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--line); margin-top: 14px; overflow: hidden; }
.card-h { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px 4px; font-size: 13px; font-weight: 700; color: var(--ink-3); letter-spacing: .06em; text-transform: uppercase; }
.card-h .link { font-size: 13px; letter-spacing: 0; text-transform: none; font-weight: 500; color: var(--accent); }

.head { padding: 18px 18px 14px; display: flex; gap: 14px; align-items: flex-start; }
.head .avatar { width: 56px; height: 56px; border-radius: 17px; font-size: 20px; }
.head .who { flex: 1; min-width: 0; }
.head .name { font-family: var(--font-display); font-size: 24px; font-weight: 800; letter-spacing: -0.4px; line-height: 1.15; word-break: break-word; }
.head .name-input { width: 100%; border: 0; outline: 0; background: transparent; font: inherit; font-family: var(--font-display); font-size: 24px; font-weight: 800; letter-spacing: -0.4px; padding: 0; }
.head .tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; align-items: center; }
.pill { display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 10px; border-radius: 8px; font-size: 13px; font-weight: 600; background: var(--bg-sunken); color: var(--ink-2); }
.pill.brand { color: #fff; }
.pill.brand.b-AZURMOVE { background: var(--brand-AZURMOVE); }
.pill.brand.b-MYSPA06 { background: var(--brand-MYSPA06); }
.pill.brand.b-AZURSHINE { background: var(--brand-AZURSHINE); }
.pill.brand.b-YOOJO { background: var(--brand-YOOJO); }
.pill.brand.b-AUTRE { background: var(--brand-AUTRE); }
.head .status { font-size: 26px; letter-spacing: -1px; line-height: 1; margin-top: 2px; }
.statusline { padding: 0 18px 14px; color: var(--ink-2); font-size: 14px; }
.statusline b { color: var(--ink); }

/* Actions rapides */
.actions { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; padding: 0 16px 16px; }
.act {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; height: 66px;
  border-radius: 14px; background: var(--bg-sunken); color: var(--accent); font-size: 12px; font-weight: 600; transition: transform .12s;
}
.act:active { transform: scale(.95); }
.act svg { width: 22px; height: 22px; }
.act.off { color: var(--ink-3); pointer-events: none; }
.act.wa { color: #1FAF54; }
.act.sms { color: #0E93E8; }

/* Check-list */
.checks { padding: 4px 0 6px; }
.check { display: flex; align-items: center; gap: 12px; padding: 11px 16px; width: 100%; text-align: left; position: relative; }
.check + .check::before { content: ""; position: absolute; left: 58px; right: 0; top: 0; height: 1px; background: var(--line); }
.check .ico { width: 30px; height: 30px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; font-size: 17px; background: var(--bg-sunken); flex: none; }
.check .lbl { flex: 1; font-size: 16px; }
.check .lbl small { display: block; color: var(--ink-3); font-size: 13px; }
.switch { flex: none; width: 50px; height: 30px; border-radius: 15px; background: var(--line-strong); position: relative; transition: background .18s; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 26px; height: 26px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.25); transition: transform .18s; }
.check.on .switch { background: var(--green); }
.check.on .switch::after { transform: translateX(20px); }
.check.warn.on .switch { background: var(--amber); }
.date-wrap { display: flex; align-items: center; gap: 10px; padding: 0 16px 12px 58px; animation: fade .2s; }
.date-wrap label { font-size: 13px; color: var(--ink-3); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.check .date, .date-wrap .date { border: 0; background: var(--bg-sunken); border-radius: 10px; padding: 8px 10px; font-size: 16px; color: var(--ink); outline: none; flex: 1; }

/* Champs d'information */
.fields { padding: 2px 0 6px; }
.field-row { display: flex; align-items: center; gap: 12px; padding: 10px 16px; position: relative; min-height: 50px; }
.field-row + .field-row::before { content: ""; position: absolute; left: 16px; right: 0; top: 0; height: 1px; background: var(--line); }
.field-row label { flex: none; width: 92px; font-size: 13px; color: var(--ink-3); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.field-row input, .field-row select { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font-size: 16px; padding: 4px 0; }
.field-row input:focus { color: var(--accent); }
.field-row .go { flex: none; color: var(--ink-3); display: inline-flex; padding: 4px; }
.field-row .go svg { width: 20px; height: 20px; }
.field-row select { -webkit-appearance: none; appearance: none; }

/* Bloc de notes libre */
.notes { padding: 6px 16px 12px; }
.notes textarea {
  width: 100%; min-height: 110px; border: 0; outline: 0; resize: none; background: transparent; font-size: 16px; line-height: 1.5;
  padding: 4px 0; display: block;
}

/* Journal */
.compose { display: flex; gap: 8px; padding: 6px 12px 12px; align-items: flex-end; }
.compose textarea { flex: 1; min-height: 44px; max-height: 160px; border: 1px solid var(--line-strong); border-radius: 14px; background: var(--bg); padding: 10px 12px; outline: 0; resize: none; font-size: 16px; line-height: 1.35; }
.compose textarea:focus { border-color: var(--accent); }
.compose .send { flex: none; width: 44px; height: 44px; border-radius: 14px; background: var(--ink); color: var(--bg); display: inline-flex; align-items: center; justify-content: center; }
.compose .send:disabled { opacity: .35; }
.compose .send svg { width: 20px; height: 20px; }
.timeline { padding: 0 16px 10px; }
.entry { position: relative; padding: 10px 0 12px 22px; }
.entry::before { content: ""; position: absolute; left: 6px; top: 0; bottom: 0; width: 2px; background: var(--line); }
.entry::after { content: ""; position: absolute; left: 2px; top: 18px; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); border: 2px solid var(--bg-elev); }
.entry.event::after { background: var(--ink-3); width: 8px; height: 8px; left: 3px; top: 19px; }
.entry:first-child::before { top: 18px; }
.entry:last-child::before { bottom: auto; height: 18px; }
.entry .when { font-size: 12px; color: var(--ink-3); font-weight: 600; display: flex; gap: 6px; align-items: center; }
.entry .when .who { color: var(--ink-2); }
.entry .body { margin-top: 3px; font-size: 16px; white-space: pre-wrap; word-break: break-word; -webkit-user-select: text; user-select: text; }
.entry.event .body { color: var(--ink-2); font-size: 14px; }
.entry .del { position: absolute; right: 0; top: 10px; color: var(--ink-3); font-size: 12px; padding: 4px 6px; opacity: 0; }
.entry:hover .del, .entry:active .del { opacity: 1; }

/* Échanges Messagerie Pro */
.msgs { padding: 4px 16px 12px; display: flex; flex-direction: column; gap: 6px; }
.bubble { max-width: 86%; padding: 8px 12px; border-radius: 16px; font-size: 15px; line-height: 1.35; position: relative; white-space: pre-wrap; word-break: break-word; }
.bubble.in { align-self: flex-start; background: var(--bg-sunken); border-bottom-left-radius: 5px; }
.bubble.out { align-self: flex-end; background: var(--accent); color: #fff; border-bottom-right-radius: 5px; }
.bubble.out.wa { background: #1FAF54; }
.bubble .b-meta { display: block; font-size: 11px; opacity: .7; margin-top: 3px; }
.msgs .note { color: var(--ink-3); font-size: 14px; text-align: center; padding: 8px; }

/* Pied de fiche */
.danger { display: flex; gap: 10px; padding: 18px 0 8px; }
.danger button { flex: 1; height: 46px; border-radius: 14px; font-weight: 600; font-size: 15px; background: var(--bg-elev); border: 1px solid var(--line); box-shadow: var(--shadow); color: var(--ink-2); }
.danger button.red { color: var(--red); }
.danger button svg { width: 18px; height: 18px; vertical-align: -4px; margin-right: 4px; }
.hint { color: var(--ink-3); font-size: 13px; text-align: center; padding: 6px 0 0; }

/* ---------- Feuille « nouveau dossier » ---------- */
.sheet-bg { position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 40; -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); animation: fade .18s; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 41; background: var(--bg); border-radius: 22px 22px 0 0;
  padding: 10px 16px calc(var(--sab) + 16px); box-shadow: var(--shadow-float); animation: up .24s cubic-bezier(.2,.8,.2,1);
  max-height: 92dvh; overflow-y: auto;
}
@media (min-width: 820px) { .sheet { left: 50%; right: auto; bottom: auto; top: 50%; transform: translate(-50%, -50%); width: 520px; border-radius: 22px; animation: fade .18s; } }
.sheet .grab { width: 40px; height: 5px; border-radius: 3px; background: var(--line-strong); margin: 0 auto 10px; }
.sheet h2 { margin: 6px 0 12px; font-family: var(--font-display); font-size: 22px; font-weight: 800; letter-spacing: -0.3px; }
.sheet .group { margin-bottom: 12px; }
.sheet .sugg { background: var(--bg-elev); border-radius: var(--radius-sm); border: 1px solid var(--line); box-shadow: var(--shadow); margin: -6px 0 12px; overflow: hidden; }
.sheet .sugg button { display: flex; width: 100%; text-align: left; align-items: center; gap: 10px; padding: 10px 12px; font-size: 15px; }
.sheet .sugg button + button { border-top: 1px solid var(--line); }
.sheet .sugg .s-main { flex: 1; min-width: 0; }
.sheet .sugg .s-main b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sheet .sugg .s-main small { color: var(--ink-2); }
.sheet .sugg .tag { font-size: 11px; font-weight: 700; color: var(--ink-3); text-transform: uppercase; }
.brandpick { display: flex; gap: 8px; flex-wrap: wrap; padding: 4px 0 14px; }
.brandpick button { height: 36px; padding: 0 14px; border-radius: 999px; background: var(--bg-elev); border: 1px solid var(--line); font-weight: 600; font-size: 14px; color: var(--ink-2); }
.brandpick button.on { color: #fff; border-color: transparent; }
.brandpick button.on.b-AZURMOVE { background: var(--brand-AZURMOVE); }
.brandpick button.on.b-MYSPA06 { background: var(--brand-MYSPA06); }
.brandpick button.on.b-AZURSHINE { background: var(--brand-AZURSHINE); }
.brandpick button.on.b-YOOJO { background: var(--brand-YOOJO); }
.brandpick button.on.b-AUTRE { background: var(--brand-AUTRE); }
.btn-primary { width: 100%; height: 52px; border-radius: 16px; background: var(--ink); color: var(--bg); font-weight: 700; font-size: 17px; }
.btn-primary:disabled { opacity: .4; }
.btn-ghost { width: 100%; height: 44px; border-radius: 14px; color: var(--ink-2); font-weight: 600; margin-top: 4px; }

/* ---------- Connexion ---------- */
.login { min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: calc(var(--sat) + 30px) 24px calc(var(--sab) + 30px); text-align: center; }
.login .logo { width: 72px; height: 72px; border-radius: 22px; background: var(--ink); color: var(--bg); display: inline-flex; align-items: center; justify-content: center; box-shadow: var(--shadow-float); margin-bottom: 18px; }
.login .logo svg { width: 46px; height: 46px; }
.login h1 { font-family: var(--font-display); font-size: 30px; font-weight: 800; letter-spacing: -0.5px; margin: 0 0 4px; }
.login .sub { color: var(--ink-2); margin-bottom: 26px; }
.users { display: flex; gap: 12px; justify-content: center; margin-bottom: 26px; flex-wrap: wrap; }
.users button { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 16px; border-radius: 18px; background: var(--bg-elev); border: 2px solid var(--line); box-shadow: var(--shadow); min-width: 110px; font-weight: 600; }
.users button.on { border-color: var(--ink); }
.users .avatar { width: 48px; height: 48px; border-radius: 15px; font-size: 18px; }
.pin-dots { display: flex; gap: 14px; justify-content: center; margin-bottom: 22px; height: 16px; }
.pin-dots i { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--ink-3); display: block; transition: background .1s, transform .1s; }
.pin-dots i.on { background: var(--ink); border-color: var(--ink); transform: scale(1.1); }
.pin-dots.err i { border-color: var(--red); background: var(--red-soft); animation: shake .35s; }
.pad { display: grid; grid-template-columns: repeat(3, 68px); gap: 12px; justify-content: center; }
.pad button { width: 68px; height: 68px; border-radius: 50%; background: var(--bg-elev); border: 1px solid var(--line); box-shadow: var(--shadow); font-size: 28px; font-weight: 500; transition: transform .1s, background .1s; }
.pad button:active { transform: scale(.94); background: var(--bg-sunken); }
.pad button.ghost { background: transparent; border: 0; box-shadow: none; font-size: 15px; color: var(--ink-2); }
.login .err { color: var(--red); min-height: 22px; margin-top: 16px; font-weight: 500; }
.install { margin-top: 26px; background: var(--bg-elev); border-radius: var(--radius); border: 1px solid var(--line); padding: 14px 16px; font-size: 14px; color: var(--ink-2); text-align: left; max-width: 360px; }
.install b { color: var(--ink); }
.install svg { width: 18px; height: 18px; vertical-align: -4px; color: var(--accent); }

/* ---------- Divers ---------- */
.toast { position: fixed; left: 50%; bottom: calc(var(--sab) + 96px); transform: translateX(-50%); z-index: 60; background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 14px; font-size: 15px; font-weight: 500; box-shadow: var(--shadow-float); max-width: 90vw; text-align: center; animation: up .2s; }
.toast.err { background: var(--red); color: #fff; }
.offline-bar { position: sticky; top: 0; z-index: 25; background: var(--amber); color: #fff; font-size: 13px; font-weight: 600; text-align: center; padding: calc(var(--sat) + 4px) 8px 4px; }
.skeleton { height: 68px; border-radius: var(--radius); background: linear-gradient(90deg, var(--bg-elev), var(--bg-sunken), var(--bg-elev)); background-size: 200% 100%; animation: shimmer 1.2s infinite; margin-top: 10px; }
.menu-bg { position: fixed; inset: 0; z-index: 40; background: rgba(0,0,0,.25); animation: fade .15s; }
.menu { position: fixed; z-index: 41; right: 16px; top: calc(var(--sat) + 52px); background: var(--bg-elev); border-radius: 16px; box-shadow: var(--shadow-float); border: 1px solid var(--line); min-width: 230px; overflow: hidden; animation: fade .15s; }
.menu button { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 13px 16px; font-size: 16px; }
.menu button + button, .menu a + button, .menu a button { border-top: 1px solid var(--line); }
.menu a { color: inherit; display: block; }
.menu button.red { color: var(--red); }
.menu button svg { width: 20px; height: 20px; color: var(--ink-3); }
.menu .who { padding: 10px 16px; font-size: 13px; color: var(--ink-3); border-bottom: 1px solid var(--line); }

@keyframes up { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (min-width: 820px) { @keyframes up { from { opacity: 0; } to { opacity: 1; } } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes shake { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ---------- v2 : animations, frise, carte Aujourd'hui ---------- */
.row.in { animation: rowin .42s cubic-bezier(.2,.8,.2,1) both; animation-delay: calc(var(--i, 0) * 28ms); }
@keyframes rowin { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.pane-detail.enter-fwd { animation: slidein .32s cubic-bezier(.2,.8,.2,1); }
.pane-list.enter-back { animation: slideback .28s cubic-bezier(.2,.8,.2,1); }
@keyframes slidein { from { transform: translateX(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes slideback { from { transform: translateX(-24px); opacity: 0; } to { transform: none; opacity: 1; } }
.card { animation: cardin .35s cubic-bezier(.2,.8,.2,1) both; }
.card:nth-child(2) { animation-delay: .04s; } .card:nth-child(3) { animation-delay: .08s; } .card:nth-child(4) { animation-delay: .12s; } .card:nth-child(5) { animation-delay: .16s; } .card:nth-child(6) { animation-delay: .2s; }
@keyframes cardin { from { opacity: 0; transform: translateY(12px) scale(.985); } to { opacity: 1; transform: none; } }
.head .status.pop { animation: pop .45s cubic-bezier(.2,1.4,.3,1); }
@keyframes pop { 0% { transform: scale(.6); } 60% { transform: scale(1.25); } 100% { transform: scale(1); } }
.switch { transition: background .22s; }
.switch::after { transition: transform .32s cubic-bezier(.2,1.3,.3,1), width .15s; }
.check:active .switch::after { width: 32px; }
.check.on:active .switch::after { transform: translateX(14px); }
.chip { transition: transform .12s, background .18s, color .18s, border-color .18s; }
.fab { transition: transform .18s cubic-bezier(.2,1.3,.3,1), box-shadow .18s; }
.fab:active { transform: scale(.88) rotate(90deg); }
.act { transition: transform .12s, background .15s; }
.act:active { background: var(--accent-soft); }
.pin-dots i.on { animation: dotin .18s cubic-bezier(.2,1.4,.3,1); }
@keyframes dotin { from { transform: scale(.4); } to { transform: scale(1.1); } }
.login .logo { animation: logoin .6s cubic-bezier(.2,1.2,.3,1); }
.login .logo svg path { stroke-dasharray: 90; stroke-dashoffset: 90; animation: draw 1s .25s ease forwards; }
@keyframes logoin { from { transform: scale(.6) rotate(-8deg); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes floaty { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
.entry { animation: fade .3s both; }
.bubble { animation: rowin .35s both; }

/* Frise d'avancement (SVG) */
.stepper { display: block; width: 100%; height: auto; padding: 2px 10px 6px; overflow: visible; }
.stepper .track { stroke: var(--line-strong); stroke-width: 3; stroke-linecap: round; }
.stepper .progress { stroke: var(--green); stroke-width: 3; stroke-linecap: round; stroke-dasharray: 320; transition: stroke-dashoffset .6s cubic-bezier(.2,.8,.2,1); }
.stepper .halo { fill: var(--green); opacity: 0; transform-origin: center; transform-box: fill-box; }
.stepper .step.next .halo { animation: halo 2s ease-out infinite; }
@keyframes halo { 0% { opacity: .35; transform: scale(.6); } 100% { opacity: 0; transform: scale(1.4); } }
.stepper .dot { fill: var(--bg-elev); stroke: var(--line-strong); stroke-width: 2.5; transition: fill .3s, stroke .3s; }
.stepper .step.done .dot { fill: var(--green); stroke: var(--green); }
.stepper .step.next .dot { stroke: var(--green); stroke-dasharray: 3 3; }
.stepper .tick { fill: none; stroke: #fff; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 16; stroke-dashoffset: 16; transition: stroke-dashoffset .35s .15s ease; }
.stepper .step.done .tick { stroke-dashoffset: 0; }
.stepper text { font: 600 11px var(--font); fill: var(--ink-3); letter-spacing: .02em; transition: fill .3s; }
.stepper .step.done text { fill: var(--ink); }
.stepper .step.next text { fill: var(--green); }

/* Carte Aujourd'hui */
.today { margin-top: 10px; border-radius: var(--radius); background: var(--bg-elev); border: 1px solid var(--line); box-shadow: var(--shadow); overflow: hidden; animation: cardin .4s both; }
.today-h { display: flex; align-items: center; gap: 8px; padding: 12px 16px 6px; font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--amber); }
.today-h svg { width: 18px; height: 18px; }
.today-h span { margin-left: auto; background: var(--amber-soft); color: var(--amber); border-radius: 10px; min-width: 22px; height: 22px; padding: 0 7px; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; }
.today-row { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 10px 14px 10px 16px; position: relative; min-height: 56px; }
.today-row + .today-row::before { content: ""; position: absolute; left: 60px; right: 0; top: 0; height: 1px; background: var(--line); }
.today-row:active { background: var(--bg-sunken); }
.today-row .t-ico { flex: none; width: 34px; height: 34px; border-radius: 10px; background: var(--amber-soft); display: inline-flex; align-items: center; justify-content: center; font-size: 17px; }
.today-row.mission .t-ico { background: var(--accent-soft); }
.today-row.late .t-ico { background: var(--red-soft); }
.today-row .t-mid { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.today-row .t-mid b { font-size: 16px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.today-row .t-mid small { color: var(--ink-2); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.today-row.late .t-mid small { color: var(--red); font-weight: 600; }
.today-row .chev { color: var(--ink-3); width: 18px; height: 18px; flex: none; }

/* iPad paysage / grands écrans : fiche plus aérée */
@media (min-width: 1100px) { .shell { grid-template-columns: 440px 1fr; } .fab { left: 440px; } .pane-detail .page { max-width: 820px; } }
/* Petits iPhone (SE) */
@media (max-width: 380px) { .hero h1 { font-size: 30px; } .actions { gap: 6px; } .act { font-size: 11px; height: 60px; } .pad { grid-template-columns: repeat(3, 62px); gap: 10px; } .pad button { width: 62px; height: 62px; font-size: 24px; } }
/* Paysage iPhone : on garde tout visible */
@media (max-height: 450px) and (orientation: landscape) { .login { justify-content: flex-start; } .login .logo { display: none; } .pad { grid-template-columns: repeat(3, 56px); gap: 8px; } .pad button { width: 56px; height: 56px; font-size: 20px; } .install { display: none; } }
