/* Fees + Invoices UI customizations (scoped)
   Keep changes page-specific to avoid impacting other portal pages.
   Uses portal theme tokens from portal_styles.css (e.g. --u-accent).
*/

/* ========== Fees page CTA button ========== */
body.u-portal-mode .u-fees-page .u-hero__actions {
  gap: 0.75rem;
}

/* Keep the glass look, but make it feel more "portal-native" */
body.u-portal-mode .u-fees-page .u-hero-btn.u-hero-btn--invoices {
  border-color: rgba(255, 255, 255, 0.42);
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.26) 0%,
    rgba(255, 255, 255, 0.10) 100%
  );
}

body.u-portal-mode .u-fees-page .u-hero-btn.u-hero-btn--invoices i {
  opacity: 0.95;
}

/* ========== Invoice list page: modern portal-theme styling with varied colors ========== */

/* KPI Summary Cards Grid */
body.u-portal-mode .u-invoices-page .u-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

body.u-portal-mode .u-invoices-page .u-kpi-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(249, 250, 251, 0.8) 100%);
  border: 1px solid rgba(229, 231, 235, 0.6);
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
  transition: all 0.3s ease;
}

body.u-portal-mode .u-invoices-page .u-kpi-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

body.u-portal-mode .u-invoices-page .u-kpi-card__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 10px;
  font-size: 1.5rem;
  flex-shrink: 0;
}

body.u-portal-mode .u-invoices-page .u-kpi-card--total .u-kpi-card__icon {
  background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
  color: white;
}

body.u-portal-mode .u-invoices-page .u-kpi-card--paid .u-kpi-card__icon {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
}

body.u-portal-mode .u-invoices-page .u-kpi-card--pending .u-kpi-card__icon {
  background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
  color: white;
}

body.u-portal-mode .u-invoices-page .u-kpi-card--overdue .u-kpi-card__icon {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: white;
}

body.u-portal-mode .u-invoices-page .u-kpi-card__content {
  flex: 1;
}

body.u-portal-mode .u-invoices-page .u-kpi-card__label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--u-muted);
  font-weight: 600;
  margin-bottom: 0.35rem;
}

body.u-portal-mode .u-invoices-page .u-kpi-card__value {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--u-text);
  line-height: 1.2;
}

/* Filter Bar */
body.u-portal-mode .u-invoices-page .u-filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(249, 250, 251, 0.9) 100%);
  border: 1px solid rgba(229, 231, 235, 0.7);
  border-radius: 10px;
  margin-bottom: 1.25rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
  flex-wrap: wrap;
}

body.u-portal-mode .u-invoices-page .u-filter-bar__left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1;
  min-width: 0;
}

body.u-portal-mode .u-invoices-page .u-filter-bar__right {
  flex-shrink: 0;
}

body.u-portal-mode .u-invoices-page .u-filter-group {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

body.u-portal-mode .u-invoices-page .u-filter-btn {
  padding: 0.5rem 1rem;
  border: 1.5px solid rgba(229, 231, 235, 0.8);
  background: white;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 600;
  color: #6b7280;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

body.u-portal-mode .u-invoices-page .u-filter-btn:hover {
  border-color: #8b5cf6;
  color: #8b5cf6;
  background: rgba(139, 92, 246, 0.05);
}

body.u-portal-mode .u-invoices-page .u-filter-btn--active {
  background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
  color: white;
  border-color: #8b5cf6;
}

body.u-portal-mode .u-invoices-page .u-filter-btn--active:hover {
  background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
  border-color: #7c3aed;
  color: white;
}

body.u-portal-mode .u-invoices-page .u-filter-btn i {
  font-size: 0.9rem;
}

body.u-portal-mode .u-invoices-page .u-filter-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  padding: 0 0.5rem;
  background: rgba(107, 114, 128, 0.12);
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 700;
  color: #4b5563;
}

body.u-portal-mode .u-invoices-page .u-filter-btn--active .u-filter-count {
  background: rgba(255, 255, 255, 0.25);
  color: white;
}

body.u-portal-mode .u-invoices-page .u-filter-btn:hover:not(.u-filter-btn--active) .u-filter-count {
  background: rgba(139, 92, 246, 0.15);
  color: #8b5cf6;
}

/* Clear Filters Button */
body.u-portal-mode .u-invoices-page .u-filter-clear {
  padding: 0.5rem 1rem;
  border: 1.5px solid rgba(220, 38, 38, 0.3);
  background: white;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 600;
  color: #dc2626;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-left: 0.5rem;
}

body.u-portal-mode .u-invoices-page .u-filter-clear:hover {
  background: #dc2626;
  color: white;
  border-color: #dc2626;
}

body.u-portal-mode .u-invoices-page .u-filter-clear i {
  font-size: 0.85rem;
}

/* Search Box */
body.u-portal-mode .u-invoices-page .u-search-box {
  position: relative;
  min-width: 240px;
}

body.u-portal-mode .u-invoices-page .u-search-box__icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--u-muted);
  pointer-events: none;
  font-size: 0.9rem;
}

