/* Blocs du PORTAIL CLIENT sur les pages du site (addons/sale/portal/blocks.py) :
   uniquement les variables du THÈME du site (--eds-*), comme les blocs du site. */
.erp-portal-section { padding: 24px 20px; background: var(--eds-bg, #fff); color: var(--eds-text, #1f2933);
  font-family: var(--eds-font-body, inherit); }
.erp-portal-section + .erp-portal-section { padding-top: 0; }
.erp-portal-navbar { padding-bottom: 0; }
.erp-portal-container { max-width: var(--erp-content-max, 1160px); margin: 0 auto; }
.erp-portal-narrow .erp-portal-container { max-width: 460px; }
.erp-portal-title { font-family: var(--eds-font-heading, inherit); color: var(--eds-heading, inherit); font-size: 1.6rem;
  margin: 0 0 12px; }
.erp-portal-section h2 { font-family: var(--eds-font-heading, inherit); color: var(--eds-heading, inherit);
  font-size: 1.15rem; margin: 0 0 10px; }
.erp-portal-muted { color: var(--eds-muted, #616e7c); margin: 0 0 16px; }

/* Navigation de l'espace client */
.erp-portal-nav { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; padding: 6px;
  border: 1px solid var(--eds-border, #e4e7eb); border-radius: var(--eds-radius, 10px); background: var(--eds-surface, #f7f9fb); }
.erp-portal-nav-link { padding: 8px 12px; border-radius: var(--eds-radius-sm, 5px); color: var(--eds-text, #1f2933);
  text-decoration: none; font: inherit; font-size: .9375rem; white-space: nowrap; background: none; border: 0; cursor: pointer; }
.erp-portal-nav-link:hover { background: var(--eds-card, #fff); color: var(--eds-accent, #1e88e5); }
.erp-portal-nav-link[aria-current="page"] { background: var(--eds-accent, #1e88e5); color: var(--eds-on-accent, #fff); }
.erp-portal-logout { margin: 0 0 0 auto; }
.erp-portal-logout .erp-portal-nav-link { color: var(--eds-muted, #616e7c); }

/* Bienvenue, tuiles */
.erp-portal-hello { margin-bottom: 18px; }
.erp-portal-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.erp-portal-tile { display: flex; flex-direction: column; gap: 4px; padding: 16px; border-radius: var(--eds-radius, 10px);
  background: var(--eds-card, #fff); border: 1px solid var(--eds-border, #e4e7eb); box-shadow: var(--eds-shadow, none);
  text-decoration: none; color: var(--eds-text, #1f2933); }
.erp-portal-tile:hover { border-color: var(--eds-accent, #1e88e5); }
.erp-portal-tile-value { font-size: 1.5rem; font-weight: 700; color: var(--eds-heading, inherit); white-space: nowrap; }
.erp-portal-tile-label { color: var(--eds-muted, #616e7c); font-size: .875rem; white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis; }

/* Tableaux de documents */
.erp-portal-table { width: 100%; border-collapse: collapse; background: var(--eds-card, #fff); font-size: .9375rem;
  border: 1px solid var(--eds-border, #e4e7eb); border-radius: var(--eds-radius-sm, 5px); }
.erp-portal-table tbody.erp-repeat { display: table-row-group; }
.erp-portal-table th { text-align: left; padding: 10px 12px; background: var(--eds-surface, #f7f9fb); color: var(--eds-muted, #616e7c);
  font-weight: 600; font-size: .8125rem; white-space: nowrap; border-bottom: 1px solid var(--eds-border, #e4e7eb); }
.erp-portal-table td { padding: 10px 12px; border-bottom: 1px solid var(--eds-border, #e4e7eb); vertical-align: top; }
.erp-portal-table tbody tr:last-child td { border-bottom: 0; }
.erp-portal-table a { color: var(--eds-accent, #1e88e5); font-weight: 600; text-decoration: none; }
.erp-portal-num { text-align: right !important; white-space: nowrap; }
.erp-portal-actions { text-align: right; white-space: nowrap; }
.erp-portal-pdf { display: inline-block; padding: 3px 10px; border: 1px solid var(--eds-border, #e4e7eb);
  border-radius: var(--eds-btn-radius, 6px); font-size: .8125rem; }
.erp-portal-empty { color: var(--eds-muted, #616e7c); padding: 16px 0; margin: 0; }
.erp-portal-pager { margin-top: 14px; }
.erp-portal-lines { margin: 18px 0; }

/* Détail d'un document */
.erp-portal-back { display: inline-block; margin-bottom: 8px; color: var(--eds-muted, #616e7c); text-decoration: none; }
.erp-portal-doc-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.erp-portal-columns { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 18px; margin: 14px 0; }
.erp-portal-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px 18px; margin: 0; }
.erp-portal-facts dt { color: var(--eds-muted, #616e7c); font-size: .8125rem; white-space: nowrap; }
.erp-portal-facts dd { margin: 2px 0 0; font-weight: 600; }
.erp-portal-address p { margin: 0; line-height: 1.5; }
.erp-portal-totals { margin: 0 0 0 auto; max-width: 320px; }
.erp-portal-totals div { display: flex; justify-content: space-between; gap: 18px; padding: 4px 0; }
.erp-portal-totals dt { color: var(--eds-muted, #616e7c); }
.erp-portal-totals dd { margin: 0; font-weight: 600; white-space: nowrap; }
.erp-portal-totals .is-grand { border-top: 1px solid var(--eds-border, #e4e7eb); padding-top: 8px; font-size: 1.1rem; }

/* Formulaires (connexion, informations, mot de passe) */
.erp-portal-card { padding: 22px; border-radius: var(--eds-radius, 10px); background: var(--eds-card, #fff);
  border: 1px solid var(--eds-border, #e4e7eb); box-shadow: var(--eds-shadow, none); }
.erp-portal-form { display: flex; flex-direction: column; gap: 12px; }
.erp-portal-field { display: flex; flex-direction: column; gap: 4px; font-size: .875rem; color: var(--eds-muted, #616e7c); }
.erp-portal-field span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.erp-portal-field input, .erp-portal-field select { height: 40px; padding: 0 10px; border: 1px solid var(--eds-border, #c4c4c4);
  border-radius: var(--eds-radius-sm, 5px); font: inherit; font-size: 1rem; color: var(--eds-text, #1f2933);
  background: var(--eds-bg, #fff); min-width: 0; }
.erp-portal-field input[readonly] { background: var(--eds-surface, #f7f9fb); }
.erp-portal-submit { align-self: flex-start; cursor: pointer; border: 0; }
.erp-portal-link { color: var(--eds-muted, #616e7c); font-size: .875rem; }
.erp-portal-message .is-error { display: block; padding: 10px 12px; border-radius: var(--eds-radius-sm, 5px);
  background: #fdecea; color: #8a1c13; }
.erp-portal-message .is-success { display: block; padding: 10px 12px; border-radius: var(--eds-radius-sm, 5px);
  background: #e8f5e9; color: #1b5e20; }
.erp-portal-addresses { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.erp-portal-address-card { font-style: normal; padding: 12px; border: 1px solid var(--eds-border, #e4e7eb);
  border-radius: var(--eds-radius-sm, 5px); line-height: 1.5; }

/* Mobile : lignes de tableau en cartes (libellé de colonne devant la valeur). */
@media (max-width: 760px) {
  .erp-portal-table thead { display: none; }
  .erp-portal-table, .erp-portal-table tbody, .erp-portal-table tbody.erp-repeat, .erp-portal-table tr,
  .erp-portal-table td { display: block; width: 100%; box-sizing: border-box; }
  .erp-portal-table tr { border-bottom: 1px solid var(--eds-border, #e4e7eb); padding: 6px 0; }
  .erp-portal-table td { border: 0; padding: 4px 12px; display: flex; justify-content: space-between; gap: 12px;
    text-align: right; }
  .erp-portal-table td[data-label]::before { content: attr(data-label); color: var(--eds-muted, #616e7c); text-align: left; }
  .erp-portal-logout { margin-left: 0; }
}

/* Éditeur : le répéteur d'un tableau (tbody) sans étiquette par-dessus l'en-tête. */
.erp-portal-table tbody[data-erp-repeat]::before { content: none; }
.erp-portal-pdf-btn, .erp-portal-submit { padding: 10px 20px; font: inherit; font-weight: 600; }

/* Documents joints (pont GED × portail) */
.erp-portal-files, .erp-portal-files.erp-repeat { display: block; list-style: none; margin: 0; padding: 0; }
.erp-portal-files li { padding: 8px 0; border-bottom: 1px solid var(--eds-border, #e4e7eb); }
.erp-portal-files a { color: var(--eds-accent, #1e88e5); font-weight: 600; text-decoration: none; }
.erp-portal-documents { margin-top: 6px; }

/* Adresses modifiables par le client (« Mes informations », page « Mon adresse ») */
.erp-portal-address-card .erp-portal-link { float: right; font-size: .8125rem; }
.erp-portal-add { display: inline-block; margin-top: 10px; text-decoration: none; }
.erp-portal-check { display: flex; align-items: center; gap: 8px; font-size: .9375rem; color: var(--eds-text, #1f2933);
  white-space: nowrap; }

/* Références d'origine des lignes, documents liés, colis et suivi */
.erp-portal-refs { white-space: nowrap; }
.erp-portal-ref { display: block; font-size: .92em; color: var(--eds-muted, #616e7c); }
.erp-portal-ref a { color: var(--eds-accent, #1e88e5); font-weight: 600; text-decoration: none; }
.erp-portal-related, .erp-portal-parcels { margin-top: 24px; }
.erp-portal-related a { color: var(--eds-accent, #1e88e5); text-decoration: none; font-weight: 600; }
.erp-portal-parcels a { color: var(--eds-accent, #1e88e5); font-weight: 600; }

/* Création de compte : bloc professionnel, champ piège invisible (anti-robot), lien sous la connexion */
.erp-portal-signup .erp-portal-b2b { border-left: 3px solid var(--eds-border, #e4e7eb); padding-left: 12px; margin: 4px 0 8px; }
.erp-portal-hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.erp-portal-signup-link:empty { display: none; }
.erp-portal-signup-link { display: block; }

/* « Payer en ligne » d'une facture (pont payment_portal) */
.erp-portal-pay:empty { display: none; }
.erp-portal-pay { margin: 16px 0 0 auto; max-width: 420px; padding: 14px 16px; border: 1px solid var(--eds-border, #e4e7eb);
  border-radius: var(--eds-radius, 8px); background: var(--eds-card, #fff); }
.erp-portal-pay-form p { margin: 0 0 10px; }
.erp-portal-pay-buttons { display: flex; flex-direction: column; gap: 8px; }
.erp-portal-pay-btn { padding: 10px 20px; font: inherit; font-weight: 600; cursor: pointer; }
