/* ============================================================================
   P&L COMMAND CENTER — ORANGE × WHITE REDESIGN
   assets/css/pl-redesign.css
   ----------------------------------------------------------------------------
   Loaded ONLY by pl-engine-v2.php and pl-engine.php (after assets/css/style.css).
   Replaces the old page-level inline <style> block. Every functional ID/class
   that the backend + pl-engine.js + the page decorator rely on is preserved and
   restyled here — nothing is renamed or removed.
   Palette: Orange (#FF5722) primary · White cards · warm light-grays for
   borders & secondary text.
   ========================================================================== */

/* ── Display font for headings (Inter remains the UI/body font) ───────── */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@600;700;800&display=swap');

/* ── Content backdrop: warm off-white, breathable ─────────────────────── */
.main-content {
  background: #FAF8F5;
}

/* ════════════════════════════════════════════════════════════════════════
   DESIGN TOKENS + SHELL LAYOUT
   ════════════════════════════════════════════════════════════════════════ */
.pl-shell {
  --plc-orange: #FF5722;
  --plc-orange-deep: #F4511E;
  --plc-orange-soft: #FFF1EB;
  --plc-orange-grad: linear-gradient(135deg, #FF6A3D, #F4511E);
  --plc-ink: #211B16;
  --plc-ink-2: #6E665E;
  --plc-muted: #A8A099;
  --plc-line: #EFEAE4;
  --plc-line-2: #E2DBD2;
  --plc-card: #FFFFFF;
  --plc-green: #10B981;
  --plc-green-soft: #E9F8F1;
  --plc-red: #EF4444;
  --plc-red-soft: #FDEBEB;
  --plc-amber: #F59E0B;
  --plc-amber-soft: #FEF4E0;
  --plc-shadow: 0 1px 2px rgba(33, 27, 22, .04), 0 14px 34px -22px rgba(33, 27, 22, .25);
  --plc-shadow-hover: 0 2px 4px rgba(33, 27, 22, .05), 0 22px 44px -20px rgba(255, 87, 34, .25);

  display: flex;
  flex-direction: column;
  gap: 22px;
  max-width: 1160px;
  margin: 0 auto;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--plc-ink);
}

.pl-shell h3,
.pl-shell h4,
.pl-shell .metric-stat-value,
.pl-shell .pl2-health-pct b,
.pl-shell .cf-val,
.pl-shell .pl2-step h4,
.pl-shell .pl-collapse-title {
  font-family: 'Poppins', 'Inter', sans-serif;
}

.pl-shell .section-gap { margin-bottom: 0; }

/* gradient text accent (used by page header too) */
.pl-grad-text {
  background: linear-gradient(120deg, #FF5722, #FF8A50);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ── Generic cards inside the shell ───────────────────────────────────── */
.pl-shell .card {
  background: #FFFFFF;
  border: 1px solid var(--plc-line);
  border-radius: 20px;
  padding: 22px;
  box-shadow: var(--plc-shadow);
  transition: box-shadow .18s ease, transform .18s ease, border-color .18s ease;
}
.pl-shell .card:hover {
  transform: translateY(-1px);
  box-shadow: var(--plc-shadow-hover);
  border-color: var(--plc-line-2);
}
.pl-shell .card h3 { font-size: 15px; font-weight: 700; color: var(--plc-ink); margin: 0; }

.pl-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
}
@media (max-width: 900px) { .pl-two-col { grid-template-columns: 1fr; } }

/* small "?" info badge on section titles */
.pl-info {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  font-size: 10px;
  font-weight: 800;
  color: var(--plc-ink-2);
  background: #F7F3EE;
  border: 1px solid var(--plc-line-2);
  margin-left: 6px;
  vertical-align: middle;
  cursor: help;
  transition: all .15s;
}
.pl-info:hover {
  background: var(--plc-orange);
  border-color: var(--plc-orange);
  color: #fff;
  transform: scale(1.15);
}

.pl-shell .empty-state {
  text-align: center;
  color: var(--plc-muted);
  font-size: 12.5px;
  font-weight: 600;
  padding: 30px 16px;
}

/* ── Inputs / selects / buttons polish (shell scope only) ─────────────── */
.pl-shell input[type="text"],
.pl-shell input[type="number"],
.pl-shell input[type="search"],
.pl-shell select {
  border: 1px solid var(--plc-line-2);
  border-radius: 10px;
  background: #FFFFFF;
  color: var(--plc-ink);
  font-family: inherit;
  font-weight: 600;
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.pl-shell input:focus,
.pl-shell select:focus {
  border-color: var(--plc-orange);
  box-shadow: 0 0 0 3px rgba(255, 87, 34, .12);
}
.pl-shell .btn { border-radius: 10px; font-weight: 700; }

/* ════════════════════════════════════════════════════════════════════════
   01 · UPLOAD GUIDE — horizontal stepper + collapsible detail accordion
   ════════════════════════════════════════════════════════════════════════ */
.plc-guide-top {
  display: flex;
  gap: 24px;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  margin-bottom: 22px;
}
.plc-guide-heading { display: flex; gap: 14px; align-items: center; }
.plc-ico {
  width: 44px;
  height: 44px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  font-size: 20px;
  flex: none;
}
.plc-ico-orange {
  background: var(--plc-orange-soft);
  box-shadow: inset 0 0 0 1px rgba(255, 87, 34, .14);
}
.plc-guide-heading h3 { margin: 0; font-size: 16px; font-weight: 700; color: var(--plc-ink); }
.plc-guide-heading p { margin: 2px 0 0; font-size: 12px; color: var(--plc-ink-2); font-weight: 500; }
.plc-guide-progress {
  flex: 1;
  min-width: 250px;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  justify-content: center;
}

/* progress bar (JS drives width via #pl2-progress-fill) */
.pl2-progress {
  height: 7px;
  background: #F2EDE7;
  border-radius: 6px;
  overflow: hidden;
}
.pl2-progress-fill {
  height: 100%;
  width: 0;
  border-radius: 6px;
  background: var(--plc-orange-grad);
  transition: width .6s cubic-bezier(.22, .8, .35, 1);
  box-shadow: 0 0 10px rgba(255, 87, 34, .45);
}
.pl2-progress-label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--plc-ink-2);
  letter-spacing: .1px;
}