body.u-portal-mode .u-invoices-page .u-search-box__input {
  width: 100%;
  padding: 0.6rem 1rem 0.6rem 2.75rem;
  border: 1.5px solid rgba(229, 231, 235, 0.8);
  border-radius: 8px;
  font-size: 0.875rem;
  background: white;
  color: var(--u-text);
  transition: all 0.2s ease;
}

body.u-portal-mode .u-invoices-page .u-search-box__input:focus {
  outline: none;
  border-color: #8b5cf6;
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

body.u-portal-mode .u-invoices-page .u-search-box__input::placeholder {
  color: var(--u-muted);
}

/* Invoice Table Card */
body.u-portal-mode .u-invoices-page .u-card {
  border-top-width: 3px;
  border-top-style: solid;
  border-top-color: transparent;
  border-image: linear-gradient(90deg, #8b5cf6 0%, #06b6d4 35%, #10b981 70%, #f59e0b 100%) 1;
  border-left: none;
  border-right: none;
  border-bottom: 1px solid rgba(229, 231, 235, 0.8);
  background: linear-gradient(
    180deg,
    rgba(243, 244, 246, 0.4) 0%,
    var(--u-surface) 42%
  );
  box-shadow: 0 10px 28px rgba(107, 114, 128, 0.08);
}

body.u-portal-mode .u-invoices-page .u-card__header {
  color: #4c1d95;
  border-bottom-color: rgba(139, 92, 246, 0.15);
  background: linear-gradient(
    135deg,
    rgba(139, 92, 246, 0.08) 0%,
    rgba(6, 182, 212, 0.06) 50%,
    rgba(16, 185, 129, 0.05) 100%
  );
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Table Row Transitions */
body.u-portal-mode .u-invoices-page tbody tr {
  transition: opacity 0.3s ease, transform 0.2s ease;
}

/* Hero: richer gradient with purple-teal-green-amber blend */
body.u-portal-mode .u-invoices-page .u-hero {
  background:
    radial-gradient(900px 260px at 90% 10%, rgba(245, 158, 11, 0.22) 0%, transparent 55%),
    radial-gradient(700px 220px at 10% 5%, rgba(139, 92, 246, 0.20) 0%, transparent 60%),
    linear-gradient(135deg, #8b5cf6 0%, #3b82f6 35%, #06b6d4 70%, #10b981 100%);
}

body.u-portal-mode .u-invoices-page .u-hero__icon {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.22);
}

/* Pay hint panel with warmer multi-color gradient */
body.u-portal-mode .u-invoices-page .u-pay-hint {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.9rem 1rem;
  margin: 0 0 1rem;
  border-radius: 1rem;
  background: linear-gradient(
    135deg,
    rgba(139, 92, 246, 0.06) 0%,
    rgba(6, 182, 212, 0.08) 50%,
    rgba(16, 185, 129, 0.06) 100%
  );
  border: 1px solid rgba(139, 92, 246, 0.15);
  box-shadow: 0 10px 26px rgba(139, 92, 246, 0.08);
}

body.u-portal-mode .u-invoices-page .u-pay-hint__icon {
  width: 42px;
  height: 42px;
  border-radius: 0.9rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #4c1d95;
  background: rgba(139, 92, 246, 0.14);
  border: 1px solid rgba(139, 92, 246, 0.20);
  flex: 0 0 42px;
}

body.u-portal-mode .u-invoices-page .u-pay-hint__title {
  font-weight: 900;
  color: var(--u-text);
}

body.u-portal-mode .u-invoices-page .u-pay-hint__subtitle {
  color: var(--u-muted);
}

body.u-portal-mode .u-invoices-page .u-card .table {
  border-collapse: separate;
  border-spacing: 0;
}

body.u-portal-mode .u-invoices-page .u-card .table thead th {
  color: #4c1d95;
  background: linear-gradient(
    135deg,
    rgba(139, 92, 246, 0.08) 0%,
    rgba(6, 182, 212, 0.06) 50%,
    rgba(16, 185, 129, 0.05) 100%
  );
  border-bottom: 2px solid rgba(139, 92, 246, 0.18);
  text-transform: none;
  letter-spacing: 0.2px;
  font-size: 0.86rem;
  padding-left: 1.5rem;
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
}

body.u-portal-mode .u-invoices-page .u-card .table tbody td {
  padding-top: 0.65rem;
  padding-bottom: 0.65rem;
  padding-left: 1.5rem;
  border-top: 1px solid rgba(229, 231, 235, 0.5);
}

body.u-portal-mode .u-invoices-page .u-card .table tbody tr {
  transition: all 0.2s ease;
}

body.u-portal-mode .u-invoices-page .u-card .table tbody tr:hover {
  background: linear-gradient(
    90deg,
    rgba(139, 92, 246, 0.04) 0%,
    rgba(6, 182, 212, 0.05) 50%,
    rgba(16, 185, 129, 0.03) 100%
  );
  box-shadow: inset 3px 0 0 #8b5cf6;
}

body.u-portal-mode .u-invoices-page .u-card .table a {
  font-weight: 600;
  color: var(--u-text);
  text-decoration: none;
  transition: color 0.2s ease;
}

body.u-portal-mode .u-invoices-page .u-card .table a:hover {
  color: #7c3aed;
  text-decoration: none;
}

/* Status pills: varied colors */
body.u-portal-mode .u-invoices-page td[name="invoice_status"] .badge {
  font-weight: 800;
  padding: 0.45rem 0.85rem;
  border: 1px solid transparent;
}

/* Row action buttons - simpler since we removed Pay */
body.u-portal-mode .u-invoices-page .u-row-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
}

body.u-portal-mode .u-invoices-page .u-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.5rem 0.7rem;
  border-radius: 999px;
  border: 1px solid rgba(139, 92, 246, 0.18);
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.08) 0%, rgba(6, 182, 212, 0.06) 100%);
  color: #4c1d95;
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.10);
  white-space: nowrap;
  transition: all 0.2s ease;
}

