/* Kundenportal V2 — SECTOR Cert Look (Website-Nähe) */
html.kunde-portal-active #app-nav { display: none !important; }
html.kunde-portal-active #app-panel {
  height: calc(var(--app-vh, 100vh));
  max-height: calc(var(--app-vh, 100vh));
}

.kp-shell {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  background: var(--bg);
  font-family: var(--font-portal, 'Lato', Arial, Helvetica, sans-serif);
}
.kp-topbar {
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 8px 28px;
  min-height: 96px;
  border-bottom: 1px solid var(--border);
  background: #fff;
  flex-shrink: 0;
  flex-wrap: wrap;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.03);
}
.kp-brand {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  gap: 16px;
}
.kp-brand-logo {
  display: block;
  flex-shrink: 0;
  line-height: 0;
  text-decoration: none;
}
.kp-brand-logo img {
  display: block;
  height: 80px;
  width: auto;
  max-width: none;
  object-fit: contain;
  object-position: left center;
}
.kp-menubar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex: 1 1 auto;
  gap: 0.15rem 0.65rem;
  flex-wrap: wrap;
  min-width: 0;
  align-self: stretch;
}
.kp-menubar-item {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  min-height: 48px;
  height: auto;
  padding: 0.55rem 0.35rem;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #B50C40;
  font: 700 13px/1.2 var(--font-portal, 'Lato', Arial, Helvetica, sans-serif);
  letter-spacing: 0.01em;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  position: relative;
  box-shadow: none;
  transition: background .15s ease, color .15s ease;
}
.kp-menubar-item:hover,
.kp-menubar-item:focus-visible {
  background: rgba(181, 12, 64, 0.08);
  color: #B50C40;
  outline: none;
}
.kp-menubar-item.is-active {
  background: transparent;
  color: #B50C40;
  font-weight: 700;
  box-shadow: none;
}
.kp-menubar-item.is-active:hover,
.kp-menubar-item.is-active:focus-visible {
  background: rgba(181, 12, 64, 0.08);
}
.kp-topbar-aside {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
  margin-left: auto;
}
/* Profil-Icon wie Website (.head-portal) */
.kp-profile-host {
  position: relative;
  display: flex;
  align-items: center;
  align-self: stretch;
}
.kp-profile-host:empty { display: none; }
.kp-profile-host #nav-user-info {
  position: relative;
  display: flex;
  align-items: center;
  align-self: stretch;
}
.kp-profile-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.1rem;
  height: 2.5rem;
  margin: 0;
  padding: 0 0 0 0.4rem;
  border: none;
  border-left: 1px solid var(--border2);
  box-sizing: content-box;
  background: transparent;
  color: #535352;
  cursor: pointer;
  box-shadow: none;
  border-radius: 0;
  flex-shrink: 0;
  transition: color .15s;
}
.kp-profile-trigger:hover,
.kp-profile-trigger.kp-profile-trigger--active,
.kp-profile-trigger:focus-visible {
  color: var(--accent);
  outline: none;
  background: transparent;
  transform: none;
}
.kp-profile-trigger__icon {
  display: block;
  width: 16px;
  height: 16px;
}
.kp-profile-host .np-menu {
  position: absolute;
  left: auto;
  right: 0;
  top: calc(100% + 8px);
  bottom: auto;
  min-width: 240px;
}
.kp-main {
  flex: 1 1 0%;
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 32px 28px 48px;
  box-sizing: border-box;
}
.kp-page {
  max-width: 720px;
  margin: 0 auto;
}
.kp-page--profil,
.kp-page--wide { max-width: var(--portal-shell-width, 90vw); }
.kp-page-title {
  margin: 0 0 8px;
  font-size: 1.6rem;
  font-weight: 900;
  letter-spacing: -.01em;
  color: var(--text);
  text-transform: uppercase;
}
.kp-page-lead {
  margin: 0 0 24px;
  color: var(--text2);
  font-size: .95rem;
  line-height: 1.5;
}
.kp-page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}
.kp-page-head .kp-page-title { margin: 0; }
.kp-page-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.kp-hero-actions { margin-bottom: 28px; }
.kp-section { margin-bottom: 32px; }
.kp-section--muted .kp-lead {
  margin: 0;
  color: var(--text2);
  font-size: .95rem;
  line-height: 1.55;
}
.kp-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.kp-section-title {
  margin: 0;
  font-size: .95rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--text);
}
.kp-task-list,
.kp-antrag-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.kp-task-card,
.kp-antrag-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s;
}
.kp-task-card:hover,
.kp-antrag-card:hover {
  border-color: color-mix(in srgb, var(--accent) 40%, var(--border));
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}
.kp-antrag-card--aktion,
.kp-antrag-card--entwurf,
.kp-task-card {
  border-color: color-mix(in srgb, #e0a000 50%, var(--border));
  background: #faf8f2;
}
.kp-task-card-title,
.kp-antrag-card-title {
  font-weight: 700;
  font-size: .95rem;
  line-height: 1.35;
}
.kp-task-card-meta,
.kp-antrag-card-meta {
  font-size: .8rem;
  color: var(--text3);
  margin-top: 4px;
}
.kp-task-card-action {
  display: block;
  margin-top: 6px;
  font-size: .8rem;
  font-weight: 700;
  color: var(--accent);
}
.kp-antrag-card-main { min-width: 0; flex: 1; }
.kp-antrag-card-aside {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.kp-chevron { color: var(--text3); font-size: 1.2rem; }
.kp-mini-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.kp-mini-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  font: inherit;
  font-size: .9rem;
  text-align: left;
  cursor: pointer;
}
.kp-mini-row:hover {
  background: var(--surface2);
  border-color: color-mix(in srgb, var(--accent) 25%, var(--border));
}
.kp-empty {
  padding: 40px 16px;
  text-align: center;
  color: var(--text3);
  font-size: .95rem;
}
.kp-footer {
  margin-top: 40px;
  padding-top: 16px;
}
.kp-zert-embed .mod-wrap,
.kp-zert-embed .mod-wrap--kunde { min-height: 0; }
.kp-zert-embed .app-tabs { display: none; }
.kp-profil-embed .per-wrap > .app-tabs { display: none; }
.kp-profil-embed .per-wrap--kunde .per-body { display: block; }
.kp-profil-embed .per-sidebar { display: none; }
.kp-profil-embed .per-main { padding: 0; }

/* Eingebettete Kunden-Views: weniger „App“, mehr Portal */
html.kunde-portal-active .kp-zert-embed,
html.kunde-portal-active .kp-profil-embed {
  font-family: var(--font-portal, 'Lato', Arial, Helvetica, sans-serif);
}

@media (max-width: 720px) {
  .kp-topbar {
    flex-direction: column;
    align-items: stretch;
    padding: 12px 16px 0;
    gap: 0;
    min-height: 0;
  }
  .kp-brand {
    padding-bottom: 10px;
  }
  .kp-brand-logo img {
    height: 56px;
    max-width: min(220px, 100%);
  }
  .kp-topbar-aside {
    margin-left: 0;
    padding-bottom: 10px;
  }
  .kp-menubar {
    justify-content: flex-start;
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    border-top: 1px solid var(--border);
    gap: 0;
  }
  .kp-menubar-item {
    min-height: 48px;
    padding: 0.55rem 0.75rem;
    font: 700 13px/1.2 var(--font-portal, 'Lato', Arial, Helvetica, sans-serif);
  }
  .kp-main { padding: 20px 16px 40px; }
  .kp-page-title { font-size: 1.35rem; }
}
