/* ============================================================
   GUARDIAN GROUP — portal.css
   Client portal — extends survey.css + admin.css (both loaded
   alongside this file on every portal page).
   ============================================================ */

/* ── LOGIN EXTRAS ────────────────────────────────────────── */
.portal-link-btn {
  background: none;
  border: none;
  color: var(--gg-mid);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  margin-top: 4px;
  padding: 4px;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.portal-link-btn:hover { color: var(--gg-dark); }

.portal-login-hint {
  margin-top: 24px;
  font-size: 12px;
  color: var(--gg-muted);
  text-align: center;
  line-height: 1.6;
}

.portal-back-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: 100%;
  margin-top: 18px;
  text-decoration: none;
}

.login-success {
  background: #eef6f0;
  border: 1px solid #bfe0c8;
  color: #2e7d4f;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
}

.portal-user-tag {
  font-size: 12px;
  color: rgba(255,255,255,0.6);
  margin-bottom: 10px;
  word-break: break-all;
}

.portal-info-card {
  display: grid;
  gap: 16px;
  text-align: center;
}

.portal-info-card h1 {
  margin: 0;
  color: var(--gg-dark);
  font-family: var(--font-display);
  font-size: 24px;
  line-height: 1.15;
}

.portal-info-card p {
  margin: 0;
  color: var(--gg-muted);
  font-size: 14px;
  line-height: 1.6;
}

/* ── CLIENT PORTAL DASHBOARD ────────────────────────────── */
.portal-eyebrow {
  margin: 0 0 6px;
  color: var(--gg-steel);
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.portal-overview-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(260px, 0.8fr);
  gap: 18px;
}

.portal-panel {
  min-width: 0;
  padding: 24px;
  background: white;
  border: 1px solid var(--gg-pale);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
}

.portal-panel h2 {
  margin: 0;
  color: var(--gg-dark);
  font-family: var(--font-display);
  font-size: 21px;
}

.portal-panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.portal-text-action {
  flex: 0 0 auto;
  padding: 4px 0;
  border: 0;
  background: transparent;
  color: var(--gg-mid);
  font: 600 13px var(--font-display);
  cursor: pointer;
}

.portal-text-action:hover,
.portal-text-action:focus-visible { color: var(--gg-dark); }

.portal-recent-list {
  border-top: 1px solid var(--gg-off);
}

.portal-recent-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 15px 0;
  border-bottom: 1px solid var(--gg-off);
}

.portal-recent-row:last-child { border-bottom: 0; }
.portal-recent-row strong { display: block; color: var(--gg-dark); font-size: 14px; }
.portal-recent-row > div:first-child span { display: block; margin-top: 3px; color: var(--gg-muted); font-size: 12px; }

.portal-recent-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  color: var(--gg-muted);
  font-size: 12px;
  text-align: right;
}

.portal-empty-compact {
  padding: 30px 10px 14px;
  color: var(--gg-muted);
  text-align: center;
}

.portal-empty-compact p { margin: 0; }

.portal-quick-links {
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.portal-quick-links h2 { margin-bottom: 16px; }

.portal-quick-link {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  width: 100%;
  margin-top: 10px;
  padding: 15px 16px;
  border: 1px solid var(--gg-pale);
  border-radius: 9px;
  background: var(--gg-off);
  color: var(--gg-dark);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.portal-quick-link:hover,
.portal-quick-link:focus-visible {
  border-color: var(--gg-steel);
  background: white;
}

.portal-quick-link strong { font: 700 15px var(--font-display); }
.portal-quick-link span { color: var(--gg-muted); font-size: 12px; }

/* ── EMPLOYEE ROSTER ───────────────────────────────────── */
.portal-roster-editor { max-width: 900px; }
.portal-roster-actions { align-items: center; }
.portal-feedback { margin: 0 0 18px; }
.portal-roster-table tr { cursor: default; }
.portal-roster-inactive td { background: rgba(238, 242, 244, 0.55); color: var(--gg-muted); }

.portal-row-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
}

.portal-row-actions .portal-table-secondary { margin: 0; white-space: nowrap; }

/* ── ORGANIZATION TRAINING RECORDS ───────────────────────── */
.portal-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 0 0 20px;
}