body.u-portal-mode .u-invoices-page .u-icon-btn:hover {
  border-color: rgba(139, 92, 246, 0.35);
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.14) 0%, rgba(6, 182, 212, 0.10) 100%);
  color: #5b21b6;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(139, 92, 246, 0.18);
}

/* Hero buttons with varied gradient */
body.u-portal-mode .u-invoices-page .u-hero-btn {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.22) 0%, rgba(255, 255, 255, 0.10) 100%);
}

body.u-portal-mode .u-invoices-page .u-hero-btn:hover {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.30) 0%, rgba(255, 255, 255, 0.14) 100%);
}

/* Waiting / Processing - teal accent */
body.u-portal-mode .u-invoices-page td[name="invoice_status"] .text-bg-info {
  background-color: rgba(6, 182, 212, 0.14) !important;
  color: #075985 !important;
  border-color: rgba(6, 182, 212, 0.26);
}

/* Paid - green accent */
body.u-portal-mode .u-invoices-page td[name="invoice_status"] .text-bg-success {
  background-color: rgba(16, 185, 129, 0.14) !important;
  color: #065f46 !important;
  border-color: rgba(16, 185, 129, 0.22);
}

/* Cancelled / Partial - amber accent */
body.u-portal-mode .u-invoices-page td[name="invoice_status"] .text-bg-warning {
  background-color: rgba(245, 158, 11, 0.16) !important;
  color: #92400e !important;
  border-color: rgba(245, 158, 11, 0.26);
}

/* Overdue Badge */
body.u-portal-mode .u-invoices-page .u-badge-overdue {
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
  color: white;
  font-size: 0.7rem;
  padding: 0.25rem 0.5rem;
  font-weight: 600;
  border: none;
  animation: pulse-badge 2s ease-in-out infinite;
}

body.u-portal-mode .u-invoices-page .u-badge-overdue i {
  font-size: 0.7rem;
}

@keyframes pulse-badge {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.4);
  }
  50% {
    box-shadow: 0 0 0 4px rgba(220, 38, 38, 0);
  }
}

