/* C3R Tâches — interface (aucune ressource externe) */
:root {
  --navy: #262d4e; --navy-2: #323b66; --blue: #3a5bb5; --sky: #6e93db; --sky-l: #e8eefb;
  --bg: #f3f5fa; --surface: #ffffff; --surface-2: #f7f8fc; --text: #1b2238; --muted: #6a7389; --faint: #9aa2b5;
  --line: #e4e8f1; --line-2: #eef1f7;
  --primary: var(--navy); --on-primary: #fff; --accent: var(--blue);
  --danger: #d23c3c; --danger-bg: #fdecec; --ok: #1f9d55; --ok-bg: #e6f6ed; --warn: #c27a00; --warn-bg: #fff4dc;
  --radius: 14px; --radius-s: 10px;
  --shadow-1: 0 1px 2px rgba(23, 32, 66, .06), 0 1px 3px rgba(23, 32, 66, .05);
  --shadow-2: 0 4px 12px rgba(23, 32, 66, .08), 0 1px 3px rgba(23, 32, 66, .06);
  --shadow-3: 0 18px 50px rgba(23, 32, 66, .22);
  --safe-b: env(safe-area-inset-bottom, 0px); --safe-t: env(safe-area-inset-top, 0px);
  --sidebar: 256px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1220; --surface: #181c2e; --surface-2: #1d2236; --text: #e6e9f2; --muted: #9aa3ba; --faint: #6d7690;
    --line: #2a3048; --line-2: #22283d; --sky-l: #22305a;
    --primary: #8fb0f0; --on-primary: #0f1220; --accent: #8fb0f0;
    --danger-bg: #3a1c22; --ok-bg: #173327; --warn-bg: #3a2c10;
    --shadow-1: none; --shadow-2: 0 4px 14px rgba(0, 0, 0, .3); --shadow-3: 0 18px 50px rgba(0, 0, 0, .5);
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); overflow-x: clip; }
body { font: 15px/1.5 "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", sans-serif;
  -webkit-text-size-adjust: 100%; -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
svg.i { width: 20px; height: 20px; flex: 0 0 auto; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
svg.i.s { width: 16px; height: 16px; }
svg.i.l { width: 24px; height: 24px; }
.boot { text-align: center; margin-top: 30vh; color: var(--muted); }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.spacer { flex: 1; }

/* ================================================================== structure */
.app { min-height: 100vh; }
.page { min-width: 0; }
.sidebar { display: none; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 10px;
  padding: calc(10px + var(--safe-t)) 16px 10px; background: rgba(243, 245, 250, .88); backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px); border-bottom: 1px solid var(--line); }
@media (prefers-color-scheme: dark) { .topbar { background: rgba(15, 18, 32, .85); } }
.topbar .brand { display: flex; align-items: center; gap: 8px; font-weight: 700; letter-spacing: .01em; }
.topbar .brand img { height: 26px; width: auto; }
.topbar h1 { font-size: 1.05rem; margin: 0; font-weight: 700; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.content { padding: 14px 14px calc(100px + var(--safe-b)); max-width: 1500px; margin: 0 auto; }

.sync { display: inline-flex; align-items: center; gap: 6px; font-size: .78rem; font-weight: 600; padding: 4px 10px; border-radius: 99px;
  background: var(--ok-bg); color: var(--ok); white-space: nowrap; }
.sync::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.sync.warn { background: var(--warn-bg); color: var(--warn); }

/* barre d'onglets mobile */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex; align-items: flex-end;
  background: rgba(255, 255, 255, .94); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--line); padding: 6px 4px calc(6px + var(--safe-b)); }
