.is-client-portal .inline-password-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.admin-session-banner {
  border: 1px solid rgba(241, 163, 59, 0.38);
  border-radius: 8px;
  padding: 14px 16px;
  color: #5b3c08;
  background: #fff8ed;
  font-weight: 800;
}

.portal-content {
  display: grid;
  gap: 18px;
}

.client-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.client-tabs .button.is-active {
  border-color: rgba(17, 185, 154, 0.42);
  background: var(--teal);
  color: #fff;
}

.portal-overview {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(360px, 0.8fr);
  align-items: center;
  gap: 18px;
}

.portal-overview h2 {
  font-size: clamp(24px, 3vw, 36px);
}

.portal-stats,
.site-metrics {
  display: grid;
  gap: 10px;
}

.notifications-panel .button {
  margin-top: 12px;
}

.notification-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  border: 1px solid var(--line);
  border-left: 4px solid #cbd8d6;
  border-radius: 8px;
  padding: 14px;
  background: #f9fbfb;
}

.notification-card.is-unread {
  border-left-color: var(--teal);
  background: var(--teal-soft);
}

.notification-card p {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.notification-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-align: right;
  white-space: nowrap;
}

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

.portal-stats article,
.site-metrics article {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #f9fbfb;
}

.portal-stats span,
.site-metrics span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.portal-stats strong,
.site-metrics strong {
  overflow-wrap: anywhere;
}

.site-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: #f9fbfb;
}

.site-card.ok {
  border-left: 4px solid var(--teal);
}

.site-card.warn {
  border-left: 4px solid var(--amber);
}

.site-card.fail {
  border-left: 4px solid var(--danger);
}

.site-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.site-card-head p {
  margin: 4px 0 0;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.site-metrics {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 14px;
}

.recommendation-box {
  margin-top: 14px;
  border: 1px solid rgba(17, 185, 154, 0.24);
  border-radius: 8px;
  padding: 12px;
  background: rgba(17, 185, 154, 0.06);
}

.recommendation-box p {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.site-card form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.add-site-panel {
  margin: 0;
}

.site-card .form-actions {
  grid-column: 1 / -1;
}

.check-card {
  border: 1px solid var(--line);
  border-left: 4px solid var(--teal);
  border-radius: 8px;
  padding: 14px;
  background: #f9fbfb;
}

.check-card.warn {
  border-left-color: var(--amber);
}

.check-card.fail {
  border-left-color: var(--danger);
}

.check-card p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.5;
}

.work-history-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--teal);
  border-radius: 8px;
  padding: 14px;
  background: #f9fbfb;
}

.work-history-card p {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.work-history-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-align: right;
  white-space: nowrap;
}

.report-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--teal);
  border-radius: 8px;
  padding: 14px;
  background: #f9fbfb;
}

.report-card p {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.request-card {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #f8fbfb;
}

.request-card p {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.avorix-reply {
  margin-top: 10px;
  border-left: 4px solid var(--teal);
  padding: 10px 12px;
  background: var(--teal-soft);
}

.avorix-reply p {
  margin-bottom: 0;
}

.notification-preferences {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 16px;
  background: #f8fcfb;
}

.notification-preferences label {
  display: flex;
  align-items: center;
  gap: 10px;
}

.preference-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

@media (max-width: 900px) {
  .is-client-portal .inline-password-form,
  .site-card form,
  .work-history-card,
  .notification-card,
  .portal-overview,
  .portal-stats,
  .site-metrics {
    grid-template-columns: 1fr;
  }

  .report-card {
    align-items: flex-start;
    flex-direction: column;
  }

  .request-card {
    flex-direction: column;
  }

  .notification-card span {
    text-align: left;
  }
}

@media (max-width: 760px) {
  .preference-grid {
    grid-template-columns: 1fr 1fr;
  }
}