/* Responsive adjustments for mobile */
@media (max-width: 768px) {
  body.u-portal-mode .u-invoices-page .u-kpi-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  body.u-portal-mode .u-invoices-page .u-kpi-card {
    padding: 1rem 1.25rem;
  }

  body.u-portal-mode .u-invoices-page .u-kpi-card__icon {
    width: 48px;
    height: 48px;
    font-size: 1.25rem;
  }

  body.u-portal-mode .u-invoices-page .u-kpi-card__value {
    font-size: 1.2rem;
  }

  body.u-portal-mode .u-invoices-page .u-filter-bar {
    flex-direction: column;
    align-items: stretch;
    padding: 1rem;
  }

  body.u-portal-mode .u-invoices-page .u-filter-bar__left,
  body.u-portal-mode .u-invoices-page .u-filter-bar__right {
    width: 100%;
  }

  body.u-portal-mode .u-invoices-page .u-filter-group {
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  body.u-portal-mode .u-invoices-page .u-filter-btn {
    flex: 1;
    min-width: calc(50% - 0.25rem);
    justify-content: center;
    font-size: 0.8rem;
    padding: 0.5rem 0.75rem;
  }

  body.u-portal-mode .u-invoices-page .u-search-box {
    min-width: 100%;
    margin-top: 0.75rem;
  }

  body.u-portal-mode .u-invoices-page .u-filter-clear {
    width: 100%;
    margin-left: 0;
    margin-top: 0.5rem;
    justify-content: center;
  }
}

/* ========== Invoice Detail Page ========== */
body.u-portal-mode .u-invoice-detail-page .u-hero {
  background:
    radial-gradient(700px 220px at 90% 0%, rgba(255, 255, 255, 0.10) 0%, transparent 60%),
    linear-gradient(135deg, #1e3a8a 0%, #2563eb 50%, #0891b2 100%);
}

body.u-portal-mode .u-invoice-detail-page .u-hero .badge.rounded-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 0.35rem 0.8rem;
}

body.u-portal-mode .u-invoice-detail-page .u-hero .badge.rounded-pill::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

body.u-portal-mode .u-invoice-detail-page .u-card {
  border: 1px solid var(--u-border);
  border-top: 3px solid var(--u-accent-2);
  border-radius: 1rem;
  background: var(--u-surface);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 12px 24px -10px rgba(15, 23, 42, 0.10);
}

body.u-portal-mode .u-invoice-detail-page .u-card__header {
  color: var(--u-accent-ink);
  border-bottom-color: var(--u-border);
  background: var(--u-surface-2);
  font-size: 1.02rem;
  font-weight: 700;
}

/* Invoice summary grid with icons */
body.u-portal-mode .u-invoice-detail-page .u-invoice-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

body.u-portal-mode .u-invoice-detail-page .u-summary-item {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.85rem 1rem;
  border-radius: 0.9rem;
  background: var(--u-surface);
  border: 1px solid var(--u-border);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

body.u-portal-mode .u-invoice-detail-page .u-summary-item:hover {
  border-color: rgba(37, 99, 235, 0.25);
  box-shadow: 0 12px 24px -10px rgba(15, 23, 42, 0.14);
  transform: translateY(-2px);
}

body.u-portal-mode .u-invoice-detail-page .u-summary-item__icon {
  width: 36px;
  height: 36px;
  border-radius: 0.65rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

body.u-portal-mode .u-invoice-detail-page .u-summary-item__icon--status {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.14) 0%, rgba(139, 92, 246, 0.08) 100%);
  color: #7c3aed;
  border: 1px solid rgba(139, 92, 246, 0.20);
}

body.u-portal-mode .u-invoice-detail-page .u-summary-item__icon--date {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.14) 0%, rgba(59, 130, 246, 0.08) 100%);
  color: #2563eb;
  border: 1px solid rgba(59, 130, 246, 0.20);
}

body.u-portal-mode .u-invoice-detail-page .u-summary-item__icon--due {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.14) 0%, rgba(6, 182, 212, 0.08) 100%);
  color: #0891b2;
  border: 1px solid rgba(6, 182, 212, 0.20);
}

body.u-portal-mode .u-invoice-detail-page .u-summary-item__icon--total {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.14) 0%, rgba(16, 185, 129, 0.08) 100%);
  color: #059669;
  border: 1px solid rgba(16, 185, 129, 0.20);
}

