/* Feuille complémentaire isolée dans #zb-price-calculator (charte : variables de default.css). */
.zbpc [hidden] { display: none !important; }
.zbpc { --zbpc-accent: var(--green-dark, #005f2e); --zbpc-accent-light: var(--green-light, #59ae34); --zbpc-soft: #eaf3ed; --zbpc-border: #d0e4d8; --zbpc-text: var(--text-dark, #0f2f22); --zbpc-ring: 0 0 0 3px rgba(0, 95, 46, .14); }
.zbpc .zbpc-intro { margin: 0 0 22px; color: var(--zbpc-text); }
.zbpc .zbpc-intro p { margin: 0 0 15px; }
.zbpc .zbpc-mode-tabs { display: inline-flex; flex-wrap: wrap; gap: 6px; padding: 5px; background: var(--zbpc-soft); border-radius: 11px; }
.zbpc .zbpc-tab { appearance: none; border: 1px solid transparent; border-radius: 8px; padding: 11px 16px; background: transparent; color: var(--zbpc-text); font: inherit; font-weight: 650; cursor: pointer; }
.zbpc .zbpc-tab.is-active { background: #fff; border-color: var(--zbpc-border); color: var(--zbpc-accent); box-shadow: 0 2px 6px rgba(0,0,0,.07); }

/* Focus : boutons = contour ; champs = bordure verte + halo (convention de section-outils.css,
   le halo n'est pas rogné par l'overflow:hidden de .calc-input-wrap). */
.zbpc button:focus-visible { outline: 3px solid rgba(89, 174, 52, .6); outline-offset: 2px; }
.zbpc .calc-input-wrap:focus-within,
.zbpc .calc-field > input:focus,
.zbpc .calc-field select:focus,
.zbpc .zbpc-table input:focus { border-color: var(--zbpc-accent); box-shadow: var(--zbpc-ring); outline: none; }

/* Champs posés directement dans .calc-field (hors .calc-input-wrap) : même rendu que les select. */
.zbpc .calc-field > input { width: 100%; box-sizing: border-box; border: 1.5px solid var(--zbpc-border); border-radius: 10px; padding: 10px 14px; font-size: .95rem; font-family: 'Montserrat', sans-serif; color: var(--zbpc-text); background: #fff; transition: border-color .2s; }
.zbpc .calc-field input:not([type=checkbox]), .zbpc .calc-field select { max-width: 100%; }

.zbpc .zbpc-table-scroller { width: 100%; overflow-x: auto; border: 1px solid var(--zbpc-border); border-radius: 11px; margin-top: 8px; background: #fff; }
.zbpc .zbpc-table { width: 100%; border-collapse: collapse; min-width: 560px; font-size: 13px; }
.zbpc .zbpc-table th { background: #f3f8f5; color: var(--text-gray, #5f5f5f); font-size: 12px; white-space: nowrap; text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--zbpc-border); }
.zbpc .zbpc-table td { padding: 7px 5px; border-bottom: 1px solid #edf4ef; }
.zbpc .zbpc-table tr:last-child td { border-bottom: 0; }
.zbpc .zbpc-table input { width: 100%; min-width: 0; border: 1px solid var(--zbpc-border); border-radius: 6px; padding: 9px 8px; background: #fff; color: var(--zbpc-text); font: inherit; box-sizing: border-box; }
.zbpc .zbpc-table th:nth-child(1) { min-width: 150px; }
.zbpc .zbpc-table th:nth-child(2) { width: 65px; }
.zbpc .zbpc-table th:nth-child(3) { width: 65px; }
.zbpc .zbpc-table th:nth-child(4) { width: 105px; }
.zbpc .zbpc-table th:nth-child(5) { width: 90px; }
.zbpc .zbpc-table th:nth-child(6) { width: 38px; }
/* Colonnes chiffrées (Qté, P. U., Total) alignées à droite, en-têtes compris. */
.zbpc .zbpc-table th:nth-child(2), .zbpc .zbpc-table th:nth-child(4), .zbpc .zbpc-table th:nth-child(5) { text-align: right; }
.zbpc .zbpc-table .zbpc-row-qty, .zbpc .zbpc-table .zbpc-row-price { text-align: right; font-variant-numeric: tabular-nums; }
.zbpc .zbpc-row-total { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.zbpc .zbpc-row-invalid { background: #fff1f1; }
.zbpc .zbpc-remove-row { cursor: pointer; width: 31px; height: 31px; border: 0; border-radius: 6px; color: #aa3040; background: #fff0f2; font: inherit; font-size: 22px; line-height: 1; }
.zbpc .zbpc-remove-row:hover { background: #ffdce2; }
.zbpc .zbpc-row-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.zbpc .zbpc-add-btn, .zbpc .zbpc-download-btn { border: 1px solid var(--zbpc-accent); border-radius: 8px; padding: 10px 13px; cursor: pointer; background: var(--zbpc-accent); color: #fff; font: inherit; font-size: 14px; font-weight: 650; transition: background-color .2s, border-color .2s; }
.zbpc .zbpc-add-btn:hover, .zbpc .zbpc-download-btn:hover:not(:disabled) { background: #004a24; border-color: #004a24; }
.zbpc .zbpc-download-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 100%; margin-top: 14px; }
.zbpc .zbpc-download-btn:disabled { opacity: .5; cursor: not-allowed; }
.zbpc .zbpc-cost-subtotal { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; justify-content: space-between; padding: 13px 0; border-top: 1px dashed var(--zbpc-border); margin-top: 10px; color: var(--zbpc-text); }
.zbpc .zbpc-section-divider { border: 0; border-top: 1px solid var(--zbpc-border); margin: 20px 0; }
.zbpc .zbpc-status { border-radius: 8px; padding: 12px 13px; background: #f1f4f2; color: #3d4b43; margin-top: 17px; font-size: 14px; line-height: 1.5; }
.zbpc .zbpc-status[data-type="error"] { background: #fff0f0; color: #982d35; }
.zbpc .zbpc-status[data-type="warning"] { background: #fff7e8; color: #85630e; }
.zbpc .zbpc-status[data-type="success"] { background: var(--zbpc-soft); color: var(--zbpc-accent); }
.zbpc .zbpc-loss { color: #b4313d !important; }
.zbpc .zbpc-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
@media (max-width: 620px) {
  .zbpc .zbpc-mode-tabs { display: flex; width: 100%; box-sizing: border-box; }
  .zbpc .zbpc-tab { flex: 1; padding: 11px 8px; font-size: 13px; }
  /* Chaque dépense devient une fiche compacte : pas de tableau à faire défiler sur téléphone. */
  .zbpc .zbpc-table-scroller { overflow: visible; }
  .zbpc .zbpc-table, .zbpc .zbpc-table tbody { display: block; min-width: 0; width: 100%; }
  .zbpc .zbpc-table thead { display: none; }
  .zbpc .zbpc-table tr { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 10px; padding: 12px; border-bottom: 1px solid var(--zbpc-border); }
  .zbpc .zbpc-table tr:last-child { border-bottom: none; }
  .zbpc .zbpc-table td { display: block; min-width: 0; padding: 0; border: 0; }
  .zbpc .zbpc-table td::before { content: attr(data-label); display: block; font-size: 11px; color: var(--text-gray, #5f5f5f); margin-bottom: 5px; }
  .zbpc .zbpc-table td:nth-child(1) { grid-column: 1 / -1; }
  .zbpc .zbpc-table td:nth-child(1)::before { content: none; }
  .zbpc .zbpc-table td:nth-child(5) { text-align: right; padding-top: 2px; }
  .zbpc .zbpc-table td:nth-child(6) { grid-column: 1 / -1; text-align: right; }
  .zbpc .zbpc-table td:nth-child(6)::before { display: none; }
  .zbpc .zbpc-row-actions > button { flex: 1 1 140px; }
}

