/* ========================================================
   Rumah Sakit JIH Yogyakarta — Portal Digital Signature
   Design System & Professional Clinical Styles
   ======================================================== */

:root {
  /* Palet putih-biru: navy logo RS JIH dan aksen biru antarmuka */
  --jih-primary: #3e4870;
  --jih-primary-hover: #303957;
  --jih-primary-light: #53638c;
  --jih-primary-soft: #eef1f8;
  --jih-primary-surface: #f7f9fc;

  --jih-accent: #09558b;
  --jih-accent-dark: #08456f;
  --jih-accent-soft: #eef5fb;

  /* Netral & Background Medis */
  --bg-body: #ffffff;
  --bg-card: #ffffff;
  --bg-subtle: #f3f6fb;
  --bg-input: #ffffff;

  /* Batas & Garis */
  --border-light: #dce3f0;
  --border-input: #b6c4d9;
  --border-focus: #3e4870;

  /* Tipografi */
  --text-primary: #24324b;
  --text-secondary: #53627a;
  --text-muted: #5c6b84;
  --text-inverse: #ffffff;

  /* Status Klinis */
  --status-signed: #166534;
  --status-signed-bg: #ecfdf5;
  --status-signed-border: #a7f3d0;

  --status-draft: #b45309;
  --status-draft-bg: #fffbeb;
  --status-draft-border: #fde68a;

  --status-danger: #b91c1c;
  --status-danger-bg: #fef2f2;
  --status-danger-border: #fecaca;

  --status-info: #0369a1;
  --status-info-bg: #f0f9ff;
  --status-info-border: #bae6fd;

  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;

  --shadow-card: 0 2px 10px rgba(35, 52, 86, 0.05), 0 1px 3px rgba(0, 0, 0, 0.04);
  --shadow-hover: 0 8px 24px rgba(35, 52, 86, 0.08);

  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 15px;
  color: var(--text-primary);
  background-color: var(--bg-body);
  min-height: 100dvh;
}

body {
  font-family: var(--font-sans);
  line-height: 1.6;
  min-height: 100dvh;
  color: var(--text-primary);
  background-color: var(--bg-body);
  display: flex;
  flex-direction: column;
}

/* Wrapper Layout */
.app-wrapper {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 20px 48px;
  width: 100%;
}

/* Header RS JIH */
.app-header {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 20px 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: var(--shadow-card);
  margin-bottom: 24px;
}

.app-header__brand {
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand-logo__svg {
  width: 48px;
  height: 48px;
  display: block;
}

.brand-title {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  color: var(--jih-primary);
  line-height: 1.2;
}

.brand-location {
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--jih-accent-dark);
}

.brand-tagline {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-style: italic;
  margin-top: 2px;
}

.app-header__right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.system-title {
  text-align: right;
}

.system-title__main {
  display: block;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
}

.system-title__sub {
  display: block;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.badge-poc {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 3px 9px;
  background: var(--jih-accent-soft);
  color: var(--jih-accent-dark);
  border: 1px solid var(--jih-accent);
  border-radius: 4px;
}

.connection-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 10px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
}

.connection-status__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--text-muted);
}

.connection-status--ok .connection-status__dot {
  background-color: var(--jih-primary);
}

.connection-status--error .connection-status__dot {
  background-color: var(--status-danger);
}

/* Navigasi Tab */
.tab-nav {
  display: flex;
  gap: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 6px;
  box-shadow: var(--shadow-card);
  margin-bottom: 24px;
}

.tab-nav__btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 16px;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.tab-nav__icon {
  width: 18px;
  height: 18px;
}

.tab-nav__btn:hover {
  background: var(--jih-primary-soft);
  color: var(--jih-primary);
}

.tab-nav__btn.active {
  background: var(--jih-primary);
  color: #ffffff;
}

/* Tab Panels */
.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

/* Card Container */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-card);
}

.card__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 22px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-light);
}

.card__title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--jih-primary);
}

.card__desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* Stepper Alur Tanda Tangan */
.stepper {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
  padding: 16px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
}

.stepper__step {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-muted);
}

.stepper__circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid var(--border-input);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
}

.stepper__label {
  font-size: 0.85rem;
  font-weight: 600;
}

.stepper__line {
  flex: 1;
  max-width: 90px;
  height: 2px;
  background: var(--border-light);
  margin: 0 16px;
}

.stepper__step.active {
  color: var(--jih-primary);
}