/* horizontal stepper — 2 steps connected by a dotted line */
.pl2-steps {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  z-index: 0;
}
@media (max-width: 820px) {
  .pl2-steps { grid-template-columns: 1fr; }
  .pl2-steps::before { display: none; }
}
.pl2-steps::before {
  content: '';
  position: absolute;
  top: 36px;
  left: calc(25% + 14px);
  right: calc(25% + 14px);
  height: 2px;
  background: repeating-linear-gradient(90deg, var(--plc-line-2) 0 7px, transparent 7px 14px);
  z-index: 0;
}

.pl2-step {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 14px;
  background: #FFFDFB;
  border: 1px solid var(--plc-line);
  border-radius: 18px;
  padding: 20px 20px 16px;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.pl2-step:hover {
  transform: translateY(-2px);
  box-shadow: var(--plc-shadow);
}

.pl2-step-num {
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--plc-orange-grad);
  color: #fff;
  font-weight: 800;
  font-size: 14px;
  display: grid;
  place-items: center;
  box-shadow: 0 4px 10px -3px rgba(255, 87, 34, .5);
  transition: transform .2s ease, background .2s ease;
}
.pl2-step-body { min-width: 0; }
.pl2-step h4 { margin: 2px 0 6px; font-size: 13.5px; font-weight: 700; color: var(--plc-ink); letter-spacing: .1px; }
.pl2-step h4 small {
  display: block;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--plc-muted);
  margin-top: 2px;
  letter-spacing: .2px;
  font-family: 'Inter', sans-serif;
}
.pl2-step p { margin: 0; font-size: 12px; color: var(--plc-ink-2); line-height: 1.6; font-weight: 500; }
.pl2-step p b { color: var(--plc-ink); font-weight: 700; }

.pl2-step-status {
  display: inline-block;
  margin-top: 10px;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--plc-muted);
}

/* step 2 (payments) — subtle warm tint for the extra-attention note */
.pl2-step.warn {
  border-color: rgba(245, 158, 11, .35);
  background: #FFFDF6;
}

/* step states (driven by decorator classes .done/.current/.todo) */
.pl2-step.done {
  border-color: rgba(16, 185, 129, .4);
  background: #F3FBF7;
}
.pl2-step.done .pl2-step-num {
  background: var(--plc-green);
  box-shadow: 0 4px 10px -3px rgba(16, 185, 129, .5);
}
.pl2-step.done .pl2-step-status { color: var(--plc-green); }
.pl2-step.current {
  border-color: rgba(255, 87, 34, .45);
  box-shadow: 0 0 0 4px rgba(255, 87, 34, .08);
}
.pl2-step.current .pl2-step-num {
  transform: scale(1.08);
  animation: plcPulse 2s ease-in-out infinite;
}
.pl2-step.current .pl2-step-status { color: var(--plc-orange); }
@keyframes plcPulse {
  0%, 100% { box-shadow: 0 4px 10px -3px rgba(255, 87, 34, .5); }
  50% { box-shadow: 0 0 0 8px rgba(255, 87, 34, .14); }
}