body.u-portal-mode .u-invoice-detail-page .u-summary-item__label {
  font-size: 0.8rem;
  color: var(--u-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

body.u-portal-mode .u-invoice-detail-page .u-summary-item__value {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--u-text);
}

/* Amount Due highlight - premium "wallet card" style, echoing a payment card face */
body.u-portal-mode .u-invoice-detail-page .u-amount-due-highlight {
  position: relative;
  overflow: hidden;
  margin-top: 1rem;
  padding: 1.1rem 1.35rem;
  border-radius: 1.1rem;
  background:
    radial-gradient(420px 160px at 88% -15%, rgba(255, 255, 255, 0.14) 0%, transparent 60%),
    linear-gradient(135deg, #0f172a 0%, #1e3a8a 55%, #0e7490 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 16px 32px -12px rgba(15, 23, 42, 0.45);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

body.u-portal-mode .u-invoice-detail-page .u-amount-due-highlight::after {
  content: "";
  position: absolute;
  top: -46px;
  right: -46px;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.12), transparent 70%);
  pointer-events: none;
}

body.u-portal-mode .u-invoice-detail-page .u-amount-due-highlight__label {
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.65);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

body.u-portal-mode .u-invoice-detail-page .u-amount-due-highlight__value {
  font-size: 1.85rem;
  font-weight: 900;
  color: #ffffff;
  letter-spacing: -0.01em;
}

/* Invoice detail table */
body.u-portal-mode .u-invoice-detail-page .u-card .table {
  border-collapse: separate;
  border-spacing: 0;
}

body.u-portal-mode .u-invoice-detail-page .u-card .table-striped > tbody > tr:nth-of-type(odd) > * {
  background-color: transparent;
}

body.u-portal-mode .u-invoice-detail-page .u-card .table thead th {
  color: var(--u-accent-ink);
  background: var(--u-surface-2);
  border-bottom: 1px solid var(--u-border);
  padding: 0.65rem 0.9rem;
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.74rem;
  letter-spacing: 0.06em;
}

body.u-portal-mode .u-invoice-detail-page .u-card .table tbody td {
  padding: 0.7rem 0.9rem;
  border-top: 1px solid var(--u-border);
  font-weight: 600;
}

body.u-portal-mode .u-invoice-detail-page .u-card .table tbody tr {
  transition: background-color 0.15s ease;
}

body.u-portal-mode .u-invoice-detail-page .u-card .table tbody tr:hover {
  background-color: var(--u-surface-2);
}

/* Payment Evidence Page - Payment Option Buttons (fintech "wallet row" style) */
body.u-portal-mode .u-pay-option {
  position: relative;
  display: flex;
  align-items: center;
  gap: 1rem;
  width: 100%;
  padding: 1rem 2.5rem 1rem 1.15rem;
  border: 1px solid var(--u-border);
  border-radius: 1rem;
  background: var(--u-surface);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
  text-align: left;
}

body.u-portal-mode .u-pay-option::after {
  content: "\f105";
  font-family: FontAwesome;
  position: absolute;
  right: 1.1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--u-muted);
  opacity: 0.5;
  transition: transform 0.18s ease, opacity 0.18s ease, color 0.18s ease;
}

body.u-portal-mode .u-pay-option:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 26px -12px rgba(15, 23, 42, 0.18);
}

body.u-portal-mode .u-pay-option:hover::after {
  opacity: 1;
  transform: translate(3px, -50%);
}

body.u-portal-mode .u-pay-option__icon {
  width: 46px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border-radius: 0.85rem;
  font-size: 1.35rem;
}

body.u-portal-mode .u-pay-option--mobile .u-pay-option__icon {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
  padding: 0.4rem;
}

body.u-portal-mode .u-pay-option--evidence .u-pay-option__icon {
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
  color: white;
}

body.u-portal-mode .u-pay-option__content {
  flex: 1;
}

body.u-portal-mode .u-pay-option__title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--u-text);
  margin-bottom: 0.2rem;
}

body.u-portal-mode .u-pay-option__desc {
  font-size: 0.85rem;
  color: var(--u-muted);
  font-weight: 500;
}

body.u-portal-mode .u-pay-option--mobile:hover {
  border-color: rgba(16, 185, 129, 0.35);
}

body.u-portal-mode .u-pay-option--mobile:hover::after {
  color: #059669;
}

body.u-portal-mode .u-pay-option--evidence:hover {
  border-color: rgba(99, 102, 241, 0.35);
}

body.u-portal-mode .u-pay-option--evidence:hover::after {
  color: #4f46e5;
}

/* Remove the dashed separator */
body.u-portal-mode #evidenceFormSection {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

/* Payment Evidence Page - Card Styling with Varied Colors */
body.u-portal-mode .u-card {
  position: relative;
  border: 1px solid rgba(139, 92, 246, 0.18);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  margin-bottom: 1.25rem;
}

