/* ==========================================================================
   iTradeAIMS Portal Theme - Members Dashboard & Layout Styles
   ========================================================================== */

/* Universal Reset & Dark Base */
html, body {
  background-color: #080b11 !important;
  color: #f8fafc !important;
  font-family: var(--font-primary, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);
  margin: 0;
  padding: 0;
  min-height: 100vh;
}

/* Main App Layout */
.portal-app {
  display: flex;
  min-height: 100vh;
  width: 100%;
  background-color: #080b11;
  position: relative;
}

/* --------------------------------------------------------------------------
   Sidebar Navigation (Desktop)
   -------------------------------------------------------------------------- */
.portal-sidebar {
  width: 260px;
  flex: 0 0 260px;
  min-height: 100vh;
  background-color: #0b0f19;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 100;
  transition: transform 0.25s ease;
}

/* Sidebar Brand Header */
.portal-sidebar-brand {
  padding: 28px 24px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.portal-sidebar-logo-link {
  display: block;
  text-decoration: none;
}

.portal-sidebar-logo {
  height: auto;
  max-width: 160px;
  display: block;
}

/* Sidebar Navigation Items */
.portal-sidebar-nav {
  flex: 1;
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow-y: auto;
}

.portal-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 9px;
  color: #94a3b8;
  font-size: 0.9375rem;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}

.portal-nav-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  stroke: currentColor;
  transition: stroke 0.18s ease;
}

.portal-nav-item:hover {
  background-color: rgba(255, 255, 255, 0.04);
  color: #ffffff;
}

/* Active Nav State */
.portal-nav-item.is-active {
  background-color: rgba(0, 122, 255, 0.12);
  color: #ffffff;
  font-weight: 600;
}

.portal-nav-item.is-active .portal-nav-icon {
  stroke: #007aff;
}

.portal-nav-item.is-active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 3px;
  background-color: #007aff;
  border-radius: 0 3px 3px 0;
  box-shadow: 0 0 10px rgba(0, 122, 255, 0.8);
}

/* Sidebar Footer / User & Logout */
.portal-sidebar-footer {
  padding: 16px 16px 20px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  background-color: #080c14;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.portal-user-profile {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
}

.portal-user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #007aff 0%, #0056cc 100%);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.875rem;
  flex-shrink: 0;
}

.portal-user-meta {
  overflow: hidden;
}

.portal-user-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: #ffffff;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

.portal-user-role {
  font-size: 0.75rem;
  color: #64748b;
}

/* Logout Button */
.portal-logout-btn {
  color: #f87171 !important;
  font-weight: 500;
}

.portal-logout-btn:hover {
  background-color: rgba(239, 68, 68, 0.1) !important;
  color: #fca5a5 !important;
}

.portal-logout-btn .portal-nav-icon {
  stroke: #f87171 !important;
}

/* --------------------------------------------------------------------------
   Content Area & Topbar
   -------------------------------------------------------------------------- */
.portal-main-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-width: 0;
  background-color: #080b11;
}

/* Topbar */
.portal-topbar {
  height: 72px;
  padding: 0 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background-color: #080b11;
  position: sticky;
  top: 0;
  z-index: 90;
}

.portal-topbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.portal-page-heading {
  font-size: 1.375rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: #ffffff;
  margin: 0;
}

.portal-mobile-toggle {
  display: none;
  background: transparent;
  border: none;
  color: #94a3b8;
  padding: 8px;
  cursor: pointer;
  border-radius: 6px;
}

.portal-mobile-toggle:hover {
  color: #ffffff;
  background-color: rgba(255, 255, 255, 0.06);
}

.portal-topbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.portal-topbar-order-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 15px;
  background: rgba(0, 122, 255, 0.1);
  border: 1px solid rgba(0, 122, 255, 0.28);
  border-radius: 9999px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #60a5fa;
  text-decoration: none;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  letter-spacing: 0.01em;
}

.portal-topbar-order-link:hover {
  background: #007aff;
  border-color: #007aff;
  color: #ffffff !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(0, 122, 255, 0.35);
}

.portal-topbar-order-link svg {
  transition: transform 0.2s ease;
}

.portal-topbar-order-link:hover svg {
  transform: translate(1px, -1px);
}

.portal-topbar-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  color: #34d399;
}

.portal-status-dot {
  width: 6px;
  height: 6px;
  background-color: #10b981;
  border-radius: 50%;
  box-shadow: 0 0 6px #10b981;
}

/* --------------------------------------------------------------------------
   Page Body Container
   -------------------------------------------------------------------------- */
.portal-main {
  flex: 1;
  padding: 36px 36px 64px;
}

.portal-page-content {
  max-width: 1200px;
  margin: 0 auto;
}

/* --------------------------------------------------------------------------
   Dashboard Component Styles
   -------------------------------------------------------------------------- */
.portal-dashboard {
  display: flex;
  flex-direction: column;
  gap: 36px;
  max-width: 1200px;
  margin: 0 auto;
}

/* 1. Welcome Banner */
.dashboard-hero-banner {
  padding: 32px 36px;
  background: radial-gradient(ellipse 70% 60% at 20% 0%, rgba(0, 122, 255, 0.18) 0%, rgba(0, 86, 204, 0.05) 50%, transparent 80%),
              linear-gradient(135deg, #0e131d 0%, #151c2a 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  position: relative;
  overflow: hidden;
}

.dashboard-hero-content {
  position: relative;
  z-index: 2;
  max-width: 680px;
}

.dashboard-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px;
  background: rgba(0, 122, 255, 0.12);
  border: 1px solid rgba(0, 122, 255, 0.3);
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  color: #60a5fa;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 12px;
}

.badge-pulse-dot {
  width: 6px;
  height: 6px;
  background-color: #007aff;
  border-radius: 50%;
  box-shadow: 0 0 6px #007aff;
}

