/*
 * GDS Customer Portal Theme (basic template)
 * ------------------------------------------
 * Scoped to .customer-portal / .customer-dashboard.
 * Does not change public marketing pages or staff UI.
 * Brand: navy primary (#2F3C7E), coral accent (#E84351).
 * Informed by ui-ux-pro-max (Data-Dense Dashboard + Banking trust).
 */

.customer-portal,
.customer-dashboard {
  --gds-primary: #2F3C7E;
  --gds-primary-hover: #26326A;
  --gds-navy-dark: #14233C;
  --gds-accent: #E84351;
  --gds-success: #157F4B;
  --gds-warning: #9A6700;
  --gds-danger: #C0362C;
  --gds-bg: #F8FAFC;
  --gds-card: #FFFFFF;
  --gds-border: #E2E8F0;
  --gds-muted: #64748B;
  --gds-dark: #0F1729;
  --gds-radius: 8px;
  --gds-shadow: 0 1px 2px rgb(15 23 41 / 0.06), 0 1px 3px rgb(15 23 41 / 0.04);
  --gds-gap: 10px;
  --gds-pad: 12px;
}

/* ---- Authenticated portal chrome (header / hero / footer) ---- */

body:has(.customer-portal) {
  background: var(--gds-bg, #F8FAFC);
  min-height: 100vh;
}

/*
 * Flex sticky footer: footer stays at the bottom on short pages and
 * scrolls with content on long pages — no fixed overlay / clipped cards.
 */
body:has(.customer-portal) > .main-wrapper {
  width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

body:has(.customer-portal) .customer-portal {
  width: 100%;
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
  min-height: 100%;
  background: var(--gds-bg, #F8FAFC);
  padding-bottom: 0;
}

/* Light gds-header bar (shared with public site) — navy text, not white-on-white */
body:has(.customer-portal) .gds-header,
body:has(.customer-portal) .header.gds-header {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}

body:has(.customer-portal) .gds-header__bar,
body:has(.customer-portal) .header .header__bottom,
body:has(.customer-portal) .header.menu-fixed .header__bottom {
  background: rgba(248, 250, 252, 0.94) !important;
  background-image: none !important;
  border-bottom: 1px solid #e2e8f0;
  box-shadow: 0 1px 0 rgb(15 23 41 / 0.04);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

body:has(.customer-portal) .header .site-logo img,
body:has(.customer-portal) .gds-header__logo img {
  max-height: 52px;
  max-width: 180px;
  width: auto;
}

body:has(.customer-portal) .gds-header__wordmark {
  color: #14233c !important;
}

body:has(.customer-portal) .header .main-menu {
  margin-left: 1.25rem;
}

body:has(.customer-portal) .header .main-menu li a,
body:has(.customer-portal) .gds-header__menu li a {
  font-family: 'Poppins', 'Segoe UI', ui-sans-serif, sans-serif;
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  text-transform: none !important;
  padding: 0.55rem 0.85rem !important;
  color: #14233c !important;
  border-radius: 8px;
}

body:has(.customer-portal) .header .main-menu li a:hover,
body:has(.customer-portal) .header .main-menu li a:focus,
body:has(.customer-portal) .gds-header__menu li a:hover,
body:has(.customer-portal) .gds-header__menu li a:focus {
  color: #2f3c7e !important;
  background: rgba(47, 60, 126, 0.06);
}

body:has(.customer-portal) .header .main-menu li a.active,
body:has(.customer-portal) .gds-header__menu li a.active {
  color: #fff !important;
  background: var(--gds-accent, #e84351) !important;
}

body:has(.customer-portal) .header .main-menu li.menu_has_children > a::before {
  color: #14233c !important;
}

body:has(.customer-portal) .header .nav-right,
body:has(.customer-portal) .gds-header__actions {
  align-items: center;
  gap: 0.5rem;
}

body:has(.customer-portal) .header-user-meta {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
}

body:has(.customer-portal) .header-user-meta__text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
  text-align: right;
}

body:has(.customer-portal) .header-user-meta__name {
  color: #14233c;
  font-size: 0.875rem;
  font-weight: 600;
}

body:has(.customer-portal) .header-user-meta__branch {
  color: #64748b;
  font-size: 0.72rem;
}

body:has(.customer-portal) .header-user-meta__kyc {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.15rem 0.4rem;
  border-radius: 999px;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #fff;
  background: #9a6700;
}

body:has(.customer-portal) .header-logout-btn,
body:has(.customer-portal) .gds-header__actions .gds-btn--ghost-dark {
  background: transparent !important;
  border: 1.5px solid #cbd5e1 !important;
  color: #14233c !important;
  border-radius: 8px;
  padding: 0.4rem 0.85rem !important;
  font-size: 0.875rem;
  font-weight: 600;
  min-height: 40px;
}

body:has(.customer-portal) .header-logout-btn:hover,
body:has(.customer-portal) .gds-header__actions .gds-btn--ghost-dark:hover {
  background: #f1f5f9 !important;
  border-color: #94a3b8 !important;
  color: #14233c !important;
}

body:has(.customer-portal) .gds-header__toggle .menu-toggle,
body:has(.customer-portal) .gds-header__toggle .menu-toggle::before,
body:has(.customer-portal) .gds-header__toggle .menu-toggle::after {
  background-color: #14233c !important;
}

body:has(.customer-portal) .customer-page-hero {
  background: linear-gradient(180deg, #14233C 0%, #2F3C7E 100%);
  border-bottom: 1px solid rgb(255 255 255 / 0.08);
  /* Clear fixed header; keep content band short */
  padding: 5.75rem 0 1.15rem;
  margin-top: 0;
}

body:has(.customer-portal) .customer-page-hero__inner {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

body:has(.customer-portal) .customer-page-hero__eyebrow {
  margin: 0;
  color: rgb(255 255 255 / 0.65);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

body:has(.customer-portal) .customer-page-hero__title {
  margin: 0;
  color: #fff;
  font-size: clamp(1.35rem, 2vw, 1.75rem);
  font-weight: 650;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

body:has(.customer-portal) .customer-portal-main {
  flex: 1 0 auto;
  background: #F8FAFC;
  padding: 1.5rem 0 2rem;
  width: 100%;
}

body:has(.customer-portal) .bottom-menu-section {
  background: #fff !important;
  border-bottom: 1px solid #E2E8F0;
  padding: 0.45rem 0 !important;
}

body:has(.customer-portal) .bottom-menu .navbar-toggler {
  color: #14233C !important;
}

body:has(.customer-portal) .bottom-menu ul {
  gap: 0.25rem;
  flex-wrap: wrap;
  justify-content: center;
}

body:has(.customer-portal) .bottom-menu ul li a {
  color: #334155 !important;
  font-family: 'Poppins', 'Segoe UI', ui-sans-serif, sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: none;
  padding: 0.45rem 0.8rem !important;
  border-radius: 6px;
  transition: background 0.15s ease, color 0.15s ease;
}

body:has(.customer-portal) .bottom-menu ul li a:hover,
body:has(.customer-portal) .bottom-menu ul li a:focus {
  color: #2F3C7E !important;
  background: rgb(47 60 126 / 0.08);
}

body:has(.customer-portal) .bottom-menu ul li a.active {
  color: #fff !important;
  background: #2F3C7E !important;
}

/*
 * Outline buttons: frontend skin forces white labels for dark heroes.
 * On the light customer portal that becomes white-on-white — restore ink.
 */
body:has(.customer-portal) .btn-outline--base,
body:has(.customer-portal) .btn.btn-outline--base,
body:has(.customer-portal) .btn-outline--gradient,
body:has(.customer-portal) .btn.btn-outline--gradient {
  color: var(--gds-accent, #e84351) !important;
  background: #fff !important;
  border-color: var(--gds-accent, #e84351) !important;
}

body:has(.customer-portal) .btn-outline--base:hover,
body:has(.customer-portal) .btn.btn-outline--base:hover,
body:has(.customer-portal) .btn-outline--base:focus,
body:has(.customer-portal) .btn.btn-outline--base:focus,
body:has(.customer-portal) .btn-outline--gradient:hover,
body:has(.customer-portal) .btn.btn-outline--gradient:hover {
  color: #fff !important;
  background: var(--gds-accent, #e84351) !important;
  border-color: var(--gds-accent, #e84351) !important;
}

body:has(.customer-portal) .btn-outline--primary,
body:has(.customer-portal) .btn.btn-outline--primary {
  color: var(--gds-primary, #2f3c7e) !important;
  border-color: var(--gds-primary, #2f3c7e) !important;
  background: #fff !important;
}

body:has(.customer-portal) .btn-outline--primary:hover,
body:has(.customer-portal) .btn.btn-outline--primary:hover,
body:has(.customer-portal) .btn-outline--primary:focus,
body:has(.customer-portal) .btn.btn-outline--primary:focus {
  color: #fff !important;
  background: var(--gds-primary, #2f3c7e) !important;
  border-color: var(--gds-primary, #2f3c7e) !important;
}

@media (max-width: 1199px) {
  body:has(.customer-portal) .bottom-menu ul li:not(:last-child) {
    border-bottom-color: #E2E8F0;
  }

  body:has(.customer-portal) .bottom-menu ul li a {
    text-align: left;
  }
}

/* In-flow utility footer (flex sticky via parent column layout) */
body:has(.customer-portal) .customer-footer {
  background: #14233C !important;
  background-image: none !important;
  padding: 0.95rem 0 !important;
  margin: auto 0 0 !important;
  border-top: 3px solid var(--gds-accent, #E84351);
  width: 100%;
  position: relative !important;
  left: auto;
  right: auto;
  bottom: auto;
  z-index: 2;
  flex-shrink: 0;
  box-shadow: none;
}

/* Debugbar sits over the page bottom in local/dev — leave a little clearance */
body:has(.phpdebugbar) .customer-footer {
  margin-bottom: 2.25rem !important;
}

body:has(.phpdebugbar) .customer-portal {
  padding-bottom: 0;
}

body:has(.customer-portal) .customer-footer__bar {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) auto minmax(140px, 1fr);
  align-items: center;
  gap: 0.85rem 1.25rem;
}

body:has(.customer-portal) .customer-footer__brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: #fff;
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 600;
  justify-self: start;
}

body:has(.customer-portal) .customer-footer__brand img {
  max-height: 28px;
  width: auto;
}

body:has(.customer-portal) .customer-footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.1rem;
  align-items: center;
  justify-content: center;
}

body:has(.customer-portal) .customer-footer__links a {
  color: rgb(255 255 255 / 0.78);
  font-size: 0.8125rem;
  font-weight: 500;
  text-decoration: none;
}

body:has(.customer-portal) .customer-footer__links a:hover {
  color: #fff;
}

body:has(.customer-portal) .customer-footer__copy {
  color: rgb(255 255 255 / 0.55);
  font-size: 0.75rem;
  text-align: right;
  justify-self: end;
  max-width: none;
}

@media (max-width: 767.98px) {
  body:has(.customer-portal) .header-user-meta__text {
    text-align: left;
  }

  body:has(.customer-portal) .customer-page-hero {
    padding: 5.25rem 0 1rem;
  }

  body:has(.customer-portal) .header .site-logo img {
    max-height: 36px;
    max-width: 130px;
  }

  body:has(.customer-portal) .customer-portal-main {
    padding: 1rem 0 1.25rem;
  }

  body:has(.customer-portal) .customer-footer {
    padding: 0.75rem 0 !important;
  }

  body:has(.customer-portal) .customer-footer__bar {
    grid-template-columns: 1fr;
    justify-items: start;
    gap: 0.45rem;
  }

  body:has(.customer-portal) .customer-footer__links {
    justify-content: flex-start;
  }

  body:has(.customer-portal) .customer-footer__copy {
    text-align: left;
    justify-self: start;
  }
}

.customer-dashboard {
  color: var(--gds-dark);
}

.customer-dashboard .dashboard-welcome {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.customer-dashboard .dashboard-welcome h4 {
  font-size: 1.2rem;
  font-weight: 650;
  letter-spacing: -0.01em;
  margin-bottom: 2px;
  color: var(--gds-navy-dark);
}

.customer-dashboard .dashboard-welcome .welcome-sub {
  font-size: 0.875rem;
  color: var(--gds-muted);
  margin: 0;
}

.customer-dashboard .welcome-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.customer-dashboard .welcome-actions .btn {
  border-radius: 6px;
  font-weight: 550;
  font-size: 0.8125rem;
  padding: 0.4rem 0.75rem;
  min-height: 36px;
  white-space: nowrap;
}

.customer-dashboard .welcome-actions .btn-outline--primary,
.customer-dashboard .welcome-actions .btn-outline-primary {
  color: var(--gds-primary) !important;
  border-color: var(--gds-primary) !important;
  background: transparent !important;
}

.customer-dashboard .welcome-actions .btn-outline--primary:hover,
.customer-dashboard .welcome-actions .btn-outline-primary:hover {
  color: #fff !important;
  background: var(--gds-primary) !important;
}

.customer-dashboard .welcome-actions .btn-outline--success {
  color: var(--gds-success) !important;
  border-color: var(--gds-success) !important;
}

.customer-dashboard .welcome-actions .btn-outline--success:hover {
  color: #fff !important;
  background: var(--gds-success) !important;
}

.customer-dashboard .welcome-actions .btn-outline--warning {
  color: var(--gds-warning) !important;
  border-color: #D4A017 !important;
}

.customer-dashboard .welcome-actions .btn-outline--base,
.customer-dashboard .welcome-actions .btn-outline--base:hover {
  color: var(--gds-accent) !important;
  border-color: var(--gds-accent) !important;
}

.customer-dashboard .welcome-actions .btn-outline--base:hover {
  color: #fff !important;
  background: var(--gds-accent) !important;
}

.customer-dashboard .custom--card {
  border: 1px solid var(--gds-border);
  border-radius: var(--gds-radius);
  box-shadow: var(--gds-shadow);
  background: var(--gds-card);
  overflow: hidden;
}

.customer-dashboard .custom--card:hover {
  box-shadow: 0 2px 8px rgb(15 23 41 / 0.08);
}

.customer-dashboard .custom--card > .card-header {
  background: #fff !important;
  color: var(--gds-navy-dark) !important;
  border-bottom: 1px solid var(--gds-border);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.customer-dashboard .custom--card > .card-header h5,
.customer-dashboard .custom--card > .card-header .text-base,
.customer-dashboard .custom--card > .card-header i {
  color: var(--gds-navy-dark) !important;
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 600;
}

.customer-dashboard .custom--card > .card-body {
  padding: var(--gds-pad);
}

.customer-dashboard .account-slider-container {
  padding: 10px 12px 14px !important;
}

.customer-dashboard .account-slider {
  gap: 10px !important;
}

.customer-dashboard .account-slide {
  min-width: 260px !important;
}

.customer-dashboard .account-card {
  border-radius: var(--gds-radius) !important;
  padding: 1rem 1.1rem !important;
  height: 168px !important;
  background-color: var(--gds-primary) !important;
  box-shadow: var(--gds-shadow) !important;
}

.customer-dashboard .account-card:hover {
  transform: translateY(-1px);
}

.customer-dashboard .account-icon {
  width: 40px !important;
  height: 40px !important;
  font-size: 1.15rem !important;
}

.customer-dashboard .account-name {
  font-size: 0.95rem !important;
}

.customer-dashboard .account-number {
  font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  font-size: 0.75rem !important;
  letter-spacing: 0.02em;
}

.customer-dashboard .balance-amount {
  font-size: 1.45rem !important;
  letter-spacing: -0.02em;
}

.customer-dashboard .account-balance {
  margin: 0.5rem 0 !important;
}

.customer-dashboard .slider-controls .btn {
  width: 32px !important;
  height: 32px !important;
  min-width: 32px;
  background: var(--gds-accent) !important;
  border-color: var(--gds-accent) !important;
  color: #fff !important;
}

.customer-dashboard .slider-controls .btn:hover {
  background: #d33845 !important;
  border-color: #d33845 !important;
}

.customer-dashboard .btn--base,
.customer-dashboard .btn-base,
.customer-dashboard .btn.btn--base {
  background-color: var(--gds-accent) !important;
  border-color: var(--gds-accent) !important;
  color: #fff !important;
}

/* Keep Recent Transactions header actions the same height */
.customer-dashboard .custom--card > .card-header .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.2;
  padding: 0.35rem 0.65rem;
  min-height: 32px;
  height: 32px;
  border-radius: 6px;
  white-space: nowrap;
}

.customer-dashboard .customer-dashboard__view-all,
.customer-dashboard .customer-dashboard__view-all:visited {
  color: var(--gds-accent) !important;
  border: 1px solid var(--gds-accent) !important;
  background: transparent !important;
  box-shadow: none !important;
}

.customer-dashboard .customer-dashboard__view-all i,
.customer-dashboard .custom--card > .card-header .customer-dashboard__view-all i {
  color: inherit !important;
}

.customer-dashboard .customer-dashboard__view-all:hover,
.customer-dashboard .customer-dashboard__view-all:focus {
  color: #fff !important;
  background: var(--gds-accent) !important;
  border-color: var(--gds-accent) !important;
}

.customer-dashboard .customer-dashboard__view-all:hover i,
.customer-dashboard .customer-dashboard__view-all:focus i,
.customer-dashboard .custom--card > .card-header .customer-dashboard__view-all:hover i,
.customer-dashboard .custom--card > .card-header .customer-dashboard__view-all:focus i {
  color: inherit !important;
}

.customer-dashboard .transaction-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.customer-dashboard .transaction-toggle .btn {
  font-size: 0.75rem;
  padding: 0.35rem 0.65rem;
  min-height: 32px;
  height: 32px;
  border-radius: 6px;
}

.customer-dashboard .transaction-toggle .btn.active {
  background-color: var(--gds-primary) !important;
  border-color: var(--gds-primary) !important;
  color: #fff !important;
}

.customer-dashboard .transaction-section {
  max-height: 280px;
}

.customer-dashboard .table {
  font-size: 0.8125rem;
  margin-bottom: 0;
}

.customer-dashboard .table th {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--gds-muted);
  font-weight: 600;
  border-top: 0;
  padding: 0.45rem 0.5rem;
}

.customer-dashboard .table td {
  padding: 0.55rem 0.5rem;
  vertical-align: middle;
}

.customer-dashboard .status-indicators .alert {
  border-radius: 6px;
}

/* ---- Product Balances card ---- */

.customer-dashboard .product-balances-card__header {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.75rem;
}

.customer-dashboard .product-balances-card__subtitle {
  margin-top: 0.2rem;
  font-size: 0.75rem;
  color: var(--gds-muted);
  font-weight: 400;
}

.customer-dashboard .product-balances-card__body {
  padding: 0.85rem 1rem 1rem !important;
}

.customer-dashboard .product-switcher {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding: 0.25rem;
  background: #F1F5F9;
  border-radius: 8px;
}

.customer-dashboard .product-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: 0;
  background: transparent;
  color: #475569;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.4rem 0.7rem;
  border-radius: 6px;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease;
}

.customer-dashboard .product-tab i {
  font-size: 0.95rem;
  color: #94A3B8;
}

.customer-dashboard .product-tab:hover {
  background: rgb(255 255 255 / 0.7);
  color: #14233C;
}

.customer-dashboard .product-tab.active {
  background: #fff;
  color: #14233C;
  box-shadow: 0 1px 2px rgb(15 23 41 / 0.08);
}

.customer-dashboard .product-tab.active i {
  color: var(--gds-accent);
}

.customer-dashboard .product-balance-panel__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.customer-dashboard .product-balance-panel__identity {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
}

.customer-dashboard .product-balance-panel__icon {
  width: 2.25rem;
  height: 2.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: rgb(47 60 126 / 0.1);
  color: var(--gds-primary);
  font-size: 1.1rem;
  flex-shrink: 0;
}

.customer-dashboard .product-balance-panel__name {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: #14233C;
}

.customer-dashboard .product-balance-panel__count {
  font-size: 0.75rem;
  color: var(--gds-muted);
}

.customer-dashboard .product-balance-panel__badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.45rem;
}

.customer-dashboard .product-balance-panel__chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #475569;
  background: #F1F5F9;
  border-radius: 999px;
  padding: 0.2rem 0.55rem;
}

.customer-dashboard .product-balance-panel__chip--success {
  color: #157F4B;
  background: rgb(21 127 75 / 0.1);
}

.customer-dashboard .product-balance-panel__toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
  font-size: 0.75rem;
  font-weight: 600;
  color: #475569;
  cursor: pointer;
}

.customer-dashboard .product-balance-panel__toggle .form-check-input {
  width: 2.1rem;
  height: 1.15rem;
  margin: 0;
  cursor: pointer;
}

.customer-dashboard .product-balance-metrics {
  display: grid;
  gap: 0.6rem;
  margin-bottom: 0.85rem;
}

.customer-dashboard .product-balance-metrics--single {
  grid-template-columns: 1fr;
}

.customer-dashboard .product-balance-metrics--triple {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.customer-dashboard .product-balance-metric {
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 8px;
  padding: 0.7rem 0.75rem;
  min-width: 0;
}

.customer-dashboard .product-balance-metric__label {
  display: block;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--gds-muted);
  margin-bottom: 0.25rem;
}

.customer-dashboard .product-balance-metric__value {
  display: block;
  font-size: 1.05rem;
  font-weight: 700;
  color: #14233C;
  letter-spacing: -0.01em;
  word-break: break-word;
}

.customer-dashboard .product-balance-metric__value--ok {
  color: var(--gds-success);
}

.customer-dashboard .product-balance-metric__value--warn {
  color: var(--gds-danger);
}

.customer-dashboard .product-balance-metric__progress {
  margin-top: 0.45rem;
}

.customer-dashboard .product-balance-metric__progress .progress {
  height: 4px;
  margin-bottom: 0.2rem;
  background: #E2E8F0;
}

.customer-dashboard .product-balance-metric__progress small {
  font-size: 0.68rem;
  color: var(--gds-muted);
}

.customer-dashboard .product-balance-loan {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem 0.75rem;
  margin-bottom: 0.85rem;
  padding: 0.75rem;
  border: 1px solid #E2E8F0;
  border-radius: 8px;
  background: #fff;
}

.customer-dashboard .product-balance-loan__item span {
  display: block;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--gds-muted);
  margin-bottom: 0.15rem;
}

.customer-dashboard .product-balance-loan__item strong {
  font-size: 0.8125rem;
  font-weight: 650;
  color: #14233C;
}

.customer-dashboard .product-balance-accounts {
  margin-bottom: 0.85rem;
  padding-top: 0.25rem;
}

.customer-dashboard .product-balance-accounts__title {
  margin: 0 0 0.55rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--gds-muted);
}

.customer-dashboard .product-balance-account {
  border: 1px solid #E2E8F0;
  border-radius: 8px;
  padding: 0.7rem 0.75rem;
  margin-bottom: 0.5rem;
  background: #fff;
}

.customer-dashboard .product-balance-account:last-child {
  margin-bottom: 0;
}

.customer-dashboard .product-balance-account__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.55rem;
}

.customer-dashboard .product-balance-account__head strong {
  display: block;
  font-size: 0.8125rem;
  color: #14233C;
}

.customer-dashboard .product-balance-account__head small {
  display: block;
  font-size: 0.7rem;
  color: var(--gds-muted);
}

.customer-dashboard .product-balance-account__vals {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.customer-dashboard .product-balance-account__vals span {
  display: block;
  font-size: 0.68rem;
  color: var(--gds-muted);
}

.customer-dashboard .product-balance-account__vals strong {
  font-size: 0.875rem;
  color: #14233C;
}

.customer-dashboard .product-balance-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  padding-top: 0.15rem;
}

.customer-dashboard .product-balance-actions .btn {
  flex: 1 1 auto;
  min-width: 7.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  border-radius: 6px;
  font-weight: 600;
}

@media (max-width: 767.98px) {
  .customer-dashboard .product-balance-metrics--triple {
    grid-template-columns: 1fr;
  }

  .customer-dashboard .product-balance-loan {
    grid-template-columns: 1fr;
  }

  .customer-dashboard .product-balance-panel__meta {
    flex-direction: column;
    align-items: stretch;
  }

  .customer-dashboard .product-balance-panel__badges {
    justify-content: flex-start;
  }

  .customer-dashboard .product-switcher {
    width: 100%;
  }

  .customer-dashboard .product-tab {
    flex: 1 1 auto;
    justify-content: center;
  }
}

.customer-dashboard .mb-4 {
  margin-bottom: 1rem !important;
}

.customer-dashboard .mb-3 {
  margin-bottom: 0.75rem !important;
}

.customer-dashboard .alert {
  border-radius: 6px;
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
}

@media (max-width: 767.98px) {
  .customer-dashboard .dashboard-welcome {
    flex-direction: column;
    align-items: stretch;
  }

  .customer-dashboard .welcome-actions {
    justify-content: stretch;
  }

  .customer-dashboard .welcome-actions .btn {
    flex: 1 1 calc(50% - 8px);
    justify-content: center;
    min-height: 40px;
    font-size: 0.78rem;
    padding: 0.45rem 0.5rem;
  }

  .customer-dashboard .account-slide {
    min-width: min(280px, calc(100vw - 72px)) !important;
  }

  .customer-dashboard .account-card {
    height: 156px !important;
    padding: 0.9rem !important;
  }

  .customer-dashboard .balance-amount {
    font-size: 1.3rem !important;
  }

  .customer-dashboard .custom--card > .card-header {
    padding: 10px 12px;
    flex-wrap: wrap;
  }

  .customer-dashboard .transaction-toggle {
    width: 100%;
    margin-top: 6px;
  }

  .customer-dashboard .transaction-toggle .btn {
    flex: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .customer-dashboard .account-card,
  .customer-dashboard .custom--card,
  .customer-dashboard .d-widget,
  .customer-dashboard .copybtn,
  .customer-dashboard .account-slider {
    transition: none !important;
  }
}

/* ---- Retail / Commercial product hubs ---- */

/* ---- More menu (grouped dropdown) ---- */

body:has(.customer-portal) .header .main-menu li.customer-more-menu > .sub-menu {
  width: 260px;
  padding: 0.5rem 0 0.65rem;
  border: 1px solid #E2E8F0;
  border-radius: 10px;
  box-shadow: 0 12px 28px rgb(15 23 41 / 0.14);
}

body:has(.customer-portal) .header .main-menu li.customer-more-menu .more-menu__label {
  border-bottom: none;
  padding: 0.65rem 1.1rem 0.2rem;
  pointer-events: none;
}

body:has(.customer-portal) .header .main-menu li.customer-more-menu .more-menu__label span {
  display: block;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #94A3B8;
}

body:has(.customer-portal) .header .main-menu li.customer-more-menu .sub-menu li a {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.45rem 1.1rem;
  font-size: 0.8125rem;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
  color: #0F1729 !important;
  border-radius: 0;
}

body:has(.customer-portal) .header .main-menu li.customer-more-menu .sub-menu li a i {
  font-size: 1rem;
  color: #64748B;
  width: 1.1rem;
  text-align: center;
}

body:has(.customer-portal) .header .main-menu li.customer-more-menu .sub-menu li a:hover,
body:has(.customer-portal) .header .main-menu li.customer-more-menu .sub-menu li a.active {
  background: rgb(47 60 126 / 0.06) !important;
  color: #2F3C7E !important;
}

body:has(.customer-portal) .header .main-menu li.customer-more-menu .sub-menu li a:hover i,
body:has(.customer-portal) .header .main-menu li.customer-more-menu .sub-menu li a.active i {
  color: #E84351;
}

body:has(.customer-portal) .header .main-menu li.customer-more-menu.active > a {
  color: #fff !important;
  background: var(--gds-accent, #E84351) !important;
}

@media (max-width: 1199px) {
  body:has(.customer-portal) .header .main-menu li.customer-more-menu > .sub-menu {
    width: 100%;
    background: #fff;
    border: 1px solid #e2e8f0;
    box-shadow: none;
  }

  body:has(.customer-portal) .header .main-menu li.customer-more-menu .more-menu__label span {
    color: #94a3b8;
  }

  body:has(.customer-portal) .header .main-menu li.customer-more-menu .sub-menu li a {
    color: #14233c !important;
  }

  body:has(.customer-portal) .header .main-menu li.customer-more-menu .sub-menu li a i {
    color: #64748b;
  }
}

/* ---- Retail / Commercial product comparison ---- */

body:has(.customer-portal) .customer-products {
  --gds-primary: #2F3C7E;
  --gds-accent: #E84351;
  padding-top: 0.25rem;
  padding-bottom: 1.5rem;
}

body:has(.customer-portal) .product-compare-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(220px, 0.8fr);
  gap: 1.25rem;
  align-items: end;
  margin-bottom: 1.5rem;
  padding: 1.25rem 1.35rem;
  background: linear-gradient(135deg, #14233C 0%, #2F3C7E 70%, #3a4a96 100%);
  border-radius: 12px;
  color: #fff;
}

body:has(.customer-portal) .product-compare-hero__eyebrow {
  margin: 0 0 0.35rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgb(255 255 255 / 0.65);
}

body:has(.customer-portal) .product-compare-hero__title {
  margin: 0 0 0.45rem;
  font-size: clamp(1.35rem, 2.2vw, 1.75rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #fff;
}

body:has(.customer-portal) .product-compare-hero__text {
  margin: 0;
  max-width: 36rem;
  font-size: 0.9rem;
  line-height: 1.55;
  color: rgb(255 255 255 / 0.78);
}

body:has(.customer-portal) .product-compare-hero__points {
  list-style: none;
  margin: 0;
  padding: 0.85rem 1rem;
  background: rgb(255 255 255 / 0.08);
  border: 1px solid rgb(255 255 255 / 0.12);
  border-radius: 10px;
}

body:has(.customer-portal) .product-compare-hero__points li {
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
  font-size: 0.8rem;
  color: rgb(255 255 255 / 0.9);
  margin-bottom: 0.45rem;
}

body:has(.customer-portal) .product-compare-hero__points li:last-child {
  margin-bottom: 0;
}

body:has(.customer-portal) .product-compare-hero__points i {
  color: #E84351;
  margin-top: 0.1rem;
}

body:has(.customer-portal) .product-compare-grid .row {
  --bs-gutter-y: 1.25rem;
}

body:has(.customer-portal) .product-compare-card {
  height: 100%;
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid #E2E8F0;
  border-radius: 12px;
  box-shadow: 0 1px 2px rgb(15 23 41 / 0.05);
  overflow: hidden;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

body:has(.customer-portal) .product-compare-card:hover {
  border-color: rgb(47 60 126 / 0.35);
  box-shadow: 0 10px 28px rgb(15 23 41 / 0.1);
  transform: translateY(-2px);
}

body:has(.customer-portal) .product-compare-card__top {
  padding: 1.15rem 1.15rem 0.85rem;
  background: linear-gradient(180deg, #F8FAFC 0%, #fff 100%);
  border-bottom: 1px solid #F1F5F9;
  position: relative;
}

body:has(.customer-portal) .product-compare-card__badge {
  position: absolute;
  top: 0.85rem;
  right: 0.85rem;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #fff;
  background: #E84351;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
}

body:has(.customer-portal) .product-compare-card__icon {
  width: 2.4rem;
  height: 2.4rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: rgb(47 60 126 / 0.1);
  color: #2F3C7E;
  font-size: 1.25rem;
  margin-bottom: 0.7rem;
}

body:has(.customer-portal) .product-compare-card__title {
  margin: 0 0 0.35rem;
  font-size: 1.1rem;
  font-weight: 700;
  color: #14233C;
  letter-spacing: -0.01em;
}

body:has(.customer-portal) .product-compare-card__summary {
  margin: 0;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: #64748B;
}

body:has(.customer-portal) .product-compare-card__meta {
  margin: 0.55rem 0 0;
  font-size: 0.75rem;
  font-weight: 600;
  color: #2F3C7E;
}

body:has(.customer-portal) .product-compare-card__variants {
  padding: 0.75rem 1rem 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

body:has(.customer-portal) .customer-products .toggle-label {
  border-radius: 6px;
  border: 1px solid #E2E8F0;
  padding: 0.35rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 550;
  color: #0F1729;
  background: #F8FAFC;
  margin: 0;
  cursor: pointer;
}

body:has(.customer-portal) .customer-products .toggle-input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

body:has(.customer-portal) .customer-products .toggle-input:checked + .toggle-label {
  background: #2F3C7E !important;
  border-color: #2F3C7E !important;
  color: #fff !important;
}

body:has(.customer-portal) .product-compare-card__body,
body:has(.customer-portal) .customer-products .plan-card__body {
  margin-top: 0 !important;
  padding: 0.75rem 1.15rem 0.35rem;
  flex: 1 1 auto;
  text-align: left !important;
}

body:has(.customer-portal) .customer-products .plan-feature-list {
  margin: 0;
  padding: 0 !important;
  list-style: none;
}

body:has(.customer-portal) .customer-products .plan-feature-list li {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.35rem 0.75rem;
  width: 100%;
  position: relative;
  padding: 0.65rem 0 !important;
  padding-left: 0 !important;
  margin-top: 0 !important;
  border-bottom: 1px solid #F1F5F9;
  font-size: 0.8125rem;
  color: #0F1729;
  font-weight: 600;
}

body:has(.customer-portal) .customer-products .plan-feature-list li::before {
  content: none !important;
}

body:has(.customer-portal) .customer-products .plan-feature-list li span:first-child {
  color: #64748B;
  font-weight: 500;
}

body:has(.customer-portal) .product-compare-card__cta {
  padding: 0.85rem 1.15rem 1.15rem;
  margin-top: auto;
  border-top: 1px solid #F1F5F9;
  background: #FCFDFE;
}

body:has(.customer-portal) .product-compare-card__btn {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  background: #E84351 !important;
  border: 1px solid #E84351 !important;
  color: #fff !important;
  border-radius: 8px;
  font-weight: 650;
  font-size: 0.875rem;
  padding: 0.7rem 1rem;
  transition: background 0.15s ease, transform 0.15s ease;
}

body:has(.customer-portal) .product-compare-card__btn:hover,
body:has(.customer-portal) .product-compare-card__btn:focus {
  background: #d63a47 !important;
  border-color: #d63a47 !important;
  color: #fff !important;
  transform: translateY(-1px);
}

body:has(.customer-portal) .product-compare-card__cta-note {
  margin: 0.45rem 0 0;
  text-align: center;
  font-size: 0.7rem;
  color: #94A3B8;
}

@media (max-width: 991px) {
  body:has(.customer-portal) .product-compare-hero {
    grid-template-columns: 1fr;
  }
}

/* ---- Product compare matrix ---- */
body:has(.customer-portal) .product-matrix {
  --pm-border: #e2e8f0;
  --pm-ink: #14233c;
  --pm-muted: #64748b;
  padding-bottom: 1.5rem;
}

body:has(.customer-portal) .product-matrix__toolbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 1rem;
}

body:has(.customer-portal) .product-matrix__toggle {
  display: inline-flex;
  padding: 0.25rem;
  border: 1px solid var(--pm-border);
  border-radius: 999px;
  background: #fff;
  gap: 0.15rem;
}

body:has(.customer-portal) .product-matrix__tab {
  border: 0;
  background: transparent;
  color: var(--pm-muted);
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  padding: 0.5rem 1.1rem;
  border-radius: 999px;
  min-height: 40px;
  cursor: pointer;
}

body:has(.customer-portal) .product-matrix__tab.is-active {
  background: var(--gds-primary, #2f3c7e);
  color: #fff;
}

body:has(.customer-portal) .product-matrix__panel[hidden] {
  display: none !important;
}

body:has(.customer-portal) .product-matrix__scroll {
  /* Horizontal only; page handles vertical scroll (no nested scrollport). */
  overflow-x: auto;
  overflow-y: clip;
  border: 1px solid var(--pm-border);
  border-radius: 12px;
  background: #fff;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
}

body:has(.customer-portal) .product-matrix__table {
  width: 100%;
  min-width: 720px;
  border-collapse: separate;
  border-spacing: 0;
  margin: 0;
}

body:has(.customer-portal) .product-matrix__table th,
body:has(.customer-portal) .product-matrix__table td {
  border-bottom: 1px solid var(--pm-border);
  border-right: 1px solid var(--pm-border);
  padding: 0.75rem 0.9rem;
  vertical-align: middle;
  text-align: center;
  background: #fff;
}

body:has(.customer-portal) .product-matrix__table th:last-child,
body:has(.customer-portal) .product-matrix__table td:last-child {
  border-right: 0;
}

body:has(.customer-portal) .product-matrix__table tbody tr:last-child th,
body:has(.customer-portal) .product-matrix__table tbody tr:last-child td {
  border-bottom: 0;
}

/* Static single-row header — product names only. Apply lives in the first body row. */
body:has(.customer-portal) .product-matrix__table thead th {
  background: #f8fafc;
  padding-top: 0.9rem;
  padding-bottom: 0.9rem;
}

body:has(.customer-portal) .product-matrix__product {
  min-width: 8.5rem;
  max-width: 11rem;
  vertical-align: middle;
}

body:has(.customer-portal) .product-matrix__product-name {
  display: block;
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--pm-ink);
  line-height: 1.3;
  text-align: center;
  text-wrap: balance;
}

body:has(.customer-portal) .product-matrix__actions td {
  padding-top: 0.7rem;
  padding-bottom: 0.7rem;
}

body:has(.customer-portal) .product-matrix__apply {
  min-height: 30px !important;
  padding: 0.3rem 0.85rem !important;
  font-size: 0.78rem !important;
  font-weight: 600 !important;
  border-radius: 6px !important;
  box-shadow: none !important;
  transform: none !important;
}

body:has(.customer-portal) .product-matrix__apply:hover {
  transform: none !important;
  box-shadow: none !important;
}

body:has(.customer-portal) .product-matrix__apply:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* Sticky first column only (helps when table is wider than viewport). */
body:has(.customer-portal) .product-matrix__corner,
body:has(.customer-portal) .product-matrix__table tbody th {
  position: sticky;
  left: 0;
  z-index: 2;
  text-align: left;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--pm-ink);
  background: #f8fafc;
  min-width: 11rem;
  box-shadow: 1px 0 0 var(--pm-border);
}

body:has(.customer-portal) .product-matrix__corner {
  z-index: 3;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--pm-muted);
  vertical-align: middle;
}

body:has(.customer-portal) .product-matrix__table td.is-yes {
  color: #15803d;
  font-weight: 600;
}

body:has(.customer-portal) .product-matrix__table td.is-value {
  color: var(--pm-ink);
  font-weight: 600;
  font-size: 0.875rem;
  line-height: 1.35;
}

body:has(.customer-portal) .product-matrix__table td.is-no {
  color: #cbd5e1;
  font-weight: 500;
}

body:has(.customer-portal) .product-matrix__empty {
  padding: 2.5rem 1.25rem;
  text-align: center;
  color: var(--pm-muted);
  border: 1px dashed var(--pm-border);
  border-radius: 12px;
  background: #fff;
}

body:has(.customer-portal) .visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 767px) {
  body:has(.customer-portal) .product-matrix__toolbar {
    justify-content: stretch;
  }

  body:has(.customer-portal) .product-matrix__toggle {
    width: 100%;
  }

  body:has(.customer-portal) .product-matrix__tab {
    flex: 1 1 0;
  }
}

/* ---- Policy / agreement documents ---- */

body:has(.customer-portal) .customer-policy-doc,
.customer-policy-shell .customer-policy-doc {
  background: #fff;
  border: 1px solid #E2E8F0;
  border-radius: 10px;
  box-shadow: 0 1px 2px rgb(15 23 41 / 0.06);
  padding: 1.5rem 1.75rem 2rem;
  max-width: 860px;
  margin: 0 auto;
}

body:has(.customer-portal) .customer-policy-doc__title,
.customer-policy-shell .customer-policy-doc__title {
  margin: 0 0 1rem;
  color: #14233C;
  font-size: 1.5rem;
  font-weight: 650;
  letter-spacing: -0.02em;
}

body:has(.customer-portal) .customer-policy-doc__body,
.customer-policy-shell .customer-policy-doc__body {
  color: #334155;
  font-size: 0.95rem;
  line-height: 1.7;
}

body:has(.customer-portal) .customer-policy-doc__body h1,
body:has(.customer-portal) .customer-policy-doc__body h2,
body:has(.customer-portal) .customer-policy-doc__body h3,
.customer-policy-shell .customer-policy-doc__body h1,
.customer-policy-shell .customer-policy-doc__body h2,
.customer-policy-shell .customer-policy-doc__body h3 {
  color: #14233C;
  margin-top: 1.25rem;
  margin-bottom: 0.5rem;
}

body:has(.customer-portal) .customer-policy-doc__body p,
.customer-policy-shell .customer-policy-doc__body p {
  margin-bottom: 0.85rem;
}

.customer-policy-shell {
  background: #F8FAFC;
  min-height: 50vh;
}

/* ---- Support tickets ---- */

body:has(.customer-portal) .customer-support {
  padding-bottom: 1.25rem;
}

body:has(.customer-portal) .customer-support__toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

body:has(.customer-portal) .customer-support__intro {
  margin: 0;
  max-width: 36rem;
  font-size: 0.875rem;
  color: #64748B;
}

body:has(.customer-portal) .customer-support__panel {
  background: #fff;
  border: 1px solid #E2E8F0;
  border-radius: 12px;
  box-shadow: 0 1px 2px rgb(15 23 41 / 0.05);
  overflow: hidden;
}

body:has(.customer-portal) .customer-support__panel .card-body,
body:has(.customer-portal) .customer-support__panel .card-header,
body:has(.customer-portal) .customer-support__panel .card-footer {
  border-color: #F1F5F9;
}

body:has(.customer-portal) .customer-support__table {
  margin: 0;
}

body:has(.customer-portal) .customer-support__table thead th {
  background: #F8FAFC;
  color: #475569;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-bottom: 1px solid #E2E8F0;
  padding: 0.75rem 1rem;
  white-space: nowrap;
}

body:has(.customer-portal) .customer-support__table tbody td {
  padding: 0.85rem 1rem;
  vertical-align: middle;
  font-size: 0.875rem;
  border-color: #F1F5F9;
  color: #0F1729;
}

body:has(.customer-portal) .customer-support__subject {
  display: block;
  color: #14233C !important;
  font-weight: 650;
  text-decoration: none;
}

body:has(.customer-portal) .customer-support__subject:hover {
  color: #2F3C7E !important;
}

body:has(.customer-portal) .customer-support__ticket-id {
  display: block;
  font-size: 0.75rem;
  font-weight: 500;
  color: #94A3B8;
  margin-top: 0.15rem;
}

body:has(.customer-portal) .customer-support__empty {
  text-align: center;
  padding: 2.5rem 1rem;
  color: #64748B;
}

body:has(.customer-portal) .customer-support__form-title {
  margin: 0 0 0.35rem;
  font-size: 1.15rem;
  font-weight: 700;
  color: #14233C;
}

body:has(.customer-portal) .customer-support__form-help {
  margin: 0 0 1.15rem;
  font-size: 0.85rem;
  color: #64748B;
}

body:has(.customer-portal) .customer-support .form--control {
  border-radius: 8px;
  border-color: #E2E8F0;
}

body:has(.customer-portal) .customer-support .btn--base,
body:has(.customer-portal) .customer-support .btn-outline--base {
  border-radius: 8px;
  font-weight: 600;
}

body:has(.customer-portal) .customer-support-thread__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem 1.15rem;
  background: #14233C;
  color: #fff;
}

body:has(.customer-portal) .customer-support-thread__title {
  margin: 0.35rem 0 0;
  font-size: 1rem;
  font-weight: 650;
  color: #fff;
}

body:has(.customer-portal) .customer-support-thread__id {
  font-size: 0.75rem;
  color: rgb(255 255 255 / 0.65);
}

body:has(.customer-portal) .customer-support-msg {
  display: grid;
  grid-template-columns: minmax(120px, 160px) 1fr;
  gap: 1rem;
  padding: 1rem 1.15rem;
  border: 1px solid #E2E8F0;
  border-radius: 10px;
  margin-bottom: 0.85rem;
  background: #fff;
}

body:has(.customer-portal) .customer-support-msg--staff {
  background: #FFF8EB;
  border-color: #F6E2B3;
}

body:has(.customer-portal) .customer-support-msg__aside {
  text-align: left;
}

body:has(.customer-portal) .customer-support-msg__name {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 650;
  color: #14233C;
}

body:has(.customer-portal) .customer-support-msg__role {
  margin: 0.2rem 0 0;
  font-size: 0.75rem;
  color: #64748B;
}

body:has(.customer-portal) .customer-support-msg__time {
  margin: 0 0 0.55rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: #94A3B8;
}

body:has(.customer-portal) .customer-support-msg__body {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.55;
  color: #334155;
  white-space: pre-wrap;
}

body:has(.customer-portal) .customer-support-msg__files a {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin-right: 0.75rem;
  margin-top: 0.5rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: #2F3C7E;
}

@media (max-width: 767px) {
  body:has(.customer-portal) .customer-support-msg {
    grid-template-columns: 1fr;
    gap: 0.35rem;
  }
}

/* ---- Loan installment logs ---- */

body:has(.customer-portal) .customer-loan-logs {
  padding-bottom: 1.25rem;
}

body:has(.customer-portal) .customer-loan-logs__toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  padding: 1.1rem 1.2rem;
  background: linear-gradient(135deg, #14233C 0%, #2F3C7E 72%, #3a4a96 100%);
  border-radius: 12px;
  color: #fff;
}

body:has(.customer-portal) .customer-loan-logs__badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.45rem;
}

/* Status badges sit on the navy toolbar — force light, readable pills */
body:has(.customer-portal) .customer-loan-logs__toolbar .badge,
body:has(.customer-portal) .customer-loan-logs__badges .badge {
  border: 1px solid rgb(255 255 255 / 0.28) !important;
  background: rgb(255 255 255 / 0.16) !important;
  color: #fff !important;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  font-size: 0.68rem;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
}

body:has(.customer-portal) .customer-loan-logs__toolbar .badge--warning,
body:has(.customer-portal) .customer-loan-logs__badges .badge--warning {
  background: rgb(245 158 11 / 0.28) !important;
  border-color: rgb(251 191 36 / 0.55) !important;
  color: #FEF3C7 !important;
}

body:has(.customer-portal) .customer-loan-logs__toolbar .badge--success,
body:has(.customer-portal) .customer-loan-logs__badges .badge--success {
  background: rgb(34 197 94 / 0.28) !important;
  border-color: rgb(74 222 128 / 0.55) !important;
  color: #DCFCE7 !important;
}

body:has(.customer-portal) .customer-loan-logs__toolbar .badge--danger,
body:has(.customer-portal) .customer-loan-logs__badges .badge--danger {
  background: rgb(239 68 68 / 0.28) !important;
  border-color: rgb(248 113 113 / 0.55) !important;
  color: #FEE2E2 !important;
}

body:has(.customer-portal) .customer-loan-logs__toolbar .badge--dark,
body:has(.customer-portal) .customer-loan-logs__badges .badge--dark,
body:has(.customer-portal) .customer-loan-logs__toolbar .badge--secondary,
body:has(.customer-portal) .customer-loan-logs__badges .badge--secondary {
  background: rgb(255 255 255 / 0.18) !important;
  border-color: rgb(255 255 255 / 0.35) !important;
  color: #fff !important;
}

body:has(.customer-portal) .customer-loan-logs__chip {
  display: inline-flex;
  align-items: center;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #fff;
  background: rgb(255 255 255 / 0.14);
  border-radius: 999px;
  padding: 0.2rem 0.55rem;
}

body:has(.customer-portal) .customer-loan-logs__title {
  margin: 0 0 0.25rem;
  font-size: clamp(1.2rem, 2vw, 1.5rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #fff;
}

body:has(.customer-portal) .customer-loan-logs__meta {
  font-size: 0.8rem;
  color: rgb(255 255 255 / 0.72);
}

body:has(.customer-portal) .customer-loan-logs__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

body:has(.customer-portal) .customer-loan-logs__actions .btn-outline--base {
  background: transparent !important;
  border-color: rgb(255 255 255 / 0.35) !important;
  color: #fff !important;
}

body:has(.customer-portal) .customer-loan-logs__actions .btn-outline--base:hover {
  background: rgb(255 255 255 / 0.1) !important;
  color: #fff !important;
}

body:has(.customer-portal) .customer-loan-logs__metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

body:has(.customer-portal) .customer-loan-metric {
  background: #fff;
  border: 1px solid #E2E8F0;
  border-radius: 10px;
  padding: 0.85rem 0.95rem;
  box-shadow: 0 1px 2px rgb(15 23 41 / 0.04);
}

body:has(.customer-portal) .customer-loan-metric__label {
  display: block;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #64748B;
  margin-bottom: 0.25rem;
}

body:has(.customer-portal) .customer-loan-metric__value {
  display: block;
  font-size: 1.1rem;
  font-weight: 700;
  color: #14233C;
  letter-spacing: -0.01em;
  margin-bottom: 0.2rem;
}

body:has(.customer-portal) .customer-loan-metric__value--ok {
  color: #157F4B;
}

body:has(.customer-portal) .customer-loan-metric__value--warn {
  color: #C0362C;
}

body:has(.customer-portal) .customer-loan-metric small {
  font-size: 0.72rem;
  color: #94A3B8;
}

body:has(.customer-portal) .customer-loan-logs__progress {
  background: #fff;
  border: 1px solid #E2E8F0;
  border-radius: 10px;
  padding: 0.85rem 1rem;
  margin-bottom: 1rem;
}

body:has(.customer-portal) .customer-loan-logs__progress-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.45rem;
  font-size: 0.8125rem;
  color: #475569;
}

body:has(.customer-portal) .customer-loan-logs__progress-head strong {
  color: #14233C;
}

body:has(.customer-portal) .customer-loan-logs__progress .progress {
  height: 8px;
  background: #E2E8F0;
  border-radius: 999px;
  overflow: hidden;
}

body:has(.customer-portal) .customer-loan-logs__progress .progress-bar {
  background: linear-gradient(90deg, #2F3C7E, #E84351);
}

body:has(.customer-portal) .customer-loan-logs__progress-foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.35rem;
  margin-top: 0.45rem;
  font-size: 0.72rem;
  color: #94A3B8;
}

body:has(.customer-portal) .customer-loan-logs__delay-note {
  color: #C0362C;
  font-weight: 600;
}

body:has(.customer-portal) .customer-loan-logs__aside {
  background: #fff;
  border: 1px solid #E2E8F0;
  border-radius: 12px;
  padding: 1rem 1.1rem;
  height: 100%;
  box-shadow: 0 1px 2px rgb(15 23 41 / 0.04);
}

body:has(.customer-portal) .customer-loan-logs__aside-title {
  margin: 0 0 0.85rem;
  font-size: 0.9rem;
  font-weight: 700;
  color: #14233C;
}

body:has(.customer-portal) .customer-loan-facts {
  margin: 0;
}

body:has(.customer-portal) .customer-loan-facts > div {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.75rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid #F1F5F9;
}

body:has(.customer-portal) .customer-loan-facts > div:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

body:has(.customer-portal) .customer-loan-facts dt {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 600;
  color: #64748B;
}

body:has(.customer-portal) .customer-loan-facts dd {
  margin: 0;
  text-align: right;
  font-size: 0.8125rem;
  font-weight: 650;
  color: #14233C;
}

body:has(.customer-portal) .customer-loan-facts--grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  padding: 0.35rem 1.1rem 1rem;
}

body:has(.customer-portal) .customer-loan-facts--grid > div {
  padding: 0.7rem 0.35rem;
  border-bottom: 1px solid #F1F5F9;
}

@media (max-width: 767.98px) {
  body:has(.customer-portal) .customer-loan-facts--grid {
    grid-template-columns: 1fr;
  }
}

body:has(.customer-portal) .customer-loan-schedule {
  background: #fff;
  border: 1px solid #E2E8F0;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgb(15 23 41 / 0.04);
  height: 100%;
}

body:has(.customer-portal) .customer-loan-schedule__header {
  padding: 0.95rem 1.1rem;
  border-bottom: 1px solid #F1F5F9;
  background: #F8FAFC;
}

body:has(.customer-portal) .customer-loan-schedule__title {
  margin: 0 0 0.2rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: #14233C;
}

body:has(.customer-portal) .customer-loan-schedule__help {
  font-size: 0.78rem;
  color: #64748B;
}

body:has(.customer-portal) .customer-loan-schedule__table thead th {
  background: #F8FAFC;
  color: #475569;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border-bottom: 1px solid #E2E8F0;
  padding: 0.7rem 0.75rem;
  white-space: nowrap;
}

body:has(.customer-portal) .customer-loan-schedule__table tbody td {
  padding: 0.75rem;
  vertical-align: middle;
  font-size: 0.8125rem;
  color: #0F1729;
  border-color: #F1F5F9;
}

body:has(.customer-portal) .customer-loan-schedule__table tbody tr.is-paid {
  background: rgb(21 127 75 / 0.03);
}

body:has(.customer-portal) .customer-loan-schedule__table tbody tr.is-overdue {
  background: rgb(192 54 44 / 0.04);
}

body:has(.customer-portal) .customer-loan-schedule__type {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.02em;
  color: #2F3C7E;
  background: #EEF2FF;
  border-radius: 6px;
  padding: 0.2rem 0.45rem;
}

body:has(.customer-portal) .customer-loan-list__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  justify-content: flex-end;
}

body:has(.customer-portal) .customer-loan-list__actions .btn {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  white-space: nowrap;
  min-height: 32px;
  height: 32px;
  padding: 0.3rem 0.65rem;
  font-size: 0.75rem;
  line-height: 1.2;
}

/* Portal list tables: skin forces white thead labels meant for dark bands */
body:has(.customer-portal) .custom--card .custom--table thead th,
body:has(.customer-portal) .customer-loan-schedule .custom--table thead th {
  color: #475569 !important;
  background: #F8FAFC !important;
  box-shadow: none;
}

body:has(.customer-portal) .customer-loan-schedule__empty {
  text-align: center;
  padding: 2rem 1rem !important;
  color: #64748B;
}

body:has(.customer-portal) .customer-loan-schedule__footer {
  padding: 0.75rem 1rem;
  border-top: 1px solid #F1F5F9;
}

body:has(.customer-portal) .customer-trx__desc {
  display: inline-block;
  max-width: 22rem;
  font-size: 0.8125rem;
  color: #334155;
  line-height: 1.35;
}

body:has(.customer-portal) .customer-trx__ref {
  display: inline-block;
  max-width: 10rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: bottom;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.72rem;
}

@media (max-width: 991.98px) {
  body:has(.customer-portal) .customer-loan-logs__metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body:has(.customer-portal) .customer-trx__desc {
    max-width: 14rem;
  }
}

@media (max-width: 575.98px) {
  body:has(.customer-portal) .customer-loan-logs__metrics {
    grid-template-columns: 1fr;
  }

  body:has(.customer-portal) .customer-loan-logs__toolbar {
    padding: 1rem;
  }

  body:has(.customer-portal) .customer-loan-logs__actions {
    width: 100%;
  }

  body:has(.customer-portal) .customer-loan-logs__actions .btn {
    flex: 1 1 auto;
  }
}
