/* ============================================================================
   Vendor Portal (/portal) - a vendor's read-only statement from the shop
   (design C, shop-branded statement). The shop's name and logo sit on a band
   of its invoice accent (--brand, set on <body> by the layout, with --brand-ink
   chosen for contrast). Everything below the band is ink on white, so a pale
   brand colour never costs readability. Phone-first: vendors mostly arrive
   from an email.
   ============================================================================ */
.portal-body { background: var(--panel-subtle); min-height: 100vh; display: flex; flex-direction: column; }
.portal-band { background: var(--brand, #0f6e58); color: var(--brand-ink, #fff); }
.portal-band-inner { max-width: 1100px; margin: 0 auto; padding: 18px 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.portal-brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; min-width: 0; max-width: 100%; }
.portal-brand:focus-visible { outline: 2px solid currentColor; outline-offset: 4px; border-radius: 4px; }
.portal-logo { flex: none; width: 44px; height: 44px; border-radius: 8px; background: #fff; display: grid; place-items: center; overflow: hidden; box-shadow: 0 0 0 1px rgba(0, 0, 0, .08); }
.portal-logo img { max-width: 36px; max-height: 36px; object-fit: contain; }
.portal-brand-text { display: grid; min-width: 0; }
.portal-brand-shop { font-weight: 750; font-size: 18px; letter-spacing: -0.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.portal-brand-vendor { font-size: 13px; }
.portal-navbar { background: var(--panel); border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 8px; padding: 0 max(16px, calc((100% - 1100px) / 2 + 16px)); }
.portal-nav { flex: 1; min-width: 0; display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.portal-nav::-webkit-scrollbar { display: none; }
.portal-nav a { padding: 11px 10px; font-size: 14px; font-weight: 600; color: var(--muted); text-decoration: none; border-bottom: 2px solid transparent; white-space: nowrap; }
.portal-nav a:hover { color: var(--text); }
.portal-nav a.is-current { color: var(--text); border-bottom-color: var(--text); }
.portal-nav a:focus-visible { outline: 2px solid var(--text); outline-offset: -2px; }
.portal-signout-button:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
.portal-signout { margin: 0; flex: none; }
.portal-signout-button { appearance: none; border: 1px solid currentColor; border-radius: 8px; background: none; font: inherit; font-size: 13px; font-weight: 600; color: inherit; padding: 5px 10px; cursor: pointer; white-space: nowrap; }
.portal-signout-button:hover { text-decoration: underline; }
.portal-main { flex: 1; width: 100%; max-width: 1100px; margin: 0 auto; padding: 22px 16px 40px; box-sizing: border-box; }
.portal-footer { max-width: 1100px; margin: 0 auto; padding: 16px; font-size: 12.5px; color: var(--muted); text-align: center; }
.portal-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 6px 0 16px; }
.portal-heading h1 { margin: 0; font-size: 22px; letter-spacing: -0.01em; }
/* A statement, not an app: square-ish cards on a hairline, ink figures. */
.portal-card { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 16px 18px; margin-bottom: 14px; }
.portal-card h1 { margin: 4px 0 8px; font-size: 22px; }
.portal-card h2 { margin: 0 0 12px; font-size: 15px; }
.portal-card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 8px; }
.portal-card-head h2 { margin: 0; }
.portal-card-head a { font-size: 13px; color: var(--text); text-decoration: underline; text-underline-offset: 2px; font-weight: 600; }
.portal-narrow { max-width: 440px; margin: 40px auto; }
.portal-form { display: grid; gap: 14px; margin-top: 14px; }
.portal-muted { color: var(--muted); }
.portal-small { font-size: 12.5px; margin-bottom: 0; }
.portal-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; padding: 4px 0 4px; }
.portal-stats + .portal-stats { border-top: 1px solid var(--line-soft); padding-top: 12px; }
.portal-stat-label { display: block; font-size: 12.5px; font-weight: 500; color: var(--muted); }
.portal-stat-value { display: block; font-size: 20px; font-weight: 700; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; margin-top: 2px; }
.portal-stat-value.is-accent { color: var(--text); }
.portal-range { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 12px; }
.portal-heading .portal-range { margin-bottom: 0; }
.portal-chip { padding: 5px 10px; border: 1px solid var(--line); border-radius: 999px; font-size: 12.5px; font-weight: 600; color: var(--muted); text-decoration: none; background: var(--panel); }
.portal-chip:hover { color: var(--text); }
.portal-chip.is-current { color: var(--panel); border-color: var(--text); background: var(--text); }
.portal-range-custom { display: flex; align-items: center; gap: 6px; margin: 0; font-size: 12.5px; color: var(--muted); }
.portal-range-custom input[type="date"] { padding: 4px 6px; font-size: 12.5px; }
.portal-filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; margin-bottom: 12px; }
.portal-filters .field { margin: 0; min-width: 200px; }
.portal-pager { display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding-top: 12px; font-size: 13px; color: var(--muted); }
.portal-calc { margin: 0; display: grid; gap: 0; }
.portal-calc > div { display: flex; justify-content: space-between; gap: 16px; padding: 9px 0; border-bottom: 1px solid var(--line-soft); }
.portal-calc > div:last-child { border-bottom: 0; }
.portal-calc dt { color: var(--muted); }
.portal-calc dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; }
.portal-calc .is-total { border-top: 1px solid var(--text); border-bottom: 0; }
.portal-calc .is-total dt, .portal-calc .is-total dd { color: var(--text); font-weight: 750; }
.portal-calc .is-accent dd { color: var(--text); }
.portal-statement .portal-calc + .portal-calc { margin-top: 12px; }
.portal-statement > .portal-small { margin-top: 10px; }
.portal-notice { border-color: var(--amber-weak); background: var(--amber-weak); }
.portal-notice ul { margin: 8px 0 0; padding-left: 18px; }
/* Tables read as statement lines: the page's font with aligned figures (the
   shared table style sets numbers in monospace), ink links. */
.portal-main .order-link { color: var(--text); }
.portal-main .data-table td, .portal-main .data-table td.align-right, .portal-main .data-table td::before { font-family: inherit; font-variant-numeric: tabular-nums; }
@media (max-width: 820px) {
  .portal-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 480px) {
  .portal-stat-value { font-size: 18px; }
  .portal-band-inner { padding: 14px 16px; }
  .portal-brand-shop { font-size: 16px; }
  .portal-range-custom { width: 100%; }
  .portal-filters .field { min-width: 0; flex: 1 1 100%; }
}
@media print {
  .portal-navbar, .portal-range, .portal-pager, .portal-footer { display: none; }
  .portal-band { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* The merchant's Portal Access card on a vendor's page. */

.portal-card .portal-subhead { margin: 18px 0 6px; font-size: 14px; }

