/* Kuuna Admin — charte Kuuna (référence Notion « Charte de marque & kit CSS »).
   Blanc dominant, bleu Kuuna, texte encre, filets légers, rayons 4/6 px, aucune ombre décorative.
   Grammaire des apps Kuuna : une page = une info = une action ; un seul bouton principal en bas. */
:root {
  --brand: #0e82f6; --action: #087bf0; --action-strong: #0968c4; --ink: #18324e; --muted: #61748a;
  --paper: #ffffff; --surface: #f7f9fc; --border: #e3e9f0; --field: #cbd7e3; --selection: #f2f7ff;
  --success: #2bb361; --success-text: #1f7f46; --success-soft: #e8f8ee;
  --coral: #ff5a5f; --error: #c9343a; --error-soft: #fff0f0; --warn-text: #9a5b00; --warn-soft: #fff6e5;
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --r-control: 4px; --r-panel: 6px;
  --side: 232px;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--font); color: var(--ink); background: var(--paper); font-size: 15px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
h1, h2, h3 { margin: 0; line-height: 1.2; letter-spacing: -.02em; text-wrap: balance; }
h1 { font-size: 28px; font-weight: 650; } h2 { font-size: 20px; font-weight: 650; } h3 { font-size: 15px; font-weight: 600; }
p { margin: 0; }
a { color: var(--action-strong); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--action-strong); outline-offset: 2px; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); } .small { font-size: 13px; } .xs { font-size: 12px; }
.ic { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.ic.sm { width: 16px; height: 16px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ---------- shell */
.shell { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); min-height: 100dvh; }
.side { position: sticky; top: 0; height: 100dvh; overflow-y: auto; border-right: 1px solid var(--border); padding: 20px 12px; display: flex; flex-direction: column; gap: 18px; }
.brand { display: flex; align-items: baseline; gap: 8px; padding: 0 10px; }
.brand img { width: 96px; height: auto; display: block; }
.brand span { font-size: 11px; letter-spacing: .12em; color: var(--muted); font-weight: 600; }
.nav-group { display: flex; flex-direction: column; gap: 1px; }
.nav-label { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; padding: 0 10px 4px; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--r-control); color: var(--ink); text-decoration: none; font-weight: 500; font-size: 14px; }
.nav-item:hover { background: var(--surface); }
.nav-item.on { background: var(--selection); color: var(--action-strong); box-shadow: inset 2px 0 0 var(--action); }
.side-foot { margin-top: auto; font-size: 12px; color: var(--muted); padding: 0 10px; display: flex; flex-direction: column; gap: 6px; }
.main { min-width: 0; display: flex; flex-direction: column; }
.top { position: sticky; top: 0; z-index: 5; background: var(--paper); border-bottom: 1px solid var(--border); display: none; align-items: center; gap: 10px; padding: 10px 16px; }
.view { padding: 28px 32px 64px; min-width: 0; }
.bnav { display: none; }