.dashboard-hero-title {
  font-size: clamp(1.75rem, 2.5vw, 2.25rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.2;
  margin: 0 0 10px 0;
  color: #ffffff;
}

.dashboard-hero-subtext {
  font-size: 1rem;
  color: #94a3b8;
  line-height: 1.6;
  margin: 0;
}

/* 2. Sections & Headers */
.dashboard-section {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.dashboard-section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

.dashboard-section-title {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #ffffff;
  margin: 0 0 4px 0;
}

.dashboard-section-subtitle {
  font-size: 0.875rem;
  color: #64748b;
  margin: 0;
}

/* 3. My Products Grid & Cards */
.dashboard-products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}

.dashboard-product-card {
  background-color: #0e131d;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}

.dashboard-product-card:hover {
  border-color: rgba(0, 122, 255, 0.35);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px -4px rgba(0, 0, 0, 0.4);
}

.product-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.product-card-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  background: rgba(0, 122, 255, 0.1);
  border: 1px solid rgba(0, 122, 255, 0.25);
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  color: #60a5fa;
  letter-spacing: 0.02em;
}

.product-card-badges-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.product-card-order-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  background: #151c2a;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  color: #94a3b8;
  letter-spacing: 0.01em;
}

.product-card-icon {
  width: 36px;
  height: 36px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #007aff;
}

.product-card-title {
  font-size: 1.1875rem;
  font-weight: 700;
  color: #ffffff;
  margin: 0 0 8px 0;
  letter-spacing: -0.02em;
}

.product-card-desc {
  font-size: 0.875rem;
  color: #94a3b8;
  line-height: 1.6;
  margin: 0 0 20px 0;
  flex: 1;
}

.product-card-footer {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.product-action-btn {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  font-size: 0.875rem;
  border-radius: 8px;
}

.product-card-order-meta {
  margin-top: 10px;
  text-align: center;
  width: 100%;
}

.order-meta-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 500;
  color: #64748b;
  text-decoration: none;
  transition: color 0.15s ease;
  letter-spacing: 0.01em;
}

.order-meta-link:hover {
  color: #94a3b8;
  text-decoration: underline;
}

.order-meta-link svg {
  color: #475569;
  transition: color 0.15s ease;
}

.order-meta-link:hover svg {
  color: #007aff;
}

/* 4. Empty State Cards (Dashboard, Orders, Billing) */
.dashboard-empty-card,
.portal-empty-card,
.portal-billing-empty {
  background: linear-gradient(180deg, #111726 0%, #0e131d 100%);
  border: 1px dashed rgba(255, 255, 255, 0.14);
  border-radius: 16px;
  padding: 56px 32px 44px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  max-width: 580px;
  margin: 36px auto;
  width: 100%;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.3);
  position: relative;
}

.empty-icon-wrap,
.billing-empty-icon {
  width: 64px;
  height: 64px;
  background: rgba(0, 122, 255, 0.08);
  border: 1px solid rgba(0, 122, 255, 0.25);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #007aff;
  margin: 0 auto 20px;
  box-shadow: 0 0 24px rgba(0, 122, 255, 0.12);
}

.empty-title,
.billing-empty-title {
  font-size: 1.45rem;
  font-weight: 800;
  color: #ffffff;
  margin: 0 0 10px 0;
  letter-spacing: -0.02em;
}

.empty-desc,
.billing-empty-desc {
  font-size: 0.9375rem;
  color: #94a3b8;
  line-height: 1.65;
  margin: 0 auto 26px auto;
  max-width: 440px;
}

.empty-action {
  display: flex;
  justify-content: center;
  width: 100%;
}

