/* Nabestaandenportaal — shell + content aligned with login design */

.portal-body {
  --radius: 0.625rem;
  --background: #faf8f2;
  --foreground: #1f3333;
  --card: #ffffff;
  --primary: #1f6b6b;
  --primary-foreground: #faf8f2;
  --muted-foreground: #6a7a7a;
  --accent: #f3ead8;
  --border: #ddd4c4;
  --input: #ddd4c4;
  --ring: #1f6b6b;
  --font-sans: 'Inter', system-ui, sans-serif;
  --font-display: 'Fraunces', 'Lora', Georgia, serif;

  margin: 0;
  min-height: 100vh;
  background: var(--background);
  color: var(--foreground);
  font-family: var(--font-sans);
}

.portal-body *,
.portal-body *::before,
.portal-body *::after {
  box-sizing: border-box;
}

.portal-shell {
  display: flex;
  min-height: 100vh;
  width: 100%;
}

.portal-sidebar {
  display: none;
  width: 16.5rem;
  flex-shrink: 0;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  background: var(--primary);
  color: var(--primary-foreground);
  padding: 1.75rem 1.25rem 1.5rem;
}

@media (min-width: 768px) {
  .portal-sidebar {
    display: flex;
  }
}

.portal-sidebar-dots {
  pointer-events: none;
  position: absolute;
  inset: 0;
  opacity: 0.1;
  background-image: radial-gradient(circle at 1px 1px, rgba(255, 255, 255, 0.9) 1px, transparent 0);
  background-size: 22px 22px;
}

.portal-sidebar-brand {
  position: relative;
  display: block;
  width: fit-content;
  margin: 0.25rem 0.5rem 2.5rem;
}

.portal-sidebar-brand img {
  display: block;
  height: 1.4rem;
  width: auto;
}

.portal-sidebar-nav {
  position: relative;
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex: 1;
}

.portal-sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 0.85rem;
  border-radius: calc(var(--radius) + 2px);
  color: rgba(250, 248, 242, 0.78) !important;
  text-decoration: none !important;
  font-size: 0.9375rem;
  font-weight: 500;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.portal-sidebar-link i {
  width: 1.1rem;
  text-align: center;
  opacity: 0.85;
  font-size: 0.9rem;
}

.portal-sidebar-link:hover {
  background: rgba(250, 248, 242, 0.1);
  color: var(--primary-foreground) !important;
}

.portal-sidebar-link.is-active {
  background: rgba(250, 248, 242, 0.16);
  color: var(--primary-foreground) !important;
}

.portal-sidebar-foot {
  position: relative;
  margin-top: auto;
  padding: 1rem 0.5rem 0;
  font-size: 0.7rem;
  line-height: 1.4;
  color: rgba(250, 248, 242, 0.55);
}

.portal-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--background);
}

.portal-topbar {
  height: auto;
  min-height: 4.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1.25rem;
  background: rgba(250, 248, 242, 0.85);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 30;
}

@media (min-width: 1024px) {
  .portal-topbar {
    padding: 0.85rem 2rem;
  }
}

.portal-topbar-brand {
  display: block;
}

.portal-topbar-brand img {
  display: block;
  height: 1.35rem;
  width: auto;
}

@media (min-width: 768px) {
  .portal-topbar-brand {
    display: none;
  }
}

.portal-topbar-help {
  display: none;
  font-size: 0.875rem;
  line-height: 1.45;
  color: var(--muted-foreground);
}

@media (min-width: 768px) {
  .portal-topbar-help {
    display: block;
  }
}

.portal-topbar-help strong {
  color: var(--foreground);
  font-weight: 500;
}

.portal-topbar-help a {
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
}

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

.portal-user {
  position: relative;
  margin-left: auto;
}

