:root {
  --blue: #365b6d;
  --blue-dark: #2a4756;
  --blue-soft: #e9f0f3;
  --orange: #de722f;
  --orange-dark: #c25f20;
  --orange-soft: #fcefe6;
  --ink: #1f2d33;
  --muted: #6b7b82;
  --line: #e2e8eb;
  --bg: #f6f8f9;
  --white: #fff;
  --ok: #2e7d4f;
  --ok-soft: #e5f4ea;
  --bad: #b3261e;
  --bad-soft: #fbe9e7;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(31, 45, 51, .06), 0 4px 16px rgba(31, 45, 51, .06);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink); background: var(--bg);
  min-height: 100vh; display: flex; flex-direction: column;
}
a { color: var(--blue); }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }

/* ---------- Connexion ---------- */
body.login { align-items: center; justify-content: center; background: var(--white); }
.login-box { width: min(360px, 92vw); margin: auto; padding-top: 6vh; }
.login-logo { display: block; width: 220px; margin: 0 auto 28px; }
.login-box form { display: grid; gap: 14px; }
label { display: grid; gap: 4px; align-content: start; font-size: 13px; color: var(--muted); }
input, select, textarea {
  border: 1px solid var(--line); border-radius: 8px; padding: 9px 11px; background: var(--white);
  outline: none; transition: border-color .15s, box-shadow .15s; width: 100%;
}
input:focus, select:focus, textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
textarea { resize: vertical; min-height: 60px; }
.alert { background: var(--orange-soft); color: var(--orange-dark); border-radius: 8px; padding: 10px 12px; margin: 0; font-size: 14px; }
.alert.bad { background: var(--bad-soft); color: var(--bad); }

