/* Bookseller portal. Builds on /booksellers/order.css tokens. */
.masthead-right { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; justify-content: flex-end; }
.masthead-label { font-weight: 600; font-size: 14px; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; }
.masthead-email { font-size: 14px; color: var(--muted); }
.linkish { background: none; border: 0; padding: 0; font: 600 15px var(--font-body); color: var(--plum); text-decoration: underline; cursor: pointer; }

.portal { padding: 40px 0 72px; min-height: 60vh; }
.portal h1 { font-size: clamp(30px, 4.4vw, 44px); margin-bottom: 8px; }
.portal h2 { font-family: var(--font-head); font-weight: 700; font-size: 24px; margin: 44px 0 14px; }
.portal h3 { font-family: var(--font-head); font-weight: 500; font-size: 19px; margin: 24px 0 10px; }
.sub { color: var(--muted); margin: 0 0 24px; }
.loading { color: var(--muted); }

.card { background: #fff; border: 1.5px solid var(--ink); border-radius: var(--radius); padding: 22px; }
.card + .card { margin-top: 16px; }
.auth { max-width: 460px; }
.auth .btn { width: 100%; }
.auth .field { margin-bottom: 14px; }
.auth-links { display: grid; gap: 8px; margin-top: 18px; }
.notice { padding: 14px 16px; border-radius: 12px; background: var(--soft); border: 1.5px solid var(--ink); margin: 0 0 18px; }
.notice.error { background: #FBEAEC; border-color: var(--error); color: var(--error); font-weight: 600; }
.notice.ok { background: #EAF4EC; border-color: #2F6B3B; color: #24502C; font-weight: 600; }

.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 8px 0 18px; }
.tile { border: 1.5px solid var(--ink); border-radius: var(--radius); padding: 16px; background: #fff; }
.tile-label { font-size: 12.5px; text-transform: uppercase; letter-spacing: .08em; font-weight: 600; color: var(--muted); }
.tile-value { font-family: var(--font-head); font-weight: 700; font-size: 32px; line-height: 1.1; margin-top: 6px; }
.tile-note { font-size: 14px; color: var(--muted); margin-top: 2px; }
.actions { display: flex; gap: 12px; flex-wrap: wrap; margin: 6px 0 4px; }
.actions + .tiles, .actions + div + .tiles { margin-top: 20px; }
.btn-sm { padding: 11px 20px; min-height: 44px; font-size: 16px; box-shadow: 3px 3px 0 var(--ink); }
.btn-ghost { display: inline-flex; align-items: center; justify-content: center; font: 600 16px/1 var(--font-body); color: var(--ink); background: transparent; border: 2.5px solid var(--ink); border-radius: 999px; padding: 11px 20px; min-height: 44px; cursor: pointer; text-decoration: none; }
.btn-danger { color: var(--error); border-color: var(--error); }

.table-wrap { overflow-x: auto; border: 1.5px solid var(--ink); border-radius: var(--radius); background: #fff; }
table { width: 100%; border-collapse: collapse; font-size: 15.5px; }
th, td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--soft); vertical-align: top; }
th { font-size: 12.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; background: var(--blush); white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; white-space: nowrap; }
.empty { color: var(--muted); padding: 16px; margin: 0; }
.pill { display: inline-block; font-size: 13px; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: var(--soft); white-space: nowrap; }
.pill.received, .pill.pending, .pill.unpaid { background: #F6ECD6; }
.pill.confirmed { background: #E3D8E2; }
.pill.dispatched, .pill.approved { background: #DCE9F5; }
.pill.delivered, .pill.paid { background: #DCEFE0; }
.pill.cancelled, .pill.void, .pill.paused { background: #EEE; color: #555; }
.row-link { color: var(--plum); font-weight: 600; cursor: pointer; text-decoration: underline; background: none; border: 0; font: inherit; padding: 0; }

.downloads { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.download { display: grid; gap: 8px; text-decoration: none; color: var(--ink); border: 1.5px solid var(--ink); border-radius: var(--radius); padding: 14px; background: #fff; }
.download img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 6px; border: 1px solid var(--soft); background: var(--blush); }
.download strong { font-weight: 600; }
.download span { font-size: 14px; color: var(--muted); }

.inline-form { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)) auto; gap: 10px; align-items: end; margin-top: 12px; }
.inline-form .field label { font-size: 13px; }
.inline-form .btn, .inline-form .btn-ghost { min-height: 48px; }
select { width: 100%; font: inherit; color: var(--ink); background: var(--blush); border: 1.5px solid var(--ink); border-radius: 10px; padding: 11px 13px; min-height: 48px; }
.mini-select { min-height: 38px; padding: 6px 10px; font-size: 14.5px; width: auto; }
.mini-input { min-height: 38px !important; padding: 6px 10px !important; font-size: 14.5px; width: 150px !important; }

.back { display: inline-block; margin-bottom: 14px; font-weight: 600; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.kv { display: grid; grid-template-columns: 150px 1fr; gap: 6px 14px; margin: 0; }
.kv dt { color: var(--muted); font-size: 14.5px; }
.kv dd { margin: 0; }

/* Invoice */
.invoice { background: #fff; border: 1.5px solid var(--ink); border-radius: var(--radius); padding: 36px; max-width: 820px; }
.inv-head { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; margin-bottom: 28px; }
.inv-title { font-family: var(--font-head); font-weight: 700; font-size: 34px; margin: 0; }
.inv-meta { text-align: right; }
.inv-meta p, .inv-parties p { margin: 0; }
.inv-parties { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-bottom: 26px; }
.inv-total { font-family: var(--font-head); font-weight: 700; font-size: 22px; }
.inv-pay { margin-top: 24px; padding: 16px; background: var(--blush); border-radius: 10px; white-space: pre-line; }

@media (max-width: 860px) {
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .downloads { grid-template-columns: 1fr 1fr; }
  .inline-form { grid-template-columns: 1fr 1fr; }
  .two-col { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .masthead-email { display: none; }
  .downloads { grid-template-columns: 1fr; }
  .inline-form { grid-template-columns: 1fr; }
  .inv-parties { grid-template-columns: 1fr; }
  .invoice { padding: 22px; }
  .inv-meta { text-align: left; }
  .kv { grid-template-columns: 1fr; }
  .kv dt { margin-top: 8px; }
}
@media print {
  .masthead, .site-footer, .no-print { display: none !important; }
  body { background: #fff; }
  .portal { padding: 0; }
  .invoice { border: 0; padding: 0; max-width: none; }
}

/* Fields the shared form styles do not cover */
input[type="password"] { width: 100%; font: inherit; color: var(--ink); background: var(--blush); border: 1.5px solid var(--ink); border-radius: 10px; padding: 11px 13px; min-height: 48px; }
a.btn, a.btn-ghost { text-decoration: none; }
.masthead-right a { font-weight: 600; font-size: 15px; }