.empty-action-btn,
.portal-empty-card .btn-primary,
.dashboard-empty-card .btn-primary,
.portal-billing-empty .btn-primary {
  padding: 12px 28px;
  font-size: 0.9375rem;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.empty-state-footer-note {
  margin-top: 26px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 0.8125rem;
  color: #64748b;
  width: 100%;
}

.empty-state-footer-note a {
  color: #007aff;
  text-decoration: none;
  font-weight: 600;
  transition: color 0.15s ease;
}

.empty-state-footer-note a:hover {
  color: #38bdf8;
  text-decoration: underline;
}

/* 5. Resources Grid (Documentation, Community, Support) */
.dashboard-resources-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.dashboard-resource-card {
  background-color: #0e131d;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 22px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  text-decoration: none;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.dashboard-resource-card:hover {
  background-color: #121824;
  border-color: rgba(0, 122, 255, 0.4);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px -4px rgba(0, 0, 0, 0.35);
}

.resource-card-icon {
  width: 42px;
  height: 42px;
  background: rgba(0, 122, 255, 0.1);
  border: 1px solid rgba(0, 122, 255, 0.2);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #007aff;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.dashboard-resource-card:hover .resource-card-icon {
  background-color: #007aff;
  color: #ffffff;
}

.resource-card-body {
  flex: 1;
}

.resource-card-title {
  font-size: 1rem;
  font-weight: 600;
  color: #ffffff;
  margin: 0 0 4px 0;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: color 0.18s ease;
}

.dashboard-resource-card:hover .resource-card-title {
  color: #60a5fa;
}

.resource-card-desc {
  font-size: 0.8125rem;
  color: #94a3b8;
  line-height: 1.5;
  margin: 0;
}

/* --------------------------------------------------------------------------
   Billing & Invoices Page Styles
   -------------------------------------------------------------------------- */
.portal-billing-page {
  display: flex;
  flex-direction: column;
  gap: 28px;
  max-width: 1200px;
  margin: 0 auto;
}

.portal-page-header-block {
  margin-bottom: 8px;
}

.portal-section-heading {
  font-size: 1.625rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: #ffffff;
  margin: 0 0 6px 0;
}

.portal-section-subheading {
  font-size: 0.9375rem;
  color: #94a3b8;
  margin: 0;
}

/* Invoices Table Card */
.portal-table-card {
  background-color: #0e131d;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  overflow: hidden;
}

.portal-table-responsive {
  width: 100%;
  overflow-x: auto;
}

.portal-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.portal-table th {
  padding: 16px 20px;
  background-color: #0a0e17;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #64748b;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  white-space: nowrap;
}

.portal-table td {
  padding: 18px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 0.9375rem;
  color: #e2e8f0;
  vertical-align: middle;
}

.portal-table tbody tr:hover td {
  background-color: rgba(255, 255, 255, 0.02);
}

.portal-table tbody tr:last-child td {
  border-bottom: none;
}

.col-date {
  color: #94a3b8 !important;
  white-space: nowrap;
}

.col-product {
  min-width: 220px;
}

.product-name-highlight {
  display: block;
  font-weight: 600;
  color: #ffffff;
  margin-bottom: 3px;
}

.product-type-label {
  display: block;
  font-size: 0.75rem;
  color: #60a5fa;
}

.col-invoice-code code {
  background-color: rgba(255, 255, 255, 0.05);
  padding: 3px 8px;
  border-radius: 5px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-family: monospace;
  font-size: 0.8125rem;
  color: #cbd5e1;
}

.col-total {
  white-space: nowrap;
  font-size: 1rem;
}

.table-action-col {
  text-align: right;
  white-space: nowrap;
}

.btn-table-action {
  padding: 8px 14px;
  font-size: 0.8125rem;
  border-radius: 7px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* Status Badges */
.portal-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.status-badge-paid {
  background-color: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #34d399;
}

.status-badge-paid .status-dot {
  width: 5px;
  height: 5px;
  background-color: #10b981;
  border-radius: 50%;
  box-shadow: 0 0 5px #10b981;
}

.status-badge-refunded {
  background-color: rgba(244, 63, 94, 0.12);
  border: 1px solid rgba(244, 63, 94, 0.3);
  color: #fda4af;
}

/* Empty State */
.portal-billing-empty {
  background-color: #0e131d;
  border: 1px dashed rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 56px 24px;
  text-align: center;
  max-width: 540px;
  margin: 32px auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.billing-empty-icon {
  width: 54px;
  height: 54px;
  background-color: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  margin-bottom: 16px;
}

.billing-empty-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #ffffff;
  margin: 0 0 8px 0;
}

.billing-empty-desc {
  font-size: 0.9375rem;
  color: #94a3b8;
  line-height: 1.6;
  margin: 0;
}

/* --------------------------------------------------------------------------
   Invoice Sheet & PDF Print Layout
   -------------------------------------------------------------------------- */
.portal-invoice-wrapper {
  max-width: 820px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.invoice-actions-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 8px;
}

.btn-print-invoice {
  padding: 10px 20px;
  font-size: 0.875rem;
  border-radius: 8px;
}

.btn-back-billing {
  padding: 10px 18px;
  font-size: 0.875rem;
  border-radius: 8px;
}

.invoice-sheet {
  background-color: #0e131d;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  padding: 44px;
  color: #f8fafc;
}

.invoice-sheet-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding-bottom: 28px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 28px;
}

.invoice-logo {
  max-width: 150px;
  height: auto;
  display: block;
  margin-bottom: 12px;
}

.invoice-seller-info {
  font-size: 0.8125rem;
  color: #64748b;
  line-height: 1.5;
  margin: 0;
}

.invoice-header-meta {
  text-align: right;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.invoice-type-pill {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #60a5fa;
  margin-bottom: 4px;
}

.invoice-number {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #ffffff;
  margin: 0 0 6px 0;
}

.invoice-meta-item {
  font-size: 0.875rem;
  color: #94a3b8;
}

.invoice-meta-item strong {
  color: #cbd5e1;
}

.invoice-parties-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  padding-bottom: 28px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 28px;
}

.invoice-party-col {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.party-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #64748b;
  margin-bottom: 2px;
}

.party-name, .party-payment {
  font-size: 1rem;
  font-weight: 700;
  color: #ffffff;
}

.party-email, .party-card {
  font-size: 0.875rem;
  color: #94a3b8;
}

.invoice-items-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 24px;
}

.invoice-items-table th {
  padding: 12px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #64748b;
  text-align: left;
}

.invoice-items-table td {
  padding: 18px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  color: #e2e8f0;
}

.invoice-item-subtext {
  font-size: 0.8125rem;
  color: #64748b;
  margin: 4px 0 0 0;
}

.portal-badge-small {
  display: inline-block;
  font-size: 0.75rem;
  padding: 3px 8px;
  background-color: rgba(0, 122, 255, 0.1);
  color: #60a5fa;
  border-radius: 4px;
}

.text-right {
  text-align: right;
}

.item-price {
  font-weight: 700;
  font-size: 1rem;
  color: #ffffff;
}

.invoice-totals-wrapper {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 36px;
}

.invoice-totals-table {
  width: 260px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.totals-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.875rem;
  color: #94a3b8;
}

.totals-row-final {
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 1.125rem;
  font-weight: 800;
  color: #ffffff;
}

.totals-final-price {
  color: #007aff;
}

.invoice-sheet-footer {
  text-align: center;
  padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 0.8125rem;
  color: #64748b;
}

/* --------------------------------------------------------------------------
   Print Stylesheet (Window.print PDF Export)
   -------------------------------------------------------------------------- */