/* ---------- page grammar */
.page { max-width: 720px; margin: 0 auto; display: flex; flex-direction: column; gap: 22px; }
.page.wide { max-width: 1040px; }
.eyebrow { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.intro { color: var(--muted); max-width: 62ch; }
.steps { display: flex; flex-direction: column; gap: 8px; }
.steps .label { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--action-strong); font-weight: 700; }
.steps .track { height: 3px; background: var(--border); border-radius: 2px; overflow: hidden; }
.steps .track i { display: block; height: 100%; background: var(--action); }
.bar { height: 6px; background: var(--border); border-radius: 3px; overflow: hidden; } .bar i { display: block; height: 100%; background: var(--action); }
.cta { position: sticky; bottom: 0; background: var(--paper); border-top: 1px solid var(--border); padding: 14px 0; display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 11px 18px; border-radius: var(--r-control); border: 1px solid var(--field); background: var(--paper); color: var(--ink); font-weight: 600; font-size: 14px; cursor: pointer; text-decoration: none; }
.btn:hover:not(:disabled) { background: var(--selection); border-color: var(--action); }
.btn.primary { background: var(--action-strong); border-color: var(--action-strong); color: #fff; }
.btn.primary:hover:not(:disabled) { background: #062653; border-color: #062653; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.sm { min-height: 36px; padding: 6px 12px; font-size: 13px; }
.link { background: none; border: 0; padding: 0; color: var(--action-strong); font-weight: 500; font-size: 14px; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.link.danger { color: var(--error); }

.rows { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; gap: 14px; padding: 15px 2px; border: 0; border-top: 1px solid var(--border); background: none; width: 100%; text-align: left; color: var(--ink); min-height: 44px; }
.rows > .row:last-child { border-bottom: 1px solid var(--border); }
button.row, a.row { cursor: pointer; text-decoration: none; } button.row:hover, a.row:hover { background: var(--surface); }
.row .grow { flex: 1; min-width: 0; }
.row .t { font-weight: 600; font-size: 15px; display: block; }
.row .v { font-size: 13px; color: var(--muted); display: block; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.row .end { color: var(--muted); font-size: 13px; text-align: right; white-space: nowrap; }
.group-label { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 700; padding: 16px 2px 6px; }

.badge { display: inline-flex; align-items: center; gap: 4px; padding: 1px 7px; border-radius: var(--r-control); font-size: 12px; font-weight: 600; background: var(--surface); color: var(--muted); white-space: nowrap; }
.badge.blue { background: var(--selection); color: var(--action-strong); } .badge.ok { background: var(--success-soft); color: var(--success-text); }
.badge.warn { background: var(--warn-soft); color: var(--warn-text); } .badge.err { background: var(--error-soft); color: var(--error); }
.notice { border-left: 2px solid var(--border); padding: 4px 0 4px 12px; font-size: 14px; color: var(--ink); }
.notice.info { border-color: var(--action); } .notice.ok { border-color: var(--success); } .notice.warn { border-color: #e0a100; } .notice.err { border-color: var(--error); color: var(--error); }

.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.stats > div { padding: 16px 14px 16px 0; display: flex; flex-direction: column; gap: 2px; }
.stats > div + div { padding-left: 16px; border-left: 1px solid var(--border); }
.stats .v { font-size: 26px; font-weight: 650; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stats .l { font-size: 13px; color: var(--muted); }

.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 14px; font-weight: 600; }
.field .help { font-size: 13px; color: var(--muted); }
.input, select.input, textarea.input { width: 100%; min-height: 48px; padding: 12px 14px; border: 1px solid var(--field); border-radius: var(--r-control); background: var(--paper); font-size: 16px; }
textarea.input { min-height: 120px; resize: vertical; }
.input:focus { border-color: var(--action); outline: none; box-shadow: 0 0 0 3px var(--selection); }
.choices { display: flex; flex-direction: column; gap: 8px; }
.choice { display: flex; align-items: center; gap: 12px; padding: 13px 14px; border: 1px solid var(--border); border-radius: var(--r-control); background: var(--paper); cursor: pointer; text-align: left; width: 100%; min-height: 48px; }
.choice:hover { border-color: var(--action); }
.choice.on { background: var(--selection); border-color: var(--action); box-shadow: inset 2px 0 0 var(--action); }
.choice .box { width: 18px; height: 18px; border: 1.5px solid var(--field); border-radius: 3px; display: grid; place-items: center; flex: none; color: #fff; }
.choice.on .box { background: var(--action-strong); border-color: var(--action-strong); }
.choice small { color: var(--muted); font-size: 13px; display: block; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1px solid var(--field); background: var(--paper); border-radius: var(--r-control); padding: 6px 12px; font-size: 14px; cursor: pointer; }
.chip.on { background: var(--selection); border-color: var(--action); color: var(--action-strong); font-weight: 600; }
.seg { display: inline-flex; border-bottom: 1px solid var(--border); gap: 20px; overflow-x: auto; max-width: 100%; }
.seg button { background: none; border: 0; border-bottom: 2px solid transparent; padding: 10px 0; color: var(--muted); font-weight: 600; cursor: pointer; white-space: nowrap; }
.seg button.on { color: var(--action-strong); border-bottom-color: var(--action); }

.split { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 0; border-top: 1px solid var(--border); min-height: calc(100dvh - 160px); }
.split > .list { border-right: 1px solid var(--border); overflow-y: auto; max-height: calc(100dvh - 160px); }
.split > .detail { padding: 28px 32px; overflow-y: auto; max-height: calc(100dvh - 160px); }
.li { display: flex; gap: 8px; align-items: center; width: 100%; padding: 10px 14px; border: 0; background: none; text-align: left; cursor: pointer; font-size: 14px; color: var(--ink); }
.li:hover { background: var(--surface); } .li.on { background: var(--selection); color: var(--action-strong); font-weight: 600; }
.li.done { color: var(--muted); }
.li-group { position: sticky; top: 0; background: var(--paper); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; font-weight: 700; padding: 14px 14px 4px; }
.li-sub { font-size: 12px; color: var(--muted); padding: 6px 14px 2px; }

.big { font-size: 30px; font-weight: 650; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.kv { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 10px 18px; font-size: 14px; border-top: 1px solid var(--border); padding-top: 18px; margin: 0; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; overflow-wrap: anywhere; }
.quote { border-left: 2px solid var(--border); padding-left: 12px; color: var(--muted); }
.code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-control); padding: 10px 12px; overflow-x: auto; white-space: pre-wrap; word-break: break-all; }
.empty { padding: 28px 0; color: var(--muted); }
.skeleton { height: 14px; background: var(--surface); border-radius: 3px; margin: 10px 0; }
.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: var(--r-panel); font-size: 14px; z-index: 50; max-width: calc(100% - 32px); }
.toast[hidden] { display: none; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-weight: 600; color: var(--muted); font-size: 12px; padding: 8px 12px 8px 0; border-bottom: 1px solid var(--border); }
.table td { padding: 10px 12px 10px 0; border-bottom: 1px solid var(--border); }
.table td.n, .table th.n { text-align: right; font-variant-numeric: tabular-nums; }
.tw { overflow-x: auto; }
.hours { display: grid; grid-template-columns: repeat(11, minmax(0, 1fr)); gap: 6px; height: 140px; align-items: end; }
.hours > div { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 4px; font-size: 11px; color: var(--muted); }
.hours .b { width: 100%; max-width: 26px; background: var(--border); border-radius: 3px 3px 0 0; } .hours .best .b { background: var(--action); }
.hrow { display: grid; grid-template-columns: 170px minmax(0, 1fr) 44px; gap: 12px; align-items: center; padding: 5px 0; font-size: 14px; }
.hrow .hb { height: 8px; background: var(--surface); border-radius: 4px; overflow: hidden; } .hrow .hb i { display: block; height: 100%; background: var(--action); }
.hrow .n { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.login { max-width: 420px; margin: 12vh auto 0; padding: 0 20px; display: flex; flex-direction: column; gap: 20px; }

@media (max-width: 900px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; inset: 0 auto 0 0; width: min(300px, 86vw); background: var(--paper); z-index: 30; transform: translateX(-100%); transition: transform .2s; }
  .side.on { transform: none; }
  .top { display: flex; }
  .view { padding: 18px 16px calc(96px + env(safe-area-inset-bottom, 0px)); }
  .bnav { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: var(--paper); border-top: 1px solid var(--border); padding: 6px 8px calc(6px + env(safe-area-inset-bottom, 0px)); }
  .bnav a { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; font-weight: 600; color: var(--muted); text-decoration: none; padding: 4px 0; }
  .bnav a.on { color: var(--action-strong); }
  .split { grid-template-columns: minmax(0, 1fr); min-height: 0; }
  .split > .list, .split > .detail { max-height: none; border-right: 0; }
  .split.detail-open > .list { display: none; } .split:not(.detail-open) > .detail { display: none; }
  .split > .detail { padding: 18px 0; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats > div { border-left: 0 !important; padding-left: 0 !important; border-bottom: 1px solid var(--border); }
  .kv { grid-template-columns: minmax(0, 1fr); gap: 2px; } .kv dd { margin-bottom: 10px; }
  .hrow { grid-template-columns: 120px minmax(0, 1fr) 36px; }
  .cta { position: sticky; bottom: calc(60px + env(safe-area-inset-bottom, 0px)); }
  h1 { font-size: 24px; }
}
.scrim { position: fixed; inset: 0; background: rgba(24, 50, 78, .3); z-index: 25; }
.scrim[hidden] { display: none; }
.m-only { display: none; } @media (max-width: 900px) { .m-only { display: inline-flex; } .d-only { display: none !important; } }

/* ---------- vue prospection (views/prospection.js) */
.seg button .n { margin-left: 6px; font-weight: 500; font-variant-numeric: tabular-nums; }
.pros-batch, .pros-msg { display: flex; flex-direction: column; gap: 10px; }
.pros-batch[hidden], .pros-msg[hidden] { display: none; }
.pros-batch .link, .pros-msg .link, .pros-retry { align-self: flex-start; }
/* ---------- fin vue prospection */

/* ---------- vue suivi (views/suivi.js) */
.suivi-sec { border-top: 1px solid var(--border); padding-top: 20px; display: flex; flex-direction: column; gap: 10px; }
.suivi-head { display: flex; flex-wrap: wrap; gap: 16px 32px; align-items: flex-end; justify-content: space-between; }
.suivi-goal { display: flex; flex-direction: column; gap: 6px; flex: 1 1 260px; min-width: 0; }
.suivi-avg { display: flex; flex-direction: column; gap: 2px; font-size: 20px; }
.suivi-due, .suivi-err { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; }
.suivi-err .link { align-self: flex-start; }
/* ---------- fin vue suivi */

/* ---------- vue session (views/session.js) */
.sess-head { display: flex; flex-direction: column; gap: 8px; }
.sess-prog { display: flex; align-items: baseline; gap: 6px 14px; flex-wrap: wrap; }
.sess-prog .grow { flex: 1; min-width: 0; }
.sess .li .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sess .li small { font-size: 12px; font-weight: 500; white-space: nowrap; }
.sess-back { align-self: flex-start; margin-bottom: 14px; }
.sess-lines, .sess-group { display: flex; flex-direction: column; gap: 10px; }
.sess-more { margin-top: 24px; }
/* ---------- fin vue session */

/* ---------- vue import (views/import.js) */
.imp-q { font-size: 14px; font-weight: 600; }
.imp-cols { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 14px 18px; }
.imp-sec { border-top: 1px solid var(--border); padding-top: 20px; display: flex; flex-direction: column; gap: 10px; }
.imp-retry { align-self: flex-start; }
@media (min-width: 901px) { .stats.imp-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
/* ---------- fin vue import */

/* ---------- vue agents (views/agents.js) */
.agents-how { border-top: 1px solid var(--border); padding-top: 20px; display: flex; flex-direction: column; gap: 12px; }
.agents-how ol { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; }
.agents-how code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; overflow-wrap: anywhere; }
.agents-how .code, .agents-key .code { margin: 0; }
.agents-key { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.agents-key .code { width: 100%; }
/* ---------- fin vue agents */

/* ---------- vue réglages (views/settings.js) */
.set-q { font-size: 14px; font-weight: 600; }
.set-sec { border-top: 1px solid var(--border); padding-top: 20px; display: flex; flex-direction: column; gap: 10px; }
.set-sec .code { margin: 0; }
.set-sec code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; overflow-wrap: anywhere; }
/* ---------- fin vue réglages */

/* Onboarding assisté (IMP-58) */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 480px) { .grid-2 { grid-template-columns: 1fr; } }
a.choice, .choice[data-copy] { text-decoration: none; color: inherit; }
a.choice .box, .choice[data-copy] .box { border: 0; color: var(--action); }
label.btn { cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.row label.btn + label.btn { margin-left: 6px; }
