/* ============================================================
   Lonsher LTD — client portal demo
   Deliberately styled after the real portal (steel blue, light cards)
   rather than the marketing site, so what a visitor plays with here is
   what they would actually log into.
   ============================================================ */

.pdemo{
  --pd-blue:#5B93B8; --pd-blue-d:#42789B; --pd-blue-l:#EAF3F8;
  --pd-ink:#1F2A33; --pd-ink-2:#526270; --pd-ink-3:#7E8B96;
  --pd-line:#DCE5EB; --pd-surf:#fff; --pd-bg:#F4F7F9;
  --pd-ok:#1D9E74; --pd-warn:#C4820F;
  border:1px solid var(--pd-line); border-radius:var(--r-lg); overflow:hidden;
  box-shadow:var(--sh-3); background:var(--pd-bg); color:var(--pd-ink);
  font-size:15px; line-height:1.55;
}

/* ---------- top bar ---------- */
.pd-bar{
  display:flex; align-items:center; gap:12px; padding:11px 16px;
  background:#fff; border-bottom:1px solid var(--pd-line); flex-wrap:wrap;
}
.pd-bar__tag{
  font-size:10.5px; font-weight:700; letter-spacing:.12em; text-transform:uppercase;
  background:#F0A93B; color:#3B2A08; padding:3px 9px; border-radius:5px;
}
.pd-bar__brand{ font-weight:700; font-size:15.5px; }
.pd-bar__spacer{ flex:1 1 auto; }
.pd-bar__user{
  display:inline-flex; align-items:center; gap:7px; font-size:13.5px; font-weight:600;
  color:var(--pd-ink-2); background:var(--pd-bg); border:1px solid var(--pd-line);
  border-radius:999px; padding:5px 12px;
}
.pd-bar__user svg{ width:15px; height:15px; }
.pd-bar__out{
  background:none; border:1px solid var(--pd-line); border-radius:8px;
  padding:5px 11px; font-size:13px; font-weight:600; color:var(--pd-ink-3); transition:.14s;
}
.pd-bar__out:hover{ border-color:var(--pd-blue); color:var(--pd-blue); }