.portal-summary-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 94px;
  padding: 18px;
  background: white;
  border: 1px solid var(--gg-pale);
  border-radius: 10px;
  box-shadow: var(--shadow-sm);
}

.portal-summary-card strong {
  color: var(--gg-dark);
  font-family: var(--font-display);
  font-size: 30px;
  line-height: 1;
}

.portal-summary-card span {
  color: var(--gg-muted);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.portal-record-filters {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(160px, 220px);
  gap: 12px;
  align-items: end;
  margin-bottom: 18px;
}

.portal-training-table td {
  vertical-align: middle;
}

.portal-training-table td strong {
  display: block;
  color: var(--gg-dark);
  font-weight: 600;
}

.portal-table-secondary {
  display: block;
  margin-top: 3px;
  color: var(--gg-muted);
  font-size: 12px;
}

.portal-empty-state {
  padding: 44px 24px;
  background: white;
  border: 1px solid var(--gg-pale);
  border-radius: 10px;
  text-align: center;
}

.portal-empty-state h2 {
  margin: 0 0 8px;
  color: var(--gg-dark);
  font-family: var(--font-display);
  font-size: 22px;
}

.portal-empty-state p {
  margin: 0;
  color: var(--gg-muted);
}

@media (max-width: 860px) {
  .portal-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .portal-overview-grid { grid-template-columns: 1fr; }
  .portal-record-filters { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .portal-panel { padding: 18px; }
  .portal-panel-heading { align-items: flex-end; }
  .portal-recent-row { align-items: flex-start; flex-direction: column; gap: 9px; }
  .portal-recent-meta { justify-content: space-between; width: 100%; text-align: left; }
  .portal-roster-actions { align-items: stretch; flex-direction: column-reverse; }
  .portal-roster-actions .btn { width: 100%; }
  .portal-summary-grid { grid-template-columns: 1fr 1fr; }
  .portal-summary-card { min-height: 82px; padding: 14px; }
  .portal-summary-card strong { font-size: 26px; }
}

/* ── CERTIFICATE PAGE ────────────────────────────────────── */
.certificate-page {
  min-height: 100vh;
  background: var(--gg-off);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px 20px;
}

.certificate-toolbar {
  width: 100%;
  max-width: 760px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.certificate-card {
  width: 100%;
  max-width: 760px;
  background: white;
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  padding: 16px;
}

.certificate-border {
  border: 2px solid var(--gg-mid);
  border-radius: 8px;
  padding: 56px 48px;
  text-align: center;
}

.certificate-logo { height: 56px; width: auto; margin-bottom: 20px; }

.certificate-eyebrow {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gg-muted);
  margin-bottom: 28px;
}

.certificate-name {
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: 700;
  color: var(--gg-dark);
  margin-bottom: 8px;
}

.certificate-line {
  font-size: 15px;
  color: var(--gg-muted);
  font-style: italic;
  margin-bottom: 8px;
}

.certificate-workshop {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  color: var(--gg-mid);
  margin-bottom: 40px;
}

.certificate-meta {
  display: flex;
  justify-content: center;
  gap: 64px;
  margin-bottom: 32px;
}
.certificate-meta-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gg-muted);
  margin-bottom: 4px;
}
.certificate-meta-value {
  font-size: 15px;
  font-weight: 600;
  color: var(--gg-dark);
}

.certificate-tag {
  font-family: var(--font-display);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gg-muted);
  padding-top: 24px;
  border-top: 1px solid var(--gg-pale);
}

.certificate-error {
  text-align: center;
  max-width: 400px;
  margin-top: 40px;
}
.certificate-error p { color: var(--gg-muted); margin-bottom: 20px; }

@media print {
  .no-print { display: none !important; }
  .certificate-page { padding: 0; background: white; }
  .certificate-card { box-shadow: none; max-width: 100%; }
}