@media print {
  body, html {
    background-color: #ffffff !important;
    color: #111827 !important;
  }

  .portal-sidebar,
  .portal-topbar,
  .invoice-actions-bar,
  .no-print {
    display: none !important;
  }

  .portal-main-wrapper {
    margin: 0 !important;
    padding: 0 !important;
    background: #ffffff !important;
  }

  .portal-main {
    padding: 0 !important;
  }

  .invoice-sheet {
    background: #ffffff !important;
    border: none !important;
    color: #111827 !important;
    padding: 0 !important;
  }

  .invoice-sheet-header,
  .invoice-parties-grid,
  .invoice-items-table th,
  .invoice-items-table td,
  .totals-row-final,
  .invoice-sheet-footer {
    border-color: #e5e7eb !important;
  }

  .invoice-number,
  .party-name,
  .party-payment,
  .totals-row-final,
  .item-price {
    color: #111827 !important;
  }

  .invoice-meta-item,
  .party-email,
  .party-card,
  .totals-row,
  .invoice-seller-info {
    color: #4b5563 !important;
  }

  .totals-final-price {
    color: #111827 !important;
  }

  .confirmation-action-card,
  .confirmation-sheet-actions {
    display: none !important;
  }

  .confirmation-details-sheet {
    background: #ffffff !important;
    border: none !important;
    color: #111827 !important;
    padding: 0 !important;
  }

  .confirmation-parties-grid,
  .financial-total-row {
    border-color: #e5e7eb !important;
  }

  .confirmation-party-col .party-name,
  .confirmation-party-col .party-payment,
  .confirmation-product-name,
  .financial-total-row .total-val,
  .financial-total-row .financial-label {
    color: #111827 !important;
  }

  .confirmation-party-col .party-email,
  .confirmation-party-col .party-card,
  .financial-row,
  .financial-row .financial-value {
    color: #4b5563 !important;
  }

  .confirmation-product-row {
    background: #f9fafb !important;
    border-color: #e5e7eb !important;
  }
}

/* Mobile Sidebar Backdrop */
.portal-sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  z-index: 95;
}

/* --------------------------------------------------------------------------
   Responsive Breakpoints
   -------------------------------------------------------------------------- */
@media (max-width: 1024px) {
  .dashboard-resources-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 960px) {
  .portal-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 270px;
    max-width: 82vw;
    height: 100%;
    height: 100dvh;
    min-height: 0;
    max-height: 100dvh;
    display: flex;
    flex-direction: column;
    transform: translateX(-100%);
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.5);
    z-index: 100;
  }

  .portal-sidebar.is-open {
    transform: translateX(0);
  }

  .portal-sidebar-brand {
    padding: 20px 20px 16px;
    flex-shrink: 0;
  }

  .portal-sidebar-nav {
    flex: 1 1 auto;
    min-height: 0;
    padding: 14px 14px;
    gap: 4px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .portal-sidebar-footer {
    flex-shrink: 0;
    padding: 12px 14px calc(14px + env(safe-area-inset-bottom, 0px)) 14px;
    gap: 8px;
  }

  .portal-user-profile {
    padding: 6px 8px;
  }

  .portal-sidebar-backdrop.is-open {
    display: block;
  }

  .portal-mobile-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .portal-topbar {
    padding: 0 20px;
    height: 64px;
  }

  .portal-main {
    padding: 24px 20px 48px;
  }

  .dashboard-hero-banner {
    padding: 24px 20px;
  }

  .invoice-sheet {
    padding: 24px 20px;
  }

  .invoice-sheet-header,
  .invoice-parties-grid {
    flex-direction: column;
    grid-template-columns: 1fr;
  }

  .invoice-header-meta {
    text-align: left;
    margin-top: 16px;
  }
}

/* --------------------------------------------------------------------------
   Orders & Product Access Views
   -------------------------------------------------------------------------- */
.portal-orders-page {
  display: flex;
  flex-direction: column;
  gap: 28px;
  width: 100%;
}

.portal-breadcrumb-nav {
  margin-bottom: -10px;
}

.breadcrumb-back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #94a3b8;
  font-size: 0.9375rem;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.18s ease;
}

.breadcrumb-back-link:hover {
  color: #007aff;
  transform: translateX(-2px);
}

/* Access Product Hero Card */
.access-hero-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  background: linear-gradient(135deg, rgba(14, 19, 29, 0.92) 0%, rgba(8, 11, 17, 0.95) 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 32px;
  position: relative;
  overflow: hidden;
}

.access-hero-card::before {
  content: '';
  position: absolute;
  top: -80px;
  right: -80px;
  width: 260px;
  height: 260px;
  background: radial-gradient(circle, rgba(0, 122, 255, 0.15) 0%, transparent 70%);
  pointer-events: none;
}

.access-pill-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.portal-badge-active {
  display: inline-flex;
  align-items: center;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #34d399;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 4px 10px;
  border-radius: 6px;
}

.portal-order-num {
  color: #64748b;
  font-size: 0.875rem;
  font-weight: 600;
  font-family: monospace;
}

.access-product-title {
  color: #ffffff;
  font-size: 1.875rem;
  font-weight: 800;
  margin: 0 0 8px;
  letter-spacing: -0.02em;
}

.access-product-meta {
  color: #94a3b8;
  font-size: 0.9375rem;
  margin: 0;
}

.access-invoice-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  font-size: 0.875rem;
  white-space: nowrap;
}

/* Platform Cards Grid */
.platform-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 24px;
}

.platform-card {
  background: #0e131d;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.platform-card:hover {
  border-color: rgba(255, 255, 255, 0.14);
}

.platform-card-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 24px 28px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.platform-badge {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1rem;
  flex-shrink: 0;
}

.platform-badge-mt4 {
  background: rgba(0, 122, 255, 0.15);
  border: 1px solid rgba(0, 122, 255, 0.35);
  color: #007aff;
}

.platform-badge-mt5 {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #10b981;
}

.platform-badge-tv {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: #f59e0b;
}

.platform-title {
  color: #ffffff;
  font-size: 1.1875rem;
  font-weight: 700;
  margin: 0 0 4px;
}

.platform-subtitle {
  color: #94a3b8;
  font-size: 0.8125rem;
  margin: 0;
}