.stepper__step.active .stepper__circle {
  border-color: var(--jih-primary);
  background: var(--jih-primary);
  color: #ffffff;
}

.stepper__step.completed {
  color: var(--status-signed);
}

.stepper__step.completed .stepper__circle {
  border-color: var(--status-signed);
  background: var(--status-signed-bg);
  color: var(--status-signed);
}

/* Form Styles */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.form-group {
  display: flex;
  flex-direction: column;
}

.form-group--full {
  grid-column: 1 / -1;
}

.form-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.form-input {
  width: 100%;
  padding: 11px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border-input);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.9rem;
  color: var(--text-primary);
  transition: var(--transition);
}

.form-input--mono {
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

.form-input:focus {
  outline: none;
  border-color: var(--jih-primary);
  box-shadow: 0 0 0 3px rgba(62, 72, 112, 0.12);
}

.form-hint {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 5px;
}

.form-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 10px;
}

/* Tombol */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: var(--transition);
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn--primary {
  background: var(--jih-primary);
  color: #ffffff;
}

.btn--primary:hover:not(:disabled) {
  background: var(--jih-primary-hover);
}

.btn--large {
  padding: 14px 28px;
  font-size: 0.95rem;
}

.btn--outline {
  background: transparent;
  border-color: var(--jih-primary);
  color: var(--jih-primary);
}

.btn--outline:hover:not(:disabled) {
  background: var(--jih-primary-soft);
}

.btn--ghost {
  background: transparent;
  color: var(--text-secondary);
}

.btn--ghost:hover:not(:disabled) {
  background: var(--bg-subtle);
  color: var(--text-primary);
}

.btn--sm {
  padding: 6px 12px;
  font-size: 0.8rem;
}

/* File Drop Zone Medis */
.file-drop {
  border: 2px dashed var(--border-input);
  border-radius: var(--radius-md);
  padding: 36px 20px;
  text-align: center;
  position: relative;
  background: var(--jih-primary-surface);
  cursor: pointer;
  transition: var(--transition);
}

.file-drop:hover, .file-drop.dragover {
  border-color: var(--jih-primary);
  background: var(--jih-primary-soft);
}

.file-drop__input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.file-drop__icon-wrap {
  width: 48px;
  height: 48px;
  margin: 0 auto 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--jih-primary-soft);
  color: var(--jih-primary);
  border-radius: 50%;
}

.file-drop__svg {
  width: 24px;
  height: 24px;
}

.file-drop__text {
  font-size: 0.9rem;
  color: var(--text-primary);
}

.file-drop__hint {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.file-drop__selected {
  margin-top: 14px;
  padding: 12px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
}

/* Notice Box */
.notice-box {
  display: flex;
  gap: 14px;
  padding: 16px;
  background: var(--jih-primary-soft);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  color: var(--text-primary);
  line-height: 1.6;
}

.notice-box__icon {
  width: 20px;
  height: 20px;
  color: var(--jih-primary);
  flex-shrink: 0;
  margin-top: 2px;
}

/* Progress Bar */
.progress-meta {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
}

.progress-bar {
  height: 8px;
  background: var(--bg-subtle);
  border-radius: 4px;
  overflow: hidden;
}

.progress-bar__fill {
  height: 100%;
  background: var(--jih-primary);
  transition: width 0.3s ease;
}

/* Status Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.badge--draft {
  background: var(--status-draft-bg);
  color: var(--status-draft);
  border: 1px solid var(--status-draft-border);
}

.badge--uploaded {
  background: var(--status-info-bg);
  color: var(--status-info);
  border: 1px solid var(--status-info-border);
}

.badge--signing {
  background: var(--jih-accent-soft);
  color: var(--jih-accent-dark);
  border: 1px solid var(--jih-accent);
}

.badge--signed {
  background: var(--status-signed-bg);
  color: var(--status-signed);
  border: 1px solid var(--status-signed-border);
}

.badge--failed {
  background: var(--status-danger-bg);
  color: var(--status-danger);
  border: 1px solid var(--status-danger-border);
}

/* Output Blocks & Hasil Pengesahan */
.output-block {
  margin-top: 18px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 16px;
}

.output-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-light);
  font-size: 0.85rem;
}

.output-row:last-child {
  border-bottom: none;
}

.output-row__label {
  color: var(--text-secondary);
  font-weight: 500;
}

.output-row__value {
  color: var(--text-primary);
  font-weight: 600;
  text-align: right;
}

