/* Portal de Decisions — estils basats en el mockup SAVA_docs/04_SAVA_portal_client.html */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --brand:    #AA162B;
  --brand-dk: #8A1122;
  --brand-hd: #3d0a10;
  --accent:   #c8a84b;
  --border:   #DEE2E6;
  --bg:       #F5F5F5;
  --white:    #ffffff;
  --gray:     #6b7280;
  --text:     #1A1A1A;
  --green:    #2e7d32;
  --green-lt: #e8f5e9;
  --red-lt:   #fdecea;
}

body {
  font-family: 'Inter', Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 13px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── TOPBAR ── */
.topbar {
  background: var(--brand);
  color: white;
  padding: 0 20px;
  height: 48px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky; top: 0; z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.22);
}
.topbar-brand { display: flex; flex-direction: column; }
.topbar-name  { font-size: 0.88rem; font-weight: 700; letter-spacing: 0.02em; }
.topbar-sub   { font-size: 0.63rem; color: rgba(255,255,255,0.55); letter-spacing: 0.09em; text-transform: uppercase; }
.topbar-accent { color: var(--accent); }

.lang-switch { display: flex; gap: 2px; background: rgba(0,0,0,0.18); border-radius: 5px; padding: 3px; }
.lang-btn {
  padding: 3px 9px; border-radius: 3px;
  font-size: 0.68rem; font-weight: 600; cursor: pointer;
  color: rgba(255,255,255,0.6); border: none; background: none;
  font-family: inherit; letter-spacing: 0.04em;
}
.lang-btn:hover { color: white; }
.lang-btn.active { background: rgba(255,255,255,0.22); color: white; }