/* collapsible detail accordion (month table + live checklist) */
.plc-acc {
  margin-top: 18px;
  border: 1px solid var(--plc-line);
  border-radius: 14px;
  background: #FFFDFB;
  overflow: hidden;
}
.plc-acc summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 13px 16px;
  font-size: 12px;
  font-weight: 700;
  color: var(--plc-ink-2);
  user-select: none;
  transition: color .15s ease;
}
.plc-acc summary::-webkit-details-marker { display: none; }
.plc-acc summary:hover { color: var(--plc-orange); }
.plc-acc-arrow { transition: transform .2s ease; color: var(--plc-muted); font-size: 14px; line-height: 1; }
.plc-acc[open] .plc-acc-arrow { transform: rotate(180deg); }
.plc-acc-body { padding: 14px 16px 18px; border-top: 1px dashed var(--plc-line); }

/* month-pairing reference table */
.pl2-month-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.pl2-month-table th {
  text-align: left;
  padding: 8px 10px;
  color: var(--plc-muted);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .6px;
  border-bottom: 1px solid var(--plc-line);
  font-weight: 800;
}
.pl2-month-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--plc-line);
  font-weight: 600;
  color: var(--plc-ink-2);
}
.pl2-month-table td b { color: var(--plc-ink); }
.pl2-month-table tr:last-child td { border-bottom: none; }

/* live checklist (filled by renderGuide) */
.pl2-guide {
  border: 1px solid var(--plc-line);
  border-radius: 12px;
  padding: 14px 16px;
  background: #FFFFFF;
  margin-top: 14px;
}
.pl2-guide-head { font-size: 12px; font-weight: 700; color: var(--plc-ink); margin-bottom: 10px; }
.pl2-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 13px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 700;
  margin: 3px 6px 3px 0;
  border: 1px solid var(--plc-line);
  background: #F7F3EE;
  color: var(--plc-ink-2);
}
.pl2-chip-ok { border-color: rgba(16, 185, 129, .4); color: #0E8F63; background: var(--plc-green-soft); }
.pl2-chip-miss { border-color: rgba(245, 158, 11, .45); color: #B47A05; background: var(--plc-amber-soft); }
.pl2-chip-wait { color: var(--plc-muted); }
.pl2-guide-warn {
  display: none;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  background: var(--plc-amber-soft);
  border: 1px solid rgba(245, 158, 11, .4);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 12px;
  font-weight: 600;
  color: #8A5A06;
  line-height: 1.55;
}
.pl2-guide-warn b { color: #6B4600; }

/* ════════════════════════════════════════════════════════════════════════
   02 · HERO UPLOAD — soft, inviting dropzone
   ════════════════════════════════════════════════════════════════════════ */
.hero-card {
  position: relative;
  background: #FFFFFF;
  border: 1px solid var(--plc-line);
  border-radius: 22px;
  padding: 26px;
  box-shadow: var(--plc-shadow);
  overflow: hidden;
}
.hero-card::before {
  content: '';
  position: absolute;
  top: -90px;
  right: -70px;
  width: 240px;
  height: 240px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 87, 34, .10), transparent 70%);
  pointer-events: none;
}
.hero-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--plc-orange-grad);
  opacity: .9;
}
.plc-upload-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 18px;
  position: relative;
  z-index: 1;
}
.plc-upload-head h3 { margin: 0; font-size: 16px; font-weight: 700; color: var(--plc-ink); }
.plc-upload-head p { margin: 3px 0 0; font-size: 12px; color: var(--plc-ink-2); font-weight: 500; }
.plc-private-badge {
  background: var(--plc-green-soft);
  color: #0E8F63;
  border: 1px solid rgba(16, 185, 129, .3);
  border-radius: 20px;
  padding: 6px 12px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .3px;
}

