/* MonOutilGestion — interface. Mobile d'abord, aucune dépendance externe. */
:root {
  --c-primary: #1f4e79;
  --c-primary-600: #173d5f;
  --c-primary-50: #eaf1f8;
  --c-text: #1d2935;
  --c-muted: #5b6b7c;
  --c-border: #d6dee7;
  --c-bg: #f4f6f8;
  --c-card: #ffffff;
  --c-ok: #1e7d4f;
  --c-ok-bg: #e4f4ea;
  --c-warn: #8a5a00;
  --c-warn-bg: #fff3d6;
  --c-err: #b42318;
  --c-err-bg: #fdecea;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
  --nav-h: 62px;
  font-size: 16px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--c-text); background: var(--c-bg); line-height: 1.45;
  -webkit-text-size-adjust: 100%;
}
a { color: var(--c-primary); }
h1 { font-size: 1.45rem; margin: 0 0 .25rem; }
h2 { font-size: 1.05rem; margin: 0 0 .75rem; }
code { background: var(--c-primary-50); padding: .1rem .3rem; border-radius: 4px; }
[hidden] { display: none !important; }

/* Structure */
.topbar {
  position: sticky; top: 0; z-index: 30; height: 56px; display: flex; align-items: center; justify-content: space-between;
  padding: 0 1rem; background: var(--c-primary); color: #fff;
}
.brand { color: #fff; text-decoration: none; font-weight: 700; display: flex; align-items: center; gap: .5rem; font-size: 1.1rem; }
.topbar-actions { display: flex; align-items: center; gap: .75rem; }
.menu { position: relative; }
.menu summary { cursor: pointer; list-style: none; padding: .4rem .6rem; border-radius: 8px; }
.menu summary::-webkit-details-marker { display: none; }
.menu summary:hover { background: rgba(255,255,255,.12); }
.menu-panel {
  position: absolute; right: 0; top: 110%; min-width: 230px; background: #fff; border-radius: var(--radius);
  box-shadow: 0 10px 30px rgba(0,0,0,.18); padding: .4rem; display: flex; flex-direction: column; z-index: 40;
}
.menu-panel a, .menu-panel .linklike { color: var(--c-text); text-decoration: none; padding: .6rem .75rem; border-radius: 6px; text-align: left; }
.menu-panel a:hover, .menu-panel .linklike:hover { background: var(--c-primary-50); }
.linklike { background: none; border: 0; font: inherit; cursor: pointer; width: 100%; }
.shell { display: flex; min-height: calc(100vh - 56px); }
.sidenav {
  position: fixed; bottom: 0; left: 0; right: 0; height: calc(var(--nav-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom); background: #fff; border-top: 1px solid var(--c-border);
  display: flex; justify-content: space-around; z-index: 30;
}
.sidenav a {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  color: var(--c-muted); text-decoration: none; font-size: .72rem; min-width: 0;
}
.sidenav a.active { color: var(--c-primary); font-weight: 600; }
.content { flex: 1; padding: 1rem; padding-bottom: calc(var(--nav-h) + 1.5rem); max-width: 1200px; width: 100%; margin: 0 auto; min-width: 0; }
.appfoot { display: none; }

@media (min-width: 900px) {
  .sidenav {
    position: sticky; top: 56px; height: calc(100vh - 56px); width: 210px; flex-direction: column; justify-content: flex-start;
    border-top: 0; border-right: 1px solid var(--c-border); padding: 1rem .6rem; gap: .2rem;
  }
  .sidenav a { flex: 0; flex-direction: row; justify-content: flex-start; gap: .7rem; padding: .65rem .8rem; border-radius: 8px; font-size: .95rem; }
  .sidenav a.active { background: var(--c-primary-50); }
  .content { padding: 1.5rem 2rem 3rem; }
  .appfoot { display: block; text-align: center; color: var(--c-muted); font-size: .75rem; padding: 1rem; }
}
@media (max-width: 899px) { .hide-mobile { display: none !important; } }

/* Icônes (masques CSS) */
.ico { width: 22px; height: 22px; background: currentColor; display: inline-block; flex: none;
  -webkit-mask: var(--i) center / contain no-repeat; mask: var(--i) center / contain no-repeat; }
.ico-home { --i: url("../img/i-home.svg"); }
.ico-quote { --i: url("../img/i-quote.svg"); }
.ico-invoice { --i: url("../img/i-invoice.svg"); }
.ico-users { --i: url("../img/i-users.svg"); }
.ico-box { --i: url("../img/i-box.svg"); }
.ico-chart { --i: url("../img/i-chart.svg"); }

/* Composants */
.page-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: .75rem; margin-bottom: 1rem; }
.quick { display: flex; flex-wrap: wrap; gap: .5rem; }
.card { background: var(--c-card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1rem; margin-bottom: 1rem; border: 0; min-width: 0; }
fieldset.card { margin-inline: 0; }
.card > legend { font-weight: 700; padding: 0 .3rem; font-size: 1rem; float: left; width: 100%; margin-bottom: .6rem; }
.card > legend + * { clear: both; }
.center { text-align: center; }
.right { text-align: right; }
.muted { color: var(--c-muted); }
.small, .help { font-size: .85rem; }
.help { color: var(--c-muted); margin: .25rem 0 0; }
.note { background: var(--c-primary-50); padding: .6rem .8rem; border-radius: 8px; }
.grid-2, .grid-3 { display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 900px) { .grid-2 { grid-template-columns: 1fr 1fr; } .grid-3 { grid-template-columns: repeat(3, 1fr); } }
.grid-2 > .card, .grid-3 > .card { margin-bottom: 0; }
.grid-2, .grid-3 { margin-bottom: 1rem; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .35rem; min-height: 44px; padding: .5rem 1rem;
  border-radius: 8px; border: 1px solid var(--c-border); background: #fff; color: var(--c-text); font: inherit; font-weight: 600;
  text-decoration: none; cursor: pointer; white-space: nowrap;
}
.btn:hover { border-color: var(--c-primary); }
.btn-primary { background: var(--c-primary); border-color: var(--c-primary); color: #fff; }
.btn-primary:hover { background: var(--c-primary-600); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--c-muted); }
.btn-danger { color: var(--c-err); }
.btn-sm { min-height: 36px; padding: .3rem .7rem; font-size: .88rem; }
.btn-block { width: 100%; }
.topbar .btn-primary { background: #fff; color: var(--c-primary); }

.flash { padding: .75rem 1rem; border-radius: 8px; margin-bottom: 1rem; }
.flash-success { background: var(--c-ok-bg); color: var(--c-ok); }
.flash-error { background: var(--c-err-bg); color: var(--c-err); }
.flash-warning { background: var(--c-warn-bg); color: var(--c-warn); }
.empty { background: #fff; border: 2px dashed var(--c-border); border-radius: var(--radius); padding: 2rem; text-align: center; color: var(--c-muted); }

.tag { display: inline-block; font-size: .75rem; padding: .1rem .5rem; border-radius: 999px; background: var(--c-primary-50); color: var(--c-primary); font-weight: 600; }
.status { display: inline-block; font-size: .78rem; padding: .15rem .55rem; border-radius: 999px; font-weight: 600; background: #eef1f4; color: var(--c-muted); }
.status-envoye, .status-validee { background: #e6effa; color: #1f5fa8; }
.status-accepte, .status-payee { background: var(--c-ok-bg); color: var(--c-ok); }
.status-refuse, .status-retard, .status-annulee { background: var(--c-err-bg); color: var(--c-err); }
.status-expire { background: var(--c-warn-bg); color: var(--c-warn); }

.chips { display: flex; gap: .4rem; overflow-x: auto; padding-bottom: .4rem; margin-bottom: .75rem; }
.chip { flex: none; padding: .4rem .85rem; border-radius: 999px; background: #fff; border: 1px solid var(--c-border); text-decoration: none; color: var(--c-text); font-size: .88rem; }
.chip.active { background: var(--c-primary); border-color: var(--c-primary); color: #fff; }

/* Formulaires */
input, select, textarea {
  font: inherit; font-size: 16px; /* évite le zoom iOS */ width: 100%; min-height: 44px; padding: .5rem .65rem;
  border: 1px solid var(--c-border); border-radius: 8px; background: #fff; color: var(--c-text);
}
textarea { min-height: 0; resize: vertical; }
input[type=checkbox], input[type=radio] { width: 20px; height: 20px; min-height: 0; accent-color: var(--c-primary); }
input[type=color] { padding: 2px; width: 70px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--c-primary); outline-offset: 1px; border-color: var(--c-primary); }
label { display: flex; flex-direction: column; gap: .25rem; font-size: .88rem; font-weight: 600; color: #34465a; }
label.check { flex-direction: row; align-items: center; gap: .5rem; font-weight: 500; }
.form { display: block; }
.stack { display: flex; flex-direction: column; gap: .9rem; }
.grid-form { display: grid; gap: .75rem; grid-template-columns: 1fr; }
@media (min-width: 700px) { .grid-form { grid-template-columns: repeat(3, 1fr); } .span-2 { grid-column: span 2; } .span-3 { grid-column: 1 / -1; } }
.form-actions { display: flex; justify-content: flex-end; gap: .5rem; flex-wrap: wrap; margin-top: 1rem; }
.sticky-actions { position: sticky; bottom: calc(var(--nav-h) + env(safe-area-inset-bottom)); background: rgba(244,246,248,.95); padding: .6rem 0; z-index: 5; backdrop-filter: blur(4px); }
@media (min-width: 900px) { .sticky-actions { bottom: 0; } }
.inline-form { display: flex; flex-wrap: wrap; gap: .5rem; align-items: flex-end; }
.inline-form label { flex: 1 1 140px; }
.actions-bar { display: flex; flex-wrap: wrap; gap: .5rem; align-items: flex-end; }
.filters { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: 1rem; align-items: center; }
.filters input[type=search] { flex: 1 1 220px; width: auto; }
.filters select { width: auto; }
.segmented { display: inline-flex; border: 1px solid var(--c-border); border-radius: 8px; overflow: hidden; margin-bottom: .9rem; }
.segmented label { flex-direction: row; align-items: center; gap: .4rem; padding: .55rem .9rem; cursor: pointer; }
.segmented label:has(input:checked) { background: var(--c-primary-50); color: var(--c-primary); }
.repeat-item { border: 1px solid var(--c-border); border-radius: 8px; padding: .75rem; margin-bottom: .75rem; background: #fbfcfd; }
.settings-list { display: grid; gap: 1.1rem; }
.setting label.switch { flex-direction: row; align-items: center; gap: .6rem; font-weight: 600; }
.code-input { font-size: 1.6rem; letter-spacing: .3em; text-align: center; }
.qr { background: #fff; border: 1px solid var(--c-border); border-radius: 8px; }

/* Tableaux */
.table-wrap { overflow-x: auto; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 1rem; }
.card .table-wrap { box-shadow: none; }
.table { width: 100%; border-collapse: collapse; font-size: .93rem; }
.table th, .table td { padding: .65rem .75rem; border-bottom: 1px solid #edf1f5; text-align: left; vertical-align: top; }
.table th { font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; color: var(--c-muted); background: #fafbfc; }
.table .num, .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.table tr.inactive td { color: #9aa7b4; }
@media (max-width: 699px) {
  .table-cards thead { display: none; }
  .table-cards, .table-cards tbody, .table-cards tr, .table-cards td { display: block; width: 100%; }
  .table-cards tr { border-bottom: 1px solid var(--c-border); padding: .5rem 0; }
  .table-cards td { border: 0; padding: .2rem .9rem; display: flex; justify-content: space-between; gap: 1rem; text-align: right; }
  .table-cards td::before { content: attr(data-label); color: var(--c-muted); font-size: .8rem; text-align: left; }
  .table-cards td:empty { display: none; }
}

/* Tableau de bord */
.kpi-grid { display: grid; gap: 1rem; grid-template-columns: 1fr; margin-bottom: 1rem; }
@media (min-width: 900px) { .kpi-grid { grid-template-columns: repeat(3, 1fr); } }
.kpi { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 1rem; }
.kpi h2 { font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--c-muted); margin: 0 0 .4rem; }
.kpi-value { font-size: 1.6rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.kpi-value small { font-size: .8rem; font-weight: 500; color: var(--c-muted); }
.kpi-compare { font-size: .82rem; color: var(--c-muted); margin: .2rem 0 .6rem; }
.delta { font-weight: 700; }
.delta.up { color: var(--c-ok); }
.delta.down { color: var(--c-err); }
.kpi-details { margin: 0; display: grid; gap: .4rem; }
.kpi-details > div { display: flex; justify-content: space-between; gap: 1rem; border-top: 1px solid #edf1f5; padding-top: .4rem; }
.kpi-details dt { color: var(--c-muted); font-size: .88rem; }
.kpi-details dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; }
.facts { padding-left: 1.1rem; margin: 0 0 1rem; }
.facts li { margin-bottom: .35rem; }
.legend { font-size: .82rem; color: var(--c-muted); display: flex; align-items: center; gap: .4rem; margin: -.4rem 0 .6rem; }
.sw { display: inline-block; width: 12px; height: 12px; border-radius: 3px; }
.sw-cur, .bar.cur { background: var(--c-primary); }
.sw-prev, .bar.prev { background: #b9c9da; }
.bars { display: grid; grid-template-columns: repeat(12, 1fr); gap: 4px; height: 190px; align-items: end; }
.bar-col { display: flex; flex-direction: column; align-items: stretch; height: 100%; justify-content: flex-end; min-width: 0; }
.bar-pair { flex: 1; display: flex; align-items: flex-end; gap: 2px; }
.bar { flex: 1; border-radius: 3px 3px 0 0; min-height: 1px; height: 0; transition: height .4s; }
.bar-label { font-size: .66rem; color: var(--c-muted); text-align: center; margin-top: 3px; overflow: hidden; }
.gauge { margin-bottom: .9rem; }
.gauge-head { display: flex; justify-content: space-between; font-size: .85rem; font-weight: 600; gap: .5rem; }
.gauge-track { height: 10px; background: #e7ecf1; border-radius: 999px; overflow: hidden; margin-top: .3rem; }
.gauge-fill { display: block; height: 100%; width: 0; background: var(--c-ok); border-radius: 999px; transition: width .4s; }
.gauge.warn .gauge-fill { background: #d99a00; }
.gauge.over .gauge-fill { background: var(--c-err); }

/* Éditeur de documents */
.picker { position: relative; }
.suggest {
  position: absolute; left: 0; right: 0; top: 100%; z-index: 20; list-style: none; margin: 2px 0 0; padding: .3rem;
  background: #fff; border: 1px solid var(--c-border); border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.12); max-height: 300px; overflow: auto;
}
.suggest li { padding: .6rem .7rem; border-radius: 6px; cursor: pointer; }
.suggest li:hover, .suggest li.on { background: var(--c-primary-50); }
.suggest li small { display: block; color: var(--c-muted); }
.lines { display: flex; flex-direction: column; gap: .6rem; }
.line {
  display: grid; gap: .5rem; padding: .6rem; border: 1px solid var(--c-border); border-radius: 8px; background: #fbfcfd;
  grid-template-columns: repeat(2, 1fr);
}
.line .drag { display: none; }
.line .line-label { grid-column: 1 / -1; display: flex; flex-direction: column; gap: .35rem; }
.line .cell span { font-size: .75rem; }
.line .line-total { grid-column: 1 / -1; font-weight: 700; align-self: center; }
.line .line-total:not(:empty)::before { content: "Total HT : "; font-weight: 500; color: var(--c-muted); }
.line-more { grid-column: 1 / -1; }
.line-more summary { cursor: pointer; color: var(--c-muted); font-size: .85rem; list-style: none; padding: .2rem 0; }
.line-more summary::-webkit-details-marker { display: none; }
.line-more summary::after { content: " Options"; }
.line-head { display: none; }
.line-titre { background: var(--c-primary-50); }
.line-titre input { font-weight: 700; }
.line-texte input { font-style: italic; }
.line-soustotal { background: #f3f5f7; }
.line-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .75rem; align-items: center; }
.line-actions .picker { flex: 1 1 260px; }
@media (min-width: 1000px) {
  .line { grid-template-columns: 18px minmax(220px, 1fr) 80px 80px 100px 70px 90px 110px 36px; align-items: start; background: #fff; padding: .45rem; }
  .line .drag { display: block; color: #b0bcc8; cursor: grab; padding-top: .6rem; text-align: center; }
  .line .line-label { grid-column: auto; }
  .line .cell span { display: none; }
  .line .line-total { grid-column: auto; text-align: right; padding-top: .6rem; }
  .line .line-total:not(:empty)::before { content: none; }
  .line-more { grid-column: auto; position: relative; }
  .line-more summary { padding: .55rem .3rem; text-align: center; }
  .line-more summary::after { content: none; }
  .line-head { display: grid; border: 0; background: transparent; font-size: .75rem; color: var(--c-muted); text-transform: uppercase; font-weight: 700; padding-bottom: 0; }
  .line-titre .line-label, .line-texte .line-label, .line-soustotal .line-label { grid-column: 2 / 8; }
}
.line-more-panel { display: flex; flex-wrap: wrap; gap: .5rem; align-items: flex-end; padding-top: .4rem; }
.line-more-panel label { flex: 1 1 160px; }
@media (min-width: 1000px) {
  .line-more-panel { position: absolute; right: 0; top: 100%; width: 330px; background: #fff; border: 1px solid var(--c-border); border-radius: 8px; padding: .6rem; box-shadow: 0 8px 24px rgba(0,0,0,.12); z-index: 15; }
}
.totals { display: grid; gap: 1rem; grid-template-columns: 1fr; align-items: start; }
@media (min-width: 700px) { .totals { grid-template-columns: 220px 1fr; } }
.totals dl { margin: 0; display: grid; gap: .3rem; }
.totals dl > div { display: flex; justify-content: space-between; gap: 1rem; font-variant-numeric: tabular-nums; }
.totals dl dt { color: var(--c-muted); }
.totals dl dd { margin: 0; font-weight: 600; }
.totals .grand { font-size: 1.25rem; border-top: 2px solid var(--c-primary); padding-top: .3rem; }
.totals .grand dt { color: var(--c-text); font-weight: 700; }
.address { margin-bottom: .75rem; }
.copyable { cursor: copy; border-bottom: 1px dashed var(--c-primary); }

/* Aperçu du document */
.preview-wrap { overflow-x: auto; }
.paper { background: #fff; box-shadow: var(--shadow); border-radius: 4px; padding: 6%; max-width: 860px; margin: 0 auto; min-width: 640px; }
.pdoc { font-size: 12px; color: #1d2935; font-family: system-ui, sans-serif; }
.pdoc table { border-collapse: collapse; width: 100%; }
.pdoc .head td { vertical-align: top; }
.pdoc .logo { max-height: 60px; max-width: 200px; }
.pdoc .company { line-height: 1.45; font-size: 11px; }
.pdoc .company strong { font-size: 14px; }
.pdoc .doc-title { text-align: right; }
.pdoc .doc-title h1 { font-size: 24px; margin: 0 0 4px; color: var(--c-primary); }
.pdoc .doc-title .meta { line-height: 1.55; font-size: 11px; }
.pdoc .parties { margin-top: 14px; }
.pdoc .parties td { width: 50%; vertical-align: top; }
.pdoc .box { border: 1px solid #cfd8e3; border-radius: 4px; padding: 8px 10px; margin-left: 8px; line-height: 1.45; }
.pdoc .box-label { font-size: 10px; text-transform: uppercase; color: #5b6b7c; letter-spacing: .5px; }
.pdoc .subject { margin: 14px 0 6px; font-size: 13px; }
.pdoc table.lines { display: table; }
.pdoc .lines th { background: var(--c-primary); color: #fff; font-size: 11px; padding: 6px; text-align: left; }
.pdoc .lines td { padding: 6px; border-bottom: 1px solid #e3e8ee; vertical-align: top; }
.pdoc .num { text-align: right; white-space: nowrap; }
.pdoc .lines .title td { font-weight: bold; background: #f1f4f8; }
.pdoc .lines .text td { color: #4a5a6a; font-style: italic; }
.pdoc .lines .subtotal td { font-weight: bold; text-align: right; background: #fafbfc; }
.pdoc .lines .option td { color: #6b7b8b; }
.pdoc .desc { color: #5b6b7c; font-size: 11px; margin-top: 2px; }
.pdoc .totals { width: 48%; margin-left: 52%; margin-top: 10px; display: table; }
.pdoc .totals td { padding: 4px 6px; }
.pdoc .totals .grand td { font-weight: bold; font-size: 15px; border-top: 2px solid var(--c-primary); }
.pdoc .schedule { margin-top: 12px; font-size: 12px; width: 100%; border-collapse: collapse; }
.pdoc .schedule th { text-align: left; border-bottom: 1px solid var(--c-primary); color: var(--c-primary); padding: 4px 6px; font-size: 11px; }
.pdoc .schedule td { padding: 4px 6px; border-bottom: 1px solid #e3e8ee; }
.pdoc .schedule .sum td { font-weight: bold; text-align: right; }
.deposit-plan { display: grid; gap: .5rem; }
.deposit-plan .plan-row { display: grid; grid-template-columns: 2fr 5rem 2fr; gap: .5rem; }
.track-bar { height: 10px; background: #e3e8ee; border-radius: 6px; overflow: hidden; margin: .4rem 0 .8rem; }
.track-bar span { display: block; height: 100%; background: var(--c-primary); }
.deposit-forms { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); margin-top: 1rem; }
.deposit-forms form { border: 1px solid #e3e8ee; border-radius: 10px; padding: .8rem; display: grid; gap: .5rem; align-content: start; }
.deposit-forms h3 { margin: 0; font-size: 1rem; }
@media (max-width: 640px) { .deposit-plan .plan-row { grid-template-columns: 1fr 4.5rem; } .deposit-plan .plan-row input[name$="[when]"] { grid-column: 1 / -1; } }
.pdoc .mentions { margin-top: 14px; font-size: 10.5px; color: #4a5a6a; line-height: 1.45; }
.pdoc .mentions p { margin: 0 0 3px; }
.pdoc .cert { border: 1px solid #cfd8e3; padding: 8px; margin-top: 10px; font-size: 10.5px; }
.pdoc .sign { margin-top: 12px; }
.pdoc .sign td { width: 50%; height: 80px; border: 1px dashed #b8c4d0; vertical-align: top; padding: 6px; font-size: 11px; }
.pdoc .bank { margin-top: 10px; font-size: 11px; }
.pdoc .footer { margin-top: 16px; font-size: 10px; color: #6b7b8b; text-align: center; border-top: 1px solid #e3e8ee; padding-top: 6px; }
.pdoc .draft { color: #c0392b; font-weight: bold; }
.pdoc style { display: none; }

/* Pages publiques (connexion, installation) */
body.public { display: grid; place-items: center; min-height: 100vh; padding: 1rem; }
.auth-box { background: #fff; border-radius: 14px; box-shadow: var(--shadow); padding: 2rem 1.5rem; width: 100%; max-width: 420px; }
.auth-box.wide { max-width: 720px; }
.auth-brand { display: flex; align-items: center; gap: .6rem; font-size: 1.15rem; margin-bottom: 1.25rem; color: var(--c-primary); }
.checks { list-style: none; padding: 0; margin: 0 0 1rem; }
.checks li { padding: .35rem 0; border-bottom: 1px solid #edf1f5; display: flex; justify-content: space-between; gap: 1rem; }
.checks .ok { color: var(--c-ok); font-weight: 700; }
.checks .ko { color: var(--c-err); font-weight: 700; }
.steps { display: flex; gap: .4rem; margin-bottom: 1rem; }
.steps span { flex: 1; height: 5px; border-radius: 3px; background: #e2e8ee; }
.steps span.done { background: var(--c-primary); }
.pdoc .sign td.signed { border-style: solid; border-color: var(--c-primary); }
.pdoc .sig-img { max-height: 60px; max-width: 220px; margin-top: 4px; display: block; }
.pdoc .certificate { margin-top: 30px; border-top: 2px dashed var(--c-border); padding-top: 16px; }
.pdoc .certificate h2 { font-size: 16px; color: var(--c-primary); }
.pdoc .cert-table th { text-align: left; width: 32%; vertical-align: top; padding: 5px 6px; background: #f1f4f8; font-size: 11px; }
.pdoc .cert-table td { padding: 5px 6px; border-bottom: 1px solid #e3e8ee; font-size: 11px; }
.pdoc .mono { font-family: ui-monospace, monospace; font-size: 10px; word-break: break-all; }
.pdoc .cert-note { font-size: 10.5px; color: #4a5a6a; }

/* 0.2.0 : e-mails, signature, exports, espace client */
.top-gap { margin-top: 1rem; }
.grow { flex: 1 1 260px; }
.mail-body { white-space: pre-wrap; font-family: inherit; background: #fafbfc; border: 1px solid var(--c-border); border-radius: 8px; padding: 1rem; }
.approve-list { list-style: none; padding: 0; margin: 0; }
.approve-list li { display: flex; justify-content: space-between; gap: 1rem; align-items: center; flex-wrap: wrap; padding: .6rem 0; border-bottom: 1px solid #edf1f5; }
.sigpad { position: relative; border: 2px dashed var(--c-primary); border-radius: 10px; background: #fff; touch-action: none; }
.sigpad canvas { display: block; width: 100%; height: 200px; cursor: crosshair; }
.sigpad-label { position: absolute; left: .8rem; top: .5rem; font-size: .8rem; color: var(--c-muted); pointer-events: none; }
.sigpad [data-sig-clear] { position: absolute; right: .3rem; bottom: .3rem; }
.sigpad.signed .sigpad-label { display: none; }
.auth-box.wide { max-width: 980px; }
.public-doc h1 { margin-bottom: .2rem; }
.public-doc .paper { min-width: 0; padding: 4%; }
.export-list { display: grid; gap: .75rem; grid-template-columns: 1fr; margin-top: 1rem; }
@media (min-width: 700px) { .export-list { grid-template-columns: repeat(3, 1fr); } }
.export-item { text-align: left; background: #fff; border: 1px solid var(--c-border); border-radius: 10px; padding: 1rem; cursor: pointer; font: inherit; display: flex; flex-direction: column; gap: .3rem; }
.export-item:hover { border-color: var(--c-primary); background: var(--c-primary-50); }
.export-item span { color: var(--c-muted); font-size: .85rem; }
details.card > summary { cursor: pointer; }

/* 0.3.0 : chantiers, photos, mode mobile */
.ico-site { --i: url("../img/i-site.svg"); }
.show-mobile { display: none; }
@media (max-width: 899px) { .show-mobile { display: block; } }
.tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: .6rem; margin-bottom: 1rem; }
@media (min-width: 700px) { .tiles { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1100px) { .tiles { grid-template-columns: repeat(6, 1fr); } }
.tile { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .35rem; min-height: 88px; padding: .8rem;
  background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); color: var(--c-text); text-decoration: none; font-weight: 600; text-align: center; font-size: .92rem; }
.tile:active { transform: scale(.98); }
.tile-ico { font-size: 1.6rem; line-height: 1; }
.tile-primary { background: var(--c-primary); color: #fff; }
.photos { margin: .5rem 0 1rem; }
.photos-title { font-size: .95rem; margin: .4rem 0; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: .5rem; margin-bottom: .6rem; }
.photo { position: relative; margin: 0; background: #eef1f4; border-radius: 8px; overflow: hidden; }
.photo img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.photo figcaption { font-size: .7rem; color: var(--c-muted); padding: .2rem .35rem; }
.photo.pending { outline: 2px dashed #d99a00; }
.photo-del { position: absolute; top: 4px; right: 4px; width: 28px; height: 28px; border-radius: 50%; border: 0; background: rgba(0,0,0,.55); color: #fff; font-size: 18px; line-height: 1; cursor: pointer; }
.photo-add { cursor: pointer; }
.dline .grid-form { align-items: end; }
.ico-cart { --i: url("../img/i-cart.svg"); }
tr.sep td { border-top: 2px solid var(--c-border); }
.table tr.grand td { font-size: 1.05rem; background: var(--c-primary-50); }
@media (max-width: 640px) { #facturation .table th:nth-child(2), #facturation .table td:nth-child(2) { display: none; } }

/* --- Console de la plateforme --- */
body.console { background: #f3f5f8; }
.console-bar { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1.25rem; padding: .7rem 1.25rem; background: #1f2d3d; color: #fff; }
.console-brand { display: flex; align-items: center; gap: .5rem; color: #fff; font-weight: 700; text-decoration: none; }
.console-nav { display: flex; flex-wrap: wrap; gap: .25rem .9rem; flex: 1; }
.console-nav a { color: #d6e2ee; text-decoration: none; }
.console-nav a:hover { color: #fff; text-decoration: underline; }
.console-logout { margin-left: auto; }
.console-main { max-width: 1200px; margin: 0 auto; padding: 1.25rem; }
.btn-small { padding: .3rem .7rem; font-size: .85rem; }
.kpis { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin-bottom: 1rem; }
.kpis .kpi { display: flex; flex-direction: column; gap: .2rem; color: inherit; text-decoration: none; }
.kpis .kpi strong { font-size: 1.5rem; }
.kpi-label { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--c-muted); }
.kpi-alert strong { color: var(--c-err); }
.form-grid { display: grid; gap: .9rem 1rem; grid-template-columns: 1fr; }
@media (min-width: 760px) { .form-grid { grid-template-columns: 1fr 1fr; } .form-grid .span-2 { grid-column: 1 / -1; } }
.input-suffix { display: flex; align-items: stretch; }
.input-suffix input { flex: 1; min-width: 0; border-top-right-radius: 0; border-bottom-right-radius: 0; }
.input-suffix span { display: flex; align-items: center; padding: 0 .6rem; background: #eef2f6; border: 1px solid #cfd8e3; border-left: 0; border-radius: 0 6px 6px 0; font-size: .9rem; color: var(--c-muted); white-space: nowrap; }
.tenants tr.is-off td { background: #fbf3f3; }
.toggle { display: inline-flex; align-items: center; gap: .45rem; border: 0; background: none; cursor: pointer; font: inherit; font-size: .85rem; color: var(--c-muted); padding: .2rem; }
.toggle span { width: 40px; height: 22px; border-radius: 11px; background: #c4ccd6; position: relative; transition: background .15s; flex: none; }
.toggle span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: left .15s; }
.toggle.on { color: var(--c-ok); font-weight: 600; }
.toggle.on span { background: var(--c-ok); }
.toggle.on span::after { left: 21px; }
.toggle:focus-visible span { outline: 2px solid var(--c-primary); outline-offset: 2px; }
.text-danger { color: var(--c-err); }
.status-brouillon { background: #eef2f6; color: #4a5a6a; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: .3rem 1rem; }
.kv dt { color: var(--c-muted); }
.kv dd { margin: 0; }
.card.created { border-left: 4px solid var(--c-ok); }
.danger-zone summary { cursor: pointer; color: var(--c-err); font-weight: 600; }
ul.plain { list-style: none; padding: 0; margin: 0; }
ul.plain li { padding: .3rem 0; border-bottom: 1px solid #edf1f5; }
.support-banner { background: #7a2e00; color: #fff; padding: .5rem 1rem; text-align: center; font-size: .9rem; }
.support-banner form { display: inline; }
.support-banner button { background: none; border: 1px solid #fff; color: #fff; border-radius: 4px; padding: .1rem .5rem; margin-left: .5rem; cursor: pointer; }

/* --- Modèles de documents --- */
.logo-row { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; margin-bottom: 1rem; }
.logo-preview { width: 200px; height: 90px; border: 1px dashed #cfd8e3; border-radius: 8px; display: flex; align-items: center; justify-content: center; background: #fff; }
.logo-preview img { max-width: 180px; max-height: 76px; }
.settings-list.cols-2, .settings-list.cols-3 { display: grid; gap: 1rem; }
@media (min-width: 760px) { .settings-list.cols-2 { grid-template-columns: 1fr 1fr; } .settings-list.cols-3 { grid-template-columns: repeat(3, 1fr); } }
.model-cards { display: grid; gap: .8rem; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin: .5rem 0 1rem; }
.model-card { display: flex; flex-direction: column; gap: .35rem; border: 2px solid #dfe6ee; border-radius: 10px; padding: .7rem; cursor: pointer; background: #fff; }
.model-card:hover { border-color: #b8c7d8; }
.model-card.selected, .model-card:has(input:checked) { border-color: var(--c-primary); box-shadow: 0 0 0 3px rgba(31, 78, 121, .12); }
.model-card input { position: absolute; opacity: 0; pointer-events: none; }
.model-card:has(input:focus-visible) { outline: 2px solid var(--c-primary); outline-offset: 2px; }
.mini { display: grid; gap: 4px; height: 96px; overflow: hidden; padding: 8px; border: 1px solid #e3e8ee; border-radius: 4px; background: #fff; align-content: start; }
.mini i { display: block; height: 6px; border-radius: 2px; background: #dfe6ee; }
.mini .h { height: 14px; width: 40%; background: #b8c7d8; }
.mini .l1 { width: 70%; } .mini .l2 { width: 50%; margin-bottom: 4px; }
.mini .t { height: 8px; background: var(--c-primary); }
.mini-moderne .h { width: 100%; height: 22px; background: var(--c-primary); }
.mini-epure .h { justify-self: center; } .mini-epure .l1, .mini-epure .l2 { justify-self: center; } .mini-epure .t { background: none; border-bottom: 2px solid var(--c-primary); border-radius: 0; }
.mini-chantier .h { height: 18px; width: 55%; } .mini-chantier .t { height: 10px; } .mini-chantier .r { border: 1px solid var(--c-primary); background: #fff; }
.sticky-actions { position: sticky; bottom: 0; background: rgba(243, 245, 248, .95); padding: .8rem 0; z-index: 5; }
.mail-preview { width: 100%; height: 460px; border: 1px solid #dfe6ee; border-radius: 8px; background: #f4f6f8; }