body.u-portal-mode .u-card::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 3px;
  background: linear-gradient(90deg, #8b5cf6 0%, #10b981 50%, #06b6d4 100%);
  border-top-left-radius: 16px;
  border-top-right-radius: 16px;
  pointer-events: none;
}

body.u-portal-mode .u-card__header {
  padding: 0.85rem 1.15rem;
  font-weight: 700;
  font-size: 1.05rem;
  border-bottom: 1px solid rgba(139, 92, 246, 0.12);
  background: linear-gradient(
    135deg,
    rgba(139, 92, 246, 0.06) 0%,
    rgba(16, 185, 129, 0.04) 100%
  );
  color: #5b21b6;
}

/* Transaction Details Summary Bar - clean stat chips (matches invoice summary tiles) */
body.u-portal-mode .u-card .u-info-bar {
  display: flex;
  gap: 1.5rem;
  padding: 0.9rem 1.15rem;
  background: var(--u-surface-2);
  border: 1px solid var(--u-border);
  border-radius: 0.9rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

body.u-portal-mode .u-card .u-info-bar__item {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

body.u-portal-mode .u-card .u-info-bar__label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--u-muted);
  letter-spacing: 0.06em;
}

body.u-portal-mode .u-card .u-info-bar__value {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--u-text);
}

/* Form Field Enhancements - Fix Label Positioning */
body.u-portal-mode .u-input.u-outline-field {
  position: relative;
  margin-bottom: 0;
}

body.u-portal-mode .u-input__icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: #0891b2;
  font-size: 1.05rem;
  z-index: 2;
  pointer-events: none;
}

body.u-portal-mode .u-input .u-control {
  width: 100%;
  padding: 0.85rem 1rem 0.85rem 3rem;
  border: 1.5px solid rgba(209, 213, 219, 0.6);
  border-radius: 12px;
  transition: all 0.2s ease;
  font-size: 0.95rem;
  background: white;
}

body.u-portal-mode .u-input .u-control:focus {
  border-color: #0891b2;
  box-shadow: 0 0 0 3px rgba(8, 145, 178, 0.1);
  outline: none;
}

/* Base State (Inside the input) - Floating Label Start Position */
body.u-portal-mode .u-input .u-label {
  position: absolute;
  left: 3rem; /* Push right to clear the icon when inside */
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.95rem;
  font-weight: 500;
  color: #9ca3af; /* Muted gray placeholder */
  pointer-events: none;
  background: transparent;
  padding: 0 0.5rem;
  z-index: 1;
  white-space: nowrap;
  max-width: calc(100% - 4rem);
  overflow: hidden;
  text-overflow: ellipsis;
  transition: all 0.2s ease-out;
}

/* Active State (Floating on border) - Triggered by focus or content */
/* Override portal styles with higher specificity */
body.u-portal-mode .u-input.u-outline-field:focus-within .u-label,
body.u-portal-mode .u-input.u-outline-field.is-filled .u-label {
  top: -0.7rem;
  left: 1rem; /* Move back left when floating */
  transform: none;
  font-size: 0.8rem;
  font-weight: 600;
  color: #0891b2;
  background: white;
  z-index: 5;
  margin: 0;
}

body.u-portal-mode .u-input textarea.u-control {
  padding-top: 1rem;
  padding-bottom: 1rem;
  resize: vertical;
  min-height: 100px;
}

body.u-portal-mode .u-input select.u-control {
  cursor: pointer;
  padding-top: 0.6rem;
}

/* Upload Drop Zone */
body.u-portal-mode .u-upload-drop {
  border: 2px dashed rgba(37, 99, 235, 0.28);
  border-radius: 1rem;
  padding: 2rem;
  text-align: center;
  background: var(--u-surface-2);
  cursor: pointer;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

body.u-portal-mode .u-upload-drop:hover {
  border-color: var(--u-accent-2);
  background: color-mix(in srgb, var(--u-accent) 6%, var(--u-surface-2));
}

body.u-portal-mode .u-upload-drop strong {
  color: var(--u-accent-2);
  font-weight: 700;
}

/* Form Actions */
body.u-portal-mode .u-form-actions .btn-success {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  border: none;
  padding: 0.65rem 1.75rem;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
  transition: all 0.3s ease;
}

body.u-portal-mode .u-form-actions .btn-success:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.35);
}

/* ========== Pay Invoice / Submit Evidence page ==========
   Scoped to .u-payment-request-page so cards/inputs shared with other
   portal pages (admissions, profile, etc.) are left untouched. */