/* dropzone — soft, rounded, no harsh dashes */
.biz-drop {
  position: relative;
  z-index: 1;
  background: #FFFDFB;
  border: 1.5px solid var(--plc-line-2);
  border-radius: 18px;
  padding: 38px 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease, background .2s ease;
}
.biz-drop:hover {
  border-color: rgba(255, 87, 34, .5);
  background: #FFF9F6;
  box-shadow: 0 0 0 4px rgba(255, 87, 34, .06);
  transform: translateY(-1px);
}
.biz-drop.dragover {
  border-color: var(--plc-orange);
  background: var(--plc-orange-soft);
  animation: plcDropPulse 1.1s ease-out infinite;
  transform: scale(1.01);
}
@keyframes plcDropPulse {
  0%   { box-shadow: 0 0 0 0 rgba(255, 87, 34, .30), inset 0 0 0 1px var(--plc-orange); }
  100% { box-shadow: 0 0 0 18px rgba(255, 87, 34, 0), inset 0 0 0 1px var(--plc-orange); }
}
.biz-drop.needs-file {
  border-color: rgba(245, 158, 11, .55);
  background: #FFFCF5;
}
.plc-drop-ico {
  width: 62px;
  height: 62px;
  margin: 0 auto 14px;
  border-radius: 50%;
  background: var(--plc-orange-soft);
  display: grid;
  place-items: center;
  box-shadow: inset 0 0 0 1px rgba(255, 87, 34, .14), 0 6px 16px -8px rgba(255, 87, 34, .5);
  transition: transform .2s ease;
}
.biz-drop:hover .plc-drop-ico { transform: translateY(-3px) scale(1.06); }
.biz-drop-icon { font-size: 26px; line-height: 1; filter: drop-shadow(0 3px 6px rgba(255, 87, 34, .3)); }
.biz-drop-text { font-size: 15px; font-weight: 700; color: var(--plc-ink); }
.biz-drop-hint { font-size: 12px; color: var(--plc-ink-2); font-weight: 500; margin-top: 5px; }
#pl-parse-status {
  font-size: 12px;
  font-weight: 700;
  color: var(--plc-orange);
  margin-top: 12px;
  display: none;
  text-align: center;
  position: relative;
  z-index: 1;
}

/* instant file preview strip */
.pl-file-preview {
  display: none;
  margin-top: 14px;
  background: #FFFDFB;
  border: 1px solid var(--plc-line);
  border-radius: 14px;
  padding: 12px 14px;
  position: relative;
  z-index: 1;
}
.pl-file-pv {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  transition: background .15s ease;
}
.pl-file-pv:hover { background: #F7F3EE; }
.pl-file-pv-ic { font-size: 18px; flex: none; }
.pl-file-pv-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--plc-ink);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pl-file-pv-size { font-size: 10.5px; font-weight: 600; color: var(--plc-muted); flex: none; }
.pl-file-pv-state { font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .5px; flex: none; }
.pl-file-pv.queued .pl-file-pv-state { color: var(--plc-muted); }
.pl-file-pv.ok { background: var(--plc-green-soft); }
.pl-file-pv.ok .pl-file-pv-state { color: var(--plc-green); }
.pl-file-pv.reject { background: var(--plc-red-soft); }
.pl-file-pv.reject .pl-file-pv-state { color: var(--plc-red); }

/* missing-file hint */
.pl-hero-hint {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  font-size: 12px;
  font-weight: 700;
  border-radius: 10px;
  padding: 9px 13px;
  border: 1px solid transparent;
  position: relative;
  z-index: 1;
}
.pl-hero-hint.warn { background: var(--plc-amber-soft); border-color: rgba(245, 158, 11, .4); color: #8A5A06; }
.pl-hero-hint.ok { background: var(--plc-green-soft); border-color: rgba(16, 185, 129, .35); color: #0E8F63; }

/* file-type status chips (renderFileStatus + decorator) */
.filetype-row { display: flex; gap: 8px; flex-wrap: wrap; position: relative; z-index: 1; }
.filetype-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 13px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  background: #F7F3EE;
  border: 1px solid var(--plc-line);
  color: var(--plc-ink-2);
}
.filetype-chip .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--plc-muted); flex: none; }
.filetype-chip.ok { border-color: rgba(16, 185, 129, .4); background: var(--plc-green-soft); color: #0E8F63; }
.filetype-chip.ok .dot { background: var(--plc-green); box-shadow: 0 0 8px rgba(16, 185, 129, .55); }
.filetype-chip.missing {
  border-color: rgba(245, 158, 11, .5);
  animation: plcChipPulse 2.2s ease-in-out infinite;
}
@keyframes plcChipPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0); }
  50% { box-shadow: 0 0 0 5px rgba(245, 158, 11, .14); }
}
.plc-chip-key b { color: var(--plc-ink); }

/* ════════════════════════════════════════════════════════════════════════
   03 · FORMULA + MISMATCH BANNER
   ════════════════════════════════════════════════════════════════════════ */