.output-row__value--mono {
  font-family: var(--font-mono);
  font-size: 0.8rem;
}

/* Result Banners */
.result-banner {
  padding: 16px 20px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 18px;
}

.result-banner--authentic {
  background: var(--status-signed-bg);
  border: 1px solid var(--status-signed-border);
  color: var(--status-signed);
}

.result-banner--not-authentic {
  background: var(--status-danger-bg);
  border: 1px solid var(--status-danger-border);
  color: var(--status-danger);
}

.result-banner--unknown {
  background: var(--status-draft-bg);
  border: 1px solid var(--status-draft-border);
  color: var(--status-draft);
}

.result-banner__icon-wrap {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #ffffff;
  flex-shrink: 0;
}

.result-banner__title {
  font-weight: 700;
  font-size: 0.95rem;
}

.result-banner__desc {
  font-size: 0.8rem;
  opacity: 0.9;
  margin-top: 2px;
}

/* Table Style */
.table-wrapper {
  overflow-x: auto;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  margin-top: 14px;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.85rem;
}

.data-table th {
  background: var(--bg-subtle);
  padding: 12px 14px;
  font-weight: 700;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-light);
  white-space: nowrap;
}

.data-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-primary);
}

.data-table tr:last-child td {
  border-bottom: none;
}

.data-table tr:hover td {
  background: var(--jih-primary-surface);
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 48px 20px;
}

.empty-state__icon-wrap {
  width: 52px;
  height: 52px;
  margin: 0 auto 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-subtle);
  border-radius: 50%;
  color: var(--text-muted);
}

.empty-state__title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.empty-state__desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* Alerts */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  margin-top: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.alert--error {
  background: var(--status-danger-bg);
  border: 1px solid var(--status-danger-border);
  color: var(--status-danger);
}

.alert--success {
  background: var(--status-signed-bg);
  border: 1px solid var(--status-signed-border);
  color: var(--status-signed);
}

.alert--info {
  background: var(--status-info-bg);
  border: 1px solid var(--status-info-border);
  color: var(--status-info);
}