.platform-card-body {
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  flex: 1;
}

/* License Box */
.license-box-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.license-label {
  color: #cbd5e1;
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.license-key-wrapper {
  background: #080b11;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.license-key-display {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.9375rem;
  font-weight: 600;
  color: #00d2ff;
  letter-spacing: 0.04em;
  word-break: break-all;
  user-select: all;
  background: rgba(0, 0, 0, 0.3);
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid rgba(0, 210, 255, 0.15);
}

.license-actions-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.btn-copy-key {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #1e293b;
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s ease;
}

.btn-copy-key:hover {
  background: #334155;
  border-color: rgba(255, 255, 255, 0.22);
}

.btn-copy-key.copy-success {
  background: rgba(16, 185, 129, 0.2);
  border-color: rgba(16, 185, 129, 0.4);
  color: #34d399;
}

.btn-reset-license {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  color: #94a3b8;
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.18s ease;
}

.btn-reset-license:hover {
  color: #f59e0b;
  border-color: rgba(245, 158, 11, 0.4);
  background: rgba(245, 158, 11, 0.08);
}

.license-helper-text {
  color: #64748b;
  font-size: 0.8125rem;
  margin: 0;
  line-height: 1.4;
}

/* Download Button */
.platform-download-box {
  margin-top: 4px;
}

.platform-download-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 20px;
  font-size: 0.9375rem;
  text-decoration: none;
}

/* Guide Accordion */
.platform-guide-accordion {
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
  overflow: hidden;
}

.guide-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  font-size: 0.875rem;
  font-weight: 600;
  color: #94a3b8;
  cursor: pointer;
  user-select: none;
  list-style: none;
}

.guide-summary::-webkit-details-marker {
  display: none;
}

.guide-summary:hover {
  color: #ffffff;
}

.guide-summary .chevron-icon {
  transition: transform 0.2s ease;
}

.platform-guide-accordion[open] .guide-summary .chevron-icon {
  transform: rotate(180deg);
}

.guide-content {
  padding: 0 16px 16px;
  font-size: 0.8125rem;
  color: #94a3b8;
  line-height: 1.6;
}

.guide-content ol {
  margin: 0;
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.guide-content code {
  color: #00d2ff;
  background: rgba(0, 0, 0, 0.3);
  padding: 2px 6px;
  border-radius: 4px;
}

/* TradingView Box */
.tradingview-info-box {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tv-status-desc {
  color: #94a3b8;
  font-size: 0.9375rem;
  margin: 0;
  line-height: 1.5;
}

.tv-user-display {
  background: #080b11;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.tv-user-label {
  color: #64748b;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

.tv-user-value {
  color: #ffffff;
  font-size: 1.0625rem;
  font-weight: 700;
}

/* Mini Platform Icons for Orders Table & Dashboard */
.platform-pill-list,
.product-card-platforms {
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
  flex-wrap: wrap !important;
}

.platform-logo-img {
  width: 26px !important;
  height: 26px !important;
  border-radius: 6px !important;
  object-fit: cover !important;
  display: inline-block !important;
  vertical-align: middle !important;
  flex-shrink: 0 !important;
  transition: transform 0.18s ease;
}

.platform-logo-img:hover {
  transform: translateY(-1px);
}

.mini-pill-default {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #94a3b8;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: 6px;
  padding: 3px 8px;
}

.platform-badge {
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
}

.platform-badge-img {
  width: 44px !important;
  height: 44px !important;
  border-radius: 8px !important;
  object-fit: cover !important;
  display: block !important;
}

/* Reset Confirmation Modal */
.portal-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(4, 6, 11, 0.85);
  backdrop-filter: blur(8px);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.portal-modal-card {
  background: #0e131d;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  max-width: 440px;
  width: 100%;
  padding: 32px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.modal-icon-wrap {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
}

.modal-icon-warning {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: #f59e0b;
}

.modal-title {
  color: #ffffff;
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0 0 10px;
}

.modal-desc {
  color: #94a3b8;
  font-size: 0.9375rem;
  line-height: 1.5;
  margin: 0 0 24px;
}

.modal-actions {
  display: flex;
  gap: 12px;
  width: 100%;
}

.modal-actions button {
  flex: 1;
  padding: 12px 18px;
  border-radius: 10px;
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
}

/* TradingView Connect Form & Connected Views */
.tv-connect-form {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.tv-username-input {
  flex: 1;
  min-width: 200px;
  background: #080b11;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 11px 16px;
  color: #ffffff;
  font-size: 0.9375rem;
  font-family: inherit;
  transition: all 0.18s ease;
}

.tv-username-input:focus {
  border-color: #007aff;
  box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.2);
  outline: none;
}

.btn-connect-tv {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 20px;
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.tv-status-badge-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.btn-disconnect-tv {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  color: #fda4af;
  border: 1px solid rgba(244, 63, 94, 0.35);
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s ease;
}

.btn-disconnect-tv:hover {
  background: rgba(244, 63, 94, 0.15);
  border-color: rgba(244, 63, 94, 0.6);
  color: #ffffff;
}

.tv-scripts-list-box {
  background: #080b11;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 12px 16px;
}

/* ==========================================================================
   Profile Page Styles
   ========================================================================== */

.portal-profile-page {
  max-width: 680px;
  margin: 20px auto 40px;
}

.portal-profile-card {
  background: #0e131d;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 32px;
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
}

.profile-summary-header {
  display: flex;
  align-items: center;
  gap: 18px;
  padding-bottom: 28px;
  margin-bottom: 28px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.profile-avatar-large {
  width: 60px;
  height: 60px;
  border-radius: 16px;
  background: linear-gradient(135deg, #007aff 0%, #0056b3 100%);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 800;
  box-shadow: 0 6px 16px -2px rgba(0, 122, 255, 0.35);
  flex-shrink: 0;
}

.profile-display-name {
  font-size: 1.375rem;
  font-weight: 700;
  color: #ffffff;
  margin: 0 0 4px;
  letter-spacing: -0.02em;
}

.profile-summary-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.875rem;
  color: #94a3b8;
}

.profile-username {
  color: #007aff;
  font-weight: 600;
}

.meta-dot {
  color: #475569;
}

.profile-form-section {
  display: flex;
  flex-direction: column;
}

.profile-section-title {
  font-size: 1.0625rem;
  font-weight: 700;
  color: #ffffff;
  margin: 0 0 6px;
}

.profile-section-desc {
  font-size: 0.8125rem;
  color: #94a3b8;
  margin: 0 0 16px;
}

.profile-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-top: 14px;
}

@media (max-width: 640px) {
  .profile-form-grid {
    grid-template-columns: 1fr;
  }
  .portal-profile-card {
    padding: 20px;
  }
}

.profile-form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.profile-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #cbd5e1;
}

.label-lock-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.6875rem;
  font-weight: 600;
  color: #94a3b8;
  background: rgba(255, 255, 255, 0.06);
  padding: 2px 7px;
  border-radius: 4px;
}

.profile-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.profile-input {
  width: 100%;
  padding: 12px 14px;
  background: #080b11;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: #ffffff;
  font-size: 0.9375rem;
  outline: none;
  transition: all 0.2s ease;
  font-family: inherit;
}

.profile-input::placeholder {
  color: #475569;
}

.profile-input:focus {
  border-color: #007aff;
  box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.2);
  background: #0b0f17;
}

.profile-input-readonly {
  background: rgba(255, 255, 255, 0.03) !important;
  border-color: rgba(255, 255, 255, 0.06) !important;
  color: #64748b !important;
  cursor: not-allowed;
}

.profile-input-hint {
  font-size: 0.75rem;
  color: #64748b;
  margin: 4px 0 0;
  line-height: 1.4;
}

.btn-toggle-password {
  position: absolute;
  right: 12px;
  background: transparent;
  border: none;
  color: #64748b;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.18s ease;
}

.btn-toggle-password:hover {
  color: #cbd5e1;
}

.profile-form-actions {
  margin-top: 28px;
  display: flex;
  justify-content: flex-end;
}

.btn-save-profile {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  font-size: 0.9375rem;
  font-weight: 600;
  border-radius: 8px;
}

/* Alert Boxes */
.portal-alert {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-radius: 9px;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 22px;
}

.portal-alert-success {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #34d399;
}

.portal-alert-error {
  background: rgba(244, 63, 94, 0.12);
  border: 1px solid rgba(244, 63, 94, 0.35);
  color: #fda4af;
}

/* --------------------------------------------------------------------------
   Confirmation Page Styles
   -------------------------------------------------------------------------- */
.portal-confirmation-wrapper {
  max-width: 780px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 16px 0 48px;
}

/* Header & Success Icon */
.confirmation-hero-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 12px 0 8px;
}

.confirmation-icon-wrap {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(16, 185, 129, 0.12);
  border: 2px solid rgba(16, 185, 129, 0.4);
  color: #34d399;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
  box-shadow: 0 0 28px rgba(16, 185, 129, 0.22);
  animation: pulseSuccess 2s infinite ease-in-out;
}

@keyframes pulseSuccess {
  0%, 100% {
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.2);
  }
  50% {
    box-shadow: 0 0 32px rgba(16, 185, 129, 0.38);
  }
}

