/* Tahiti Kiwi OS — style repris de Compta (compta.tahiti-kiwi.com) */
:root {
  --bg: #f2f5f3; --surface: #fff; --surface-2: #f4f7f5; --surface-3: #eaf0ec; --grid: #eef2f0;
  --border: #e1e8e4; --border-strong: #cdd8d2;
  --text: #14201b; --ink-2: #52514e; --ink-3: #6b7470; --muted: #5f6f68;
  --accent: #000; --accent-on: #fff; --accent-2: #e0e0e0;
  --dark: #000; --dark-2: #141414; --dark-3: #292929;
  --side-w: 252px; --side-text: #e9eeec; --side-strong: #fff; --side-accent: #959595;
  --ok: #1e7d43; --ok-2: #e5f5eb; --warn: #9a6700; --warn-2: #fff6db; --danger: #b3261e; --danger-2: #fdecea;
  --ocean: #1f6f8b; --ocean-2: #e6f2f6; --todo: #e8590c; --todo-2: #fdeee6;
  --series-1: #237a52; --series-2: #ee8c56; --series-prev: #b3bcb8; --viz-hl: rgba(35,122,82,.065);
  --radius: 14px; --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(16,24,20,.04), 0 3px 12px rgba(16,24,20,.05); --shadow-lg: 0 12px 32px rgba(16,24,20,.12);
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; font-size: 15px; line-height: 1.45; color: var(--text); background: var(--bg); }
a { color: inherit; }
h1, h2, h3, h4 { margin: 0; letter-spacing: -.02em; }
h1 { font-size: 30px; font-weight: 750; line-height: 1.15; }
h2 { font-size: 20px; font-weight: 700; }
h3 { font-size: 16px; font-weight: 700; }
p { margin: 0 0 12px; }
small, .small { font-size: 13px; }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); font-size: 13px; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.center { text-align: center; }
.hide { display: none !important; }
.mt0{margin-top:0}.mt8{margin-top:8px}.mt16{margin-top:16px}.mt24{margin-top:24px}.mb8{margin-bottom:8px}.mb16{margin-bottom:16px}.mb24{margin-bottom:24px}
.w100{width:100%}