.formula-strip {
  display: flex;
  gap: 12px;
  align-items: center;
  background: #FFFFFF;
  border: 1px solid var(--plc-line);
  border-left: 3px solid var(--plc-orange);
  border-radius: 14px;
  padding: 13px 16px;
  font-size: 12px;
  font-weight: 500;
  color: var(--plc-ink-2);
  line-height: 1.7;
  box-shadow: var(--plc-shadow);
}
.formula-strip b { color: var(--plc-ink); font-weight: 700; }
.plc-formula-ico { font-size: 16px; flex: none; }
.plc-f-pos { color: var(--plc-green); font-weight: 700; }
.plc-f-warn { color: #B47A05; font-weight: 700; }

.banner-missing {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--plc-amber-soft);
  border: 1px solid rgba(245, 158, 11, .4);
  border-radius: 14px;
  padding: 12px 16px;
  font-size: 12.5px;
  font-weight: 600;
  color: #8A5A06;
  flex-wrap: wrap;
  cursor: pointer;
  transition: all .15s ease;
}
.banner-missing:hover { border-color: rgba(245, 158, 11, .7); background: #FDF1D8; }
.banner-missing b { color: #6B4600; }

/* ════════════════════════════════════════════════════════════════════════
   04 · METRICS CARDS
   ════════════════════════════════════════════════════════════════════════ */
.pl-metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(172px, 1fr));
  gap: 14px;
}
.metric-stat-card {
  background: #FFFFFF;
  border: 1px solid var(--plc-line);
  border-radius: 18px;
  padding: 18px 18px 20px;
  box-shadow: var(--plc-shadow);
  position: relative;
  overflow: hidden;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.metric-stat-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--plc-orange-grad);
  opacity: .9;
}
.metric-stat-card.orange::after { background: var(--plc-orange-grad); }
.metric-stat-card.green::after { background: linear-gradient(90deg, #10B981, #34D399); }
.metric-stat-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--plc-shadow-hover);
  border-color: rgba(255, 87, 34, .35);
}
.metric-stat-label {
  font-size: 10.5px;
  font-weight: 800;
  color: var(--plc-muted);
  text-transform: uppercase;
  letter-spacing: .7px;
  display: block;
  margin-bottom: 6px;
}
.metric-stat-value {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -.4px;
  line-height: 1.1;
  color: var(--plc-ink);
  margin-bottom: 5px;
  font-variant-numeric: tabular-nums;
}
.metric-stat-desc { font-size: 11px; font-weight: 500; color: var(--plc-ink-2); line-height: 1.45; }
.metric-stat-icon {
  position: absolute;
  right: 14px;
  bottom: 10px;
  font-size: 30px;
  opacity: .12;
  filter: grayscale(.2);
  transition: transform .25s ease, opacity .25s ease;
}
.metric-stat-card:hover .metric-stat-icon { transform: scale(1.2) rotate(-5deg); opacity: .22; }
.pl-tip-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 10px;
  font-weight: 800;
  color: var(--plc-orange);
  background: var(--plc-orange-soft);
  border: 1px solid rgba(255, 87, 34, .25);
  cursor: help;
  transition: all .15s ease;
  z-index: 2;
}
.metric-stat-card:hover .pl-tip-badge { background: var(--plc-orange); color: #fff; transform: scale(1.15); }

.profit-pos { color: var(--plc-green); font-weight: 800; }
.profit-neg { color: var(--plc-red); font-weight: 800; }
.profit-est { color: #5B74E8; font-weight: 800; }
.stat-net-pos { color: var(--plc-green); font-weight: 800; }
.stat-net-neg { color: var(--plc-red); font-weight: 800; }
.pl-unsettled { color: var(--plc-muted); font-size: 10.5px; font-weight: 700; font-style: italic; }

/* ════════════════════════════════════════════════════════════════════════
   05 · ORDER HEALTH CARDS
   ════════════════════════════════════════════════════════════════════════ */
.pl2-health-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
@media (max-width: 1100px) { .pl2-health-cards { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .pl2-health-cards { grid-template-columns: 1fr; } }
.pl2-health-card {
  position: relative;
  overflow: hidden;
  display: flex;
  gap: 12px;
  align-items: center;
  background: #FFFFFF;
  border: 1px solid var(--plc-line);
  border-radius: 16px;
  padding: 14px 16px;
  box-shadow: var(--plc-shadow);
  transition: transform .18s ease, box-shadow .18s ease;
}
.pl2-health-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--hcolor, var(--plc-orange));
  opacity: .85;
}
.pl2-health-card:hover { transform: translateY(-2px); box-shadow: var(--plc-shadow-hover); }
.pl2-health-ico {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 18px;
  background: #F7F3EE;
  border: 1px solid var(--plc-line);
}
.pl2-health-body { flex: 1; min-width: 0; }
.pl2-health-label {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--plc-muted);
}
.pl2-health-pct { display: flex; align-items: baseline; gap: 7px; margin-top: 2px; }
.pl2-health-pct b { font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }
.pl2-health-pct span { font-size: 10.5px; font-weight: 600; color: var(--plc-muted); }
.pl2-health-bar { height: 5px; background: #F2EDE7; border-radius: 4px; overflow: hidden; margin-top: 7px; }
.pl2-health-bar div { height: 100%; border-radius: 4px; transition: width .7s cubic-bezier(.22, .8, .35, 1); }

/* ════════════════════════════════════════════════════════════════════════
   06 · MONEY FLOW CASCADE
   ════════════════════════════════════════════════════════════════════════ */
.cf-row {
  display: grid;
  grid-template-columns: 200px 1fr 130px;
  gap: 14px;
  align-items: center;
  padding: 7px 0;
}
@media (max-width: 720px) { .cf-row { grid-template-columns: 110px 1fr 92px; } }
.cf-label span { font-size: 12.5px; font-weight: 700; color: var(--plc-ink); display: block; }
.cf-label small { font-size: 10.5px; color: var(--plc-muted); font-weight: 500; display: block; line-height: 1.35; }
.cf-bar { height: 12px; background: #F2EDE7; border-radius: 8px; overflow: hidden; }
.cf-fill { height: 100%; border-radius: 8px; transition: width .5s ease; min-width: 2px; }
.cf-val { font-size: 13px; font-weight: 800; text-align: right; font-variant-numeric: tabular-nums; }
.cf-pos { color: var(--plc-green); }
.cf-neg { color: var(--plc-red); }
.cf-row.cf-final {
  background: linear-gradient(90deg, #FFF5F0, transparent);
  border: 1px solid rgba(255, 87, 34, .22);
  border-radius: 12px;
  padding: 10px 10px 10px 12px;
  margin-top: 4px;
}
.cf-final .cf-label span { font-size: 14px; }
.cf-final-val { font-size: 16px; }

/* ════════════════════════════════════════════════════════════════════════
   07 · PROFIT BREAKDOWN + INSIGHTS
   ════════════════════════════════════════════════════════════════════════ */
.pl-break-row { margin-bottom: 12px; }
.pl-break-row > div:first-child { display: flex; justify-content: space-between; align-items: center; margin-bottom: 5px; }
.pl-break-plus { color: var(--plc-green); font-weight: 700; }
.pl-break-minus { color: var(--plc-red); font-weight: 600; }
.pl-break-profit-pos { color: var(--plc-green); font-weight: 800; }
.pl-break-profit-neg { color: var(--plc-red); font-weight: 800; }
.pl-break-row > div:last-child {
  height: 6px;
  background: #F2EDE7;
  border-radius: 6px;
  overflow: hidden;
}
.pl-break-row > div:last-child div { height: 100%; border-radius: 6px; transition: width .4s ease; }

#pl-why-low {
  background: #F7F3EE !important;
  color: var(--plc-ink) !important;
  border: 1px solid var(--plc-line);
}
#pl-break-note { color: var(--plc-muted) !important; }

#pl-insights > div {
  background: #FFFDFB !important;
  box-shadow: var(--plc-shadow);
}

/* ════════════════════════════════════════════════════════════════════════
   08 · COLLAPSIBLE SECTIONS (accordions)
   ════════════════════════════════════════════════════════════════════════ */
.pl-collapse,
.pl-shell .card.pl-collapse {
  padding: 0;
  overflow: hidden;
  background: #FFFFFF;
  border: 1px solid var(--plc-line);
  border-radius: 18px;
  box-shadow: var(--plc-shadow);
}
.pl-collapse-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  cursor: pointer;
  user-select: none;
  transition: background .15s ease;
  position: relative;
}
.pl-collapse-head:hover { background: #FFF9F6; }
.pl-collapse-head:hover .pl-collapse-title { color: var(--plc-orange); }
.pl-collapse-head::after {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--plc-orange-grad);
  opacity: 0;
  transition: opacity .15s ease;
}
.pl-collapse-head:hover::after { opacity: 1; }
.pl-collapse-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--plc-ink);
  display: flex;
  align-items: center;
  gap: 10px;
}
.pl-collapse-count {
  font-size: 10px;
  font-weight: 800;
  background: #F7F3EE;
  border: 1px solid var(--plc-line);
  color: var(--plc-ink-2);
  border-radius: 20px;
  padding: 2px 9px;
}
.pl-collapse-count.warn {
  background: var(--plc-amber-soft);
  color: #B47A05;
  border-color: rgba(245, 158, 11, .35);
}
.pl-collapse-arrow {
  margin-left: auto;
  color: var(--plc-muted);
  font-size: 12px;
  font-weight: 800;
  transition: transform .2s ease;
  width: 16px;
  text-align: center;
}
.pl-collapse.open .pl-collapse-arrow { transform: rotate(90deg); }
.pl-collapse-body { border-top: 1px solid var(--plc-line); }
.plc-collapse-sub { font-size: 11px; font-weight: 600; color: var(--plc-muted); }