/* Spinner */
.spinner {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.spinner__ring {
  width: 18px;
  height: 18px;
  border: 2px solid var(--border-light);
  border-top-color: var(--jih-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.copy-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-input);
  border-radius: 4px;
  padding: 2px 7px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
}

.copy-btn:hover {
  background: var(--jih-primary);
  color: #ffffff;
  border-color: var(--jih-primary);
}

.page-footer-actions {
  text-align: center;
  margin-top: 20px;
}

.app-footer {
  margin-top: 40px;
  text-align: center;
  padding-top: 20px;
  border-top: 1px solid var(--border-light);
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.app-footer__sub {
  margin-top: 4px;
  color: var(--text-muted);
}

.hidden {
  display: none !important;
}

.mt-4 { margin-top: 16px; }
.mb-2 { margin-bottom: 8px; }
.text-sm { font-size: 0.8rem; }
.text-secondary { color: var(--text-secondary); }
.font-semibold { font-weight: 600; }
.font-mono { font-family: var(--font-mono); }
.text-success { color: var(--status-signed); }
.text-danger { color: var(--status-danger); }

@media (max-width: 768px) {
  .app-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }
  .app-header__right {
    align-items: flex-start;
  }
  .system-title {
    text-align: left;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .tab-nav {
    flex-wrap: wrap;
  }
}

/* Public validation portal */
.public-portal { max-width: 900px; }
.public-logo { width: 44px; height: 44px; flex-shrink: 0; }
.public-intro { max-width: 660px; margin: 36px 0 28px; }
.public-eyebrow { color: var(--jih-primary); font-size: .72rem; font-weight: 700; letter-spacing: .14em; margin-bottom: 10px; }
.public-intro h1 { font-size: clamp(1.6rem, 4vw, 2.3rem); line-height: 1.25; letter-spacing: -.035em; margin-bottom: 14px; }
.public-intro > p:last-child { color: var(--text-secondary); }
.public-fieldset { border: 0; min-width: 0; }
.public-fieldset:disabled { opacity: .7; }
.public-portal .tab-nav__btn { flex: 1; justify-content: center; }
.public-note { color: var(--text-secondary); font-size: .85rem; margin: 18px 6px 0; }
.public-result { border: 1px solid; border-radius: 10px; padding: 20px; }
.public-result h3 { font-size: 1rem; margin-bottom: 6px; }
.public-result p { font-size: .9rem; }
.public-result--success { color: var(--status-signed); background: var(--status-signed-bg); border-color: var(--status-signed-border); }
.public-result--warning { color: #854d0e; background: #fffbeb; border-color: #fde68a; }
.public-result--error { color: #991b1b; background: #fef2f2; border-color: #fecaca; }
.public-portal progress { width: 100%; height: 10px; accent-color: var(--jih-primary); display: block; margin-top: 8px; }
.public-portal :focus-visible { outline: 3px solid var(--jih-accent); outline-offset: 4px; }
.public-portal .file-drop:focus-within { outline: 3px solid var(--jih-accent); outline-offset: 4px; }
.public-portal .form-actions { flex-wrap: wrap; }
.public-portal .app-footer { line-height: 1.7; }
@media (max-width: 480px) {
  .public-portal { padding: 16px 12px 30px; }
  .public-portal .app-header, .public-portal .card { padding: 20px; }
  .public-portal .tab-nav__btn { font-size: .85rem; padding: 14px 8px; }
  .public-portal .file-drop { padding: 30px 14px; }
}

/* ============================================================
   Public Verification Report — Hospital Identity (no PSrE)
   ============================================================ */
.public-portal { max-width: 1280px; }
.public-portal.portal-has-result .public-intro,
.public-portal.portal-has-result .tab-nav,
.public-portal.portal-has-result .validate-workspace,
.public-portal.portal-has-result .qr-workspace { display: none; }
.public-portal.portal-has-result #outputValidate,
.public-portal.portal-has-result #outputQrValidation { margin-top: 0; }
.public-portal.portal-has-result { padding-bottom: 56px; }

/* Entry animation */
.validation-report {
  color: var(--text-primary);
  animation: vr-enter .45s cubic-bezier(.4, 0, .2, 1);
}
@keyframes vr-enter {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: none; }
}

/* ---- Banner ---- */
.vr-banner {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 24px;
  align-items: center;
  padding: 28px 36px;
  border: 1px solid var(--status-signed-border);
  border-radius: 24px;
  background: var(--status-signed-bg);
  box-shadow: 0 10px 32px rgba(22, 101, 52, .06);
  overflow: hidden;
  position: relative;
}
.vr-banner::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(600px 320px at 100% 120%, rgba(22, 101, 52,.04), transparent 60%);
  pointer-events: none;
}
.vr-banner-icon-wrap {
  position: relative;
  z-index: 1;
}
.vr-icon.vr-banner-icon {
  width: 72px;
  height: 72px;
  padding: 19px;
  border-radius: 50%;
  color: var(--text-inverse);
  background: var(--status-signed);
  box-shadow: 0 8px 24px rgba(22, 101, 52, .16);
}
@keyframes vr-pulse {
  0%, 100% { transform: scale(1); box-shadow: 0 8px 28px rgba(62, 72, 112,.32); }
  50%       { transform: scale(1.04); box-shadow: 0 12px 36px rgba(62, 72, 112,.22); }
}
.vr-banner-copy {
  position: relative;
  z-index: 1;
}
.vr-banner h2 {
  font-size: clamp(1.2rem, 2.4vw, 1.6rem);
  font-weight: 800;
  line-height: 1.3;
  letter-spacing: -.035em;
  color: var(--status-signed);
  margin-bottom: 12px;
  text-wrap: balance;
}

/* Badge row in banner */
.vr-banner-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
}
.vr-banner-note { color: var(--status-signed); font-size: .9rem; line-height: 1.7; margin-bottom: 12px; max-width: 65ch; }
.vr-banner-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-weight: 600;
  font-size: .875rem;
  color: var(--status-signed);
}
.vr-icon.vr-badge-icon {
  width: 18px;
  height: 18px;
  background: var(--status-signed);
  color: #fff;
  border-radius: 50%;
  padding: 3px;
  flex-shrink: 0;
}
.vr-badge-icon svg { width: 100%; height: 100%; }

/* Icon base */
.vr-icon { width: 22px; height: 22px; display: inline-flex; flex-shrink: 0; align-items: center; justify-content: center; }
.vr-icon svg { width: 100%; height: 100%; }