/* Mise en page */
.app { display: flex; min-height: 100vh; }
.sidebar { width: var(--side-w); flex: 0 0 var(--side-w); background: var(--dark); color: var(--side-text); padding: 18px 12px 24px; display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 14px; color: var(--side-strong); font-weight: 700; font-size: 13px; letter-spacing: .02em; text-transform: uppercase; text-decoration: none; }
.brand .logo { width: 28px; height: 28px; border-radius: 50%; background: #fff; color: #000; display: grid; place-items: center; font-weight: 800; font-size: 13px; flex: 0 0 28px; }
.side-section { font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--side-accent); padding: 14px 10px 4px; font-weight: 600; }
.side-link { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; color: var(--side-text); text-decoration: none; font-size: 14px; }
.side-link svg { width: 18px; height: 18px; flex: 0 0 18px; opacity: .85; }
.side-link:hover { background: var(--dark-2); color: #fff; }
.side-link.active { background: var(--dark-3); color: #fff; font-weight: 600; }
.side-link .badge { margin-left: auto; }
.context { margin: 0 2px 6px; background: var(--dark-2); border: 1px solid #2a2a2a; border-radius: 10px; padding: 8px 10px; font-size: 13px; color: #fff; display: flex; align-items: center; gap: 8px; }
.context .muted { color: #9aa39f; }
.side-foot { margin-top: auto; padding: 14px 10px 0; font-size: 12px; color: var(--side-accent); }
.side-foot a { color: inherit; }
.main { flex: 1; min-width: 0; padding: 28px 32px 48px; }
.topbar { display: none; }
.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head .sub { color: var(--muted); margin-top: 4px; font-size: 15px; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.page-head .icon-big { width: 44px; height: 44px; border-radius: 12px; background: var(--surface-3); display: grid; place-items: center; margin-right: 12px; float: left; }

/* Cartes */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.card + .card { margin-top: 16px; }
.card h2, .card h3 { margin-bottom: 12px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.card-head h2, .card-head h3 { margin: 0; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.cols { display: grid; grid-template-columns: 1fr 340px; gap: 16px; align-items: start; }

/* Cartes d'action (accueil) */
.actions-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.action { display: flex; align-items: center; gap: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; text-decoration: none; color: inherit; box-shadow: var(--shadow); transition: transform .08s, box-shadow .12s; }
.action:hover { transform: translateY(-1px); box-shadow: var(--shadow-lg); }
.action .ico { width: 44px; height: 44px; border-radius: 12px; background: var(--surface-3); display: grid; place-items: center; flex: 0 0 44px; }
.action .ico svg { width: 22px; height: 22px; }
.action b { display: block; font-size: 15px; }
.action span { display: block; color: var(--muted); font-size: 13px; }
.action .arrow { margin-left: auto; color: var(--ink-3); }
.action.primary { background: var(--dark); color: #fff; border-color: var(--dark); }
.action.primary .ico { background: #1f1f1f; }
.action.primary span { color: #b9c0bc; }
.action.primary .arrow { color: #fff; }
.action.locked { opacity: .8; background: var(--surface-2); border-style: dashed; }

/* Bandeau de chiffres */
.kpis { display: flex; gap: 28px; flex-wrap: wrap; align-items: center; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 20px; box-shadow: var(--shadow); }
.kpi .lbl { font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.kpi .val { font-size: 22px; font-weight: 750; letter-spacing: -.02em; margin-top: 2px; }
.kpi .val.masked { letter-spacing: .2em; color: var(--ink-3); }
.kpi .delta { font-size: 12px; color: var(--muted); }
.kpi .delta.up { color: var(--ok); } .kpi .delta.down { color: var(--danger); }
.kpis .spacer { flex: 1; }

/* Listes « à faire » */
.todo-list { display: flex; flex-direction: column; gap: 8px; }
.todo { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; text-decoration: none; color: inherit; }
.todo:hover { background: var(--surface-2); }
.todo .dot { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; flex: 0 0 32px; background: var(--todo-2); color: var(--todo); font-weight: 700; }
.todo.ok .dot { background: var(--ok-2); color: var(--ok); }
.todo b { display: block; font-size: 14px; }
.todo span { color: var(--muted); font-size: 12.5px; }
.todo .arrow { margin-left: auto; color: var(--ink-3); }

/* Tableaux */
table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--border); }
.tbl td { padding: 10px; border-bottom: 1px solid var(--grid); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr.link { cursor: pointer; }
.tbl tr.link:hover td { background: var(--surface-2); }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl-wrap { overflow-x: auto; }

/* Pastilles et badges */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--surface-3); color: var(--ink-2); white-space: nowrap; }
.badge.ok { background: var(--ok-2); color: var(--ok); }
.badge.warn { background: var(--warn-2); color: var(--warn); }
.badge.danger { background: var(--danger-2); color: var(--danger); }
.badge.info, .badge.ocean { background: var(--ocean-2); color: var(--ocean); }
.badge.todo { background: var(--todo-2); color: var(--todo); }
.badge.dark { background: var(--dark); color: #fff; }
.badge.muted { background: var(--surface-3); color: var(--muted); }
.dot-state { width: 10px; height: 10px; border-radius: 50%; display: inline-block; background: var(--border-strong); }
.dot-state.ok { background: var(--ok); } .dot-state.warn { background: var(--warn); } .dot-state.danger { background: var(--danger); }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--surface-3); color: var(--text); display: inline-grid; place-items: center; font-weight: 700; font-size: 12px; flex: 0 0 32px; }
.avatar.dark { background: var(--dark); color: #fff; }
.logo-sq { width: 40px; height: 40px; border-radius: 10px; object-fit: cover; background: var(--surface-3); display: inline-grid; place-items: center; font-weight: 700; }

/* Boutons */
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: 10px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; text-decoration: none; line-height: 1.2; white-space: nowrap; }
.btn:hover { background: var(--surface-2); }
.btn.primary { background: var(--accent); color: var(--accent-on); border-color: var(--accent); }
.btn.primary:hover { filter: brightness(1.15); }
.btn.danger { color: var(--danger); border-color: #f0c9c5; }
.btn.danger:hover { background: var(--danger-2); }
.btn.ok { color: var(--ok); border-color: #bfe3cc; }
.btn.warn { color: var(--warn); border-color: #ecdca8; }
.btn.warn:hover { background: var(--warn-2); }
.btn.sm { padding: 6px 10px; font-size: 13px; }
.btn.xs { padding: 3px 8px; font-size: 12px; border-radius: 8px; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn svg { width: 16px; height: 16px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
form.inline { display: inline; }

/* Formulaires */
label.lbl, .field > label { display: block; font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.field { margin-bottom: 14px; }
.field .help { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
input[type=text], input[type=email], input[type=password], input[type=url], input[type=number], input[type=date], input[type=datetime-local], input[type=search], input[type=color], select, textarea {
  width: 100%; padding: 9px 12px; border: 1px solid var(--border-strong); border-radius: 10px; background: #fff; font: inherit; font-size: 14px; color: var(--text); }
input:focus, select:focus, textarea:focus { outline: 2px solid #000; outline-offset: 0; border-color: #000; }
textarea { min-height: 96px; resize: vertical; }
input[type=color] { padding: 2px; height: 40px; width: 64px; }
.check { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.check input { width: 16px; height: 16px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.form-grid .full { grid-column: 1 / -1; }
.form-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 8px; padding-top: 14px; border-top: 1px solid var(--grid); }
.inline-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.inline-form input, .inline-form select { width: auto; }
.code-input { font-family: var(--mono); font-size: 22px; letter-spacing: .4em; text-align: center; }

/* Messages flash */
.flashes { margin-bottom: 16px; }
.flash { padding: 10px 14px; border-radius: 10px; font-size: 14px; margin-bottom: 8px; border: 1px solid transparent; }
.flash.success { background: var(--ok-2); color: var(--ok); border-color: #bfe3cc; }
.flash.error { background: var(--danger-2); color: var(--danger); border-color: #f0c9c5; }
.flash.info { background: var(--ocean-2); color: var(--ocean); }

/* Onglets */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 16px; overflow-x: auto; }
.tabs a { padding: 10px 14px; text-decoration: none; color: var(--muted); font-weight: 600; font-size: 14px; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a.active { color: var(--text); border-bottom-color: var(--dark); }
.tabs a .n { margin-left: 6px; color: var(--ink-3); font-weight: 500; }

/* Étapes de projet */
.steps { display: flex; gap: 6px; align-items: center; }
.step { flex: 1; text-align: center; font-size: 12px; color: var(--muted); }
.step .bar { height: 6px; border-radius: 3px; background: var(--surface-3); margin-bottom: 6px; }
.step.done .bar { background: var(--ok); }
.step.current .bar { background: var(--dark); }
.step.current { color: var(--text); font-weight: 600; }

/* Modules (grille du portail) */
.modules { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.module { position: relative; display: block; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; text-decoration: none; color: inherit; box-shadow: var(--shadow); min-height: 128px; }
.module:hover { box-shadow: var(--shadow-lg); }
.module .ico { width: 38px; height: 38px; border-radius: 10px; background: var(--surface-3); display: grid; place-items: center; margin-bottom: 10px; }
.module .ico svg { width: 20px; height: 20px; }
.module b { display: block; font-size: 14px; margin-bottom: 4px; }
.module span { font-size: 12.5px; color: var(--muted); display: block; }
.module .state { position: absolute; top: 12px; right: 12px; }
.module.locked { background: var(--surface-2); border-style: dashed; color: var(--ink-2); }
.module.locked .ico { background: #e3e9e5; }
.module.attente { border-color: #e8d9a3; }
.module.suspendu { border-color: #f0c9c5; background: #fffaf9; }
.lock-page { text-align: center; padding: 40px 20px; }
.lock-page .big { width: 72px; height: 72px; border-radius: 20px; background: var(--surface-3); display: grid; place-items: center; margin: 0 auto 16px; }
.lock-page .big svg { width: 32px; height: 32px; }
.blur-preview { filter: blur(6px); opacity: .5; pointer-events: none; user-select: none; }

/* Kanban */
.kanban { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; align-items: start; }
.kcol { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px; min-height: 120px; }
.kcol h3 { font-size: 13px; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); display: flex; justify-content: space-between; padding: 4px 6px 10px; }
.kcol.dragover { outline: 2px dashed var(--dark); }
.kcard { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; margin-bottom: 8px; cursor: grab; box-shadow: var(--shadow); }
.kcard:active { cursor: grabbing; }
.kcard b { display: block; font-size: 14px; }
.kcard .meta { font-size: 12px; color: var(--muted); display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.kcard .late { color: var(--danger); font-weight: 600; }
.kcard .foot { display: flex; gap: 6px; margin-top: 8px; align-items: center; }
.kcol .empty { border: 1px dashed var(--border-strong); border-radius: 12px; padding: 14px; text-align: center; color: var(--muted); font-size: 13px; }
.kcol-head-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; }

/* Score santé */
.score { display: inline-grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; font-weight: 750; font-size: 20px; letter-spacing: -.02em; border: 4px solid var(--border-strong); }
.score.ok { border-color: var(--ok); color: var(--ok); }
.score.warn { border-color: var(--warn); color: var(--warn); }
.score.danger { border-color: var(--danger); color: var(--danger); }
.score.muted { color: var(--muted); }
.check-row { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--grid); align-items: flex-start; }
.check-row:last-child { border-bottom: 0; }
.check-row .v { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; flex: 0 0 22px; font-size: 12px; font-weight: 700; }
.check-row .v.ok { background: var(--ok-2); color: var(--ok); } .check-row .v.warn { background: var(--warn-2); color: var(--warn); } .check-row .v.danger { background: var(--danger-2); color: var(--danger); } .check-row .v.info { background: var(--ocean-2); color: var(--ocean); }
.check-row b { font-size: 14px; display: block; }
.check-row span { font-size: 13px; color: var(--muted); }
.check-row .val { margin-left: auto; font-family: var(--mono); font-size: 12.5px; color: var(--ink-2); white-space: nowrap; }

/* Messages (tickets) */
.thread { display: flex; flex-direction: column; gap: 12px; }
.msg { display: flex; gap: 12px; }
.msg .bubble { background: var(--surface-2); border-radius: 14px; padding: 12px 14px; max-width: 80%; }
.msg.me .bubble { background: var(--dark); color: #fff; }
.msg.internal .bubble { background: var(--warn-2); border: 1px dashed #e8d9a3; }
.msg .who { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.msg.me .who { color: #b9c0bc; }
.msg .body { white-space: pre-wrap; font-size: 14px; }

/* Médiathèque */
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.media-item { position: relative; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: #fff; }
.media-item img, .media-item .vid { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; background: var(--surface-3); }
.media-item .vid { display: grid; place-items: center; color: var(--muted); }
.media-item .tags { padding: 6px 8px; font-size: 11.5px; color: var(--muted); line-height: 1.3; max-height: 48px; overflow: hidden; }
.media-item input[type=checkbox] { position: absolute; top: 8px; left: 8px; width: 18px; height: 18px; }
.media-item.selected { outline: 3px solid var(--dark); }
.dropzone { border: 2px dashed var(--border-strong); border-radius: var(--radius); padding: 28px; text-align: center; color: var(--muted); background: var(--surface-2); cursor: pointer; }
.dropzone.over { border-color: var(--dark); background: var(--surface-3); }
.progress { height: 6px; background: var(--surface-3); border-radius: 3px; overflow: hidden; margin-top: 8px; }
.progress i { display: block; height: 100%; background: var(--dark); width: 0; transition: width .2s; }

/* Aperçu de post */
.phone { width: 320px; border: 1px solid var(--border-strong); border-radius: 24px; padding: 12px; background: #fff; box-shadow: var(--shadow); }
.phone .ph-head { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; margin-bottom: 8px; }
.phone .ph-img { aspect-ratio: 1; background: var(--surface-3); border-radius: 8px; overflow: hidden; display: grid; place-items: center; color: var(--muted); font-size: 13px; }
.phone .ph-img img { width: 100%; height: 100%; object-fit: cover; }
.phone .ph-cap { font-size: 13px; margin-top: 8px; white-space: pre-wrap; }
.phone .ph-tags { font-size: 12px; color: var(--ocean); margin-top: 4px; }
.variant { border: 1px solid var(--border); border-radius: 12px; padding: 12px; margin-bottom: 8px; cursor: pointer; }
.variant:hover { border-color: var(--dark); }
.variant .angle { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.variant .hook { font-weight: 700; }
.variant .cap { font-size: 13px; white-space: pre-wrap; color: var(--ink-2); margin-top: 4px; }

/* Graphiques SVG simples */
.chart { width: 100%; height: auto; display: block; }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); margin-top: 6px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: middle; }

/* Auth */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: var(--bg); }
.auth-card { width: 100%; max-width: 420px; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow-lg); padding: 32px; }
.auth-card .brand { color: var(--text); padding: 0 0 18px; }
.auth-card .brand .logo { background: #000; color: #fff; }
.auth-card h1 { font-size: 24px; margin-bottom: 6px; }
.auth-card .sub { color: var(--muted); margin-bottom: 20px; }
.qr { display: grid; place-items: center; margin: 12px auto; }

/* Fil chronologique */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: flex; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--grid); font-size: 14px; }
.timeline li:last-child { border-bottom: 0; }
.timeline .when { color: var(--muted); font-size: 12.5px; white-space: nowrap; width: 110px; flex: 0 0 110px; }

/* Secrets */
.secret-val { font-family: var(--mono); background: var(--surface-2); padding: 6px 10px; border-radius: 8px; word-break: break-all; }

.copy-box { background: var(--surface-2); border: 1px dashed var(--border-strong); border-radius: 10px; padding: 10px 12px; font-family: var(--mono); font-size: 12.5px; word-break: break-all; }

details.help { margin-top: 10px; font-size: 13px; color: var(--muted); }
details.help summary { cursor: pointer; font-weight: 600; color: var(--ink-2); }

/* Responsive */
@media (max-width: 1100px) { .grid-4, .modules, .kanban, .actions-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .cols { grid-template-columns: 1fr; } }
@media (max-width: 820px) {
  .app { flex-direction: column; }
  .sidebar { position: fixed; inset: 0 auto 0 0; z-index: 50; transform: translateX(-100%); transition: transform .2s; height: 100vh; }
  .sidebar.open { transform: none; }
  .topbar { display: flex; align-items: center; gap: 12px; padding: 12px 16px; background: var(--dark); color: #fff; position: sticky; top: 0; z-index: 40; }
  .topbar .brand { padding: 0; }
  .topbar button { margin-left: auto; background: none; border: 1px solid #333; color: #fff; border-radius: 8px; padding: 6px 10px; font: inherit; }
  .main { padding: 18px 16px 40px; }
  h1 { font-size: 24px; }
  .grid-2, .grid-3, .grid-4, .modules, .kanban, .actions-grid, .form-grid { grid-template-columns: 1fr; }
  .kpis { gap: 16px; }
  .phone { width: 100%; }
  .msg .bubble { max-width: 100%; }
}
@media print { .sidebar, .topbar, .btn, .flashes { display: none !important; } .main { padding: 0; } }

/* ---- v1.1 : sélecteur de projet, espace projet, Mes sites ---- */
.side-select { margin: 2px 2px 8px; }
.side-select select { width: 100%; background: var(--dark-2); color: #fff; border: 1px solid #2f2f2f; border-radius: 10px; padding: 9px 30px 9px 10px; font: inherit; font-size: 13.5px; font-weight: 600; appearance: none; -webkit-appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23bbb' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; cursor: pointer; }
.side-select select:focus { outline: 2px solid #4a4a4a; outline-offset: 1px; }
.side-select optgroup, .side-select option { background: #1a1a1a; color: #fff; font-weight: 500; }
.context div { display: flex; flex-direction: column; min-width: 0; }
.context b { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.context span { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-link.locked { color: #8d948f; }
.side-link.locked svg { opacity: .55; }
.side-link.locked.active { color: #fff; }
.side-mark { margin-left: auto; display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: #2a2a2a; color: #9aa39f; font-size: 11px; font-weight: 700; flex: 0 0 18px; }
.side-mark svg { width: 11px; height: 11px; opacity: 1; }
.side-mark.warn { background: var(--warn); color: #fff; }
.side-mark.danger { background: var(--danger); color: #fff; }
.side-link.back { margin-top: 6px; color: var(--side-accent); font-size: 13px; }
.side-link.back svg { transform: rotate(180deg); }

.notice { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: var(--radius-sm); margin-bottom: 16px; font-size: 13.5px; background: var(--ocean-2); color: #164e62; border: 1px solid #cfe3ea; }
.notice > svg { flex: 0 0 16px; }
.notice > div:first-of-type { flex: 1; }
.notice .btn-row { margin: 0; }
.notice.lock { background: var(--surface-2); color: var(--ink-2); border-color: var(--border-strong); border-style: dashed; }
.notice.warn { background: var(--warn-2); color: var(--warn); border-color: #ecdca8; }
.notice.ok { background: var(--ok-2); color: var(--ok); border-color: #c7e6d2; }

.site-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.site-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; display: flex; flex-direction: column; gap: 12px; position: relative; }
.site-card.down { border-color: #f0c9c5; background: #fffaf9; }
.site-card .head { display: flex; gap: 12px; align-items: flex-start; }
.site-card .head .ring { flex: 0 0 auto; }
.site-card .name { font-weight: 700; font-size: 15px; line-height: 1.2; }
.site-card .name a { text-decoration: none; }
.site-card .name a:hover { text-decoration: underline; }
.site-card .who { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.site-card .facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.site-card .fact { background: var(--surface-2); border-radius: 10px; padding: 7px 9px; min-width: 0; }
.site-card .fact .lbl { font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.site-card .fact .v { font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.site-card .fact .v.warn { color: var(--warn); }
.site-card .fact .v.danger { color: var(--danger); }
.site-card .fact .v.ok { color: var(--ok); }
.site-card .btns { display: flex; gap: 8px; flex-wrap: wrap; margin-top: auto; }
.site-card .btns form { display: inline; }
.ring { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 15px; background: conic-gradient(var(--ring-c, var(--ok)) calc(var(--ring-v, 0) * 1%), var(--surface-3) 0); position: relative; color: var(--text); }
.ring::before { content: ""; position: absolute; inset: 4px; border-radius: 50%; background: var(--surface); }
.ring span { position: relative; }
.ring.ok { --ring-c: var(--ok); } .ring.warn { --ring-c: var(--warn); } .ring.danger { --ring-c: var(--danger); } .ring.muted { --ring-c: var(--border-strong); }
.site-tools { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.site-tools input[type=search] { max-width: 280px; }
.agent-step { display: flex; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--grid); font-size: 13.5px; }
.agent-step .n { flex: 0 0 24px; width: 24px; height: 24px; border-radius: 50%; background: var(--dark); color: #fff; display: grid; place-items: center; font-size: 12px; font-weight: 700; }
.update-list { font-size: 13px; }
.update-list li { padding: 3px 0; }
@media (max-width: 1100px) { .site-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 720px) { .site-grid { grid-template-columns: 1fr; } .notice { flex-wrap: wrap; } }

/* ---- v1.2 : espace client, couleur du client, vue client ---- */
.client-head { display: flex; align-items: center; gap: 10px; margin: 0 2px 8px; padding: 10px; background: var(--dark-2); border: 1px solid rgba(255,255,255,.08); border-radius: 12px; }
.client-logo { width: 40px; height: 40px; border-radius: 10px; object-fit: contain; background: #fff; flex: 0 0 40px; padding: 3px; }
.client-logo.initials { display: grid; place-items: center; background: var(--dark-3); color: #fff; font-weight: 800; font-size: 14px; padding: 0; }
.client-name { min-width: 0; display: flex; flex-direction: column; }
.client-name b { color: #fff; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.client-name span { color: #b8c0bc; font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.view-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 3px; margin: 0 2px 6px; padding: 3px; background: rgba(255,255,255,.06); border-radius: 10px; }
.view-switch a { display: flex; align-items: center; justify-content: center; gap: 5px; padding: 6px 4px; border-radius: 8px; color: #b8c0bc; text-decoration: none; font-size: 12px; font-weight: 600; }
.view-switch a.on { background: #fff; color: #14201b; }
.view-switch a svg { width: 13px; height: 13px; }
.side-link.admin { color: #cdd3d0; }
.side-mark.admin { background: #fff; color: #000; font-size: 10px; }
.preview-bar { display: flex; align-items: center; gap: 8px; margin: -8px 0 14px; padding: 8px 14px; border-radius: 10px; background: #14201b; color: #fff; font-size: 13px; }
.preview-bar a { color: #fff; margin-left: auto; white-space: nowrap; }
body.branded .sidebar { background: var(--dark); }
body.branded .eyebrow { color: var(--accent); }
body.branded .kpi .lbl, body.branded .side-section { color: inherit; opacity: .85; }
body.branded .side-section { color: #d6ddd9; }
body.branded .action.primary { background: var(--accent); border-color: var(--accent); color: var(--brand-on); }
body.branded .action.primary span, body.branded .action.primary .ico { color: var(--brand-on); }
body.branded .step.done .bar, body.branded .step.current .bar { background: var(--accent); }
body.branded .ring.ok { --ring-c: var(--ok); }
body.branded .page-head h1 { color: var(--text); }
body.branded .notice.team, body.branded .notice { background: var(--brand-tint); border-color: var(--brand-tint-2); color: var(--text); }
body.branded .module .ico { background: var(--brand-tint); color: var(--accent); }
body.branded .module.locked .ico { background: #e3e9e5; color: var(--ink-2); }
body.branded .badge.info { background: var(--brand-tint); color: var(--accent); }
body.branded .tbl th { color: var(--accent); }
body.branded a:not(.btn):not(.side-link):not(.module):not(.action):not(.todo) { color: var(--accent); }
body.branded .side-link.active { background: var(--dark-3); color: var(--brand-on); }
body.branded .side-link.active svg { color: var(--brand-on); }
.space-head { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.space-head .big-logo { width: 56px; height: 56px; border-radius: 14px; object-fit: contain; background: #fff; border: 1px solid var(--border); padding: 4px; }
.space-head .big-logo.initials { display: grid; place-items: center; background: var(--accent); color: var(--brand-on, #fff); font-weight: 800; font-size: 20px; }
.month-nav { display: flex; align-items: center; gap: 8px; }
.month-nav b { min-width: 150px; text-align: center; text-transform: capitalize; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.cal .dow { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 600; padding: 4px 6px; }
.cal .day { min-height: 92px; background: var(--surface-2); border-radius: 10px; padding: 6px; font-size: 12px; border: 1px solid transparent; }
.cal .day.out { opacity: .45; }
.cal .day.today { border-color: var(--accent); background: var(--brand-tint, var(--ocean-2)); }
.cal .day .n { font-weight: 700; color: var(--muted); margin-bottom: 4px; }
.cal .ev { display: block; padding: 3px 6px; border-radius: 6px; margin-bottom: 3px; font-size: 11.5px; line-height: 1.25; text-decoration: none; color: inherit; background: var(--surface); border-left: 3px solid var(--border-strong); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.cal .ev.a_valider { border-left-color: var(--warn); background: var(--warn-2); }
.cal .ev.valide, .cal .ev.programme { border-left-color: var(--ok); background: var(--ok-2); }
.cal .ev.publie { border-left-color: var(--ok); }
.cal .ev.demande { border-left-color: var(--ocean); background: var(--ocean-2); }
.cal .ev.refuse { border-left-color: var(--danger); background: var(--danger-2); }
.legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-top: 10px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 4px; vertical-align: middle; }
.post-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; max-width: 420px; }
.post-card .ph { display: flex; align-items: center; gap: 8px; font-size: 13px; margin-bottom: 8px; }
.post-card .ph .av { width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: var(--brand-on, #fff); display: grid; place-items: center; font-size: 11px; font-weight: 700; }
.post-card .media { aspect-ratio: 1; background: var(--surface-3); border-radius: 10px; display: grid; place-items: center; color: var(--muted); overflow: hidden; }
.post-card .media img { width: 100%; height: 100%; object-fit: cover; }
.post-card .cap { white-space: pre-wrap; font-size: 13.5px; margin-top: 10px; }
.post-card .tags { color: var(--ocean); font-size: 13px; margin-top: 6px; }
.contract { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr auto; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--grid); }
.contract .lbl { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.status-now { display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: var(--radius); background: var(--ok-2); color: var(--ok); font-weight: 700; }
.status-now.down { background: var(--danger-2); color: var(--danger); }
.status-now .dot-state { width: 14px; height: 14px; }
.report-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 1100px) { .report-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .contract { grid-template-columns: 1fr 1fr; } }
@media (max-width: 720px) { .cal .day { min-height: 60px; } .report-grid { grid-template-columns: 1fr; } }
@media print { .preview-bar, .view-switch { display: none !important; } }