/* ── ACCENT LINE ── */
.accent-line { height: 3px; background: linear-gradient(to right, var(--accent), #e8c97a, var(--accent)); flex-shrink: 0; }

/* ── PROGRESS BAR ── */
.progress-bar {
  background: var(--white); border-bottom: 1px solid var(--border);
  position: sticky; top: 48px; z-index: 90; flex-shrink: 0;
}
.progress-inner { padding: 7px 20px; display: flex; align-items: center; gap: 14px; }
.progress-label { font-size: 0.73rem; color: var(--gray); white-space: nowrap; }
.progress-label strong { color: var(--text); }
.progress-track { flex: 1; height: 5px; background: var(--border); border-radius: 3px; overflow: hidden; }
.progress-fill  { height: 100%; background: var(--green); border-radius: 3px; transition: width 0.6s ease; }
.progress-pct   { font-size: 0.73rem; font-weight: 700; color: var(--green); min-width: 32px; text-align: right; }

/* ── MAIN ── */
.main { flex: 1; width: 100%; padding: 16px 20px 16px; }

/* ── COMPLETION BANNER ── */
.completion-banner {
  display: none; background: var(--green-lt); border: 1.5px solid var(--green);
  border-radius: 8px; padding: 18px 22px; text-align: center; margin-bottom: 14px;
}
.completion-banner.show { display: block; }
.completion-title { font-size: 0.95rem; font-weight: 700; color: var(--green); margin-bottom: 5px; }
.completion-text  { font-size: 0.80rem; color: #374151; line-height: 1.65; }

/* ── ENVIAMENT CARD ── */
.env-card { background: var(--white); border: 1px solid var(--border); border-radius: 8px; overflow: hidden; margin-bottom: 14px; }
.env-head {
  background: var(--brand); color: white; padding: 9px 14px;
  font-size: 0.80rem; font-weight: 600; border-bottom: 2px solid var(--accent);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.env-head-left { display: flex; align-items: center; gap: 10px; }
.env-type { background: var(--accent); color: #3a2a00; font-size: 0.65rem; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; padding: 2px 9px; border-radius: 3px; }
.env-date { font-size: 0.70rem; color: rgba(255,255,255,0.5); }
.env-body { padding: 11px 14px; display: flex; gap: 18px; align-items: flex-start; }
.env-greeting { flex: 1; font-size: 0.80rem; color: var(--text); line-height: 1.65; }
.env-greeting strong { color: var(--brand); }
.env-comment { flex: 0 0 auto; max-width: 340px; background: #fff8e1; border-left: 3px solid var(--accent); padding: 8px 12px; border-radius: 0 5px 5px 0; font-size: 0.77rem; color: #5a4200; line-height: 1.5; }
.env-comment-lbl { font-size: 0.58rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; color: #a07800; margin-bottom: 3px; }

/* ── TABLE SECTION ── */
.table-section { background: var(--white); border: 1px solid var(--border); border-radius: 8px; overflow: hidden; margin-bottom: 12px; }
.table-head {
  background: var(--brand); color: white; padding: 9px 14px; font-size: 0.80rem; font-weight: 600;
  border-bottom: 2px solid var(--accent); display: flex; justify-content: space-between; align-items: baseline;
}
.table-head-sub { font-size: 0.68rem; color: rgba(255,255,255,0.5); font-weight: 400; }
.table-wrap { overflow-x: auto; }

.tbl { width: 100%; border-collapse: collapse; font-size: 0.78rem; }
.tbl thead { position: sticky; top: 0; }
.tbl th { background: var(--brand-hd); color: white; padding: 7px 10px; text-align: left; font-weight: 500; white-space: nowrap; border-right: 1px solid rgba(255,255,255,0.08); }
.tbl th:last-child { border-right: none; }
.tbl td { padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.tbl tr:nth-child(even) td { background: #fafafa; }
.tbl tr:hover td          { background: var(--red-lt); }
.tbl tr.row-decided:hover td  { background: #edf8ed; }
.tbl tr.row-decided td    { background: #f6fdf6; }
.tbl tr.row-abandoned td  { background: #f9f9f9; }
.tbl tr.row-abandoned:hover td { background: #f2f2f2; }
.tbl tr.row-info td       { background: #f0f8ff; }
.tbl tr.row-info:hover td { background: #e5f4ff; }
.tbl tr.row-projectada td       { background: #fffaf0; }
.tbl tr.row-projectada:hover td { background: #fff3d9; }
.tbl tr:last-child td     { border-bottom: none; }
.tbl tr.total-row td      { background: #f0f0f0 !important; font-weight: 700; font-size: 0.80rem; border-top: 2px solid var(--border); color: var(--text); }

/* ── CHECKBOX COLUMN ── */
.tbl th.check-th { width: 34px; text-align: center; padding: 6px; }
.tbl td.check-cell { text-align: center; padding: 0 6px; }
.row-check { width: 15px; height: 15px; cursor: pointer; accent-color: var(--brand); }
.check-all { width: 15px; height: 15px; cursor: pointer; accent-color: var(--accent); }

/* ── STAGED ROWS ── */
.tbl tr.row-staged-renovar td   { background: #f0fdf4; }
.tbl tr.row-staged-renovar:hover td { background: #dcfce7; }
.tbl tr.row-staged-abandonar td { background: #f8f8f8; }
.tbl tr.row-staged-abandonar:hover td { background: #efefef; }
.tbl tr.row-staged-info td      { background: #eff6ff; }
.tbl tr.row-staged-info:hover td { background: #dbeafe; }

.badge-staged-renovar  { background: #bbf7d0; color: #14532d; }
.badge-staged-abandonar{ background: #e5e7eb; color: #374151; }
.badge-staged-info     { background: #bfdbfe; color: #1e3a5f; }

.staged-cell { text-align: center; }
.staged-note { font-size: 0.60rem; color: var(--gray); margin-top: 2px; font-style: italic; }

/* Marcador d'un expedient que va demanar MÉS INFO (segueix pendent i re-decidible) */
.info-requested-note {
  display: inline-block; margin-bottom: 6px; padding: 2px 8px; border-radius: 3px;
  background: #e0f2fe; color: #0369a1; font-size: 0.60rem; font-weight: 700;
  letter-spacing: 0.04em; text-transform: uppercase; white-space: nowrap;
}
/* Previsió de despeses (CU-002): fila sense event real a PATRICIA, no decidible */
.projectada-cell { text-align: center; }
.projectada-note {
  display: inline-block; padding: 2px 8px; border-radius: 3px;
  background: #fff8e1; color: #7d5c00; font-size: 0.62rem; font-weight: 700;
  letter-spacing: 0.02em; cursor: help;
}
.undo-btn {
  display: inline-block; margin-top: 4px; font-size: 0.63rem;
  color: var(--gray); cursor: pointer; background: none; border: none;
  font-family: inherit; text-decoration: underline; padding: 0;
}
.undo-btn:hover { color: #b91c1c; }

/* Autorització (a les files marcades PAGAR) */
.aut-box { margin-top: 8px; padding-top: 6px; border-top: 1px dashed #e5e0d5; }
.aut-title { font-size: 0.62rem; font-weight: 700; color: var(--gray); margin-bottom: 3px; }
.aut-link {
  display: inline-block; margin-right: 10px; font-size: 0.66rem;
  color: var(--brand); cursor: pointer; background: none; border: none;
  font-family: inherit; text-decoration: none; padding: 0;
}
.aut-link:hover { text-decoration: underline; }
.aut-send-row { display: flex; gap: 6px; margin-top: 6px; align-items: center; }
.aut-email {
  font-size: 0.7rem; padding: 4px 7px; border: 1px solid #ccc; border-radius: 5px;
  flex: 1; min-width: 120px; max-width: 240px;
}
.aut-send-do {
  font-size: 0.68rem; padding: 4px 12px; border: none; border-radius: 5px;
  background: var(--brand); color: #fff; cursor: pointer; font-family: inherit;
}
.aut-send-do:disabled { opacity: 0.6; cursor: default; }

.ref-cell    { font-weight: 600; color: var(--brand); white-space: nowrap; }
.obj-cell    { font-weight: 600; color: var(--text); }
.detalls-cell { font-size: 0.70rem; color: var(--gray); max-width: 160px; overflow-wrap: anywhere; }
.gestio-line  { margin-top: 2px; font-size: 0.70rem; font-style: italic; font-weight: 400; color: var(--gray); }
.comentari-line { margin-top: 2px; font-size: 0.70rem; font-style: italic; font-weight: 400; color: #a0a0a0; }
.data-sub    { margin-top: 2px; font-size: 0.70rem; color: var(--gray); }
/* Sol·licitud / Registre: número, data (gris) i capçalera centrats. */
.tbl th.num-cell, .tbl td.num-cell { text-align: center; white-space: nowrap; }
.exp-img     { display: block; margin-top: 4px; max-width: 120px; max-height: 40px; object-fit: contain; }
.date-cell   { white-space: nowrap; }
.date-urgent { color: #b91c1c; font-weight: 600; }
.amount-cell { font-weight: 700; color: var(--brand); text-align: right; white-space: nowrap; }

.badge { display: inline-flex; align-items: center; gap: 3px; padding: 2px 8px; border-radius: 3px; font-size: 0.65rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; white-space: nowrap; }
.badge-pendent  { background: #fff8e1; color: #7d5c00; }
.badge-renovar  { background: #e8f5e9; color: #2e7d32; }
.badge-abandonar{ background: #f0f0f0; color: #374151; }
.badge-info     { background: #e0f2fe; color: #0369a1; }

.action-cell  { text-align: center; white-space: nowrap; min-width: 240px; }
.tbl-btn {
  padding: 5px 11px; border-radius: 4px; font-size: 0.70rem; font-weight: 600;
  cursor: pointer; font-family: inherit; border: 1.5px solid transparent;
  margin: 0 2px; transition: all 0.12s;
}
.tbl-btn-renovar   { background: var(--green); color: white; border-color: var(--green); }
.tbl-btn-renovar:hover   { background: #1b5e20; border-color: #1b5e20; }
.tbl-btn-abandonar { background: white; color: #b91c1c; border-color: #b91c1c; }
.tbl-btn-abandonar:hover { background: #fef2f2; }
.tbl-btn-info      { background: white; color: #0369a1; border-color: #0369a1; }
.tbl-btn-info:hover      { background: #e0f2fe; }

.decided-cell  { text-align: center; }
.decided-who   { font-size: 0.68rem; color: var(--gray); margin-top: 2px; }
.decided-date  { font-size: 0.63rem; color: #9ca3af; }

.footnote { font-size: 0.68rem; color: var(--gray); padding: 8px 14px 10px; border-top: 1px solid var(--border); line-height: 1.5; }

/* ── CONFIRM BAR ── */
.confirm-bar {
  position: sticky; bottom: 0; z-index: 80;
  background: var(--white);
  border-top: 2px solid var(--brand);
  box-shadow: 0 -4px 16px rgba(0,0,0,0.10);
  padding: 0 20px;
  display: flex; flex-direction: column; gap: 0;
}

.batch-bar {
  display: none;
  padding: 8px 0 7px;
  border-bottom: 1px solid var(--border);
  align-items: center; gap: 10px; flex-wrap: wrap;
}
.batch-bar.visible { display: flex; }
.batch-count { font-size: 0.72rem; font-weight: 700; color: var(--brand); white-space: nowrap; min-width: 90px; }
.batch-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.batch-btn {
  padding: 4px 11px; border-radius: 4px; font-size: 0.70rem; font-weight: 600;
  cursor: pointer; font-family: inherit; border: 1.5px solid transparent; transition: all 0.12s;
}
.batch-btn-renovar   { background: var(--green); color: white; border-color: var(--green); }
.batch-btn-renovar:hover   { background: #1b5e20; }
.batch-btn-abandonar { background: white; color: #b91c1c; border-color: #b91c1c; }
.batch-btn-abandonar:hover { background: #fef2f2; }
.batch-btn-info      { background: white; color: #0369a1; border-color: #0369a1; }
.batch-btn-info:hover      { background: #e0f2fe; }

.confirm-row {
  padding: 9px 0;
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
}
.confirm-staged-label { font-size: 0.73rem; color: var(--gray); flex: 1; white-space: nowrap; }
.confirm-staged-label strong { color: var(--brand); }
.confirm-btn {
  background: var(--accent); color: #3a2a00;
  border: none; border-radius: 6px;
  padding: 8px 22px; font-size: 0.82rem; font-weight: 700;
  cursor: pointer; font-family: inherit; white-space: nowrap;
  transition: filter 0.12s;
}
.confirm-btn:hover { filter: brightness(0.93); }
.confirm-btn:disabled { background: #e5e7eb; color: #aaa; cursor: not-allowed; filter: none; }

/* ── FOOTER ── */
.site-footer { background: white; border-top: 1px solid var(--border); padding: 14px 20px; text-align: center; font-size: 0.68rem; color: var(--gray); line-height: 1.8; }
.site-footer strong { color: var(--text); }
.site-footer a { color: var(--brand); text-decoration: none; }

/* ── MODAL BASE ── */
.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.52); z-index: 200; align-items: center; justify-content: center; padding: 20px; }
.modal-overlay.open { display: flex; }
.modal-box { background: white; border-radius: 10px; width: 100%; max-width: 460px; box-shadow: 0 24px 60px rgba(0,0,0,0.3); overflow: hidden; }
.modal-box.wide { max-width: 560px; }
.modal-head { background: var(--brand); color: white; padding: 11px 16px; font-size: 0.84rem; font-weight: 600; display: flex; justify-content: space-between; align-items: center; border-bottom: 2px solid var(--accent); }
.modal-close { background: none; border: none; color: rgba(255,255,255,0.65); font-size: 1rem; cursor: pointer; }
.modal-close:hover { color: white; }
.modal-body { padding: 16px; }
.form-label { display: block; font-size: 0.65rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; color: var(--gray); margin-bottom: 5px; }
.form-control { width: 100%; border: 1px solid var(--border); border-radius: 6px; padding: 9px 12px; font-size: 0.85rem; font-family: inherit; color: var(--text); margin-bottom: 12px; transition: border-color 0.15s; }
.form-control:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(170,22,43,0.10); }
.form-control::placeholder { color: #bbb; }
.modal-foot { padding: 11px 16px; border-top: 1px solid var(--border); display: flex; gap: 8px; justify-content: flex-end; }
.m-btn { padding: 8px 18px; border-radius: 6px; font-size: 0.78rem; font-weight: 600; cursor: pointer; font-family: inherit; border: 1.5px solid transparent; }
.m-btn-cancel { background: white; color: var(--gray); border-color: var(--border); }
.m-btn-cancel:hover { border-color: var(--gray); }
.m-btn-ok { background: var(--brand); color: white; }
.m-btn-ok:hover { background: var(--brand-dk); }
.m-btn-ok:disabled { background: #e5e7eb; color: #aaa; cursor: not-allowed; }
.m-btn-ok.green      { background: var(--green); }
.m-btn-ok.green:hover { background: #1b5e20; }

/* ── DETAIL MODAL (detall de l'expedient en clicar la fila) ── */
.tbl tbody tr:not(.total-row) { cursor: pointer; }
.modal-box.detail-box { max-width: 720px; max-height: 88vh; overflow-y: auto; }
.detail-box .modal-head { position: sticky; top: 0; z-index: 2; border-radius: 10px 10px 0 0; }
.detail-box .modal-foot { position: sticky; bottom: 0; background: white; }
.detail-top { display: flex; gap: 20px; margin-bottom: 4px; }
.detail-img {
  flex-shrink: 0; width: 180px; height: 180px;
  border: 1px solid var(--border); border-radius: 8px; background: #f9f9f9;
  display: flex; align-items: center; justify-content: center; overflow: hidden;
  color: #bbb; font-size: 0.72rem; text-align: center; padding: 6px;
}
.detail-img img { width: 100%; height: 100%; object-fit: contain; }
.detail-grid {
  flex: 1; display: grid; grid-template-columns: 1fr 1fr;
  gap: 10px 20px; align-content: start;
}
.detail-k {
  color: var(--gray); font-weight: 700; font-size: 0.62rem;
  text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 2px;
}
.detail-v { color: var(--text); font-size: 0.82rem; font-weight: 500; word-break: break-word; }
.detail-v.accent { color: var(--brand); font-weight: 700; }
.detail-sep {
  margin: 18px 0 12px; padding-bottom: 5px;
  border-bottom: 1px solid var(--border);
  font-size: 0.65rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.1em; color: var(--brand);
}
.detail-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.detail-chip {
  background: var(--red-lt); color: var(--brand); border: 1px solid #f0c8cd;
  border-radius: 12px; padding: 3px 10px; font-size: 0.72rem; font-weight: 600;
}
.detail-products {
  font-size: 0.80rem; color: #444; line-height: 1.6;
  background: #f9f9f9; border-radius: 6px; padding: 10px 12px;
  border: 1px solid var(--border); min-height: 40px;
}
.detail-prod-row { margin-bottom: 6px; }
.detail-prod-row:last-child { margin-bottom: 0; }
.detail-prod-row strong { color: var(--brand); }
.detail-empty { color: #bbb; }
@media (max-width: 620px) {
  .detail-top { flex-direction: column; }
  .detail-img { width: 100%; height: 160px; }
  .detail-grid { grid-template-columns: 1fr; }
}

/* ── SUMMARY MODAL ── */
.summary-list { margin-bottom: 10px; }
.summary-item {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 0; border-bottom: 1px solid var(--border); font-size: 0.80rem;
}
.summary-item:last-child { border-bottom: none; }
.summary-item-ref { font-weight: 600; color: var(--brand); min-width: 110px; white-space: nowrap; font-size: 0.75rem; }
.summary-item-obj { flex: 1; color: var(--text); }
.summary-item-amt { font-weight: 700; color: var(--brand); text-align: right; min-width: 80px; white-space: nowrap; font-size: 0.75rem; }
.summary-pendent-section { margin-top: 10px; }
.summary-pendent-title { font-size: 0.65rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--gray); margin-bottom: 5px; }
.summary-pendent-item {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 0; font-size: 0.77rem; color: var(--gray);
  border-bottom: 1px dashed var(--border);
}
.summary-pendent-item:last-child { border-bottom: none; }
.summary-pendent-item .summary-item-ref { color: var(--gray); }
.summary-pendent-note-box {
  font-size: 0.70rem; color: #b45309;
  background: #fff8e1; border: 1px solid #fcd34d;
  border-radius: 4px; padding: 5px 9px; margin-top: 8px; line-height: 1.5;
}
.summary-total-row {
  display: flex; justify-content: flex-end; align-items: baseline; gap: 8px;
  padding: 9px 0 2px; border-top: 2px solid var(--border); margin-top: 8px;
}
.summary-total-label { font-size: 0.70rem; color: var(--gray); }
.summary-total-amt { font-size: 0.95rem; font-weight: 700; color: var(--brand); }
.summary-irrevocable {
  font-size: 0.72rem; color: #7f1d1d;
  background: #fef2f2; border: 1px solid #fecaca;
  border-radius: 5px; padding: 7px 10px; margin: 12px 0 14px; line-height: 1.55;
}
.summary-error {
  font-size: 0.72rem; color: #7f1d1d;
  background: #fef2f2; border: 1px solid #fecaca;
  border-radius: 5px; padding: 7px 10px; margin-top: 10px; line-height: 1.55;
  display: none;
}
.summary-error.show { display: block; }

/* ── SUMMARY · FORMULARI CLASSES (marca) ── */
.summary-classes { margin-top: 14px; }
.sc-exp {
  border: 1px solid var(--border); border-radius: 6px;
  padding: 9px 11px; margin-bottom: 8px; background: #fafafa;
}
.sc-head { display: flex; gap: 8px; align-items: baseline; margin-bottom: 6px; }
.sc-head .sc-ref { font-weight: 700; color: var(--brand); font-size: 0.74rem; white-space: nowrap; }
.sc-head .sc-obj { font-size: 0.78rem; color: var(--text); }
.sc-all {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
  font-size: 0.72rem; font-weight: 600; color: var(--gray); margin-bottom: 6px;
}
.sc-all input, .sc-cls input { width: 14px; height: 14px; accent-color: var(--brand); cursor: pointer; }
.sc-classes { display: flex; flex-wrap: wrap; gap: 5px 12px; }
.sc-cls {
  display: inline-flex; align-items: center; gap: 5px; cursor: pointer;
  font-size: 0.76rem; color: var(--text);
}
.sc-empty { color: #bbb; font-size: 0.78rem; }

/* ── SUMMARY · FORMULARI PAÏSOS DESIGNATS (registres internacionals) ── */
/* Bessó del de classes, però els noms de país són llargs i n'hi pot haver desenes:
   graella d'amplada fixa i llista amb scroll propi perquè el modal no creixi sense fi. */
.summary-paisos { margin-top: 14px; }
.sp-exp { border: 1px solid var(--border); border-radius: 6px; padding: 9px 11px; margin-bottom: 8px; background: #fafafa; }
.sp-head { display: flex; gap: 8px; align-items: baseline; margin-bottom: 6px; }
.sp-head .sp-ref { font-weight: 700; color: var(--brand); font-size: 0.74rem; white-space: nowrap; }
.sp-head .sp-obj { font-size: 0.78rem; color: var(--text); }
.sp-all { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; font-size: 0.72rem; font-weight: 600; color: var(--gray); margin-bottom: 6px; }
.sp-all input, .sp-pais input { width: 14px; height: 14px; accent-color: var(--brand); cursor: pointer; }
.sp-paisos { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 4px 12px; max-height: 220px; overflow-y: auto; }
.sp-pais { display: inline-flex; align-items: flex-start; gap: 5px; cursor: pointer; font-size: 0.76rem; color: var(--text); overflow-wrap: anywhere; }

/* ── SUMMARY · FORMULARI MOTIU (abandonar / més info) ── */
.summary-motiu { margin-top: 14px; }
.sm-exp { border: 1px solid var(--border); border-radius: 6px; padding: 9px 11px; margin-bottom: 8px; background: #fafafa; }
.sm-head { display: flex; gap: 8px; align-items: baseline; margin-bottom: 6px; }
.sm-head .sm-ref { font-weight: 700; color: var(--brand); font-size: 0.74rem; white-space: nowrap; }
.sm-head .sm-obj { font-size: 0.78rem; color: var(--text); }
.sm-motiu { width: 100%; min-height: 50px; }

/* ── SUMMARY · FORMULARI FORMA DE PAGAMENT ── */
.summary-payment { margin-top: 14px; }
.pay-opt {
  display: flex; gap: 8px; align-items: flex-start; cursor: pointer;
  border: 1px solid var(--border); border-radius: 6px;
  padding: 9px 11px; margin-bottom: 7px; background: #fff;
}
.pay-opt:hover { border-color: var(--brand); }
.pay-opt > input[type="radio"] { margin-top: 2px; width: 15px; height: 15px; accent-color: var(--brand); cursor: pointer; }
.pay-opt-body { display: flex; flex-direction: column; gap: 5px; flex: 1; min-width: 0; }
.pay-opt-title { font-size: 0.78rem; font-weight: 600; color: var(--text); line-height: 1.4; }
.pay-opt-field { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 0.74rem; color: var(--gray); }
.pay-hint { font-size: 0.68rem; color: #999; font-style: italic; }
.pay-input {
  border: 1px solid var(--border); border-radius: 5px; padding: 5px 9px;
  font-size: 0.8rem; font-family: inherit; color: var(--text); background: #fff;
}
.pay-input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(170,22,43,0.10); }
.pay-input.wide { width: 100%; }
textarea.pay-input { resize: vertical; }

/* ── ERROR PAGE ── */
.error-page { text-align: center; padding: 70px 20px; }
.error-title { font-size: 1.1rem; font-weight: 700; color: var(--brand); margin-bottom: 10px; }
.error-text  { font-size: 0.85rem; color: var(--gray); line-height: 1.7; }

/* ── LANDING (arrel pública, sense token) ── */
.landing { max-width: 620px; margin: 0 auto; text-align: center; padding: 64px 20px 48px; }
.landing-title { font-size: 1.25rem; font-weight: 700; color: var(--brand); margin-bottom: 14px; }
.landing-lead  { font-size: 0.9rem; color: var(--text); line-height: 1.75; margin-bottom: 18px; }
.landing-help  { font-size: 0.8rem; color: var(--gray); line-height: 1.7; }
.landing-help a { color: var(--brand); }

/* ── TOAST ── */
.toast { display: none; position: fixed; bottom: 70px; left: 50%; transform: translateX(-50%); padding: 9px 20px; border-radius: 5px; font-size: 0.80rem; font-weight: 600; box-shadow: 0 8px 24px rgba(0,0,0,0.2); z-index: 300; white-space: nowrap; }
.toast.show { display: block; animation: fadeUp 0.2s ease; }
.toast.green { background: var(--green); color: white; }
.toast.gray  { background: #374151; color: white; }
.toast.blue  { background: #0369a1; color: white; }
.toast.amber { background: #b45309; color: white; }
@keyframes fadeUp { from { opacity:0; transform:translateX(-50%) translateY(6px); } to { opacity:1; transform:translateX(-50%) translateY(0); } }

/* Modal d'avís de descàrrega (reutilitza .modal-overlay / .modal-box). */
.download-note-text { font-size: 0.86rem; line-height: 1.45; color: var(--text); margin: 0; }
