:root {
  --portal-bg: #f5f7fb;
  --portal-surface: #ffffff;
  --portal-surface-soft: #f8fafc;
  --portal-border: #d9e1ec;
  --portal-text: #142033;
  --portal-muted: #65758b;
  --portal-primary: #155eef;
  --portal-primary-dark: #124bc0;
  --portal-success: #0b8f55;
  --portal-warning: #d17b00;
  --portal-danger: #bf1b3d;
  --portal-shadow: 0 18px 40px rgba(20, 32, 51, 0.08);
  --portal-radius-xl: 28px;
  --portal-radius-lg: 20px;
  --portal-radius-md: 16px;
}

body.portal-body {
  min-height: 100vh;
  background: linear-gradient(180deg, #ffffff 0%, var(--portal-bg) 100%);
  color: var(--portal-text);
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  position: relative;
}

.portal-body-auth {
  display: flex;
  flex-direction: column;
}

.page-backdrop {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at top right, rgba(21, 94, 239, 0.08), transparent 30%),
    radial-gradient(circle at top left, rgba(11, 143, 85, 0.05), transparent 24%);
  pointer-events: none;
  z-index: -1;
}

.portal-nav {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(217, 225, 236, 0.9);
}

.portal-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
  color: var(--portal-text);
  text-decoration: none;
}

.portal-brand:hover {
  color: var(--portal-text);
}

.portal-brand-mark {
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #155eef, #69a0ff);
  color: #ffffff;
  font-weight: 700;
}

.portal-brand small {
  display: block;
  color: var(--portal-muted);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.nav-link {
  color: var(--portal-muted);
  font-weight: 600;
  border-radius: 999px;
  padding: 0.6rem 1rem !important;
}

.nav-link.active,
.nav-link:hover {
  color: var(--portal-primary);
  background: rgba(21, 94, 239, 0.08);
}

.portal-nav-user {
  color: var(--portal-muted);
  font-size: 0.9rem;
  font-weight: 700;
  padding: 0.5rem 0.25rem;
}

.portal-nav-logout {
  margin-bottom: 0;
}

.hero-card,
.surface-card {
  background: var(--portal-surface);
  border: 1px solid rgba(217, 225, 236, 0.95);
  border-radius: var(--portal-radius-xl);
  box-shadow: var(--portal-shadow);
}

.hero-card {
  padding: 2rem;
}

.surface-card {
  padding: 1.6rem;
}

.compact-card {
  padding: 1.2rem;
}

.portal-main-auth {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-shell {
  width: 100%;
  display: flex;
  justify-content: center;
}

.auth-card {
  width: min(100%, 28rem);
}

.eyebrow {
  display: inline-block;
  color: var(--portal-primary);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.hero-title,
.section-heading h2 {
  font-weight: 700;
  letter-spacing: -0.03em;
}

.hero-title {
  font-size: clamp(2rem, 3vw, 3rem);
}

.hero-copy,
.stat-note,
.pill-note,
.status-panel,
.form-label,
.table,
.portal-alert {
  color: var(--portal-muted);
}

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.portal-input,
.portal-status-input {
  min-height: 3rem;
  border-radius: var(--portal-radius-md);
  border: 1px solid var(--portal-border);
  background: var(--portal-surface-soft);
}

.portal-input:focus {
  border-color: rgba(21, 94, 239, 0.45);
  box-shadow: 0 0 0 0.25rem rgba(21, 94, 239, 0.12);
  background: #ffffff;
}

.portal-textarea {
  min-height: 20rem;
}

.portal-button,
.portal-button-secondary {
  border-radius: 999px;
  min-height: 3rem;
  font-weight: 700;
  padding: 0.7rem 1.3rem;
}

.portal-button {
  background: var(--portal-primary);
  border: none;
  color: #ffffff;
}

.portal-button:hover,
.portal-button:focus {
  background: var(--portal-primary-dark);
  color: #ffffff;
}

.portal-button:disabled {
  opacity: 0.5;
}

.portal-button-secondary {
  background: rgba(21, 94, 239, 0.08);
  border: 1px solid rgba(21, 94, 239, 0.16);
  color: var(--portal-primary);
}

.portal-button-secondary:hover,
.portal-button-secondary:focus {
  background: rgba(21, 94, 239, 0.14);
  color: var(--portal-primary);
}

.portal-alert {
  border-radius: var(--portal-radius-md);
  border: none;
}

.stat-card {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.stat-label {
  color: var(--portal-muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.78rem;
}

.stat-value {
  font-size: clamp(2rem, 4vw, 2.7rem);
  font-weight: 700;
  color: var(--portal-text);
}

.portal-table thead th {
  color: var(--portal-muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom-color: rgba(217, 225, 236, 0.9);
}

.portal-table td,
.portal-table th {
  padding-top: 1rem;
  padding-bottom: 1rem;
}

.portal-progress {
  height: 0.65rem;
  border-radius: 999px;
  background: rgba(21, 94, 239, 0.1);
}

.portal-progress .progress-bar {
  background: linear-gradient(90deg, #155eef, #69a0ff);
}

.pill-note,
.status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 2.25rem;
  border-radius: 999px;
  padding: 0.4rem 0.9rem;
  background: rgba(20, 32, 51, 0.06);
  color: var(--portal-text);
  font-weight: 700;
}

.status-panel {
  border: 1px dashed rgba(217, 225, 236, 0.95);
  border-radius: var(--portal-radius-md);
  background: var(--portal-surface-soft);
  padding: 1rem;
}

.portal-status-input {
  font-weight: 700;
  color: var(--portal-text);
}

.status-success {
  background: rgba(11, 143, 85, 0.12);
  color: var(--portal-success);
}

.status-warning {
  background: rgba(209, 123, 0, 0.12);
  color: var(--portal-warning);
}

.status-danger {
  background: rgba(191, 27, 61, 0.12);
  color: var(--portal-danger);
}

.status-muted {
  background: rgba(101, 117, 139, 0.14);
  color: var(--portal-muted);
}

.portal-number-input {
  min-width: 8rem;
}

code {
  color: var(--portal-primary-dark);
  background: rgba(21, 94, 239, 0.08);
  padding: 0.2rem 0.45rem;
  border-radius: 0.5rem;
}

@media (max-width: 991px) {
  .hero-card,
  .surface-card {
    padding: 1.25rem;
  }

  .hero-title {
    font-size: 2rem;
  }

  .portal-nav-user {
    padding: 0.5rem 1rem;
  }
}