body.u-portal-mode .u-payment-request-page .u-hero {
  background:
    radial-gradient(700px 220px at 90% 0%, rgba(255, 255, 255, 0.10) 0%, transparent 60%),
    linear-gradient(135deg, #1e3a8a 0%, #2563eb 50%, #0891b2 100%);
}

body.u-portal-mode .u-payment-request-page .u-card {
  position: relative;
  border: 1px solid var(--u-border);
  border-top: 3px solid var(--u-accent-2);
  border-radius: 1rem;
  overflow: hidden;
  background: var(--u-surface);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 12px 24px -10px rgba(15, 23, 42, 0.10);
}

body.u-portal-mode .u-payment-request-page .u-card::before {
  content: none;
}

body.u-portal-mode .u-payment-request-page .u-card__header {
  color: var(--u-accent-ink);
  border-bottom-color: var(--u-border);
  background: var(--u-surface-2);
  font-size: 1.02rem;
  font-weight: 700;
}

/* Form fields - crisp bordered inputs with a plain (non-chip) icon,
   instead of the site-wide pale-blue icon chip + barely-visible border. */
body.u-portal-mode .u-payment-request-page .u-input .u-control {
  height: 48px;
  border: 1.5px solid var(--u-border);
  border-radius: 0.85rem;
  padding-left: 2.75rem;
  background: var(--u-surface);
}

body.u-portal-mode .u-payment-request-page .u-input textarea.u-control {
  height: auto;
}

body.u-portal-mode .u-payment-request-page .u-input .u-control:focus {
  border-color: var(--u-accent-2);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

body.u-portal-mode .u-payment-request-page .u-input__icon {
  left: 1rem;
  width: auto;
  height: auto;
  border-radius: 0;
  background: none;
  color: var(--u-muted);
  font-size: 0.95rem;
}

body.u-portal-mode .u-payment-request-page .u-input.u-outline-field:focus-within .u-input__icon {
  color: var(--u-accent-2);
}

body.u-portal-mode .u-payment-request-page .u-input.u-outline-field > .u-label {
  left: 2.75rem;
}

body.u-portal-mode .u-payment-request-page .u-input.u-outline-field.is-filled > .u-label,
body.u-portal-mode .u-payment-request-page .u-input.u-outline-field:focus-within > .u-label {
  left: 1rem;
  color: var(--u-accent-2);
}

/* Transaction Details quick-stats: separate tiles instead of one pill-shaped bar */
body.u-portal-mode .u-payment-request-page .u-card .u-info-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.75rem;
  padding: 0;
  background: none;
  border: none;
  border-radius: 0;
  margin-bottom: 1.25rem;
}

body.u-portal-mode .u-payment-request-page .u-card .u-info-bar__item {
  flex-direction: column;
  align-items: flex-start;
  gap: 0.25rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--u-border);
  border-radius: 0.9rem;
  background: var(--u-surface-2);
}

body.u-portal-mode .u-payment-request-page .u-card .u-info-bar__value {
  font-size: 1.1rem;
}

body.u-portal-mode .u-payment-request-page .u-form-actions .btn-light {
  border: 1px solid var(--u-border);
  font-weight: 600;
}

/* Stanbic Bank Agent option + instructions modal */
body.u-portal-mode .u-payment-request-page .u-pay-option--stanbic .u-pay-option__icon.u-pay-option__icon--logo {
  background: #ffffff;
  border: 1px solid var(--u-border);
  padding: 0.35rem;
}

body.u-portal-mode .u-payment-request-page .u-pay-option--stanbic:hover {
  border-color: rgba(15, 76, 156, 0.35);
}

body.u-portal-mode .u-payment-request-page .u-pay-option--stanbic:hover::after {
  color: #0f4c9c;
}

/* Modal chrome - branded header/footer instead of the plain default Bootstrap modal */
body.u-portal-mode .u-payment-request-page .u-stanbic-modal {
  border: none;
  border-radius: 1.1rem;
  overflow: hidden;
  box-shadow: 0 24px 60px -16px rgba(15, 23, 42, 0.35);
}

