/* Shared visual finish. Load after page styles and before Apple compatibility. */
body {
  --bg: #f1f4f8;
  --paper: #fff;
  --bg-glow-a: rgba(21, 74, 145, .035);
  --bg-glow-b: rgba(15, 107, 97, .035);
  --admin-bg: #f1f4f8;
  --admin-shadow-sm: 0 2px 10px rgba(19, 34, 56, .045);
  --admin-shadow-lg: 0 8px 24px rgba(19, 34, 56, .065);
}

body[data-theme="dark"] {
  --bg: #0c1422;
  --paper: #111d31;
  --bg-glow-a: rgba(72, 130, 221, .06);
  --bg-glow-b: rgba(44, 144, 124, .04);
  --admin-bg: #0c1422;
  --admin-shadow-sm: 0 2px 10px rgba(0, 0, 0, .15);
  --admin-shadow-lg: 0 8px 24px rgba(0, 0, 0, .2);
}

.top-nav-card {
  padding: 22px 24px;
  background: var(--surface);
  border-color: var(--line);
  box-shadow: 0 2px 12px rgba(19, 34, 56, .045);
}

body[data-theme="dark"] .top-nav-card { background: var(--surface); }
.hero h1 { font-size: clamp(22px, 2.1vw, 30px); letter-spacing: -.025em; line-height: 1.25; margin-block: 8px; }
.hero .subhead { font-size: 14px; line-height: 1.6; }

#fullForm { padding: clamp(14px, 2vw, 24px); background: var(--surface); box-shadow: 0 4px 20px rgba(19, 34, 56, .045); }
#fullForm .section-card,
body.admin-shell-page #editForm .form-step > .section-card {
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: none;
  padding: clamp(16px, 1.7vw, 24px);
  margin-bottom: 18px;
}

#fullForm .section-card > h2,
body.admin-shell-page #editForm .section-card > h2 {
  color: var(--ink);
  font-size: 18px;
  font-weight: 700;
  line-height: 1.4;
  padding-bottom: 12px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

#fullForm .form-row { margin-bottom: 12px; }
#fullForm .form-row > label,
body.admin-shell-page #editForm .form-row > label {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.5;
  margin-bottom: 6px;
}

#fullForm .stepper { box-shadow: none; border-radius: 10px; background: var(--surface-soft); padding: 8px; }
#fullForm .stepper button { min-height: 40px; border-radius: 8px; }
#fullForm .form-summary { margin-block: 12px 18px; gap: 8px; }
#fullForm .form-nav { box-shadow: none; border-top: 1px solid var(--line); padding-top: 16px; }

.admin-main .card { box-shadow: var(--admin-shadow-sm); }
.admin-topbar { box-shadow: none; border-bottom: 1px solid var(--admin-line); }
.admin-main .panel-head { padding-bottom: 16px; gap: 12px; }
.admin-main .page-hero { background: var(--admin-surface); box-shadow: var(--admin-shadow-sm); }
.admin-main :is(h1, h2, .page-hero-title) { font-weight: 700; }
.admin-main table th { font-weight: 700; line-height: 1.5; }
.admin-main table td { line-height: 1.6; }
.admin-main table tbody tr:hover { background: var(--admin-surface-soft); }

.admin-main { grid-template-columns: minmax(0, 1fr); }
.admin-main > *, .admin-system-title { min-width: 0; }
.admin-system-title { overflow-wrap: anywhere; }
.section-card h2 { overflow-wrap: anywhere; }

/* Right-aligned tooltips stay inside the field even when visually hidden. */
.contact-number-control .contact-add-button::after {
  left: auto;
  right: 0;
  transform: translateY(4px);
  max-width: min(240px, 65vw);
  width: max-content;
  white-space: normal;
}
.contact-number-control .contact-add-button:hover::after,
.contact-number-control .contact-add-button:focus-visible::after { transform: translateY(0); }

/* Native controls keep their existing focus/error styles and theme colors. */
.card input:not([type="checkbox"]):not([type="radio"]), .card select, .card textarea {
  box-shadow: none;
}
.card input:focus-visible, .card select:focus-visible, .card textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

@media (max-width: 640px) {
  .top-nav-card { padding: 18px 16px; }
  #fullForm .section-card { padding: 16px 12px; }
  #fullForm .form-summary { gap: 6px; }
  body.admin-shell-page #editForm .vax-row-2 > .form-row,
  #fullForm .vax-row-2 > .form-row { min-width: 0 !important; }
}
