/*
 * Zevpoint partner portal (partners.zevpoint.com): the shell and its pages.
 * Loaded after static/portal/theme.css, which holds the brand tokens (--zp-*)
 * the customer portal uses too. Everything here is prefixed `pp-`.
 * Screens: docs/PARTNER_PORTAL_PLAN.md.
 */

body.pp { background: var(--zp-surface-mute); font-size: 14px; }
/* `hidden` must win over a class that sets display (a flex field, a grid row). */
.pp [hidden] { display: none !important; }
.pp a { color: var(--zp-ink); }
.pp a:hover { color: var(--zp-sage-deep); }

/* ---------- top bar ---------- */
.pp-top { display: flex; align-items: center; gap: 28px; min-height: 64px; padding: 0 32px; background: var(--zp-surface);
  border-bottom: 1px solid var(--zp-border); }
.pp-brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 15px; white-space: nowrap; }
.pp-brand img { width: 34px; height: 34px; border-radius: 8px; }
.pp-nav { display: flex; gap: 4px; flex: 1 1 0; min-width: 0; }
.pp-nav a { display: flex; align-items: center; min-height: 64px; padding: 0 14px; font-size: 13.5px; font-weight: 600;
  color: var(--zp-text-muted); }
.pp-nav a.is-active { color: var(--zp-ink); font-weight: 700; box-shadow: inset 0 -2px 0 var(--zp-sage-deep); }
.pp-who { margin-left: auto; font-size: 13px; color: var(--zp-text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pp-out { font-size: 13px; font-weight: 600; white-space: nowrap; }

/* ---------- page ---------- */
.pp-main { max-width: 1120px; margin: 0 auto; padding: 32px; display: flex; flex-direction: column; gap: 24px; }
.pp-head h1 { font-size: 24px; font-weight: 700; letter-spacing: var(--zp-tracking-tight); }
.pp-head p { font-size: 13px; color: var(--zp-text-muted); }
.pp-card { background: var(--zp-surface); border: 1px solid var(--zp-border); border-radius: 10px; }
.pp-h2 { font-size: 16px; font-weight: 700; }
.pp-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.pp-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 18px;
  border: 1px solid var(--zp-border-strong); border-radius: 10px; background: var(--zp-surface); color: var(--zp-ink);
  font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.pp-btn:hover { border-color: var(--zp-ink); }
.pp-btn--go { border-color: var(--zp-sage-deep); background: var(--zp-sage-deep); color: #fff; }
.pp a.pp-btn--go, .pp a.pp-btn--go:hover { color: #fff; }
.pp-more { font-size: 13px; font-weight: 600; white-space: nowrap; }

/* ---------- your link ---------- */
.pp-link { display: flex; align-items: center; gap: 16px 20px; flex-wrap: wrap; padding: 20px 24px; }
.pp-link-text { flex: 1 1 320px; min-width: 0; }
.pp-label { font-size: 12.5px; font-weight: 600; color: var(--zp-text-muted); }
.pp-link-url { font-size: 18px; font-weight: 700; margin-top: 2px; overflow-wrap: anywhere; }
.pp-note { font-size: 13px; color: var(--zp-text-muted); margin-top: 4px; }

/* ---------- numbers ---------- */
.pp-seg { display: inline-flex; gap: 2px; padding: 3px; background: var(--zp-neutral-bg); border-radius: 10px; }
.pp-seg button { min-height: 36px; padding: 0 14px; border-radius: 8px; font-size: 13px; font-weight: 600; color: var(--zp-text-muted); }
.pp-seg button[aria-pressed="true"] { background: var(--zp-surface); color: var(--zp-ink); box-shadow: var(--zp-shadow-sm); }
.pp-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px; }
.pp-tile { padding: 18px 20px; }
.pp-tile b { display: block; font-size: 26px; font-weight: 700; letter-spacing: var(--zp-tracking-tight); font-variant-numeric: tabular-nums; }
.pp-tile small { font-size: 12.5px; color: var(--zp-text-muted); }

/* ---------- orders through the link ---------- */
.pp-table-head { padding: 16px 24px; border-bottom: 1px solid var(--zp-divider); }
.pp-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.pp-table th { padding: 10px 24px; font-size: 12px; font-weight: 600; color: var(--zp-text-muted); text-align: left; white-space: nowrap; }
.pp-table td { padding: 14px 24px; border-top: 1px solid var(--zp-divider); vertical-align: middle; }
.pp-table .r { text-align: right; }
.pp-table .dim { color: var(--zp-text-muted); }
.pp-scroll { overflow-x: auto; }
.pp-status { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.pp-status::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pp-status--good { color: var(--zp-success-fg); }
.pp-status--warn { color: var(--zp-warning-fg); }
.pp-status--ink { color: var(--zp-ink); }
.pp-status--bad { color: var(--zp-danger-fg); }
.pp-status--wait, .pp-status--off { color: var(--zp-neutral-fg); }
.pp-empty { padding: 28px 24px; font-size: 13.5px; color: var(--zp-text-muted); }
.pp-table tr.is-off td, .pp-table tr.is-off strong { color: var(--zp-text-subtle); font-weight: 400; }

/* ---------- profile ---------- */
.pp-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 24px; align-items: start; }
.pp-pad { padding: 20px 24px; }
.pp-pad .pp-h2 { margin-bottom: 8px; }
.pp-kv { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 10px 0; border-top: 1px solid var(--zp-divider); }
.pp-kv > span:first-child { color: var(--zp-text-muted); }
.pp-kv > span:last-child { font-weight: 600; text-align: right; overflow-wrap: anywhere; }
.pp-two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.pp-textarea { height: auto; padding: 10px 14px; resize: vertical; }
select.pp-input { appearance: auto; }
.pp-h3 { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--zp-divider); font-size: 14px; font-weight: 700; }
.pp-request { padding: 10px 0; border-top: 1px solid var(--zp-divider); }
.pp-h3 + .pp-request { border-top: 0; }
.pp-pad .pp-btn--go { align-self: flex-start; }

/* ---------- sign in ---------- */
.pp-login { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; background: var(--zp-surface-mute); }
.pp-login-box { width: 100%; max-width: 400px; padding: 32px 28px; display: flex; flex-direction: column; gap: 20px; }
.pp-login-box h1 { font-size: 24px; font-weight: 700; letter-spacing: var(--zp-tracking-tight); }
.pp-login-box p { font-size: 14px; color: var(--zp-text-muted); }
.pp-field { display: flex; flex-direction: column; gap: 6px; }
.pp-field label { font-size: 13px; font-weight: 600; }
.pp-input { width: 100%; height: 48px; padding: 0 14px; border: 1px solid var(--zp-border-strong); border-radius: 10px;
  background: var(--zp-surface); color: var(--zp-ink); font-size: 16px; outline: none; }
.pp-input:focus { border-color: var(--zp-sage-deep); }
.pp-login-box .pp-btn { width: 100%; min-height: 48px; font-size: 15px; }
.pp-btn:disabled { opacity: 0.6; cursor: not-allowed; }
.pp-msg { padding: 10px 14px; border: 1px solid var(--zp-danger-border); border-radius: 10px; background: var(--zp-surface);
  color: var(--zp-danger-fg); font-size: 13px; }
.pp-plain { font-size: 13px; font-weight: 600; color: var(--zp-ink); text-decoration: underline; cursor: pointer; }
.pp-small { font-size: 12.5px; color: var(--zp-text-muted); }

/* ---------- ordering ---------- */
.pp-order { display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); gap: 24px; align-items: start; }
.pp-qty { display: inline-flex; align-items: center; gap: 4px; }
.pp-qty-btn { width: 44px; height: 44px; border: 1px solid var(--zp-border-strong); border-radius: 10px; background: var(--zp-surface);
  font-size: 18px; color: var(--zp-ink); }
.pp-qty-in { width: 56px; height: 44px; border: 1px solid var(--zp-border-strong); border-radius: 10px; text-align: center;
  font-weight: 700; color: var(--zp-ink); background: var(--zp-surface); -moz-appearance: textfield; }
.pp-qty-in::-webkit-outer-spin-button, .pp-qty-in::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.pp-total { display: flex; justify-content: space-between; margin-top: 8px; padding-top: 12px; border-top: 1px solid var(--zp-border);
  font-size: 17px; font-weight: 700; }
.pp-pay { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.pp-bank { margin: 12px 0 16px; padding: 4px 16px; border: 1px solid var(--zp-border); border-radius: 10px; }
.pp-bank .pp-kv:first-child { border-top: 0; }

/* ---------- creatives ---------- */
.pp-pills { display: flex; gap: 8px; flex-wrap: wrap; }
.pp-pill { min-height: 44px; padding: 0 16px; border: 1px solid var(--zp-border-strong); border-radius: var(--zp-radius-pill);
  background: var(--zp-surface); color: var(--zp-ink); font-size: 13px; font-weight: 600; }
.pp-pill[aria-pressed="true"] { border-color: var(--zp-ink); background: var(--zp-ink); color: #fff; }
.pp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }
.pp-creative { display: flex; flex-direction: column; overflow: hidden; }
.pp-creative-pic { width: 100%; height: 220px; object-fit: cover; background: var(--zp-neutral-bg); }
.pp-creative-none { display: flex; align-items: center; justify-content: center; font-size: 12.5px; color: var(--zp-text-muted); }
.pp-creative-body { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px; flex: 1 1 0; }
.pp-caption { font-size: 13px; white-space: pre-line; overflow-wrap: anywhere; }
.pp-creative-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; padding-top: 8px; }
.pp-creative-actions .pp-btn { flex: 1 1 0; }
.pp-strip { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
.pp-strip-item { display: flex; flex-direction: column; overflow: hidden; }
.pp-strip-item img, .pp-strip-item .pp-creative-none { width: 100%; height: 120px; object-fit: cover; background: var(--zp-neutral-bg); }
.pp-strip-item strong { padding: 10px 14px; font-size: 13px; }

/* ---------- phone ---------- */
.pp-tabs, .pp-phone-only { display: none; }
@media (max-width: 760px) {
  .pp-top { gap: 12px; min-height: 56px; padding: 0 16px; }
  .pp-nav { display: none; }
  .pp-main { padding: 16px 16px 88px; gap: 16px; }
  .pp-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .pp-tile { padding: 14px; }
  .pp-tile b { font-size: 22px; }
  .pp-link { padding: 16px; }
  .pp-link .pp-btn { flex: 1 1 0; }
  .pp-cols { gap: 16px; }
  .pp-order { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .pp-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .pp-pad { padding: 16px; }
  .pp-table-head { padding: 14px 16px; }
  .pp-table th, .pp-table td { padding-left: 16px; padding-right: 16px; white-space: nowrap; }

  /* A list of orders (.pp-orders) is two lines per order here: what was sold
     and what it earns, then who and where it stands. Other tables stay tables
     and scroll sideways inside their card. */
  .pp-phone-only { display: inline; }
  .pp-orders, .pp-orders tbody { display: block; }
  .pp-orders thead, .pp-orders .c-date, .pp-orders .c-paid { display: none; }
  .pp-orders tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; padding: 12px 16px;
    border-top: 1px solid var(--zp-divider); }
  .pp-orders td { display: block; padding: 0; border: 0; white-space: normal; }
  .pp-orders .c-prod { grid-area: 1 / 1; font-weight: 600; }
  .pp-orders .c-comm { grid-area: 1 / 2; }
  .pp-orders .c-cust { grid-area: 2 / 1; font-size: 12.5px; color: var(--zp-text-muted); }
  .pp-orders .c-stat { grid-area: 2 / 2; text-align: right; }

  .pp-tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex; height: 60px;
    padding-bottom: env(safe-area-inset-bottom, 0px); background: var(--zp-surface); border-top: 1px solid var(--zp-border); }
  .pp-tabs a { flex: 1 1 0; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; color: var(--zp-text-muted); }
  .pp-tabs a.is-active { color: var(--zp-sage-deep); font-weight: 700; }
}