body.u-portal-mode .u-payment-request-page .u-stanbic-modal__header {
  position: relative;
  padding: 1.35rem 1.5rem;
  background:
    radial-gradient(420px 160px at 100% -20%, rgba(255, 255, 255, 0.12) 0%, transparent 60%),
    linear-gradient(135deg, #0a3d91 0%, #073b7a 60%, #052a5c 100%);
}

body.u-portal-mode .u-payment-request-page .u-stanbic-modal__header .btn-close {
  position: absolute;
  top: 1rem;
  right: 1.1rem;
  opacity: 0.85;
}

body.u-portal-mode .u-payment-request-page .u-stanbic-modal__brand {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding-right: 1.75rem;
}

body.u-portal-mode .u-payment-request-page .u-stanbic-modal__logo {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  border-radius: 0.85rem;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

body.u-portal-mode .u-payment-request-page .u-stanbic-modal__logo img {
  width: 34px;
  height: 34px;
  object-fit: contain;
}

body.u-portal-mode .u-payment-request-page .u-stanbic-modal__eyebrow {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.65);
  margin-bottom: 0.15rem;
}

body.u-portal-mode .u-payment-request-page .u-stanbic-modal__title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 800;
  color: #ffffff;
}

body.u-portal-mode .u-payment-request-page .u-stanbic-modal__body {
  padding: 1.4rem 1.5rem;
}

body.u-portal-mode .u-payment-request-page .u-stanbic-modal__footer {
  display: flex;
  justify-content: flex-end;
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--u-border);
  background: var(--u-surface-2);
}

body.u-portal-mode .u-payment-request-page .u-stanbic-modal__done-btn {
  padding: 0.55rem 1.4rem;
  border-radius: 0.7rem;
  font-weight: 700;
  color: #ffffff;
  background: linear-gradient(135deg, #0a3d91 0%, #073b7a 100%);
  border: none;
  box-shadow: 0 6px 14px rgba(10, 61, 145, 0.28);
}

body.u-portal-mode .u-payment-request-page .u-stanbic-modal__done-btn:hover {
  color: #ffffff;
  filter: brightness(1.08);
}

/* Numbered steps */
body.u-portal-mode .u-payment-request-page .u-stanbic-steps {
  list-style: none;
  padding-left: 0;
  margin-bottom: 1.1rem;
}

body.u-portal-mode .u-payment-request-page .u-stanbic-steps li {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.65rem;
  line-height: 1.5;
}

body.u-portal-mode .u-payment-request-page .u-stanbic-step__num {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: 800;
  color: #ffffff;
  background: linear-gradient(135deg, #0a3d91 0%, #0f4c9c 100%);
  margin-top: 0.1rem;
}

body.u-portal-mode .u-payment-request-page .u-stanbic-step__text {
  color: var(--u-text);
}

body.u-portal-mode .u-payment-request-page .u-stanbic-prn-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1.1rem;
  border: 1.5px dashed rgba(15, 76, 156, 0.35);
  border-radius: 0.85rem;
  background: var(--u-surface-2);
  margin-bottom: 1rem;
}

body.u-portal-mode .u-payment-request-page .u-stanbic-prn-box__text {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

body.u-portal-mode .u-payment-request-page .u-stanbic-prn-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--u-muted);
}

body.u-portal-mode .u-payment-request-page .u-stanbic-prn-value {
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  color: var(--u-accent-ink);
  word-break: break-all;
}

body.u-portal-mode .u-payment-request-page .u-stanbic-copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.9rem;
  border: 1px solid var(--u-border);
  border-radius: 0.65rem;
  background: var(--u-surface);
  color: var(--u-accent-2);
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  flex-shrink: 0;
  transition: border-color 0.18s ease, background-color 0.18s ease, transform 0.12s ease;
}

body.u-portal-mode .u-payment-request-page .u-stanbic-copy-btn:hover {
  border-color: var(--u-accent-2);
  background: color-mix(in srgb, var(--u-accent) 6%, var(--u-surface));
}

body.u-portal-mode .u-payment-request-page .u-stanbic-copy-btn:active {
  transform: scale(0.97);
}

body.u-portal-mode .u-payment-request-page .u-stanbic-confirm {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}

body.u-portal-mode .u-payment-request-page .u-stanbic-confirm__item {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--u-border);
  border-radius: 0.85rem;
  background: var(--u-surface-2);
}

body.u-portal-mode .u-payment-request-page .u-stanbic-confirm__label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--u-muted);
}

body.u-portal-mode .u-payment-request-page .u-stanbic-confirm__value {
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--u-text);
}

body.u-portal-mode .u-payment-request-page .u-stanbic-note {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  padding: 0.75rem 0.9rem;
  border-radius: 0.75rem;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.22);
  color: #047857;
  font-size: 0.85rem;
  font-weight: 600;
}

body.u-portal-mode .u-payment-request-page .u-stanbic-note .fa {
  margin-top: 0.15rem;
}