.confirmation-hero-title {
  font-size: 1.85rem;
  font-weight: 800;
  color: #f8fafc;
  margin: 0 0 16px;
  letter-spacing: -0.025em;
}

/* Header Metadata Pills */
.confirmation-header-badges {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.confirmation-meta-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: #151c2a;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 9999px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: #94a3b8;
}

.meta-pill-label {
  color: #64748b;
  font-weight: 500;
}

.meta-pill-value {
  color: #f8fafc;
  font-weight: 600;
}

.confirmation-meta-paid {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.35);
  color: #34d399;
}

.confirmation-meta-paid .meta-pill-value {
  color: #34d399;
}

.meta-paid-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #34d399;
  display: inline-block;
  box-shadow: 0 0 8px #34d399;
}

/* Primary Action Hero Card */
.confirmation-action-card {
  background: linear-gradient(135deg, rgba(0, 122, 255, 0.10) 0%, rgba(14, 19, 29, 0.95) 100%);
  border: 1px solid rgba(0, 122, 255, 0.35);
  border-radius: 14px;
  padding: 32px 28px;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.28), 0 0 25px rgba(0, 122, 255, 0.1);
}

.confirmation-action-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: #ffffff;
  margin: 0 0 22px;
  line-height: 1.35;
  letter-spacing: -0.01em;
}

.confirmation-action-button-wrap {
  display: flex;
  justify-content: center;
}

.confirmation-access-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 34px;
  font-size: 1rem;
  font-weight: 700;
  border-radius: 10px;
  background: #007aff;
  color: #ffffff !important;
  text-decoration: none;
  box-shadow: 0 4px 18px rgba(0, 122, 255, 0.35);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.confirmation-access-btn:hover {
  background: #0062cc;
  transform: translateY(-2px);
  box-shadow: 0 8px 26px rgba(0, 122, 255, 0.5);
  color: #ffffff !important;
}

/* Order & Billing Details Card */
.confirmation-details-sheet {
  background-color: #0e131d;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 32px;
  color: #f8fafc;
}

.confirmation-parties-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 24px;
}

