/* Customer portal shell — enterprise read-only self-service */

.portal-body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(1200px 480px at 10% -10%, color-mix(in srgb, var(--mf-primary, #1e3a5f) 18%, transparent), transparent 60%),
    linear-gradient(180deg, #f3f6fa 0%, #eef2f7 100%);
  color: #1a2332;
}

.portal-topbar {
  background: linear-gradient(135deg, #13243a 0%, color-mix(in srgb, var(--mf-primary, #1e3a5f) 85%, #0b1624) 100%);
  color: #fff;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06);
}

.portal-topbar-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 1rem 1.25rem 0.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.portal-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.portal-brand-logo {
  height: 40px;
  width: auto;
  max-width: 140px;
  object-fit: contain;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  padding: 0.25rem 0.4rem;
}

.portal-brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  font-size: 1.25rem;
}

.portal-brand-eyebrow {
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.75;
}

.portal-brand-name {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 0;
  line-height: 1.25;
}

.portal-session {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.portal-user {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1.2;
}

.portal-user-name { font-weight: 600; font-size: 0.9rem; }
.portal-user-meta {
  font-size: 0.75rem;
  opacity: 0.75;
  font-variant-numeric: tabular-nums;
}

.portal-logout-form { margin: 0; }
.portal-logout-btn {
  border-color: rgba(255, 255, 255, 0.45);
  color: #fff;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}
.portal-logout-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: #fff;
  color: #fff;
}

.portal-nav {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.12);
}

.portal-nav-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 1.25rem;
  display: flex;
  gap: 0.25rem;
  overflow-x: auto;
}

.portal-nav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.7rem 0.9rem;
  color: rgba(255, 255, 255, 0.78);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 550;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  transition: color 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}

.portal-nav-link:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}

.portal-nav-link.is-active {
  color: #fff;
  border-bottom-color: #fff;
}

.portal-main {
  flex: 1;
  padding: 1.5rem 0 2.5rem;
}

.portal-container {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 1.25rem;
  animation: portal-fade-up 0.35s ease-out;
}

@keyframes portal-fade-up {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.portal-alert { margin-bottom: 1rem; }

.portal-page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.35rem;
}

.portal-page-title {
  font-size: 1.25rem;
  font-weight: 650;
  margin: 0 0 0.25rem;
  color: #1a2332;
}

.portal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.portal-actions--compact {
  justify-content: flex-end;
}

.portal-section { margin-bottom: 1.75rem; }

.portal-section-head { margin-bottom: 0.75rem; }

.portal-section-head--split {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.portal-section-title {
  font-size: 0.95rem;
  font-weight: 650;
  margin: 0 0 0.2rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: #243247;
}

.portal-section-lead {
  margin: 0;
  font-size: 0.85rem;
  color: #5c6b7e;
}

.portal-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.1rem;
  margin-bottom: 0.5rem;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(30, 58, 95, 0.08);
  border-radius: 10px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.portal-row:hover {
  border-color: rgba(30, 58, 95, 0.16);
  box-shadow: 0 4px 14px rgba(19, 36, 58, 0.06);
}

.portal-row-title {
  font-size: 0.95rem;
  font-weight: 600;
  margin: 0 0 0.15rem;
}

.portal-row-meta {
  font-size: 0.78rem;
  color: #6a7a8f;
  font-variant-numeric: tabular-nums;
}

.portal-row-aside {
  text-align: right;
  flex-shrink: 0;
}

.portal-amount {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

.portal-amount--credit { color: #0f7a4a; }

.portal-empty,
.portal-empty-cell {
  padding: 1.25rem;
  text-align: center;
  color: #6a7a8f;
  font-size: 0.875rem;
  background: rgba(255, 255, 255, 0.7);
  border: 1px dashed rgba(30, 58, 95, 0.15);
  border-radius: 10px;
}

.portal-empty-cell {
  background: transparent;
  border: none;
}

.portal-table-wrap {
  overflow-x: auto;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(30, 58, 95, 0.08);
  border-radius: 10px;
}

.portal-table {
  width: 100%;
  margin: 0;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.portal-table th,
.portal-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(30, 58, 95, 0.06);
  vertical-align: middle;
}

.portal-table th {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #5c6b7e;
  font-weight: 650;
  background: rgba(243, 246, 250, 0.9);
}

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

.portal-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.portal-summary > div {
  padding: 0.85rem 1rem;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(30, 58, 95, 0.08);
  border-radius: 10px;
}

.portal-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.75rem;
}

.portal-detail-item {
  padding: 0.95rem 1.05rem;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(30, 58, 95, 0.08);
  border-radius: 10px;
}

.portal-detail-item--wide { grid-column: 1 / -1; }

.portal-detail-value {
  font-size: 0.95rem;
  font-weight: 600;
  color: #1a2332;
  margin-top: 0.2rem;
}

.portal-breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: #5c6b7e;
  margin-bottom: 1rem;
}

.portal-breadcrumb a {
  color: var(--mf-primary, #1e3a5f);
  text-decoration: none;
  font-weight: 550;
  transition: color 0.15s ease;
}

.portal-breadcrumb a:hover { text-decoration: underline; }

.portal-footer {
  padding: 1rem 0 1.5rem;
  font-size: 0.78rem;
  color: #6a7a8f;
}

.portal-footer a { color: inherit; }

.auth-eyebrow {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #6a7a8f;
  font-weight: 650;
}

/* Login polish */
.portal-login-card {
  overflow: hidden;
  animation: portal-fade-up 0.4s ease-out;
}

.portal-login-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding: 0.75rem 1.25rem;
  border-bottom: 1px solid rgba(30, 58, 95, 0.08);
  background: linear-gradient(180deg, rgba(243, 246, 250, 0.95), rgba(255, 255, 255, 0.6));
}

.portal-login-nav-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: #3d4f66;
  letter-spacing: 0.01em;
}

.portal-login-nav-links {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.portal-login-nav-link {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--mf-primary, #1e3a5f);
  text-decoration: none;
  padding: 0.2rem 0;
  border-bottom: 1px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
}

.portal-login-nav-link:hover {
  border-bottom-color: currentColor;
  opacity: 0.85;
}

.portal-login-nav-hint {
  font-size: 0.78rem;
  color: #6a7a8f;
}

.portal-login-form .form-control {
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.portal-login-form .auth-submit {
  transition: transform 0.15s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.portal-login-form .auth-submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(30, 58, 95, 0.18);
}

.portal-login-form .auth-submit:active {
  transform: translateY(0);
}

@media (max-width: 576px) {
  .portal-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .portal-row-aside {
    text-align: left;
    width: 100%;
  }

  .portal-actions--compact {
    justify-content: flex-start;
  }

  .portal-user { align-items: flex-start; }

  .portal-session {
    width: 100%;
    justify-content: space-between;
  }
}