.portal-user-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border: 1px solid var(--border);
  background: var(--card);
  border-radius: 9999px;
  padding: 0.45rem 0.85rem 0.45rem 0.55rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--foreground);
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.portal-user-btn:hover,
.portal-user-btn:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(31, 107, 107, 0.15);
}

.portal-user-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 9999px;
  background: var(--primary);
  color: var(--primary-foreground);
  font-size: 0.7rem;
  font-weight: 600;
}

.portal-user-name {
  display: none;
  max-width: 12rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (min-width: 768px) {
  .portal-user-name {
    display: inline;
  }
}

.portal-user-chevron {
  width: 0.7rem;
  height: 0.7rem;
  opacity: 0.55;
}

.portal-user-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 0.5rem);
  width: 15rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 4px);
  box-shadow: 0 12px 28px rgba(31, 51, 51, 0.12);
  padding: 0.4rem;
  z-index: 40;
  list-style: none;
  margin: 0;
}

.portal-user-menu.invisible {
  display: none;
}

.portal-user-menu a {
  display: block;
  padding: 0.65rem 0.8rem;
  border-radius: var(--radius);
  color: var(--foreground) !important;
  text-decoration: none !important;
  font-size: 0.875rem;
}

.portal-user-menu a:hover {
  background: var(--accent);
  color: var(--primary) !important;
}

.portal-content {
  flex: 1;
  width: 100%;
  padding: 1.25rem 1.25rem 2.5rem;
}

@media (min-width: 1024px) {
  .portal-content {
    padding: 1.75rem 2rem 3rem;
  }
}

.portal-content .main-content {
  max-width: 72rem;
  margin: 0 auto;
  padding: 0 !important;
}

.portal-page-eyebrow {
  margin: 0 0 0.75rem;
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: rgba(31, 107, 107, 0.8);
}

.portal-page-title {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 2.5vw, 2.25rem);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: var(--foreground);
  margin: 0 0 0.35rem;
}

.portal-page-lead {
  margin: 0 0 1.75rem;
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--muted-foreground);
}

.portal-flash {
  border: 1px solid rgba(21, 128, 61, 0.2);
  background: #ecfdf5;
  color: #166534;
  border-radius: calc(var(--radius) + 4px);
  padding: 0.85rem 1rem;
  margin-bottom: 1.25rem;
  font-size: 0.9rem;
}

/* Soften legacy cards / buttons inside portal */
.portal-content .card {
  background: var(--card) !important;
  border: 1px solid var(--border) !important;
  border-radius: calc(var(--radius) + 8px) !important;
  box-shadow: 0 1px 2px rgba(31, 51, 51, 0.04) !important;
  overflow: hidden;
}

.portal-content .card .card-header,
.portal-content .card-header {
  font-family: var(--font-display) !important;
  font-size: 1.25rem !important;
  font-weight: 400 !important;
  letter-spacing: -0.02em;
  color: var(--foreground) !important;
  background: transparent !important;
  border-bottom: 1px solid var(--border);
  padding: 1.15rem 1.25rem 0.9rem !important;
  margin: 0 !important;
}

.portal-content .card .card-body,
.portal-content .card-body {
  padding: 1.15rem 1.25rem 1.35rem !important;
  color: var(--foreground);
}

.portal-content .btn-primary,
.portal-content a.btn-primary {
  background: var(--primary) !important;
  border-color: var(--primary) !important;
  color: var(--primary-foreground) !important;
  border-radius: calc(var(--radius) + 4px) !important;
  font-weight: 500 !important;
  box-shadow: none !important;
  padding: 0.7rem 1.1rem !important;
  transition: filter 0.15s ease;
}

.portal-content .btn-primary:hover,
.portal-content a.btn-primary:hover {
  filter: brightness(1.08);
  color: var(--primary-foreground) !important;
}

.portal-content .text-primary {
  color: var(--primary) !important;
}

.portal-content table {
  border-collapse: collapse;
}

.portal-content table td {
  font-size: 0.9rem;
  color: var(--foreground);
}

