/* Neuréty — « Mon bilan du mois » : document A4 blanc, imprimable / exportable en PDF. */
.bilan-screen { max-width: 860px; margin: 0 auto; }
.bilan-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.bilan-toolbar .segmented { flex: 1; justify-content: center; }
.bilan-hint { color: var(--muted); font-size: 13px; text-align: center; margin: 4px 0 16px; }
@media (max-width: 480px) { .hide-xs { display: none; } .bilan-toolbar .segmented { order: 3; flex-basis: 100%; } }

.paper {
  --ink: #14161F; --ink-2: #4A5068; --ink-3: #8A90A6; --rule: #E2E5EE; --zebra: #F6F7FA; --accent: #0FA88F; --neg: #D9534A; --warn: #B7791F;
  background: #fff; color: var(--ink); width: min(210mm, 100%); min-height: 297mm; margin: 0 auto;
  padding: clamp(18px, 5vw, 15mm) clamp(16px, 5vw, 15mm) 14mm; border-radius: 6px;
  box-shadow: 0 30px 80px rgb(0 0 0 / .45); font-size: 10.5pt; line-height: 1.45;
  font-variant-numeric: tabular-nums; color-scheme: light;
}
.paper .num { text-align: right; white-space: nowrap; }
.paper .neg { color: var(--neg); }
.paper .pos { color: var(--accent); }
.paper .amber { color: var(--warn); }
.paper .mint { color: var(--accent); }
.paper .coral { color: var(--neg); }

.doc-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; padding-bottom: 14px; border-bottom: 2px solid var(--ink); }
.doc-logo { height: 34px; width: auto; margin-top: 4px; }
.doc-id { text-align: right; font-size: 9.5pt; color: var(--ink-2); }
.doc-id .k { font: 500 7.5pt "JetBrains Mono", monospace; color: var(--ink-3); text-transform: uppercase; letter-spacing: .06em; margin-right: 8px; }
.doc-kind { font-size: 15pt; font-weight: 700; color: var(--ink); letter-spacing: -.01em; margin-bottom: 4px; }

.doc-warning {
  margin: 12px 0 16px; padding: 8px 12px; border: 1px solid var(--rule); border-left: 3px solid var(--accent);
  background: var(--zebra); font-size: 8.5pt; color: var(--ink-2); border-radius: 0 4px 4px 0;
}

.doc-summary { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--rule); border-radius: 6px; overflow: hidden; }
.sum-cell { padding: 10px 12px; border-right: 1px solid var(--rule); }
.sum-cell:last-child { border-right: 0; }
.sum-cell.main { background: var(--zebra); }
.sum-k { font-size: 8pt; color: var(--ink-3); text-transform: uppercase; letter-spacing: .04em; font-weight: 600; }
.sum-v { font-size: 13pt; font-weight: 700; margin-top: 2px; letter-spacing: -.01em; }
.sum-cell.main .sum-v { font-size: 15pt; }
@media (max-width: 560px) {
  .doc-summary { grid-template-columns: 1fr 1fr; }
  .sum-cell:nth-child(2) { border-right: 0; }
  .sum-cell:nth-child(-n+2) { border-bottom: 1px solid var(--rule); }
  .doc-head { flex-direction: column; } .doc-id { text-align: left; }
}

