:root {
  --portal-ink: #18212d;
  --portal-muted: #6b7280;
  --portal-border: #d7dee6;
  --portal-surface: #ffffff;
  --portal-surface-soft: #f5f7fb;
  --portal-brand: #0f5b8d;
  --portal-brand-strong: #083f63;
  --portal-success: #157f57;
  --portal-warning: #b26717;
}

html {
  font-size: 16px;
}

body.portal-body {
  margin: 0;
  min-height: 100vh;
  background: linear-gradient(180deg, #f3f7fb 0%, #f8fafc 100%);
  color: var(--portal-ink);
}

.portal-header {
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--portal-border);
  backdrop-filter: blur(14px);
  position: sticky;
  top: 0;
  z-index: 20;
}

.portal-main {
  padding: 2rem 0 3rem;
}

.portal-footer {
  margin-top: 1rem;
  padding: 1.2rem 0 2rem;
  border-top: 1px solid rgba(24, 33, 45, 0.08);
  color: var(--portal-muted);
  font-size: 0.9rem;
}

.portal-footer-content {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  padding-top: 0.25rem;
}

.portal-footer-brand {
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--portal-ink);
}

.portal-footer-logo {
  width: 7rem;
  height: auto;
  display: block;
}

.portal-footer-text {
  color: var(--portal-muted);
}

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

.portal-brand-logo {
  width: 8.2rem;
  height: auto;
  display: block;
}

.portal-brand-title {
  display: block;
  font-size: 1rem;
  font-weight: 700;
}

.portal-brand-subtitle {
  display: block;
  font-size: 0.78rem;
  color: var(--portal-muted);
}

.portal-user-chip {
  padding: 0.55rem 0.9rem;
  border-radius: 999px;
  background: var(--portal-surface-soft);
  border: 1px solid var(--portal-border);
  line-height: 1.15;
}

.portal-user-name {
  font-size: 0.9rem;
  font-weight: 600;
}

.portal-user-meta {
  font-size: 0.72rem;
  color: var(--portal-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.portal-link {
  color: var(--portal-brand-strong);
  text-decoration: none;
  font-weight: 600;
}

.portal-mode-switch {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.3rem 0.35rem 0.3rem 0.75rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--portal-border);
}

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

.portal-segmented-control {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  padding: 0.22rem;
  border-radius: 999px;
  background: #e8eef5;
  border: 1px solid #d0dbe7;
}

.portal-segmented-control.compact {
  gap: 0.15rem;
  padding: 0.18rem;
}

.portal-segment-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.15rem;
  padding: 0.4rem 0.95rem;
  border-radius: 999px;
  color: var(--portal-ink);
  text-decoration: none;
  font-size: 0.86rem;
  font-weight: 800;
}

.portal-segment-link.active {
  background: linear-gradient(135deg, var(--portal-brand) 0%, var(--portal-brand-strong) 100%);
  color: white;
  box-shadow: 0 8px 20px rgba(8, 63, 99, 0.2);
}

.portal-segment-link.static {
  min-height: 1.95rem;
  padding: 0.35rem 0.85rem;
  opacity: 0.72;
}

.portal-segment-link.static.active {
  opacity: 1;
}

.portal-btn-primary,
.portal-btn-secondary {
  border-radius: 0.8rem;
  padding: 0.65rem 1rem;
  font-weight: 600;
}

.portal-btn-primary {
  background: linear-gradient(135deg, var(--portal-brand) 0%, var(--portal-brand-strong) 100%);
  color: white;
  border: 0;
}

.portal-btn-primary:hover {
  color: white;
  opacity: 0.95;
}

.portal-btn-secondary {
  background: white;
  color: var(--portal-ink);
  border: 1px solid var(--portal-border);
}

.portal-grid {
  display: grid;
  gap: 1.25rem;
}

.portal-grid.two {
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
}

.portal-card {
  background: var(--portal-surface);
  border: 1px solid var(--portal-border);
  border-radius: 1.4rem;
  box-shadow: 0 10px 30px rgba(16, 24, 40, 0.06);
}