/* ---------- layout ---------- */
.pd-grid{ display:grid; grid-template-columns:280px 1fr; min-height:520px; }
.pd-grid > *{ min-width:0; }
.pd-side{ background:#fff; border-inline-end:1px solid var(--pd-line); padding-bottom:14px; }
.pd-main{ padding:20px; }

.pd-tabs{ display:grid; grid-template-columns:repeat(3,1fr); border-bottom:1px solid var(--pd-line); }
.pd-tab{
  background:none; border:0; border-bottom:2px solid transparent;
  padding:12px 6px; font-size:12.5px; font-weight:600; color:var(--pd-ink-3);
  line-height:1.3; transition:.14s;
}
.pd-tab:hover{ color:var(--pd-ink); background:var(--pd-bg); }
.pd-tab.is-on{ color:var(--pd-blue-d); border-bottom-color:var(--pd-blue); font-weight:700; }
.pd-badge{
  display:inline-grid; place-items:center; min-width:17px; height:17px; padding:0 4px;
  margin-inline-start:5px; border-radius:999px; background:var(--pd-blue); color:#fff;
  font-size:10.5px; font-weight:700;
}
.pd-tab:not(.is-on) .pd-badge{ background:var(--pd-line); color:var(--pd-ink-2); }

.pd-side__row{
  padding:14px 16px; border-bottom:1px solid var(--pd-line);
  border-inline-start:3px solid transparent; display:flex; flex-direction:column; gap:3px;
}
.pd-side__row.is-on{ background:var(--pd-blue-l); border-inline-start-color:var(--pd-blue); }
.pd-side__row b{ font-size:14px; line-height:1.4; }
.pd-side__row span{ font-size:12.5px; color:var(--pd-ink-3); }
.pd-side__empty{ padding:22px 16px; font-size:14px; color:var(--pd-ink-3); }

/* ---------- record header ---------- */
.pd-head{
  position:relative; background:linear-gradient(160deg, var(--pd-blue), var(--pd-blue-d));
  color:#fff; border-radius:var(--r) var(--r) 0 0; padding:22px 24px;
}
.pd-head h3{ font-size:20px; margin:0 0 8px; max-width:44ch; line-height:1.3; color:#fff; }
/* Reserve room for the floating reorder button so it never sits on the title. */
.pd-head--act{ padding-inline-start:180px; }
.pd-head p{ font-size:13.5px; margin:2px 0; opacity:.92; }
.pd-head b{ font-weight:700; }
.pd-btn--dark{
  position:absolute; inset-block-start:20px; inset-inline-start:22px;
  background:var(--pd-ink); color:#fff; border:0; border-radius:9px;
  padding:9px 16px; font-size:13.5px; font-weight:700; transition:.15s;
}
.pd-btn--dark:hover{ background:#000; transform:translateY(-1px); }

.pd-body{ background:#fff; border:1px solid var(--pd-line); border-top:0;
  border-radius:0 0 var(--r) var(--r); padding:18px; }

.pd-panel{ border:1px solid var(--pd-line); border-radius:var(--r-sm); padding:16px 18px; margin-bottom:14px; }
.pd-panel h4{ font-size:14.5px; margin:0 0 14px; }
.pd-panel--note{ background:var(--pd-blue-l); border-color:#CFE2EE; }
.pd-panel--note h4{ color:var(--pd-blue-d); margin-bottom:6px; }
.pd-panel--note p{ font-size:14px; color:var(--pd-ink-2); margin:0; }

/* ---------- status tracker ---------- */
.pd-track{ display:grid; grid-auto-flow:column; grid-auto-columns:1fr; gap:0; align-items:start; }
.pd-track__s{ display:flex; flex-direction:column; align-items:center; gap:7px; position:relative; }
.pd-track__s::before{
  content:""; position:absolute; inset-block-start:17px; inset-inline-start:50%;
  width:100%; height:2px; background:var(--pd-line);
}
.pd-track__s:last-child::before{ display:none; }
.pd-track__i{
  position:relative; z-index:1; width:34px; height:34px; border-radius:50%;
  display:grid; place-items:center; background:#fff;
  border:2px solid var(--pd-line); color:var(--pd-ink-3);
}
.pd-track__i svg{ width:16px; height:16px; }
.pd-track__l{ font-size:11.5px; color:var(--pd-ink-3); text-align:center; line-height:1.3; }
.pd-track__s.is-done .pd-track__i{ background:var(--pd-blue); border-color:var(--pd-blue); color:#fff; }
.pd-track__s.is-done::before{ background:var(--pd-blue); }
.pd-track__s.is-now .pd-track__i{
  background:var(--pd-blue); border-color:var(--pd-blue); color:#fff;
  box-shadow:0 0 0 5px rgba(91,147,184,.20);
}
.pd-track__s.is-now .pd-track__l{ color:var(--pd-blue-d); font-weight:700; }

/* ---------- payment ---------- */
.pd-pay__top{ display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:12px; }
.pd-pay__top h4{ margin:0; }
.pd-chip{ font-size:12.5px; font-weight:700; padding:4px 12px; border-radius:999px; }
.pd-chip--warn{ background:#FDF3E0; color:var(--pd-warn); }
.pd-chip--ok{ background:#E6F6F0; color:var(--pd-ok); }
.pd-pay__rows{ margin:0; }
.pd-pay__rows > div{ display:flex; justify-content:space-between; gap:14px; padding:5px 0; font-size:14.5px; }
.pd-pay__rows dt{ color:var(--pd-ink-2); }
.pd-pay__rows dd{ margin:0; font-weight:600; font-variant-numeric:tabular-nums; }
.pd-due{ color:var(--pd-warn); }
.pd-pay__total{ border-top:1px solid var(--pd-line); margin-top:6px; padding-top:10px !important; font-weight:700; }
.pd-pay__date{ font-size:13px; color:var(--pd-ink-3); margin-top:10px; }

/* ---------- items ---------- */
.pd-sechead{
  display:flex; align-items:center; justify-content:space-between; gap:14px;
  flex-wrap:wrap; margin:20px 2px 12px; font-size:14.5px;
}
.pd-keep{ display:inline-flex; align-items:center; gap:7px; font-size:13px; color:var(--pd-ink-2); cursor:pointer; }
.pd-item{ border:1px solid var(--pd-line); border-radius:var(--r-sm); padding:16px 18px; margin-bottom:12px; background:#fff; }
.pd-item__head{ display:flex; align-items:baseline; gap:9px; margin-bottom:5px; }
.pd-item__head b{ font-size:15.5px; }
.pd-qty{ font-size:15px; font-weight:700; color:var(--pd-ink-3); flex:0 0 auto; }
.pd-item__sku{ font-size:13px; color:var(--pd-ink-3); margin:0 0 14px; }
.pd-item__note{ font-size:13px; color:var(--pd-ink-2); margin:12px 0 0; padding-top:10px; border-top:1px solid var(--pd-line); }
.pd-eta{ font-size:13px; color:var(--pd-ink-2); margin-top:12px; }
.pd-mono{ font-family:var(--font-mono); direction:ltr; unicode-bidi:embed; display:inline-block; }

.pd-item--pick{ background:var(--pd-bg); cursor:pointer; transition:.15s; }
.pd-item--pick.is-on{ background:var(--pd-blue-l); border-color:#B8D6E6; }
.pd-item--pick .pd-item__head{ cursor:pointer; }
.pd-item--pick input[type="checkbox"]{ width:17px; height:17px; accent-color:var(--pd-blue); flex:0 0 auto; }
.pd-kv{ display:flex; flex-wrap:wrap; gap:6px 30px; margin:10px 0 0; }
.pd-kv > div{ display:flex; gap:8px; font-size:13.5px; }
.pd-kv dt{ color:var(--pd-ink-3); }
.pd-kv dd{ margin:0; font-weight:600; }

/* ---------- approve ---------- */
.pd-approve{ border:1px solid var(--pd-line); border-radius:var(--r-sm); padding:18px; margin-top:18px; background:var(--pd-bg); }
.pd-approve__hint{ font-size:13.5px; color:var(--pd-ink-2); margin:0 0 14px; }
.pd-approve__sum{ display:flex; justify-content:space-between; gap:14px; flex-wrap:wrap;
  font-size:14px; margin-bottom:16px; color:var(--pd-ink-2); }
.pd-approve__sum b{ color:var(--pd-ink); font-variant-numeric:tabular-nums; }
.pd-btn--go{
  background:var(--pd-blue); color:#fff; border:0; border-radius:9px;
  padding:12px 24px; font-size:15px; font-weight:700; transition:.15s;
}
.pd-btn--go:hover:not(:disabled){ background:var(--pd-blue-d); }
.pd-btn--go:disabled{ opacity:.45; cursor:not-allowed; }
.pd-approved{ border:1px solid #BFE6D6; background:#EFFAF5; border-radius:var(--r-sm); padding:18px; margin-top:18px; }
.pd-approved p{ margin:10px 0 0; font-size:14px; color:var(--pd-ink-2); }

/* ---------- toast ---------- */
.pd-toast{
  position:sticky; inset-block-end:14px; margin:0 18px 14px;
  background:var(--pd-ink); color:#fff; border-radius:11px;
  padding:13px 18px; font-size:14px; font-weight:600;
  box-shadow:0 12px 30px rgba(0,0,0,.28);
}

.pd-btn:focus-visible,.pd-tab:focus-visible,.pd-item--pick input:focus-visible{
  outline:3px solid var(--pd-blue); outline-offset:2px;
}

@media (max-width:860px){
  .pd-grid{ grid-template-columns:1fr; }
  .pd-side{ border-inline-end:0; border-bottom:1px solid var(--pd-line); }
  .pd-track{ grid-auto-flow:row; grid-auto-columns:auto; gap:2px; }
  .pd-track__s{ flex-direction:row; gap:12px; justify-content:flex-start; }
  .pd-track__s::before{ inset-block-start:34px; inset-inline-start:17px; width:2px; height:100%; }
  .pd-track__l{ text-align:start; }
  .pd-head h3{ font-size:17.5px; }
  .pd-btn--dark{ position:static; margin-bottom:14px; display:inline-block; }
  .pd-head--act{ padding-inline-start:24px; }
}

/* ---------- Keep the widget a component, not a second page ----------
   The real portal is full-screen; embedded in a marketing page it has to
   stay inside a fixed frame, so the detail pane scrolls internally. */
.pd-main{ max-height:min(560px, 72vh); overflow-y:auto; overscroll-behavior:contain; }
.pd-side{ max-height:min(560px, 72vh); overflow-y:auto; }
.pd-main::-webkit-scrollbar,.pd-side::-webkit-scrollbar{ width:9px; }
.pd-main::-webkit-scrollbar-thumb,.pd-side::-webkit-scrollbar-thumb{
  background:#C9D5DE; border-radius:5px; border:2px solid #fff; }
.pd-main::-webkit-scrollbar-track,.pd-side::-webkit-scrollbar-track{ background:transparent; }

/* ---------- Payments area ---------- */
.pd-bar__user{ cursor:pointer; transition:.14s; }
.pd-bar__user:hover{ border-color:var(--pd-blue); color:var(--pd-blue); }
.pd-payarea{ padding:4px 4px 8px; }
.pd-payarea h3{ font-size:19px; margin:0 0 18px; }
.pd-back{
  background:none; border:1px solid var(--pd-line); border-radius:8px;
  padding:7px 14px; font-size:13px; font-weight:600; color:var(--pd-ink-2);
  margin-bottom:16px; transition:.14s;
}
.pd-back:hover{ border-color:var(--pd-blue); color:var(--pd-blue); }
.pd-tablewrap{ overflow-x:auto; border:1px solid var(--pd-line); border-radius:var(--r-sm); }
.pd-table{ width:100%; border-collapse:collapse; font-size:13.5px; min-width:640px; }
.pd-table th{
  background:var(--pd-bg); text-align:start; font-weight:700; color:var(--pd-ink-2);
  padding:11px 13px; border-bottom:1px solid var(--pd-line); white-space:nowrap; font-size:12.5px;
}
.pd-table td{ padding:13px; border-bottom:1px solid var(--pd-line); vertical-align:top; }
.pd-table tr:last-child td{ border-bottom:0; }
.pd-table td:nth-child(3),.pd-table td:nth-child(4),.pd-table td:nth-child(5){
  font-weight:600; font-variant-numeric:tabular-nums; white-space:nowrap; }
.pd-total{ font-size:15px; margin-top:14px; }
.pd-total b{ color:var(--pd-blue-d); font-variant-numeric:tabular-nums; }
.pd-mailrow{ display:flex; gap:10px; align-items:center; flex-wrap:wrap; margin-top:18px; }
.pd-mailrow label{ font-size:13.5px; color:var(--pd-ink-2); }
.pd-mailrow input{
  flex:1 1 220px; min-width:0; padding:10px 13px; font-family:inherit; font-size:14px;
  border:1px solid var(--pd-line); border-radius:8px; color:var(--pd-ink); background:#fff;
}
.pd-mailrow input:focus{ outline:none; border-color:var(--pd-blue);
  box-shadow:0 0 0 3px rgba(91,147,184,.18); }

/* Advance payment / all-in price, stated where a client would look for it. */
.pd-pay__terms{
  font-size:12.5px; color:var(--pd-ink-3); margin-top:12px;
  padding-top:10px; border-top:1px dashed var(--pd-line);
}

/* Sidebar rows became buttons once the list held more than one record. */
.pd-side__row{
  width:100%; text-align:start; background:none; font:inherit; color:inherit;
  border-inline-end:0; border-block-start:0; cursor:pointer; transition:.14s;
}
.pd-side__row:hover{ background:var(--pd-bg); }
.pd-side__row.is-on:hover{ background:var(--pd-blue-l); }
.pd-side__row:focus-visible{ outline:2px solid var(--pd-blue); outline-offset:-2px; }