/* ---- Divider ---- */
.vr-divider { display: flex; align-items: center; gap: 18px; margin: 32px 0 20px; }
.vr-divider::before, .vr-divider::after { content: ''; flex: 1; height: 1px; background: #c3d3e9; }
.vr-divider h3 {
  border: 1px solid #c3d3e9;
  background: var(--jih-accent-soft);
  color: var(--jih-accent-dark);
  padding: 8px 22px;
  border-radius: 30px;
  font-size: .95rem;
  font-weight: 700;
  white-space: nowrap;
}

/* ---- Summary Grid (2-col) ---- */
.vr-summary-grid {
  display: grid;
  grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr);
  gap: 18px;
}

/* Card shell */
.vr-card {
  min-width: 0;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 22px;
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: box-shadow .2s ease;
}
.vr-card:hover { box-shadow: var(--shadow-hover); }
.vr-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-subtle);
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-light);
}
.vr-card-head h4 {
  text-transform: uppercase;
  letter-spacing: .07em;
  font-size: .7rem;
  font-weight: 700;
  color: var(--text-secondary);
  flex: 1;
}
.vr-card-head > .vr-icon { color: var(--jih-primary); }
.vr-card-body { padding: 20px 22px; }
.vr-card-note { font-size: .84rem; line-height: 1.7; color: var(--text-secondary); margin-top: 8px; }

/* ---- Sign count widget ---- */
.vr-sign-count { display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: start; }
.vr-sign-index {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, var(--jih-primary-light), var(--jih-primary));
  color: var(--text-inverse);
  font-weight: 800;
  font-size: 1.05rem;
  font-variant-numeric: tabular-nums;
  box-shadow: 0 4px 12px rgba(62, 72, 112,.28);
}
.vr-sign-label { display: block; font-size: .95rem; font-weight: 700; line-height: 1.4; }

/* ---- Pills ---- */
.vr-pill {
  display: inline-block;
  border-radius: 20px;
  padding: 4px 12px;
  font-size: .72rem;
  font-weight: 700;
  line-height: 1.5;
  white-space: nowrap;
}
.vr-pill-success { background: var(--status-signed-bg);  color: var(--status-signed);  border: 1px solid var(--status-signed-border); }
.vr-pill-warn    { background: var(--status-draft-bg);   color: var(--status-draft);   border: 1px solid var(--status-draft-border); }
.vr-pill-neutral { background: var(--bg-subtle);         color: var(--text-secondary); border: 1px solid var(--border-light); }
.vr-pill-blue    { background: var(--jih-primary-soft);  color: var(--jih-primary);    border: 1px solid #c3d3e9; }

/* ---- Facts table (dl) ---- */
.vr-facts { font-size: .875rem; }
.vr-facts-row {
  display: grid;
  grid-template-columns: minmax(130px, .7fr) minmax(0, 1.3fr);
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--border-light);
  align-items: start;
}
.vr-facts-row:last-child { border-bottom: 0; }
.vr-facts dt { color: var(--text-secondary); font-weight: 500; }
.vr-facts dd {
  margin: 0;
  font-weight: 600;
  overflow-wrap: anywhere;
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
  line-height: 1.55;
}

/* ---- Preview link ---- */
.vr-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--jih-primary);
  background: var(--jih-primary-soft);
  border: 1px solid #c3d3e9;
  border-radius: 20px;
  padding: 6px 14px;
  font-size: .75rem;
  font-weight: 700;
  white-space: nowrap;
  text-decoration: none;
  margin-left: auto;
  min-height: 34px;
  transition: var(--transition);
}
.vr-link:hover { background: var(--jih-primary); color: #fff; border-color: var(--jih-primary); }

/* ---- Signer bar (row) ---- */
.vr-signer-bar {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.5fr) auto;
  gap: 16px 22px;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 22px;
  padding: 18px 24px;
  box-shadow: var(--shadow-card);
  margin-top: 4px;
}
.vr-signer-identity { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; min-width: 0; }
.vr-signer-names    { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.vr-signer-names strong, .vr-signer-identity > strong { overflow-wrap: anywhere; font-size: .95rem; }
.vr-avatar {
  background: linear-gradient(145deg, var(--jih-primary-light), var(--jih-primary));
  color: var(--text-inverse);
  width: 42px;
  height: 42px;
  padding: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 3px 10px rgba(62, 72, 112,.22);
}
.vr-signer-meta  { display: flex; flex-wrap: wrap; gap: 8px 18px; color: var(--text-secondary); font-size: .83rem; }
.vr-meta-item    { display: inline-flex; align-items: center; gap: 7px; min-width: 0; }
.vr-meta-item .vr-icon { width: 16px; height: 16px; color: var(--jih-primary); }

/* Lihat Detil button */
.vr-detail-toggle {
  border: 1px solid var(--border-input);
  background: var(--bg-card);
  color: var(--text-primary);
  border-radius: 24px;
  padding: 10px 18px;
  font: inherit;
  font-size: .82rem;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  min-height: 44px;
  transition: var(--transition);
}
.vr-detail-toggle:hover  { background: var(--jih-primary-soft); border-color: var(--jih-primary); color: var(--jih-primary); }
.vr-detail-toggle:active { transform: translateY(1px) scale(.98); }

/* ---- Expanded detail panel ---- */
.vr-expanded {
  margin-top: 16px;
  padding: 20px;
  border-radius: 22px;
  border: 1px solid #c3d3e9;
  background:
    radial-gradient(900px 160px at 100% 0%, rgba(9, 85, 139,.08), transparent 50%),
    var(--jih-primary-surface);
}
.vr-expanded[hidden] { display: none !important; }

.vr-detail-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px 22px;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 18px;
  padding: 16px 20px;
  box-shadow: var(--shadow-card);
  margin-bottom: 18px;
}