.doc-h { font-size: 10.5pt; font-weight: 700; margin: 20px 0 8px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink); }
.doc-table { width: 100%; border-collapse: collapse; font-size: 9.5pt; }
.doc-table th { text-align: left; font-size: 7.8pt; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); font-weight: 600; padding: 6px 8px; border-bottom: 1px solid var(--ink); }
.doc-table th.num { text-align: right; }
.doc-table td { padding: 6px 8px; border-bottom: 1px solid var(--rule); vertical-align: top; }
.doc-table tbody tr:nth-child(even) td { background: var(--zebra); }
.doc-table tr.fixe td { color: var(--ink-2); }
.doc-table td.date { white-space: nowrap; color: var(--ink-2); }
.doc-table td.cat { color: var(--ink-2); white-space: nowrap; }
.doc-table td.solde { font-weight: 600; }
.doc-table td.none { text-align: center; color: var(--ink-3); padding: 14px; }
.doc-table tfoot td { font-weight: 700; border-top: 2px solid var(--ink); border-bottom: 0; padding-top: 8px; }
.doc-table tr { break-inside: avoid; }
@media (max-width: 560px) { .doc-table th:nth-child(3), .doc-table td.cat { display: none; } .doc-table tfoot td:first-child { } }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
@media (max-width: 560px) { .doc-table { font-size: 8.5pt; } .doc-table td, .doc-table th { padding: 6px 5px; } }
.doc-note { font-size: 8pt; color: var(--ink-3); margin: 6px 0 0; }

.doc-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 560px) { .doc-cols { grid-template-columns: 1fr; gap: 0; } }
.doc-box { break-inside: avoid; }
.cat-row { margin-bottom: 8px; }
.cat-line { display: flex; justify-content: space-between; gap: 10px; font-size: 9.5pt; }
.cat-bar { height: 6px; background: var(--zebra); border-radius: 3px; overflow: hidden; margin-top: 3px; }
.cat-bar i { display: block; height: 100%; background: var(--accent); border-radius: 3px; }
.cat-bar.prev i { background: #B9BFD0; }
.doc-muted { color: var(--ink-3); font-size: 9pt; margin: 6px 0 0; }

.doc-attention { break-inside: avoid; }
.doc-points { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; break-inside: avoid; }
@media (max-width: 560px) { .doc-attention { break-inside: avoid; }
.doc-points { grid-template-columns: 1fr 1fr; } }
.point { border: 1px solid var(--rule); border-radius: 6px; padding: 10px; }
.point-k { font-size: 7.8pt; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-3); font-weight: 600; }
.point-v { font-size: 12.5pt; font-weight: 700; margin: 3px 0; }
.point-t { font-size: 8.5pt; color: var(--ink-2); }

.doc-foot { margin-top: 22px; padding-top: 10px; border-top: 1px solid var(--rule); font-size: 8pt; color: var(--ink-3); break-inside: avoid; }
.doc-foot p { margin: 0 0 4px; }
.doc-brand { font-family: "JetBrains Mono", monospace; font-size: 7.5pt; }

/* ---------- Impression : seule la feuille blanche sort, au format A4 ---------- */
@page {
  size: A4; margin: 12mm 12mm 16mm;
  @bottom-left { content: "Neuréty · Bilan personnel indicatif, non officiel. Ce n'est pas un relevé bancaire."; font: 7.5pt "DM Sans", sans-serif; color: #8A90A6; }
  @bottom-right { content: "Page " counter(page) " / " counter(pages); font: 7.5pt "DM Sans", sans-serif; color: #8A90A6; }
}
@media print {
  :root { color-scheme: light !important; }
  html, body { background: #fff !important; height: auto; }
  body::before { display: none !important; }
  body * { visibility: hidden; }
  .paper, .paper * { visibility: visible; }
  .nav, .fab, .bilan-toolbar, .bilan-hint, .toast, .sheet-wrap { display: none !important; }
  .main { padding: 0 !important; max-width: none !important; margin: 0 !important; }
  .table-wrap { overflow: visible !important; }
  .doc-table { font-size: 9.5pt !important; }
  .paper { position: absolute; left: 0; top: 0; width: 100%; min-height: 0; margin: 0; padding: 0; box-shadow: none; border-radius: 0; font-size: 10pt; }
  .paper * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .doc-summary { grid-template-columns: repeat(4, 1fr) !important; }
  .doc-cols { grid-template-columns: 1fr 1fr !important; }
  .doc-attention { break-inside: avoid; }
.doc-points { grid-template-columns: repeat(4, 1fr) !important; }
  .doc-table th:nth-child(3), .doc-table td.cat { display: table-cell !important; }
  .doc-head { flex-direction: row !important; } .doc-id { text-align: right !important; }
}