.portal-card-header {
  padding: 1.2rem 1.4rem 0.6rem;
}

.portal-card-body {
  padding: 0.75rem 1.4rem 1.3rem;
}

.portal-card-title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
}

.portal-card-subtitle {
  margin-top: 0.35rem;
  color: var(--portal-muted);
  font-size: 0.92rem;
}

.portal-stat-list,
.portal-message-list,
.portal-attachment-list,
.portal-procedure-list,
.portal-project-list {
  display: grid;
  gap: 0.85rem;
}

.portal-stat {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 1rem;
  border-radius: 1rem;
  background: var(--portal-surface-soft);
  border: 1px solid #e5eaf1;
}

.portal-stat-label {
  color: var(--portal-muted);
  font-size: 0.88rem;
}

.portal-stat-value {
  font-weight: 700;
}

.portal-message,
.portal-attachment,
.portal-procedure {
  padding: 1rem;
  border-radius: 1rem;
  border: 1px solid var(--portal-border);
  background: white;
}

.portal-message.system {
  background: #f6f8fb;
}

.portal-meta {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  color: var(--portal-muted);
  font-size: 0.83rem;
  margin-bottom: 0.5rem;
}

.portal-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  background: #edf4fa;
  color: var(--portal-brand-strong);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
}

.portal-pill.success {
  background: #e8f8f1;
  color: var(--portal-success);
}

.portal-pill.warning {
  background: #fff4e8;
  color: var(--portal-warning);
}

.portal-pill.danger {
  background: #fdecec;
  color: #b42318;
}

.portal-login-shell {
  min-height: calc(100vh - 8rem);
  display: grid;
  place-items: center;
}

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

.portal-table {
  width: 100%;
  border-collapse: collapse;
}

.portal-table th,
.portal-table td {
  padding: 0.8rem 0.7rem;
  border-bottom: 1px solid var(--portal-border);
  vertical-align: top;
}