.vr-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px;
}

/* ---- Verification check rows ---- */
.vr-check {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: start;
  gap: 10px 14px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border-light);
}
.vr-check:last-child { border-bottom: 0; }
.vr-check > .vr-icon {
  width: 44px;
  height: 44px;
  padding: 10px;
  border-radius: 14px;
  flex-shrink: 0;
}
.vr-check-ok      { background: linear-gradient(145deg, var(--jih-primary-light), var(--jih-primary)); color: #fff; box-shadow: 0 4px 12px rgba(62, 72, 112,.22); }
.vr-check-warn    { background: var(--status-draft-bg); color: var(--status-draft); border: 1px solid var(--status-draft-border); }
.vr-check-pending { background: var(--bg-subtle); color: var(--text-muted); border: 1px solid var(--border-light); }
.vr-check-text    { min-width: 0; }
.vr-check strong  { font-size: .9rem; display: block; }
.vr-check-desc    { color: var(--text-secondary); font-size: .8rem; margin-top: 4px; line-height: 1.5; }

/* ---- Actions row ---- */
.vr-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.vr-reset {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--jih-primary);
  color: var(--text-inverse);
  font: inherit;
  font-weight: 700;
  font-size: .9rem;
  border: 1px solid var(--jih-primary);
  border-radius: 14px;
  padding: 13px 28px;
  min-height: 48px;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 4px 14px rgba(35, 52, 86, .14);
}
.vr-reset:hover  { background: var(--jih-primary-hover); border-color: var(--jih-primary-hover); color: #fff; }
.vr-reset:active { transform: translateY(1px) scale(.98); }
.vr-reset--outline { background: var(--bg-card); color: var(--jih-primary); box-shadow: none; }
.vr-reset--outline:hover { background: var(--jih-primary-soft); color: var(--jih-primary); }
.vr-reset-icon   { width: 18px; height: 18px; flex-shrink: 0; }
.vr-reset-icon svg { width: 100%; height: 100%; }

/* ---- Misc ---- */
.public-intro h1 { text-wrap: balance; }
.public-portal .btn:active:not(:disabled) { transform: translateY(1px) scale(.98); }

/* ---- Responsive ---- */
@media (max-width: 960px) {
  .vr-summary-grid,
  .vr-detail-grid { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .vr-signer-bar { grid-template-columns: 1fr 1fr; }
  .vr-detail-toggle { grid-column: 1 / -1; justify-self: start; }
}
@media (max-width: 640px) {
  .vr-banner { grid-template-columns: 1fr; padding: 22px 20px; gap: 16px; }
  .vr-banner-icon { width: 52px; height: 52px; padding: 13px; }
  .vr-signer-bar { grid-template-columns: 1fr; }
  .vr-banner-badges { flex-direction: column; gap: 8px; }
  .vr-facts-row { grid-template-columns: 1fr; gap: 3px; }
  .vr-check { grid-template-columns: 44px minmax(0, 1fr); }
  .vr-check > .vr-pill { grid-column: 2; justify-self: start; }
  .vr-card-body { padding: 16px; }
  .vr-card-head { padding: 12px 16px; flex-wrap: wrap; }
  .vr-divider { gap: 8px; }
  .vr-divider h3 { padding: 7px 14px; font-size: .85rem; }
  .vr-expanded { padding: 14px; }
  .vr-detail-head { grid-template-columns: 1fr; }
}
