/* ICE Partners — Authenticated Dashboard Components (v4 — split-screen login)
   Loaded on dashboard.php, refer.php, earnings.php, login.php.

   v4: replaced the single centered login card with a two-panel "auth
   shell" — left panel gives a reason to sign in (a locked preview of
   the real Ledger, so it's not a blank form on empty space), right
   panel is the actual WhatsApp OTP flow with a live message-bubble
   preview. Same circuit-trace and gradient-text language as the
   Ledger elsewhere in the dashboard, so login and dashboard read as
   one continuous product.

   v3.1: low-opacity white text inside the dark Ledger/CTA cards was too
   faint. Every label/sub-copy value bumped to solid light blue-grey.

   v3 direction: KPI grid is one "Ledger" card — hero number + avatar,
   three supporting stats split by a circuit-trace divider (grounded in
   ICE actually manufacturing electronics, not a generic decoration). */

.pd-section { padding-top: calc(var(--nh) + 40px); padding-bottom: 72px; position: relative; }

.pd-section::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 420px;
  background: radial-gradient(ellipse 900px 320px at 15% 0%, rgba(0,74,173,.06), transparent 70%);
  pointer-events: none; z-index: 0;
}
.pd-section > .inner { position: relative; z-index: 1; }

/* .ap-full is defined in apply.php's own private <style> block and was
   never actually shared — login.php and refer.php use the same class
   name but that width:100% rule never applied to them. Defining it here
   makes it universally available across every dashboard-system page. */
.ap-full { width: 100%; }

