/* ============================================================
   B2B PORTAL — Full-width standalone page styles
   ============================================================ */

.pcs-portal-wrap {
  display: flex;
  min-height: 80vh;
  background: #f3f4f6;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 14px;
  color: #1f2937;
  max-width: 1400px;
  margin: 0 auto;
}

/* Sidebar */
.pcs-portal-sidebar {
  width: 240px;
  min-width: 220px;
  background: #1d2327;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;          /* sticks to very top of viewport */
  height: 100vh;
  overflow-y: auto;
}
/* When rendered inside the app shell (topbar 36px) */
.pcs-portal-body .pcs-portal-sidebar {
  top: 36px;
  height: calc(100vh - 36px);
}

.pcs-portal-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 16px 16px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.pcs-portal-avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2563eb, #1e40af);
  color: #fff;
  display: grid; place-items: center;
  font-size: 14px; font-weight: 700; flex-shrink: 0;
}
.pcs-portal-user-name  { font-size: 13px; font-weight: 600; color: #fff; }
.pcs-portal-user-email { font-size: 11px; color: rgba(255,255,255,.5); margin-top: 1px; }
.pcs-portal-user-tier  {
  display: inline-block; margin-top: 5px;
  padding: 2px 8px; border-radius: 9999px;
  font-size: 10px; font-weight: 700;
}

.pcs-portal-nav { flex: 1; padding: 12px 8px; }
.pcs-portal-nav-section-label {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .08em; color: rgba(255,255,255,.35);
  padding: 10px 8px 4px;
}
.pcs-portal-nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 6px;
  color: rgba(255,255,255,.75); font-size: 13px; font-weight: 500;
  text-decoration: none; transition: all .12s;
  cursor: pointer; margin-bottom: 2px;
}
.pcs-portal-nav-item:hover { background: rgba(255,255,255,.08); color: #fff; text-decoration: none; }
.pcs-portal-nav-item.active { background: #2563eb; color: #fff; font-weight: 600; }
.pcs-portal-nav-icon { font-size: 15px; flex-shrink: 0; width: 20px; text-align: center; }
.pcs-portal-nav-badge {
  margin-left: auto; background: #ef4444; color: #fff;
  font-size: 10px; font-weight: 700;
  padding: 1px 6px; border-radius: 9999px;
}
.pcs-portal-nav-divider { height: 1px; background: rgba(255,255,255,.08); margin: 8px 4px; }
.pcs-portal-nav-logout { color: rgba(255,255,255,.4); }
.pcs-portal-nav-logout:hover { color: #ef4444; background: rgba(239,68,68,.1); }

.pcs-portal-sidebar-cta { padding: 16px; border-top: 1px solid rgba(255,255,255,.08); }
.pcs-portal-shop-btn {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  width: 100%; padding: 10px;
  background: linear-gradient(135deg, #2563eb, #1e40af);
  color: #fff; border-radius: 8px;
  font-size: 13px; font-weight: 600; text-decoration: none;
}
.pcs-portal-shop-btn:hover { opacity: .9; color: #fff; text-decoration: none; }
.pcs-portal-shop-btn span {
  background: rgba(255,255,255,.2); padding: 2px 6px;
  border-radius: 9999px; font-size: 11px;
}

/* Main */
.pcs-portal-main { flex: 1; min-width: 0; overflow-x: hidden; background: #f3f4f6; }

/* Page header */
.pcs-ph {
  background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 55%, #3b82f6 100%);
  padding: 28px 32px; color: #fff;
  position: relative; overflow: hidden;
}
.pcs-ph::after {
  content: ""; position: absolute; top: -60px; right: -60px;
  width: 240px; height: 240px;
  background: radial-gradient(circle, rgba(255,255,255,.12), transparent 70%);
  border-radius: 50%; pointer-events: none;
}
.pcs-ph-inner { position: relative; z-index: 1; }
.pcs-ph-top { display: flex; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.pcs-ph-logo {
  width: 52px; height: 52px; border-radius: 14px;
  background: rgba(255,255,255,.18);
  display: grid; place-items: center;
  font-size: 20px; font-weight: 800; color: #fff; flex-shrink: 0;
}
.pcs-ph-info { flex: 1; min-width: 0; }
.pcs-ph-eyebrow { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; opacity: .8; margin-bottom: 4px; }
.pcs-ph-title { font-size: 26px; font-weight: 800; color: #fff; margin: 0 0 4px; line-height: 1.1; }
.pcs-ph-sub { font-size: 13px; opacity: .9; margin: 0; line-height: 1.4; }
.pcs-ph-actions { display: flex; gap: 8px; flex-shrink: 0; align-items: center; flex-wrap: wrap; }
.pcs-ph-stats {
  display: flex; gap: 32px; flex-wrap: wrap;
  margin-top: 18px; padding-top: 14px;
  border-top: 1px solid rgba(255,255,255,.15);
}
.pcs-ph-stat-val { font-size: 22px; font-weight: 800; color: #fff; }
.pcs-ph-stat-lbl { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; opacity: .75; margin-top: 2px; }

/* Buttons */
.pcs-pbtn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 38px; padding: 0 16px; border-radius: 8px;
  font-size: 13px; font-weight: 600;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  cursor: pointer; border: 1px solid transparent;
  text-decoration: none; transition: all .15s; white-space: nowrap;
}
.pcs-pbtn:hover { text-decoration: none; }
.pcs-pbtn-primary { background: #fff; color: #1e3a8a; }
.pcs-pbtn-primary:hover { background: #eff6ff; color: #1e3a8a; }
.pcs-pbtn-ghost { background: rgba(255,255,255,.15); color: #fff; border-color: rgba(255,255,255,.3); }
.pcs-pbtn-ghost:hover { background: rgba(255,255,255,.25); color: #fff; }

/* Cards */
.pcs-pcard { background: #fff; border: 1px solid #e5e7eb; border-radius: 12px; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,.05); margin-bottom: 16px; }
.pcs-pcard-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px solid #f3f4f6; background: #f9fafb; }
.pcs-pcard-head-brand   { background: linear-gradient(135deg, #dbeafe, #eff6ff); }
.pcs-pcard-head-success { background: linear-gradient(135deg, #dcfce7, #ecfdf5); }
.pcs-pcard-head-warning { background: linear-gradient(135deg, #fef3c7, #fffbeb); }
.pcs-pcard-title { font-size: 15px; font-weight: 700; color: #1f2937; margin: 0; }
.pcs-pcard-action { font-size: 13px; color: #2563eb; font-weight: 500; text-decoration: none; }
.pcs-pcard-action:hover { text-decoration: underline; }
.pcs-pcard-body { padding: 18px; }

/* Grid layouts */
.pcs-pgrid { display: grid; gap: 16px; }
.pcs-pgrid-4    { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.pcs-pgrid-aside { grid-template-columns: 1fr 300px; }
@media (max-width: 900px) { .pcs-pgrid-aside { grid-template-columns: 1fr; } }

/* Stat cards */
.pcs-pcard-stat { padding: 18px; text-align: left; border-radius: 12px; background: #fff; border: 1px solid #e5e7eb; box-shadow: 0 1px 3px rgba(0,0,0,.05); }
.pcs-pstat-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: #6b7280; margin-bottom: 6px; }
.pcs-pstat-value { font-size: 28px; font-weight: 700; color: #1f2937; line-height: 1; font-variant-numeric: tabular-nums; }
.pcs-pstat-delta { font-size: 12px; color: #9ca3af; margin-top: 4px; }

/* Order rows */
.pcs-porder-row {
  display: grid; grid-template-columns: 46px 1fr auto auto;
  gap: 12px; align-items: center;
  padding: 12px 18px; border-bottom: 1px solid #f3f4f6;
  cursor: pointer; transition: background .12s;
}
.pcs-porder-row:last-child { border-bottom: none; }
.pcs-porder-row:hover { background: #f9fafb; }
.pcs-porder-thumb { width: 46px; height: 46px; border-radius: 8px; background: linear-gradient(135deg, #2b3a8a, #1a1547); display: grid; place-items: center; color: #fbbf24; font-size: 9px; font-weight: 800; }
.pcs-porder-title { font-size: 13px; font-weight: 600; margin-bottom: 2px; }
.pcs-porder-meta  { font-size: 11px; color: #9ca3af; }
.pcs-porder-status { display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: 9999px; font-size: 11px; font-weight: 600; }
.pcs-porder-price { font-size: 13px; font-weight: 600; color: #1f2937; white-space: nowrap; }

/* Member rows */
.pcs-pmember-row { display: grid; grid-template-columns: 38px 1fr auto auto; gap: 12px; align-items: center; padding: 12px 18px; border-bottom: 1px solid #f3f4f6; }
.pcs-pmember-row:last-child { border-bottom: none; }
.pcs-pmember-avatar { width: 36px; height: 36px; border-radius: 50%; background: linear-gradient(135deg, #2563eb, #1e40af); color: #fff; display: grid; place-items: center; font-size: 12px; font-weight: 700; }
.pcs-pmember-name  { font-size: 13px; font-weight: 600; }
.pcs-pmember-email { font-size: 11px; color: #9ca3af; }
.pcs-pmember-meta  { font-size: 11px; color: #9ca3af; }
.pcs-you-tag { background: #dbeafe; color: #1e40af; padding: 1px 6px; border-radius: 4px; font-size: 10px; font-weight: 700; margin-left: 4px; }
.pcs-role-tag { padding: 2px 8px; border-radius: 4px; font-size: 11px; font-weight: 600; background: #f3f4f6; color: #374151; }
.pcs-role-tag.admin    { background: #dbeafe; color: #1e40af; }
.pcs-role-tag.member   { background: #dcfce7; color: #065f46; }
.pcs-role-tag.approver { background: #fef3c7; color: #92400e; }

/* Info list */
.pcs-pinfo-list { display: flex; flex-direction: column; }
.pcs-pinfo-row { display: grid; grid-template-columns: 120px 1fr; gap: 12px; padding: 8px 0; border-bottom: 1px solid #f3f4f6; font-size: 13px; }
.pcs-pinfo-row:last-child { border-bottom: none; }
.pcs-pinfo-label { color: #6b7280; font-weight: 500; }
.pcs-pinfo-value { color: #1f2937; font-weight: 500; }

/* Benefits list */
.pcs-benefit-list { list-style: none; margin: 0; padding: 0; }
.pcs-benefit-list li { display: flex; align-items: center; gap: 8px; font-size: 13px; padding: 6px 0; border-bottom: 1px solid #f3f4f6; line-height: 1.4; }
.pcs-benefit-list li:last-child { border-bottom: none; }
.pcs-benefit-list li::before { content: "✓"; color: #16a34a; font-weight: 700; flex-shrink: 0; }

/* Content padding */
.pcs-portal-content-inner { padding: 20px 24px 32px; }

/* Mobile */
@media (max-width: 768px) {
  .pcs-portal-wrap { flex-direction: column; }
  .pcs-portal-sidebar { width: 100%; height: auto; position: static; }
  .pcs-portal-nav { display: flex; flex-wrap: wrap; gap: 4px; padding: 8px; }
  .pcs-portal-nav-section-label,.pcs-portal-nav-divider,.pcs-portal-sidebar-cta { display: none; }
  .pcs-portal-nav-item { padding: 6px 10px; font-size: 12px; }
  .pcs-ph { padding: 16px; }
  .pcs-ph-title { font-size: 20px; }
}

/* Portal form fields */
.pcs-pfield { display: flex; flex-direction: column; gap: 5px; margin-bottom: 4px; }
.pcs-pfield-label { font-size: 12px; font-weight: 600; color: #374151; }
.pcs-pinput {
  width: 100%; padding: 9px 12px;
  border: 1px solid #e5e7eb; border-radius: 8px;
  background: #fff; font-size: 13px; color: #1f2937;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  transition: border-color .15s;
  box-shadow: inset 0 1px 3px rgba(0,0,0,.04);
}
.pcs-pinput:focus {
  outline: none; border-color: #2563eb;
  box-shadow: inset 0 1px 3px rgba(0,0,0,.03), 0 0 0 3px rgba(37,99,235,.12);
}