.confirmation-party-col {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.confirmation-party-col .party-label {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #64748b;
  text-transform: uppercase;
}

.confirmation-party-col .party-name,
.confirmation-party-col .party-payment {
  font-size: 0.9375rem;
  font-weight: 600;
  color: #f8fafc;
}

.confirmation-party-col .party-email,
.confirmation-party-col .party-card {
  font-size: 0.8125rem;
  color: #94a3b8;
}

/* Unified SUMMARY Section */
.confirmation-summary-section {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.confirmation-summary-heading {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #64748b;
  text-transform: uppercase;
  margin: 0;
}

.confirmation-product-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  background: #151c2a;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
}

.confirmation-product-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  flex-wrap: wrap;
  gap: 12px;
}

.confirmation-product-name {
  font-size: 1.05rem;
  font-weight: 700;
  color: #f8fafc;
}

.confirmation-product-meta {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Financial Breakdown */
.confirmation-financials {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 12px 4px 6px;
}

.financial-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.875rem;
  color: #94a3b8;
}

.financial-row .financial-value {
  font-weight: 600;
  color: #f8fafc;
  font-variant-numeric: tabular-nums;
}

.financial-discount-row {
  color: #34d399;
}

.financial-discount-row .financial-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #34d399;
}

.discount-code-tag {
  display: inline-block;
  font-size: 0.6875rem;
  padding: 2px 7px;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: 4px;
  color: #34d399;
  font-weight: 600;
  text-transform: uppercase;
}

.discount-val {
  color: #34d399 !important;
  font-weight: 700;
}

.financial-total-row {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 16px;
  margin-top: 6px;
}

.financial-total-row .financial-label {
  font-size: 1.05rem;
  font-weight: 700;
  color: #f8fafc;
}

.financial-total-row .total-val {
  font-size: 1.45rem;
  font-weight: 800;
  color: #f8fafc;
}

/* Print Action */
.confirmation-sheet-actions {
  display: flex;
  justify-content: flex-end;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.btn-print-confirmation {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  font-size: 0.8125rem;
  font-weight: 600;
  border-radius: 8px;
  background: #151c2a;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #94a3b8;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-print-confirmation:hover {
  background: #1e2738;
  color: #f8fafc;
  border-color: rgba(255, 255, 255, 0.2);
}

/* ==========================================================================
   Portal Status / Error / Warning Cards
   ========================================================================== */
.portal-status-card {
  max-width: 580px;
  margin: 36px auto 60px;
  background: linear-gradient(180deg, #111726 0%, #0d121c 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 44px 32px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
  position: relative;
  overflow: hidden;
}

.portal-warning-card {
  border-color: rgba(245, 158, 11, 0.3);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4), 0 0 35px rgba(245, 158, 11, 0.07);
}

.portal-error-card {
  border-color: rgba(239, 68, 68, 0.3);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4), 0 0 35px rgba(239, 68, 68, 0.07);
}

.portal-status-icon-wrap {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 18px;
}

.status-icon-warning {
  background: rgba(245, 158, 11, 0.12);
  border: 2px solid rgba(245, 158, 11, 0.4);
  color: #fbbf24;
  box-shadow: 0 0 24px rgba(245, 158, 11, 0.2);
  animation: pulseWarning 2.5s infinite ease-in-out;
}

.status-icon-error {
  background: rgba(239, 68, 68, 0.12);
  border: 2px solid rgba(239, 68, 68, 0.4);
  color: #f87171;
  box-shadow: 0 0 24px rgba(239, 68, 68, 0.2);
}

@keyframes pulseWarning {
  0%, 100% {
    box-shadow: 0 0 16px rgba(245, 158, 11, 0.15);
  }
  50% {
    box-shadow: 0 0 30px rgba(245, 158, 11, 0.35);
  }
}

.portal-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 14px;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 14px;
}

.pill-warning {
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: #fbbf24;
}

.pill-pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #fbbf24;
  box-shadow: 0 0 8px #fbbf24;
  animation: pulseDot 2s infinite ease-in-out;
}

@keyframes pulseDot {
  0%, 100% { opacity: 0.6; transform: scale(0.9); }
  50% { opacity: 1; transform: scale(1.15); }
}

.portal-status-title {
  font-size: 1.65rem;
  font-weight: 800;
  color: #ffffff;
  margin: 0 0 12px;
  letter-spacing: -0.025em;
  line-height: 1.25;
}

.portal-status-order-meta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: #151c2a;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 0.8125rem;
}

.meta-item-badge {
  font-weight: 700;
  color: #94a3b8;
  letter-spacing: 0.02em;
}

.meta-item-sep {
  color: #475569;
}

.meta-item-name {
  font-weight: 600;
  color: #f8fafc;
}

.portal-status-desc {
  font-size: 0.9375rem;
  color: #94a3b8;
  line-height: 1.65;
  max-width: 440px;
  margin: 0 auto 26px;
}

.portal-status-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  width: 100%;
}

.portal-status-footer-note {
  margin-top: 26px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 0.8125rem;
  color: #64748b;
  width: 100%;
}

.portal-status-footer-note a {
  color: #007aff;
  text-decoration: none;
  font-weight: 600;
  transition: color 0.15s ease;
}

.portal-status-footer-note a:hover {
  color: #38bdf8;
  text-decoration: underline;
}

/* Fallback / Legacy Empty State Compatibility */
.portal-confirmation-empty {
  text-align: center;
  padding: 60px 24px;
  background: #0e131d;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
}

.confirmation-empty-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #f8fafc;
  margin: 0 0 12px;
}

.confirmation-empty-desc {
  font-size: 0.9375rem;
  color: #94a3b8;
  max-width: 480px;
  margin: 0 auto 24px;
  line-height: 1.6;
}

/* Responsive adjustments */
@media (max-width: 640px) {
  .confirmation-parties-grid {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .confirmation-hero-title {
    font-size: 1.5rem;
  }

  .confirmation-action-title {
    font-size: 1.15rem;
  }

  .confirmation-product-info {
    flex-direction: column;
    align-items: flex-start;
  }

  .confirmation-details-sheet {
    padding: 22px;
  }
}

/* ==========================================================================
   AffiliateWP Forms & Registration
   ========================================================================== */
.affwp-form.affwp-register-form,
.wp-block-affiliatewp-affiliate-registration,
form.affwp-form {
  max-width: 600px;
  margin: 32px auto 60px;
  background: #0e131d;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 16px;
  padding: 36px 32px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4);
}