/* ════════════════════════════════════════════════════════════════════════
   09 · ORDER TABLE AREA
   ════════════════════════════════════════════════════════════════════════ */
.pl-pills { display: flex; gap: 8px; flex-wrap: wrap; }
.pl-pill {
  border: 1px solid var(--plc-line-2);
  background: #FFFFFF;
  color: var(--plc-ink-2);
  font-size: 11px;
  font-weight: 700;
  padding: 7px 13px;
  border-radius: 20px;
  cursor: pointer;
  transition: all .15s ease;
}
.pl-pill:hover { border-color: rgba(255, 87, 34, .45); color: var(--plc-orange); }
.pl-pill.active {
  background: var(--plc-orange);
  border-color: var(--plc-orange);
  color: #fff;
  box-shadow: 0 4px 12px -4px rgba(255, 87, 34, .5);
}
.pl-pill span { opacity: .8; font-weight: 800; }
.pl-pending-strip {
  font-size: 11.5px;
  font-weight: 600;
  color: #5B74E8;
  background: rgba(91, 116, 232, .07);
  border: 1px solid rgba(91, 116, 232, .25);
  border-radius: 12px;
  padding: 9px 13px;
  line-height: 1.55;
}

.pl-table-scroll {
  max-height: 480px;
  overflow: auto;
  scrollbar-width: thin;
}
.pl-table-scroll::-webkit-scrollbar { height: 10px; width: 10px; }
.pl-table-scroll::-webkit-scrollbar-thumb { background: #E2DBD2; border-radius: 6px; border: 2px solid #FFFFFF; }
.pl-table-scroll::-webkit-scrollbar-track { background: transparent; }
.pl-table-scroll thead th {
  position: sticky;
  top: 0;
  background: #FFFDFB;
  z-index: 2;
  box-shadow: 0 1px 0 var(--plc-line);
}
#pl-orders-table .pl-table-scroll th:first-child,
#pl-orders-table .pl-table-scroll td:first-child {
  position: sticky;
  left: 0;
  z-index: 3;
  background: #FFFFFF;
  box-shadow: inset -1px 0 0 var(--plc-line);
}
#pl-orders-table .pl-table-scroll thead th:first-child { z-index: 5; background: #FFFDFB; }
#pl-orders-table .pl-table-scroll tbody tr { transition: background .15s ease; }
#pl-orders-table .pl-table-scroll tbody tr:hover td { background: #FFF9F4 !important; }