/* ---------- Boutons ---------- */
.btn {
  border: 1px solid var(--line); background: var(--white); border-radius: 8px; padding: 8px 14px;
  cursor: pointer; font-weight: 500; white-space: nowrap; transition: background .15s, border-color .15s;
}
.btn:hover { border-color: var(--blue); }
.btn.primary { background: var(--orange); border-color: var(--orange); color: #fff; }
.btn.primary:hover { background: var(--orange-dark); }
.btn.blue { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn.blue:hover { background: var(--blue-dark); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--muted); }
.btn.ghost:hover { color: var(--bad); }
.btn.wide { width: 100%; padding: 11px; }
.btn:disabled { opacity: .5; cursor: default; }
.icon-btn { border: 0; background: transparent; cursor: pointer; font-size: 16px; color: var(--muted); padding: 4px 8px; border-radius: 6px; }
.icon-btn:hover { background: var(--blue-soft); color: var(--blue); }

/* ---------- Barre du haut ---------- */
.topbar {
  display: flex; align-items: center; gap: 22px; padding: 10px 24px; background: var(--white);
  border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10;
}
.brand img { height: 46px; display: block; }
.topbar nav { display: flex; gap: 4px; flex: 1; }
.topbar nav a {
  text-decoration: none; color: var(--muted); padding: 7px 14px; border-radius: 8px; font-weight: 500;
  display: inline-flex; align-items: center;
}
.topbar nav a:hover { color: var(--blue); background: var(--blue-soft); }
.topbar nav a.active { color: var(--white); background: var(--blue); }
.topbar .nav-settings { margin-left: auto; }
.logout { color: var(--muted); display: inline-flex; padding: 6px; border-radius: 8px; }
.logout:hover { color: var(--bad); background: var(--bad-soft); }

/* ---------- Vues ---------- */
.view { flex: 1; width: min(1180px, 100%); margin: 0 auto; padding: 26px 24px 120px; }
.view-head { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.view-head h1 { margin: 0; font-size: 24px; color: var(--blue); font-weight: 650; }
.view-head .spacer { flex: 1; }
.filters { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.filters input { max-width: 280px; }
.chip {
  border: 1px solid var(--line); background: var(--white); border-radius: 999px; padding: 5px 12px;
  font-size: 13px; cursor: pointer; color: var(--muted);
}
.chip.active { background: var(--blue); color: #fff; border-color: var(--blue); }
.card { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); }

/* Tableau */
.table-wrap { overflow-x: auto; }
table.grid { width: 100%; border-collapse: collapse; }
.grid th {
  text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted);
  font-weight: 600; padding: 12px 14px; border-bottom: 1px solid var(--line);
}
.grid td { padding: 12px 14px; border-bottom: 1px solid var(--line); }
.grid tbody tr { cursor: pointer; transition: background .1s; }
.grid tbody tr:hover { background: var(--blue-soft); }
.grid tbody tr:last-child td { border-bottom: 0; }
.grid tfoot td { font-weight: 600; background: var(--bg); border-bottom: 0; }
.grid .r { text-align: right; white-space: nowrap; }
.grid .num { font-weight: 600; color: var(--blue); white-space: nowrap; }
.grid .sub { color: var(--muted); font-size: 13px; }
.empty-state { padding: 48px 20px; text-align: center; color: var(--muted); }
.empty-state p { margin: 4px 0; }

/* Statuts */
.pill {
  display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600;
  background: var(--blue-soft); color: var(--blue); white-space: nowrap;
}
.pill.brouillon { background: #eef1f2; color: var(--muted); }
.pill.envoye, .pill.emise { background: var(--blue-soft); color: var(--blue); }
.pill.accepte, .pill.payee { background: var(--ok-soft); color: var(--ok); }
.pill.refuse, .pill.retard { background: var(--bad-soft); color: var(--bad); }
.pill.expire { background: var(--orange-soft); color: var(--orange-dark); }

/* Éditeur */
.doc-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.doc-head h1 { margin: 0; font-size: 22px; color: var(--blue); }
.doc-head .back { text-decoration: none; color: var(--muted); font-size: 22px; padding: 0 6px; }
.doc-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-left: auto; justify-content: flex-end; }
.doc-actions select { width: auto; }
.doc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.section { padding: 16px 18px; }
.section h2 { margin: 0 0 12px; font-size: 13px; text-transform: uppercase; letter-spacing: .8px; color: var(--blue); }
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.fields .full { grid-column: 1 / -1; }
.locked-note { background: var(--blue-soft); color: var(--blue); border-radius: 8px; padding: 9px 12px; margin-bottom: 14px; font-size: 14px; }
.save-state { font-size: 12px; color: var(--muted); min-width: 90px; }

table.lines-edit { width: 100%; border-collapse: collapse; }
.lines-edit th { font-size: 12px; color: var(--muted); text-align: left; font-weight: 600; padding: 6px; border-bottom: 1px solid var(--line); }
.lines-edit td { padding: 5px 4px; vertical-align: middle; border-bottom: 1px solid var(--line); }
.lines-edit input, .lines-edit select { padding: 6px 8px; }
.lines-edit .c-pos { width: 28px; color: var(--muted); text-align: center; font-size: 13px; }
.lines-edit .c-kind { width: 150px; }
.lines-edit .c-qty { width: 80px; }
.lines-edit .c-unit { width: 72px; }
.lines-edit .c-pu { width: 110px; }
.lines-edit .c-vat { width: 74px; }
.lines-edit .c-tot { width: 110px; text-align: right; font-weight: 600; white-space: nowrap; }
.lines-edit .c-del { width: 36px; }
.lines-edit input.n { text-align: right; }
.lines-edit td.estimated { position: relative; }
.lines-edit td.estimated input { border-color: var(--orange); background: var(--orange-soft); }
.lines-edit td.estimated::after { content: "estimé"; position: absolute; right: 8px; top: -6px; font-size: 9px; font-weight: 700; letter-spacing: .4px; text-transform: uppercase; color: var(--orange-dark); background: var(--white); padding: 0 3px; }

/* Catalogue */
table.catalog { width: 100%; border-collapse: collapse; }
.catalog th { font-size: 12px; color: var(--muted); text-align: left; font-weight: 600; padding: 8px 6px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.catalog td { padding: 5px 4px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.catalog input, .catalog select { padding: 6px 8px; }
.catalog input.n { text-align: right; }
.catalog .c-kind { width: 150px; }
.catalog .c-qty { width: 76px; }
.catalog .c-unit { width: 76px; }
.catalog .c-pu { width: 108px; }
.catalog .c-note { width: 160px; }
.catalog .c-act { width: 56px; text-align: center; }
.catalog .c-del { width: 36px; }
.catalog tr.inactive td { opacity: .55; }
.catalog tr.saved td { animation: rowflash 1s ease-out; }
@keyframes rowflash { 0% { background: var(--ok-soft); } 100% { background: transparent; } }
.cat-suggest { margin-top: 16px; }
.cat-suggest .row { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.cat-suggest .row:last-child { border-bottom: 0; }
.cat-suggest .row .sub { color: var(--muted); font-size: 13px; }
.cat-suggest .row .spacer { flex: 1; }
.cat-help { color: var(--muted); font-size: 14px; margin: 0 0 14px; }
.lines-foot { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; margin-top: 12px; flex-wrap: wrap; }
.totals { min-width: 260px; }
.totals div { display: flex; justify-content: space-between; padding: 3px 0; gap: 20px; }
.totals .grand { font-size: 18px; font-weight: 700; color: var(--blue); border-top: 2px solid var(--blue); margin-top: 4px; padding-top: 6px; }
.ro-value { padding: 9px 0; min-height: 20px; white-space: pre-wrap; }

/* Indicateurs */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 16px; }
.kpi { padding: 16px 18px; }
.kpi .label { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .6px; }
.kpi .value { font-size: 24px; font-weight: 700; color: var(--blue); margin-top: 4px; white-space: nowrap; }
.kpi .hint { font-size: 13px; color: var(--muted); }
.kpi.accent .value { color: var(--orange); }
.kpi.bad .value { color: var(--bad); }
.charts { display: grid; grid-template-columns: 2fr 1fr; gap: 14px; }
.chart { padding: 16px 18px; }
.chart h2 { margin: 0 0 10px; font-size: 13px; text-transform: uppercase; letter-spacing: .8px; color: var(--blue); }
.bars { display: flex; align-items: flex-end; gap: 6px; height: 190px; padding-top: 18px; }
.bar { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; position: relative; }
.bar .fill { width: 100%; max-width: 38px; background: var(--blue); border-radius: 5px 5px 0 0; min-height: 2px; transition: height .4s; }
.bar.current .fill { background: var(--orange); }
.bar .m { font-size: 11px; color: var(--muted); margin-top: 5px; }
.bar .v { position: absolute; top: -2px; font-size: 10px; color: var(--muted); white-space: nowrap; }
.bar:hover .v { color: var(--ink); font-weight: 600; }
.split div { margin-bottom: 10px; }
.split .row { display: flex; justify-content: space-between; font-size: 14px; }
.split .track { height: 8px; background: var(--blue-soft); border-radius: 4px; overflow: hidden; margin-top: 3px; }
.split .track span { display: block; height: 100%; background: var(--orange); border-radius: 4px; }

/* Paramètres */
.settings-group { padding: 16px 18px; margin-bottom: 14px; }
.settings-group h2 { margin: 0 0 12px; font-size: 13px; text-transform: uppercase; letter-spacing: .8px; color: var(--blue); }
.settings-group .fields { grid-template-columns: repeat(3, 1fr); }
.settings-group small { color: var(--muted); font-size: 11px; }
.warnings { margin-bottom: 14px; display: grid; gap: 6px; }

/* ---------- Assistant ---------- */
.assistant { position: fixed; right: 22px; bottom: 30px; z-index: 50; display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
.mic {
  width: 66px; height: 66px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--orange); color: #fff; box-shadow: 0 6px 22px rgba(222, 114, 47, .45);
  display: grid; place-items: center; transition: transform .15s, background .15s;
}
.mic:hover { transform: scale(1.05); }
.mic { position: relative; }
.mic.wake::after { content: ""; position: absolute; inset: -9px; border-radius: 50%; border: 2px solid rgba(46, 125, 79, .55); animation: orb-breathe 2.4s ease-in-out infinite; }
.mic.wake { box-shadow: 0 0 0 4px var(--ok-soft), 0 6px 22px rgba(222, 114, 47, .35); }
.mic.listening { background: var(--bad); animation: pulse 1.3s infinite; }
.mic.thinking { background: var(--blue); animation: spin-shadow 1s linear infinite; }
.mic.speaking { background: var(--blue); }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(179, 38, 30, .5); } 70% { box-shadow: 0 0 0 18px rgba(179, 38, 30, 0); } 100% { box-shadow: 0 0 0 0 rgba(179, 38, 30, 0); } }
@keyframes spin-shadow { 0% { box-shadow: 3px 0 14px rgba(54, 91, 109, .5); } 25% { box-shadow: 0 3px 14px rgba(54, 91, 109, .5); } 50% { box-shadow: -3px 0 14px rgba(54, 91, 109, .5); } 75% { box-shadow: 0 -3px 14px rgba(54, 91, 109, .5); } 100% { box-shadow: 3px 0 14px rgba(54, 91, 109, .5); } }
.mic-hint {
  position: absolute; right: 78px; bottom: 18px; background: var(--ink); color: #fff; font-size: 13px;
  padding: 6px 10px; border-radius: 8px; white-space: nowrap; max-width: 60vw; overflow: hidden; text-overflow: ellipsis;
  opacity: 0; transition: opacity .2s; pointer-events: none;
}
.mic-hint.show { opacity: .92; }
.assistant-panel {
  width: min(430px, calc(100vw - 44px)); max-height: min(640px, 74vh); background: var(--white);
  border-radius: 14px; box-shadow: 0 10px 40px rgba(31, 45, 51, .2); display: flex; flex-direction: column; overflow: hidden;
}
.assistant-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px; background: var(--blue); color: #fff; }
.assistant-head strong { flex: 1; }
.assistant-head .icon-btn { color: #fff; }
.assistant-head .icon-btn:hover { background: rgba(255, 255, 255, .15); color: #fff; }
.switch { display: flex; align-items: center; gap: 5px; font-size: 12px; color: #fff; cursor: pointer; }
.switch input { width: auto; margin: 0; accent-color: var(--orange); }
.assistant-log { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 8px; min-height: 120px; }
.msg { padding: 8px 11px; border-radius: 12px; max-width: 88%; font-size: 14px; white-space: pre-wrap; }
.msg.user { align-self: flex-end; background: var(--orange-soft); color: var(--ink); border-bottom-right-radius: 4px; }
.msg.bot { align-self: flex-start; background: var(--blue-soft); color: var(--ink); border-bottom-left-radius: 4px; }
.msg.err { align-self: stretch; background: var(--bad-soft); color: var(--bad); max-width: none; }
.msg.interim { opacity: .55; font-style: italic; }
.assistant-input { display: flex; gap: 6px; padding: 10px; border-top: 1px solid var(--line); }

.head-orb { width: 14px; height: 14px; border-radius: 50%; flex: none; background: radial-gradient(circle at 35% 30%, #ffd3b0, var(--orange)); box-shadow: 0 0 8px rgba(255, 255, 255, .5); }
.ai-badge {
  display: inline-block; margin-left: 6px; font-size: 10px; font-weight: 700; letter-spacing: .5px; vertical-align: 1px;
  color: var(--orange-dark); background: var(--orange-soft); border-radius: 4px; padding: 1px 5px;
}
.say-btn { border: 0; background: transparent; cursor: pointer; font-size: 14px; margin-left: 6px; padding: 0 4px; vertical-align: 1px; opacity: .7; }
.say-btn:hover { opacity: 1; }
.msg-extra { display: grid; gap: 8px; }
.msg-extra .doc-cards { grid-template-columns: 1fr; gap: 8px; }
.msg-extra .doc-card { padding: 9px 11px; }
.msg-extra .tiles { grid-template-columns: 1fr 1fr; gap: 8px; }
.msg-extra .tile { box-shadow: none; border: 1px solid var(--line); padding: 8px 10px; }
.msg-extra .tile .value { font-size: 17px; }
.msg-extra .chips-row { margin: 0; }

/* ---------- Accueil ---------- */
.home-hero { display: flex; align-items: center; gap: 24px; margin: 4px 0 20px; }
.home-hello h1 { margin: 0 0 6px; font-size: 26px; color: var(--blue); font-weight: 650; }
.home-brief { margin: 0; font-size: 16px; max-width: 780px; }
.orb {
  position: relative; flex: none; width: 92px; height: 92px; border-radius: 50%; border: 0; padding: 0; cursor: pointer;
  background: radial-gradient(circle at 35% 30%, #ffd3b0 0%, var(--orange) 48%, var(--orange-dark) 100%);
  box-shadow: 0 0 0 6px var(--orange-soft), 0 10px 30px rgba(222, 114, 47, .35); transition: transform .2s, background .3s;
}
.orb:hover { transform: scale(1.04); }
.orb-ring { position: absolute; inset: -11px; border-radius: 50%; border: 2px solid rgba(222, 114, 47, .35); animation: orb-breathe 3.2s ease-in-out infinite; }
.orb-core { position: absolute; inset: 31%; border-radius: 50%; background: rgba(255, 255, 255, .88); box-shadow: 0 0 18px #fff; }
.orb.listening { background: radial-gradient(circle at 35% 30%, #ffb3ad, var(--bad) 55%, #7d1a14); box-shadow: 0 0 0 6px var(--bad-soft), 0 10px 30px rgba(179, 38, 30, .35); }
.orb.listening .orb-ring { border-color: rgba(179, 38, 30, .55); animation: orb-pulse 1.2s ease-out infinite; }
.orb.thinking, .orb.speaking { background: radial-gradient(circle at 35% 30%, #c4dbe5, var(--blue) 55%, var(--blue-dark)); box-shadow: 0 0 0 6px var(--blue-soft), 0 10px 30px rgba(54, 91, 109, .35); }
.orb.thinking .orb-ring { border: 3px dashed rgba(54, 91, 109, .55); animation: orb-spin 1.6s linear infinite; }
.orb.speaking .orb-core { animation: orb-talk .45s ease-in-out infinite alternate; }
@keyframes orb-breathe { 0%, 100% { transform: scale(1); opacity: .55; } 50% { transform: scale(1.07); opacity: 1; } }
@keyframes orb-pulse { 0% { transform: scale(.92); opacity: 1; } 100% { transform: scale(1.35); opacity: 0; } }
@keyframes orb-spin { to { transform: rotate(360deg); } }
@keyframes orb-talk { from { transform: scale(.82); } to { transform: scale(1.12); } }
@media (prefers-reduced-motion: reduce) { .orb-ring, .orb-core { animation: none !important; } }

.ask { display: flex; gap: 8px; margin-bottom: 12px; }
.ask input { font-size: 16px; padding: 13px 16px; border-radius: 12px; border-color: transparent; box-shadow: var(--shadow); }
.ask .btn { border-radius: 12px; padding: 0 22px; }
.chips-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 18px; }
.chips-row .chip { color: var(--blue); border-color: #d3e0e6; }
.chips-row .chip:hover { background: var(--blue-soft); }
.chip.static { cursor: default; }
.home-cards { display: grid; gap: 16px; margin-bottom: 18px; }
.home-recent { margin-top: 4px; }
.ai-cost { font-size: 12px; color: var(--muted); text-align: center; margin: 22px 0 0; }

/* Scène 3D de l'atelier (accueil) */
.scene { height: 300px; margin-bottom: 18px; overflow: hidden; position: relative; background: linear-gradient(#dfe9ee, #f6f8f9); }
.scene-home { height: clamp(380px, 60vh, 820px); }
.brief { margin-bottom: 16px; }
.brief-text { margin: 0 0 10px; font-size: 16px; }
.scene canvas { display: block; width: 100% !important; height: 100% !important; }
.scene .scene-cap { position: absolute; left: 14px; bottom: 10px; font-size: 12px; color: var(--muted); background: rgba(255, 255, 255, .7); padding: 2px 8px; border-radius: 6px; }

/* Page IA */
.ai-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.ai-grid .fields { grid-template-columns: 1fr 1fr; }
.ai-log td { vertical-align: top; font-size: 13px; }
.ai-log tbody tr.static { cursor: default; }
.ai-log tbody tr.static:hover { background: transparent; }
.view-head .sub { color: var(--muted); font-size: 13px; }

/* Tuiles */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.tile { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px; min-width: 0; }
.tile .label { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
.tile .value { font-size: 22px; font-weight: 700; color: var(--blue); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile .hint { font-size: 12px; color: var(--muted); }
.tile.bad .value { color: var(--bad); }

/* Fiches de documents */
.doc-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.doc-cards h3 { grid-column: 1 / -1; margin: 6px 0 0; font-size: 13px; text-transform: uppercase; letter-spacing: .8px; color: var(--blue); }
.doc-card {
  display: flex; flex-direction: column; gap: 6px; text-align: left; font: inherit; color: inherit; cursor: pointer; min-width: 0;
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; transition: border-color .15s, box-shadow .15s;
}
.doc-card:hover { border-color: var(--blue); box-shadow: var(--shadow); }
.dc-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.dc-num { font-weight: 650; color: var(--blue); }
.dc-date { font-size: 13px; color: var(--muted); margin-right: auto; }
.dc-who { font-weight: 500; }
.doc-card .sub { color: var(--muted); font-weight: 400; font-size: 13px; }
.dc-lines { list-style: none; margin: 0; padding: 0; font-size: 13px; }
.dc-lines li { display: flex; justify-content: space-between; gap: 10px; padding: 2px 0; border-bottom: 1px dashed var(--line); }
.dc-lines li:last-child { border-bottom: 0; }
.dc-lines li span:last-child { white-space: nowrap; }
.dc-total { font-size: 13px; color: var(--muted); text-align: right; }
.dc-total strong { color: var(--ink); }

/* Fiche client */
.client-card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; display: grid; gap: 4px; }
.cc-name { font-weight: 650; color: var(--blue); font-size: 16px; }
.client-card a { text-decoration: none; }
.client-card .sub { color: var(--muted); font-size: 13px; white-space: pre-line; }
.cc-veh { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0; }

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: 34px; transform: translateX(-50%); background: var(--ink); color: #fff;
  padding: 10px 16px; border-radius: 10px; font-size: 14px; z-index: 60; box-shadow: var(--shadow);
}
.toast.bad { background: var(--bad); }
.flash { animation: flash 1.2s ease-out; }
@keyframes flash { 0% { box-shadow: 0 0 0 3px var(--orange); } 100% { box-shadow: var(--shadow); } }

.print-frame { position: fixed; width: 0; height: 0; border: 0; visibility: hidden; }

/* Pied de page */
.credit { text-align: center; font-size: 11px; color: #9aa7ad; padding: 10px 0 14px; letter-spacing: .3px; }
body.login .credit { position: fixed; bottom: 0; left: 0; right: 0; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .charts, .doc-grid, .ai-grid { grid-template-columns: 1fr; }
  .scene { height: 220px; }
  .settings-group .fields { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .grid td, .grid th { padding: 10px 8px; }
  .topbar { padding: 8px 12px; gap: 10px; }
  .brand img { height: 32px; }
  .topbar nav a { padding: 6px 9px; font-size: 14px; }
  .view { padding: 18px 12px 120px; }
  .fields, .settings-group .fields { grid-template-columns: 1fr; }
  .kpi .value { font-size: 20px; }
  .grid .hide-sm { display: none; }
  .lines-edit .c-kind, .lines-edit .c-unit, .lines-edit .c-vat { display: none; }
  .home-hero { gap: 16px; align-items: flex-start; }
  .scene-home { height: 260px; }
  .orb { width: 64px; height: 64px; }
  .home-hello h1 { font-size: 21px; }
  .home-brief { font-size: 15px; }
  .ask .btn { padding: 0 14px; }
  .doc-cards { grid-template-columns: 1fr; }
  .tiles { grid-template-columns: 1fr 1fr; }
  .topbar nav { overflow-x: auto; }
  .catalog .c-note, .catalog .c-unit, .catalog .c-kind { display: none; }
}