.portal-table th {
  color: var(--portal-muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

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

.portal-form-stack {
  display: grid;
  gap: 0.75rem;
}

.portal-empty {
  padding: 1rem;
  border-radius: 1rem;
  background: var(--portal-surface-soft);
  color: var(--portal-muted);
}

.portal-project-link {
  display: block;
  color: inherit;
  text-decoration: none;
}

.portal-chat-shell {
  display: grid;
  gap: 1rem;
}

.communication-grid {
  grid-template-columns: minmax(19rem, 24rem) minmax(0, 1fr);
  align-items: start;
}

.portal-thread-list {
  display: grid;
  gap: 0.8rem;
}

.portal-thread-link {
  display: block;
  padding: 0.95rem 1rem;
  border-radius: 1rem;
  border: 1px solid var(--portal-border);
  background: white;
  color: inherit;
  text-decoration: none;
  transition: transform 120ms ease, border-color 120ms ease, box-shadow 120ms ease;
}

.portal-thread-link:hover {
  transform: translateY(-1px);
  border-color: #c8d5e3;
  box-shadow: 0 10px 26px rgba(16, 24, 40, 0.08);
}

.portal-thread-link.active {
  border-color: #96b7d2;
  background: linear-gradient(180deg, #f7fbff 0%, #eef6ff 100%);
  box-shadow: 0 10px 24px rgba(8, 63, 99, 0.12);
}

.portal-thread-title-row {
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
  align-items: start;
}

.portal-thread-meta {
  margin-top: 0.45rem;
  font-size: 0.78rem;
  color: var(--portal-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.portal-thread-preview {
  margin-top: 0.4rem;
  color: var(--portal-muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.portal-thread-unread {
  min-width: 1.7rem;
  height: 1.7rem;
  padding: 0 0.45rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--portal-brand-strong);
  color: white;
  font-size: 0.76rem;
  font-weight: 800;
}

.portal-chat-thread {
  display: grid;
  gap: 0.9rem;
  padding: 1rem;
  border-radius: 1.2rem;
  background:
    linear-gradient(180deg, rgba(15, 91, 141, 0.04) 0%, rgba(255, 255, 255, 0.96) 100%),
    var(--portal-surface-soft);
  border: 1px solid #dce4ee;
}

.portal-chat-row {
  display: flex;
}

.portal-chat-row.incoming {
  justify-content: flex-start;
}

.portal-chat-row.outgoing {
  justify-content: flex-end;
}

.portal-chat-row.system {
  justify-content: center;
}

.portal-chat-bubble {
  width: min(100%, 44rem);
  padding: 1rem 1.1rem;
  border-radius: 1.2rem;
  border: 1px solid var(--portal-border);
  background: white;
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.05);
}

.portal-chat-row.outgoing .portal-chat-bubble {
  background: linear-gradient(135deg, #edf4ff 0%, #dfeeff 100%);
  border-color: #b7cdf3;
}

.portal-chat-row.internal .portal-chat-bubble {
  background: linear-gradient(135deg, #eff7ff 0%, #f8fbff 100%);
  border-color: #c7d9ee;
}

.portal-chat-row.client .portal-chat-bubble {
  background: linear-gradient(135deg, #fff4e6 0%, #fffaf2 100%);
  border-color: #f0cf9f;
}

.portal-chat-row.contractor .portal-chat-bubble {
  background: linear-gradient(135deg, #edf8f2 0%, #f7fcf9 100%);
  border-color: #b9dcc7;
}

.portal-chat-row.system .portal-chat-bubble {
  width: min(100%, 26rem);
  padding: 0.55rem 0.9rem;
  background: rgba(244, 246, 249, 0.78);
  border-color: #e0e6ee;
  box-shadow: none;
  text-align: center;
}

.portal-chat-topline {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
}

.portal-chat-role {
  display: inline-flex;
  align-items: center;
  min-height: 1.8rem;
  padding: 0.15rem 0.7rem;
  border-radius: 999px;
  background: rgba(24, 33, 45, 0.08);
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.portal-chat-system-label {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--portal-muted);
}

.portal-chat-row.outgoing .portal-chat-role {
  background: var(--portal-brand);
  color: white;
}

.portal-chat-row.contractor .portal-chat-role {
  background: var(--portal-success);
  color: white;
}

.portal-chat-row.client .portal-chat-role {
  background: var(--portal-warning);
  color: white;
}

.portal-chat-row.external .portal-chat-bubble {
  background: linear-gradient(135deg, #fff4e6 0%, #fffaf2 100%);
  border-color: #f0cf9f;
}

.portal-chat-row.external .portal-chat-role {
  background: var(--portal-warning);
  color: white;
}

.portal-chat-time {
  font-size: 0.78rem;
  color: var(--portal-muted);
}

.portal-chat-author {
  margin-top: 0.7rem;
  font-size: 0.92rem;
  font-weight: 700;
}

.portal-chat-content {
  margin-top: 0.65rem;
  line-height: 1.55;
  white-space: pre-wrap;
}

.portal-chat-row.system .portal-chat-content {
  margin-top: 0.35rem;
  color: #5f6978;
  font-size: 0.92rem;
}

.portal-chat-composer {
  display: grid;
  gap: 0.75rem;
  padding: 1rem;
  border-radius: 1.1rem;
  background: white;
  border: 1px solid var(--portal-border);
}

.portal-chat-textarea {
  min-height: 7rem;
  resize: vertical;
}

.portal-chat-hint {
  color: var(--portal-muted);
  font-size: 0.85rem;
}

.portal-tab-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.portal-tab-link {
  display: inline-flex;
  align-items: center;
  min-height: 2.9rem;
  padding: 0.7rem 1rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--portal-border);
  color: var(--portal-ink);
  text-decoration: none;
  font-weight: 700;
}

.portal-tab-link.active {
  background: linear-gradient(135deg, var(--portal-brand) 0%, var(--portal-brand-strong) 100%);
  border-color: transparent;
  color: white;
  box-shadow: 0 10px 24px rgba(8, 63, 99, 0.22);
}

.portal-overview-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.9rem;
}

.portal-overview-tile {
  padding: 1rem 1.1rem;
  border-radius: 1.1rem;
  border: 1px solid var(--portal-border);
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

.portal-overview-tile.compact {
  min-width: 10rem;
}

.portal-overview-label {
  color: var(--portal-muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.portal-overview-value {
  margin-top: 0.45rem;
  font-size: 1.5rem;
  font-weight: 800;
}

.portal-user-mini {
  font-size: 0.82rem;
  color: var(--portal-muted);
  font-weight: 700;
}

.portal-list {
  display: grid;
  gap: 0.85rem;
}

.portal-list-item {
  padding: 1rem;
  border-radius: 1rem;
  border: 1px solid var(--portal-border);
  background: white;
}

.portal-note {
  padding: 1rem 1.1rem;
  border-radius: 1rem;
  border: 1px solid var(--portal-border);
  background: var(--portal-surface-soft);
  white-space: pre-wrap;
  line-height: 1.55;
}

.portal-section-title {
  font-size: 0.86rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--portal-muted);
  font-weight: 800;
}

.portal-finance-total,
.portal-finance-inline {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.95rem 1rem;
  border-radius: 1rem;
  background: linear-gradient(180deg, #f7fbff 0%, #eef6ff 100%);
  border: 1px solid #d2e3f6;
}

.portal-finance-total strong,
.portal-finance-inline {
  font-size: 1.1rem;
  font-weight: 800;
}

.portal-project-card {
  transition: transform 120ms ease, box-shadow 120ms ease, border-color 120ms ease;
}

.portal-project-link:hover .portal-project-card {
  transform: translateY(-2px);
  box-shadow: 0 14px 34px rgba(16, 24, 40, 0.1);
  border-color: #c8d5e3;
}

.portal-pill.neutral {
  background: #eff3f8;
  color: #546578;
}

.portal-body-jpt .portal-main {
  display: grid;
  gap: 1.25rem;
}

.portal-header-center {
  flex: 1;
  display: flex;
  justify-content: center;
}

.jpt-header-switches {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
}

.jpt-header-switch {
  min-width: 9.5rem;
}

.jpt-page-shell {
  display: grid;
  gap: 1.25rem;
}

.jpt-strip {
  display: grid;
  gap: 0.85rem;
}

.jpt-stats-strip {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 1rem;
}

.jpt-actions-strip {
  margin-bottom: 1.15rem;
}

.jpt-toolbar-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(10rem, 1fr)) auto;
  gap: 0.85rem;
  align-items: end;
}

.jpt-toolbar-group {
  display: grid;
  gap: 0.35rem;
}

.jpt-toolbar-buttons {
  display: flex;
  gap: 0.65rem;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: end;
}

.jpt-table-shell {
  border-radius: 1.25rem;
  border: 1px solid #d9e3ee;
  overflow: hidden;
  background: #fff;
}

.jpt-table-header,
.jpt-list-row {
  display: grid;
  grid-template-columns: minmax(16rem, 2fr) 3.2rem minmax(11rem, 1.2fr) minmax(9rem, 1fr) 4.5rem 4.5rem 4.5rem minmax(14rem, 1.6fr) minmax(7rem, 0.8fr) minmax(7rem, 0.8fr);
  gap: 0.75rem;
  align-items: center;
}

.jpt-table-header {
  padding: 0.95rem 1rem;
  background: #f5f8fc;
  border-bottom: 1px solid #d9e3ee;
}

.jpt-col {
  min-width: 0;
  font-size: 0.84rem;
}

.jpt-table-header .jpt-col {
  color: var(--portal-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.72rem;
  font-weight: 800;
}

.jpt-col-action,
.jpt-col-dim,
.jpt-col-nietyp,
.jpt-col-deadline {
  text-align: center;
}

.jpt-list-group {
  display: grid;
}

.jpt-list-group + .jpt-list-group {
  border-top: 1px solid #e4ebf2;
}

.jpt-list-group-header {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.8rem 1rem;
  background: #fbfdff;
  border-bottom: 1px solid #eef3f8;
}

.jpt-list-group-title {
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--portal-brand-strong);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.jpt-list-group-count {
  min-width: 2rem;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  background: #edf4fa;
  color: #0b4c78;
  font-size: 0.78rem;
  font-weight: 700;
  text-align: center;
}

.jpt-list-group-body {
  display: grid;
}

.jpt-list-row {
  padding: 0.9rem 1rem;
  border-bottom: 1px solid #edf2f7;
  background: #fff;
  transition: background 120ms ease, transform 120ms ease;
}

.jpt-list-row:last-child {
  border-bottom: 0;
}

.jpt-list-row:hover {
  background: #fbfdff;
}

.jpt-list-row.warning {
  background: linear-gradient(180deg, #fff9f9 0%, #fff5f5 100%);
}

.jpt-part-main {
  font-weight: 800;
  color: var(--portal-brand-strong);
  line-height: 1.3;
}

.jpt-part-sub {
  margin-top: 0.18rem;
  font-size: 0.8rem;
  color: var(--portal-muted);
  line-height: 1.35;
}

.jpt-col-material {
  color: #2d3b4d;
  line-height: 1.35;
}

.jpt-part-open {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 999px;
  border: 1px solid #cfd8e4;
  background: #f7fbff;
  color: #124a73;
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(16, 24, 40, 0.06);
  transition: transform 120ms ease, border-color 120ms ease, box-shadow 120ms ease, background 120ms ease;
}

.jpt-part-open:hover {
  transform: translateY(-1px);
  border-color: #8fb0ca;
  background: #eef6ff;
  box-shadow: 0 10px 22px rgba(8, 63, 99, 0.12);
}

.jpt-part-open svg {
  width: 1.15rem;
  height: 1.15rem;
  fill: currentColor;
}

.jpt-row-status-form {
  display: grid;
  gap: 0.35rem;
}

.jpt-row-status-form .form-select {
  min-width: 10rem;
}

.jpt-deadline-warning {
  color: #b42318;
  font-weight: 800;
}

.jpt-empty-list {
  padding: 1.5rem;
}

.jpt-admin-card .portal-card-body,
.jpt-settings-form {
  display: grid;
  gap: 0.9rem;
}

.jpt-settings-table {
  display: grid;
  gap: 0.65rem;
}

.jpt-settings-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 8rem;
  gap: 0.75rem;
  align-items: center;
}

.jpt-settings-label {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--portal-brand-strong);
}

.jpt-modal-content {
  border: 1px solid #d9e3ee;
  border-radius: 1.4rem;
  background: linear-gradient(180deg, #fbfdff 0%, #f6f9fc 100%);
}

.jpt-modal-title {
  color: var(--portal-brand-strong);
}

.jpt-modal-preview-card {
  display: grid;
  gap: 0.7rem;
  margin-bottom: 1rem;
}

.jpt-modal-preview-stage {
  min-height: 32rem;
  position: relative;
  border-radius: 1.2rem;
  border: 1px solid #d9e3ee;
  background: #eef4fb;
  overflow: hidden;
  touch-action: none;
}

.jpt-modal-preview-canvas-host {
  position: absolute;
  inset: 0;
}

.jpt-modal-preview-canvas-host canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.jpt-modal-preview-image {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  max-width: 100%;
  height: 100%;
  object-fit: contain;
  user-select: none;
  transform-origin: center center;
  transition: transform 120ms ease;
}

.jpt-modal-preview-hint {
  color: var(--portal-muted);
  font-size: 0.84rem;
}

.jpt-modal-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.85rem;
  margin-bottom: 1rem;
}

.jpt-modal-kpi,
.jpt-modal-meta-card {
  padding: 0.95rem 1rem;
  border-radius: 1rem;
  border: 1px solid #d9e3ee;
  background: #fff;
}

.jpt-modal-kpi-label,
.jpt-modal-meta-label {
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--portal-muted);
  margin-bottom: 0.3rem;
}

.jpt-modal-kpi-value,
.jpt-modal-meta-value {
  font-size: 0.98rem;
  font-weight: 800;
  color: var(--portal-brand-strong);
  line-height: 1.4;
}

.jpt-history-toggle {
  min-height: 100%;
}

.jpt-modal-meta-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.85rem;
}

.jpt-history-modal-list {
  display: grid;
  gap: 0.8rem;
}

.jpt-history-item {
  padding: 0.9rem 1rem;
  border-radius: 1rem;
  background: #f4f7fb;
  border: 1px solid #dde6ef;
}

.jpt-history-time {
  font-size: 0.8rem;
  color: var(--portal-muted);
  margin-bottom: 0.25rem;
}

.jpt-history-flow {
  font-weight: 800;
  color: var(--portal-brand-strong);
  margin-bottom: 0.2rem;
}

.jpt-history-summary {
  font-size: 0.9rem;
  color: #344256;
}

.portal-auth-shell {
  min-height: calc(100vh - 12rem);
  display: grid;
  place-items: center;
  padding: 2rem 1rem 3rem;
}

.portal-auth-card {
  width: min(100%, 30rem);
  padding: 2rem;
  border-radius: 1.5rem;
  border: 1px solid #d9e3ee;
  background: linear-gradient(180deg, #fbfdff 0%, #f3f7fb 100%);
  box-shadow: 0 24px 60px rgba(14, 37, 64, 0.08);
}

.portal-auth-brand {
  display: grid;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.jpt-auth-shell {
  min-height: calc(100vh - 10rem);
}

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

.jpt-auth-brand {
  text-align: center;
  justify-items: center;
}

.jpt-auth-pill {
  justify-self: center;
}

.portal-auth-title {
  margin: 0;
  color: var(--portal-brand-strong);
  font-size: clamp(1.85rem, 3vw, 2.35rem);
  line-height: 1.05;
}

.portal-auth-copy {
  margin: 0;
  color: #445268;
  line-height: 1.6;
}

.portal-auth-form {
  display: grid;
  gap: 1rem;
}

.portal-auth-error {
  padding: 0.9rem 1rem;
  border-radius: 1rem;
  border: 1px solid #f0c4c8;
  background: #fff2f3;
  color: #8e2430;
  font-weight: 600;
}

.portal-auth-secondary {
  margin-top: 1.25rem;
  color: var(--portal-muted);
  font-size: 0.92rem;
}

.portal-auth-secondary a {
  color: var(--portal-brand);
  font-weight: 700;
  text-decoration: none;
}

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

@media (max-width: 992px) {
  .portal-grid.two {
    grid-template-columns: 1fr;
  }

  .communication-grid {
    grid-template-columns: 1fr;
  }

  .portal-overview-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .portal-chat-bubble {
    width: 100%;
  }

  .portal-footer-content {
    flex-direction: column;
    align-items: flex-start;
  }

  .portal-header-center {
    display: none;
  }

  .jpt-stats-strip,
  .jpt-modal-kpi-grid,
  .jpt-modal-meta-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .jpt-toolbar-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .jpt-toolbar-buttons {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }

  .jpt-table-header {
    display: none;
  }

  .jpt-list-row {
    grid-template-columns: 1fr;
    gap: 0.6rem;
  }

  .jpt-col {
    text-align: left;
  }

  .jpt-col-action,
  .jpt-col-dim,
  .jpt-col-nietyp,
  .jpt-col-deadline {
    text-align: left;
  }

  .jpt-settings-row {
    grid-template-columns: 1fr;
  }

  .jpt-modal-preview-stage {
    min-height: 20rem;
  }
}

@media (max-width: 640px) {
  .jpt-stats-strip,
  .jpt-modal-kpi-grid,
  .jpt-modal-meta-grid,
  .jpt-toolbar-form {
    grid-template-columns: 1fr;
  }
}