@media (prefers-color-scheme: dark) { .tabbar { background: rgba(24, 28, 46, .94); } }
.tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px 0; font-size: .7rem; font-weight: 600; color: var(--faint); }
.tabbar a svg.i { width: 23px; height: 23px; }
.tabbar a.active { color: var(--accent); }
.tabbar a.fab span.f { width: 54px; height: 54px; margin-top: -26px; border-radius: 18px; display: grid; place-items: center;
  background: linear-gradient(145deg, var(--blue), var(--navy)); color: #fff; box-shadow: 0 8px 18px rgba(38, 45, 78, .35); }
.tabbar a.fab svg.i { width: 26px; height: 26px; stroke-width: 2.4; }

/* ================================================================== bureau */
@media (min-width: 1024px) {
  /* la barre latérale reste fixe ; seule la partie droite défile */
  .app { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); height: 100vh; height: 100dvh; overflow: hidden; }
  .page { height: 100%; overflow-y: auto; overscroll-behavior: contain; }
  .tabbar { display: none; }
  .sidebar { display: flex; flex-direction: column; height: 100%; overflow-y: auto; padding: 22px 14px 16px;
    background: linear-gradient(180deg, #232a4a 0%, #1c2240 100%); color: #cfd6ea; }
  .sidebar .logo { display: flex; align-items: center; gap: 10px; padding: 0 8px 22px; }
  .sidebar .logo img { height: 34px; }
  .sidebar .logo b { color: #fff; font-size: 1.05rem; letter-spacing: .02em; }
  .sidebar .new { margin: 0 4px 18px; }
  .sidebar nav { display: flex; flex-direction: column; gap: 2px; }
  .sidebar nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; font-weight: 500; color: #b9c2dc; transition: background .15s, color .15s; }
  .sidebar nav a:hover { background: rgba(255, 255, 255, .06); color: #fff; }
  .sidebar nav a.active { background: rgba(110, 147, 219, .18); color: #fff; }
  .sidebar nav a .count { margin-left: auto; font-size: .75rem; background: rgba(255, 255, 255, .1); padding: 1px 8px; border-radius: 99px; }
  .sidebar .me { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 12px 8px 0; border-top: 1px solid rgba(255, 255, 255, .08); }
  .sidebar .me .name { color: #fff; font-weight: 600; font-size: .9rem; }
  .sidebar .sync { background: rgba(31, 157, 85, .18); color: #6fd59c; }
  .sidebar .sync.warn { background: rgba(194, 122, 0, .2); color: #ffc65c; }
  .topbar { padding: 16px 28px; background: rgba(243, 245, 250, .9); }
  .topbar .brand, .topbar .sync { display: none; }
  .topbar h1 { font-size: 1.35rem; }
  .content { padding: 22px 28px 40px; }
}

/* ================================================================== composants */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-1); padding: 18px; }
.card + .card { margin-top: 14px; }
.card h3 { margin: 0 0 4px; font-size: 1rem; display: flex; align-items: center; gap: 8px; }
.card .sub { margin: 0 0 14px; color: var(--muted); font-size: .86rem; }
.section-title { display: flex; align-items: center; gap: 8px; font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 22px 2px 10px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 9px 16px; border-radius: var(--radius-s);
  border: 1px solid var(--line); background: var(--surface); font-weight: 600; font-size: .92rem; cursor: pointer; transition: background .15s, border-color .15s, transform .05s, box-shadow .15s; }
.btn:hover { background: var(--surface-2); border-color: #d4dae8; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: linear-gradient(145deg, var(--blue), var(--navy)); color: #fff; border-color: transparent; box-shadow: 0 4px 12px rgba(38, 45, 78, .25); }
.btn.primary:hover { filter: brightness(1.08); }
@media (prefers-color-scheme: dark) { .btn.primary { background: linear-gradient(145deg, #4d72cf, #3a5bb5); } }
.btn.danger { color: var(--danger); border-color: transparent; background: var(--danger-bg); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--line-2); }
.btn.block { width: 100%; }
.btn.sm { min-height: 34px; padding: 5px 11px; font-size: .84rem; border-radius: 9px; }
.btn.icon { padding: 0; width: 40px; min-height: 40px; }
.btn.icon.sm { width: 34px; min-height: 34px; }
.btn:disabled { opacity: .45; cursor: default; transform: none; }
.sidebar .btn.primary { width: 100%; background: linear-gradient(145deg, #5b80d6, #3a5bb5); box-shadow: 0 6px 16px rgba(0, 0, 0, .25); }

label.field { display: block; margin: 16px 0 6px; font-weight: 600; font-size: .84rem; color: var(--muted); }
label.field:first-child { margin-top: 0; }
input[type=text], input[type=email], input[type=password], input[type=search], select, textarea {
  width: 100%; padding: 11px 13px; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--surface);
  font-size: 16px; transition: border-color .15s, box-shadow .15s; }
@media (min-width: 1024px) { input[type=text], input[type=email], input[type=password], input[type=search], select, textarea { font-size: .95rem; } }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--sky); box-shadow: 0 0 0 4px rgba(110, 147, 219, .2); }
button:focus-visible, a:focus-visible { outline: 3px solid rgba(110, 147, 219, .55); outline-offset: 2px; }
textarea { min-height: 120px; resize: vertical; }
.search { position: relative; }
.search svg.i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--faint); }
.search input { padding-left: 40px; }
.check { display: flex; gap: 10px; align-items: center; margin: 14px 0 0; font-size: .92rem; cursor: pointer; }
.check input { width: 19px; height: 19px; accent-color: var(--blue); }

.seg { display: inline-flex; background: var(--line-2); border-radius: 11px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: transparent; padding: 7px 14px; border-radius: 8px; font-weight: 600; font-size: .86rem; color: var(--muted); cursor: pointer; white-space: nowrap; }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-1); }
.chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 2px; }
.chips::-webkit-scrollbar { display: none; }
.chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--surface); border-radius: 99px;
  padding: 6px 13px; font-size: .84rem; font-weight: 600; color: var(--muted); white-space: nowrap; cursor: pointer; }
.chip.on { background: var(--navy); border-color: var(--navy); color: #fff; }
@media (prefers-color-scheme: dark) { .chip.on { background: var(--primary); border-color: var(--primary); color: var(--on-primary); } }

.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar .search { flex: 1 1 220px; }
.toolbar select { width: auto; min-width: 0; flex: 1 1 170px; max-width: 260px; }
@media (max-width: 1023px) { .toolbar .search { flex-basis: 100%; } .toolbar select { max-width: none; } }

.dot { width: 10px; height: 10px; border-radius: 50%; flex: 0 0 10px; display: inline-block; }
.avatar { width: 26px; height: 26px; border-radius: 50%; display: inline-grid; place-items: center; font-size: .68rem; font-weight: 700; color: #fff; flex: 0 0 26px; letter-spacing: .02em; }
.avatar.l { width: 36px; height: 36px; flex-basis: 36px; font-size: .82rem; }
.tag { display: inline-flex; align-items: center; gap: 4px; font-size: .74rem; font-weight: 600; padding: 2px 8px; border-radius: 99px; background: var(--line-2); color: var(--muted); white-space: nowrap; }
.tag.warn { background: var(--warn-bg); color: var(--warn); }
.tag.err { background: var(--danger-bg); color: var(--danger); }
.tag.ok { background: var(--ok-bg); color: var(--ok); }
.tag.blue { background: var(--sky-l); color: var(--blue); }
@media (prefers-color-scheme: dark) { .tag.blue { color: #a9c1f5; } }

/* barre de progression */
.progress { display: flex; align-items: center; gap: 8px; }
.progress .track { flex: 1; height: 6px; border-radius: 99px; background: var(--line-2); overflow: hidden; }
.progress .fill { height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--sky), var(--blue)); transition: width .3s; }
.progress .pct { font-size: .75rem; font-weight: 700; color: var(--muted); min-width: 34px; text-align: right; font-variant-numeric: tabular-nums; }
.range-wrap { display: flex; align-items: center; gap: 14px; }
input[type=range] { flex: 1; accent-color: var(--blue); height: 28px; }
.range-wrap output { font-weight: 800; font-size: 1.15rem; min-width: 54px; text-align: right; font-variant-numeric: tabular-nums; color: var(--blue); }

/* ================================================================== statistiques */
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 16px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow-1); display: flex; gap: 12px; align-items: center; cursor: pointer; transition: box-shadow .15s, transform .15s; }
.stat:hover { box-shadow: var(--shadow-2); transform: translateY(-1px); }
.stat .ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--sky-l); color: var(--blue); flex: 0 0 40px; }
.stat .v { font-size: 1.45rem; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat .l { font-size: .78rem; color: var(--muted); font-weight: 600; }
@media (max-width: 1023px) { .stats { display: none; } }
@media (min-width: 1024px) { .stats { grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 20px; } }

/* ================================================================== cartes d'éléments */
.item { position: relative; display: flex; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-1); padding: 13px 12px 13px 16px; margin-bottom: 8px; cursor: pointer; transition: box-shadow .15s, transform .15s, border-color .15s; overflow: hidden; }
.item::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--c, var(--line)); }
.item:hover { box-shadow: var(--shadow-2); border-color: #d6dcea; }
.item.sel { border-color: var(--sky); box-shadow: 0 0 0 3px rgba(110, 147, 219, .25); }
.item .body { flex: 1; min-width: 0; }
.item .title { font-weight: 650; overflow-wrap: anywhere; line-height: 1.35; }
.item.done .title { text-decoration: line-through; color: var(--faint); }
.item .meta { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; margin-top: 6px; font-size: .8rem; color: var(--muted); }
.item .meta .m { display: inline-flex; align-items: center; gap: 4px; }
.item .progress { margin-top: 9px; }
.item .side { display: flex; flex-direction: column; align-items: flex-end; justify-content: space-between; gap: 8px; }
.tick { width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--line); background: var(--surface); display: grid; place-items: center; cursor: pointer; color: transparent; transition: all .15s; flex: 0 0 30px; }
.tick:hover { border-color: var(--ok); color: var(--ok); }
.tick.on { background: var(--ok); border-color: var(--ok); color: #fff; }
.tick svg.i { width: 16px; height: 16px; stroke-width: 3; }

.group { margin-bottom: 8px; }
.group-h { display: flex; align-items: center; gap: 9px; margin: 18px 2px 10px; font-weight: 700; font-size: .95rem; }
.group-h .n { font-size: .75rem; font-weight: 700; color: var(--muted); background: var(--line-2); padding: 1px 8px; border-radius: 99px; }
.empty { text-align: center; color: var(--muted); padding: 48px 16px; }
.empty svg.i { width: 44px; height: 44px; color: var(--faint); stroke-width: 1.4; margin-bottom: 8px; }
.notice { display: flex; gap: 10px; align-items: flex-start; background: var(--warn-bg); color: var(--warn); border-radius: var(--radius-s); padding: 11px 14px; font-size: .88rem; font-weight: 500; margin-bottom: 12px; }

/* tableau Kanban (bureau) */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(290px, 1fr); gap: 16px; overflow-x: auto; padding-bottom: 10px; align-items: start; }
.col { background: var(--surface-2); border: 1px solid var(--line); border-radius: 16px; padding: 12px; min-height: 140px; }
@media (prefers-color-scheme: dark) { .col { background: #141829; } }
.col-h { display: flex; align-items: center; gap: 9px; font-weight: 700; padding: 2px 4px 12px; }
.col-h .n { margin-left: auto; font-size: .75rem; color: var(--muted); background: var(--surface); border: 1px solid var(--line); padding: 1px 9px; border-radius: 99px; }
.col .item { margin-bottom: 10px; }
.col .empty-col { color: var(--faint); font-size: .85rem; text-align: center; padding: 18px 0; }
.clients-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; align-items: start; }
.clients-grid .col .item:last-child { margin-bottom: 0; }

/* ================================================================== détail & formulaire */
.detail h2 { font-size: 1.3rem; margin: 6px 0 4px; line-height: 1.3; overflow-wrap: anywhere; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 10px 16px; font-size: .9rem; margin: 16px 0; align-items: center; }
.kv dt { color: var(--muted); font-weight: 600; font-size: .82rem; }
.kv dd { margin: 0; overflow-wrap: anywhere; display: flex; align-items: center; gap: 8px; }
.body-text { white-space: pre-wrap; overflow-wrap: anywhere; background: var(--surface-2); border: 1px solid var(--line-2); border-radius: var(--radius-s); padding: 12px 14px; line-height: 1.55; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 18px; }
.prio { display: flex; flex-wrap: wrap; gap: 8px; }
.prio button { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border: 1.5px solid var(--line); border-radius: 99px; background: var(--surface); cursor: pointer; font-weight: 600; font-size: .88rem; }
.prio button.on { border-color: var(--c); background: color-mix(in srgb, var(--c) 12%, var(--surface)); }
.photo-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; margin-top: 10px; }
.photos .ph { position: relative; aspect-ratio: 1; border-radius: 12px; overflow: hidden; background: var(--line-2); }
.photos img { width: 100%; height: 100%; object-fit: cover; display: block; cursor: zoom-in; transition: transform .2s; }
.photos img:hover { transform: scale(1.04); }
.photos .rm { position: absolute; top: 5px; right: 5px; width: 28px; height: 28px; border-radius: 50%; border: 0; background: rgba(0, 0, 0, .6); color: #fff; display: grid; place-items: center; cursor: pointer; }
.photos .rm svg.i { width: 14px; height: 14px; stroke-width: 2.6; }
.viewer { position: fixed; inset: 0; z-index: 90; background: rgba(8, 10, 20, .92); display: grid; place-items: center; cursor: zoom-out; }
.viewer img { max-width: 96vw; max-height: 92vh; border-radius: 8px; }
.viewer button { position: absolute; top: calc(14px + var(--safe-t)); right: 14px; color: #fff; background: rgba(255, 255, 255, .12); border: 0; }
.form-foot { display: flex; gap: 10px; margin-top: 22px; }
.form-foot .btn { flex: 1; }

/* panneau latéral (bureau) */
.drawer-bg { position: fixed; inset: 0; z-index: 60; background: rgba(16, 20, 40, .32); animation: fade .15s; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; z-index: 61; width: min(560px, 100vw); background: var(--surface); box-shadow: var(--shadow-3);
  display: flex; flex-direction: column; animation: slide .2s ease-out; }
.drawer-h { display: flex; align-items: center; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.drawer-h b { flex: 1; font-size: 1.02rem; }
.drawer-c { padding: 20px 24px 30px; overflow-y: auto; flex: 1; }
@keyframes slide { from { transform: translateX(40px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }

/* ================================================================== export */
table.list { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-1); }
table.list td, table.list th { padding: 11px 14px; border-bottom: 1px solid var(--line-2); text-align: left; vertical-align: middle; font-size: .9rem; }
table.list tr:last-child td { border-bottom: 0; }
table.list th { font-size: .74rem; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .05em; background: var(--surface-2); }
table.list tbody tr { cursor: pointer; }
table.list tbody tr:hover td { background: var(--surface-2); }
table.list td.c { width: 44px; }
table.list input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--blue); }
.table-wrap { overflow-x: auto; }
.export-bar { position: sticky; bottom: calc(76px + var(--safe-b)); z-index: 5; display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; box-shadow: var(--shadow-2); margin-top: 14px; }
@media (min-width: 1024px) { .export-bar { bottom: 16px; } }
.filters { display: grid; grid-template-columns: 1fr; gap: 10px; }
@media (min-width: 700px) { .filters { grid-template-columns: repeat(3, 1fr); } }

/* ================================================================== réglages */
.settings { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-items: start; }
.card { min-width: 0; }
.settings .card + .card { margin-top: 0; }
@media (min-width: 1100px) { .settings { grid-template-columns: repeat(2, minmax(0, 1fr)); } .settings .wide { grid-column: 1 / -1; } }
.line { display: flex; align-items: center; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--line-2); }
.line:last-child { border-bottom: 0; }
.line input[type=color] { width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 10px; padding: 3px; background: var(--surface); flex: 0 0 40px; cursor: pointer; }
.line input[type=text], .line input[type=email] { flex: 1 1 80px; min-width: 0; width: auto; }
.line .btn { flex: 0 0 auto; }
.line .info { flex: 1; min-width: 0; }
.line.wrap { flex-wrap: wrap; }
.line.wrap .info { flex: 1 1 200px; }
.line .info b { display: block; }
.line .info span { font-size: .8rem; color: var(--muted); }
details summary { cursor: pointer; font-weight: 700; list-style: none; display: flex; align-items: center; gap: 8px; }
details summary::-webkit-details-marker { display: none; }

/* ================================================================== authentification */
.auth { min-height: 100vh; display: grid; }
.auth .panel { display: none; }
.auth .main { display: flex; align-items: flex-start; justify-content: center; padding: calc(40px + var(--safe-t)) 18px 40px; }
.auth .box { width: 100%; max-width: 410px; }
.auth .box > img { display: block; height: 58px; margin: 6px auto 26px; }
.auth h2 { margin: 0 0 6px; font-size: 1.35rem; }
.auth .lead { margin: 0 0 18px; color: var(--muted); }
@media (min-width: 960px) {
  .auth { grid-template-columns: 1.05fr 1fr; }
  .auth .panel { display: flex; flex-direction: column; justify-content: space-between; padding: 48px; color: #d9e0f3;
    background: radial-gradient(1200px 600px at -10% -10%, #3f5db0 0%, transparent 60%), linear-gradient(160deg, #262d4e, #171c36); }
  .auth .panel img { height: 64px; align-self: flex-start; background: rgba(255, 255, 255, .95); border-radius: 18px; padding: 10px 14px; }
  .auth .panel h1 { color: #fff; font-size: 2.1rem; line-height: 1.2; margin: 0 0 12px; max-width: 460px; }
  .auth .panel p { max-width: 440px; color: #b8c2e0; margin: 0; }
  .auth .main { align-items: center; }
  .auth .box > img { display: none; }
}
.qr { display: grid; place-items: center; margin: 14px 0; }
.qr img { width: 210px; height: 210px; image-rendering: pixelated; background: #fff; padding: 10px; border-radius: 14px; border: 1px solid var(--line); }
.secret { font-family: ui-monospace, "Cascadia Mono", Menlo, Consolas, monospace; font-size: .95rem; letter-spacing: .04em; text-align: center; padding: 11px; background: var(--surface-2); border: 1px dashed var(--line); border-radius: 10px; overflow-wrap: anywhere; user-select: all; }
.codes { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; font-family: ui-monospace, "Cascadia Mono", Menlo, Consolas, monospace; text-align: center; margin: 14px 0; }
.codes span { padding: 8px; background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 8px; }
.error { color: var(--danger); margin-top: 12px; font-size: .88rem; font-weight: 500; }
.error:empty { display: none; }
.steps { counter-reset: s; padding: 0; margin: 0 0 6px; list-style: none; }
.steps li { position: relative; padding-left: 34px; margin-bottom: 10px; }
.steps li::before { counter-increment: s; content: counter(s); position: absolute; left: 0; top: 0; width: 24px; height: 24px; border-radius: 50%; background: var(--sky-l); color: var(--blue); font-weight: 800; font-size: .8rem; display: grid; place-items: center; }

/* ================================================================== modale & toast */
.modal-bg { position: fixed; inset: 0; z-index: 80; background: rgba(16, 20, 40, .45); display: flex; align-items: flex-end; justify-content: center; animation: fade .15s; }
.modal { background: var(--surface); width: 100%; max-width: 480px; border-radius: 20px 20px 0 0; padding: 22px 20px calc(20px + var(--safe-b)); box-shadow: var(--shadow-3); }
.modal h3 { margin: 0 0 8px; font-size: 1.1rem; }
.modal p { color: var(--muted); margin: 0; }
.modal .row { justify-content: flex-end; margin-top: 20px; }
@media (min-width: 600px) { .modal-bg { align-items: center; } .modal { border-radius: 18px; } }
#toast { position: fixed; left: 50%; bottom: calc(92px + var(--safe-b)); transform: translate(-50%, 10px); z-index: 95; max-width: 92vw;
  background: #1b2238; color: #fff; padding: 11px 18px; border-radius: 12px; font-size: .9rem; font-weight: 500; box-shadow: var(--shadow-3);
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast.err { background: var(--danger); }
@media (min-width: 1024px) { #toast { left: auto; right: 24px; bottom: 24px; transform: translateY(10px); } #toast.show { transform: none; } }