/* ---- Page header ---- */
.pd-head { display: flex; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; gap: 16px; margin-bottom: 30px; padding-top: 30px; }
.pd-head-name { font-size: clamp(22px,3vw,30px); font-weight: 800; color: #0d1c2e; line-height: 1.2; }
.pd-head-meta { display: flex; align-items: center; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.pd-code { font-family: monospace; font-size: 12.5px; font-weight: 700; color: #004aad; background: linear-gradient(135deg, rgba(0,74,173,.08), rgba(58,127,212,.12)); border: 1px solid rgba(0,74,173,.25); border-radius: 6px; padding: 4px 10px; letter-spacing: .5px; }
.pd-head-btn { display: inline-flex; align-items: center; gap: 7px; padding: 9px 16px; border-radius: 8px; background: #fff; border: 1px solid #dde4f0; color: #004aad; font-weight: 700; font-size: 12.5px; text-decoration: none; box-shadow: 0 2px 8px rgba(13,28,46,.05); transition: box-shadow .15s ease, transform .15s ease; }
.pd-head-btn svg { width: 15px; height: 15px; }
.pd-head-btn:hover { box-shadow: 0 6px 16px rgba(0,74,173,.15); transform: translateY(-1px); }

/* ---- Badges ---- */
.pd-badge { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 800; letter-spacing: .3px; text-transform: uppercase; padding: 5px 12px; border-radius: 20px; box-shadow: 0 2px 6px rgba(0,0,0,.08); }
.pd-badge-blue   { background: linear-gradient(135deg,#004aad,#1260c4); color: #fff; }
.pd-badge-green  { background: linear-gradient(135deg,#059669,#10b981); color: #fff; }
.pd-badge-amber  { background: linear-gradient(135deg,#f59e0b,#fbbf24); color: #1a1200; }
.pd-badge-red    { background: linear-gradient(135deg,#dc2626,#ef4444); color: #fff; }
.pd-badge-gray   { background: #3a4a5c; color: #fff; }

/* ---- Status banner ---- */
.pd-banner { border-radius: 16px; padding: 28px 30px; display: flex; align-items: flex-start; gap: 18px; margin-bottom: 30px; box-shadow: 0 8px 24px rgba(13,28,46,.06); }
.pd-banner-amber { background: linear-gradient(135deg, #fffbeb, #fef3c7 140%); border: 1px solid #fde68a; }
.pd-banner-red   { background: linear-gradient(135deg, #fef2f2, #fee2e2 140%); border: 1px solid #fecaca; }
.pd-banner-icon { flex-shrink: 0; width: 44px; height: 44px; border-radius: 50%; display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 12px rgba(0,0,0,.1); }
.pd-banner-icon svg { width: 20px; height: 20px; color: #fff; }
.pd-banner-amber .pd-banner-icon { background: linear-gradient(135deg,#f59e0b,#fbbf24); }
.pd-banner-red .pd-banner-icon { background: linear-gradient(135deg,#dc2626,#ef4444); }
.pd-banner-title { font-size: 17px; font-weight: 800; color: #0d1c2e; margin-bottom: 4px; }
.pd-banner-text { font-size: 14px; color: #3a4a5c; line-height: 1.6; }

/* ==========================================================
   THE LEDGER — signature component.
   ========================================================== */
.pd-ledger {
  background: linear-gradient(165deg, #0d1c2e, #05101e 130%);
  border: 1px solid rgba(58,127,212,.18);
  border-radius: 20px;
  padding: 34px 36px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 20px 48px rgba(5,16,30,.28);
  margin-bottom: 40px;
  display: flex;
  align-items: flex-start;
  gap: 40px;
  flex-wrap: nowrap;
}
.pd-ledger::before {
  content: '';
  position: absolute; inset: 0;
  background-image: radial-gradient(rgba(58,127,212,.14) 1px, transparent 1px);
  background-size: 24px 24px;
  pointer-events: none;
}
.pd-ledger::after {
  content: '';
  position: absolute; top: -60%; right: -10%; width: 60%; height: 220%;
  background: linear-gradient(135deg, rgba(58,127,212,.10), transparent 60%);
  pointer-events: none;
  transform: rotate(12deg);
}
/* Diagonal sweep — same shimmerSweep keyframe used on the store's
   category/product card images (store.css). Placed as a real DOM
   element rather than a third pseudo-element (::before/::after are
   already used above), and positioned first in markup so the hero/stat
   content — both already z-index:1 — paints on top of it, keeping
   text crisp while the sweep runs behind it on the dark background. */
.pd-ledger-shimmer {
  position: absolute; top: 0; left: -100%; width: 40%; height: 100%;
  background: linear-gradient(to right, transparent 0%, rgba(255,255,255,.26) 50%, transparent 100%);
  transform: skewX(-18deg);
  pointer-events: none;
  animation: shimmerSweep 4.5s ease infinite;
}
@media (prefers-reduced-motion: reduce) {
  .pd-ledger-shimmer { animation: none; display: none; }
}

.pd-ledger-hero { display: flex; align-items: center; gap: 18px; position: relative; z-index: 1; flex-shrink: 0; }
.pd-ledger-avatar {
  width: 54px; height: 54px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg,#004aad,#3a7fd4);
  display: flex; align-items: center; justify-content: center;
  font-size: 17px; font-weight: 800; color: #fff; letter-spacing: .5px;
  box-shadow: 0 6px 16px rgba(0,74,173,.4), inset 0 0 0 2px rgba(255,255,255,.15);
}
.pd-ledger-hero-label { font-size: 11px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; color: #a9c0dc; margin-bottom: 6px; }
.pd-ledger-hero-value { font-size: clamp(28px,3.4vw,40px); font-weight: 800; color: #fff; line-height: 1; background: linear-gradient(90deg,#fff,#c7ddf7); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.pd-ledger-hero-sub { font-size: 12.5px; color: #c3d2e6; margin-top: 8px; }

.pd-ledger-stats { display: flex; align-items: flex-start; flex: 0 0 auto; margin-left: auto; gap: 0; position: relative; z-index: 1; }
.pd-ledger-col { flex: 0 0 auto; width: 148px; padding: 0 22px; position: relative; }
.pd-ledger-col:first-child { padding-left: 0; }
.pd-ledger-col:last-child { padding-right: 0; }
.pd-ledger-col:not(:last-child)::after {
  content: '';
  position: absolute; top: 4px; bottom: 4px; right: -1px; width: 1px;
  background: repeating-linear-gradient(to bottom, rgba(58,127,212,.4) 0 5px, transparent 5px 10px);
}
.pd-ledger-col:not(:last-child)::before {
  content: '';
  position: absolute; top: 50%; right: -4.5px; width: 7px; height: 7px; border-radius: 50%;
  background: #3a7fd4; box-shadow: 0 0 0 3px rgba(58,127,212,.18);
  transform: translateY(-50%);
}

.pd-kpi-icon { position: relative; z-index: 1; width: 34px; height: 34px; border-radius: 9px; display: flex; align-items: center; justify-content: center; margin-bottom: 12px; }
.pd-kpi-icon svg { width: 17px; height: 17px; }
.pd-kpi-icon-blue  { background: rgba(58,127,212,.16); box-shadow: inset 0 0 0 1px rgba(58,127,212,.3); color: #7cb0f0; }
.pd-kpi-icon-green { background: rgba(5,150,105,.2); box-shadow: inset 0 0 0 1px rgba(5,150,105,.35); color: #4ee6ac; }
.pd-kpi-icon-amber { background: rgba(245,158,11,.2); box-shadow: inset 0 0 0 1px rgba(245,158,11,.35); color: #fbbf24; }
.pd-kpi-icon-red   { background: rgba(220,38,38,.2); box-shadow: inset 0 0 0 1px rgba(220,38,38,.35); color: #f87171; }

.pd-kpi-label { position: relative; z-index: 1; font-size: 10.5px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; color: #a9c0dc; margin-bottom: 7px; }
.pd-kpi-value-sm { position: relative; z-index: 1; font-size: 22px; font-weight: 800; color: #fff; line-height: 1; }
.pd-kpi-sub { position: relative; z-index: 1; font-size: 11.5px; color: #c3d2e6; margin-top: 7px; line-height: 1.4; }

@media (max-width: 760px) {
  .pd-ledger { flex-direction: column; align-items: flex-start; gap: 28px; padding: 28px 24px; }
  .pd-ledger-stats { width: 100%; flex-wrap: wrap; }
  .pd-ledger-col { flex: 1 1 100%; width: auto; margin-bottom: 18px; }
  .pd-ledger-col:not(:last-child)::after,
  .pd-ledger-col:not(:last-child)::before { display: none; }
}

/* ---- Primary action card ---- */
.pd-cta-dark {
  background: linear-gradient(135deg, #004aad, #1260c4 130%);
  border-radius: 18px;
  padding: 26px 30px;
  display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap;
  margin-bottom: 24px;
  box-shadow: 0 14px 32px rgba(0,74,173,.28);
  position: relative;
  overflow: hidden;
}
.pd-cta-dark::before {
  content: '';
  position: absolute; inset: 0;
  background-image: radial-gradient(rgba(255,255,255,.1) 1px, transparent 1px);
  background-size: 22px 22px;
  pointer-events: none;
}
.pd-cta-left { display: flex; align-items: center; gap: 16px; position: relative; z-index: 1; }
.pd-cta-icon { flex-shrink: 0; width: 46px; height: 46px; border-radius: 12px; background: rgba(255,255,255,.15); display: flex; align-items: center; justify-content: center; box-shadow: inset 0 0 0 1px rgba(255,255,255,.2); }
.pd-cta-icon svg { width: 22px; height: 22px; color: #fff; }
.pd-cta-title { font-size: 17px; font-weight: 800; color: #fff; }
.pd-cta-desc { font-size: 13px; color: #e3edfa; margin-top: 3px; }
.pd-cta-btn { position: relative; z-index: 1; overflow: hidden; background: #fff; color: #004aad; font-weight: 800; font-size: 13.5px; padding: 12px 24px; border-radius: 8px; text-decoration: none; white-space: nowrap; box-shadow: 0 6px 16px rgba(0,0,0,.15); transition: transform .15s ease; display: inline-block; }
.pd-cta-btn:hover { transform: translateY(-2px); }
.pd-cta-btn::after {
  content: '';
  position: absolute; top: 0; left: -100%; width: 35%; height: 100%;
  background: linear-gradient(to right, transparent 0%, rgba(0,74,173,.32) 50%, transparent 100%);
  transform: skewX(-18deg);
  pointer-events: none;
  animation: shimmerSweep 4.5s ease infinite;
}
@media (prefers-reduced-motion: reduce) {
  .pd-cta-btn::after { animation: none; display: none; }
}

/* ---- Section card (light) ---- */
.pd-card { background: #fff; border: 1px solid #dde4f0; border-radius: 16px; padding: 26px; margin-bottom: 24px; position: relative; overflow: hidden; box-shadow: 0 4px 16px rgba(13,28,46,.05); transition: box-shadow .2s ease; }
.pd-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: linear-gradient(90deg, #004aad, #3a7fd4, #059669); }
.pd-card:hover { box-shadow: 0 10px 28px rgba(13,28,46,.09); }
.pd-card-title { font-size: 17px; font-weight: 800; color: #0d1c2e; margin-bottom: 4px; }
.pd-card-desc { font-size: 13px; color: #3a4a5c; margin-bottom: 20px; line-height: 1.6; }

/* ---- Table ---- */
.pd-table-wrap { overflow-x: auto; border: 1px solid #dde4f0; border-radius: 12px; }
.pd-table { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 560px; }
.pd-table thead th { background: #f4f6fb; text-align: left; font-size: 11px; font-weight: 700; letter-spacing: .4px; text-transform: uppercase; color: #3a4a5c; padding: 12px 16px; border-bottom: 1px solid #dde4f0; white-space: nowrap; }
.pd-table tbody td { padding: 14px 16px; border-bottom: 1px solid #f0f2f7; color: #0d1c2e; vertical-align: top; }
.pd-table tbody tr:last-child td { border-bottom: none; }
.pd-table tbody tr { transition: background .15s ease; }
.pd-table tbody tr:hover { background: linear-gradient(90deg, rgba(0,74,173,.03), rgba(58,127,212,.02)); }
.pd-table .pd-num { text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; }
.pd-table-empty { text-align: center; color: #3a4a5c; padding: 40px 20px; font-size: 13.5px; }

/* ---- Empty state ---- */
.pd-empty { text-align: center; padding: 48px 24px; color: #3a4a5c; }
.pd-empty-icon { width: 56px; height: 56px; border-radius: 50%; background: linear-gradient(135deg,#004aad,#1260c4); display: flex; align-items: center; justify-content: center; margin: 0 auto 16px; box-shadow: 0 8px 20px rgba(0,74,173,.25); }
.pd-empty-icon svg { width: 24px; height: 24px; color: #fff; }
.pd-empty-title { font-size: 15px; font-weight: 700; color: #0d1c2e; margin-bottom: 6px; }
.pd-empty-text { font-size: 13px; line-height: 1.6; max-width: 340px; margin: 0 auto; }

/* ==========================================================
   AUTH SHELL — split-screen login/signin.
   Left: a locked preview of the real Ledger (a reason to sign in).
   Right: the WhatsApp OTP flow with a live message-bubble preview.
   Same circuit-trace + gradient-text language as the Ledger.
   ========================================================== */
.pd-auth-shell {
  display: flex; flex-wrap: wrap;
  border-radius: 20px; overflow: hidden;
  box-shadow: 0 20px 48px rgba(5,16,30,.28);
  margin: 32px 0 60px;
}
.pd-auth-left, .pd-auth-right { flex: 1 1 360px; padding: 44px 40px; position: relative; }
.pd-auth-left {
  background: linear-gradient(165deg, #0d1c2e, #05101e 130%);
  overflow: hidden;
}
.pd-auth-left::before {
  content: '';
  position: absolute; inset: 0;
  background-image: radial-gradient(rgba(58,127,212,.14) 1px, transparent 1px);
  background-size: 24px 24px;
  pointer-events: none;
}
.pd-auth-right { background: #0a1626; }

.pd-auth-eyebrow { display: flex; align-items: center; gap: 8px; margin-bottom: 26px; position: relative; z-index: 1; }
.pd-auth-logo-chip { width: 28px; height: 28px; border-radius: 7px; background: linear-gradient(135deg,#004aad,#3a7fd4); display: flex; align-items: center; justify-content: center; font-size: 9.5px; font-weight: 800; color: #fff; flex-shrink: 0; }
.pd-auth-eyebrow span { font-size: 12px; color: #8fa8c9; font-weight: 700; letter-spacing: .3px; }

.pd-auth-headline {
  font-size: clamp(24px,2.6vw,28px); font-weight: 800; line-height: 1.2; margin-bottom: 10px; position: relative; z-index: 1;
  background: linear-gradient(90deg,#fff,#c7ddf7);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.pd-auth-sub { font-size: 13.5px; color: #c3d2e6; line-height: 1.6; margin-bottom: 26px; position: relative; z-index: 1; }

.pd-auth-teaser { background: rgba(19,35,58,.7); border: 1px solid rgba(58,127,212,.22); border-radius: 14px; padding: 20px; position: relative; overflow: hidden; z-index: 1; }
.pd-auth-teaser-row { display: flex; gap: 32px; }
.pd-auth-teaser-label { font-size: 10.5px; font-weight: 700; letter-spacing: .4px; text-transform: uppercase; color: #5f7691; margin-bottom: 6px; }
.pd-auth-teaser-value { font-size: 19px; font-weight: 800; color: #3a5170; }
.pd-auth-teaser-lock { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 8px; background: rgba(13,28,46,.62); }
.pd-auth-teaser-lock svg { width: 14px; height: 14px; color: #8fa8c9; flex-shrink: 0; }
.pd-auth-teaser-lock span { font-size: 12px; color: #c3d2e6; font-weight: 600; }

.pd-auth-trust { font-size: 12px; color: #5f7691; margin-top: 24px; position: relative; z-index: 1; }

.pd-auth-title { font-size: 22px; font-weight: 800; margin-bottom: 6px; background: linear-gradient(90deg,#fff,#c7ddf7); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.pd-auth-right .pd-auth-sub2 { font-size: 13.5px; color: #c3d2e6; line-height: 1.6; margin-bottom: 24px; }

.pd-auth-phone-prefix { position: absolute; left: 0; top: 0; bottom: 0; display: flex; align-items: center; gap: 6px; padding: 0 12px; border-right: 1px solid rgba(255,255,255,.14); pointer-events: none; }
.pd-auth-phone-prefix svg { width: 15px; height: 15px; color: #25d366; flex-shrink: 0; }
.pd-auth-phone-prefix span { font-size: 12.5px; font-weight: 700; color: rgba(255,255,255,.85); }

.pd-auth-wa-btn {
  height: 42px; width: 100%; background: #25d366; color: #04331d; font-weight: 800; font-size: 13.5px;
  border: none; border-radius: 8px; display: flex; align-items: center; justify-content: center; gap: 8px;
  cursor: pointer; transition: transform .15s ease, box-shadow .15s ease; margin-top: 18px;
}
.pd-auth-wa-btn svg { width: 16px; height: 16px; }
.pd-auth-wa-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 18px rgba(37,211,102,.35); }
.pd-auth-wa-btn:disabled { opacity: .7; cursor: default; transform: none; box-shadow: none; }

.pd-auth-bubble { margin-top: 20px; background: rgba(19,35,58,.7); border: 1px solid rgba(58,127,212,.22); border-radius: 14px; padding: 14px 16px; display: flex; gap: 10px; align-items: flex-start; }
.pd-auth-bubble-avatar { width: 28px; height: 28px; border-radius: 50%; background: #25d366; display: flex; align-items: center; justify-content: center; flex-shrink: 0; position: relative; }
.pd-auth-bubble-avatar svg { width: 14px; height: 14px; color: #04331d; position: relative; z-index: 1; }
.pd-auth-bubble-avatar.pulsing::after {
  content: ''; position: absolute; inset: -5px; border-radius: 50%;
  border: 1.5px solid rgba(37,211,102,.5); animation: pdPulseRing 2.6s ease-out infinite;
}
@keyframes pdPulseRing {
  0%   { transform: scale(.9); opacity: .9; }
  70%  { transform: scale(1.18); opacity: 0; }
  100% { transform: scale(1.18); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .pd-auth-bubble-avatar.pulsing::after { animation: none; display: none; }
}
.pd-auth-bubble-name { font-size: 12px; color: #8fa8c9; margin: 0 0 2px; }
.pd-auth-bubble-text { font-size: 13px; color: #fff; margin: 0; }
.pd-auth-bubble-text.sent { color: #4ee6ac; font-weight: 700; }

.pd-auth-foot { text-align: left; font-size: 12px; color: #c3d2e6; margin-top: 24px; }

/* Circuit-trace divider before the OTP boxes — same grammar as the Ledger */
.pd-otp-trace { position: relative; padding-bottom: 12px; }
.pd-otp-trace::after {
  content: '';
  position: absolute; left: 0; right: 0; bottom: 0; height: 1px;
  background: repeating-linear-gradient(to right, rgba(58,127,212,.4) 0 4px, transparent 4px 8px);
}
.ap-otp-box.filled { border-color: #4ee6ac; background: rgba(5,150,105,.12); }

@media (max-width: 860px) {
  .pd-auth-left, .pd-auth-right { padding: 34px 26px; }
}
@media (max-width: 480px) {
  .pd-auth-teaser { display: none; }
  .pd-auth-trust { margin-top: 14px; }
}