/* row status tints (decorator + renderOrdersTable classes) */
tr.pl-row-unsettled td { background: rgba(245, 158, 11, .06) !important; }
tr.pl-row-unsettled td:first-child { background: color-mix(in srgb, #F59E0B 7%, #FFFFFF) !important; }
tr.pl2-row-return td { background: rgba(239, 68, 68, .06) !important; }
tr.pl2-row-return td:first-child { background: color-mix(in srgb, #EF4444 7%, #FFFFFF) !important; }
tr.pl-row-profit-pos td { background: rgba(16, 185, 129, .05) !important; }
tr.pl-row-profit-pos td:first-child { background: color-mix(in srgb, #10B981 6%, #FFFFFF) !important; }
tr.pl-row-profit-neg td { background: rgba(239, 68, 68, .05) !important; }
tr.pl-row-profit-neg td:first-child { background: color-mix(in srgb, #EF4444 6%, #FFFFFF) !important; }

/* generic tables rendered into the shell (orders, uploads, unmatched) */
.pl-shell .table-wrapper {
  background: #FFFFFF;
  border: 1px solid var(--plc-line);
  border-radius: 12px;
  overflow: auto;
}
.pl-shell table { border-collapse: collapse; width: 100%; }
.pl-shell table th {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--plc-muted);
  font-weight: 800;
  text-align: left;
  padding: 10px 12px;
  background: #FFFDFB;
  border-bottom: 1px solid var(--plc-line);
  white-space: nowrap;
}
.pl-shell table td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--plc-line-2);
  font-size: 12px;
  color: var(--plc-ink-2);
}
.pl-shell table tbody tr:last-child td { border-bottom: none; }
.pl-shell table tbody tr:hover td { background: #FFF9F4; }

/* ════════════════════════════════════════════════════════════════════════
   10 · COST SETTINGS
   ════════════════════════════════════════════════════════════════════════ */
.pl-cost-src {
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 10px;
  background: var(--plc-green-soft);
  color: #0E8F63;
}
.pl-cost-src-global { background: var(--plc-amber-soft); color: #B47A05; }
.cost-btn {
  cursor: pointer;
  border: 1px solid var(--plc-line-2);
  background: #FFFFFF;
  color: var(--plc-orange);
  padding: 3px 9px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 800;
  transition: all .15s ease;
}
.cost-btn:hover { background: var(--plc-orange); color: #fff; border-color: var(--plc-orange); }
.costing-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 12px;
  background: #FFFDFB;
  border: 1px solid var(--plc-line);
  border-radius: 10px;
  margin-bottom: 6px;
}

/* ════════════════════════════════════════════════════════════════════════
   11 · MOTION + SCROLLBARS
   ════════════════════════════════════════════════════════════════════════ */
.pl-shell > * { animation: plcFadeUp .5s cubic-bezier(.22, .8, .35, 1) both; }
.pl-shell > *:nth-child(2) { animation-delay: .04s; }
.pl-shell > *:nth-child(3) { animation-delay: .08s; }
.pl-shell > *:nth-child(4) { animation-delay: .12s; }
.pl-shell > *:nth-child(5) { animation-delay: .16s; }
.pl-shell > *:nth-child(6) { animation-delay: .2s; }
.pl-shell > *:nth-child(7) { animation-delay: .24s; }
.pl-shell > *:nth-child(8) { animation-delay: .28s; }
.pl-shell > *:nth-child(9) { animation-delay: .32s; }
.pl-shell > *:nth-child(10) { animation-delay: .36s; }
@keyframes plcFadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

.pl-shell { scrollbar-width: thin; }
.pl-shell::-webkit-scrollbar { width: 10px; height: 10px; }
.pl-shell::-webkit-scrollbar-thumb { background: #E2DBD2; border-radius: 6px; border: 2px solid #FAF8F5; }

@media (prefers-reduced-motion: reduce) {
  .pl-shell > *,
  .biz-drop.dragover,
  .pl2-step.current,
  .filetype-chip.missing {
    animation: none !important;
  }
  .metric-stat-card,
  .pl2-health-card,
  .pl2-step,
  .biz-drop { transition: none !important; }
}

/* ════════════════════════════════════════════════════════════════════════
   12 · SMART FILE ASSISTANT WIZARD (popup)
   ════════════════════════════════════════════════════════════════════════ */
.wizard-trigger {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; margin: 0 0 14px; padding: 11px 16px;
  background: var(--plc-orange-soft); color: var(--plc-orange-deep);
  border: 1px solid rgba(255, 87, 34, .45); border-radius: 12px;
  font-family: 'Poppins', 'Inter', sans-serif; font-size: 13px; font-weight: 700;
  cursor: pointer; transition: all .2s ease;
}
.wizard-trigger:hover {
  background: #FFE4D6; border-color: var(--plc-orange);
  transform: translateY(-1px); box-shadow: var(--plc-shadow-hover);
}

.wizard-modal-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0; z-index: 9999;
  background: rgba(33, 27, 22, .5); backdrop-filter: blur(3px);
  display: none; align-items: center; justify-content: center; padding: 20px;
}
.wizard-modal-overlay.open { display: flex; }

.wizard-modal {
  position: relative; width: 100%; max-width: 500px; max-height: 86vh; overflow-y: auto;
  background: #fff; border: 1px solid var(--plc-line); border-radius: 18px;
  padding: 26px; box-shadow: var(--plc-shadow-hover);
  animation: plcFadeUp .3s ease-out;
}

.wizard-close {
  position: absolute; top: 14px; right: 14px; width: 32px; height: 32px;
  display: grid; place-items: center; border: none; cursor: pointer;
  background: var(--plc-line); color: var(--plc-ink-2); border-radius: 50%;
  font-size: 15px; transition: all .2s ease;
}
.wizard-close:hover { background: var(--plc-orange); color: #fff; transform: rotate(90deg); }

.wizard-select {
  width: 100%; padding: 12px 14px; margin-bottom: 18px; cursor: pointer;
  border: 1px solid var(--plc-line-2); border-radius: 12px;
  background: #fff; color: var(--plc-ink);
  font-family: 'Inter', sans-serif; font-size: 13px; font-weight: 700;
}
.wizard-select:focus {
  outline: none; border-color: var(--plc-orange);
  box-shadow: 0 0 0 3px rgba(255, 87, 34, .12);
}

.wizard-results {
  background: #FAF8F5; border: 1px solid var(--plc-line);
  border-radius: 14px; padding: 16px;
}

.wizard-row {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
  margin-bottom: 14px;
}
.wizard-row .wizard-select { margin-bottom: 0; }

.wizard-note {
  font-size: 11px; font-style: italic; line-height: 1.5;
  color: var(--plc-ink-2); margin: 0 0 16px;
}

.wz-badge {
  display: inline-block; margin-left: 4px; padding: 2px 8px;
  border-radius: 999px; font-size: 10.5px; font-weight: 800;
}
.wz-badge-ok { background: var(--plc-green-soft); color: #0E8F63; }
.wz-badge-miss { background: var(--plc-amber-soft); color: #B47A05; }

@media (prefers-reduced-motion: reduce) {
  .wizard-modal { animation: none !important; }
}