.portal-content table th {
  background: var(--primary) !important;
  border-color: var(--primary) !important;
  font-size: 0.75rem !important;
  letter-spacing: 0.04em;
}

.portal-dossier-banner {
  border: 1px solid var(--border);
  background: rgba(243, 234, 216, 0.55);
  border-radius: calc(var(--radius) + 8px);
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
}

.portal-dossier-banner h1 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 400;
  letter-spacing: -0.02em;
  margin: 0;
  color: var(--foreground);
}

.portal-status-card .btn-primary {
  width: 100%;
  justify-content: center;
  display: inline-flex;
  align-items: center;
}

.portal-note {
  display: block;
  margin-top: 1rem;
  font-size: 0.85rem;
  line-height: 1.55;
  color: var(--muted-foreground);
  font-style: normal !important;
}

.portal-empty {
  color: var(--muted-foreground);
  font-style: italic;
}

/* AfterWizard / open-action rows on the dashboard */
.portal-open-action {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 1.5rem;
  padding: 0.35rem 0 1.15rem;
  border-bottom: 1px solid var(--border);
}

.portal-open-action--last {
  border-bottom: 0;
  padding-bottom: 0.15rem;
}

.portal-open-action__body {
  flex: 1 1 16rem;
  min-width: 0;
}

.portal-open-action__title {
  margin: 0 0 0.35rem;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.3;
  color: var(--foreground) !important;
}

.portal-open-action__description {
  margin: 0;
  font-size: 0.925rem;
  line-height: 1.55;
  color: var(--muted-foreground);
}

.portal-open-action__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.65rem;
  flex: 0 0 auto;
}

.portal-open-action__actions .btn-primary,
.portal-open-action__cancel,
.portal-wizard-actions .btn-primary,
.portal-btn-secondary {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  box-sizing: border-box;
  min-height: 2.75rem;
  padding: 0.65rem 1.15rem !important;
  margin: 0;
  font-family: var(--font-sans) !important;
  font-size: 0.875rem !important;
  font-weight: 500 !important;
  line-height: 1.2 !important;
  letter-spacing: 0;
  border-radius: calc(var(--radius) + 4px) !important;
  border-width: 1px !important;
  border-style: solid;
  box-shadow: none !important;
  white-space: nowrap;
  text-decoration: none !important;
  transition: border-color 0.15s ease, color 0.15s ease, background-color 0.15s ease, filter 0.15s ease;
}

.portal-open-action__actions .btn-primary i,
.portal-wizard-actions .btn-primary i {
  font-size: 0.7rem;
  line-height: 1;
  margin: 0 !important;
}

.portal-open-action__cancel,
.portal-btn-secondary {
  appearance: none;
  background: var(--card);
  border-color: var(--border);
  color: var(--foreground);
  cursor: pointer;
}

.portal-open-action__cancel:hover,
.portal-open-action__cancel:focus,
.portal-btn-secondary:hover,
.portal-btn-secondary:focus {
  outline: none;
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(31, 107, 107, 0.06);
}

.portal-open-action__cta {
  white-space: nowrap;
}

/* Dedicated AfterWizard pages */
.portal-wizard-card {
  max-width: 40rem;
}

.portal-wizard-copy {
  margin: 0 0 1rem;
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--foreground);
}

.portal-wizard-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem 0.85rem;
  margin: 0 0 1.25rem;
  padding: 0.85rem 1rem;
  border-radius: calc(var(--radius) + 4px);
  background: rgba(243, 234, 216, 0.55);
  border: 1px solid var(--border);
  font-size: 0.875rem;
  color: var(--muted-foreground);
}

.portal-wizard-meta__value {
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--foreground);
}

.portal-wizard-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 1.75rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}

/* Override old global nav height when inside portal shell */
.portal-shell nav#header {
  height: auto !important;
  border-bottom-width: 0 !important;
}