.affwp-form fieldset {
  border: none;
  padding: 0;
  margin: 0;
}

.affwp-form legend {
  display: block;
  width: 100%;
  font-size: 1.25rem;
  font-weight: 700;
  color: #f8fafc;
  padding-bottom: 16px;
  margin-bottom: 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  letter-spacing: -0.01em;
}

.affwp-form p {
  margin: 0 0 20px 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.affwp-form label.affwp-field-label,
.affwp-form label {
  font-size: 0.875rem;
  font-weight: 600;
  color: #cbd5e1;
  display: flex;
  align-items: center;
  gap: 6px;
}

.affwp-form label .required {
  font-size: 0.75rem;
  font-weight: 500;
  color: #64748b;
}

.affwp-form input[type="text"],
.affwp-form input[type="email"],
.affwp-form input[type="password"],
.affwp-form input[type="url"],
.affwp-form input[type="tel"],
.affwp-form textarea,
.affwp-form .affwp-field:not([type="checkbox"]):not([type="radio"]):not([type="submit"]) {
  width: 100% !important;
  box-sizing: border-box !important;
  padding: 13px 16px !important;
  background-color: #080b11 !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  border-radius: 9px !important;
  color: #ffffff !important;
  font-size: 0.9375rem !important;
  font-family: inherit !important;
  line-height: 1.5 !important;
  outline: none !important;
  transition: all 0.2s ease !important;
}

.affwp-form input[type="text"]::placeholder,
.affwp-form input[type="email"]::placeholder,
.affwp-form textarea::placeholder {
  color: #64748b !important;
}

.affwp-form input[type="text"]:focus,
.affwp-form input[type="email"]:focus,
.affwp-form input[type="password"]:focus,
.affwp-form textarea:focus,
.affwp-form .affwp-field:focus {
  border-color: #007aff !important;
  background-color: #0b0f17 !important;
  box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.2) !important;
}

/* Disabled & Readonly state (when logged in or prefilled) */
.affwp-form input:disabled,
.affwp-form input[readonly],
.affwp-form input.affwp-field:disabled,
.affwp-form input.affwp-field[readonly] {
  background-color: rgba(255, 255, 255, 0.04) !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
  color: #94a3b8 !important;
  cursor: not-allowed !important;
  -webkit-text-fill-color: #94a3b8 !important;
}

/* Terms checkbox row */
.affwp-form p:has(input[type="checkbox"]),
.affwp-form p:has(.affwp-field-terms-of-use) {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 12px;
  margin: 22px 0 26px;
}

.affwp-form input[type="checkbox"],
.affwp-form .affwp-field-terms-of-use {
  width: 18px !important;
  height: 18px !important;
  min-width: 18px !important;
  margin: 3px 0 0 0 !important;
  accent-color: #007aff !important;
  cursor: pointer;
  border-radius: 4px;
}

.affwp-form p:has(input[type="checkbox"]) label,
.affwp-form p:has(.affwp-field-terms-of-use) label {
  font-size: 0.875rem;
  font-weight: 500;
  color: #94a3b8;
  line-height: 1.5;
  cursor: pointer;
  display: inline-block;
}

.affwp-form p:has(input[type="checkbox"]) label a,
.affwp-form p:has(.affwp-field-terms-of-use) label a,
.affwp-form a {
  color: #007aff;
  text-decoration: underline;
  text-underline-offset: 3px;
  font-weight: 600;
  transition: color 0.15s ease;
}

.affwp-form a:hover {
  color: #38bdf8;
}

/* Submit Button */
.affwp-form input[type="submit"],
.affwp-form input[type="submit"].button,
.affwp-form button[type="submit"] {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  background: #007aff !important;
  color: #ffffff !important;
  font-weight: 700 !important;
  font-size: 0.9375rem !important;
  padding: 13px 32px !important;
  border-radius: 9px !important;
  border: none !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
  box-shadow: 0 4px 14px rgba(0, 122, 255, 0.35) !important;
  letter-spacing: 0.01em !important;
}

.affwp-form input[type="submit"]:hover,
.affwp-form input[type="submit"].button:hover,
.affwp-form button[type="submit"]:hover {
  background: #0062cc !important;
  box-shadow: 0 6px 20px rgba(0, 122, 255, 0.45) !important;
  transform: translateY(-1px);
}

.affwp-form input[type="submit"]:active,
.affwp-form input[type="submit"].button:active {
  transform: translateY(0);
}

/* Alerts / Notices */
.affwp-errors,
.affwp-error,
.affwp-notice {
  background: rgba(239, 68, 68, 0.1) !important;
  border: 1px solid rgba(239, 68, 68, 0.3) !important;
  color: #f87171 !important;
  border-radius: 10px !important;
  padding: 14px 18px !important;
  margin-bottom: 22px !important;
  font-size: 0.875rem !important;
  line-height: 1.5 !important;
}

.affwp-errors p,
.affwp-error p {
  margin: 0 !important;
  color: #f87171 !important;
}

.affwp-success {
  background: rgba(16, 185, 129, 0.1) !important;
  border: 1px solid rgba(16, 185, 129, 0.3) !important;
  color: #34d399 !important;
  border-radius: 10px !important;
  padding: 14px 18px !important;
  margin-bottom: 22px !important;
  font-size: 0.875rem !important;
}

@media (max-width: 640px) {
  .affwp-form.affwp-register-form,
  form.affwp-form {
    padding: 24px 20px;
    margin: 16px auto 36px;
  }
}

