/* PROJETO DESENVOLVIDO POR GUSTAVO MAGGI - TODOS OS DIREITOS RESERVADOS. */
:root {
  color-scheme: light;
  --bg: #f8fafc;
  --bg-gradient-start: #f8fafc;
  --bg-glow: rgba(5, 150, 105, 0.08);
  --surface: #ffffff;
  --card-surface: #ffffff;
  --surface-elevated: rgba(255, 255, 255, 0.8);
  --header-bg: rgba(248, 250, 252, 0.8);
  --border-subtle: #e2e8f0;
  --card-border: rgba(5, 150, 105, 0.12);
  --accent-glow: rgba(5, 150, 105, 0.35);
  --surface-soft: #f1f5f9;
  --surface-glass: rgba(255, 255, 255, 0.96);
  --topbar-glass: rgba(255, 255, 255, 0.92);
  --tabs-glass: rgba(255, 255, 255, 0.94);
  --input-bg: #ffffff;
  --ghost-bg: #ffffff;
  --label-color: #334155;
  --text: #0f172a; /* slate-900 */
  --muted: #64748b;
  --line: #e2e8f0;
  --primary: #059669;
  --primary-dark: #047857;
  --primary-soft: #d1fae5;
  --header-height: 4.5rem;
  --sticky-filters-top: 4.5rem;
  --layout-max: 82rem;
  --touch-target: 48px;
  --btn-radius: 12px;
  --danger: #b42318;
  --danger-soft: #fee4e2;
  --warning: #9a6700;
  --warning-soft: #fff2c7;
  --success: #1f7a4d;
  --success-soft: #dcf5e8;
  --pill-neutral-bg: #edf1f5;
  --pill-neutral-text: #344054;
  --pill-badge-bg: #dff2ef;
  --metric-hover-bg: #fbfefd;
  --metric-feature-bg: linear-gradient(180deg, #f0faf7, #ffffff);
  --admission-header-bg: #fbfcfd;
  --evolution-compact-bg: #ffffff;
  --empty-bg: #ffffff;
  --alert-bg: #fff8df;
  --alert-text: #5f4200;
  --modal-backdrop: rgba(15, 23, 42, 0.42);
  --focus-ring: rgba(5, 150, 105, 0.15);
  --skeleton-base: #e2e8f0;
  --skeleton-shine: #f1f5f9;
  --shadow: 0 18px 44px rgba(16, 24, 40, 0.10);
  --shadow-soft: 0 8px 22px rgba(16, 24, 40, 0.07);
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #020617;
  --bg-gradient-start: #020617;
  --bg-glow: rgba(52, 211, 153, 0.06);
  --surface: #0f172a;
  --card-surface: #0f172a;
  --surface-elevated: rgba(2, 6, 23, 0.8);
  --header-bg: rgba(2, 6, 23, 0.8);
  --border-subtle: rgba(16, 185, 129, 0.1);
  --card-border: rgba(16, 185, 129, 0.1);
  --accent-glow: rgba(52, 211, 153, 0.4);
  --surface-soft: #1e293b;
  --skeleton-base: #1e293b;
  --skeleton-shine: #334155;
  --surface-glass: rgba(26, 35, 50, 0.96);
  --topbar-glass: rgba(26, 35, 50, 0.92);
  --tabs-glass: rgba(26, 35, 50, 0.94);
  --input-bg: #1e2938;
  --ghost-bg: #1e2938;
  --label-color: #c5d0de;
  --text: #f1f5f9; /* slate-100 */
  --muted: #94a3b8;
  --line: #2d3a4d;
  --primary: #34d399;
  --primary-dark: #6ee7b7;
  --primary-soft: #064e3b;
  --danger: #f87171;
  --danger-soft: #3b1f1f;
  --warning: #fbbf24;
  --warning-soft: #3d3014;
  --success: #4ade80;
  --success-soft: #143226;
  --pill-neutral-bg: #243044;
  --pill-neutral-text: #c5d0de;
  --pill-badge-bg: #12312e;
  --metric-hover-bg: #1f2d3f;
  --metric-feature-bg: linear-gradient(180deg, #163530, #1a2332);
  --admission-header-bg: #15202b;
  --evolution-compact-bg: #1e2938;
  --empty-bg: #1a2332;
  --alert-bg: #3d3014;
  --alert-text: #fde68a;
  --modal-backdrop: rgba(0, 0, 0, 0.65);
  --focus-ring: rgba(45, 212, 191, 0.2);
  --shadow: 0 18px 44px rgba(0, 0, 0, 0.35);
  --shadow-soft: 0 8px 22px rgba(0, 0, 0, 0.25);
}

* {
  box-sizing: border-box;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
.tab:focus-visible,
.chip:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

html {
  scroll-behavior: auto;
}

html.theme-fade,
html.theme-fade body,
html.theme-fade .app-shell,
html.theme-fade .app-navbar,
html.theme-fade .profile-sticky-nav,
html.theme-fade .card,
html.theme-fade .login-shell,
html.theme-fade .dashboard-panel {
  transition:
    background-color 0.3s ease,
    color 0.3s ease,
    border-color 0.3s ease,
    box-shadow 0.3s ease;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at top left, var(--bg-glow), transparent 34rem),
    linear-gradient(180deg, var(--bg-gradient-start) 0%, var(--bg) 100%);
  font-family: "Inter", system-ui, -apple-system, Segoe UI, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  letter-spacing: 0;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

p,
li {
  overflow-wrap: anywhere;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: clamp(16px, 4vw, 32px);
  position: relative;
  font-family: "Inter", var(--font, system-ui, sans-serif);
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, var(--bg-glow), transparent 55%),
    linear-gradient(180deg, var(--bg-gradient-start) 0%, var(--bg) 100%);
}

.app-init-loading {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, var(--bg-glow), transparent 55%),
    linear-gradient(180deg, var(--bg-gradient-start) 0%, var(--bg) 100%);
}

.app-init-loading__card {
  text-align: center;
  padding: 28px 32px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  box-shadow: var(--shadow);
}

.app-init-loading__title {
  margin: 0 0 8px;
  font-family: "Sora", "Inter", sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
}

.app-init-loading__text {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.app-init-loading__text::after {
  content: "";
  animation: initDots 1.2s steps(4, end) infinite;
}

@keyframes initDots {
  0% { content: ""; }
  25% { content: "."; }
  50% { content: ".."; }
  75% { content: "..."; }
}

.login-theme-bar {
  display: none;
  position: absolute;
  top: max(14px, env(safe-area-inset-top));
  right: max(14px, env(safe-area-inset-right));
  z-index: 2;
}

.login-card {
  width: min(90vw, 1000px);
  max-width: 1000px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  align-items: stretch;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  border: 1px solid var(--line);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: var(--shadow);
  animation: rise 0.22s ease-out;
  backdrop-filter: blur(12px);
}

.login-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 18px;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  padding: clamp(28px, 5vw, 40px) clamp(20px, 4vw, 32px);
  background: linear-gradient(135deg, #0f172a 0%, #134e4a 100%);
  border-bottom: 1px solid var(--line);
  color: #f8fafc;
  box-sizing: border-box;
}

[data-theme="dark"] .login-brand {
  background: linear-gradient(135deg, #0f172a 0%, #134e4a 100%);
}

.login-brand .login-eyebrow {
  color: #99f6e4;
}

.login-brand .login-tagline {
  color: #cbd5e1;
}

.login-brand-copy {
  display: grid;
  gap: 8px;
  max-width: 36ch;
}

.login-hero-head {
  width: 100%;
  max-width: 100%;
  display: flex;
  justify-content: center;
  padding-inline: clamp(10px, 3vw, 18px);
  box-sizing: border-box;
  overflow: hidden;
}

.login-hero-title {
  position: relative;
  width: 100%;
  max-width: 100%;
  margin: 0 auto 4px;
  padding: 0;
  font-size: clamp(1.2rem, 4.5vw, 2.1rem);
  font-weight: 900;
  line-height: 1.15;
  letter-spacing: clamp(0.05em, 1.2vw, 0.12em);
  text-indent: 0;
  text-transform: uppercase;
  text-align: center;
  overflow: hidden;
  box-sizing: border-box;
}

.login-hero-title__text {
  display: block;
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  overflow: hidden;
  background: linear-gradient(
    105deg,
    #99f6e4 0%,
    #ecfeff 22%,
    #5eead4 45%,
    #fff 55%,
    #5eead4 72%,
    #99f6e4 100%
  );
  background-size: 220% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: login-hero-title-shine 4.5s ease-in-out infinite;
  filter: drop-shadow(0 2px 12px rgba(94, 234, 212, 0.35));
}

.login-hero-title--nurse-day .login-hero-title__text {
  animation:
    login-hero-title-shine 3s ease-in-out infinite,
    login-hero-title-celebrate 2.2s ease-in-out infinite;
}

@keyframes login-hero-title-shine {
  0%,
  100% {
    background-position: 0% center;
  }
  50% {
    background-position: 100% center;
  }
}

@keyframes login-hero-title-celebrate {
  0%,
  100% {
    filter: drop-shadow(0 2px 12px rgba(94, 234, 212, 0.35));
  }
  50% {
    filter: drop-shadow(0 4px 18px rgba(94, 234, 212, 0.55));
  }
}

.login-hero-fireworks {
  position: absolute;
  left: 50%;
  top: 55%;
  width: 1px;
  height: 1px;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 2;
}

.login-firework-particle {
  position: absolute;
  left: 0;
  top: 0;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--fx-color, #fbbf24);
  box-shadow: 0 0 10px var(--fx-color, #fbbf24);
  opacity: 0;
  animation: login-firework-burst var(--fx-duration, 1.6s) ease-out var(--fx-delay, 0s) infinite;
}

@keyframes login-firework-burst {
  0% {
    transform: translate(0, 0) scale(0.2);
    opacity: 0;
  }
  8% {
    opacity: 1;
  }
  100% {
    transform: translate(var(--fx-x, 0), var(--fx-y, -80px)) scale(0.15);
    opacity: 0;
  }
}

.logo-flip-card {
  width: min(100%, 380px);
  margin: 0 auto;
  perspective: 1100px;
  cursor: pointer;
  outline: none;
}

.logo-flip-inner {
  position: relative;
  width: 100%;
  min-height: clamp(150px, 28vw, 210px);
  transform-style: preserve-3d;
  transition: transform 0.7s cubic-bezier(0.4, 0.15, 0.2, 1);
  border-radius: 12px;
}

.logo-flip-card.is-flipped .logo-flip-inner,
.logo-flip-card.is-hover-flipped:not(.is-flipped) .logo-flip-inner {
  transform: rotateY(180deg);
}

@media (hover: hover) and (pointer: fine) {
  .logo-flip-card:hover .logo-flip-inner {
    transform: rotateY(180deg);
  }
}

.logo-flip-card:active .logo-flip-inner {
  transform: rotateY(180deg) scale(0.98);
}

@media (prefers-reduced-motion: reduce) {
  .logo-flip-card--animated .logo-flip-inner,
  .logo-flip-card--animated .logo-flip-front,
  .login-hero-title__text,
  .login-firework-particle {
    animation: none;
  }

  .logo-flip-card.is-flipped .logo-flip-inner,
  .logo-flip-card:hover .logo-flip-inner {
    transform: rotateY(180deg);
  }
}

.logo-flip-face {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: 12px;
  overflow: visible;
  background: transparent;
  box-shadow: none;
}

.logo-flip-back {
  transform: rotateY(180deg);
}

.login-logo {
  display: block;
  width: 100%;
  max-height: 210px;
  height: auto;
  margin: 0 auto;
  object-fit: contain;
  background: transparent;
  border-radius: 0;
  filter: drop-shadow(0 12px 28px rgba(0, 0, 0, 0.28));
}

.login-logo-back {
  width: 100%;
  height: 100%;
  max-height: none;
  min-height: clamp(150px, 28vw, 210px);
  object-fit: cover;
  border-radius: 12px;
}

.login-eyebrow {
  margin: 0;
  color: var(--primary);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.login-title {
  margin: 0;
  font-size: 1.25rem;
  line-height: 1.25;
  letter-spacing: -0.02em;
  font-weight: 800;
}

@media (min-width: 1024px) {
  .login-title {
    font-size: 1.875rem;
  }
}

.login-tagline {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.login-main {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: clamp(22px, 4vw, 36px);
}

.login-form-head,
.login-form,
.login-actions,
.login-error,
.remember-login {
  width: 100%;
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
}

.login-form-head {
  margin-bottom: 20px;
  text-align: center;
}

.login-form-eyebrow {
  margin: 0 0 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--primary);
}

.login-form-lead {
  margin: 8px 0 0;
  font-size: 14px;
  line-height: 1.55;
  color: var(--muted);
}

.login-form-head h2 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 800;
}

@media (min-width: 1024px) {
  .login-form-head h2 {
    font-size: 1.875rem;
  }
}

.login-field-modern {
  border-radius: 10px;
  background: color-mix(in srgb, var(--surface) 8%, transparent);
  border-color: color-mix(in srgb, var(--line) 90%, var(--primary));
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.login-field-modern:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary) 45%, transparent);
}

.login-actions-primary {
  display: grid;
  gap: 10px;
}

.login-btn-main {
  transition: transform 0.12s ease, background 0.15s ease;
}

.login-btn-main:active {
  transform: scale(0.95);
}

.login-secondary-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px 14px;
  margin-top: 4px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  width: 100%;
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
}

.login-link-ghost {
  border: 0;
  background: transparent;
  padding: 4px 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  text-decoration: underline transparent;
  text-underline-offset: 4px;
  transition: color 0.15s ease, text-decoration-color 0.15s ease;
}

.login-link-ghost:hover {
  color: var(--primary);
  text-decoration-color: var(--primary);
}

.login-btn-outline {
  border: 1px solid var(--line);
  background: transparent;
  border-radius: 10px;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, transform 0.12s ease;
}

.login-btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.login-btn-outline:active {
  transform: scale(0.95);
}

.login-actions-sep {
  color: var(--muted);
  font-weight: 700;
  user-select: none;
}

@media (max-width: 479px) {
  .login-actions-sep {
    display: none;
  }

  .login-secondary-actions {
    flex-direction: column;
  }
}

.login-form {
  display: grid;
  gap: 14px;
}

.login-google-hint {
  text-align: center;
  margin: 0;
}

.login-card-narrow {
  width: min(480px, 100%);
  grid-template-columns: 1fr;
  justify-items: center;
  min-height: auto;
}

.login-card-narrow .login-main {
  width: 100%;
}

.login-card-narrow .login-form-head,
.login-card-narrow .login-form,
.login-card-narrow .login-actions,
.login-card-narrow .login-error,
.login-card-narrow .pending-box {
  width: min(100%, 400px);
  margin-left: auto;
  margin-right: auto;
  min-width: 0;
}

/* Cadastro — layout responsivo */
.register-shell {
  align-items: flex-start;
  padding-top: max(20px, env(safe-area-inset-top));
  padding-bottom: max(24px, env(safe-area-inset-bottom));
  overflow-y: auto;
}

.register-shell .login-theme-bar {
  display: block;
}

.register-card {
  width: min(95%, 28rem);
  max-width: 100%;
  margin: 0 auto;
  padding: clamp(20px, 4vw, 28px);
  border-radius: 20px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  box-shadow: var(--shadow);
  animation: rise 0.22s ease-out;
}

.register-back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 20px;
  padding: 0;
  border: none;
  background: none;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: color 0.2s ease;
}

.register-back-link:hover {
  color: var(--primary);
}

.register-back-icon {
  font-size: 16px;
  line-height: 1;
}

.register-head {
  text-align: center;
  margin-bottom: 24px;
}

.register-eyebrow {
  margin: 0;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--primary);
}

.register-title {
  margin: 10px 0 0;
  font-size: clamp(1.5rem, 5vw, 1.875rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: var(--text);
}

.register-subtitle {
  margin: 12px auto 0;
  max-width: 32ch;
  font-size: 14px;
  line-height: 1.6;
  color: var(--muted);
}

.register-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.register-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.register-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}

.register-input-wrap {
  position: relative;
  display: block;
}

.register-input {
  width: 100%;
  min-height: 48px;
  padding: 12px 44px 12px 14px;
  border-radius: 10px;
  border: 1px solid color-mix(in srgb, var(--line) 85%, var(--primary) 15%);
  background: color-mix(in srgb, var(--surface) 75%, var(--bg) 25%);
  color: var(--text);
  font-size: 15px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.register-input::placeholder {
  color: color-mix(in srgb, var(--muted) 88%, transparent);
}

.register-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 28%, transparent);
  background: color-mix(in srgb, var(--surface) 88%, var(--primary-soft) 12%);
}

.register-input-wrap .register-input {
  padding-right: 48px;
}

.register-input-action {
  position: absolute;
  top: 50%;
  right: 10px;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.register-input-action::before {
  content: "";
  display: block;
  width: 20px;
  height: 20px;
  margin: 6px auto;
  background-color: currentColor;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpath d='M2 12s3.5-6 10-6 10 6 10 6-3.5 6-10 6-10-6-10-6Z'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E") center / contain no-repeat;
}

.register-input-action.is-visible::before {
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2'%3E%3Cpath d='m5 12 4 4L19 6'/%3E%3C/svg%3E") center / contain no-repeat;
  color: var(--primary);
}

.register-input-action:hover {
  background: color-mix(in srgb, var(--primary-soft) 55%, transparent);
  color: var(--primary);
}

.register-password-group {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 16px;
  border-radius: 14px;
  border: 1px solid color-mix(in srgb, var(--line) 90%, var(--primary) 10%);
  background: color-mix(in srgb, var(--surface) 80%, var(--bg) 20%);
}

.register-strength {
  margin-top: 4px;
}

.register-strength-track {
  height: 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--bg) 70%, var(--line) 30%);
  overflow: hidden;
}

.register-strength-bar {
  height: 100%;
  width: 20%;
  border-radius: inherit;
  background: var(--muted);
  transition: width 0.25s ease, background 0.25s ease;
}

.register-strength-label {
  margin: 8px 0 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

.register-error {
  margin: 0;
  text-align: center;
}

.register-submit {
  width: 100%;
  min-height: 48px;
  margin-top: 4px;
  border: none;
  border-radius: 10px;
  background: var(--primary);
  color: #fff;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 10px 24px color-mix(in srgb, var(--primary) 35%, transparent);
  transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.register-submit:hover {
  transform: scale(1.02);
  background: color-mix(in srgb, var(--primary) 88%, #fff 12%);
}

.register-submit:active {
  transform: scale(0.98);
}

.register-submit:disabled {
  opacity: 0.65;
  cursor: wait;
  transform: none;
}

@media (min-width: 640px) {
  .register-shell {
    place-items: center;
  }

  .register-head {
    text-align: left;
  }

  .register-subtitle {
    margin-left: 0;
    margin-right: 0;
    max-width: none;
  }
}

.pending-box {
  display: grid;
  gap: 12px;
  justify-items: stretch;
  text-align: center;
}

.pending-box p {
  width: 100%;
}

.onboarding-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
  text-align: left;
}

.onboarding-step {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  font-size: 14px;
  color: var(--muted);
  background: var(--surface);
}

.onboarding-step.is-done {
  border-color: color-mix(in srgb, var(--success) 40%, var(--border));
  color: var(--text);
}

.onboarding-step.is-active {
  border-color: var(--primary);
  background: color-mix(in srgb, var(--primary) 8%, var(--surface));
  color: var(--text);
  font-weight: 600;
}

.admin-pending-banner {
  padding: 12px 14px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--warning) 12%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--warning) 35%, var(--border));
  margin-bottom: 12px;
}

.admin-pending-banner strong {
  color: var(--text);
}

.user-admin-row.is-pending-approval {
  border-color: color-mix(in srgb, var(--warning) 45%, var(--border));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--warning) 20%, transparent);
}

.user-created-at {
  font-size: 12px;
  margin-top: 4px;
}

.user-access-progress {
  margin: 8px 0 0;
  color: var(--text);
  font-weight: 700;
  line-height: 1.45;
}

.user-access-progress.warning-text {
  color: var(--warning-dark, #92400e);
}

.user-access-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.top-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  margin-left: 6px;
  padding: 0 5px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  background: var(--warning);
  color: #1a1a1a;
}

.audit-log-list {
  max-height: 220px;
  overflow-y: auto;
  padding: 8px 12px 12px;
}

.audit-log-row {
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}

.audit-log-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.audit-log-row-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px 12px;
}

.audit-log-row-action {
  font-size: 12px;
  font-weight: 800;
  color: var(--text);
}

.audit-log-row-time {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
}

.audit-log-row-meta {
  margin: 4px 0 0;
  font-size: 12px;
  line-height: 1.45;
  color: var(--muted);
}

.user-status-pill {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.field-block {
  display: grid;
  gap: 8px;
}

.field-label {
  font-size: 13px;
  font-weight: 800;
  color: var(--label-color);
}

.field-input {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  color: var(--text);
  background: var(--input-bg);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field-input:focus {
  border-color: #5bb5aa;
  box-shadow: 0 0 0 4px var(--focus-ring);
  outline: none;
}

.login-error {
  margin: 0;
}

.remember-login {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 2px 0 0;
  font-size: 14px;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
}

.remember-login input {
  width: 18px;
  height: 18px;
  min-height: 18px;
  margin: 0;
  accent-color: var(--primary);
  cursor: pointer;
}

.login-actions {
  display: grid;
  gap: 10px;
  margin-top: 4px;
  justify-items: stretch;
}

.login-btn-main {
  width: 100%;
  min-height: 48px;
  font-size: 15px;
}

.login-btn-ghost {
  width: 100%;
  min-height: 44px;
}

.google-signin-box {
  display: grid;
  justify-items: center;
  align-items: center;
  width: 100%;
  min-height: 48px;
}

.google-signin-box:empty {
  display: none;
}

.google-signin-box > div {
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 auto !important;
}

.google-signin-box iframe,
.google-signin-box div[role="button"] {
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 auto !important;
}

.google-recover-box {
  display: grid;
  justify-content: center;
  justify-items: center;
  min-height: 48px;
  margin-top: 8px;
}

.google-recover-box > div,
.google-recover-box iframe,
.google-recover-box div[role="button"] {
  width: 100% !important;
  max-width: 360px !important;
  margin: 0 auto !important;
}

@media (min-width: 768px) {
  .login-card {
    grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
    min-height: min(560px, 90vh);
  }

  .login-brand {
    border-bottom: 0;
    border-right: 1px solid color-mix(in srgb, var(--line) 60%, transparent);
    min-height: 100%;
  }

  .login-main {
    padding: clamp(28px, 3vw, 40px);
  }

  .login-form-head {
    text-align: left;
  }

  .remember-login {
    justify-content: flex-start;
  }

  .login-secondary-actions {
    justify-content: flex-start;
  }

  .login-card-narrow {
    grid-template-columns: 1fr;
    min-height: auto;
  }
}

.app-shell {
  width: min(100%, var(--layout-max));
  max-width: var(--layout-max);
  margin: 0 auto;
  padding: 12px clamp(14px, 3vw, 28px) 40px;
  display: grid;
  gap: 20px;
  justify-items: stretch;
}

.dashboard-shell {
  padding-top: 0;
}

.dashboard-shell,
#profile-view {
  position: relative;
  width: min(100%, var(--layout-max));
  margin-inline: auto;
}

.dashboard-shell > :not(.security-watermark-layer),
#profile-view > :not(.security-watermark-layer):not(.profile-sticky-sentinel):not(.profile-chrome-spacer) {
  position: relative;
  z-index: 1;
}

#profile-chrome-sticky {
  position: relative;
  z-index: auto;
  isolation: isolate;
  pointer-events: auto;
  max-width: 100%;
  overflow-x: clip;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  background: var(--surface);
  width: min(100%, var(--layout-max, 1180px));
  margin: 0 auto;
}

.profile-chrome-spacer,
.dashboard-pin-wrap {
  position: relative;
  width: 100%;
  flex: 0 0 auto;
  min-height: var(--context-bar-height, 0px);
  pointer-events: none;
}

#app-context-bar {
  display: none !important;
}

.profile-chrome-spacer,
.dashboard-pin-wrap {
  display: none;
  min-height: 0;
}

#dashboard-view,
#profile-view {
  width: 100%;
}

.topbar,
.toolbar,
.profile-head,
.section-head,
.card-head,
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.card-head-tags,
.admission-status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.admission-status {
  justify-content: center;
  margin-top: 10px;
}

.topbar {
  margin-bottom: 20px;
  padding: clamp(18px, 2.2vw, 26px) clamp(18px, 2.6vw, 30px);
  background:
    radial-gradient(circle at 12% 10%, color-mix(in srgb, var(--brand) 12%, transparent), transparent 34%),
    linear-gradient(135deg, color-mix(in srgb, var(--surface-elevated) 94%, transparent), color-mix(in srgb, var(--surface) 82%, transparent));
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: 0 22px 60px rgba(15, 23, 42, 0.12), var(--shadow-soft);
  backdrop-filter: blur(12px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: clamp(14px, 2vw, 24px);
  align-items: center;
}

.topbar > div:first-child {
  min-width: 0;
}

.topbar h1 {
  overflow-wrap: anywhere;
  font-size: clamp(1.55rem, 3vw, 2.15rem);
  line-height: 1.05;
  letter-spacing: 0;
}

.top-actions {
  gap: 10px;
}

.top-actions button,
.top-actions .ghost,
.top-actions .secondary,
.top-actions .primary,
.top-actions #profile-btn,
.top-actions #users-admin-btn,
.top-actions #logout-btn {
  min-height: 48px;
  border-radius: 14px;
  padding-inline: 18px;
  font-weight: 800;
}

.theme-toggle {
  width: 42px;
  min-width: 42px;
  height: 42px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  color: var(--text);
  transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}

.theme-toggle:hover {
  color: var(--primary);
}

.theme-toggle:active {
  transform: scale(0.94);
}

.dashboard-shell ~ #floating-theme-toggle,
#floating-theme-toggle[hidden] {
  display: none !important;
}

.floating-theme-toggle {
  position: fixed;
  top: max(14px, env(safe-area-inset-top));
  right: max(14px, env(safe-area-inset-right));
  z-index: 260;
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.theme-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
}

.theme-icon-svg {
  display: block;
  width: 20px;
  height: 20px;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.2;
}

h1 {
  font-size: clamp(28px, 4vw, 40px);
}

h2 {
  font-size: clamp(20px, 2.4vw, 26px);
}

h3 {
  font-size: 17px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--primary);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.muted,
.hint {
  color: var(--muted);
}

.hint {
  font-size: 13px;
  margin: 0;
}

.error {
  margin: 0;
  color: var(--danger);
  font-weight: 800;
}

.grid,
.cards-grid,
.overview-grid,
.reports-grid {
  display: grid;
  gap: 16px;
}

.cards-grid {
  grid-template-columns: repeat(auto-fill, minmax(285px, 1fr));
}

.children-grid {
  grid-template-columns: 1fr;
  gap: 1.25rem;
  width: 100%;
}

@media (min-width: 640px) {
  .children-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .children-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 1280px) {
  .children-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.overview-grid {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  align-items: stretch;
  justify-items: stretch;
  width: 100%;
}

.profile-content .overview-grid,
.profile-content .record-list-compact,
.profile-content .section,
.profile-content .compact-record-section {
  margin-inline: auto;
}

.reports-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.panel,
.child-card,
.metric,
.record,
.modal {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.panel {
  padding: 18px;
}

.child-card,
.metric,
.record {
  padding: 18px;
  box-shadow: var(--shadow-soft);
  animation: fadeIn 0.18s ease-out;
}

.child-card,
.record {
  display: grid;
  gap: 12px;
}

.child-card {
  border-radius: 1rem;
  border: 1px solid var(--card-border);
  background: var(--card-surface);
  padding: 1.15rem 1.2rem 1rem;
  animation: cardEnter 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: calc(var(--card-enter-index, 0) * 55ms);
}

.child-card--skeleton {
  pointer-events: none;
  animation: none;
}

@keyframes cardEnter {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.metric {
  min-height: 124px;
}

.overview-grid .metric {
  align-self: stretch;
  height: 150px;
  max-height: 150px;
  overflow: auto;
  scrollbar-width: none;
  scrollbar-color: transparent transparent;
}

.overview-grid .metric:hover,
.overview-grid .metric:focus-within {
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--muted) 35%, transparent) transparent;
}

.overview-grid .metric::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.overview-grid .metric:hover::-webkit-scrollbar,
.overview-grid .metric:focus-within::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.overview-grid .metric::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: color-mix(in srgb, var(--muted) 35%, transparent);
}

.metric-link {
  display: block;
  width: 100%;
  color: inherit;
  text-align: left;
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.metric-link:hover,
.history-row:hover {
  border-color: #78bdb5;
  background: var(--metric-hover-bg);
  box-shadow: 0 14px 30px rgba(15, 118, 110, 0.12);
  transform: translateY(-1px);
}

.metric-feature {
  border-color: #9ed0c8;
  background: var(--metric-feature-bg);
}

.metric strong {
  display: block;
  margin-bottom: 8px;
}

.metric ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.metric ul.overview-compact-list {
  gap: 4px;
}

.metric li {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 28px;
  line-height: 1.4;
  text-align: left;
}

.overview-compact-list li {
  min-height: 0;
  font-size: 12px;
  line-height: 1.35;
}

.overview-list-more {
  margin-top: 3px;
  color: var(--primary);
  font-weight: 800;
}

.metric p {
  margin: 0;
  text-align: left;
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  margin-bottom: 18px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow-soft);
}

.dashboard-toolbar {
  width: 100%;
  justify-items: center;
  gap: 14px;
}

.dashboard-toolbar .search {
  max-width: 100%;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.dashboard-filters {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  width: 100%;
  max-width: 760px;
  justify-content: center;
  justify-items: stretch;
  align-items: center;
}

.dashboard-filters .chip {
  justify-content: center;
  min-width: 0;
  white-space: nowrap;
}

.record-filters {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}

.search {
  width: 100%;
}

.section-head {
  flex-wrap: wrap;
  gap: 12px;
}

.section-head .primary,
.section-head .secondary {
  width: auto;
  min-height: 50px;
  padding-inline: 20px;
  font-size: 14px;
}

.section-head h2 {
  flex: 1 1 auto;
  min-width: min(100%, 12rem);
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px 12px;
  color: var(--text);
  background: var(--input-bg);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

input:focus,
select:focus,
textarea:focus {
  border-color: #5bb5aa;
  box-shadow: 0 0 0 4px var(--focus-ring);
}

textarea {
  min-height: 120px;
  resize: vertical;
  line-height: 1.55;
  white-space: pre-wrap;
}

textarea[spellcheck="true"] {
  -webkit-text-decoration-skip: none;
}

label {
  display: grid;
  gap: 7px;
  color: var(--label-color);
  font-weight: 800;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  align-items: start;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  grid-column: 1 / -1;
}

.modal #record-form > .form-actions,
.modal #child-form > .form-actions,
.modal #comment-form > .form-actions,
.modal #file-form > .form-actions,
.modal #hospitalization-discharge-form > .form-actions,
.modal #appointment-followup-form > .form-actions {
  position: sticky;
  bottom: -20px;
  z-index: 4;
  margin: 12px -20px -20px;
  padding: 12px 20px;
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(10px);
}

.form-grid .wide,
.form-grid button,
.form-grid .hint,
.form-grid .error,
.form-grid .draft-status,
.form-grid .form-actions,
.usage-field-group {
  grid-column: 1 / -1;
}

.usage-field-group {
  display: grid;
  gap: 8px;
}

.usage-field-group > span {
  font-size: 12px;
  font-weight: 800;
  color: var(--label-color);
}

.child-form-bmi-panel {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid color-mix(in srgb, var(--primary) 20%, var(--line));
  border-radius: 12px;
  background: color-mix(in srgb, var(--primary-soft) 34%, var(--surface) 66%);
}

.child-form-bmi-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.child-form-bmi-head strong {
  font-size: 13px;
  color: var(--text);
}

.child-form-bmi-head span {
  flex: 0 0 auto;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

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

.child-form-bmi-grid label {
  gap: 5px;
  font-size: 12px;
}

.child-form-bmi-grid .field-datetime {
  min-width: 0;
}

.child-form-bmi-grid .dt-quick-actions,
.child-form-bmi-grid .dt-display-hint {
  display: none;
}

.child-form-bmi-panel .bmi-live-hint {
  margin: 0;
  padding: 8px 10px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  font-size: 12px;
  line-height: 1.35;
}

@media (max-width: 720px) {
  .child-form-bmi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 460px) {
  .child-form-bmi-grid {
    grid-template-columns: 1fr;
  }
}

.usage-field-row {
  display: grid;
  grid-template-columns: minmax(9rem, 12rem) minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.usage-field-row select,
.usage-field-row input {
  min-height: var(--touch-target);
  width: 100%;
}

@media (max-width: 640px) {
  .usage-field-row {
    grid-template-columns: 1fr;
  }
}

.primary,
.secondary,
.ghost,
.tab,
.chip,
.emergency-action-btn,
.dashboard-command #new-child,
.navbar-notifications-btn,
.navbar-logout {
  min-height: var(--touch-target);
  border-radius: var(--btn-radius);
  padding: 9px 14px;
  font-weight: 800;
  transition: transform 0.14s ease, box-shadow 0.14s ease, background 0.14s ease, border-color 0.14s ease;
}

.primary {
  background: var(--primary);
  color: #fff;
  box-shadow: var(--shadow-soft);
}

.primary:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
}

.secondary {
  background: var(--primary-soft);
  color: var(--primary-dark);
}

.secondary:hover,
.ghost:hover,
.chip:hover {
  border-color: #8ec8c1;
  box-shadow: var(--shadow-soft);
  transform: translateY(-1px);
}

.chip.active {
  border-color: transparent;
  background: var(--primary-soft);
  color: var(--primary-dark);
}

.ghost {
  border: 1px solid var(--line);
  background: var(--ghost-bg);
  color: var(--text);
}

.ghost.danger,
.text-danger,
.danger-action {
  color: var(--danger);
}

.danger-action {
  background: var(--danger-soft);
  box-shadow: none;
}

.top-actions,
.actions,
.chips,
.tabs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.top-actions {
  justify-content: flex-end;
}

.actions,
.profile-actions {
  justify-content: flex-end;
}

.profile-layout {
  position: relative;
  display: grid;
  gap: 8px;
  width: min(var(--layout-max), 100%);
  max-width: var(--layout-max);
  margin: 0 auto;
  justify-items: stretch;
  padding: 0 clamp(12px, 2vw, 24px) 32px;
}

.profile-layout-body {
  min-width: 0;
}


body.profile-route-active .app-shell {
  padding-top: 0;
  gap: 8px;
}

body.profile-route-active .app-header-sticky {
  margin-bottom: 0;
}

#profile-view {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.profile-sticky-sentinel {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 1px;
  pointer-events: none;
}

body.profile-route-active .profile-chrome-sticky {
  position: relative;
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  padding: 0;
  background: transparent;
  border-bottom: 0;
  box-shadow: none;
  overflow-x: clip;
}

body.profile-route-active .profile-layout-body {
  position: relative;
  z-index: 0;
  padding-top: 12px;
  width: min(var(--layout-max), 100%);
  max-width: var(--layout-max);
  margin: 0 auto;
  isolation: isolate;
}

.profile-chrome-sticky {
  position: relative;
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  box-shadow: none;
  overflow-x: clip;
}

[data-theme="dark"] .profile-chrome-sticky {
  background: #0f172a;
  border-bottom-color: #1e293b;
}

.profile-chrome-sticky .profile-sticky-nav,
body.profile-route-active .profile-chrome-sticky .profile-sticky-nav {
  position: static;
  top: auto;
  z-index: 2;
  flex: 0 0 auto;
  width: 100%;
  max-width: min(var(--layout-max), 100%);
  margin: 0 auto;
  border-bottom: 1px solid var(--line);
  box-shadow: none;
  background: transparent;
}

[data-theme="dark"] .profile-chrome-sticky .profile-sticky-nav {
  border-bottom-color: #1e293b;
}

.profile-chrome-sticky .profile-subnav-slot {
  flex: 0 0 auto;
  z-index: 2;
}

.profile-chrome-sticky.is-elevated {
  box-shadow:
    0 12px 40px rgba(15, 23, 42, 0.14),
    0 4px 12px rgba(15, 23, 42, 0.08);
}

[data-theme="dark"] .profile-chrome-sticky.is-elevated {
  box-shadow:
    0 14px 44px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(16, 185, 129, 0.08);
}

.profile-subnav-slot {
  position: relative;
  z-index: 3;
  width: min(var(--layout-max), 100%);
  max-width: 100%;
  margin: 0 auto;
  padding: 0 clamp(12px, 2vw, 20px) 6px;
  border-top: 1px solid var(--line);
  pointer-events: auto;
}

.profile-subnav-slot .vaccine-inner-tab {
  position: relative;
  z-index: 1;
  pointer-events: auto;
  cursor: pointer;
}

[data-theme="dark"] .profile-subnav-slot {
  border-top-color: #1e293b;
}

.profile-subnav-slot .profile-subnav-tabs {
  margin: 0;
}

.profile-chrome-emergency-slot {
  flex: 0 0 auto;
  width: 100%;
  max-width: min(var(--layout-max), 100%);
  margin: 0 auto;
  padding: 4px clamp(12px, 2vw, 20px) 6px;
  border-top: 1px solid var(--line);
  background: inherit;
  box-sizing: border-box;
}

.profile-emergency-shell {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  width: 100%;
}

.profile-emergency-siren-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  align-self: flex-start;
  min-height: 40px;
  padding: 8px 16px;
  border-radius: 999px;
  border: 2px solid #dc2626;
  background: linear-gradient(135deg, #fef2f2, #fff);
  color: #b91c1c;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.profile-emergency-siren-btn:hover,
.profile-emergency-siren-btn.is-active {
  background: #dc2626;
  color: #fff;
  box-shadow: 0 6px 18px rgba(220, 38, 38, 0.35);
}

.profile-emergency-siren-btn .icon-lucide {
  width: 18px;
  height: 18px;
}

.profile-emergency-shell .profile-emergency-bar {
  width: 100%;
  margin: 0;
}

.profile-emergency-shell .profile-emergency-bar:not(.is-open) {
  display: none;
}

[data-theme="dark"] .profile-chrome-emergency-slot {
  border-top-color: #1e293b;
}

.profile-chrome-emergency-slot .profile-emergency-bar {
  width: 100%;
  max-width: 100%;
  margin: 0;
}

.profile-sticky-nav {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 100%;
  margin-left: 0;
  margin-right: 0;
  padding: 0;
  background: transparent;
  border-bottom: none;
  box-shadow: none;
  transition: box-shadow 0.25s ease;
}

[data-theme="dark"] .profile-sticky-nav {
  background: #0f172a;
  border-bottom-color: #1e293b;
}

.profile-sticky-nav__inner {
  width: 100%;
  max-width: min(var(--layout-max), 100%);
  margin-inline: auto;
  padding: 4px clamp(12px, 2vw, 20px) 6px;
  display: grid;
  gap: 6px;
  box-sizing: border-box;
  transition: gap 0.3s ease-in-out;
}

#profile-chrome-sticky .profile-tabs-panel,
#profile-chrome-sticky .profile-tabs-panel .tab,
#profile-chrome-sticky .profile-mobile-tab-bar,
#profile-chrome-sticky .profile-sticky-nav__top button,
#profile-chrome-sticky .profile-subnav-slot button,
#profile-chrome-sticky #back-dashboard {
  position: relative;
  z-index: 2;
  pointer-events: auto;
  cursor: pointer;
}

#back-dashboard {
  position: relative;
  z-index: 4;
  touch-action: manipulation;
}

.profile-sticky-nav__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 40px;
}

.profile-sticky-nav__controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.profile-active-tab-label {
  display: inline-flex;
  align-items: center;
  max-width: min(12rem, 38vw);
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

[data-theme="dark"] .profile-active-tab-label {
  color: #6ee7b7;
}

.profile-nav-collapse-btn,
.profile-nav-mobile-menu-btn,
.profile-scroll-top-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 44px;
  height: 40px;
  padding: 0 10px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface-soft);
  color: var(--text);
  cursor: pointer;
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    transform 0.15s ease,
    opacity 0.2s ease,
    visibility 0.2s ease;
}

.profile-nav-collapse-btn,
.profile-nav-mobile-menu-btn {
  width: 44px;
  padding: 0;
}

.profile-scroll-top-btn {
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.profile-scroll-top-btn[hidden] {
  display: none !important;
}

.profile-scroll-top-btn svg,
.profile-scroll-top-btn [data-lucide] {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.profile-nav-collapse-btn:hover,
.profile-nav-mobile-menu-btn:hover,
.profile-scroll-top-btn:hover {
  background: var(--primary-soft);
  border-color: color-mix(in srgb, var(--primary) 35%, transparent);
}

.profile-nav-collapse-icon {
  width: 20px;
  height: 20px;
  transition: transform 0.3s ease-in-out;
}

.profile-sticky-nav--collapsed .profile-nav-collapse-icon {
  transform: rotate(180deg);
}

.profile-nav-mobile-menu-btn {
  display: none;
}

.profile-tabs-panel {
  display: flex;
  max-height: none;
  overflow: visible;
  opacity: 1;
  transition:
    max-height 0.3s ease-in-out,
    opacity 0.3s ease-in-out,
    padding 0.3s ease-in-out,
    margin 0.3s ease-in-out,
    border-width 0.3s ease-in-out;
}

.profile-sticky-nav--collapsed .profile-tabs-panel {
  max-height: 0;
  opacity: 0;
  padding-top: 0;
  padding-bottom: 0;
  margin: 0;
  border-width: 0;
  pointer-events: none;
}

@media (min-width: 1024px) {
  .profile-chrome-sticky .profile-tabs-panel {
    max-height: none;
    overflow: visible;
  }

  .profile-sticky-nav--collapsed .profile-tabs-panel {
    max-height: none;
    opacity: 1;
    padding-top: 6px;
    padding-bottom: 6px;
    margin: 0;
    border-width: 0;
    pointer-events: auto;
    overflow: visible;
  }

  .profile-sticky-nav--collapsed .profile-active-tab-label {
    display: none !important;
  }
}

.profile-sticky-nav--collapsed .profile-sticky-nav__inner {
  gap: 0;
}

.profile-mobile-drawer {
  display: none;
}

.profile-sticky-nav.is-elevated {
  box-shadow:
    0 12px 40px rgba(15, 23, 42, 0.14),
    0 4px 12px rgba(15, 23, 42, 0.08);
}

[data-theme="dark"] .profile-sticky-nav.is-elevated {
  box-shadow:
    0 14px 44px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(16, 185, 129, 0.08);
}

.profile-emergency-bar {
  width: min(var(--layout-max), 100%);
  margin: 0 auto;
}

.profile-emergency-bar-inner {
  padding: 12px 14px;
  border-radius: 14px;
  border: 2px solid #f87171;
  background: linear-gradient(135deg, #fef2f2 0%, #fff7ed 55%, #ffffff 100%);
  box-shadow: 0 8px 28px rgba(239, 68, 68, 0.18);
}

[data-theme="dark"] .profile-emergency-bar-inner {
  border-color: rgba(248, 113, 113, 0.55);
  background: linear-gradient(135deg, rgba(127, 29, 29, 0.55) 0%, rgba(15, 23, 42, 0.95) 100%);
  box-shadow: 0 8px 32px rgba(248, 113, 113, 0.15);
}

.profile-emergency-label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #b91c1c;
}

[data-theme="dark"] .profile-emergency-label {
  color: #fca5a5;
}

.profile-emergency-label .icon-lucide {
  width: 18px;
  height: 18px;
}

.profile-emergency-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.emergency-action-btn {
  min-height: 42px;
  padding: 8px 14px;
  border-radius: 10px;
  border: 1px solid #fecaca;
  background: #ffffff;
  color: #991b1b;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.emergency-action-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(239, 68, 68, 0.2);
}

.emergency-action-btn--danger {
  background: #dc2626;
  border-color: #b91c1c;
  color: #ffffff;
}

.emergency-action-btn--alert {
  background: #fff7ed;
  border-color: #fdba74;
  color: #9a3412;
}

[data-theme="dark"] .emergency-action-btn {
  background: #1e293b;
  border-color: #475569;
  color: #fecaca;
}

[data-theme="dark"] .emergency-action-btn--danger {
  background: #991b1b;
  color: #fff;
}

.profile-emergency-allergy {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 10px 0 0;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(239, 68, 68, 0.12);
  font-size: 12px;
  font-weight: 600;
  color: #7f1d1d;
}

.profile-tab-skeleton {
  width: 100%;
  padding: 20px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
}

.profile-tab-skeleton-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.profile-back-bar {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-width: 0;
  padding: 0;
}

.back-btn-centered {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: min(100%, 280px);
  min-height: 40px;
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;
  box-shadow: var(--shadow-soft);
}

.profile-alert,
.profile-head {
  margin-bottom: 4px;
}

.profile-inactivation-history {
  margin: 0 0 8px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
  background: color-mix(in srgb, var(--surface-soft) 80%, transparent);
  font-size: 13px;
  line-height: 1.45;
}

.child-card-inactive-meta {
  margin: 6px 0 0;
  font-size: 11px;
  line-height: 1.35;
}

.child-inactivation-notice {
  margin-bottom: 4px;
}

.child-inactivation-date-field span.muted {
  display: block;
  margin-top: 4px;
  font-size: 12px;
}

.profile-content .section {
  gap: 10px;
}

.profile-content .record-list-compact {
  display: grid;
  gap: 10px;
}

.admission-checklist-obs {
  display: inline-block;
  margin-left: 6px;
  font-weight: 600;
}

.profile-head,
.profile-content {
  width: min(var(--layout-max), 100%);
}

.profile-content {
  scroll-margin-top: var(--profile-scroll-offset, 150px);
  min-width: 0;
}

.profile-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: end;
  padding: 18px 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow-soft);
  position: relative;
  z-index: 0;
}

.profile-intro {
  min-width: 0;
}

.profile-meta {
  margin: 8px 0 0;
  line-height: 1.5;
}

.profile-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
}

@media (max-width: 719px) {
  .profile-actions {
    justify-content: stretch;
  }
}

.profile-actions button,
.vaccine-card-head-actions .primary,
.vax-next-actions button {
  border-radius: 12px;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.profile-actions button:hover,
.vaccine-card-head-actions .primary:hover,
.vax-next-actions button:hover {
  transform: translateY(-1px);
}

.profile-content {
  min-width: 0;
}

.badge,
.pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 27px;
  border-radius: 999px;
  padding: 4px 10px;
  color: var(--primary-dark);
  background: var(--pill-badge-bg);
  font-size: 12px;
  font-weight: 800;
}

.pill.warning {
  color: #704700;
  background: var(--warning-soft);
}

.pill.danger {
  color: #8f1d14;
  background: var(--danger-soft);
}

.pill.success {
  color: #155c38;
  background: var(--success-soft);
}

.pill.neutral {
  color: var(--pill-neutral-text);
  background: var(--pill-neutral-bg);
}

.tabs {
  position: relative;
  z-index: 4;
  margin: 0 auto;
  width: 100%;
  max-width: var(--layout-max);
  gap: 6px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--tabs-glass);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(12px);
}

.tabs-scroll {
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  justify-content: flex-start;
  scroll-snap-type: x proximity;
  scroll-padding-inline: 16px;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
  touch-action: pan-x;
}

.tabs-scroll::-webkit-scrollbar {
  height: 6px;
}

.tabs-scroll::-webkit-scrollbar-thumb {
  background: var(--line);
  border-radius: 999px;
}

.tab {
  flex: 0 0 auto;
  white-space: nowrap;
  scroll-snap-align: center;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  padding: 8px 14px;
}

.tab.active {
  color: var(--primary-dark);
  background: var(--primary-soft);
}

.profile-sticky-nav .tabs-scroll.profile-tabs-panel {
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  row-gap: 6px;
}

@media (min-width: 1024px) {
  .tabs-scroll {
    flex-wrap: wrap;
    justify-content: center;
    overflow-x: visible;
    row-gap: 6px;
    scrollbar-width: auto;
  }

  .profile-sticky-nav .tabs-scroll.profile-tabs-panel {
    overflow-x: visible;
  }

  .tabs-scroll .tab:not(.active):hover {
    color: var(--text);
    background: var(--surface-soft);
    box-shadow: var(--shadow-soft);
  }
}

@media (max-width: 1023px) {
  .tabs-scroll {
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x proximity;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-x;
    scrollbar-width: none;
  }

  .tabs-scroll::-webkit-scrollbar {
    display: none;
    height: 0;
  }
}

.section {
  display: grid;
  gap: 16px;
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
}

.record.controlada {
  border-left: 5px solid var(--danger);
}

.record.antibiotico,
.record.ativo {
  border-left: 5px solid var(--warning);
}

.record.continuo {
  border-left: 5px solid var(--success);
}

.record.encerrado {
  opacity: 0.82;
  background: var(--surface-soft);
}

.record.suspenso {
  border-left: 5px solid var(--danger);
  background: var(--danger-soft);
}

.child-card.child-inactive {
  opacity: 0.88;
  border-color: var(--danger);
}

.user-admin-list {
  display: grid;
  gap: 12px;
  max-height: min(62vh, 520px);
  overflow: auto;
  margin-top: 12px;
}

.user-admin-row .actions {
  flex-wrap: wrap;
  gap: 8px;
}

.compact-record {
  box-shadow: none;
}

.record-list-compact {
  display: grid;
  gap: 12px;
}

.record-compact {
  padding: 14px 16px;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.record-compact .card-head {
  align-items: center;
}

.record-compact .compact-open {
  display: grid;
  gap: 4px;
  min-width: 0;
  flex: 1;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.record-compact .compact-open:hover .compact-title {
  color: var(--primary);
}

.record-compact .compact-title {
  display: block;
  font-size: 17px;
  font-weight: 800;
  line-height: 1.25;
}

.record-quick-actions {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  justify-content: flex-start;
  gap: 8px;
}

.record-quick-actions button {
  flex: 1 1 auto;
  min-width: 88px;
}

.compact-meta {
  margin: 4px 0 0;
  font-size: 13px;
}

.compact-summary {
  margin: 10px 0 0;
  color: var(--text);
  line-height: 1.5;
}

.compact-hint {
  margin: 8px 0 0;
  font-size: 12px;
  font-weight: 800;
  color: var(--primary);
}

.record-detail-modal {
  margin-top: 4px;
}

.record-detail-modal > .record {
  box-shadow: none;
}

.record-detail-modal .actions {
  position: sticky;
  bottom: 0;
  padding-top: 12px;
  background: linear-gradient(180deg, transparent, var(--surface) 28%);
}

.details {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
}

.details div {
  min-width: 0;
  padding: 10px;
  border-radius: 10px;
  background: var(--surface-soft);
}

.details span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.details p {
  margin: 4px 0 0;
  white-space: pre-wrap;
}

.author-line {
  margin: 0;
  color: var(--primary-dark);
  font-size: 13px;
  font-weight: 800;
}

.digital-signature {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  text-align: center;
  line-height: 1.5;
}

.avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  object-fit: cover;
}

.log-line {
  margin: 8px 0;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.admission-sheet {
  gap: 0;
  padding: 0;
  overflow: hidden;
  border-radius: 12px;
}

.admission-title {
  padding: 20px 18px 16px;
  text-align: center;
  border-bottom: 1px solid var(--text);
  background: var(--admission-header-bg);
}

.admission-title p {
  margin: 3px 0;
  text-transform: uppercase;
}

.admission-title h3 {
  margin-top: 16px;
  text-transform: uppercase;
}

.admission-grid {
  display: grid;
  grid-template-columns: 2fr 0.8fr 0.8fr;
  border-bottom: 1px solid var(--text);
}

.admission-grid div,
.sheet-lines p {
  margin: 0;
  padding: 8px 10px;
  border-right: 1px solid var(--text);
  border-bottom: 1px solid var(--text);
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.admission-grid div:nth-child(3n) {
  border-right: 0;
}

.admission-grid span,
.sheet-lines strong {
  font-weight: 800;
  text-transform: uppercase;
}

.sheet-yn-row {
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.sheet-yn-row strong {
  display: block;
  margin-bottom: 4px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.sheet-yn-answer {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
}

.sheet-yn-answer--sim {
  color: var(--primary-dark);
}

.sheet-yn-answer--nao {
  color: var(--muted);
}

.yn-sheet .sheet-yn-row {
  margin-bottom: 6px;
}

.check-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  padding: 10px;
  border-bottom: 1px solid var(--text);
}

.sheet-lines p:last-child {
  border-bottom: 0;
}

.evolution-box {
  min-height: 160px;
  padding: 16px;
  border-top: 1px solid var(--text);
  text-align: left;
}

.evolution-box strong {
  display: block;
  margin-bottom: 10px;
  text-align: center;
  font-size: 18px;
  text-transform: uppercase;
}

.evolution-box p {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.evolution-box.compact {
  min-height: 110px;
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--evolution-compact-bg);
}

.official-record {
  border-left: 5px solid var(--primary);
}

.official-note {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.admission-sheet .author-line,
.admission-sheet .actions,
.admission-sheet .chips {
  margin: 12px 14px;
}

.alert {
  border: 1px solid #f4c430;
  border-left: 5px solid var(--warning);
  border-radius: 12px;
  padding: 14px;
  background: var(--alert-bg);
  color: var(--alert-text);
  font-weight: 800;
  box-shadow: var(--shadow-soft);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  padding: 22px;
  background: var(--modal-backdrop);
  animation: fadeIn 0.14s ease-out;
  isolation: isolate;
}

body.modal-open {
  overflow: hidden;
}

body.modal-open #profile-view,
body.modal-open #dashboard-view,
body.modal-open .app-header-sticky {
  pointer-events: none;
}

body.modal-open .abrigo-ai-fab-wrap {
  z-index: 9998;
}

.modal {
  width: min(var(--layout-max), 100%);
  margin: auto;
  max-height: min(88vh, 920px);
  overflow: auto;
  padding: 20px;
  box-shadow: var(--shadow);
  animation: rise 0.18s ease-out;
}

.modal-head {
  position: sticky;
  top: -20px;
  z-index: 2;
  padding-bottom: 14px;
  margin-bottom: 14px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.confirm-message {
  margin: 0 0 18px;
  font-size: 16px;
}

.confirm-actions {
  justify-content: flex-end;
}

.draft-status {
  margin: 0;
  color: var(--success);
  font-size: 13px;
  font-weight: 800;
}

.draft-hint {
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
}

.form-grid .draft-hint {
  grid-column: 1 / -1;
}

.toast-area {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 10100;
  display: grid;
  gap: 10px;
  width: min(360px, calc(100vw - 36px));
  pointer-events: none;
}

.toast-area .toast {
  pointer-events: auto;
}

.toast {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--success);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow);
  font-weight: 800;
  animation: rise 0.18s ease-out;
}

.toast.warning {
  border-left-color: var(--warning);
}

.toast.error {
  border-left-color: var(--danger);
}

.empty {
  padding: 26px;
  border: 1px dashed var(--line);
  border-radius: 12px;
  color: var(--muted);
  text-align: center;
  background: var(--empty-bg);
}

.report-page {
  display: none;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (min-width: 768px) {
  .record-filters {
    grid-template-columns: minmax(0, 2fr) repeat(3, minmax(120px, 1fr));
  }

  .toolbar {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
  }

  .toolbar .filters {
    grid-column: 1 / -1;
  }

  #new-child {
    justify-self: end;
  }

  .dashboard-toolbar {
    grid-template-columns: minmax(0, 1fr);
  }

  .dashboard-toolbar .filters,
  .dashboard-toolbar #new-child {
    grid-column: 1;
  }

  .dashboard-toolbar #new-child {
    justify-self: center;
  }
}

@media (max-width: 680px) {
  .dashboard-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-width: 100%;
  }
}

@media (min-width: 720px) {
  .tabs-scroll {
    justify-content: center;
    scroll-snap-type: none;
    overflow-x: auto;
    padding-inline: 8px;
  }
}

@media (min-width: 768px) and (max-width: 1023px) {
  .profile-sticky-nav__inner {
    padding-inline: 14px;
  }

  .profile-tabs-panel.tabs-scroll {
    padding-inline: 8px;
  }

  .profile-content .overview-grid,
  .profile-tab-skeleton-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .tabs-scroll {
    flex-wrap: wrap;
    justify-content: center;
    overflow-x: visible;
    row-gap: 6px;
  }

  .tab {
    flex: 0 1 auto;
  }

  .cards-grid:not(.children-grid) {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  }

  .profile-content .overview-grid {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  }
}

.profile-mobile-tab-bar {
  display: none;
}

@media (max-width: 767px) {
  .profile-chrome-emergency-slot {
    padding: 8px 12px 10px;
  }

  .profile-chrome-sticky .profile-tabs-panel.profile-tabs-panel--mobile-scroll {
    display: none !important;
  }

  .profile-sticky-nav__inner {
    padding: 6px 12px 8px;
  }

  .profile-sticky-nav__top {
    max-height: 55px;
    min-height: 44px;
  }

  .profile-back-bar {
    flex: 1;
    justify-content: center;
  }

  .back-btn-centered {
    width: 100%;
    max-width: none;
    min-height: var(--touch-target);
    max-height: 44px;
    padding: 8px 12px;
    font-size: 12px;
  }

  .profile-scroll-top-label {
    display: none;
  }

  .profile-scroll-top-btn {
    width: 40px;
    min-width: 40px;
    padding: 0;
  }

  .profile-nav-collapse-btn {
    display: none;
  }

  .profile-nav-mobile-menu-btn {
    display: inline-flex;
  }

  .profile-mobile-tab-bar {
    display: grid;
    gap: 6px;
  }

  .profile-tabs-panel.profile-tabs-panel--mobile-scroll {
    display: flex !important;
    max-height: none;
    opacity: 1;
    pointer-events: auto;
    overflow-x: auto;
    overflow-y: hidden;
    flex-wrap: nowrap;
    padding: 6px 4px;
    gap: 6px;
    border: 1px solid var(--line);
    border-radius: var(--btn-radius);
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
  }

  .profile-sticky-nav--collapsed .profile-tabs-panel.profile-tabs-panel--mobile-scroll {
    display: none !important;
    max-height: 0;
    opacity: 0;
    pointer-events: none;
  }

  .profile-active-tab-label {
    display: inline-flex !important;
  }

  .profile-mobile-drawer {
    display: grid;
    gap: 10px;
    padding: 10px 0 4px;
    border-top: 1px solid var(--line);
  }

  .profile-mobile-drawer[hidden] {
    display: none !important;
  }

  .profile-sticky-nav--mobile-open .profile-mobile-drawer {
    display: grid;
  }

  .admission-print-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .admission-print-bar .primary {
    width: 100%;
    min-height: var(--touch-target);
  }

  .profile-emergency-actions {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }

  .profile-emergency-actions .emergency-action-btn {
    width: 100%;
    min-height: var(--touch-target);
  }

  .profile-mobile-select-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
  }

  .profile-mobile-tab-select {
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: var(--input-bg);
    font-size: 14px;
    font-weight: 600;
  }

  .profile-mobile-tab-list {
    display: grid;
    gap: 6px;
    max-height: min(50vh, 320px);
    overflow-y: auto;
  }

  .profile-mobile-tab-btn {
    display: flex;
    align-items: center;
    min-height: 44px;
    padding: 10px 14px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: var(--surface-soft);
    color: inherit;
    font-size: 14px;
    font-weight: 700;
    text-align: left;
    cursor: pointer;
  }

  .profile-mobile-tab-btn.is-active {
    border-color: var(--primary);
    background: var(--primary-soft);
    color: var(--primary-dark);
  }

  [data-theme="dark"] .profile-mobile-tab-btn.is-active {
    color: #6ee7b7;
  }

  .profile-back-bar {
    justify-content: flex-start;
  }

  .back-btn-centered {
    flex: 1;
    min-width: 0;
    max-width: none;
    min-height: 44px;
    padding: 8px 14px;
    font-size: 13px;
  }
}

@media (max-width: 900px) {
  .form-grid,
  .record-filters {
    grid-template-columns: 1fr;
  }

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

  .top-actions {
    width: 100%;
    justify-content: center;
  }

  html {
    scroll-behavior: auto;
  }

  #profile-view {
    padding-top: 0;
  }

  .profile-layout {
    padding-top: 0;
    gap: 12px;
  }

  .profile-head {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .profile-actions {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
    gap: 8px;
  }

  .profile-actions button {
    width: 100%;
    flex: none;
    min-height: 48px;
  }

  .profile-content {
    scroll-margin-top: var(--profile-scroll-offset, 120px);
  }

  .tabs-scroll {
    scroll-snap-type: none;
  }

  .section-head,
  .card-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .section-head .primary,
  .section-head .secondary {
    width: 100%;
  }

  .record-compact .card-head {
    flex-direction: column;
    align-items: stretch;
  }

  .record-compact .compact-open {
    align-items: flex-start;
  }

  .record-compact .compact-title,
  .record-compact .compact-meta {
    text-align: left;
    width: 100%;
  }

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

  .admission-grid div,
  .admission-grid div:nth-child(3n) {
    border-right: 0;
  }
}

@media (max-width: 560px) {
  body {
    font-size: 14px;
    text-align: center;
  }

  .app-shell,
  .login-shell {
    padding-left: max(12px, env(safe-area-inset-left));
    padding-right: max(12px, env(safe-area-inset-right));
  }

  .app-shell {
    padding-top: 14px;
    padding-bottom: max(42px, env(safe-area-inset-bottom));
  }

  .topbar,
  .toolbar,
  .panel,
  .child-card,
  .metric,
  .record,
  .modal,
  .profile-head {
    border-radius: 10px;
    padding: 14px;
  }

  .topbar {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    max-width: 420px;
    margin-left: auto;
    margin-right: auto;
  }

  .topbar h1 {
    font-size: clamp(22px, 7vw, 32px);
  }

  .top-actions {
    display: grid;
    grid-template-columns: 44px repeat(2, minmax(0, 1fr));
    gap: 8px;
    align-items: center;
    width: 100%;
  }

  #session-badge {
    grid-column: 1 / -1;
    grid-row: 1;
    justify-content: center;
    min-height: 30px;
    padding: 4px 10px;
  }

  .top-actions .ghost,
  .top-actions .primary,
  .top-actions .secondary,
  .top-actions #users-admin-btn,
  .top-actions #profile-btn,
  .top-actions #logout-btn {
    width: 100%;
    min-height: 44px;
    justify-content: center;
  }

  .filters {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .filters .chip {
    width: 100%;
    justify-content: center;
    font-size: 12px;
    padding: 8px 10px;
  }

  .modal-backdrop {
    padding: max(10px, env(safe-area-inset-top)) max(10px, env(safe-area-inset-right)) max(10px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left));
    place-items: stretch;
  }

  .modal {
    max-height: calc(100dvh - 20px);
    padding: 14px;
  }

  .modal-head {
    flex-direction: column;
    align-items: stretch;
  }

  .toast-area {
    left: 12px;
    right: 12px;
    width: auto;
    bottom: max(12px, env(safe-area-inset-bottom));
  }

  .back-btn-centered {
    width: 100%;
    max-width: none;
    min-height: 48px;
  }

  .primary,
  .secondary,
  .ghost,
  .login-btn-main,
  .login-btn-ghost,
  .tab {
    min-height: 48px;
  }

  .login-actions .primary,
  .login-actions .ghost,
  .login-actions .secondary,
  .login-actions .google-signin-box {
    width: 100%;
  }

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

  .toolbar .primary,
  .toolbar #new-child {
    width: 100%;
    justify-self: stretch;
  }

  .child-card .secondary,
  .child-card .primary {
    width: 100%;
  }

  .record-quick-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .record-quick-actions button {
    width: 100%;
    flex: none;
    min-height: 48px;
  }

  .section-head .primary,
  .section-head .secondary,
  .section-head .ghost {
    width: 100%;
  }

  .actions:not(.top-actions):not(.record-quick-actions) {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }

  .actions:not(.top-actions):not(.record-quick-actions) button {
    width: 100%;
  }

  .confirm-actions {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }

  .confirm-actions button {
    width: 100%;
  }

  .user-admin-row .record-quick-actions button {
    width: 100%;
  }

  .login-form-head,
  .login-form,
  .login-actions,
  .login-error,
  .remember-login {
    max-width: none;
  }

  .login-card {
    border-radius: 16px;
    width: 90vw;
    max-width: 1000px;
    margin-left: auto;
    margin-right: auto;
  }

  .login-shell {
    place-items: center;
    justify-items: center;
  }

  .login-brand,
  .login-main,
  .login-form,
  .login-form-head,
  .login-actions,
  .pending-box {
    align-items: center;
    text-align: center;
  }

  .login-brand-copy,
  .login-form,
  .login-actions,
  .login-actions-primary,
  .login-secondary-actions,
  .login-error,
  .remember-login,
  .field-block {
    width: min(100%, 360px);
    margin-left: auto;
    margin-right: auto;
  }

  .logo-flip-card {
    width: min(100%, 300px);
  }

  .login-logo {
    max-height: 170px;
  }

  .login-shell,
  .login-card {
    width: min(100%, 420px);
    max-width: 420px;
    margin-left: auto;
    margin-right: auto;
  }

  .app-shell,
  #dashboard-view,
  #profile-view,
  .profile-layout,
  .profile-content,
  .section,
  .toolbar,
  .panel,
  .child-card,
  .metric,
  .record,
  .profile-head,
  .overview-grid,
  .cards-grid,
  .record-list-compact,
  .compact-record-section {
    width: 100%;
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
  }

  .topbar,
  .profile-head,
  .section-head,
  .card-head,
  .metric,
  .child-card,
  .record,
  .details div,
  .empty,
  .alert {
    text-align: center;
  }

  .profile-intro,
  .profile-meta,
  .topbar > div:first-child {
    text-align: center;
    width: 100%;
  }

  .overview-grid,
  .cards-grid,
  .details,
  .reports-grid {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .metric,
  .child-card,
  .record,
  .panel,
  .toolbar {
    justify-items: center;
  }

  .metric-link {
    text-align: center;
  }

  .tabs {
    max-width: 420px;
  }

  .tabs-scroll {
    justify-content: flex-start;
  }

  .tab {
    text-align: center;
  }

  .chips,
  .card-head-tags,
  .admission-status {
    justify-content: center;
  }

  .record-filters,
  .form-grid {
    max-width: 360px;
    margin-left: auto;
    margin-right: auto;
  }

  label,
  .field-block {
    text-align: left;
  }

  .author-line,
  .official-note,
  .evolution-box,
  .sheet-lines p,
  .admission-grid div {
    text-align: left;
  }
}
}

.print-only {
  display: none !important;
}

.screen-only {
  display: block;
}

@media print {
  @page {
    size: A4 portrait;
    margin: 1.5cm;
  }

  html.print-landscape @page {
    size: A4 landscape;
    margin: 7mm;
  }

  html.print-portrait @page {
    size: A4 portrait;
    margin: 1.5cm;
  }

  html,
  body {
    background: #fff !important;
    color: #000 !important;
    font-family: "Inter", Arial, Helvetica, sans-serif !important;
    font-size: 10pt;
    line-height: 1.5;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  body.official-print-mode {
    counter-reset: page;
  }

  .no-print,
  .screen-only,
  .topbar,
  .app-navbar,
  .app-header-sticky,
  .app-bottom-nav,
  .app-credits,
  .toolbar,
  .tabs,
  .profile-sticky-nav,
  .profile-back-bar,
  .profile-actions,
  .profile-head,
  .profile-alert,
  .section-head,
  .record-filters,
  .record-list-compact,
  .compact-record-section,
  .child-card,
  .metrics,
  .toast-area,
  .theme-switch,
  .floating-theme-toggle,
  .dashboard-command-sticky,
  .dashboard-filters-scroll,
  .vaccine-tabs-sticky,
  .vaccine-inner-tabs,
  .vaccine-week-alert,
  .vax-history-toolbar,
  .vax-mobile-accordions,
  .vax-table-wrap,
  .vax-next-hero,
  .vax-next-queue,
  .vax-config,
  .nursing-timeline,
  .nursing-timeline-open,
  .nursing-drawer-backdrop,
  .nursing-drawer-head,
  .nursing-workspace-head,
  .nursing-allergy-banner,
  .nursing-doc-actions,
  .nursing-attachments,
  .profile-emergency-bar,
  .admission-print-bar,
  .navbar-notifications-mount,
  #dashboard-view,
  .modal-head,
  .record-quick-actions,
  .actions {
    display: none !important;
  }

  .print-only,
  .official-gov-letterhead,
  .official-print-page-footer {
    display: block !important;
  }

  .screen-only {
    display: none !important;
  }

  .official-print-auth-footer,
  #official-print-auth-footer {
    display: flex !important;
    visibility: visible !important;
  }

  .modal-backdrop {
    display: block !important;
    position: static !important;
    inset: auto !important;
    padding: 0 !important;
    background: transparent !important;
    animation: none !important;
  }

  .modal {
    width: 100% !important;
    max-height: none !important;
    overflow: visible !important;
    padding: 0 !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    background: #fff !important;
  }

  .record-detail-modal > .record {
    padding: 0 !important;
  }

  .app-shell {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
  }

  #profile-view[hidden] {
    display: none !important;
  }

  .panel,
  .record,
  .metric,
  .child-card,
  .nursing-clinical-document,
  .official-a4-document {
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    background: #fff !important;
    break-inside: auto;
    page-break-inside: auto;
    padding: 0 !important;
  }

  * {
    box-shadow: none !important;
    text-shadow: none !important;
  }

  .pill,
  .nursing-severity,
  .severity--stable,
  .severity--watch,
  .severity--critical,
  .nursing-allergy-banner {
    background: #fff !important;
    color: #000 !important;
    border: 1px solid #000 !important;
  }

  .admission-sheet {
    border: none !important;
    border-radius: 0 !important;
    overflow: visible;
  }

  .admission-title {
    background: #fff !important;
    padding: 0 0 10px;
    border-bottom: 1px solid #000;
  }

  .admission-title p,
  .admission-title h3 {
    color: #000;
  }

  .admission-grid div,
  .sheet-lines p,
  .check-row,
  .sheet-yn-row {
    border-color: #000 !important;
    color: #000;
  }

  .sheet-yn-row {
    break-inside: avoid;
    border-bottom: 1px solid #000 !important;
  }

  .sheet-yn-answer {
    font-size: 12pt !important;
    font-weight: 700 !important;
  }

  .evolution-box {
    border-top: 1px solid #000 !important;
    background: #fff !important;
    padding: 12px 0;
  }

  .evolution-box.compact {
    border: none !important;
    border-top: 1px solid #000 !important;
    margin-top: 0;
    min-height: 0;
    background: #fff !important;
  }

  .official-record {
    border: none !important;
    border-left: none !important;
  }

  .card-head {
    border-bottom: 1px solid #000;
    padding-bottom: 8px;
    margin-bottom: 10px;
  }

  .card-head h3,
  .official-doc-title,
  .admission-title h3,
  .hosp-annual-doc-title,
  .abx-annual-doc-title,
  .apt-annual-doc-title,
  .gro-annual-doc-title {
    font-size: 12pt;
    text-transform: uppercase;
  }

  .details {
    border: none;
  }

  .author-line,
  .digital-signature {
    margin-top: 16px;
    padding-top: 10px;
    border-top: 1px solid #000;
    font-size: 10pt;
    font-weight: 700;
    text-align: center;
    color: #000;
  }

  .pill,
  .card-head-tags {
    display: none !important;
  }

  .report-page {
    display: block;
  }
}

.maintenance-overlay {
  position: fixed;
  inset: 0;
  z-index: 9990;
  display: grid;
  place-items: center;
  padding: clamp(18px, 4vw, 42px);
  background:
    linear-gradient(135deg, rgba(15, 23, 42, 0.88), rgba(69, 26, 3, 0.82));
  backdrop-filter: blur(8px);
}

.maintenance-overlay__card {
  width: min(760px, 100%);
  display: grid;
  gap: 14px;
  justify-items: center;
  text-align: center;
  padding: clamp(24px, 5vw, 48px);
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: color-mix(in srgb, var(--surface) 94%, var(--warning-soft));
  color: var(--text);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.36);
}

.maintenance-overlay__mark {
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--warning-soft);
  color: var(--warning);
  border: 1px solid color-mix(in srgb, var(--warning) 35%, transparent);
}

.maintenance-overlay__mark .icon-lucide {
  width: 34px;
  height: 34px;
}

.maintenance-overlay__eyebrow {
  margin: 0;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--warning);
}

.maintenance-overlay h2 {
  margin: 0;
  max-width: 12ch;
  font-size: clamp(2.35rem, 8vw, 5rem);
  line-height: 0.98;
  font-weight: 950;
  letter-spacing: 0;
}

.maintenance-overlay__message {
  max-width: 58ch;
  margin: 0;
  color: var(--text);
  font-size: clamp(1rem, 2.4vw, 1.3rem);
  font-weight: 700;
}

.maintenance-overlay__meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.maintenance-overlay__meta span {
  padding: 9px 12px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--warning-soft) 70%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--warning) 22%, transparent);
  color: var(--text);
  font-size: 13px;
}

.maintenance-overlay__hint {
  margin: 2px 0 0;
  color: var(--muted);
  font-weight: 700;
}

.maintenance-overlay__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 4px;
}

.maintenance-control-form textarea {
  min-height: 110px;
}

.maintenance-current-status {
  display: flex;
  align-items: center;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-weight: 700;
}

.maintenance-current-status.is-active {
  color: #047857;
  background: #ecfdf5;
  border-color: #a7f3d0;
}

.maintenance-current-status.is-inactive {
  color: var(--muted);
  background: var(--surface-soft);
}

.maintenance-control-status {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 12px 14px;
  margin: 0 0 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-soft);
}

.maintenance-control-status strong {
  font-family: "Sora", "Inter", sans-serif;
  font-size: 1.35rem;
  color: var(--text);
  letter-spacing: 0;
}

@media (max-width: 640px) {
  .maintenance-overlay {
    align-items: stretch;
  }

  .maintenance-overlay__card {
    align-self: center;
    padding: 22px;
    border-radius: 16px;
  }

  .maintenance-overlay h2 {
    max-width: 11ch;
    font-size: clamp(2.2rem, 14vw, 3.8rem);
  }
}

/* —— Dashboard: header sticky, bottom nav, busca, cards —— */

.app-header-sticky {
  position: relative;
  margin: 0;
  padding: 8px 0 0;
  box-sizing: border-box;
  transition: box-shadow 0.2s ease;
  overflow: visible;
  background: transparent;
}

.app-header-sticky .app-navbar {
  max-width: var(--layout-max, 1180px);
  margin-inline: auto;
}

.app-header-sticky.is-notifications-open {
  z-index: 120;
}

.app-header-sticky .app-navbar {
  border-bottom: 1px solid var(--border-subtle);
}

.app-header-sticky.is-scrolled {
  box-shadow: 0 8px 32px rgba(2, 6, 23, 0.08);
}

[data-theme="dark"] .app-header-sticky.is-scrolled {
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
}

.app-navbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px 18px;
  padding: 14px 18px;
  min-height: 56px;
  overflow: visible;
  background: var(--header-bg);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  box-shadow: var(--shadow-soft);
}

.navbar-brand {
  min-width: 0;
  flex: 1 1 12rem;
  display: flex;
  align-items: center;
  gap: 14px;
}

.navbar-brand-mark {
  flex-shrink: 0;
  width: 52px;
  height: 52px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, color-mix(in srgb, var(--primary) 88%, #fff), color-mix(in srgb, var(--primary-dark) 92%, #0f172a));
  color: #fff;
  box-shadow: 0 10px 28px color-mix(in srgb, var(--primary) 35%, transparent);
}

.navbar-brand-mark svg {
  width: 26px;
  height: 26px;
}

.navbar-brand-copy {
  min-width: 0;
}

.navbar-eyebrow {
  margin: 0 0 4px;
  font-size: 11px;
  letter-spacing: 0.1em;
}

.navbar-title {
  margin: 0;
  font-size: clamp(1.2rem, 2.8vw, 1.55rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.navbar-tagline {
  margin: 4px 0 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

.navbar-brand h1 {
  font-size: clamp(1.25rem, 3vw, 1.65rem);
  font-weight: 800;
  letter-spacing: -0.02em;
}

.navbar-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex: 1 1 auto;
  overflow: visible;
}

.navbar-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-size: 12px;
  font-weight: 700;
}

.navbar-badge .avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  object-fit: cover;
}

.navbar-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.navbar-link {
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.navbar-link:hover {
  color: var(--primary-dark);
  background: var(--primary-soft);
  border-color: color-mix(in srgb, var(--primary) 25%, transparent);
}

.navbar-link.is-maintenance-active {
  border-color: color-mix(in srgb, var(--warning) 55%, var(--line));
  background: color-mix(in srgb, var(--warning-soft) 78%, var(--surface));
  color: var(--warning);
}

.navbar-logout {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid color-mix(in srgb, var(--danger) 35%, transparent);
  border-radius: 12px;
  background: color-mix(in srgb, var(--danger-soft) 70%, transparent);
  color: var(--danger);
  transition: transform 0.12s ease, background 0.15s ease, border-color 0.15s ease;
}

.navbar-logout:hover {
  background: var(--danger-soft);
  border-color: var(--danger);
  transform: scale(1.04);
}

.navbar-logout:active {
  transform: scale(0.96);
}

.navbar-logout .icon-lucide {
  width: 18px;
  height: 18px;
}

.save-status-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
}

.save-status-badge--saving {
  background: color-mix(in srgb, var(--warning) 18%, var(--surface));
  color: var(--text);
}

.save-status-badge--saved {
  background: color-mix(in srgb, var(--success) 16%, var(--surface));
  color: var(--success);
}

.save-status-badge--error {
  background: color-mix(in srgb, var(--danger) 14%, var(--surface));
  color: var(--danger);
}

.connection-status-badge {
  font-size: 11px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
}

.connection-status-badge--online {
  background: color-mix(in srgb, var(--success) 18%, var(--surface));
  color: var(--success);
}

.connection-status-badge--local {
  background: color-mix(in srgb, var(--warning) 22%, var(--surface));
  color: var(--warning);
}

.app-mode-banner,
.login-local-warning {
  margin: 0;
  padding: 10px 14px;
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  background: #fef3c7;
  color: #92400e;
  border-bottom: 1px solid #fcd34d;
}

.mode-banner-action {
  margin-left: 8px;
  border: 1px solid currentColor;
  border-radius: 999px;
  padding: 4px 9px;
  color: inherit;
  background: transparent;
  font: inherit;
  font-weight: 800;
}

.mode-banner-action:hover {
  background: rgba(146, 64, 14, 0.12);
}

[data-theme="dark"] .app-mode-banner,
[data-theme="dark"] .login-local-warning {
  background: rgba(120, 53, 15, 0.35);
  color: #fde68a;
  border-bottom-color: rgba(251, 191, 36, 0.35);
}

.login-legal-links {
  margin: 12px 0 0;
  text-align: center;
  font-size: 12px;
}

.login-legal-links a {
  color: var(--primary);
  font-weight: 700;
}

.legal-footer-link {
  font-size: 12px;
  margin-right: 8px;
}

.dashboard-insights {
  --insight-waiting: #ca8a04;
  --insight-waiting-soft: #fef9c3;
  --insight-antibiotic: #059669;
  --insight-antibiotic-soft: #d1fae5;
  --insight-no-weight: #ea580c;
  --insight-no-weight-soft: #ffedd5;
  --insight-critical: #b42318;
  --insight-critical-soft: #fee4e2;
  --insight-info: #2563eb;
  --insight-info-soft: #dbeafe;
  margin: 0 0 12px;
  padding: 7px 10px;
  border-radius: 8px;
  border: 1px solid color-mix(in srgb, var(--line) 88%, transparent);
  background: color-mix(in srgb, var(--surface) 98%, var(--bg));
}

.dashboard-insights-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  width: auto;
  margin: 0;
  padding: 2px 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
  text-align: left;
  cursor: pointer;
}

.dashboard-insights-toggle:hover {
  color: var(--primary);
}

.dashboard-insights-preview {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: thin;
}

.dashboard-insight-preview-chip {
  flex: 0 0 auto;
  max-width: min(46vw, 260px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  border-radius: 999px;
  border: 1px solid var(--line);
  padding: 5px 10px;
  font-size: 10.5px;
  font-weight: 800;
  background: var(--bg);
  cursor: pointer;
}

.dashboard-insight-more {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px dashed var(--line);
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  background: transparent;
}

.dashboard-insights-panel {
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transform: translateY(-4px);
  transition:
    max-height 0.32s ease,
    opacity 0.24s ease,
    transform 0.24s ease,
    margin-top 0.24s ease;
}

.dashboard-insights.is-open .dashboard-insights-panel.is-visible,
.dashboard-insights.is-open .dashboard-insights-panel:not([hidden]) {
  margin-top: 8px;
  max-height: 1200px;
  opacity: 1;
  transform: translateY(0);
}

.dashboard-insights-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: 8px;
}

@media (max-width: 1100px) {
  .dashboard-insights-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .dashboard-insights-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.dashboard-insight-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 64px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--bg);
}

.dashboard-insight-card__label {
  margin: 0;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.35;
}

.dashboard-insight-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  opacity: 0;
  transform: translateY(2px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.dashboard-insight-card:hover .dashboard-insight-card__actions,
.dashboard-insight-card:focus-within .dashboard-insight-card__actions {
  opacity: 1;
  transform: translateY(0);
}

.dashboard-insight-card__action {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 10px;
  font-weight: 700;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}

.dashboard-insight-card__action:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.dashboard-insight--waiting-list,
.dashboard-insight-preview-chip.dashboard-insight--waiting-list {
  border-color: color-mix(in srgb, var(--insight-waiting) 45%, var(--line));
  background: color-mix(in srgb, var(--insight-waiting-soft) 72%, var(--surface));
}

.dashboard-insight--antibiotic,
.dashboard-insight-preview-chip.dashboard-insight--antibiotic {
  border-color: color-mix(in srgb, var(--insight-antibiotic) 45%, var(--line));
  background: color-mix(in srgb, var(--insight-antibiotic-soft) 72%, var(--surface));
}

.dashboard-insight--no-weight,
.dashboard-insight-preview-chip.dashboard-insight--no-weight {
  border-color: color-mix(in srgb, var(--insight-no-weight) 45%, var(--line));
  background: color-mix(in srgb, var(--insight-no-weight-soft) 72%, var(--surface));
}

.dashboard-insight--critical,
.dashboard-insight-preview-chip.dashboard-insight--critical {
  border-color: color-mix(in srgb, var(--insight-critical) 45%, var(--line));
  background: color-mix(in srgb, var(--insight-critical-soft) 72%, var(--surface));
}

.dashboard-insight--info,
.dashboard-insight-preview-chip.dashboard-insight--info {
  border-color: color-mix(in srgb, var(--insight-info) 45%, var(--line));
  background: color-mix(in srgb, var(--insight-info-soft) 72%, var(--surface));
}

.dashboard-insights-title {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 800;
}

.dashboard-insights-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.dashboard-insight {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  background: var(--bg);
  cursor: pointer;
}

.dashboard-insight--warning {
  border-color: color-mix(in srgb, var(--warning) 40%, var(--line));
}

.dashboard-insight--info {
  border-color: color-mix(in srgb, var(--primary) 35%, var(--line));
}

.navbar-notifications-mount {
  position: relative;
  display: inline-flex;
  flex: 0 0 auto;
  align-self: center;
  width: 42px;
  height: 42px;
  overflow: visible;
  z-index: 80;
}

.navbar-notifications-wrap {
  position: relative;
  display: block;
  width: 42px;
  height: 42px;
  flex-shrink: 0;
}

.navbar-notifications-btn {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.navbar-notifications-btn:hover {
  background: var(--primary-soft);
  border-color: color-mix(in srgb, var(--primary) 35%, transparent);
}

.navbar-notifications-btn[aria-expanded="true"] {
  background: var(--primary-soft);
  border-color: color-mix(in srgb, var(--primary) 40%, transparent);
}

.navbar-notifications-btn .icon-lucide {
  width: 20px;
  height: 20px;
}

.navbar-notifications-btn .notification-bell-emoji,
.notifications-sound-toggle .notification-bell-emoji {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1em;
  height: 1em;
  font-family: "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", sans-serif;
  font-size: 20px;
  line-height: 1;
  filter: drop-shadow(0 1px 2px rgba(245, 158, 11, 0.35));
}

.navbar-notifications-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #dc2626;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  line-height: 18px;
  text-align: center;
  box-shadow: 0 0 0 2px var(--surface);
  animation: notifBadgePulse 2s ease-in-out infinite;
}

@keyframes notifBadgePulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.08);
  }
}

.navbar-notifications-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  left: auto;
  bottom: auto;
  margin: 0;
  z-index: 90;
  width: min(310px, calc(100vw - 20px));
  max-height: min(58vh, 340px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow:
    0 14px 40px rgba(15, 23, 42, 0.14),
    0 4px 14px rgba(15, 23, 42, 0.08);
  transform: none;
}

[data-theme="dark"] .navbar-notifications-panel {
  background: #1e293b;
  border-color: #334155;
  box-shadow:
    0 18px 48px rgba(0, 0, 0, 0.55),
    0 6px 16px rgba(0, 0, 0, 0.35),
    0 0 0 1px rgba(148, 163, 184, 0.12);
}

.navbar-notifications-panel[hidden] {
  display: none !important;
  visibility: hidden;
  pointer-events: none;
}

.navbar-notifications-panel--floating {
  position: fixed !important;
  z-index: 180 !important;
  margin: 0;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.navbar-notifications-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
}

.navbar-notifications-head-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.notifications-sound-toggle {
  min-width: 34px;
  min-height: 34px;
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 10px;
  font-size: 18px;
  line-height: 1;
}

.navbar-notifications-head h2 {
  margin: 0;
  font-size: 12px;
  font-weight: 800;
}

.navbar-notifications-count {
  min-width: 20px;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-size: 10px;
  font-weight: 800;
  text-align: center;
}

.navbar-notifications-list {
  overflow-y: auto;
  padding: 6px;
  display: grid;
  gap: 5px;
}

.notification-item-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
  align-items: stretch;
}

.notification-item {
  display: grid;
  gap: 3px;
  width: 100%;
  text-align: left;
  padding: 8px 10px;
  border-radius: 9px;
  border: 1px solid transparent;
  background: transparent;
  color: inherit;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.notification-read-btn,
.notifications-read-all {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface-soft) 80%, transparent);
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 800;
  cursor: pointer;
}

.notification-read-btn {
  align-self: center;
  padding: 7px 8px;
}

.notifications-read-all {
  padding: 6px 8px;
}

.notifications-close {
  min-height: 34px;
  padding: 6px 10px;
  border-radius: 10px;
  font-size: 12px;
}

.notification-read-btn:hover,
.notifications-read-all:hover {
  color: var(--text);
  border-color: var(--primary);
  background: color-mix(in srgb, var(--primary) 12%, var(--surface) 88%);
}

.notification-item:hover {
  background: var(--surface-soft);
}

.notification-item--danger {
  border-color: #fecaca;
  background: #fef2f2;
}

.notification-item--warning {
  border-color: #fde68a;
  background: #fffbeb;
}

.notification-item--info {
  border-color: #bfdbfe;
  background: #eff6ff;
}

[data-theme="dark"] .notification-item--danger {
  border-color: rgba(248, 113, 113, 0.35);
  background: rgba(127, 29, 29, 0.35);
}

.notification-item-title {
  font-size: 11px;
  font-weight: 800;
}

.notification-item-msg {
  font-size: 10px;
  color: var(--muted);
  line-height: 1.4;
}

.notification-empty {
  margin: 0;
  padding: 14px 10px;
  text-align: center;
  font-size: 11px;
  color: var(--muted);
}

.theme-switch {
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.theme-switch-track {
  position: relative;
  display: block;
  width: 52px;
  height: 28px;
  border-radius: 999px;
  background: linear-gradient(180deg, #7dd3fc 0%, #38bdf8 100%);
  border: 1px solid #7dd3fc;
  transition: background 0.3s ease, border-color 0.3s ease;
}

.theme-switch[data-theme-state="dark"] .theme-switch-track {
  background: linear-gradient(180deg, #1e3a8a 0%, #0f172a 100%);
  border-color: #1e40af;
}

.theme-switch-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.2);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.theme-switch[data-theme-state="dark"] .theme-switch-thumb {
  transform: translateX(24px);
}

.theme-switch-glyph {
  position: absolute;
  top: 50%;
  width: 14px;
  height: 14px;
  transform: translateY(-50%);
  pointer-events: none;
  transition: opacity 0.3s ease, stroke 0.3s ease, fill 0.3s ease;
}

.theme-switch-glyph--sun {
  left: 7px;
  color: #facc15;
  stroke: #f59e0b;
  fill: #fde047;
}

.theme-switch-glyph--moon {
  right: 7px;
  color: #cbd5e1;
  stroke: #94a3b8;
  fill: #e2e8f0;
}

.theme-switch[data-theme-state="light"] .theme-switch-glyph--moon,
.theme-switch[data-theme-state="dark"] .theme-switch-glyph--sun {
  opacity: 0.4;
}

.theme-switch[data-theme-state="light"] .theme-switch-glyph--sun,
.theme-switch[data-theme-state="dark"] .theme-switch-glyph--moon {
  opacity: 1;
}

.theme-switch.is-switching .theme-switch-glyph--sun,
.theme-switch.is-switching .theme-switch-glyph--moon {
  animation: themeGlyphSpin 0.48s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes themeGlyphSpin {
  from {
    transform: translateY(-50%) rotate(0deg);
  }
  to {
    transform: translateY(-50%) rotate(360deg);
  }
}

.dashboard-panel {
  width: 100%;
  display: grid;
  gap: 18px;
  justify-items: center;
}

.dashboard-panel > * {
  width: min(100%, var(--layout-max, 1180px));
}

.dashboard-command {
  display: grid;
  gap: 14px;
  padding: clamp(18px, 2.4vw, 24px);
  border-radius: 22px;
  border: 1px solid var(--border-subtle);
  background: var(--surface-elevated);
  box-shadow: 0 24px 62px rgba(15, 23, 42, 0.1), var(--shadow-soft);
}

.dashboard-pin-wrap {
  min-height: max(var(--context-bar-height, 0px), 0px);
}

.dashboard-pin-bar {
  position: relative;
  display: grid;
  gap: 12px;
  padding-bottom: 4px;
  width: min(100%, var(--layout-max, 1180px));
  margin: 0 auto;
}

.dashboard-pin-bar .dashboard-home-tabs {
  margin: 0;
}

.dashboard-command-block .dashboard-command {
  margin: 0;
  box-shadow: none;
}

.dashboard-command-block .dashboard-command {
  border-radius: 22px;
}

.dashboard-command-top {
  display: block;
}

.dashboard-toolbar-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(148px, 200px) auto auto;
  gap: 8px;
  align-items: end;
}

.dashboard-filters-anchor {
  position: relative;
  align-self: end;
}

.dashboard-filters-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 56px;
  padding: 0 18px;
  border-radius: 16px;
  border: 1px solid var(--border-subtle);
  background: color-mix(in srgb, var(--surface) 72%, transparent);
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.dashboard-filters-toggle:hover,
.dashboard-filters-toggle[aria-expanded="true"] {
  border-color: color-mix(in srgb, var(--primary) 45%, transparent);
  background: var(--primary-soft);
  color: var(--primary-dark);
  box-shadow: 0 8px 24px color-mix(in srgb, var(--primary) 12%, transparent);
}

.dashboard-filters-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 60;
  width: min(440px, 92vw);
  padding: 16px 18px 18px;
  border-radius: 18px;
  border: 1px solid var(--border-subtle);
  background: var(--surface);
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.14);
  opacity: 0;
  transform: translateY(-10px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.22s ease;
}

.dashboard-filters-panel.is-open {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.dashboard-filters-panel-heading {
  margin: 0 0 14px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.dashboard-filters-panel-section + .dashboard-filters-panel-section {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.dashboard-filters-panel-label {
  margin: 0 0 10px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.dashboard-filters-panel-chips {
  flex-wrap: wrap !important;
  gap: 8px !important;
}

.dashboard-filters-panel-chips .chip {
  min-height: 38px;
  padding: 0 14px;
  font-size: 13px;
}

.dashboard-filters-backdrop {
  display: none;
}

.dashboard-search-column {
  order: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

@media (max-width: 900px) {
  .dashboard-toolbar-row {
    grid-template-columns: minmax(0, 1fr) minmax(132px, 180px);
  }

  .dashboard-search-wrap {
    grid-column: 1 / -1;
  }

  .dashboard-filters-toggle,
  .dashboard-toolbar-row .btn-new-child {
    min-height: 48px;
  }

  .dashboard-toolbar-row .btn-new-child {
    grid-column: 1 / -1;
    width: 100%;
    max-width: none;
  }
}

@media (max-width: 719px) {
  .dashboard-filters-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 70;
    background: rgba(15, 23, 42, 0.42);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s ease;
  }

  .dashboard-filters-backdrop.is-visible {
    opacity: 1;
    pointer-events: auto;
  }

  .dashboard-filters-panel {
    position: fixed;
    top: auto;
    right: 0;
    left: 0;
    bottom: 0;
    width: auto;
    max-height: min(78dvh, 560px);
    border-radius: 20px 20px 0 0;
    transform: translateY(100%);
    overflow-y: auto;
  }

  .dashboard-filters-panel.is-open {
    transform: translateY(0);
  }
}

.dashboard-search-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(148px, 200px);
  gap: 8px;
  align-items: end;
}

.dashboard-search-scope {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
}

.dashboard-search-scope-label {
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.dashboard-scope-select {
  min-height: 56px;
  border-radius: 16px;
  border: 1px solid var(--border-subtle);
  background: color-mix(in srgb, var(--surface) 60%, transparent);
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  padding: 0 10px;
}

.dashboard-search-hint {
  margin: 0;
  font-size: 12px;
  line-height: 1.35;
}

.dashboard-birthdays {
  display: grid;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  background: color-mix(in srgb, var(--surface-elevated) 84%, transparent);
  box-shadow: 0 12px 34px rgba(15, 23, 42, 0.08);
}

.dashboard-birthdays__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.dashboard-birthdays__head div {
  display: grid;
  gap: 2px;
}

.dashboard-birthdays__head span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.dashboard-birthdays__head strong {
  color: var(--text);
  font-size: 17px;
}

.dashboard-birthdays__filter {
  min-height: 34px;
  border: 1px solid color-mix(in srgb, var(--primary) 35%, var(--line));
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-weight: 900;
  padding: 0 12px;
  cursor: pointer;
}

.dashboard-birthdays__list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.dashboard-birthday-chip,
.dashboard-birthday-more {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  padding: 0 12px;
  font-weight: 850;
}

.dashboard-birthday-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.dashboard-birthday-chip span {
  color: var(--primary-dark);
  font-weight: 950;
}

@media (max-width: 719px) {
  .navbar-tagline {
    display: none;
  }
}

@media (max-width: 560px) {
  .dashboard-toolbar-row {
    grid-template-columns: 1fr;
  }

  .dashboard-search-scope {
    grid-column: 1 / -1;
  }
}

.dashboard-search-wrap {
  position: relative;
  display: block;
}

.dashboard-search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--muted);
  pointer-events: none;
}

.dashboard-search {
  width: 100%;
  min-height: 56px;
  padding-left: 44px;
  border-radius: 16px;
  border-color: var(--border-subtle);
  background: color-mix(in srgb, var(--surface) 60%, transparent);
}

.btn-new-child {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 56px;
  padding: 0 28px;
  border: 0;
  border-radius: 16px;
  background: linear-gradient(135deg, #34d399 0%, #059669 100%);
  color: #fff;
  font-size: 16px;
  font-weight: 800;
  box-shadow: 0 14px 36px rgba(5, 150, 105, 0.28);
  transition: transform 0.14s ease, box-shadow 0.14s ease, filter 0.14s ease;
  white-space: nowrap;
  align-self: center;
}

.btn-new-child:hover {
  filter: brightness(1.06);
  box-shadow: 0 18px 44px rgba(13, 148, 136, 0.34);
}

.btn-new-child:active {
  filter: brightness(0.98);
}

.btn-new-child .icon-lucide {
  width: 20px;
  height: 20px;
}

.dashboard-filters-scroll {
  display: flex;
  justify-content: center;
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
  padding-bottom: 4px;
  margin: 0 auto;
  padding-inline: 4px;
}

.chips-row {
  display: flex;
  flex-wrap: nowrap;
  gap: 10px;
  min-width: min-content;
  padding: 2px 0;
}

.dashboard-filters .chip,
.chips-row .chip {
  min-height: 46px;
  padding: 0 20px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 14px;
}

.dashboard-home-tabs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  width: 100%;
  margin: 0 auto 22px;
}

.dashboard-home-tab {
  border: 1px solid var(--line);
  border-radius: 999px;
  min-height: 48px;
  padding: 0 20px;
  background: var(--surface);
  color: var(--muted);
  font-weight: 800;
  font-size: 15px;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}

.dashboard-home-tab:hover {
  border-color: color-mix(in srgb, var(--brand) 45%, var(--line));
  box-shadow: 0 16px 32px rgba(15, 23, 42, 0.1);
}

.dashboard-home-tab.is-active {
  border-color: var(--brand);
  background: color-mix(in srgb, var(--brand) 12%, var(--surface));
  color: var(--brand);
}

.annual-print-profile-btn,
.annual-print-all-btn {
  min-height: 46px;
  padding-inline: 18px;
  border-radius: 14px;
  font-weight: 800;
}

.prescriptions-workspace {
  display: grid;
  gap: 18px;
}

.prescriptions-alert {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 16px;
  border: 1px solid color-mix(in srgb, var(--warning) 34%, var(--line));
  border-radius: 16px;
  background: color-mix(in srgb, var(--warning-soft) 64%, var(--surface));
  color: var(--text);
}

.prescriptions-alert .icon-lucide {
  width: 22px;
  height: 22px;
  color: var(--warning);
}

.prescriptions-alert p {
  margin: 4px 0 0;
  color: var(--muted);
}

.prescriptions-toolbar {
  align-items: end;
}

.prescriptions-search-label {
  min-width: min(100%, 320px);
  flex: 1 1 260px;
}

.prescription-card-alert {
  display: grid;
  gap: 4px;
  margin: 12px 0;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface-soft) 72%, transparent);
}

.prescription-card-alert.is-alert {
  border-color: color-mix(in srgb, var(--warning) 42%, var(--line));
  background: color-mix(in srgb, var(--warning-soft) 62%, var(--surface));
}

.prescription-card-alert span,
.prescription-card-last {
  color: var(--muted);
}

.prescriptions-book-wrap {
  margin-top: 2px;
}

.presc-annual-sheet.annual-book-panel,
.presc-annual-sheet.annual-book-print-sheet {
  color: #0f172a;
}

.presc-annual-doc-title {
  margin: 0 0 12px;
  text-align: center;
  font-weight: 900;
  text-transform: uppercase;
}

.presc-annual-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 12px;
}

.presc-annual-table th,
.presc-annual-table td {
  border: 1px solid #cbd5e1;
  padding: 8px;
  vertical-align: top;
  word-break: break-word;
}

.presc-annual-table th {
  background: #e0f2fe;
  color: #0f172a;
  font-weight: 900;
}

.presc-patient-name {
  font-weight: 900;
}

.presc-patient-name span,
.presc-annual-table td span {
  display: block;
  margin-top: 3px;
  font-size: 11px;
  color: #475569;
  font-weight: 600;
}

.presc-allergy-cell {
  color: #92400e;
  font-weight: 800;
}

.presc-manual-row td {
  height: 62px;
  background: #fff;
}

.presc-write-lines {
  min-height: 48px;
  background:
    repeating-linear-gradient(
      to bottom,
      transparent 0,
      transparent 14px,
      rgba(15, 23, 42, 0.4) 15px
    );
}

.presc-empty-row td {
  color: #64748b;
}

.exams-workspace {
  display: grid;
  gap: 16px;
}

.exam-alert-panel {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: color-mix(in srgb, var(--surface-soft) 82%, transparent);
}

.exam-kpi-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.exam-kpi {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: color-mix(in srgb, var(--surface-soft) 82%, transparent);
}

.exam-kpi span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.exam-kpi strong {
  display: block;
  margin-top: 3px;
  font-size: 1.35rem;
  color: var(--text);
}

.exam-kpi--warn {
  border-color: color-mix(in srgb, var(--warning) 38%, var(--line));
}

.exam-kpi--danger {
  border-color: color-mix(in srgb, var(--danger) 38%, var(--line));
}

.exam-alert-chip {
  border: 1px solid color-mix(in srgb, var(--danger) 40%, var(--line));
  background: color-mix(in srgb, var(--danger-soft) 68%, var(--surface));
  color: var(--text);
  border-radius: 999px;
  padding: 7px 10px;
  font-weight: 800;
  cursor: pointer;
}

.exam-alert-chip span {
  color: var(--muted);
  margin-right: 6px;
  font-weight: 700;
}

.exam-tabs {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 4px;
  width: fit-content;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface-soft) 82%, transparent);
}

.exam-tabs button {
  min-height: 38px;
  padding: 8px 14px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
  cursor: pointer;
}

.exam-tabs button.is-active {
  background: var(--primary);
  color: #fff;
}

.exam-card-single-summary {
  margin: 8px 0 10px;
  color: var(--muted);
  font-size: 0.92rem;
}

.exam-documents-panel {
  display: grid;
  gap: 12px;
}

.exam-documents-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.exam-documents-head h3 {
  margin: 0 0 4px;
}

.exam-documents-list {
  display: grid;
  gap: 10px;
}

.exam-document-card {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}

.exam-document-card p {
  margin: 4px 0 0;
}

@media (max-width: 640px) {
  .exam-kpi-row {
    grid-template-columns: 1fr;
  }

  .exam-document-card {
    flex-direction: column;
  }
}

.exam-test-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 8px;
  margin: 12px 0;
}

.exam-test-pill {
  display: grid;
  gap: 3px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface-soft) 82%, transparent);
}

.exam-test-pill span {
  color: var(--muted);
  font-size: 0.88rem;
}

.exam-test-pill--danger {
  border-color: color-mix(in srgb, var(--danger) 46%, var(--line));
  background: color-mix(in srgb, var(--danger-soft) 72%, var(--surface));
}

.exam-test-pill--success {
  border-color: color-mix(in srgb, var(--success) 35%, var(--line));
  background: color-mix(in srgb, var(--success-soft) 70%, var(--surface));
}

.exam-test-pill--warning {
  border-color: color-mix(in srgb, var(--warning) 40%, var(--line));
  background: color-mix(in srgb, var(--warning-soft) 70%, var(--surface));
}

.rapid-test-form {
  grid-template-columns: minmax(180px, 260px) minmax(140px, 200px) 1fr;
}

.rapid-test-table-wrap,
.exam-detail-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}

.rapid-test-table,
.exam-detail-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 980px;
}

.rapid-test-table th,
.rapid-test-table td,
.exam-detail-table th,
.exam-detail-table td {
  border-bottom: 1px solid var(--line);
  padding: 8px;
  text-align: left;
  vertical-align: top;
}

.rapid-test-table th,
.exam-detail-table th {
  font-size: 0.76rem;
  text-transform: uppercase;
  color: var(--muted);
  background: color-mix(in srgb, var(--surface-soft) 82%, transparent);
}

.rapid-test-table input,
.rapid-test-table select {
  width: 100%;
  min-height: 38px;
  padding: 7px 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
  color: var(--text);
  font-weight: 700;
}

.exam-row-positive td {
  background: color-mix(in srgb, var(--danger-soft) 55%, transparent);
}

@media (max-width: 720px) {
  .prescriptions-toolbar {
    display: grid;
    grid-template-columns: 1fr;
  }

  .presc-annual-table {
    min-width: 920px;
  }
}

@media print {
  body.prescriptions-print-mode * {
    visibility: hidden;
  }

  body.prescriptions-print-mode .prescriptions-print-root,
  body.prescriptions-print-mode .prescriptions-print-root *,
  body.prescriptions-print-mode .annual-book-print-source,
  body.prescriptions-print-mode .annual-book-print-source *,
  body.prescriptions-print-mode #annual-book-viewer-print-mount,
  body.prescriptions-print-mode #annual-book-viewer-print-mount *,
  body.prescriptions-print-mode #official-print-page-footer,
  body.prescriptions-print-mode #official-print-page-footer *,
  body.prescriptions-print-mode #official-print-auth-footer,
  body.prescriptions-print-mode #official-print-auth-footer * {
    visibility: visible;
  }

  body.prescriptions-print-mode .prescriptions-print-root,
  body.prescriptions-print-mode .annual-book-print-source,
  body.prescriptions-print-mode #annual-book-viewer-print-mount {
    position: absolute;
    left: 0;
    top: 0;
    width: 100% !important;
    min-width: 0;
    height: auto !important;
    margin: 0 !important;
    border: none;
    clip: auto !important;
    overflow: visible !important;
    white-space: normal !important;
    display: block !important;
  }

  body.prescriptions-print-mode .annual-book-cards-grid,
  body.prescriptions-print-mode .annual-book-card,
  body.prescriptions-print-mode .annual-book-toolbar,
  body.prescriptions-print-mode .prescriptions-alert {
    display: none !important;
  }

  body.prescriptions-print-mode .presc-annual-table {
    width: 100% !important;
    table-layout: fixed !important;
    border-collapse: collapse !important;
    font-size: 7pt;
  }

  body.prescriptions-print-mode .presc-annual-table th,
  body.prescriptions-print-mode .presc-annual-table td {
    border-color: #000 !important;
    padding: 3px 2px !important;
    color: #000 !important;
    line-height: 1.18 !important;
    overflow-wrap: anywhere !important;
    word-break: normal !important;
    white-space: normal !important;
  }

  body.prescriptions-print-mode .presc-annual-table th {
    background: #e5e7eb !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}

.profile-analytics-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
}

.overview-analytics-link {
  margin: 0 0 12px;
}

.link-button {
  border: 0;
  background: none;
  padding: 0;
  color: var(--brand);
  font-weight: 700;
  text-decoration: underline;
  cursor: pointer;
}

.chips-row .filter-chip {
  scroll-snap-align: start;
}

.filter-chip {
  flex: 0 0 auto;
  min-height: 34px;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: color-mix(in srgb, var(--surface) 50%, transparent);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.filter-chip:hover {
  border-color: color-mix(in srgb, var(--primary) 40%, transparent);
  color: var(--primary-dark);
}

.filter-chip.active {
  border-color: color-mix(in srgb, var(--primary) 50%, transparent);
  background: var(--primary-soft);
  color: var(--primary-dark);
  box-shadow:
    inset 0 0 0 1px color-mix(in srgb, var(--primary) 30%, transparent),
    0 0 14px var(--accent-glow);
}

.child-card-top {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.child-card-avatar {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid var(--card-border);
  box-shadow: var(--shadow-soft);
}

.child-card-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.child-card-initials {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  font-size: 15px;
  font-weight: 800;
  color: #fff;
  background: hsl(var(--avatar-hue, 168), 52%, 42%);
}

.child-card-identity {
  min-width: 0;
  flex: 1;
}

.child-card-name {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1.25;
}

.child-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  margin: 6px 0 0;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.4;
}

.child-card-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.child-card-meta-item .icon-lucide {
  width: 12px;
  height: 12px;
  opacity: 0.7;
}

.presence-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 6px;
  min-height: 22px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.presence-badge .icon-lucide {
  width: 8px;
  height: 8px;
  fill: currentColor;
}

.presence-badge--active {
  background: var(--success-soft);
  color: var(--success);
}

.presence-badge--away {
  background: var(--danger-soft);
  color: var(--danger);
}

.med-alert-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.med-alert-grid .med-alert:nth-child(3):last-child {
  grid-column: 1 / -1;
}

.med-alert {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid transparent;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.25;
}

.med-alert .icon-lucide {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.med-alert--meds {
  background: #ecfdf5;
  color: #047857;
  border-color: #a7f3d0;
}

.med-alert--meds.is-active {
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.2);
}

.med-alert--controlled {
  background: var(--pill-neutral-bg);
  color: var(--pill-neutral-text);
}

.med-alert--controlled.is-active {
  background: #fef2f2;
  color: #dc2626;
  border-color: #fecaca;
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.22);
}

.med-alert--appointment {
  background: #eff6ff;
  color: #1d4ed8;
  border-color: #bfdbfe;
}

.med-alert--appointment.is-active {
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.2);
}

.med-alert--muted {
  opacity: 0.72;
}

[data-theme="dark"] .med-alert--meds {
  background: rgba(6, 78, 59, 0.45);
  color: #6ee7b7;
  border-color: rgba(16, 185, 129, 0.25);
}

[data-theme="dark"] .med-alert--controlled.is-active {
  background: rgba(127, 29, 29, 0.4);
  color: #fca5a5;
  border-color: rgba(248, 113, 113, 0.3);
}

[data-theme="dark"] .med-alert--appointment {
  background: rgba(30, 58, 138, 0.35);
  color: #93c5fd;
  border-color: rgba(59, 130, 246, 0.25);
}

.child-card-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 50px;
  margin-top: 8px;
  padding: 12px 16px;
  border: 1px solid color-mix(in srgb, var(--primary) 35%, transparent);
  border-radius: 14px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--primary-soft) 90%, transparent), color-mix(in srgb, var(--primary-soft) 60%, transparent));
  color: var(--primary-dark);
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  transition: filter 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.child-card-cta:hover {
  filter: brightness(1.1);
  border-color: var(--primary);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--primary) 20%, transparent), 0 8px 20px color-mix(in srgb, var(--primary) 15%, transparent);
}

.child-card-cta .icon-lucide {
  width: 16px;
  height: 16px;
  transition: transform 0.2s ease;
}

.child-card-cta:hover .icon-lucide {
  transform: translateX(3px);
}

.skeleton {
  background: linear-gradient(
    90deg,
    var(--skeleton-base) 0%,
    var(--skeleton-shine) 45%,
    var(--skeleton-base) 90%
  );
  background-size: 200% 100%;
  animation: skeletonShimmer 1.2s ease-in-out infinite;
  border-radius: 8px;
}

@keyframes skeletonShimmer {
  0% {
    background-position: 100% 0;
  }
  100% {
    background-position: -100% 0;
  }
}

.skeleton-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  flex-shrink: 0;
}

.skeleton-line {
  height: 12px;
}

.skeleton-line--title {
  height: 18px;
  width: 72%;
}

.skeleton-line--short {
  width: 45%;
}

.skeleton-tile {
  min-height: 44px;
  border-radius: 12px;
}

.children-grid.is-loading:has(.child-card--skeleton) .child-card:not(.child-card--skeleton) {
  display: none;
}

.app-bottom-nav {
  display: none;
  position: relative;
  width: 100%;
  margin-top: 8px;
  padding: 8px max(12px, env(safe-area-inset-right)) max(10px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
  background: var(--surface-elevated);
  border-top: 1px solid var(--border-subtle);
  box-shadow: 0 -8px 28px rgba(2, 6, 23, 0.1);
}

.app-bottom-nav.is-visible {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
  gap: 4px;
}

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 52px;
  padding: 6px 4px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  transition: color 0.15s ease, background 0.15s ease;
}

.bottom-nav-item .icon-lucide {
  width: 20px;
  height: 20px;
}

.bottom-nav-item:hover,
.bottom-nav-item.is-active {
  color: var(--primary);
  background: var(--primary-soft);
}

.bottom-nav-item .bottom-nav-badge {
  position: absolute;
  top: 4px;
  right: calc(50% - 22px);
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  line-height: 16px;
  text-align: center;
}

.bottom-nav-item {
  position: relative;
}

.navbar-link--desktop-only {
  display: inline-flex;
}

@media (max-width: 1023px) {
  .navbar-link--desktop-only {
    display: none !important;
  }

  .dashboard-shell {
    padding-bottom: 12px;
  }

  .navbar-badge-text {
    display: none;
  }
}

@media (min-width: 1024px) {
  .app-bottom-nav {
    display: none !important;
  }
}

/* Modal React — Cadastrar criança */
.child-form-modal-backdrop {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right))
    max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
}

.child-form-modal-backdrop .modal {
  display: contents;
}

.child-form-modal-mount {
  width: 100%;
  max-width: 42rem;
  margin: 0 auto;
}

.child-form-modal-scope {
  width: 100%;
}

.dashboard-empty {
  grid-column: 1 / -1;
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 48px 20px;
  text-align: center;
  color: var(--muted);
}

.dashboard-empty .icon-lucide {
  width: 36px;
  height: 36px;
  opacity: 0.5;
}

.app-credits {
  margin-top: 8px;
  padding: 20px 16px 28px;
  border-top: 1px solid var(--border-subtle);
  text-align: center;
}

.dev-signature {
  display: inline-block;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  font-family: "Sora", "Inter", system-ui, sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: #64748b;
  text-decoration: none;
  cursor: default;
  transition:
    transform 0.25s ease,
    filter 0.25s ease,
    color 0.25s ease;
}

.dev-signature-hover [data-developer-contact],
.dev-signature-hover[data-developer-contact] {
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: transparent;
  transition: text-decoration-color 0.2s ease;
}

.dev-signature:hover .dev-signature-hover [data-developer-contact],
.dev-signature:hover .dev-signature-hover[data-developer-contact],
.dev-signature:focus-visible .dev-signature-hover [data-developer-contact] {
  text-decoration-color: rgba(52, 211, 153, 0.65);
}

.dev-signature-wrap {
  position: relative;
  display: inline-block;
}

.dev-signature-default {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: center;
  gap: 6px;
  max-width: min(640px, calc(100vw - 32px));
}

.dev-signature-tip-label {
  font-weight: 800;
  color: var(--primary);
  flex-shrink: 0;
}

.dev-signature-tip {
  color: var(--muted);
  font-weight: 600;
  text-align: left;
  opacity: 0;
  transition: opacity 0.35s ease;
}

.dev-signature-tip.dev-signature-tip-visible {
  opacity: 1;
}

.dev-signature-hover {
  display: none;
}

.dev-signature:hover,
.dev-signature:focus-visible {
  transform: translateY(-4px) scale(1.1);
  outline: none;
}

.dev-signature:hover .dev-signature-default,
.dev-signature:focus-visible .dev-signature-default {
  display: none;
}

.dev-signature:hover .dev-signature-hover,
.dev-signature:focus-visible .dev-signature-hover {
  display: inline;
  background: linear-gradient(90deg, #34d399, #14b8a6);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 10px rgba(52, 211, 153, 0.55));
}

@media (hover: none) {
  .dev-signature-hover {
    display: block;
    margin-top: 6px;
    font-size: 11px;
    font-weight: 700;
    color: var(--muted);
    background: none;
    filter: none;
    -webkit-background-clip: unset;
    background-clip: unset;
  }

  .dev-signature-hover strong {
    color: var(--primary);
  }
}

.icon-lucide {
  display: block;
  flex-shrink: 0;
}

@media (prefers-reduced-motion: reduce) {
  .child-card {
    animation: none;
  }

  .theme-switch-thumb,
  html.theme-fade,
  html.theme-fade body,
  html.theme-fade .app-shell,
  html.theme-fade .app-navbar,
  html.theme-fade .profile-sticky-nav,
  html.theme-fade .card,
  html.theme-fade .login-shell,
  html.theme-fade .dashboard-panel {
    transition: none;
  }

  .dev-signature:hover,
  .dev-signature:focus-visible {
    transform: none;
  }
}

@media (max-width: 640px) {
  .app-navbar {
    padding: 12px 14px;
  }

  .navbar-actions {
    gap: 8px;
  }

  .dashboard-command-top .btn-new-child span {
    display: inline;
  }

  .dashboard-command-top .btn-new-child {
    width: 100%;
    padding: 0 18px;
    transform: none;
  }

  .dashboard-command-top .btn-new-child:hover,
  .dashboard-command-top .btn-new-child:active {
    transform: scale(0.98);
  }
}

/* —— Evolução de enfermagem (workspace clínico) —— */

.nursing-workspace {
  width: 100%;
  max-width: var(--layout-max);
  margin: 0 auto;
  padding: 4px 0 24px;
  background: #f1f5f9;
  border-radius: 16px;
}

[data-theme="dark"] .nursing-workspace {
  background: #020617;
}

.nursing-workspace-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.nursing-timeline-open {
  display: none;
  align-items: center;
  gap: 8px;
  min-height: 42px;
}

.nursing-timeline-open .icon-lucide {
  width: 18px;
  height: 18px;
}

.nursing-drawer-head {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.nursing-drawer-head h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 800;
}

.nursing-drawer-close .icon-lucide {
  width: 18px;
  height: 18px;
}

.nursing-drawer-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 44;
  margin: 0;
  padding: 0;
  border: 0;
  background: rgba(15, 23, 42, 0.45);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.nursing-drawer-backdrop.is-visible {
  display: block;
  opacity: 1;
  pointer-events: auto;
}

[data-theme="dark"] .nursing-drawer-backdrop {
  background: rgba(0, 0, 0, 0.62);
}

body.nursing-drawer-active {
  overflow: hidden;
}

.nursing-workspace-head .section-head {
  flex: 1;
  min-width: min(100%, 16rem);
}

.nursing-theme-switch {
  flex-shrink: 0;
}

.nursing-allergy-banner {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 14px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid #fecaca;
  background: #fef2f2;
  color: #991b1b;
}

.nursing-allergy-banner .icon-lucide {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  margin-top: 2px;
}

[data-theme="dark"] .nursing-allergy-banner {
  border-color: rgba(248, 113, 113, 0.35);
  background: rgba(127, 29, 29, 0.35);
  color: #fecaca;
}

.nursing-workspace-layout {
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: stretch;
}

.nursing-toolbar {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
}

.nursing-toolbar .nursing-timeline-search {
  width: 100%;
}

.nursing-workspace-main {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  max-width: var(--layout-max);
  margin: 0 auto;
}

.nursing-timeline-hint {
  margin: 0 0 8px;
  font-size: 12px;
  color: var(--muted);
}

#profile-view .nursing-timeline {
  top: auto;
}

.nursing-timeline {
  position: static;
  max-height: none;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  box-shadow: var(--shadow-soft);
}

[data-theme="dark"] .nursing-timeline {
  border-color: rgba(16, 185, 129, 0.1);
  background: #0f172a;
}

.nursing-timeline-search {
  display: grid;
  gap: 10px;
}

@media (min-width: 640px) {
  .nursing-toolbar .nursing-timeline-search {
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
    align-items: end;
  }
}

.nursing-search-field {
  position: relative;
  display: block;
}

.nursing-search-field .icon-lucide {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--muted);
}

.nursing-search-field input {
  width: 100%;
  min-height: 42px;
  padding-left: 38px;
  border-radius: 10px;
}

.nursing-date-range {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 6px;
  align-items: center;
  font-size: 11px;
  color: var(--muted);
}

.nursing-date-range input {
  min-height: 38px;
  font-size: 12px;
}

.nursing-timeline-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  gap: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x proximity;
  padding-bottom: 4px;
}

.nursing-timeline-btn {
  position: relative;
  min-width: 148px;
  max-width: 200px;
  flex: 0 0 auto;
  scroll-snap-align: start;
  display: grid;
  gap: 4px;
  text-align: left;
  padding: 10px 12px 10px 14px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: transparent;
  color: inherit;
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.nursing-timeline-btn:hover {
  background: var(--primary-soft);
}

.nursing-timeline-btn.is-active {
  border-color: color-mix(in srgb, var(--primary) 40%, transparent);
  background: var(--primary-soft);
  box-shadow: inset 3px 0 0 var(--primary);
}

.nursing-timeline-btn.is-today {
  border-color: color-mix(in srgb, var(--primary) 55%, transparent);
}

.nursing-timeline-pulse {
  position: absolute;
  left: 0;
  top: 10px;
  bottom: 10px;
  width: 3px;
  border-radius: 999px;
  background: #10b981;
  animation: nursingPulse 1.6s ease-in-out infinite;
}

@keyframes nursingPulse {
  0%,
  100% {
    opacity: 1;
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.45);
  }
  50% {
    opacity: 0.55;
    box-shadow: 0 0 0 6px rgba(16, 185, 129, 0);
  }
}

.nursing-timeline-date {
  font-size: 13px;
  font-weight: 800;
}

.nursing-timeline-meta {
  font-size: 11px;
  color: var(--muted);
}

.nursing-timeline-severity {
  display: inline-flex;
  width: fit-content;
  margin-top: 2px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.severity--stable {
  background: #d1fae5;
  color: #047857;
}

.severity--watch {
  background: #fef3c7;
  color: #b45309;
}

.severity--critical {
  background: #fee2e2;
  color: #b91c1c;
}

[data-theme="dark"] .severity--stable {
  background: rgba(6, 78, 59, 0.5);
  color: #6ee7b7;
}

[data-theme="dark"] .severity--watch {
  background: rgba(120, 53, 15, 0.45);
  color: #fcd34d;
}

[data-theme="dark"] .severity--critical {
  background: rgba(127, 29, 29, 0.45);
  color: #fca5a5;
}

.nursing-timeline-unread {
  font-size: 10px;
  font-weight: 800;
  color: var(--primary);
}

.nursing-timeline-empty {
  padding: 12px;
  font-size: 13px;
  color: var(--muted);
  flex: 1 1 100%;
  text-align: center;
}

@media (min-width: 1024px) {
  .nursing-drawer-head {
    display: none;
  }

  .nursing-timeline:has(.nursing-timeline-empty) {
    display: none;
  }
}

.nursing-document-panel {
  min-width: 0;
  width: 100%;
}

.nursing-clinical-document {
  border-radius: 16px;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  color: #0f172a;
  box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.15);
  overflow: hidden;
}

[data-theme="dark"] .nursing-clinical-document,
[data-theme="dark"] .official-a4-document:not(.admission-sheet),
[data-theme="dark"] .official-record:not(.admission-sheet) {
  background: #ffffff;
  color: #0f172a;
  border-color: #cbd5e1;
}

[data-theme="dark"] .nursing-clinical-document .nursing-field dd,
[data-theme="dark"] .nursing-clinical-document .nursing-doc-text,
[data-theme="dark"] .nursing-clinical-document .nursing-report-title,
[data-theme="dark"] .official-a4-document td,
[data-theme="dark"] .official-a4-document th,
[data-theme="dark"] .official-a4-document p,
[data-theme="dark"] .official-a4-document h1,
[data-theme="dark"] .official-a4-document h2,
[data-theme="dark"] .official-a4-document h3,
[data-theme="dark"] .official-a4-document h4 {
  color: #0f172a;
}

.nursing-report-header {
  padding: 18px 22px 0;
}

.nursing-report-title {
  margin: 0 0 12px;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text);
}

.nursing-clinical-document .official-gov-letterhead.print-only {
  display: none !important;
}

.nursing-clinical-document .nursing-report-meta-table {
  margin: 0;
}

.nursing-clinical-document .nursing-report-meta-table th,
.nursing-clinical-document .official-meta-table th {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.nursing-clinical-document .nursing-report-meta-table td,
.nursing-clinical-document .official-meta-table td {
  font-size: 14px;
  font-weight: 600;
}

.nursing-doc-header {
  padding: 20px 22px 16px;
  border-bottom: 1px solid var(--line);
}

.nursing-doc-header-top {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
}

.nursing-doc-eyebrow {
  margin: 0 0 4px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--primary);
}

.nursing-doc-header h3 {
  margin: 0;
  font-size: 1.2rem;
}

.nursing-doc-pathology {
  margin: 6px 0 0;
  font-size: 13px;
  color: var(--muted);
}

.nursing-doc-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.nursing-severity {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.nursing-doc-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 22px 0;
}

.nursing-doc-body {
  padding: 18px 22px 8px;
  display: grid;
  gap: 16px;
}

.nursing-field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 20px;
  margin: 0;
}

.nursing-field {
  margin: 0;
  min-width: 0;
}

.nursing-field dt {
  margin: 0 0 4px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.nursing-field dd {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.45;
}

.nursing-field--wide {
  grid-column: 1 / -1;
}

.nursing-field--full {
  grid-column: 1 / -1;
}

.nursing-field--full .nursing-doc-text {
  font-weight: 500;
}

@media (max-width: 768px) {
  .vax-config-form {
    grid-template-columns: 1fr;
  }

  .vaccine-inner-tab {
    flex: 0 0 auto;
    min-width: 8.5rem;
  }
}

@media (max-width: 640px) {
  .nursing-field-grid {
    grid-template-columns: 1fr;
  }

  .nursing-field--wide,
  .nursing-field--full {
    grid-column: 1;
  }
}

.nursing-doc-section h4 {
  margin: 0 0 6px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.nursing-doc-text {
  margin: 0;
  font-size: 15px;
  line-height: 1.75;
  color: var(--text);
  white-space: pre-wrap;
}

.nursing-attachments {
  padding: 0 22px 12px;
}

.nursing-attachments-title {
  margin: 0 0 10px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.nursing-attachments-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
  gap: 10px;
}

.nursing-attachment-thumb {
  display: block;
  aspect-ratio: 1;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--line);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.nursing-attachment-thumb:hover {
  transform: scale(1.03);
  box-shadow: var(--shadow-soft);
}

.nursing-attachment-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.nursing-signature-block {
  padding: 16px 22px 20px;
  border-top: 1px dashed var(--line);
}

.record-signature-block {
  margin-top: 12px;
}

.manual-signature-line {
  margin-top: 28px;
  text-align: center;
  color: #0f172a;
}

.manual-signature-rule {
  width: min(360px, 90%);
  margin: 0 auto 6px;
  border-top: 1px solid currentColor;
}

.manual-signature-line p {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
}

.nursing-word-footer {
  margin-top: 28px;
}

.nursing-word-place-date {
  margin: 0 0 30px;
  text-align: right;
}

.nursing-word-signature-line {
  width: min(360px, 86%);
  margin: 0 auto 6px;
  border-top: 1px solid currentColor;
}

.nursing-word-sign,
.nursing-word-digital-sign {
  margin: 2px 0 0;
  text-align: center;
}

.nursing-signature-seal {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
  padding: 14px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--primary-soft) 65%, transparent);
  border: 1px solid color-mix(in srgb, var(--primary) 25%, transparent);
}

.nursing-seal-icon .icon-lucide {
  width: 28px;
  height: 28px;
  color: var(--primary);
}

.nursing-seal-title {
  margin: 0;
  font-size: 12px;
  font-weight: 800;
  color: var(--primary-dark);
}

.nursing-seal-text {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--muted);
}

.nursing-qr-svg {
  width: 52px;
  height: 52px;
  color: color-mix(in srgb, var(--primary) 70%, var(--muted));
  opacity: 0.55;
  margin-left: auto;
}

.nursing-doc-actions {
  display: grid;
  gap: 12px;
  padding: 0 22px 20px;
}

.nursing-handover-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  width: 100%;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 700;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.nursing-clinical-document .nursing-handover-btn:not([class*="border-slate"]) {
  border: 1px solid var(--line);
  background: var(--surface-soft);
  color: var(--text);
}

.nursing-handover-btn.is-read {
  border-color: color-mix(in srgb, var(--primary) 35%, transparent);
  background: var(--primary-soft);
  color: var(--primary-dark);
}

.nursing-handover-btn .icon-lucide {
  width: 18px;
  height: 18px;
}

.nursing-doc-actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.nursing-empty-doc {
  padding: 48px 20px;
  border-radius: 16px;
  border: 1px dashed var(--line);
  background: var(--surface);
  text-align: center;
  max-width: 520px;
  margin: 0 auto;
}

.nursing-document-panel {
  width: 100%;
}

.nursing-registered-section {
  width: 100%;
  max-width: var(--layout-max);
  margin: 0 auto;
}

.nursing-registered-title {
  margin: 0 0 10px;
  font-size: 14px;
  font-weight: 800;
}

.nursing-registered-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.nursing-registered-item {
  border: 1px solid color-mix(in srgb, var(--line) 88%, transparent);
  border-radius: 12px;
  background: var(--surface);
  overflow: hidden;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.nursing-registered-item.is-selected {
  border-color: color-mix(in srgb, var(--primary) 35%, var(--line));
}

.nursing-registered-item.is-open {
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
}

.nursing-registered-card {
  padding: 14px 16px;
}

.nursing-registered-item__head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
}

.nursing-registered-item__head h4 {
  margin: 0;
  font-size: 17px;
  line-height: 1.2;
  color: var(--text);
}

.nursing-registered-item__status {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.nursing-registered-item__toggle {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 12px 14px;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.nursing-registered-item__toggle:hover {
  background: color-mix(in srgb, var(--primary) 5%, transparent);
}

.nursing-registered-item__main {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.nursing-registered-item__date {
  font-size: 13px;
  font-weight: 800;
}

.nursing-registered-item__meta {
  font-size: 12px;
  color: var(--muted);
}

.nursing-registered-item__preview {
  margin: 14px 0 0;
  font-size: 13px;
  color: var(--text);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.nursing-registered-item__actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.nursing-registered-item__actions button {
  min-height: 42px;
  justify-content: center;
  font-weight: 800;
}

.nursing-registered-item__arrow {
  flex-shrink: 0;
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}

.nursing-registered-item__panel {
  border-top: 1px solid var(--line);
  padding: 12px;
  animation: nursingRegisteredOpen 0.24s ease;
}

@keyframes nursingRegisteredOpen {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.nursing-registered-empty {
  padding: 16px;
  text-align: center;
}

@media (max-width: 1023px) {
  .nursing-timeline-open {
    display: inline-flex;
  }

  .nursing-toolbar {
    max-width: none;
  }

  .nursing-timeline-hint {
    display: none;
  }

  .nursing-workspace-main .nursing-timeline {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 45;
    width: min(92vw, 320px);
    max-height: none;
    margin: 0;
    transform: translateX(-105%);
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    border-radius: 0 16px 16px 0;
    box-shadow: var(--shadow);
  }

  .nursing-workspace-main .nursing-timeline.is-drawer-open {
    transform: translateX(0);
  }

  .nursing-drawer-head {
    display: flex;
  }

  .nursing-workspace-main .nursing-timeline-list {
    display: grid;
    grid-template-columns: 1fr;
    overflow: visible;
    flex-direction: column;
  }

  .nursing-workspace-main .nursing-timeline-btn {
    min-width: 0;
    max-width: none;
    width: 100%;
  }
}

/* —— Impressão oficial A4 — cabeçalho/rodapé governo + ficha admissão —— */

.official-gov-letterhead {
  width: 100%;
  margin: 0 0 5mm;
  padding: 0;
  border-bottom: 0;
  break-inside: avoid;
  page-break-inside: avoid;
}

.official-gov-letterhead--screen {
  display: block;
}

.official-gov-letterhead--screen .admission-status {
  margin-top: 8px;
  text-align: center;
}

.modal-foot.record-detail-modal-foot {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.modal-foot.record-detail-modal-foot .actions {
  position: static;
  background: none;
  padding-top: 0;
}

.profile-print-orientation .print-orientation-select {
  margin-right: 8px;
}

.official-gov-letterhead__brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  text-align: center;
}

.official-gov-logo {
  display: block;
  width: 26mm;
  height: 13mm;
  object-fit: contain;
  flex-shrink: 0;
  margin: 0 auto 3mm;
}

.official-gov-doc-title {
  margin: 10pt 0 0;
  font-size: 12pt;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
  color: #000;
  text-align: center;
}

.official-print-child-id {
  width: 100%;
  margin: 0;
  padding: 0;
  border-top: 0;
  text-align: left;
}

.official-print-child-id__line {
  margin: 0 0 1.65mm;
  font-size: 9.4pt;
  line-height: 1.12;
  color: #000;
}

.official-print-child-id__line strong {
  font-weight: 900;
  text-transform: uppercase;
}

#official-print-page-footer,
.official-print-page-footer {
  display: none;
}

.official-print-page-footer__address,
.official-print-page-footer__legal {
  margin: 0;
  font-size: 8pt;
  line-height: 1.35;
  text-align: center;
  color: #000;
}

.official-print-page-footer__legal {
  margin-top: 3pt;
  font-weight: 600;
}

.print-orientation-select {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8125rem;
}

.print-orientation-select select {
  min-height: 36px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
}

.section-head .print-orientation-select,
.profile-header-actions .print-orientation-select {
  margin-right: 4px;
}

.admission-print-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  margin: 0 0 14px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
}

.admission-print-hint {
  margin: 0;
  font-size: 12px;
  flex: 1 1 220px;
}

.admission-form-wizard {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: min(100%, 920px);
  margin-inline: auto;
  max-height: min(78vh, 920px);
  overflow: auto;
  padding-right: 0.25rem;
}

.admission-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: flex-end;
  width: 100%;
}

.admission-form-wizard__eyebrow {
  margin: 0;
  font-size: 12px;
  color: var(--muted, #64748b);
}

.admission-form-wizard__heading {
  margin: 0;
  text-align: center;
  font-size: 1.05rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.admission-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.75rem;
}

.admission-form-grid label,
.admission-form-block label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.85rem;
}

.admission-form-grid label span,
.admission-form-block label span {
  font-weight: 600;
  color: var(--text-muted, #475569);
}

.admission-form-block {
  border: 1px solid var(--border, #cbd5e1);
  border-radius: 12px;
  padding: 0.75rem 0.9rem;
  background: #fff;
}

.admission-form-block__title {
  margin: 0 0 0.65rem;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #0f172a;
}

.admission-form-block__body {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.admission-form-inline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
}

.admission-inline-label {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.admission-mobility-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.65rem;
}

.admission-mobility-pair {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.85rem;
}

.admission-check-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.admission-check-inline {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.85rem;
}

.admission-form-obs textarea {
  min-height: 2.5rem;
}

.admission-form-evolution textarea {
  min-height: 7rem;
}

.admission-locked-hint {
  margin: 0;
  font-size: 12px;
  align-self: center;
}

.admission-choice-select {
  min-width: 10rem;
}

.admission-temp-degree {
  min-width: 9rem;
}

[data-theme="dark"] .admission-form-wizard .admission-form-block {
  background: var(--surface);
  color: var(--text);
  border-color: var(--line);
}

[data-theme="dark"] .admission-form-wizard .admission-form-block label span,
[data-theme="dark"] .admission-form-wizard .admission-form-block__title,
[data-theme="dark"] .admission-form-wizard__heading {
  color: var(--text);
}

[data-theme="dark"] .profile-content .record.admission-sheet,
[data-theme="dark"] .record-detail-modal .record.admission-sheet {
  background: var(--surface) !important;
  color: var(--text) !important;
  border-color: var(--line) !important;
  box-shadow: var(--shadow-sm, 0 1px 3px rgba(0, 0, 0, 0.2));
}

[data-theme="dark"] .profile-content .admission-sheet th,
[data-theme="dark"] .profile-content .admission-sheet td,
[data-theme="dark"] .profile-content .admission-form-table th,
[data-theme="dark"] .profile-content .admission-form-table td,
[data-theme="dark"] .profile-content .admission-sheet p,
[data-theme="dark"] .profile-content .admission-sheet strong,
[data-theme="dark"] .record-detail-modal .admission-sheet th,
[data-theme="dark"] .record-detail-modal .admission-sheet td,
[data-theme="dark"] .record-detail-modal .admission-form-table th,
[data-theme="dark"] .record-detail-modal .admission-form-table td,
[data-theme="dark"] .record-detail-modal .admission-sheet p,
[data-theme="dark"] .record-detail-modal .admission-sheet strong,
[data-theme="dark"] .profile-content .manual-signature-line p,
[data-theme="dark"] .record-detail-modal .manual-signature-line p {
  color: var(--text) !important;
  background: transparent !important;
}

[data-theme="dark"] .profile-content .admission-form-table,
[data-theme="dark"] .profile-content .admission-sheet .admission-grid div,
[data-theme="dark"] .record-detail-modal .admission-form-table,
[data-theme="dark"] .record-detail-modal .admission-sheet .admission-grid div {
  border-color: var(--line) !important;
}

[data-theme="dark"] .profile-content .admission-form-label,
[data-theme="dark"] .record-detail-modal .admission-form-label {
  background: var(--surface-2, rgba(255, 255, 255, 0.04)) !important;
}

.admission-form-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 10pt;
}

.app-shell,
.dashboard-panel,
.profile-shell,
.profile-content,
.profile-card,
.section,
.profile-analytics-panel,
.annual-book-panel-wrap,
.record-detail-modal,
.modal-card {
  margin-left: auto;
  margin-right: auto;
}

.dashboard-panel,
.profile-content,
#tab-content,
.profile-analytics-panel {
  width: min(100%, var(--layout-max, 1180px));
}

.profile-analytics-panel {
  margin: 18px 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.profile-analytics-head {
  align-items: flex-start;
  gap: 14px;
}

.analytics-filter-shell {
  margin: 16px 0;
  padding: 14px;
  border: 1px solid color-mix(in srgb, var(--line) 82%, transparent);
  border-radius: 18px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--surface-soft) 92%, transparent), color-mix(in srgb, var(--surface) 94%, transparent)),
    var(--surface-soft);
  box-shadow: inset 0 1px 0 color-mix(in srgb, #fff 38%, transparent);
}

.analytics-filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
  align-items: end;
}

.analytics-filter-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
}

.analytics-active-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

.analytics-active-filters span {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border: 1px solid color-mix(in srgb, var(--primary) 22%, var(--line));
  border-radius: 999px;
  background: color-mix(in srgb, var(--primary) 10%, transparent);
  color: var(--primary-strong);
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 900;
}

.analytics-active-filters .is-empty {
  border-color: var(--line);
  background: transparent;
  color: var(--muted);
}

.analytics-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.analytics-action-btn {
  min-height: 38px;
  padding-inline: 12px;
}

/* —— Search Insights (perguntas analíticas) —— */
.analytics-insights {
  position: relative;
  margin: 18px 0;
  border-radius: 22px;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, #6366f1 35%, var(--line));
  background:
    radial-gradient(ellipse 80% 60% at 10% -20%, rgba(99, 102, 241, 0.35), transparent 55%),
    radial-gradient(ellipse 60% 50% at 100% 0%, rgba(16, 185, 129, 0.18), transparent 50%),
    linear-gradient(165deg, #0f172a 0%, #111827 42%, #0b1220 100%);
  box-shadow:
    0 0 0 1px color-mix(in srgb, #fff 6%, transparent),
    0 24px 48px rgba(2, 6, 23, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.analytics-insights__glow {
  position: absolute;
  inset: -40% auto auto 50%;
  width: 60%;
  height: 120%;
  transform: translateX(-50%);
  background: radial-gradient(circle, rgba(99, 102, 241, 0.2), transparent 70%);
  pointer-events: none;
  animation: insights-glow 8s ease-in-out infinite alternate;
}

@keyframes insights-glow {
  from { opacity: 0.45; transform: translateX(-50%) scale(0.95); }
  to { opacity: 0.85; transform: translateX(-50%) scale(1.05); }
}

.analytics-insights__inner {
  position: relative;
  z-index: 1;
  padding: 20px 20px 18px;
}

.analytics-insights__head h3 {
  margin: 0;
  font-size: clamp(1.1rem, 2.2vw, 1.35rem);
  font-weight: 800;
  color: #f8fafc;
  letter-spacing: -0.02em;
}

.analytics-insights__head p {
  margin: 4px 0 0;
  color: #94a3b8;
  font-size: 0.9rem;
}

.analytics-insights__title-wrap {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.analytics-insights__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: linear-gradient(135deg, #6366f1, #22c55e);
  color: #fff;
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.45);
}

.analytics-insights__icon svg {
  width: 22px;
  height: 22px;
}

.analytics-insights__field {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
  padding: 6px 6px 6px 14px;
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: rgba(15, 23, 42, 0.65);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.analytics-insights__field:focus-within {
  border-color: rgba(99, 102, 241, 0.65);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.analytics-insights__search-icon {
  width: 20px;
  height: 20px;
  color: #64748b;
  flex-shrink: 0;
}

.analytics-insights__field input {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  color: #f1f5f9;
  font-size: 1rem;
  outline: none;
}

.analytics-insights__field input::placeholder {
  color: #64748b;
}

.analytics-insights__submit {
  flex-shrink: 0;
  min-height: 44px;
  padding: 0 18px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  color: #fff;
  font-weight: 800;
  font-size: 0.9rem;
  cursor: pointer;
  transition: transform 0.15s ease, filter 0.15s ease;
}

.analytics-insights__submit:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.analytics-insights__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.analytics-insights__chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(30, 41, 59, 0.55);
  color: #e2e8f0;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.analytics-insights__chip:hover {
  background: rgba(51, 65, 85, 0.85);
  border-color: rgba(99, 102, 241, 0.45);
  transform: translateY(-1px);
}

.analytics-insights__chip svg {
  width: 14px;
  height: 14px;
  opacity: 0.85;
}

.analytics-insights__history {
  margin-top: 12px;
}

.analytics-insights__history-label {
  display: block;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #64748b;
  margin-bottom: 6px;
}

.analytics-insights__history-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.analytics-insights__history-item {
  max-width: 100%;
  padding: 4px 10px;
  border-radius: 8px;
  border: 1px dashed rgba(148, 163, 184, 0.3);
  background: transparent;
  color: #cbd5e1;
  font-size: 11px;
  cursor: pointer;
  text-align: left;
}

.analytics-insights__history-item:hover {
  border-color: rgba(99, 102, 241, 0.5);
  color: #fff;
}

.analytics-insights--compact .analytics-insights__open-ai {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.analytics-insights__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.analytics-insights__toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.analytics-insights.is-collapsed {
  margin-bottom: 12px;
}

.analytics-insights.is-collapsed .analytics-insights__inner {
  padding-bottom: 20px;
}

.analytics-insights.is-collapsed .analytics-insights__form,
.analytics-insights.is-collapsed .analytics-insights__chips,
.analytics-insights.is-collapsed .analytics-insights__history,
.analytics-insights.is-collapsed .analytics-insights__results {
  display: none;
}

.analytics-insights__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.insights-result__cards {
  display: grid;
  gap: 10px;
  margin: 12px 0;
}

.insights-result-card {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface);
  cursor: pointer;
  transition: border-color 0.15s ease;
}

.insights-result-card:hover {
  border-color: var(--primary, #6366f1);
}

.insights-result-card strong {
  display: block;
  font-size: 13px;
}

.insights-result-card span {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

.insights-result__auto {
  margin: 10px 0;
}

.insights-auto-line {
  margin: 0 0 6px;
  font-size: 13px;
  color: var(--text);
}

.insights-result__past {
  margin: 12px 0;
  display: grid;
  gap: 8px;
}

.insights-result__past-label {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  color: var(--primary, #6366f1);
}

.insights-past-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  text-align: left;
  height: auto;
  padding: 10px 12px;
}

.insights-past-item strong {
  font-size: 13px;
}

.insights-past-item .muted {
  font-size: 11px;
}

.analytics-insights__results {
  margin-top: 16px;
  min-height: 0;
}

.analytics-insights__results.is-busy {
  min-height: 120px;
}

.insights-result {
  padding: 16px 18px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.insights-result--enter {
  animation: insights-fade-in 0.35s ease;
}

@keyframes insights-fade-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.insights-result__head h4 {
  margin: 8px 0 4px;
  font-size: 1.15rem;
}

.insights-result__badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 6px;
  background: color-mix(in srgb, var(--primary) 14%, transparent);
  color: var(--primary);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.insights-result__question {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
  font-style: italic;
}

.insights-result__summary {
  margin: 12px 0;
  font-size: 1rem;
  font-weight: 600;
}

.insights-result__metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
}

.insights-metric {
  padding: 12px;
  border-radius: 12px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
}

.insights-metric span {
  display: block;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--muted);
  letter-spacing: 0.04em;
}

.insights-metric strong {
  display: block;
  margin-top: 6px;
  font-size: 1.25rem;
}

.insights-result__chart {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.insights-result__chart h5 {
  margin: 0 0 10px;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.insights-mini-chart__row {
  display: grid;
  grid-template-columns: minmax(80px, 1fr) minmax(0, 2fr) auto;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
  font-size: 12px;
}

.insights-mini-chart__track {
  height: 8px;
  border-radius: 999px;
  background: var(--line);
  overflow: hidden;
}

.insights-mini-chart__track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary), #22c55e);
}

.insights-result__list {
  margin: 12px 0 0;
  padding-left: 18px;
  font-size: 13px;
  color: var(--muted);
}

.insights-result__foot {
  margin-top: 12px;
  font-size: 11px;
}

.insights-result--empty {
  border-style: dashed;
}

.insights-skeleton--title {
  height: 22px;
  width: 55%;
  border-radius: 8px;
  background: linear-gradient(90deg, var(--skeleton-base), var(--skeleton-shine), var(--skeleton-base));
  background-size: 200% 100%;
  animation: insights-shimmer 1.2s ease infinite;
}

.insights-skeleton--line {
  height: 14px;
  width: 80%;
  margin-top: 10px;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--skeleton-base), var(--skeleton-shine), var(--skeleton-base));
  background-size: 200% 100%;
  animation: insights-shimmer 1.2s ease infinite;
}

.insights-skeleton--grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 14px;
}

.insights-skeleton--grid div {
  height: 56px;
  border-radius: 12px;
  background: linear-gradient(90deg, var(--skeleton-base), var(--skeleton-shine), var(--skeleton-base));
  background-size: 200% 100%;
  animation: insights-shimmer 1.2s ease infinite;
}

@keyframes insights-shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

[data-theme="dark"] .insights-result {
  background: var(--surface);
}

@media (max-width: 720px) {
  .profile-pie-layout {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .profile-pie-legend {
    width: 100%;
  }

  .analytics-insights__inner {
    padding: 16px 14px;
  }

  .analytics-insights__head {
    align-items: stretch;
  }

  .analytics-insights__title-wrap {
    width: 100%;
  }

  .analytics-insights__actions {
    width: 100%;
    justify-content: stretch;
  }

  .analytics-insights__actions > button {
    flex: 1 1 150px;
    justify-content: center;
  }

  .analytics-insights__field {
    flex-wrap: wrap;
    padding: 10px;
  }

  .analytics-insights__field input {
    width: 100%;
    order: 1;
  }

  .analytics-insights__search-icon {
    order: 0;
  }

  .analytics-insights__submit {
    width: 100%;
    order: 2;
    margin-top: 4px;
  }

  .analytics-insights__chips {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
  }

  .analytics-insights__chip {
    flex-shrink: 0;
    max-width: 85vw;
  }
}

.analytics-intelligence-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 0.8fr);
  gap: 14px;
  align-items: center;
  margin: 12px 0;
  padding: 16px;
  border: 1px solid color-mix(in srgb, var(--primary) 24%, var(--line));
  border-radius: 18px;
  background:
    radial-gradient(circle at 12% 0%, color-mix(in srgb, var(--primary) 20%, transparent), transparent 36%),
    linear-gradient(135deg, color-mix(in srgb, var(--surface-soft) 96%, transparent), var(--surface));
}

.analytics-intelligence-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.analytics-intelligence-card strong {
  display: block;
  margin-top: 5px;
  font-size: clamp(1rem, 2vw, 1.35rem);
}

.analytics-intelligence-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.profile-analytics-filter {
  display: grid;
  gap: 6px;
  min-width: min(100%, 260px);
  font-size: 12px;
  font-weight: 800;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.profile-analytics-filter select {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--input-bg);
  color: var(--text);
  padding: 0 12px;
  font: inherit;
  text-transform: none;
  letter-spacing: 0;
}

.profile-analytics-filter input {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--input-bg);
  color: var(--text);
  padding: 0 12px;
  font: inherit;
  text-transform: none;
  letter-spacing: 0;
}

.dashboard-sector-filters {
  margin-top: 0.35rem;
}

.sector-chip.active {
  background: var(--primary-soft, #eef2ff);
  border-color: var(--primary, #4f46e5);
  color: var(--primary, #4f46e5);
  font-weight: 700;
}

.analytics-drill-panel {
  margin: 14px 0 18px;
}

.analytics-drill-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
}

.analytics-drill-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.2rem;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-soft);
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.analytics-drill-card:hover {
  border-color: var(--primary);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
}

.analytics-drill-card.is-active {
  border-color: var(--primary);
  background: var(--primary-soft, #eef2ff);
  box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.15);
}

.analytics-drill-card span {
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--muted);
}

.analytics-drill-card small {
  font-size: 0.72rem;
  color: var(--muted);
}

.analytics-drill-card strong {
  font-size: 1.85rem;
  line-height: 1;
  color: var(--text);
}

.analytics-drill-card--danger strong {
  color: var(--danger);
}

.analytics-drill-card--warning strong {
  color: #d97706;
}

.analytics-drill-list {
  margin-top: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}

.analytics-drill-list h3 {
  margin: 0 0 10px;
  font-size: 1rem;
}

.analytics-drill-children {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.analytics-drill-child {
  width: 100%;
  display: grid;
  gap: 0.15rem;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
  text-align: left;
  cursor: pointer;
}

.analytics-drill-child:hover {
  border-color: var(--primary);
  background: var(--primary-soft, #eef2ff);
}

.analytics-drill-child strong {
  font-size: 0.95rem;
}

.analytics-drill-child span {
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 700;
  text-transform: uppercase;
}

.analytics-drill-child em {
  font-style: normal;
  font-size: 0.84rem;
  color: var(--text);
}

.profile-market-card--warning strong {
  color: #d97706;
}

.profile-analytics-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin: 14px 0;
}

.analytics-kpi,
.profile-chart-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-soft);
  padding: 14px;
}

.analytics-kpi span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.analytics-kpi strong {
  display: block;
  margin-top: 6px;
  font-size: 1.8rem;
  line-height: 1;
}

.analytics-kpi--danger strong {
  color: var(--danger);
}

.profile-analytics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}

.profile-analytics-mode {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 44px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-soft);
}

.profile-analytics-mode button {
  min-height: 34px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  padding: 0 14px;
  font-weight: 900;
  cursor: pointer;
}

.profile-analytics-mode button.active {
  background: color-mix(in srgb, var(--primary) 18%, transparent);
  color: var(--primary-strong);
}

.profile-market-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
  gap: 10px;
  margin: 14px 0;
}

.profile-market-card--drill {
  width: 100%;
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: inherit;
}

.profile-market-card--drill.is-active {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.15);
}

.profile-index-row--drill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  padding: 10px 12px;
  cursor: pointer;
  font: inherit;
  color: inherit;
  text-align: left;
}

.profile-index-row--drill:hover,
.profile-index-row--drill.is-active {
  border-color: var(--primary);
  background: color-mix(in srgb, var(--primary) 8%, var(--surface));
}

.profile-market-card {
  position: relative;
  overflow: hidden;
  min-height: 116px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--surface-soft) 92%, transparent), var(--surface)),
    var(--surface-soft);
  padding: 14px;
  box-shadow: 0 18px 34px color-mix(in srgb, #020617 9%, transparent);
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.profile-market-card:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--primary) 28%, var(--line));
  box-shadow: 0 22px 42px color-mix(in srgb, #020617 14%, transparent);
}

.profile-market-card::after {
  content: "";
  position: absolute;
  inset: auto 12px 12px 12px;
  height: 26px;
  opacity: 0.28;
  background:
    linear-gradient(135deg, transparent 0 18%, currentColor 18% 21%, transparent 21% 42%, currentColor 42% 45%, transparent 45% 64%, currentColor 64% 67%, transparent 67%);
  color: var(--primary);
}

.profile-market-card span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.profile-market-card strong {
  display: flex;
  align-items: baseline;
  gap: 5px;
  margin-top: 8px;
  font-size: clamp(1.55rem, 4vw, 2.2rem);
  line-height: 1;
}

.profile-market-card small {
  font-size: 0.82rem;
}

.profile-market-card em {
  display: inline-flex;
  margin-top: 10px;
  border-radius: 999px;
  padding: 4px 8px;
  font-style: normal;
  font-size: 12px;
  font-weight: 900;
  background: color-mix(in srgb, var(--line) 55%, transparent);
}

.profile-market-card em.up,
.profile-line-delta.up {
  color: #16a34a;
}

.profile-market-card em.down,
.profile-line-delta.down {
  color: #dc2626;
}

.profile-market-card em.flat,
.profile-line-delta.flat {
  color: var(--muted);
}

.profile-market-card--danger strong,
.profile-market-card--danger::after {
  color: var(--danger);
}

.profile-market-card--success strong,
.profile-market-card--success::after {
  color: #16a34a;
}

.profile-line-card {
  min-height: 270px;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.profile-line-card:hover,
.profile-index-card:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--primary) 28%, var(--line));
}

.profile-line-card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.profile-line-card__head p {
  margin: 3px 0 0;
  font-size: 12px;
}

.profile-line-delta {
  flex: 0 0 auto;
  border-radius: 999px;
  background: color-mix(in srgb, var(--line) 55%, transparent);
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 900;
}

.profile-line-chart {
  display: block;
  width: 100%;
  height: auto;
  margin-top: 10px;
  color: var(--primary);
  overflow: visible;
}

.profile-line-axis {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.profile-line-axis strong {
  color: var(--text);
  font-size: 1rem;
}

.profile-line-axis span:last-child {
  text-align: right;
}

.profile-pie-card {
  min-height: 270px;
}

.profile-pie-card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.profile-pie-card__head h3 {
  margin-bottom: 3px;
}

.profile-pie-card__head p {
  margin: 0;
  font-size: 12px;
}

.profile-pie-card__head > strong {
  border-radius: 999px;
  background: color-mix(in srgb, var(--primary) 12%, transparent);
  color: var(--primary-strong);
  padding: 5px 10px;
  font-size: 13px;
}

.profile-pie-layout {
  display: grid;
  grid-template-columns: minmax(130px, 160px) minmax(0, 1fr);
  gap: 16px;
  align-items: center;
}

.profile-pie {
  position: relative;
  width: min(160px, 100%);
  aspect-ratio: 1;
  border-radius: 50%;
  background: conic-gradient(var(--pie-gradient));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--line) 60%, transparent);
}

.profile-pie::after {
  content: "";
  position: absolute;
  inset: 34%;
  border-radius: inherit;
  background: var(--surface-soft);
  border: 1px solid var(--line);
}

.profile-pie span {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: grid;
  place-items: center;
  color: var(--text);
  font-size: 1.35rem;
  font-weight: 950;
}

.profile-pie-legend {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.profile-pie-legend__row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}

.profile-pie-legend__row i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.profile-pie-legend__row span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-weight: 800;
}

.profile-pie-legend__row strong {
  color: var(--text);
}

.profile-index-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-soft);
  padding: 14px;
  transition: transform 0.18s ease, border-color 0.18s ease;
}

.profile-index-card h3 {
  margin: 0 0 12px;
  font-size: 0.95rem;
}

.profile-index-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-height: 38px;
  border-top: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
  font-size: 13px;
}

.profile-index-row span {
  overflow-wrap: anywhere;
}

.profile-index-row strong {
  color: var(--primary-strong);
}

.profile-chart-card h3 {
  margin: 0 0 12px;
  font-size: 0.95rem;
}

.profile-chart-bar-row {
  display: grid;
  grid-template-columns: minmax(86px, 1fr) minmax(90px, 2fr) auto;
  align-items: center;
  gap: 10px;
  margin: 9px 0;
  font-size: 13px;
}

.profile-chart-track {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: color-mix(in srgb, var(--line) 65%, transparent);
}

.profile-chart-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary), #22c55e);
}

.chart-note {
  margin: 12px 0 0;
  font-size: 12px;
}

.admission-form-table th,
.admission-form-table td {
  border: 1px solid #000;
  padding: 5pt 6pt;
  vertical-align: top;
  text-align: left;
  color: #000;
}

.admission-form-label {
  width: 14%;
  font-size: 8pt;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  background: #fff;
}

.admission-form-value {
  font-size: 10pt;
  font-weight: 600;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.admission-form-value--checks {
  font-size: 9pt;
  font-weight: 700;
}

.admission-mark {
  display: inline-block;
  margin-right: 4pt;
  font-family: "Courier New", Courier, monospace;
  font-weight: 700;
  letter-spacing: 0.02em;
}

/* Documentos oficiais — sempre aparência de papel (não seguem tema escuro do app) */
[data-theme="dark"] .nursing-clinical-document,
[data-theme="dark"] .admission-print-root,
[data-theme="dark"] .record-detail-modal .admission-print-root,
[data-theme="dark"] .annual-book-panel,
[data-theme="dark"] .annual-book-print-sheet,
[data-theme="dark"] .abx-annual-sheet.annual-book-panel,
[data-theme="dark"] .apt-annual-sheet.annual-book-panel,
[data-theme="dark"] .hosp-annual-sheet.annual-book-panel,
[data-theme="dark"] .gro-annual-sheet.annual-book-panel,
[data-theme="dark"] .presc-annual-sheet.annual-book-panel,
[data-theme="dark"] .controlled-med-book-panel,
[data-theme="dark"] .controlled-med-sheet {
  color-scheme: light;
}

[data-theme="dark"] .exam-print-root {
  background: #fff !important;
  color: #0f172a !important;
  color-scheme: light;
}

[data-theme="dark"] .record-detail-modal .admission-print-root {
  background: #fff;
}

[data-theme="dark"] .official-record:not(.admission-sheet),
[data-theme="dark"] .official-a4-document:not(.admission-sheet),
[data-theme="dark"] .nursing-clinical-document,
[data-theme="dark"] .annual-book-print-sheet,
[data-theme="dark"] .controlled-med-sheet,
[data-theme="dark"] .record-detail-modal .official-record:not(.admission-sheet),
[data-theme="dark"] .record-detail-modal .official-a4-document:not(.admission-sheet) {
  background: #fff !important;
  color: #0f172a !important;
  color-scheme: light;
}

[data-theme="dark"] .official-record:not(.admission-sheet) :where(p, span, strong, em, h1, h2, h3, h4, th, td, li, dd, dt),
[data-theme="dark"] .official-a4-document:not(.admission-sheet) :where(p, span, strong, em, h1, h2, h3, h4, th, td, li, dd, dt),
[data-theme="dark"] .nursing-clinical-document :where(p, span, strong, em, h1, h2, h3, h4, th, td, li, dd, dt) {
  color: #0f172a !important;
}

.admission-evolution-print {
  display: none;
  margin-top: 10pt;
  border: 1px solid #000;
  break-inside: avoid-page;
  page-break-inside: avoid;
}

.admission-evolution-print__title {
  margin: 0;
  padding: 6pt 8pt;
  border-bottom: 1px solid #000;
  font-size: 10pt;
  font-weight: 800;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.admission-evolution-print__lines {
  min-height: 140pt;
  padding: 8pt;
}

.admission-evolution-print__lines p {
  margin: 0;
  min-height: 120pt;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.45;
  font-size: 10pt;
}

.official-letterhead {
  margin: 0 0 14pt;
  padding-bottom: 10pt;
  border-bottom: 1px solid #000;
}

.official-institution {
  margin: 0 0 6pt;
  font-size: 9pt;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.official-doc-title {
  margin: 0 0 12pt;
  font-size: 14pt;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #000;
}

.official-meta-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 10pt;
}

.official-meta-table th,
.official-meta-table td {
  border: 1px solid #000;
  padding: 6pt 8pt;
  text-align: left;
  vertical-align: top;
}

.official-meta-table th {
  width: 32%;
  font-weight: 800;
  background: #fff;
}

.official-print-seal {
  display: flex;
  gap: 12pt;
  align-items: flex-start;
  margin-top: 18pt;
  padding-top: 12pt;
  border-top: 1px solid #000;
}

.official-shield-mark {
  flex-shrink: 0;
  color: #000;
}

.official-sign-credentials {
  margin: 0 0 6pt;
  font-size: 10pt;
  font-weight: 800;
  color: #000;
}

.official-sign-legal {
  margin: 0;
  font-size: 9pt;
  color: #000;
}

.print-break-avoid {
  break-inside: avoid;
  page-break-inside: avoid;
}

.official-print-pagination {
  display: none;
}

#official-print-auth-footer {
  display: none;
}

.official-print-auth-footer {
  display: none;
  align-items: flex-start;
  gap: 12pt;
  margin-top: 1cm;
  padding-top: 10pt;
  border-top: 1px solid #000;
  break-inside: avoid;
  page-break-inside: avoid;
}

#official-print-auth-footer.official-print-auth-block {
  display: none;
}

.official-print-auth-qr .nursing-qr-svg {
  width: 64px;
  height: 64px;
  opacity: 1;
  color: #000;
  margin: 0;
}

.official-print-auth-heading {
  margin: 0 0 4pt;
  font-size: 10pt;
  font-weight: 800;
  text-transform: uppercase;
  color: #000;
}

.official-print-auth-copy p {
  margin: 0 0 3pt;
  font-size: 9pt;
  color: #000;
  line-height: 1.45;
}

@media print {
  .official-gov-logo {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  body.official-print-mode #profile-view,
  body.official-print-mode .profile-content {
    padding-bottom: 0 !important;
  }

  .official-print-pagination {
    display: none !important;
  }

  .nursing-print-root,
  .admission-print-root,
  .controlled-print-root,
  .antibiotics-print-root,
  .appointments-print-root,
  .hospital-events-print-root,
  .growth-print-root,
  .prescriptions-print-root,
  .exam-print-root,
  .vaccine-print-root,
  .official-a4-document.official-record,
  [data-print-record-id] .official-a4-document {
    display: block;
    width: 100%;
    overflow: visible !important;
  }

  .official-print-layout {
    display: table;
    width: 100%;
    table-layout: fixed;
  }

  .official-print-layout__body {
    display: table-row-group;
  }

  #official-print-page-footer,
  .official-print-page-footer.official-print-legal-footer {
    display: table-footer-group !important;
    visibility: visible !important;
    position: static !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    top: auto !important;
    z-index: auto !important;
    width: 100%;
    margin-top: 10pt;
    padding-top: 6pt;
    border-top: 1px solid #000;
    background: #fff !important;
    break-inside: avoid;
    page-break-inside: avoid;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .nursing-print-root > #official-print-page-footer,
  .admission-print-root > #official-print-page-footer,
  .controlled-print-root > #official-print-page-footer,
  .antibiotics-print-root > #official-print-page-footer,
  .appointments-print-root > #official-print-page-footer,
  .hospital-events-print-root > #official-print-page-footer,
  .growth-print-root > #official-print-page-footer,
  .prescriptions-print-root > #official-print-page-footer,
  .exam-print-root > #official-print-page-footer,
  .vaccine-print-root > #official-print-page-footer {
    display: block !important;
  }

  #official-print-auth-footer,
  #official-print-auth-footer .official-print-auth-footer,
  .official-print-auth-footer {
    display: flex !important;
    visibility: visible !important;
    position: static !important;
    width: 100%;
    margin-top: 1cm;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .nursing-evolution-print-block,
  .admission-evolution-print,
  .official-signature-block,
  .nursing-signature-block,
  .official-print-seal,
  .official-print-auth-block {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .admission-form-body {
    break-inside: auto;
    page-break-inside: auto;
  }

  .admission-form-table tr {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .nursing-doc-body {
    break-inside: auto;
    page-break-inside: auto;
  }

  .nursing-field-grid .nursing-field--full {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  body.nursing-print-mode #official-print-auth-footer,
  body.nursing-print-mode .official-print-auth-footer,
  body.admission-print-mode #official-print-page-footer,
  body.admission-print-mode #official-print-auth-footer,
  body.controlled-print-mode #official-print-page-footer,
  body.controlled-print-mode #official-print-auth-footer,
  body.antibiotics-print-mode #official-print-page-footer,
  body.antibiotics-print-mode #official-print-auth-footer,
  body.appointments-print-mode #official-print-page-footer,
  body.appointments-print-mode #official-print-auth-footer,
  body.hospital-events-print-mode #official-print-page-footer,
  body.hospital-events-print-mode #official-print-auth-footer,
  body.growth-print-mode #official-print-page-footer,
  body.growth-print-mode #official-print-auth-footer,
  body.prescriptions-print-mode #official-print-page-footer,
  body.prescriptions-print-mode #official-print-auth-footer,
  body.exams-print-mode #official-print-page-footer,
  body.exams-print-mode #official-print-auth-footer,
  body.vaccine-print-mode #official-print-page-footer,
  body.vaccine-print-mode #official-print-auth-footer {
    visibility: visible !important;
  }
}

.apt-cancelled-badge {
  display: inline-block;
  margin-bottom: 4px;
  padding: 2px 6px;
  border-radius: 6px;
  background: #fef2f2;
  color: #b91c1c;
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.apt-cell-entry--cancelled {
  opacity: 0.88;
}

.apt-cell-entry--cancelled .apt-date-chip {
  text-decoration: line-through;
}

.apt-followup-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 18px 16px 20px;
  border-radius: 14px;
  border: 1px dashed var(--line);
  background: var(--surface-soft);
  text-align: center;
}

.apt-followup-panel__intro {
  margin: 0;
  max-width: 38rem;
  line-height: 1.5;
  font-size: 14px;
}

.apt-followup-options {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  width: min(100%, 22rem);
  margin: 0 auto;
}

.apt-followup-option {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 0;
  padding: 12px 14px;
  border: 2px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  cursor: pointer;
  text-align: left;
  font-weight: 600;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.apt-followup-option:hover:not(.is-disabled) {
  border-color: #5bb5aa;
}

.apt-followup-option:has(input:checked) {
  border-color: #5bb5aa;
  background: color-mix(in srgb, #5bb5aa 10%, var(--surface));
  box-shadow: 0 0 0 3px var(--focus-ring);
}

.apt-followup-option.is-disabled,
.apt-followup-option:has(input:disabled) {
  opacity: 0.62;
  cursor: not-allowed;
}

.apt-followup-option input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.apt-followup-option__mark {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  margin-top: 2px;
  border: 2px solid #94a3b8;
  border-radius: 6px;
  background: var(--input-bg);
  display: grid;
  place-items: center;
  line-height: 1;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.apt-followup-option:has(input:checked) .apt-followup-option__mark {
  border-color: #0d9488;
  background: #0d9488;
  color: #fff;
}

.apt-followup-option:has(input:checked) .apt-followup-option__mark::after {
  content: "✓";
  font-size: 14px;
  font-weight: 800;
}

.apt-followup-option__body {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.apt-followup-option__title {
  font-size: 15px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.3;
}

.apt-followup-option__hint {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  line-height: 1.35;
}

.apt-followup-reason {
  margin-top: 4px;
}

.apt-sent-summary {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface-soft);
}

@media print {
  .nursing-clinical-document .official-gov-letterhead.print-only {
    display: block !important;
  }

  body.nursing-print-mode * {
    visibility: hidden;
  }

  body.nursing-print-mode .nursing-print-root,
  body.nursing-print-mode .nursing-print-root * {
    visibility: visible;
  }

  body.nursing-print-mode .nursing-print-root {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
  }

  body.nursing-print-mode #nursing-print-all-source,
  body.nursing-print-mode #nursing-print-all-source.visually-hidden-screen {
    position: static !important;
    width: auto !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    clip: auto !important;
    overflow: visible !important;
    white-space: normal !important;
  }

  body.nursing-print-mode #nursing-print-all-source .nursing-print-root {
    position: static !important;
    width: 100% !important;
    break-inside: avoid;
    page-break-after: always;
    break-after: page;
  }

  body.nursing-print-mode #nursing-print-all-source .nursing-print-root:last-child {
    page-break-after: auto;
    break-after: auto;
  }

  body.nursing-print-mode:not(.nursing-print-from-modal) .modal-backdrop {
    display: none !important;
  }

  body.nursing-print-mode.nursing-print-from-modal #profile-view {
    display: none !important;
  }

  body.nursing-print-mode.nursing-print-from-modal .modal-backdrop {
    display: block !important;
    visibility: visible !important;
    position: static !important;
    background: #fff !important;
    padding: 0 !important;
  }

  body.nursing-print-mode.nursing-print-from-modal .modal {
    display: block !important;
    border: 0 !important;
    padding: 0 !important;
  }

  body.nursing-print-mode .nursing-workspace,
  body.nursing-print-mode .nursing-document-panel,
  body.nursing-print-mode #profile-view,
  body.nursing-print-mode .profile-content,
  body.nursing-print-mode .profile-layout {
    background: #fff !important;
    padding: 0 !important;
    margin: 0 !important;
    border: 0 !important;
    box-shadow: none !important;
  }

  body.nursing-print-mode .nursing-screen-meta,
  body.nursing-print-mode .nursing-signature-block,
  body.nursing-print-mode .official-print-pagination {
    display: none !important;
  }

  body.nursing-print-mode .nursing-doc-body {
    padding: 0 !important;
    border-top: 0 !important;
    margin-top: 0 !important;
  }

  body.nursing-print-mode .nursing-word-sheet {
    padding: 0 !important;
    border-top: 0 !important;
    margin-top: 0 !important;
  }

  body.nursing-print-mode .nursing-field-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8pt 14pt;
  }

  body.nursing-print-mode .nursing-field {
    break-inside: avoid-page;
  }

  body.nursing-print-mode .nursing-field dt {
    font-size: 8pt;
    color: #334155;
  }

  body.nursing-print-mode .nursing-field dd {
    font-size: 11pt;
    color: #000;
  }

  body.nursing-print-mode .nursing-doc-text {
    margin: 0;
    font-size: 11pt;
    line-height: 1.6 !important;
    color: #000 !important;
  }

  body.nursing-print-mode .nursing-attachments-grid img {
    max-width: 120px;
    max-height: 120px;
  }

  body.nursing-print-mode .official-signature-block {
    margin-top: 24pt;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  body.nursing-print-mode .nursing-word-footer {
    margin-top: 18pt !important;
  }

  body.nursing-print-mode .nursing-word-place-date {
    margin-bottom: 40pt !important;
  }

  body.nursing-print-mode .nursing-evolution-print-block {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  body.nursing-print-mode #official-print-auth-footer {
    margin-top: 1cm;
  }

  body.nursing-print-mode .nursing-qr-svg {
    display: none !important;
  }
}

@media print {
  body.admission-print-mode * {
    visibility: hidden;
  }

  body.admission-print-mode .admission-print-root,
  body.admission-print-mode .admission-print-root *,
  body.admission-print-mode #official-print-page-footer,
  body.admission-print-mode #official-print-page-footer *,
  body.admission-print-mode #official-print-auth-footer,
  body.admission-print-mode #official-print-auth-footer * {
    visibility: visible;
  }

  body.admission-print-mode .admission-print-root {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    padding: 0;
    margin: 0;
    border: 0;
    background: #fff;
  }

  body.admission-print-mode #adm-print-source,
  body.admission-print-mode #adm-print-source.visually-hidden-screen {
    position: static !important;
    width: auto !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    clip: auto !important;
    overflow: visible !important;
    white-space: normal !important;
  }

  body.admission-print-mode #adm-print-source .admission-print-root {
    position: static !important;
    width: 100% !important;
    break-inside: avoid;
    page-break-after: always;
    break-after: page;
  }

  body.admission-print-mode #adm-print-source .admission-print-root:last-child {
    page-break-after: auto;
    break-after: auto;
  }

  body.admission-print-mode {
    font-size: 8.5pt !important;
    line-height: 1.25 !important;
  }

  body.admission-print-mode .admission-form-table {
    font-size: 7.8pt !important;
    line-height: 1.18 !important;
  }

  body.admission-print-mode .admission-form-table th,
  body.admission-print-mode .admission-form-table td {
    padding: 3pt 4pt !important;
    vertical-align: top;
  }

  body.admission-print-mode .official-gov-letterhead {
    margin-bottom: 5pt !important;
    padding-bottom: 4pt !important;
  }

  body.admission-print-mode .admission-evolution-word .nursing-word-sheet {
    padding: 6pt 0 0 !important;
    margin: 0 !important;
    border: 0 !important;
    box-shadow: none !important;
  }

  body.admission-print-mode .admission-evolution-word .nursing-word-title {
    margin: 7pt 0 5pt !important;
    font-size: 9pt !important;
  }

  body.admission-print-mode:not(.admission-print-from-modal) .modal-backdrop {
    display: none !important;
  }

  body.admission-print-mode.admission-print-from-modal #profile-view {
    display: none !important;
  }

  body.admission-print-mode.admission-print-from-modal .modal-backdrop {
    display: block !important;
    visibility: visible !important;
    position: static !important;
    background: #fff !important;
    padding: 0 !important;
  }

  body.admission-print-mode.admission-print-from-modal .modal {
    display: block !important;
    border: 0 !important;
    padding: 0 !important;
    max-height: none !important;
    overflow: visible !important;
  }

  body.admission-print-mode .admission-title,
  body.admission-print-mode .evolution-box,
  body.admission-print-mode .admission-grid,
  body.admission-print-mode .sheet-lines {
    display: none !important;
  }

  body.admission-print-mode .admission-evolution-print {
    display: block !important;
  }

  body.admission-print-mode .admission-form-table th,
  body.admission-print-mode .admission-form-table td {
    border-color: #000 !important;
    color: #000 !important;
    background: #fff !important;
  }

  body.admission-print-mode .admission-form-label {
    background: #fff !important;
    color: #000 !important;
  }

  body.admission-print-mode .admission-form-value {
    background: #fff !important;
    color: #000 !important;
  }

  body.admission-print-mode .admission-evolution-print {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  body.admission-print-mode .admission-form-body {
    break-inside: auto;
    page-break-inside: auto;
  }

  body.admission-print-mode .admission-evolution-print__lines,
  body.admission-print-mode .admission-evolution-print__lines p {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  body.admission-print-mode .admission-evolution-print__title {
    break-after: avoid;
    page-break-after: avoid;
  }

  body.admission-print-mode .admission-evolution-word .nursing-word-logo {
    display: none !important;
  }

  body.admission-print-mode .author-line {
    margin-top: 12pt;
    padding-top: 8pt;
    border-top: 1px solid #000;
    text-align: center;
    font-size: 9pt;
    font-weight: 700;
  }
}

/* —— Medicações controladas (grade oficial) —— */

.controlled-med-sheet-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.controlled-med-hint {
  margin: 0 0 10px;
  font-size: 12px;
}

.controlled-med-sheet {
  width: 100%;
  min-width: 720px;
  background: #fff;
  border: 2px solid #0f172a;
  border-radius: 4px;
  padding: 0;
  overflow: hidden;
}

.controlled-med-doc-title {
  margin: 0;
  padding: 12px 14px;
  text-align: center;
  font-size: 14px;
  font-weight: 800;
  color: #0f172a;
  text-transform: none;
  letter-spacing: 0.01em;
  border-bottom: 2px solid #0f172a;
  background: #fff;
}

.controlled-med-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 11px;
}

.controlled-med-table th,
.controlled-med-table td {
  border: 1px solid #0f172a;
  padding: 6px 8px;
  vertical-align: top;
  color: #0f172a;
}

.controlled-med-patient-banner {
  background: #7dd3fc !important;
  color: #0c4a6e !important;
  text-align: center;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.02em;
  padding: 8px 10px !important;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

.controlled-med-head-row th {
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  text-align: center;
  background: #f8fafc;
}

.controlled-med-cell--name {
  width: 42%;
  overflow-wrap: anywhere;
  word-break: normal;
}

.controlled-med-table--with-disp .controlled-med-cell--name {
  width: 34%;
}

.controlled-med-table--with-disp .controlled-med-cell--dose {
  width: 12%;
}

.controlled-med-table--with-disp .controlled-med-cell--rx {
  width: 22%;
  overflow-wrap: anywhere;
}

.controlled-med-cell--disp {
  width: 32%;
  text-align: left;
  vertical-align: top;
  overflow-wrap: anywhere;
}

.controlled-med-line {
  display: block;
  font-weight: 700;
  line-height: 1.35;
  text-transform: uppercase;
}

.controlled-med-row--blank .controlled-med-cell {
  height: 34px;
  background: #fff;
}

.controlled-med-cell--dose,
.controlled-med-cell--rx {
  text-align: center;
  vertical-align: middle;
}

.controlled-disp-cell-inner {
  display: block;
  padding: 6px;
  min-height: 42px;
}

.controlled-disp-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: flex-start;
}

.controlled-disp-event,
.controlled-disp-empty {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border: 1px solid #0f172a;
  border-radius: 999px;
  padding: 3px 7px;
  background: #ecfeff;
  color: #0c4a6e;
  font-size: 9px;
  font-weight: 800;
  line-height: 1.15;
  white-space: nowrap;
}

.controlled-disp-empty {
  background: #f8fafc;
  color: #64748b;
  border-style: dashed;
}

.controlled-disp-event.is-suspensao {
  background: #fef08a !important;
  color: #713f12 !important;
}

.controlled-disp-event.is-retomada {
  background: #bbf7d0 !important;
  color: #14532d !important;
}

.controlled-disp-print-list {
  font-size: 8px;
  line-height: 1.35;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.controlled-disp-btn {
  width: auto;
  min-width: 200px;
  max-width: 100%;
  margin: 0 auto;
  min-height: var(--touch-target);
  font-size: 11px;
  font-weight: 700;
}

.controlled-med-empty {
  text-align: center;
  padding: 20px;
  color: var(--muted);
}

.visually-hidden-screen {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.controlled-med-cards-grid {
  display: grid;
  gap: 14px;
  margin-top: 8px;
}

.controlled-med-card {
  border: 1px solid var(--line);
  border-radius: var(--btn-radius);
  background: var(--surface);
  padding: 14px 16px;
  box-shadow: var(--shadow-sm, 0 1px 3px rgba(15, 23, 42, 0.08));
}

.controlled-med-card.is-expanded {
  border-color: color-mix(in srgb, var(--accent) 40%, var(--line));
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.1);
}

.controlled-med-card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.controlled-med-card-title {
  margin: 0 0 4px;
  font-size: 17px;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--text);
}

.controlled-med-card-meta {
  margin: 0;
  font-size: 12px;
  line-height: 1.4;
  color: var(--muted);
}

.controlled-med-card-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.controlled-med-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.controlled-med-card-actions .primary,
.controlled-med-card-actions .secondary,
.controlled-med-card-actions .ghost {
  min-height: var(--touch-target);
}

/* Prescrição ativa — alteração de dose / versionamento */
.therapy-active-card {
  border-left: 4px solid var(--success, #22c55e);
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.06), transparent 42%);
}

.therapy-archived-card {
  opacity: 0.88;
  border-left: 3px solid rgba(148, 163, 184, 0.45);
}

.therapy-section-label {
  margin: 0 0 0.35rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted, #94a3b8);
}

.therapy-card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.therapy-card-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
}

.therapy-card-title-row h3 {
  margin: 0;
  font-size: 1.35rem;
}

.therapy-card-category,
.therapy-card-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.therapy-pill--altered {
  background: rgba(249, 115, 22, 0.16);
  color: #fb923c;
  border: 1px solid rgba(249, 115, 22, 0.35);
}

.therapy-pill--active {
  background: rgba(34, 197, 94, 0.14);
  color: #4ade80;
}

.therapy-pill--archived {
  opacity: 0.85;
}

.therapy-active-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.65rem 1rem;
  margin: 0.5rem 0 1rem;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.35);
  border: 1px solid rgba(148, 163, 184, 0.18);
}

.therapy-active-metrics > div {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

.therapy-active-metrics span {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted, #94a3b8);
}

.therapy-active-metrics strong {
  font-size: 0.98rem;
  line-height: 1.25;
}

.therapy-metric-dose {
  color: var(--success, #4ade80);
}

.therapy-alter-notice {
  margin: 0 0 1rem;
  padding: 0.85rem 1rem;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.45);
  border: 1px solid rgba(148, 163, 184, 0.2);
}

.therapy-alter-notice p {
  margin: 0.15rem 0;
}

.therapy-alter-intro {
  margin: 0 0 1rem;
}

.therapy-version-history {
  margin: 0.75rem 0 0;
}

.therapy-version-history > summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--accent, #60a5fa);
}

.therapy-version-list {
  list-style: none;
  margin: 0.75rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.65rem;
}

.therapy-version-item {
  padding: 0.75rem 0.85rem;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(15, 23, 42, 0.25);
}

.therapy-version-item.is-current {
  border-color: rgba(34, 197, 94, 0.45);
}

.therapy-version-item.is-archived {
  opacity: 0.82;
}

.therapy-version-item-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.therapy-version-reason {
  margin: 0.35rem 0 0;
  font-size: 0.92rem;
}

.history-row--therapy {
  border-left: 3px solid rgba(96, 165, 250, 0.45);
}

.history-row--archived {
  opacity: 0.86;
}

.history-row-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.history-row-date {
  margin: 0.15rem 0;
  font-weight: 600;
}

.history-row-summary {
  margin: 0.35rem 0;
  line-height: 1.45;
}

.history-therapy-lineage {
  margin: 0.5rem 0;
}

.history-therapy-lineage > summary {
  cursor: pointer;
  font-size: 0.92rem;
  color: var(--accent, #60a5fa);
}

.therapy-version-list--compact .therapy-version-item {
  padding: 0.45rem 0.65rem;
  font-size: 0.9rem;
}

@media (max-width: 820px) {
  .therapy-active-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.controlled-med-book-wrap {
  margin-top: 14px;
  width: 100%;
  max-height: min(68vh, calc(100dvh - var(--profile-scroll-offset, 11rem) - 3rem));
  overflow: auto;
  overscroll-behavior: contain;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.22);
}

.controlled-med-book-panel {
  width: 100%;
  min-width: 720px;
  background: #fff;
  border: 2px solid #0f172a;
  border-radius: 4px;
  overflow: hidden;
}

.controlled-med-print-source .controlled-med-doc-title {
  text-transform: none;
  color: #0f172a;
}

/* —— Livros anuais (cards + painel expansível) —— */

.annual-book-cards-grid {
  display: grid;
  gap: 14px;
  margin-top: 8px;
}

.annual-profile-cards-toggle {
  display: flex;
  justify-content: flex-start;
  margin: 12px 0 4px;
}

.annual-profile-cards-toggle-btn {
  font-weight: 600;
}

.annual-book-cards-grid--profile-focus {
  grid-template-columns: minmax(0, 1fr);
  max-width: 720px;
}

.annual-book-card.is-profile-focus,
.pprx-card.is-profile-focus {
  border-color: color-mix(in srgb, var(--primary) 45%, var(--line));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--primary) 18%, transparent);
}

.section-head .actions,
.vaccine-card-head-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.annual-book-card {
  cursor: pointer;
  scroll-margin-top: calc(var(--profile-scroll-offset, 10rem) + 8px);
}

.annual-book-card.is-expanded {
  border-color: color-mix(in srgb, var(--primary) 35%, var(--line));
}

.annual-book-summary {
  margin-top: 12px;
  padding: 14px 16px 16px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface-soft) 88%, transparent);
  border: 1px solid var(--line);
  text-align: left;
}

[data-theme="dark"] .annual-book-summary {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(148, 163, 184, 0.28);
}

.annual-book-summary__eyebrow {
  margin: 0 0 12px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--primary);
}

[data-theme="dark"] .annual-book-summary__eyebrow {
  color: #6ee7b7;
}

.annual-book-summary__stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(7.5rem, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.annual-book-summary__stat {
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(148, 163, 184, 0.18);
}

.annual-book-summary__stat-label {
  display: block;
  margin-bottom: 4px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}

[data-theme="dark"] .annual-book-summary__stat-label {
  color: #94a3b8;
}

.annual-book-summary__stat-value {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 15px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.25;
}

[data-theme="dark"] .annual-book-summary__stat-value {
  color: #f8fafc;
}

.annual-book-summary__list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
}

.annual-book-summary__item {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(148, 163, 184, 0.16);
}

.annual-book-summary__item strong {
  font-size: 13px;
  color: var(--text);
}

[data-theme="dark"] .annual-book-summary__item strong {
  color: #f1f5f9;
}

.annual-book-summary__item-kind {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--primary);
}

.annual-book-summary__item-meta {
  font-size: 12px;
  line-height: 1.4;
  color: var(--muted);
}

[data-theme="dark"] .annual-book-summary__item-meta {
  color: #cbd5e1;
}

.annual-book-summary__empty {
  margin: 0;
  font-size: 13px;
}

.annual-book-card .controlled-med-card-title {
  text-transform: none;
  color: var(--text);
}

.annual-book-card .controlled-med-card-meta {
  color: var(--muted);
}

.annual-book-card .controlled-med-card-head,
.annual-book-card .controlled-med-card-main {
  text-align: center;
  justify-content: center;
}

.annual-book-card .controlled-med-card-actions {
  cursor: default;
  justify-content: center;
}

.annual-book-panel .hosp-annual-table,
.annual-book-panel .abx-annual-table,
.annual-book-panel .apt-annual-table,
.annual-book-panel .gro-annual-table {
  margin-left: auto;
  margin-right: auto;
}

.annual-book-panel .hosp-month-cell,
.annual-book-panel .abx-month-cell,
.annual-book-panel .apt-month-cell,
.annual-book-panel .gro-month-cell {
  text-align: center;
}

.annual-book-panel .annual-cell-add-menu {
  max-width: 220px;
  margin-left: auto;
  margin-right: auto;
}

.annual-book-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px 20px;
  margin-bottom: 12px;
}

.annual-year-label {
  display: grid;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
}

.annual-year-select {
  min-height: var(--touch-target);
  min-width: 5.5rem;
  padding: 8px 12px;
  font-variant-numeric: tabular-nums;
  border-radius: var(--btn-radius);
  border: 1px solid var(--line);
  background: var(--input-bg);
  font-weight: 700;
}

.annual-book-panel-wrap {
  margin-top: 14px;
  width: 100%;
  max-height: min(72vh, calc(100dvh - var(--profile-scroll-offset, 11rem) - 3rem));
  display: flex;
  justify-content: center;
  overflow: auto;
  overscroll-behavior: contain;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  border-radius: 12px;
  border: 1px solid #cbd5e1;
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
  scrollbar-width: thin;
  scrollbar-color: #94a3b8 #e2e8f0;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

.annual-book-panel-wrap::-webkit-scrollbar {
  height: 10px;
  width: 10px;
}

.annual-book-panel-wrap::-webkit-scrollbar-track {
  background: #e2e8f0;
  border-radius: 999px;
}

.annual-book-panel-wrap::-webkit-scrollbar-thumb {
  background: #94a3b8;
  border-radius: 999px;
  border: 2px solid #e2e8f0;
}

.annual-book-panel-wrap::-webkit-scrollbar-thumb:hover {
  background: #64748b;
}

/* —— Visualizador de livro anual (modal tipo ficha) —— */

.annual-book-modal-backdrop {
  display: flex;
  align-items: stretch;
  justify-content: center;
  padding: clamp(8px, 1.5vw, 16px);
  background: rgba(15, 23, 42, 0.78);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.annual-book-modal {
  width: min(95vw, 1800px);
  height: min(95vh, 960px);
  max-width: 1800px;
  max-height: 95vh;
  margin: auto;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0;
  box-sizing: border-box;
  flex: 1 1 auto;
  align-self: center;
}

.modal.annual-book-modal {
  display: flex;
  flex-direction: column;
  max-height: 95vh;
  height: min(95vh, 960px);
  overflow: hidden;
  padding: 0;
}

.annual-book-modal .modal-head.annual-book-viewer__head {
  position: sticky;
  top: 0;
  z-index: 3;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px 16px;
  margin: 0;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.annual-book-viewer__eyebrow {
  margin: 0 0 4px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--primary);
}

.annual-book-viewer__head-text h2 {
  margin: 0;
}

.annual-book-viewer__subtitle {
  margin: 6px 0 0;
  font-size: 13px;
}

.annual-book-viewer__head-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.annual-book-viewer {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  padding: 0 20px 20px;
}

.annual-book-viewer__toolbar {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--surface);
  padding-top: 12px;
}

.annual-book-viewer__filters {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
  align-items: end;
  justify-content: flex-start;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.annual-book-viewer-filter {
  display: grid;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
}

.annual-book-viewer-filter select {
  min-height: var(--touch-target);
  min-width: 10rem;
  padding: 8px 12px;
  border-radius: var(--btn-radius);
  border: 1px solid var(--line);
  background: var(--input-bg);
  font-weight: 700;
}

.annual-book-viewer__body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding-top: 14px;
}

.annual-book-panel-wrap--viewer {
  margin-top: 0;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0;
}

.annual-book-viewer-scroll {
  flex: 1;
  min-height: 0;
  width: 100%;
  max-width: 100%;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  padding: 24px;
  box-sizing: border-box;
  scrollbar-width: thin;
  scrollbar-color: #94a3b8 #e2e8f0;
}

.annual-book-viewer-scroll::-webkit-scrollbar {
  height: 10px;
  width: 10px;
}

.annual-book-viewer-scroll::-webkit-scrollbar-track {
  background: #e2e8f0;
  border-radius: 999px;
}

.annual-book-viewer-scroll::-webkit-scrollbar-thumb {
  background: #94a3b8;
  border-radius: 999px;
  border: 2px solid #e2e8f0;
}

.annual-book-viewer-stage {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  margin: 0 auto;
  box-sizing: border-box;
}

.annual-book-viewer-scale-host {
  flex-shrink: 0;
  margin-inline: auto;
  overflow: hidden;
  position: relative;
}

.annual-book-viewer-scale-inner {
  transform-origin: top left;
  will-change: transform;
}

.annual-book-modal--scaled .annual-book-viewer-scroll {
  overflow: auto;
  align-items: flex-start;
}

.annual-book-modal:not(.annual-book-modal--scaled) .annual-book-viewer-scale-inner .annual-book-panel,
.annual-book-modal:not(.annual-book-modal--scaled) .annual-book-viewer-scale-inner .abx-annual-sheet.annual-book-panel,
.annual-book-modal:not(.annual-book-modal--scaled) .annual-book-viewer-scale-inner .apt-annual-sheet.annual-book-panel,
.annual-book-modal:not(.annual-book-modal--scaled) .annual-book-viewer-scale-inner .hosp-annual-sheet.annual-book-panel,
.annual-book-modal:not(.annual-book-modal--scaled) .annual-book-viewer-scale-inner .gro-annual-sheet.annual-book-panel,
.annual-book-modal:not(.annual-book-modal--scaled) .annual-book-viewer-scale-inner .presc-annual-sheet.annual-book-panel {
  width: 100%;
  min-width: min(100%, 720px);
  max-width: 100%;
}

.nursing-book-viewer-wrap .annual-book-viewer-scroll {
  align-items: stretch;
}

.nursing-book-viewer-inner {
  width: 100%;
  display: grid;
  gap: 20px;
  padding-bottom: 8px;
}

.nursing-book-sheet-wrap {
  width: 100%;
  max-width: 900px;
  margin-inline: auto;
}

.nursing-book-sheet-wrap .nursing-clinical-document {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-shadow: 0 4px 18px rgba(15, 23, 42, 0.1);
}

.nursing-book-sheet-wrap .nursing-word-body-editor,
.nursing-book-sheet-wrap .nursing-doc-actions {
  display: none !important;
}

.nursing-book-sheet-wrap .nursing-word-body.print-only {
  display: block !important;
}

.annual-book-viewer-scale-inner .official-gov-letterhead.print-only {
  display: block !important;
}

/* Visualizador: folha em tamanho natural (escala via JS — fit to screen) */
.annual-book-viewer-scale-inner .controlled-med-sheet.controlled-med-book-panel {
  width: max-content;
  min-width: 100%;
  max-width: none;
  margin-inline: auto;
  box-sizing: border-box;
  border-radius: 8px;
  box-shadow: 0 4px 18px rgba(15, 23, 42, 0.1);
}

.annual-book-modal:not(.annual-book-modal--scaled) .annual-book-viewer-scale-inner .controlled-med-sheet.controlled-med-book-panel {
  width: 100%;
  min-width: min(100%, 900px);
  max-width: 100%;
}

.controlled-book-viewer-inner {
  display: grid;
  gap: 20px;
  width: 100%;
}

.controlled-book-viewer-wrap .annual-book-viewer-scroll {
  align-items: flex-start;
}

.controlled-book-viewer .controlled-med-sheet.controlled-med-book-panel {
  display: block;
  width: min(100%, 980px);
  min-width: 720px;
  max-width: 980px;
  color: #0f172a;
  background: #fff;
}

.annual-book-viewer-scale-inner .annual-book-panel,
.annual-book-viewer-scale-inner .abx-annual-sheet.annual-book-panel,
.annual-book-viewer-scale-inner .apt-annual-sheet.annual-book-panel,
.annual-book-viewer-scale-inner .hosp-annual-sheet.annual-book-panel,
.annual-book-viewer-scale-inner .gro-annual-sheet.annual-book-panel,
.annual-book-viewer-scale-inner .presc-annual-sheet.annual-book-panel {
  width: fit-content;
  min-width: 0;
  max-width: none;
  margin-inline: auto;
  box-sizing: border-box;
}

.annual-book-viewer-scale-inner .abx-annual-table,
.annual-book-viewer-scale-inner .apt-annual-table,
.annual-book-viewer-scale-inner .hosp-annual-table,
.annual-book-viewer-scale-inner .gro-annual-table {
  width: calc(var(--annual-name-width) + var(--annual-data-cols) * var(--annual-col-width)) !important;
  max-width: none !important;
}

.annual-book-viewer-scale-inner .abx-annual-table,
.annual-book-viewer-scale-inner .hosp-annual-table,
.annual-book-viewer-scale-inner .gro-annual-table {
  --annual-data-cols: 12;
}

.annual-book-viewer-scale-inner .apt-annual-table {
  --annual-data-cols: 13;
}

.annual-book-viewer-scale-inner .annual-book-panel .annual-cell-add-menu {
  max-width: 100%;
}

.annual-book-viewer-empty {
  margin: 12px 0 0;
  text-align: center;
}

@media (max-width: 720px) {
  .profile-pie-layout {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .profile-pie-legend {
    width: 100%;
  }

  .annual-book-modal-backdrop {
    padding: 0;
  }

  .annual-book-modal {
    width: 100vw;
    height: 100dvh;
    max-width: none;
    max-height: 100dvh;
    border-radius: 0;
  }

  .modal.annual-book-modal {
    height: 100dvh;
    max-height: 100dvh;
  }

  .annual-book-modal .modal-head.annual-book-viewer__head {
    padding: 14px 16px;
  }

  .annual-book-viewer {
    padding: 0 14px 14px;
  }

  .annual-book-viewer__filters {
    flex-direction: column;
    align-items: stretch;
  }

  .annual-book-viewer-filter select {
    width: 100%;
  }

  .annual-book-panel-wrap--viewer {
    min-height: 0;
  }

  .annual-book-viewer-scroll {
    padding: 16px;
  }
}

@media print {
  .annual-book-modal-backdrop .annual-book-viewer__toolbar,
  .annual-book-modal-backdrop .annual-book-viewer__head-actions,
  .annual-book-modal-backdrop .annual-book-viewer-scroll {
    overflow: visible;
    max-height: none;
  }

  .annual-book-modal-backdrop .annual-book-panel-wrap--viewer {
    max-height: none;
    border: 0;
    box-shadow: none;
  }

  .annual-book-modal-backdrop .annual-book-viewer-stage,
  .annual-book-modal-backdrop .annual-book-panel,
  .annual-book-modal-backdrop .apt-annual-sheet.annual-book-panel,
  .annual-book-modal-backdrop .abx-annual-sheet.annual-book-panel,
  .annual-book-modal-backdrop .hosp-annual-sheet.annual-book-panel,
  .annual-book-modal-backdrop .gro-annual-sheet.annual-book-panel {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .annual-book-viewer-scale-inner {
    transform: none !important;
  }

  .annual-book-viewer-scale-host {
    width: auto !important;
    height: auto !important;
  }
}

/* —— Sistema de grade unificado (consultas, antibióticos, internações, crescimento) —— */

.apt-annual-workspace .section-head,
.abx-annual-workspace .section-head,
.hosp-annual-workspace .section-head,
.gro-annual-workspace .section-head {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 12px;
}

.apt-annual-workspace .section-head .actions,
.abx-annual-workspace .section-head .actions,
.hosp-annual-workspace .section-head .actions,
.gro-annual-workspace .section-head .actions {
  justify-content: center;
  flex-wrap: wrap;
}

.annual-book-toolbar {
  justify-content: center;
  text-align: center;
}

.annual-book-toolbar .annual-year-label {
  justify-items: center;
}

.annual-book-cards-grid {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
  gap: 16px;
}

.annual-book-panel,
.abx-annual-sheet.annual-book-panel,
.apt-annual-sheet.annual-book-panel,
.hosp-annual-sheet.annual-book-panel,
.gro-annual-sheet.annual-book-panel {
  --annual-name-width: 12.5rem;
  --annual-col-width: 7.75rem;
  --annual-cell-min-h: 5.75rem;
  --annual-cell-pad: 10px;
  --annual-inner-gap: 8px;
  --annual-card-radius: 10px;
  min-width: 100%;
  width: max-content;
  max-width: none;
}

.annual-book-panel .abx-annual-doc-title,
.annual-book-panel .apt-annual-doc-title,
.annual-book-panel .hosp-annual-doc-title,
.annual-book-panel .gro-annual-doc-title {
  text-align: center;
  padding: 14px 16px;
  font-size: 13px;
  letter-spacing: 0.02em;
}

.annual-book-panel .abx-sector-title,
.annual-book-panel .apt-sector-title,
.annual-book-panel .hosp-sector-title,
.annual-book-panel .gro-sector-title {
  text-align: center;
  padding: 10px 14px;
  font-size: 11px;
  letter-spacing: 0.06em;
}

.annual-book-panel .abx-annual-table,
.annual-book-panel .apt-annual-table,
.annual-book-panel .hosp-annual-table,
.annual-book-panel .gro-annual-table {
  table-layout: fixed;
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 10px;
  line-height: 1.4;
}

.annual-book-panel .apt-annual-table {
  --annual-data-cols: 13;
  min-width: calc(var(--annual-name-width) + var(--annual-data-cols) * var(--annual-col-width));
}

.annual-book-panel .abx-annual-table,
.annual-book-panel .hosp-annual-table,
.annual-book-panel .gro-annual-table {
  --annual-data-cols: 12;
  min-width: calc(var(--annual-name-width) + var(--annual-data-cols) * var(--annual-col-width));
}

.annual-book-panel .abx-sector-col,
.annual-book-panel .apt-sector-col,
.annual-book-panel .hosp-sector-col,
.annual-book-panel .gro-sector-col,
.annual-book-panel .abx-patient-name,
.annual-book-panel .apt-patient-name,
.annual-book-panel .hosp-patient-name,
.annual-book-panel .gro-patient-name {
  width: var(--annual-name-width);
  min-width: var(--annual-name-width);
  max-width: var(--annual-name-width);
  padding: 10px 12px;
  vertical-align: middle;
  text-align: left;
  word-break: break-word;
  overflow-wrap: anywhere;
  line-height: 1.35;
  font-size: 11px;
}

.annual-book-panel .abx-month-col,
.annual-book-panel .apt-month-col,
.annual-book-panel .apt-prev-col,
.annual-book-panel .hosp-month-col,
.annual-book-panel .gro-month-col,
.annual-book-panel .annual-month-cell {
  width: var(--annual-col-width);
  min-width: var(--annual-col-width);
  max-width: var(--annual-col-width);
  padding: 0;
  vertical-align: top;
  text-align: center;
}

.annual-book-panel .abx-month-col,
.annual-book-panel .apt-month-col,
.annual-book-panel .apt-prev-col,
.annual-book-panel .hosp-month-col,
.annual-book-panel .gro-month-col {
  padding: 8px 4px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  vertical-align: middle;
  white-space: nowrap;
}

.annual-book-panel .annual-month-cell {
  background: var(--annual-sheet-cell, #fff);
  height: 100%;
}

.annual-book-panel .annual-month-cell.has-entries {
  background: var(--annual-sheet-cell-alt, #f8fafc);
}

.annual-book-panel .annual-month-cell__inner {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: var(--annual-inner-gap);
  min-height: var(--annual-cell-min-h);
  height: 100%;
  padding: var(--annual-cell-pad);
  box-sizing: border-box;
}

.annual-book-panel .annual-month-cell__body {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: 8px;
  min-height: 2rem;
}

.annual-book-panel .annual-month-cell__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: flex-start;
  margin: 0 0 2px;
  padding: 1px 7px;
  border-radius: 999px;
  background: #1e3a5f;
  color: #fff;
  font-size: 9pt;
  font-weight: 800;
  line-height: 1.35;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.annual-book-panel .gro-triplet-block + .gro-triplet-block {
  margin-top: 4px;
  padding-top: 4px;
  border-top: 1px dashed #cbd5e1;
}

.annual-book-panel .gro-date-chip {
  margin: 0 0 2px;
  font-size: 9pt;
  font-weight: 700;
  color: #334155;
}

.annual-book-panel .annual-month-cell__actions {
  flex: 0 0 auto;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  margin-top: auto;
  padding-top: 2px;
}

.annual-book-panel .annual-empty-cell,
.annual-book-panel .abx-empty-cell,
.annual-book-panel .apt-empty-cell,
.annual-book-panel .hosp-empty-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 2.5rem;
  margin: auto 0;
  color: #94a3b8;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.annual-book-panel .annual-cell-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 4px;
  width: 100%;
  margin: 0;
  padding: 8px 6px;
  border: 1px solid #e2e8f0;
  border-radius: var(--annual-card-radius);
  background: #fff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
  text-align: center;
  word-break: break-word;
  overflow-wrap: anywhere;
  line-height: 1.4;
}

.annual-book-panel .annual-cell-card:last-child {
  margin-bottom: 0;
}

.annual-book-panel .apt-cell-entry,
.annual-book-panel .abx-cell-entry,
.annual-book-panel .hosp-cell-entry {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: 0;
}

.annual-book-panel .abx-add-btn,
.annual-book-panel .apt-add-btn,
.annual-book-panel .gro-add-btn,
.annual-book-panel .hosp-add-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.35rem;
  height: 2.35rem;
  min-height: 2.35rem;
  margin: 0;
  padding: 0;
  border: 1px dashed #64748b;
  border-radius: 10px;
  background: #fff;
  color: var(--annual-sheet-accent, #047857);
  font-size: 16px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.12s ease;
}

.annual-book-panel .abx-add-btn:hover,
.annual-book-panel .apt-add-btn:hover,
.annual-book-panel .gro-add-btn:hover {
  border-color: var(--annual-sheet-accent, #047857);
  background: #ecfdf5;
  transform: scale(1.04);
}

.annual-book-panel .annual-cell-add-menu {
  margin: 0;
  width: 100%;
  max-width: none;
}

.annual-book-panel .annual-cell-action-select {
  width: 100%;
  min-height: 2.35rem;
  text-align: center;
  text-align-last: center;
  font-size: 11px;
  font-weight: 700;
  border-radius: 10px;
}

.annual-book-panel .apt-date-chip,
.annual-book-panel .abx-date-range,
.annual-book-panel .hosp-date-chip {
  width: 100%;
  max-width: 100%;
  margin-bottom: 0;
  padding: 4px 6px;
  border-radius: 6px;
  font-size: 9px;
  box-sizing: border-box;
}

.annual-book-panel .apt-specialty,
.annual-book-panel .abx-drug {
  font-size: 9px;
  line-height: 1.35;
}

.annual-book-panel .apt-doctor,
.annual-book-panel .abx-meta,
.annual-book-panel .abx-prescriber,
.annual-book-panel .hosp-action-line,
.annual-book-panel .hosp-diagnosis {
  font-size: 9px;
}

.annual-book-panel .apt-status-note,
.annual-book-panel .apt-location,
.annual-book-panel .abx-notes {
  font-size: 8px;
  max-width: 100%;
}

.annual-book-panel .gro-triplet.annual-cell-card {
  min-height: 3.5rem;
  justify-content: center;
  font-size: 9px;
}

.annual-book-panel .apt-cell-entry--clickable:hover,
.annual-book-panel .abx-cell-entry--clickable:hover,
.annual-book-panel .hosp-cell-entry--clickable:hover,
.annual-book-panel .gro-triplet--clickable:hover {
  border-color: #5bb5aa;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
}

@media (min-width: 768px) and (max-width: 1199px) {
  .annual-book-panel {
    --annual-col-width: 6rem;
    --annual-name-width: 11rem;
  }
}

@media (min-width: 1200px) {
  .annual-book-panel {
    --annual-col-width: 7.25rem;
  }
}

.annual-book-panel,
.abx-annual-sheet.annual-book-panel,
.apt-annual-sheet.annual-book-panel,
.hosp-annual-sheet.annual-book-panel,
.gro-annual-sheet.annual-book-panel,
.annual-book-print-sheet,
.official-a4-document.abx-annual-sheet,
.official-a4-document.apt-annual-sheet,
.official-a4-document.hosp-annual-sheet,
.official-a4-document.gro-annual-sheet {
  --annual-sheet-bg: #fff;
  --annual-sheet-border: #0f172a;
  --annual-sheet-head: #e8eef4;
  --annual-sheet-cell: #fff;
  --annual-sheet-cell-alt: #f8fafc;
  --annual-sheet-text: #0f172a;
  --annual-sheet-muted: #475569;
  --annual-sheet-accent: #047857;
  margin: 0 auto;
  background: var(--annual-sheet-bg);
  border: 2px solid var(--annual-sheet-border);
  color: var(--annual-sheet-text);
}

.abx-annual-sheet.annual-book-panel,
.apt-annual-sheet.annual-book-panel,
.hosp-annual-sheet.annual-book-panel,
.gro-annual-sheet.annual-book-panel {
  width: max-content;
  min-width: 100%;
  max-width: none;
  border-radius: 8px;
  box-shadow: 0 4px 18px rgba(15, 23, 42, 0.1);
}

.annual-book-print-sheet,
.official-a4-document.abx-annual-sheet,
.official-a4-document.apt-annual-sheet,
.official-a4-document.hosp-annual-sheet,
.official-a4-document.gro-annual-sheet {
  width: 100%;
  max-width: 1100px;
  min-width: min(100%, 1100px);
  border-radius: 4px;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08);
}

.abx-annual-doc-title,
.apt-annual-doc-title,
.hosp-annual-doc-title,
.gro-annual-doc-title {
  text-transform: none;
  color: var(--annual-sheet-text);
  background: #fff;
  border-bottom: 2px solid var(--annual-sheet-border);
}

.abx-sector-title,
.apt-sector-title,
.hosp-sector-title,
.gro-sector-title {
  background: var(--annual-sheet-head);
  color: var(--annual-sheet-text);
  border-bottom-color: var(--annual-sheet-border);
}

.abx-annual-table th,
.abx-annual-table td,
.apt-annual-table th,
.apt-annual-table td,
.hosp-annual-table th,
.hosp-annual-table td,
.gro-annual-table th,
.gro-annual-table td {
  border-color: var(--annual-sheet-border);
  color: var(--annual-sheet-text);
}

.abx-sector-col,
.apt-sector-col,
.hosp-sector-col,
.gro-sector-col,
.abx-patient-name,
.apt-patient-name,
.hosp-patient-name,
.gro-patient-name {
  background: var(--annual-sheet-head);
  color: var(--annual-sheet-text);
}

.abx-month-col,
.apt-month-col,
.apt-prev-col,
.hosp-month-col,
.gro-month-col {
  background: #d8e2ec;
  color: var(--annual-sheet-text);
}

.abx-month-cell,
.apt-month-cell,
.hosp-month-cell,
.gro-month-cell {
  background: var(--annual-sheet-cell);
  vertical-align: top;
}

.abx-month-cell.has-entries,
.apt-month-cell.has-entries,
.hosp-month-cell.has-entries,
.gro-month-cell.has-entry,
.gro-month-cell.has-entries {
  background: var(--annual-sheet-cell-alt);
}

.abx-patient-row.is-highlighted .abx-patient-name,
.apt-patient-row.is-highlighted .apt-patient-name,
.hosp-patient-row.is-highlighted .hosp-patient-name,
.gro-patient-row.is-highlighted .gro-patient-name {
  background: #d1fae5;
}

.abx-add-btn,
.apt-add-btn,
.gro-add-btn,
.hosp-add-btn {
  border: 1px dashed #64748b;
  background: #fff;
  color: var(--annual-sheet-accent);
}

.annual-cell-add-menu {
  margin-top: 8px;
  width: 100%;
}

.annual-cell-add-select-wrap {
  display: block;
  width: 100%;
}

.annual-cell-action-select {
  display: block;
  width: 100%;
  min-height: 38px;
  padding: 8px 32px 8px 12px;
  border: 1px solid #94a3b8;
  border-radius: 6px;
  background-color: #fff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23475569' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  color: #0f172a;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.3;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}

.annual-cell-action-select:focus-visible {
  outline: 2px solid rgba(4, 120, 87, 0.45);
  outline-offset: 2px;
}

.annual-cell-action-select option {
  background: #fff;
  color: #0f172a;
}

.hosp-empty-cell,
.apt-empty-cell,
.abx-empty-cell {
  color: var(--annual-sheet-muted);
}

.hosp-date-chip,
.apt-date-chip {
  background: #bae6fd;
  color: #0c4a6e;
}

.hosp-internada-flag,
.abx-date-range {
  background: #fef08a !important;
  color: #713f12 !important;
}

.abx-drug,
.hosp-action-line,
.apt-specialty {
  color: #0f172a;
}

.abx-notes,
.abx-meta,
.abx-prescriber,
.hosp-diagnosis,
.apt-doctor,
.apt-location {
  color: var(--annual-sheet-muted);
}

.abx-cell-entry--clickable:hover,
.apt-cell-entry--clickable:hover,
.hosp-cell-entry--clickable:hover,
.gro-triplet--clickable:hover {
  background: #ecfdf5;
}

.hosp-sector-block,
.gro-sector-block,
.abx-sector-block,
.apt-sector-block {
  border-bottom-color: var(--annual-sheet-border);
}

.hosp-annual-sheet,
.apt-annual-sheet,
.abx-annual-sheet,
.gro-annual-sheet {
  background: var(--annual-sheet-bg);
  border-color: var(--annual-sheet-border);
}

@media (max-width: 767px) {
  .annual-book-panel-wrap:not(.annual-book-panel-wrap--viewer) {
    margin-left: 0;
    margin-right: 0;
    padding-bottom: 8px;
    overflow-x: visible;
  }

  .annual-book-panel-wrap:not(.annual-book-panel-wrap--viewer) .annual-book-panel,
  .annual-book-panel-wrap:not(.annual-book-panel-wrap--viewer) .abx-annual-sheet.annual-book-panel,
  .annual-book-panel-wrap:not(.annual-book-panel-wrap--viewer) .apt-annual-sheet.annual-book-panel,
  .annual-book-panel-wrap:not(.annual-book-panel-wrap--viewer) .hosp-annual-sheet.annual-book-panel,
  .annual-book-panel-wrap:not(.annual-book-panel-wrap--viewer) .gro-annual-sheet.annual-book-panel {
    min-width: 0 !important;
    max-width: 100%;
  }

  .annual-book-panel-wrap:not(.annual-book-panel-wrap--viewer) .annual-book-panel:not(.official-a4-document) .abx-annual-table,
  .annual-book-panel-wrap:not(.annual-book-panel-wrap--viewer) .annual-book-panel:not(.official-a4-document) .apt-annual-table,
  .annual-book-panel-wrap:not(.annual-book-panel-wrap--viewer) .annual-book-panel:not(.official-a4-document) .hosp-annual-table,
  .annual-book-panel-wrap:not(.annual-book-panel-wrap--viewer) .annual-book-panel:not(.official-a4-document) .gro-annual-table {
    display: block;
    width: 100%;
    min-width: 0;
    border-collapse: separate;
  }

  .annual-book-panel-wrap:not(.annual-book-panel-wrap--viewer) .annual-book-panel:not(.official-a4-document) thead {
    display: none;
  }

  .annual-book-panel-wrap:not(.annual-book-panel-wrap--viewer) .annual-book-panel:not(.official-a4-document) tbody {
    display: block;
    width: 100%;
  }

  .annual-book-panel-wrap:not(.annual-book-panel-wrap--viewer) .annual-book-panel:not(.official-a4-document) .abx-patient-row,
  .annual-book-panel-wrap:not(.annual-book-panel-wrap--viewer) .annual-book-panel:not(.official-a4-document) .apt-patient-row,
  .annual-book-panel-wrap:not(.annual-book-panel-wrap--viewer) .annual-book-panel:not(.official-a4-document) .hosp-patient-row,
  .annual-book-panel-wrap:not(.annual-book-panel-wrap--viewer) .annual-book-panel:not(.official-a4-document) .gro-patient-row {
    display: block;
    width: 100%;
    margin-bottom: 16px;
    padding-bottom: 4px;
    border-bottom: 1px solid var(--annual-sheet-border);
  }

  .annual-book-panel-wrap:not(.annual-book-panel-wrap--viewer) .annual-book-panel:not(.official-a4-document) .abx-patient-name,
  .annual-book-panel-wrap:not(.annual-book-panel-wrap--viewer) .annual-book-panel:not(.official-a4-document) .apt-patient-name,
  .annual-book-panel-wrap:not(.annual-book-panel-wrap--viewer) .annual-book-panel:not(.official-a4-document) .hosp-patient-name,
  .annual-book-panel-wrap:not(.annual-book-panel-wrap--viewer) .annual-book-panel:not(.official-a4-document) .gro-patient-name {
    display: block;
    width: 100%;
    min-width: 0;
    margin-bottom: 10px;
    padding: 12px;
    border-radius: 10px;
    text-align: center;
  }

  .annual-book-panel-wrap:not(.annual-book-panel-wrap--viewer) .annual-book-panel:not(.official-a4-document) .abx-month-cell,
  .annual-book-panel-wrap:not(.annual-book-panel-wrap--viewer) .annual-book-panel:not(.official-a4-document) .apt-month-cell,
  .annual-book-panel-wrap:not(.annual-book-panel-wrap--viewer) .annual-book-panel:not(.official-a4-document) .hosp-month-cell,
  .annual-book-panel-wrap:not(.annual-book-panel-wrap--viewer) .annual-book-panel:not(.official-a4-document) .gro-month-cell {
    display: block;
    width: 100%;
    min-width: 0;
    max-width: none;
    margin-bottom: 10px;
    padding: 0;
    border: 1px solid var(--annual-sheet-border);
    border-radius: 10px;
    background: #fff;
    overflow: hidden;
  }

  .annual-book-panel-wrap:not(.annual-book-panel-wrap--viewer) .annual-book-panel:not(.official-a4-document) .annual-month-cell__inner {
    min-height: 0;
    padding: 12px;
  }

  .annual-book-panel-wrap:not(.annual-book-panel-wrap--viewer) .annual-book-panel:not(.official-a4-document) .annual-month-cell__actions {
    padding-top: 8px;
  }

  .annual-book-panel-wrap:not(.annual-book-panel-wrap--viewer) .annual-book-panel:not(.official-a4-document) .abx-add-btn,
  .annual-book-panel-wrap:not(.annual-book-panel-wrap--viewer) .annual-book-panel:not(.official-a4-document) .apt-add-btn,
  .annual-book-panel-wrap:not(.annual-book-panel-wrap--viewer) .annual-book-panel:not(.official-a4-document) .gro-add-btn {
    width: 100%;
    max-width: 12rem;
    height: var(--touch-target);
    min-height: var(--touch-target);
  }

  .annual-book-panel-wrap:not(.annual-book-panel-wrap--viewer) .annual-book-panel:not(.official-a4-document) .annual-cell-action-select {
    min-height: var(--touch-target);
    font-size: 13px;
  }

  .annual-book-panel-wrap:not(.annual-book-panel-wrap--viewer) .annual-book-panel:not(.official-a4-document) [data-month-label]::before {
    content: attr(data-month-label);
    display: block;
    margin-bottom: 10px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-align: center;
    color: var(--annual-sheet-accent);
  }

  .annual-book-panel-wrap:not(.annual-book-panel-wrap--viewer) .annual-book-panel:not(.official-a4-document) .annual-cell-action-select,
  .annual-book-panel-wrap:not(.annual-book-panel-wrap--viewer) .annual-book-panel:not(.official-a4-document) .abx-add-btn,
  .annual-book-panel-wrap:not(.annual-book-panel-wrap--viewer) .annual-book-panel:not(.official-a4-document) .apt-add-btn,
  .annual-book-panel-wrap:not(.annual-book-panel-wrap--viewer) .annual-book-panel:not(.official-a4-document) .gro-add-btn {
    min-height: 44px;
    font-size: 13px;
  }
}

.history-quick-actions {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.history-quick-actions button {
  width: 100%;
  min-height: var(--touch-target);
}

@media (max-width: 767px) {
  .controlled-med-sheet {
    min-width: 0;
  }

  .controlled-med-table {
    font-size: 10px;
  }

  .controlled-disp-btn {
    min-height: var(--touch-target);
  }

  .controlled-med-cards-grid {
    display: grid;
  }

  .controlled-disp-list {
    display: grid;
    grid-template-columns: 1fr;
  }

  .history-quick-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
  }
}

@media print {
  body.controlled-print-mode * {
    visibility: hidden;
  }

body.controlled-print-mode .controlled-print-root,
body.controlled-print-mode .controlled-print-root *,
body.controlled-print-mode .controlled-book-viewer,
body.controlled-print-mode .controlled-book-viewer *,
body.controlled-print-mode .controlled-med-print-source,
body.controlled-print-mode .controlled-med-print-source *,
body.controlled-print-mode .med-print-source,
body.controlled-print-mode .med-print-source *,
body.controlled-print-mode #official-print-page-footer,
body.controlled-print-mode #official-print-page-footer *,
body.controlled-print-mode #official-print-auth-footer,
body.controlled-print-mode #official-print-auth-footer * {
    visibility: visible;
  }

body.controlled-print-mode .controlled-print-root,
body.controlled-print-mode .controlled-book-viewer,
body.controlled-print-mode .controlled-med-print-source,
body.controlled-print-mode .med-print-source {
  position: absolute;
  left: 0;
  top: 0;
    width: 100%;
    border: none;
    min-width: 0;
    clip: auto !important;
    height: auto !important;
    margin: 0 !important;
    overflow: visible !important;
  }

  body.controlled-print-mode .controlled-book-viewer .annual-book-viewer-scroll,
  body.controlled-print-mode .controlled-book-viewer .annual-book-viewer-stage,
  body.controlled-print-mode .controlled-book-viewer .annual-book-viewer-scale-host,
  body.controlled-print-mode .controlled-book-viewer .annual-book-viewer-scale-inner {
    position: static !important;
    width: 100% !important;
    height: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
  }

  body.controlled-print-mode .controlled-book-viewer .annual-book-viewer-scale-inner {
    transform: none !important;
    display: block !important;
  }

body.controlled-print-mode .controlled-med-cards-grid,
body.controlled-print-mode .controlled-med-card,
body.controlled-print-mode .controlled-med-hint,
body.controlled-print-mode .controlled-disp-btn,
body.controlled-print-mode .no-print {
  display: none !important;
}

body.controlled-print-mode .med-print-source[aria-hidden="true"],
body.controlled-print-mode .controlled-med-print-source[aria-hidden="true"] {
  display: block !important;
}

  body.controlled-print-mode .controlled-med-patient-banner {
    background: #7dd3fc !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  body.controlled-print-mode .controlled-med-table th,
  body.controlled-print-mode .controlled-med-table td {
    border-color: #000 !important;
    padding: 3px 4px !important;
    font-size: 7.4px !important;
    line-height: 1.25 !important;
    overflow-wrap: anywhere !important;
    word-break: normal !important;
  }

  body.controlled-print-mode .controlled-med-table {
    table-layout: fixed !important;
    font-size: 7.4px !important;
  }

  body.controlled-print-mode .controlled-med-cell--name {
    width: 34% !important;
  }

  body.controlled-print-mode .controlled-med-cell--dose {
    width: 11% !important;
  }

  body.controlled-print-mode .controlled-med-cell--rx {
    width: 22% !important;
  }

body.controlled-print-mode .controlled-med-cell--disp {
  width: 33% !important;
}

body.controlled-print-mode .controlled-med-row--blank .controlled-med-cell {
  height: 8mm !important;
  color: #000 !important;
  background: #fff !important;
}

  body.controlled-print-mode .controlled-disp-cell-inner {
    min-height: 0 !important;
    padding: 0 !important;
  }

  body.controlled-print-mode .controlled-disp-event.is-suspensao {
    background: #fef08a !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  body.controlled-print-mode .controlled-disp-event.is-retomada {
    background: #bbf7d0 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  body.controlled-print-mode .controlled-med-doc-title {
    color: #000 !important;
  }
}

/* —— Controle anual de antibióticos —— */

.abx-annual-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px 20px;
  margin-bottom: 12px;
}

.abx-year-label {
  display: grid;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
}

.abx-year-select {
  min-height: var(--touch-target);
  min-width: 5.5rem;
  padding: 8px 12px;
  font-variant-numeric: tabular-nums;
  border-radius: var(--btn-radius);
  border: 1px solid var(--line);
  background: var(--input-bg);
  font-weight: 700;
}

.abx-annual-hint {
  margin: 0;
  flex: 1 1 220px;
  font-size: 12px;
}

.abx-annual-sheet-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.abx-annual-sheet:not(.annual-book-panel) {
  min-width: 1100px;
  border: 1px solid var(--annual-sheet-border, rgba(148, 163, 184, 0.28));
  background: var(--annual-sheet-bg, #fff);
}

.abx-annual-doc-title {
  margin: 0;
  padding: 10px 12px;
  text-align: center;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  border-bottom: 1px solid var(--annual-sheet-border, rgba(148, 163, 184, 0.28));
}

.abx-annual-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 9px;
}

.abx-annual-table th,
.abx-annual-table td {
  border: 1px solid var(--annual-sheet-border, rgba(148, 163, 184, 0.28));
  vertical-align: top;
  color: var(--annual-sheet-text, #0f172a);
}

.abx-sector-col {
  width: 140px;
  min-width: 120px;
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  background: var(--annual-sheet-head, #e8eef4);
  text-align: left;
  padding: 8px;
}

.abx-month-col {
  font-size: 8px;
  font-weight: 800;
  text-align: center;
  padding: 6px 2px;
  background: #d8e2ec;
  color: #0f172a;
}

.abx-patient-name {
  font-size: 10px;
  font-weight: 800;
  text-align: left;
  padding: 8px;
  line-height: 1.3;
}

.abx-patient-row.is-highlighted .abx-patient-name {
  background: #d1fae5;
}

.abx-month-cell {
  min-width: 88px;
  min-height: 52px;
  padding: 4px;
  background: var(--annual-sheet-cell, #fff);
}

.abx-month-cell.has-entries {
  background: var(--annual-sheet-cell-alt, #f8fafc);
}

.abx-cell-entry {
  margin-bottom: 6px;
  padding-bottom: 6px;
  border-bottom: 1px dashed #cbd5e1;
  line-height: 1.35;
}

.abx-cell-entry:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: 0;
}

.abx-cell-entry--clickable {
  cursor: pointer;
  border-radius: 4px;
}

.abx-cell-entry--clickable:hover {
  background: #f0fdfa;
}

.abx-date-range {
  display: block;
  margin-bottom: 3px;
  padding: 2px 4px;
  background: #fef08a !important;
  color: #713f12;
  font-weight: 800;
  font-size: 8px;
  text-align: center;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

.abx-drug {
  display: block;
  font-weight: 800;
  font-size: 8px;
  text-transform: uppercase;
}

.abx-meta,
.abx-prescriber {
  display: block;
  font-size: 8px;
}

.abx-notes {
  display: block;
  font-size: 7px;
  font-style: italic;
  color: #334155;
}

.abx-add-btn {
  display: block;
  width: 100%;
  margin-top: 4px;
  min-height: 28px;
  padding: 4px;
  border: 1px dashed var(--line);
  border-radius: 6px;
  background: var(--surface-soft);
  font-weight: 800;
  font-size: 12px;
  cursor: pointer;
}

.abx-empty-row {
  text-align: center;
  padding: 24px;
  color: var(--muted);
}

.abx-child-list {
  margin-top: 18px;
}

.abx-child-list-title {
  margin: 0 0 10px;
  font-size: 15px;
}

@media (max-width: 767px) {
  .analytics-filter-grid {
    grid-template-columns: 1fr;
  }

  .analytics-filter-footer,
  .analytics-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .analytics-actions > *,
  .analytics-action-btn,
  .profile-analytics-mode {
    width: 100%;
  }

  .analytics-intelligence-card {
    grid-template-columns: 1fr;
  }

  .vaccine-card-tabs {
    padding: 0 12px 10px;
  }

  .vaccine-inner-tabs {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x proximity;
  }

  .vaccine-inner-tab {
    flex: 0 0 min(78vw, 13rem);
    min-width: min(78vw, 13rem);
    scroll-snap-align: start;
  }

  .abx-annual-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .abx-year-select {
    width: 100%;
  }

  .abx-annual-sheet {
    min-width: 0;
  }

  .abx-sector-col {
    position: sticky;
    left: 0;
    z-index: 2;
    background: #f8fafc;
    box-shadow: 2px 0 6px rgba(15, 23, 42, 0.08);
  }

  .abx-patient-row.is-highlighted .abx-patient-name {
    background: #bae6fd;
  }

  .abx-add-btn {
    min-height: var(--touch-target);
  }
}

@media print {
  body.antibiotics-print-mode * {
    visibility: hidden;
  }

  body.antibiotics-print-mode .antibiotics-print-root,
  body.antibiotics-print-mode .antibiotics-print-root *,
  body.antibiotics-print-mode .annual-book-print-source,
  body.antibiotics-print-mode .annual-book-print-source *,
  body.antibiotics-print-mode #annual-book-viewer-print-mount,
  body.antibiotics-print-mode #annual-book-viewer-print-mount *,
  body.antibiotics-print-mode #official-print-page-footer,
  body.antibiotics-print-mode #official-print-page-footer *,
  body.antibiotics-print-mode #official-print-auth-footer,
  body.antibiotics-print-mode #official-print-auth-footer * {
    visibility: visible;
  }

  body.antibiotics-print-mode .antibiotics-print-root,
  body.antibiotics-print-mode .annual-book-print-source,
  body.antibiotics-print-mode #annual-book-viewer-print-mount {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    min-width: 0;
    border: none;
    clip: auto !important;
    width: 100% !important;
    height: auto !important;
    margin: 0 !important;
    overflow: visible !important;
    white-space: normal !important;
    display: block !important;
  }

  body.antibiotics-print-mode #annual-book-viewer-print-mount.visually-hidden-screen {
    position: absolute !important;
    width: 100% !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    clip: auto !important;
    overflow: visible !important;
  }

  body.antibiotics-print-mode .annual-book-cards-grid,
  body.antibiotics-print-mode .annual-book-card,
  body.antibiotics-print-mode .annual-book-panel-wrap,
  body.antibiotics-print-mode .abx-annual-toolbar,
  body.antibiotics-print-mode .abx-child-list,
  body.antibiotics-print-mode .abx-add-btn,
  body.antibiotics-print-mode .no-print {
    display: none !important;
  }

  body.antibiotics-print-mode .abx-date-range {
    background: #fef08a !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  body.antibiotics-print-mode .abx-annual-table th,
  body.antibiotics-print-mode .abx-annual-table td {
    border-color: #000 !important;
  }

  body.antibiotics-print-mode .abx-annual-table {
    font-size: 7pt;
  }
}

/* Livros anuais — impressão em planilha clara (não herdar tema escuro da tela) */
@media print {
  body.antibiotics-print-mode,
  body.appointments-print-mode,
  body.hospital-events-print-mode,
  body.growth-print-mode {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  body.antibiotics-print-mode .annual-book-print-sheet,
  body.appointments-print-mode .annual-book-print-sheet,
  body.hospital-events-print-mode .annual-book-print-sheet,
  body.growth-print-mode .annual-book-print-sheet,
  body.prescriptions-print-mode .annual-book-print-sheet,
  body.antibiotics-print-mode .annual-book-print-sheet .abx-annual-doc-title,
  body.appointments-print-mode .annual-book-print-sheet .apt-annual-doc-title,
  body.hospital-events-print-mode .annual-book-print-sheet .hosp-annual-doc-title,
  body.growth-print-mode .annual-book-print-sheet .gro-annual-doc-title,
  body.prescriptions-print-mode .annual-book-print-sheet .presc-annual-doc-title,
  body.antibiotics-print-mode .annual-book-print-sheet .apt-sector-title,
  body.appointments-print-mode .annual-book-print-sheet .apt-sector-title,
  body.hospital-events-print-mode .annual-book-print-sheet .hosp-sector-title,
  body.growth-print-mode .annual-book-print-sheet .gro-sector-title {
    background: #fff !important;
    color: #000 !important;
    border-color: #000 !important;
    box-shadow: none !important;
    min-width: 0 !important;
    max-width: 100% !important;
    border-radius: 0 !important;
  }

  body.antibiotics-print-mode .annual-book-print-sheet .abx-annual-table,
  body.appointments-print-mode .annual-book-print-sheet .apt-annual-table,
  body.hospital-events-print-mode .annual-book-print-sheet .hosp-annual-table,
  body.growth-print-mode .annual-book-print-sheet .gro-annual-table,
  body.prescriptions-print-mode .annual-book-print-sheet .presc-annual-table {
    width: 100% !important;
    table-layout: fixed !important;
    font-size: 5.6pt !important;
    border-collapse: collapse !important;
  }

  body.antibiotics-print-mode .annual-book-print-sheet .abx-annual-table th,
  body.antibiotics-print-mode .annual-book-print-sheet .abx-annual-table td,
  body.appointments-print-mode .annual-book-print-sheet .apt-annual-table th,
  body.appointments-print-mode .annual-book-print-sheet .apt-annual-table td,
  body.hospital-events-print-mode .annual-book-print-sheet .hosp-annual-table th,
  body.hospital-events-print-mode .annual-book-print-sheet .hosp-annual-table td,
  body.growth-print-mode .annual-book-print-sheet .gro-annual-table th,
  body.growth-print-mode .annual-book-print-sheet .gro-annual-table td,
  body.prescriptions-print-mode .annual-book-print-sheet .presc-annual-table th,
  body.prescriptions-print-mode .annual-book-print-sheet .presc-annual-table td {
    background: #fff !important;
    color: #000 !important;
    border: 1px solid #000 !important;
    padding: 2px 1.5px !important;
    line-height: 1.08 !important;
    vertical-align: top !important;
    overflow: hidden !important;
    max-width: 0 !important;
    overflow-wrap: anywhere !important;
    word-break: break-word !important;
    white-space: normal !important;
  }

  body.antibiotics-print-mode .annual-book-print-sheet .abx-sector-col,
  body.antibiotics-print-mode .annual-book-print-sheet .abx-patient-name,
  body.appointments-print-mode .annual-book-print-sheet .apt-sector-col,
  body.appointments-print-mode .annual-book-print-sheet .apt-patient-name,
  body.hospital-events-print-mode .annual-book-print-sheet .hosp-sector-col,
  body.hospital-events-print-mode .annual-book-print-sheet .hosp-patient-name,
  body.growth-print-mode .annual-book-print-sheet .gro-sector-col,
  body.growth-print-mode .annual-book-print-sheet .gro-patient-name,
  body.prescriptions-print-mode .annual-book-print-sheet .presc-patient-name {
    background: #e8eef4 !important;
    color: #000 !important;
    font-weight: 800 !important;
  }

  body.antibiotics-print-mode .annual-book-print-sheet .abx-month-col,
  body.appointments-print-mode .annual-book-print-sheet .apt-month-col,
  body.appointments-print-mode .annual-book-print-sheet .apt-prev-col,
  body.hospital-events-print-mode .annual-book-print-sheet .hosp-month-col,
  body.growth-print-mode .annual-book-print-sheet .gro-month-col {
    background: #d8e2ec !important;
    color: #000 !important;
    font-size: 6pt !important;
    font-weight: 800 !important;
    text-align: center !important;
    padding: 4px 1px !important;
    white-space: nowrap !important;
    letter-spacing: 0 !important;
    line-height: 1.15 !important;
  }

  body.antibiotics-print-mode .annual-book-print-sheet .abx-sector-col,
  body.appointments-print-mode .annual-book-print-sheet .apt-sector-col,
  body.hospital-events-print-mode .annual-book-print-sheet .hosp-sector-col,
  body.growth-print-mode .annual-book-print-sheet .gro-sector-col {
    width: 9% !important;
  }

  body.appointments-print-mode .annual-book-print-sheet .apt-sector-col {
    width: 7% !important;
  }

  body.antibiotics-print-mode .annual-book-print-sheet .abx-patient-name,
  body.appointments-print-mode .annual-book-print-sheet .apt-patient-name,
  body.hospital-events-print-mode .annual-book-print-sheet .hosp-patient-name,
  body.growth-print-mode .annual-book-print-sheet .gro-patient-name {
    width: 9% !important;
    font-size: 5.7pt !important;
  }

  body.appointments-print-mode .annual-book-print-sheet .apt-patient-name {
    width: 8% !important;
  }

  body.antibiotics-print-mode .annual-book-print-sheet .abx-month-col,
  body.antibiotics-print-mode .annual-book-print-sheet .abx-month-cell,
  body.hospital-events-print-mode .annual-book-print-sheet .hosp-month-col,
  body.hospital-events-print-mode .annual-book-print-sheet .hosp-month-cell,
  body.growth-print-mode .annual-book-print-sheet .gro-month-col,
  body.growth-print-mode .annual-book-print-sheet .gro-month-cell {
    width: 6.83% !important;
  }

  body.appointments-print-mode .annual-book-print-sheet .apt-month-col,
  body.appointments-print-mode .annual-book-print-sheet .apt-month-cell,
  body.appointments-print-mode .annual-book-print-sheet .apt-prev-col,
  body.appointments-print-mode .annual-book-print-sheet .apt-prev-cell {
    width: 6.53% !important;
  }

  body.antibiotics-print-mode .annual-book-print-sheet .abx-month-cell,
  body.appointments-print-mode .annual-book-print-sheet .apt-month-cell,
  body.hospital-events-print-mode .annual-book-print-sheet .hosp-month-cell,
  body.growth-print-mode .annual-book-print-sheet .gro-month-cell {
    background: #fff !important;
    min-width: 0 !important;
    min-height: 0 !important;
  }

  body.antibiotics-print-mode .annual-book-print-sheet .abx-month-cell.has-entries,
  body.appointments-print-mode .annual-book-print-sheet .apt-month-cell.has-entries,
  body.hospital-events-print-mode .annual-book-print-sheet .hosp-month-cell.has-entries,
  body.growth-print-mode .annual-book-print-sheet .gro-month-cell.has-entries {
    background: #fff !important;
  }

  body.antibiotics-print-mode .annual-book-print-sheet .annual-month-cell__count,
  body.appointments-print-mode .annual-book-print-sheet .annual-month-cell__count,
  body.hospital-events-print-mode .annual-book-print-sheet .annual-month-cell__count,
  body.growth-print-mode .annual-book-print-sheet .annual-month-cell__count {
    background: #000 !important;
    color: #fff !important;
    font-size: 5.5pt !important;
    padding: 0 3px !important;
  }

  body.antibiotics-print-mode .annual-book-print-sheet .abx-drug,
  body.antibiotics-print-mode .annual-book-print-sheet .abx-meta,
  body.antibiotics-print-mode .annual-book-print-sheet .abx-prescriber,
  body.antibiotics-print-mode .annual-book-print-sheet .abx-notes,
  body.appointments-print-mode .annual-book-print-sheet .apt-doctor,
  body.appointments-print-mode .annual-book-print-sheet .apt-status-note,
  body.appointments-print-mode .annual-book-print-sheet .apt-location,
  body.hospital-events-print-mode .annual-book-print-sheet .hosp-action-line,
  body.hospital-events-print-mode .annual-book-print-sheet .hosp-diagnosis,
  body.growth-print-mode .annual-book-print-sheet .gro-p-line,
  body.growth-print-mode .annual-book-print-sheet .gro-e-line,
  body.growth-print-mode .annual-book-print-sheet .gro-imc-line {
    color: #000 !important;
    max-width: 100% !important;
    overflow-wrap: anywhere !important;
    word-break: break-word !important;
    white-space: normal !important;
    font-size: 5.4pt !important;
    line-height: 1.08 !important;
  }

  body.antibiotics-print-mode .annual-book-print-sheet .abx-cell-entry {
    border-bottom-color: #94a3b8 !important;
  }

  body.antibiotics-print-mode .annual-book-print-sheet .abx-date-range {
    background: #fef08a !important;
    color: #000 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  body.appointments-print-mode .annual-book-print-sheet .apt-date-chip {
    background: #bae6fd !important;
    color: #000 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  body.appointments-print-mode .annual-book-print-sheet .apt-date-chip--return {
    background: #fef08a !important;
    color: #000 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  body.appointments-print-mode .annual-book-print-sheet .apt-status-note--wait {
    background: #fef08a !important;
    color: #000 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  body.hospital-events-print-mode .annual-book-print-sheet .hosp-internada-flag {
    background: #fecaca !important;
    color: #000 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  body.antibiotics-print-mode .annual-book-print-sheet .official-gov-letterhead,
  body.appointments-print-mode .annual-book-print-sheet .official-gov-letterhead,
  body.hospital-events-print-mode .annual-book-print-sheet .official-gov-letterhead,
  body.growth-print-mode .annual-book-print-sheet .official-gov-letterhead,
  body.antibiotics-print-mode .annual-book-print-sheet .official-gov-letterhead * {
    color: #000 !important;
  }
}

/* —— Controle anual de consultas (especialistas) —— */

.apt-annual-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px 20px;
  margin-bottom: 12px;
}

.apt-year-label {
  display: grid;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
}

.apt-year-select {
  min-height: var(--touch-target);
  min-width: 120px;
  padding: 8px 12px;
  border-radius: var(--btn-radius);
  border: 1px solid var(--line);
  background: var(--input-bg);
  font-weight: 700;
}

.apt-annual-hint {
  margin: 0;
  flex: 1 1 220px;
  font-size: 12px;
}

.apt-annual-sheet-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.apt-annual-sheet {
  border: 1px solid var(--annual-sheet-border, rgba(148, 163, 184, 0.28));
  background: var(--annual-sheet-bg, #fff);
}

.apt-annual-sheet.annual-book-panel {
  min-width: 100%;
}

.apt-annual-doc-title {
  margin: 0;
  padding: 10px 12px;
  text-align: center;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  border-bottom: 1px solid var(--annual-sheet-border, rgba(148, 163, 184, 0.28));
}

.apt-sector-block {
  border-bottom: 1px solid var(--annual-sheet-border, rgba(148, 163, 184, 0.28));
}

.apt-sector-block:last-child {
  border-bottom: 0;
}

.apt-sector-title {
  margin: 0;
  padding: 8px 12px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  background: var(--annual-sheet-head, #e8eef4);
  border-bottom: 1px solid var(--annual-sheet-border, rgba(148, 163, 184, 0.28));
}

.apt-annual-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 9px;
}

.apt-annual-table th,
.apt-annual-table td {
  border: 1px solid var(--annual-sheet-border, rgba(148, 163, 184, 0.28));
  vertical-align: top;
  color: var(--annual-sheet-text, #0f172a);
}

.apt-sector-col {
  width: 140px;
  min-width: 120px;
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  background: var(--annual-sheet-head, #e8eef4);
  text-align: left;
  padding: 8px;
}

.apt-prev-col {
  min-width: 3.25rem;
  width: 3.25rem;
  font-size: 9px;
  font-weight: 800;
  text-align: center;
  padding: 6px 2px;
  background: #d8e2ec;
  color: #0f172a;
}

.apt-month-col {
  font-size: 8px;
  font-weight: 800;
  text-align: center;
  padding: 6px 2px;
  background: #d8e2ec;
  color: #0f172a;
}

.apt-patient-name {
  font-size: 10px;
  font-weight: 800;
  text-align: left;
  padding: 8px;
  line-height: 1.3;
}

.apt-patient-row.is-highlighted .apt-patient-name {
  background: #d1fae5;
}

.apt-row-badge {
  display: block;
  margin-top: 4px;
  font-size: 7px;
  font-weight: 800;
  line-height: 1.25;
  text-transform: uppercase;
}

.apt-row-badge--egresso {
  color: #b91c1c;
}

.apt-row-badge--ingresso {
  color: #0369a1;
}

.apt-month-cell {
  min-width: 80px;
  min-height: 48px;
  padding: 4px;
  background: var(--annual-sheet-cell, #fff);
}

.apt-month-cell.has-entries {
  background: var(--annual-sheet-cell-alt, #f8fafc);
}

.apt-empty-cell {
  display: block;
  text-align: center;
  color: #94a3b8;
  padding: 8px 0;
}

.apt-cell-entry {
  margin-bottom: 6px;
  padding-bottom: 6px;
  border-bottom: 1px dashed #cbd5e1;
  line-height: 1.35;
}

.apt-cell-entry:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: 0;
}

.apt-cell-entry--clickable {
  cursor: pointer;
  border-radius: 4px;
}

.apt-cell-entry--clickable:hover {
  background: #f0f9ff;
}

.apt-date-chip {
  display: block;
  margin-bottom: 3px;
  padding: 2px 4px;
  background: #bae6fd !important;
  color: #0c4a6e;
  font-weight: 800;
  font-size: 8px;
  text-align: center;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

.apt-date-chip--return {
  background: #fef08a !important;
  color: #713f12 !important;
}

.apt-cell-entry--return .apt-specialty {
  font-weight: 800;
}

.apt-status-note--muted {
  font-size: 7px;
  color: #64748b;
  font-style: italic;
}

.apt-specialty {
  display: block;
  font-weight: 800;
  font-size: 10px;
  text-transform: uppercase;
  color: var(--annual-sheet-text, #0f172a);
}

.apt-doctor {
  display: block;
  font-size: 10px;
  color: var(--annual-sheet-muted, #475569);
}

.apt-draft-chip {
  display: inline-block;
  margin-top: 4px;
  padding: 2px 5px;
  border-radius: 4px;
  background: #fef08a;
  color: #713f12;
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
}

.apt-status-note {
  display: block;
  font-size: 7px;
  font-style: italic;
}

.apt-status-note--wait {
  background: #fef08a;
  color: #713f12;
  padding: 2px 3px;
  font-weight: 700;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

.apt-waiting-block {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid #fcd34d;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(254, 243, 199, 0.45) 0%, rgba(255, 251, 235, 0.2) 100%);
}

.apt-waiting-toggle {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-weight: 700;
  cursor: pointer;
}

.apt-waiting-toggle input {
  margin-top: 3px;
  width: 1.1rem;
  height: 1.1rem;
}

.apt-waiting-fields {
  display: grid;
  gap: 12px;
}

.apt-waiting-fields.is-hidden {
  display: none;
}

.apt-waiting-hint {
  margin: 0;
  font-size: 12px;
}

.apt-waiting-badge {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  margin: 0 0 6px;
  padding: 4px 8px;
  border-radius: 999px;
  background: #fef08a;
  color: #713f12;
  font-size: 10px;
  font-weight: 800;
  line-height: 1.35;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

.apt-waiting-badge--compact {
  font-size: 9px;
  padding: 3px 6px;
  margin-bottom: 4px;
}

.apt-waiting-pill {
  font-size: 10px;
  vertical-align: middle;
}

.child-card-waiting,
.annual-book-card__waiting,
.child-card-hosp-active {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.hosp-active-banner {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin: 0 0 16px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid #fca5a5;
  background: linear-gradient(135deg, #fef2f2 0%, #fff1f2 100%);
  color: #7f1d1d;
}

.hosp-active-banner__icon {
  font-size: 1.5rem;
  line-height: 1;
}

.hosp-active-banner__body {
  flex: 1;
  min-width: 0;
}

.hosp-active-banner__body p {
  margin: 4px 0 0;
}

.hosp-active-banner .primary {
  flex-shrink: 0;
  align-self: center;
}

.hosp-discharge-summary {
  padding: 12px 14px;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}

.hosp-internada-flag--active {
  background: #fecaca !important;
  color: #7f1d1d !important;
}

.hosp-internada-flag--alta {
  background: #bbf7d0 !important;
  color: #14532d !important;
}

.hosp-internada-flag__stay,
.hosp-internada-flag__doc {
  font-weight: 600;
  text-transform: none;
}

.apt-cell-entry--waiting {
  border-color: #fbbf24;
  background: #fffbeb;
}

.apt-date-chip--waiting {
  background: #fde68a;
  color: #78350f;
  font-weight: 800;
}

.apt-status-note--done {
  color: #15803d;
  font-weight: 700;
}

.apt-location {
  display: block;
  font-size: 7px;
  color: #475569;
}

.apt-add-btn {
  display: block;
  width: 100%;
  margin-top: 4px;
  min-height: 28px;
  padding: 4px;
  border: 1px dashed var(--line);
  border-radius: 6px;
  background: var(--surface-soft);
  font-weight: 800;
  font-size: 12px;
  cursor: pointer;
}

.apt-empty-sheet {
  padding: 24px;
  text-align: center;
  color: var(--muted);
}

.apt-child-list {
  margin-top: 18px;
}

.apt-child-list-title {
  margin: 0 0 10px;
  font-size: 15px;
}

@media (max-width: 767px) {
  .apt-annual-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .apt-year-select {
    width: 100%;
  }

  .apt-sector-col {
    position: sticky;
    left: 0;
    z-index: 2;
    background: #f8fafc;
    box-shadow: 2px 0 6px rgba(15, 23, 42, 0.08);
  }

  .apt-add-btn {
    min-height: var(--touch-target);
  }
}

@media print {
  body.appointments-print-mode * {
    visibility: hidden;
  }

  body.appointments-print-mode .appointments-print-root,
  body.appointments-print-mode .appointments-print-root *,
  body.appointments-print-mode .annual-book-print-source,
  body.appointments-print-mode .annual-book-print-source *,
  body.appointments-print-mode #annual-book-viewer-print-mount,
  body.appointments-print-mode #annual-book-viewer-print-mount *,
  body.appointments-print-mode #official-print-page-footer,
  body.appointments-print-mode #official-print-page-footer *,
  body.appointments-print-mode #official-print-auth-footer,
  body.appointments-print-mode #official-print-auth-footer * {
    visibility: visible;
  }

  body.appointments-print-mode .appointments-print-root,
  body.appointments-print-mode .annual-book-print-source,
  body.appointments-print-mode #annual-book-viewer-print-mount {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    min-width: 0;
    border: none;
    clip: auto !important;
    width: 100% !important;
    height: auto !important;
    margin: 0 !important;
    overflow: visible !important;
    white-space: normal !important;
    display: block !important;
  }

  body.appointments-print-mode #annual-book-viewer-print-mount.visually-hidden-screen {
    position: absolute !important;
    width: 100% !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    clip: auto !important;
    overflow: visible !important;
  }

  body.appointments-print-mode .annual-book-cards-grid,
  body.appointments-print-mode .annual-book-card,
  body.appointments-print-mode .annual-book-panel-wrap,
  body.appointments-print-mode .apt-annual-toolbar,
  body.appointments-print-mode .apt-child-list,
  body.appointments-print-mode .apt-add-btn,
  body.appointments-print-mode .no-print {
    display: none !important;
  }

  body.appointments-print-mode .apt-date-chip {
    background: #bae6fd !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  body.appointments-print-mode .apt-status-note--wait {
    background: #fef08a !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  body.appointments-print-mode .apt-annual-table th,
  body.appointments-print-mode .apt-annual-table td {
    border-color: #000 !important;
  }

  body.appointments-print-mode .apt-annual-table {
    font-size: 7pt;
  }
}

/* —— Controle anual patologias / emergências / internações —— */

.hosp-annual-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px 20px;
  margin-bottom: 12px;
}

.hosp-year-label {
  display: grid;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
}

.hosp-year-select {
  min-height: var(--touch-target);
  min-width: 120px;
  padding: 8px 12px;
  border-radius: var(--btn-radius);
  border: 1px solid var(--line);
  background: var(--input-bg);
  font-weight: 700;
}

.hosp-annual-hint {
  margin: 0;
  flex: 1 1 220px;
  font-size: 12px;
}

.hosp-annual-sheet-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.hosp-annual-sheet:not(.annual-book-panel) {
  min-width: 1100px;
  border: 1px solid var(--annual-sheet-border, rgba(148, 163, 184, 0.28));
  background: var(--annual-sheet-bg, #fff);
}

.hosp-annual-doc-title {
  margin: 0;
  padding: 10px 12px;
  text-align: center;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  border-bottom: 1px solid var(--annual-sheet-border, rgba(148, 163, 184, 0.28));
}

.hosp-sector-block {
  border-bottom: 1px solid var(--annual-sheet-border, rgba(148, 163, 184, 0.28));
}

.hosp-sector-block:last-child {
  border-bottom: 0;
}

.hosp-sector-title {
  margin: 0;
  padding: 8px 12px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  background: var(--annual-sheet-head, #e8eef4);
  border-bottom: 1px solid var(--annual-sheet-border, rgba(148, 163, 184, 0.28));
}

.hosp-annual-table {
  width: 100%;
  min-width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 9px;
}

.hosp-annual-table th,
.hosp-annual-table td {
  border: 1px solid var(--annual-sheet-border, rgba(148, 163, 184, 0.28));
  vertical-align: top;
  color: var(--annual-sheet-text, #0f172a);
}

.hosp-sector-col {
  width: 140px;
  min-width: 120px;
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  background: var(--annual-sheet-head, #e8eef4);
  text-align: left;
  padding: 8px;
}

.hosp-month-col {
  font-size: 8px;
  font-weight: 800;
  text-align: center;
  padding: 6px 2px;
  background: #d8e2ec;
  color: #0f172a;
}

.hosp-patient-name {
  font-size: 10px;
  font-weight: 800;
  text-align: left;
  padding: 8px;
  line-height: 1.3;
}

.hosp-patient-row.is-highlighted .hosp-patient-name {
  background: #d1fae5;
}

.hosp-month-cell {
  min-height: 44px;
  padding: 4px;
  background: var(--annual-sheet-cell, #fff);
  vertical-align: top;
}

.hosp-month-cell.has-entries {
  background: var(--annual-sheet-cell-alt, #f8fafc);
}

.hosp-empty-cell {
  display: block;
  text-align: center;
  color: #94a3b8;
  padding: 8px 0;
}

.hosp-cell-entry {
  margin-bottom: 6px;
  padding-bottom: 6px;
  border-bottom: 1px dashed #cbd5e1;
  line-height: 1.35;
}

.hosp-cell-entry:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: 0;
}

.hosp-cell-entry--clickable {
  cursor: pointer;
  border-radius: 4px;
}

.hosp-cell-entry--clickable:hover {
  background: #fffbeb;
}

.hosp-cell-open-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 1.55rem;
  margin-top: 5px;
  padding: 3px 6px;
  border: 1px solid #94a3b8;
  border-radius: 6px;
  background: #fff;
  color: #0f172a;
  font-size: 9px;
  font-weight: 800;
  line-height: 1.1;
  cursor: pointer;
}

.hosp-cell-open-btn:hover,
.hosp-cell-open-btn:focus-visible {
  border-color: #0f766e;
  background: #ecfdf5;
  outline: none;
}

.hosp-date-chip {
  display: block;
  margin-bottom: 3px;
  padding: 2px 4px;
  background: #e0f2fe;
  color: #0c4a6e;
  font-weight: 800;
  font-size: 8px;
  text-align: center;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

.hosp-action-line {
  display: block;
  font-weight: 700;
  font-size: 8px;
}

.hosp-internada-flag {
  display: block;
  margin: 3px 0;
  padding: 2px 4px;
  background: #fef08a !important;
  color: #713f12;
  font-weight: 800;
  font-size: 8px;
  text-transform: uppercase;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

.hosp-diagnosis {
  display: block;
  font-size: 8px;
}

/* Menu de célula: use .annual-cell-action-select (ver bloco livros anuais acima) */

.hosp-picker-lead {
  margin: 0 0 14px;
}

.hosp-picker-actions {
  display: grid;
  gap: 10px;
}

.hosp-picker-btn {
  width: 100%;
  min-height: var(--touch-target);
  text-align: left;
  white-space: normal;
}

.hosp-picker-btn--emer {
  border-color: #fca5a5;
  color: #b91c1c;
}

.hosp-empty-sheet {
  padding: 24px;
  text-align: center;
  color: var(--muted);
}

.hosp-child-list {
  margin-top: 18px;
}

.hosp-child-list-title {
  margin: 0 0 10px;
  font-size: 15px;
}

@media (max-width: 767px) {
  .hosp-sector-col {
    position: sticky;
    left: 0;
    z-index: 2;
    background: #f8fafc;
    box-shadow: 2px 0 6px rgba(15, 23, 42, 0.08);
  }

  .hosp-add-btn {
    min-height: 36px;
  }

  .hosp-month-col,
  .hosp-month-cell {
    min-width: 48px;
    width: 48px;
  }
}

@media print {
  body.hospital-events-print-mode * {
    visibility: hidden;
  }

  body.hospital-events-print-mode .hospital-events-print-root,
  body.hospital-events-print-mode .hospital-events-print-root *,
  body.hospital-events-print-mode .annual-book-print-source,
  body.hospital-events-print-mode .annual-book-print-source *,
  body.hospital-events-print-mode #annual-book-viewer-print-mount,
  body.hospital-events-print-mode #annual-book-viewer-print-mount *,
  body.hospital-events-print-mode #official-print-page-footer,
  body.hospital-events-print-mode #official-print-page-footer *,
  body.hospital-events-print-mode #official-print-auth-footer,
  body.hospital-events-print-mode #official-print-auth-footer * {
    visibility: visible;
  }

  body.hospital-events-print-mode .hospital-events-print-root,
  body.hospital-events-print-mode .annual-book-print-source,
  body.hospital-events-print-mode #annual-book-viewer-print-mount {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    min-width: 0;
    border: none;
    clip: auto !important;
    width: 100% !important;
    height: auto !important;
    margin: 0 !important;
    overflow: visible !important;
    white-space: normal !important;
    display: block !important;
  }

  body.hospital-events-print-mode #annual-book-viewer-print-mount.visually-hidden-screen {
    position: absolute !important;
    width: 100% !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    clip: auto !important;
    overflow: visible !important;
  }

  body.hospital-events-print-mode .annual-book-cards-grid,
  body.hospital-events-print-mode .annual-book-card,
  body.hospital-events-print-mode .annual-book-panel-wrap,
  body.hospital-events-print-mode .hosp-annual-toolbar,
  body.hospital-events-print-mode .hosp-child-list,
  body.hospital-events-print-mode .hosp-add-menu,
  body.hospital-events-print-mode .no-print {
    display: none !important;
  }

  body.hospital-events-print-mode .hosp-internada-flag {
    background: #fef08a !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  body.hospital-events-print-mode .hosp-annual-table th,
  body.hospital-events-print-mode .hosp-annual-table td {
    border-color: #000 !important;
  }

  body.hospital-events-print-mode .hosp-annual-table {
    font-size: 7pt;
  }
}

/* —— Controle anual peso / estatura / IMC —— */

.gro-annual-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px 20px;
  margin-bottom: 12px;
}

.gro-year-label {
  display: grid;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
}

.gro-year-select {
  min-height: var(--touch-target);
  min-width: 120px;
  padding: 8px 12px;
  border-radius: var(--btn-radius);
  border: 1px solid var(--line);
  background: var(--input-bg);
  font-weight: 700;
}

.gro-annual-hint {
  margin: 0;
  flex: 1 1 220px;
  font-size: 12px;
}

.gro-annual-sheet-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.gro-annual-sheet:not(.annual-book-panel) {
  min-width: 1100px;
  border: 1px solid var(--annual-sheet-border, rgba(148, 163, 184, 0.28));
  background: var(--annual-sheet-bg, #fff);
}

.gro-annual-doc-title {
  margin: 0;
  padding: 10px 12px;
  text-align: center;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  border-bottom: 1px solid var(--annual-sheet-border, rgba(148, 163, 184, 0.28));
}

.gro-sector-block {
  border-bottom: 1px solid var(--annual-sheet-border, rgba(148, 163, 184, 0.28));
}

.gro-sector-block:last-child {
  border-bottom: 0;
}

.gro-sector-title {
  margin: 0;
  padding: 8px 12px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  background: var(--annual-sheet-head, #e8eef4);
  border-bottom: 1px solid var(--annual-sheet-border, rgba(148, 163, 184, 0.28));
}

.gro-annual-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 9px;
}

.gro-annual-table th,
.gro-annual-table td {
  border: 1px solid var(--annual-sheet-border, rgba(148, 163, 184, 0.28));
  vertical-align: middle;
  color: var(--annual-sheet-text, #0f172a);
}

.gro-sector-col {
  width: 140px;
  min-width: 120px;
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  background: var(--annual-sheet-head, #e8eef4);
  text-align: left;
  padding: 8px;
}

.gro-month-col {
  font-size: 8px;
  font-weight: 800;
  text-align: center;
  padding: 6px 2px;
  background: #d8e2ec;
  color: #0f172a;
}

.gro-patient-name {
  font-size: 10px;
  font-weight: 800;
  text-align: left;
  padding: 8px;
  line-height: 1.3;
}

.gro-patient-row.is-highlighted .gro-patient-name {
  background: #d1fae5;
}

.gro-month-cell {
  min-width: 72px;
  min-height: 56px;
  padding: 4px;
  text-align: center;
  background: var(--annual-sheet-cell, #fff);
}

.gro-month-cell.has-entry {
  background: var(--annual-sheet-cell-alt, #f8fafc);
}

.gro-triplet {
  line-height: 1.45;
  font-size: 8px;
  font-weight: 700;
}

.gro-triplet--clickable {
  cursor: pointer;
  border-radius: 4px;
}

.gro-triplet--clickable:hover {
  background: #ecfdf5;
}

.gro-p-line {
  color: #0f172a;
}

.gro-e-line {
  color: #334155;
}

.gro-imc-line {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-weight: 800;
  line-height: 1.25;
  text-align: center;
}

.gro-imc-line--neutral {
  color: #64748b;
}

.gro-imc-line--success {
  color: #15803d;
  background: rgba(22, 163, 74, 0.1);
  border-radius: 6px;
  padding: 2px 4px;
}

.gro-imc-line--danger {
  color: #b91c1c;
  background: rgba(220, 38, 38, 0.12);
  border-radius: 6px;
  padding: 2px 4px;
}

.gro-imc-line--warning {
  color: #a16207;
  background: rgba(234, 179, 8, 0.2);
  border-radius: 6px;
  padding: 2px 4px;
}

.gro-nutrition-label {
  font-size: 7px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.gro-nutrition-pill {
  display: inline-flex;
  vertical-align: middle;
  margin-left: 4px;
}

.gro-nutrition-pill--compact {
  font-size: 10px;
  padding: 2px 8px;
}

.annual-book-card__nutrition {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.annual-book-panel .gro-triplet--clickable {
  cursor: pointer;
}

.annual-book-panel .annual-month-cell--clickable {
  cursor: pointer;
}

.annual-book-panel .annual-month-cell--clickable:hover .gro-triplet--clickable,
.annual-book-panel .annual-month-cell--clickable:focus-within .gro-triplet--clickable {
  outline: 2px solid rgba(4, 120, 87, 0.35);
  outline-offset: 2px;
}

.gro-add-btn {
  display: block;
  width: 100%;
  margin-top: 4px;
  min-height: 24px;
  padding: 2px;
  border: 1px dashed var(--line);
  border-radius: 6px;
  background: var(--surface-soft);
  font-weight: 800;
  font-size: 11px;
  cursor: pointer;
}

.gro-empty-sheet {
  padding: 24px;
  text-align: center;
  color: var(--muted);
}

.gro-child-list {
  margin-top: 18px;
}

.gro-child-list-title {
  margin: 0 0 10px;
  font-size: 15px;
}

@media (max-width: 767px) {
  .gro-sector-col {
    position: sticky;
    left: 0;
    z-index: 2;
    background: #f8fafc;
    box-shadow: 2px 0 6px rgba(15, 23, 42, 0.08);
  }

  .gro-add-btn {
    min-height: var(--touch-target);
  }
}

@media print {
  body.growth-print-mode * {
    visibility: hidden;
  }

  body.growth-print-mode .growth-print-root,
  body.growth-print-mode .growth-print-root *,
  body.growth-print-mode .annual-book-print-source,
  body.growth-print-mode .annual-book-print-source *,
  body.growth-print-mode #annual-book-viewer-print-mount,
  body.growth-print-mode #annual-book-viewer-print-mount *,
  body.growth-print-mode #official-print-page-footer,
  body.growth-print-mode #official-print-page-footer *,
  body.growth-print-mode #official-print-auth-footer,
  body.growth-print-mode #official-print-auth-footer * {
    visibility: visible;
  }

  body.growth-print-mode .growth-print-root,
  body.growth-print-mode .annual-book-print-source,
  body.growth-print-mode #annual-book-viewer-print-mount {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    min-width: 0;
    border: none;
    clip: auto !important;
    width: 100% !important;
    height: auto !important;
    margin: 0 !important;
    overflow: visible !important;
    white-space: normal !important;
    display: block !important;
  }

  body.growth-print-mode #annual-book-viewer-print-mount.visually-hidden-screen {
    position: absolute !important;
    width: 100% !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    clip: auto !important;
    overflow: visible !important;
  }

  body.growth-print-mode .annual-book-cards-grid,
  body.growth-print-mode .annual-book-card,
  body.growth-print-mode .annual-book-panel-wrap,
  body.growth-print-mode .gro-annual-toolbar,
  body.growth-print-mode .gro-child-list,
  body.growth-print-mode .gro-add-btn,
  body.growth-print-mode .no-print {
    display: none !important;
  }

  body.growth-print-mode .gro-annual-table th,
  body.growth-print-mode .gro-annual-table td {
    border-color: #000 !important;
  }

  body.growth-print-mode .gro-annual-table {
    font-size: 7pt;
  }

  body.vaccine-print-mode * {
    visibility: hidden;
  }

  body.vaccine-print-mode .vaccine-print-root,
  body.vaccine-print-mode .vaccine-print-root *,
  body.vaccine-print-mode #vax-print-source,
  body.vaccine-print-mode #vax-print-source *,
  body.vaccine-print-mode #official-print-page-footer,
  body.vaccine-print-mode #official-print-page-footer *,
  body.vaccine-print-mode #official-print-auth-footer,
  body.vaccine-print-mode #official-print-auth-footer * {
    visibility: visible;
  }

  body.vaccine-print-mode .vaccine-print-root,
  body.vaccine-print-mode #vax-print-source .vaccine-print-root {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    min-width: 0;
    border: none;
    clip: auto !important;
    height: auto !important;
    margin: 0 !important;
    overflow: visible !important;
    background: #fff !important;
  }

  body.vaccine-print-mode .vaccine-card,
  body.vaccine-print-mode .no-print {
    display: none !important;
  }

  body.vaccine-print-mode .vax-schedule-table th,
  body.vaccine-print-mode .vax-schedule-table td {
    border: 1px solid #000 !important;
    color: #000 !important;
    font-size: 7.8pt;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  body.vaccine-print-mode .vax-model-card {
    border: none !important;
    border-radius: 0 !important;
    padding: 0 !important;
    gap: 8px !important;
    background: #fff !important;
  }

  body.vaccine-print-mode .vax-model-title {
    margin: 3mm 0 1.5mm !important;
    font-size: 10.5pt !important;
    color: #000 !important;
  }

  body.vaccine-print-mode .vax-model-status-bar {
    display: none !important;
  }

  body.vaccine-print-mode .vax-model-table {
    width: 100% !important;
    min-width: 0 !important;
    table-layout: fixed !important;
  }

  body.vaccine-print-mode .vax-model-table th {
    padding: 3px 4px !important;
    background: #f2f2f2 !important;
    font-size: 7.4pt !important;
  }

  body.vaccine-print-mode .vax-model-table td {
    padding: 3.5px 4px !important;
    line-height: 1.12 !important;
    vertical-align: top !important;
    background: #fff !important;
  }

  body.vaccine-print-mode .vax-model-table th:nth-child(1),
  body.vaccine-print-mode .vax-model-table td:nth-child(1) {
    width: 32% !important;
  }

  body.vaccine-print-mode .vax-model-table th:nth-child(2),
  body.vaccine-print-mode .vax-model-table td:nth-child(2) {
    width: 15% !important;
  }

  body.vaccine-print-mode .vax-model-table th:nth-child(3),
  body.vaccine-print-mode .vax-model-table td:nth-child(3) {
    width: 13% !important;
  }

  body.vaccine-print-mode .vax-model-table th:nth-child(4),
  body.vaccine-print-mode .vax-model-table td:nth-child(4) {
    width: 40% !important;
  }

  body.vaccine-print-mode .vax-cell-observation {
    text-align: left !important;
    word-break: normal !important;
    overflow-wrap: anywhere !important;
  }

  body.vaccine-print-mode .vax-model-notes {
    margin-top: 4mm;
    color: #000 !important;
    font-size: 8.5pt !important;
  }

  body.vaccine-print-mode .vax-model-signature {
    margin-top: 10mm;
    color: #000 !important;
    font-size: 9pt !important;
  }

  body.vaccine-print-mode .vax-cell-mark--applied,
  body.vaccine-print-mode .vax-row--applied td.vax-cell-mark--applied {
    background: #dcfce7 !important;
  }

  body.vaccine-print-mode .vax-cell-mark--overdue,
  body.vaccine-print-mode .vax-row--overdue td.vax-cell-mark--overdue {
    background: #fee2e2 !important;
  }

  body.vaccine-print-mode .vax-cell-mark--upcoming {
    background: #fef9c3 !important;
  }

  body.vaccine-print-mode .vax-status-pill {
    border: 1px solid #000;
    background: transparent !important;
    color: #000 !important;
    animation: none !important;
  }

  body.exams-print-mode * {
    visibility: hidden;
  }

  body.exams-print-mode > :not(#exam-print-source):not(#official-print-page-footer):not(#official-print-auth-footer) {
    display: none !important;
  }

  body.exams-print-mode #exam-print-source,
  body.exams-print-mode #exam-print-source *,
  body.exams-print-mode .exam-print-root,
  body.exams-print-mode .exam-print-root *,
  body.exams-print-mode #official-print-page-footer,
  body.exams-print-mode #official-print-page-footer *,
  body.exams-print-mode #official-print-auth-footer,
  body.exams-print-mode #official-print-auth-footer * {
    visibility: visible;
  }

  body.exams-print-mode #exam-print-source.visually-hidden-screen {
    display: block !important;
    position: static !important;
    width: auto !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    clip: auto !important;
    clip-path: none !important;
    overflow: visible !important;
    white-space: normal !important;
    border: 0 !important;
  }

  body.exams-print-mode #exam-print-source {
    display: block !important;
    position: static !important;
    width: auto !important;
    height: auto !important;
    overflow: visible !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  body.exams-print-mode .exam-print-root {
    position: static !important;
    width: 100%;
    max-width: 180mm;
    min-height: auto;
    max-height: none;
    margin: 0 auto !important;
    padding: 0 !important;
    background: #fff !important;
    color: #111827 !important;
    box-shadow: none !important;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 8.4pt;
    overflow: visible !important;
    break-inside: avoid-page;
    page-break-inside: avoid;
  }

  body.exams-print-mode .official-gov-letterhead {
    width: 112mm;
    margin: 0 auto 4mm !important;
    padding: 0 !important;
  }

  body.exams-print-mode .official-gov-logo {
    display: block !important;
    width: 34mm !important;
    height: 17mm !important;
    margin: 0 auto 4mm !important;
    object-fit: contain !important;
  }

  body.exams-print-mode .official-print-child-id {
    width: 112mm;
    margin: 0 auto !important;
  }

  body.exams-print-mode .official-print-child-id__line {
    margin: 0 0 2.4mm !important;
    font-size: 11pt !important;
    line-height: 1.15 !important;
  }

  body.exams-print-mode .exam-print-patient-header {
    width: 112mm;
    margin: 0 auto;
  }

  body.exams-print-mode .exam-print-patient-line {
    display: flex;
    align-items: flex-end;
    min-height: 12pt;
    border-bottom: 1px solid #555;
    font-size: 8pt;
    text-transform: uppercase;
  }

  body.exams-print-mode .exam-print-patient-line strong {
    font-weight: 600;
    text-transform: none;
  }

  body.exams-print-mode .exam-print-patient-line--split {
    justify-content: space-between;
    gap: 20pt;
  }

  body.exams-print-mode .exam-print-patient-line i {
    display: inline-block;
    width: 120pt;
    border-bottom: 1px solid #555;
  }

  body.exams-print-mode .exam-print-title {
    width: 112mm;
    margin: 2pt auto 0;
    text-align: center;
    font-size: 8.8pt;
    font-weight: 900;
    line-height: 1.05;
    text-decoration: underline;
  }

  body.exams-print-mode .exam-print-tests {
    width: 86mm;
    margin: 2pt auto 0;
    border: 1px solid #666;
  }

  body.exams-print-mode .exam-print-test-block {
    min-height: 12mm;
    padding: 1.5pt 4pt 1.5pt;
    border-bottom: 1px solid #777;
    break-inside: avoid;
  }

  body.exams-print-mode .exam-print-test-block:last-child {
    border-bottom: 0;
  }

  body.exams-print-mode .exam-print-test-block h2 {
    margin: 0 0 1pt;
    text-align: center;
    font-size: 7.2pt;
    font-weight: 900;
  }

  body.exams-print-mode .exam-print-test-block p {
    margin: 0;
    line-height: 1.05;
    color: #111827 !important;
  }

  body.exams-print-mode .exam-print-test-block span {
    margin-left: 12pt;
  }

  body.exams-print-mode .exam-print-result-line {
    display: flex;
    gap: 4pt;
    align-items: flex-end;
  }

  body.exams-print-mode .exam-print-result-line strong {
    flex: 1;
    min-height: 7pt;
    border-bottom: 1px solid #555;
    font-weight: 700;
    text-align: center;
  }

  body.exams-print-mode .exam-print-date {
    width: 86mm;
    margin: 8mm auto 0;
    text-align: center;
    font-size: 7.4pt;
    border-bottom: 1px solid #555;
    padding-bottom: 2pt;
  }

  body.exams-print-mode .exam-print-professional {
    width: 86mm;
    margin: 9mm auto 0;
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: end;
    gap: 5pt;
    font-weight: 900;
  }

  body.exams-print-mode .exam-print-professional strong {
    display: block;
    min-height: 11pt;
    border-bottom: 1px solid #555;
    text-align: center;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 7.8pt;
    font-weight: 800;
  }

  body.exams-print-mode .exam-print-professional small {
    grid-column: 2;
    text-align: center;
    font-size: 6.8pt;
    font-weight: 700;
  }
}

/* —— Data/hora nos formulários —— */

.field-datetime {
  display: grid;
  gap: 6px;
}

.field-datetime-label {
  font-size: 12px;
  font-weight: 700;
}

.field-date-input,
.field-time-input {
  min-height: var(--touch-target);
  padding: 10px 12px;
  border-radius: var(--btn-radius);
  border: 1px solid var(--line);
  background: var(--input-bg);
  font-size: 16px;
}

.field-date-input {
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

.field-date-input--invalid {
  border-color: var(--danger);
}

.annual-month-cell--clickable {
  cursor: pointer;
}

.annual-month-cell--clickable:hover {
  background: rgba(16, 185, 129, 0.08);
}

[data-theme="dark"] .annual-month-cell--clickable:hover {
  background: rgba(52, 211, 153, 0.12);
}

.dt-quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.dt-quick-btn {
  min-height: 36px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 700;
}

.dt-display-hint {
  font-size: 11px;
  line-height: 1.35;
}

.draft-deadline {
  margin: 0;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 700;
}

/* —— Guia de permissões —— */

.permissions-guide-footer-btn {
  display: block;
  width: 100%;
  max-width: 420px;
  margin: 0 auto 10px;
  font-size: 12px;
  font-weight: 700;
}

.profile-quick-guide {
  margin-bottom: 16px;
}

.profile-quick-guide-hint {
  margin: 6px 0 0;
  font-size: 12px;
}

.profile-quick-guide-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
}

.profile-quick-guide-actions .primary {
  white-space: normal;
  text-align: center;
  max-width: 220px;
}

@media (max-width: 520px) {
  .profile-quick-guide-actions {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
  }
  .profile-quick-guide-actions .primary,
  .profile-quick-guide-actions .secondary {
    width: 100%;
    max-width: none;
  }
}

.modal-head .modal-subtitle {
  margin: 4px 0 0;
  font-size: 13px;
}

.permissions-guide-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  padding: 12px 14px;
  border-radius: var(--btn-radius);
  border: 1px solid var(--line);
  background: var(--surface-soft);
}

.permissions-guide {
  max-height: min(70vh, 640px);
  overflow-y: auto;
  padding: 0 4px 8px;
}

.permissions-guide h3 {
  margin: 18px 0 8px;
  font-size: 14px;
}

.permissions-guide-list {
  margin: 0;
  padding-left: 1.2rem;
  font-size: 13px;
  line-height: 1.5;
}

.permissions-guide-list li {
  margin-bottom: 6px;
}

.permissions-guide-note {
  margin-top: 14px;
  font-size: 12px;
}

.permissions-compare-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.permissions-compare-table th,
.permissions-compare-table td {
  border: 1px solid var(--line);
  padding: 8px 10px;
  text-align: left;
  vertical-align: top;
}

.permissions-compare-table thead th {
  background: var(--surface-soft);
  font-weight: 800;
}

.permissions-compare-table tbody th {
  font-weight: 600;
  background: color-mix(in srgb, var(--surface-soft) 50%, transparent);
}

.permissions-compare-table--single thead th:last-child {
  color: var(--primary);
}

.developer-contact-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 8px 4px 4px;
  text-align: center;
}

.developer-contact-card__title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 800;
}

.developer-contact-card__role {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
}

.developer-contact-card__link {
  display: block;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
}

.developer-contact-card__link:hover {
  text-decoration: underline;
}

.developer-contact-card__copy {
  margin: 8px 0 0;
  font-size: 0.8rem;
}

.metric.metric-wide {
  grid-column: 1 / -1;
}

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

/* —— Cartão de vacinação (abas + grade PNI) —— */

.vaccine-card {
  width: 100%;
  max-width: var(--layout-max);
  margin: 0 auto;
  border-radius: 22px;
  border: 1px solid color-mix(in srgb, var(--line) 76%, transparent);
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--surface) 98%, transparent), color-mix(in srgb, var(--surface-soft) 78%, transparent)),
    var(--surface);
  box-shadow: 0 18px 46px rgba(15, 23, 42, 0.08), 0 1px 3px rgba(15, 23, 42, 0.04);
  overflow: visible;
}

[data-theme="dark"] .vaccine-card {
  border-color: rgba(94, 234, 212, 0.16);
  background:
    radial-gradient(circle at 15% 0%, rgba(45, 212, 191, 0.13), transparent 34%),
    linear-gradient(180deg, #101827, #0b1220);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.42), 0 0 0 1px rgba(16, 185, 129, 0.06);
}

.vaccine-card-intro {
  padding: 16px 18px 8px;
}

.vaccine-tabs-sticky {
  display: none;
}

.profile-subnav-slot .vaccine-inner-tabs--top {
  padding: 4px 0 2px;
}

.vaccine-card-tabs {
  padding: 0 18px 10px;
}

[data-theme="dark"] .vaccine-tabs-sticky {
  background: #0f172a;
  border-bottom-color: #1e293b;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

.vaccine-card-meta {
  padding: 0 18px 12px;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
}

[data-theme="dark"] .vaccine-card-meta {
  border-bottom-color: #1e293b;
}

.vaccine-card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.vaccine-card-eyebrow {
  margin: 0 0 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--primary);
}

.vaccine-card-name {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1.2;
}

.vaccine-card-sub {
  margin: 6px 0 0;
  font-size: 13px;
  color: var(--muted);
}

.vaccine-card-head-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.vaccine-card-head-actions .primary {
  box-shadow: 0 12px 26px color-mix(in srgb, var(--primary) 24%, transparent);
}

.vaccine-theme-switch {
  flex-shrink: 0;
}

.vaccine-progress-block {
  margin-bottom: 10px;
  padding: 14px;
  border: 1px solid color-mix(in srgb, var(--line) 72%, transparent);
  border-radius: 18px;
  background: color-mix(in srgb, var(--surface-soft) 72%, transparent);
}

.vaccine-progress-label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
}

.vaccine-progress-label strong {
  font-size: 13px;
  color: inherit;
  font-weight: 800;
}

.vaccine-progress-track {
  height: 14px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.14);
}

[data-theme="dark"] .vaccine-progress-track {
  background: #1e293b;
}

.vaccine-progress-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #0ea5e9, #10b981 58%, #34d399);
  transition: width 0.55s cubic-bezier(0.22, 1, 0.36, 1);
  box-shadow: 0 0 18px rgba(16, 185, 129, 0.36);
}

[data-theme="dark"] .vaccine-progress-fill {
  background: linear-gradient(90deg, #047857, #34d399);
  box-shadow: 0 0 12px rgba(52, 211, 153, 0.45);
}

.vaccine-status-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.vaccine-status-chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 11px;
  font-weight: 900;
  border: 1px solid transparent;
}

.vaccine-status-chip--success {
  color: #047857;
  background: #d1fae5;
  border-color: #a7f3d0;
}

.vaccine-status-chip--info {
  color: #0369a1;
  background: #e0f2fe;
  border-color: #bae6fd;
}

.vaccine-status-chip--warn {
  color: #92400e;
  background: #fef3c7;
  border-color: #fde68a;
}

.vaccine-status-chip--danger {
  color: #b91c1c;
  background: #fee2e2;
  border-color: #fecaca;
}

[data-theme="dark"] .vaccine-status-chip--success {
  color: #a7f3d0;
  background: rgba(16, 185, 129, 0.14);
  border-color: rgba(16, 185, 129, 0.26);
}

[data-theme="dark"] .vaccine-status-chip--info {
  color: #bae6fd;
  background: rgba(14, 165, 233, 0.14);
  border-color: rgba(14, 165, 233, 0.26);
}

[data-theme="dark"] .vaccine-status-chip--warn {
  color: #fde68a;
  background: rgba(245, 158, 11, 0.14);
  border-color: rgba(245, 158, 11, 0.28);
}

[data-theme="dark"] .vaccine-status-chip--danger {
  color: #fecaca;
  background: rgba(239, 68, 68, 0.14);
  border-color: rgba(239, 68, 68, 0.28);
}

.vaccine-inner-tabs--top {
  width: 100%;
  margin: 0;
  padding: 6px;
  border: 1px solid color-mix(in srgb, var(--line) 72%, transparent);
  border-radius: 18px;
  gap: 6px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--surface-soft) 92%, transparent), color-mix(in srgb, var(--surface) 92%, transparent)),
    var(--surface-soft);
  box-shadow: inset 0 1px 0 color-mix(in srgb, #fff 50%, transparent), 0 12px 30px color-mix(in srgb, #020617 7%, transparent);
}

.vaccine-inner-tabs {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  margin: 0;
  padding-bottom: 2px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.vaccine-inner-tabs::-webkit-scrollbar {
  display: none;
}

.vaccine-inner-tab {
  flex: 1;
  min-width: 11rem;
  display: grid;
  gap: 2px;
  place-items: center;
  min-height: 56px;
  padding: 9px 14px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  border-bottom: 1px solid transparent;
  transition: transform 0.18s ease, color 0.15s ease, background 0.15s ease, border-color 0.15s ease, box-shadow 0.18s ease;
}

.vaccine-inner-tab span {
  display: block;
}

.vaccine-inner-tab small {
  display: block;
  color: inherit;
  opacity: 0.72;
  font-size: 10px;
  font-weight: 700;
}

.vaccine-inner-tab:hover {
  transform: translateY(-1px);
  color: inherit;
  background: color-mix(in srgb, var(--primary) 9%, transparent);
  border-color: color-mix(in srgb, var(--primary) 20%, transparent);
}

.vaccine-inner-tab.is-active {
  color: var(--primary);
  border-color: color-mix(in srgb, var(--primary) 32%, transparent);
  border-bottom-color: color-mix(in srgb, var(--primary) 32%, transparent);
  background:
    radial-gradient(circle at 18% 0%, color-mix(in srgb, var(--primary) 24%, transparent), transparent 55%),
    linear-gradient(135deg, color-mix(in srgb, var(--primary) 16%, transparent), color-mix(in srgb, #fff 62%, transparent));
  box-shadow: 0 14px 28px color-mix(in srgb, var(--primary) 16%, transparent), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

[data-theme="dark"] .vaccine-inner-tab.is-active {
  color: #6ee7b7;
  border-color: rgba(52, 211, 153, 0.34);
  border-bottom-color: rgba(52, 211, 153, 0.34);
  background:
    radial-gradient(circle at 20% 0%, rgba(52, 211, 153, 0.18), transparent 60%),
    linear-gradient(135deg, rgba(16, 185, 129, 0.18), rgba(15, 23, 42, 0.72));
  box-shadow: 0 18px 34px rgba(16, 185, 129, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.vaccine-week-alert--warn {
  background: #fef3c7;
  border-color: #f59e0b;
  color: #92400e;
}

[data-theme="dark"] .vaccine-week-alert--warn {
  background: rgba(245, 158, 11, 0.15);
  border-color: #d97706;
  color: #fcd34d;
}

.vaccine-week-alert {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 10px 0 0;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid #fde68a;
  background: #fffbeb;
  color: #92400e;
  font-size: 12px;
  font-weight: 600;
  animation: vaccineWeekPulse 2s ease-in-out infinite;
}

.vaccine-week-alert .icon-lucide {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

[data-theme="dark"] .vaccine-week-alert {
  border-color: rgba(250, 204, 21, 0.35);
  background: rgba(113, 63, 18, 0.45);
  color: #fde68a;
}

@keyframes vaccineWeekPulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(250, 204, 21, 0.35);
  }
  50% {
    box-shadow: 0 0 0 6px rgba(250, 204, 21, 0);
  }
}

.vaccine-card-panel {
  padding: 14px 18px 20px;
  width: 100%;
  max-width: min(62rem, 100%);
  margin: 0 auto;
  box-sizing: border-box;
}

.vaccine-card-panel > * {
  max-width: 100%;
  margin-left: auto;
  margin-right: auto;
}

/* Aba Próxima dose */

.vax-next-hero {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 18px;
  border-radius: 18px;
  border: 1px solid #d1fae5;
  background: linear-gradient(135deg, #ecfdf5 0%, #f0fdf4 55%, #ffffff 100%);
  max-width: min(54rem, 100%);
  margin: 0 auto;
  text-align: left;
  box-shadow: 0 18px 36px rgba(15, 23, 42, 0.08);
}

.vax-next-hero .vax-next-actions {
  justify-content: flex-end;
}

.vax-next-hero--alert {
  border-color: #fecaca;
  background: linear-gradient(135deg, #fef2f2 0%, #fff1f2 55%, #ffffff 100%);
}

[data-theme="dark"] .vax-next-hero {
  border-color: rgba(16, 185, 129, 0.25);
  background: linear-gradient(135deg, rgba(6, 78, 59, 0.5) 0%, rgba(15, 23, 42, 0.9) 100%);
  box-shadow: inset 0 0 24px rgba(16, 185, 129, 0.08);
}

[data-theme="dark"] .vax-next-hero--alert {
  border-color: rgba(248, 113, 113, 0.35);
  background: linear-gradient(135deg, rgba(127, 29, 29, 0.45) 0%, rgba(15, 23, 42, 0.95) 100%);
  box-shadow: inset 0 0 20px rgba(248, 113, 113, 0.08);
}

.vax-next-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 16px;
  color: #047857;
  background: rgba(16, 185, 129, 0.14);
  border: 1px solid rgba(16, 185, 129, 0.24);
}

.vax-next-hero--alert .vax-next-icon {
  color: #dc2626;
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.22);
}

.vax-next-icon .icon-lucide {
  width: 23px;
  height: 23px;
}

.vax-next-content {
  min-width: 0;
}

.vax-next-label {
  margin: 0 0 6px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--primary);
}

.vax-next-hero--alert .vax-next-label {
  color: #dc2626;
}

[data-theme="dark"] .vax-next-hero--alert .vax-next-label {
  color: #fca5a5;
}

.vax-next-name {
  margin: 0 0 8px;
  font-size: 1.25rem;
  font-weight: 800;
}

.vax-next-meta,
.vax-next-applied {
  margin: 0 0 8px;
  font-size: 13px;
  color: var(--muted);
}

.vax-next-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 0;
}

.vax-register-cta {
  min-height: 44px;
  padding-inline: 18px;
  box-shadow: 0 14px 26px color-mix(in srgb, var(--primary) 28%, transparent);
}

.vax-next-queue {
  list-style: none;
  margin: 16px 0 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.vax-next-queue li {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  font-size: 13px;
}

[data-theme="dark"] .vax-next-queue li {
  border-color: #334155;
  background: #1e293b;
}

.vax-next-empty {
  padding: 24px;
  text-align: center;
  border-radius: 12px;
  border: 1px dashed #cbd5e1;
}

[data-theme="dark"] .vax-next-empty {
  border-color: #475569;
}

/* Aba Histórico */

.vax-history-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.vax-search-field {
  position: relative;
  flex: 1;
  min-width: min(100%, 14rem);
}

.vax-search-field .icon-lucide {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--muted);
}

.vax-search-field input {
  width: 100%;
  min-height: 42px;
  padding-left: 38px;
  border-radius: 10px;
}

.vax-filter-overdue {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}

.vax-table-wrap {
  overflow-x: auto;
  border-radius: 10px;
  border: 1px solid #cbd5e1;
  background: #fafafa;
}

[data-theme="dark"] .vax-table-wrap {
  border-color: #475569;
  background: #020617;
}

.vax-schedule-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  table-layout: fixed;
}

.vax-schedule-table--grid {
  border: 1px solid #cbd5e1;
}

[data-theme="dark"] .vax-schedule-table--grid {
  border-color: #475569;
}

.vax-schedule-table thead {
  background: #f1f5f9;
}

[data-theme="dark"] .vax-schedule-table thead {
  background: #1e293b;
}

.vax-schedule-table th,
.vax-schedule-table td {
  border: 1px solid #e2e8f0;
  vertical-align: middle;
  text-align: center;
}

.vax-schedule-table th {
  padding: 9px 8px;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  border-bottom: 2px solid #cbd5e1;
}

[data-theme="dark"] .vax-schedule-table th {
  border-color: #334155;
  border-bottom-color: #64748b;
}

.vax-schedule-table td {
  padding: 9px 8px;
  line-height: 1.4;
}

.vax-th-sort {
  cursor: pointer;
  user-select: none;
  transition: background-color 0.18s ease, color 0.18s ease;
}

.vax-th-sort:hover {
  background: color-mix(in srgb, var(--primary) 8%, #f1f5f9);
  color: var(--text);
}

.vax-th-sort.is-active {
  background: color-mix(in srgb, var(--primary) 14%, #f1f5f9);
  color: var(--primary);
}

[data-theme="dark"] .vax-th-sort:hover {
  background: color-mix(in srgb, var(--primary) 12%, #1e293b);
}

[data-theme="dark"] .vax-th-sort.is-active {
  background: color-mix(in srgb, var(--primary) 18%, #1e293b);
  color: #6ee7b7;
}

.vax-th-sort__inner {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 100%;
}

.vax-th-sort__icon {
  font-size: 9px;
  line-height: 1;
  opacity: 0.45;
  transition: opacity 0.18s ease, color 0.18s ease;
}

.vax-th-sort.is-active .vax-th-sort__icon {
  opacity: 1;
  color: var(--primary);
}

[data-theme="dark"] .vax-th-sort.is-active .vax-th-sort__icon {
  color: #6ee7b7;
}

.vax-schedule-table tbody tr.vax-row--clickable {
  cursor: pointer;
}

.vax-schedule-table tbody tr.vax-row--clickable:hover td {
  background-color: color-mix(in srgb, var(--primary) 6%, transparent);
}

.vax-schedule-table tbody tr.vax-row--clickable:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: -2px;
}

.vax-cell-vaccine {
  min-width: 9rem;
  font-weight: 700;
  text-align: left;
  padding-left: 12px;
  padding-right: 10px;
  white-space: normal;
  word-break: normal;
}

.vax-cell-age,
.vax-cell-dose,
.vax-cell-date,
.vax-cell-status {
  white-space: nowrap;
}

.vax-cell-dose,
.vax-cell-status {
  text-align: center;
}

[data-theme="dark"] .vax-schedule-table td {
  border-color: #334155;
}

.vax-schedule-table tbody tr:last-child td {
  border-bottom: 1px solid #e2e8f0;
}

[data-theme="dark"] .vax-schedule-table tbody tr:last-child td {
  border-bottom-color: #334155;
}

.vax-model-card {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid #dbe4ef;
  border-radius: 12px;
  background: #fff;
}

[data-theme="dark"] .vax-model-card {
  border-color: #334155;
  background: #0f172a;
}

.vax-model-title {
  margin: 0;
  text-align: center;
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--text);
}

.vax-model-status-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 10px;
  border: 1px solid #dbe4ef;
  border-radius: 10px;
  background: #f8fafc;
}

[data-theme="dark"] .vax-model-status-bar {
  border-color: #334155;
  background: #111827;
}

.vax-model-status {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}

.vax-model-status--applied {
  background: #dcfce7;
  color: #14532d;
}

.vax-model-status--overdue {
  background: #fee2e2;
  color: #991b1b;
}

.vax-model-status--upcoming {
  background: #fef9c3;
  color: #854d0e;
}

.vax-model-hint {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.vax-model-table {
  min-width: 680px;
}

.vax-model-table th:nth-child(1),
.vax-model-table td:nth-child(1) {
  width: 34%;
}

.vax-model-table th:nth-child(2),
.vax-model-table td:nth-child(2) {
  width: 16%;
}

.vax-model-table th:nth-child(3),
.vax-model-table td:nth-child(3) {
  width: 14%;
}

.vax-model-table th:nth-child(4),
.vax-model-table td:nth-child(4) {
  width: 36%;
}

.vax-model-table .vax-cell-vaccine {
  min-width: 0;
  white-space: normal;
}

.vax-model-table .vax-cell-age,
.vax-model-table .vax-cell-dose {
  white-space: normal;
}

.vax-cell-observation {
  text-align: left !important;
  line-height: 1.35;
}

.vax-model-table tr.vax-row--overdue td {
  background: #fff7ed;
}

.vax-model-table tr.vax-row--applied td {
  background: #f0fdf4;
}

[data-theme="dark"] .vax-model-table tr.vax-row--overdue td {
  background: rgba(248, 113, 113, 0.12);
}

[data-theme="dark"] .vax-model-table tr.vax-row--applied td {
  background: rgba(16, 185, 129, 0.1);
}

.vax-model-table .vax-status-pill {
  margin-right: 6px;
  vertical-align: middle;
}

.vax-model-action {
  display: inline-flex;
  align-items: center;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #dcfce7;
  color: #047857;
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}

.vax-model-notes {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.vax-model-notes p {
  margin: 0;
}

.vax-model-signature {
  display: grid;
  justify-items: center;
  gap: 5px;
  margin-top: 8px;
  color: var(--text);
  font-size: 12px;
  text-align: center;
}

.vax-model-signature span {
  display: block;
  width: min(320px, 80%);
  border-top: 1px solid currentColor;
}

.vax-dose-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  background: #e0f2fe;
  color: #0369a1;
}

[data-theme="dark"] .vax-dose-tag {
  background: rgba(14, 165, 233, 0.2);
  color: #7dd3fc;
}

/* Marca-texto (status visual) */

.vax-cell-mark--applied,
.vax-row--applied td.vax-cell-mark--applied,
.vax-cell-date--applied,
td.vax-cell-mark--applied {
  background: #dcfce7 !important;
  color: #14532d;
}

[data-theme="dark"] .vax-cell-mark--applied,
[data-theme="dark"] .vax-row--applied td.vax-cell-mark--applied,
[data-theme="dark"] td.vax-cell-mark--applied {
  background: rgba(16, 185, 129, 0.22) !important;
  color: #a7f3d0;
  box-shadow: inset 0 0 0 1px rgba(52, 211, 153, 0.25);
}

.vax-cell-mark--overdue,
.vax-row--overdue td.vax-cell-mark--overdue,
td.vax-cell-mark--overdue {
  background: #fee2e2 !important;
  color: #7f1d1d;
}

[data-theme="dark"] .vax-cell-mark--overdue,
[data-theme="dark"] .vax-row--overdue td.vax-cell-mark--overdue,
[data-theme="dark"] td.vax-cell-mark--overdue {
  background: rgba(239, 68, 68, 0.18) !important;
  color: #fecaca;
  box-shadow: inset 0 0 0 1px rgba(248, 113, 113, 0.2);
}

.vax-cell-mark--upcoming {
  background: #fef9c3 !important;
  color: #713f12;
}

[data-theme="dark"] .vax-cell-mark--upcoming {
  background: rgba(250, 204, 21, 0.15) !important;
  color: #fde68a;
}

.vax-status-pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.vax-cell--applied {
  background: #bbf7d0;
  color: #14532d;
}

.vax-cell--overdue {
  background: #fecaca;
  color: #991b1b;
}

.vax-cell--upcoming {
  background: #fde68a;
  color: #92400e;
}

[data-theme="dark"] .vax-cell--applied {
  background: rgba(16, 185, 129, 0.35);
  color: #6ee7b7;
  box-shadow: 0 0 10px rgba(52, 211, 153, 0.25);
}

[data-theme="dark"] .vax-cell--overdue {
  background: rgba(239, 68, 68, 0.3);
  color: #fca5a5;
}

[data-theme="dark"] .vax-cell--upcoming {
  background: rgba(250, 204, 21, 0.25);
  color: #fde68a;
}

.vax-table-empty {
  text-align: center;
  padding: 24px !important;
  color: var(--muted);
}

/* Aba Configurações */

.vax-config {
  max-width: min(40rem, 100%);
  margin: 0 auto;
}

.vax-config-editor {
  margin-bottom: 16px;
  padding: 14px;
  border-radius: 12px;
  border: 1px dashed var(--line);
  background: var(--surface-soft);
}

.vax-config-editor-title {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 800;
}

.vax-config-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 10px;
}

.vax-config-editor-actions {
  display: flex;
  justify-content: center;
  margin-top: 4px;
}

.vax-config-editor-actions .secondary {
  min-width: min(100%, 220px);
}

.vax-config-form label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
}

.vax-config-form input {
  min-height: 40px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--input-bg);
}

.vax-config-row {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
}

.vax-accordion--overdue-action .vax-acc-summary {
  cursor: pointer;
  grid-template-columns: minmax(0, 1fr) auto;
}

.vax-acc-quick-hint {
  grid-column: 1 / -1;
  justify-self: end;
  margin: 2px 0 0;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #b91c1c;
  white-space: nowrap;
}

[data-theme="dark"] .vax-acc-quick-hint {
  color: #fca5a5;
}

.vax-config-row-actions {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.vax-config-item-text {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 2px;
  min-width: 0;
  line-height: 1.35;
  text-align: left;
}

.vax-config-item-name {
  display: block;
  font-size: 13px;
  font-weight: 800;
  color: var(--text);
}

.vax-config-item-meta {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

.admin-audit-top {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}

.audit-details {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
  overflow: hidden;
}

.audit-details summary {
  list-style: none;
}

.audit-details summary::-webkit-details-marker {
  display: none;
}

.audit-details-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 12px;
  padding: 10px 12px;
  cursor: pointer;
  font-weight: 800;
}

.audit-details-summary-title {
  font-size: 13px;
  color: var(--primary-dark);
}

[data-theme="dark"] .audit-details-summary-title {
  color: #6ee7b7;
}

.audit-details-summary-meta {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
}

.audit-details[open] .audit-details-summary {
  border-bottom: 1px solid var(--line);
}

.audit-details--open {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
}

.register-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.register-divider::before,
.register-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.register-google-box {
  display: flex;
  justify-content: center;
  width: 100%;
}

.vax-config-list {
  list-style: none;
  margin: 12px auto 0;
  padding: 0;
  width: 100%;
  max-height: min(52vh, 420px);
  overflow-y: auto;
  display: grid;
  gap: 8px;
}

.vax-config-item {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  flex: 1 1 auto;
  min-width: 0;
  width: auto;
  max-width: 100%;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  box-sizing: border-box;
}

.vax-config-item-check {
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  min-width: 18px;
  min-height: 18px;
  margin: 0;
  accent-color: var(--primary);
  cursor: pointer;
}

.vax-config-row--custom .vax-config-item {
  border-color: color-mix(in srgb, var(--primary) 35%, #e2e8f0);
}

[data-theme="dark"] .vax-config-item {
  border-color: #334155;
  background: #1e293b;
}

@media (max-width: 640px) {
  .vax-config-row {
    flex-wrap: wrap;
  }

  .vax-config-row-actions {
    width: 100%;
    justify-content: center;
  }
}

.vax-config-birth {
  margin: 10px 0 0;
  font-size: 13px;
}

.vax-config-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.vax-config-actions .primary,
.vax-config-actions .secondary {
  width: min(100%, 280px);
  min-height: 44px;
  justify-content: center;
  text-align: center;
}

.vax-config-actions .primary {
  order: -1;
}

.vax-config-print-bar {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 12px 0 16px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
}

[data-theme="dark"] .vax-config-print-bar {
  border-color: #334155;
  background: #0f172a;
}

.vax-config-print-hint {
  margin: 0;
  font-size: 12px;
}

.vax-config-rule-details {
  margin: 8px 0 0 36px;
  font-size: 12px;
}

.vax-config-rule-details summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--primary);
  list-style-position: outside;
}

.vax-config-rule-fields {
  display: grid;
  gap: 10px;
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px dashed #cbd5e1;
  background: #fff;
}

[data-theme="dark"] .vax-config-rule-fields {
  border-color: #475569;
  background: #1e293b;
}

.vax-config-rule-field {
  display: grid;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
}

.vax-config-rule-field input,
.vax-config-rule-field select {
  min-height: 38px;
  font-weight: 500;
}

.vax-config-rule-hint {
  margin: 0;
  font-size: 11px;
}

.vax-print-patient {
  margin: 12pt 0 14pt;
  padding: 8pt 10pt;
  border: 1px solid #000;
  font-size: 10pt;
  line-height: 1.45;
}

.vax-print-patient p {
  margin: 0 0 4pt;
}

.vax-print-interval {
  font-size: 9pt;
  font-weight: 600;
  color: #334155;
}

.vax-print-source {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.vax-cell--pulse,
.vax-acc-header--pulse .vax-acc-status {
  animation: vaxOverduePulse 1.45s ease-in-out infinite;
}

@keyframes vaxOverduePulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4);
  }
  50% {
    box-shadow: 0 0 0 7px rgba(239, 68, 68, 0);
  }
}

.vax-mobile-accordions {
  display: none;
  gap: 8px;
}

.vax-table-wrap--desktop {
  display: block;
}

.vax-accordion {
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  overflow: hidden;
}

.vax-acc-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 10px;
  align-items: center;
  padding: 12px 14px;
  cursor: pointer;
  list-style: none;
}

.vax-acc-summary::-webkit-details-marker {
  display: none;
}

.vax-acc-title {
  font-weight: 800;
  font-size: 14px;
  grid-column: 1;
}

.vax-acc-meta {
  font-size: 11px;
  color: var(--muted);
  grid-column: 1;
}

.vax-acc-status {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: center;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  padding: 4px 8px;
  border-radius: 999px;
}

.vax-acc-header--applied {
  background: #ecfdf5;
}

.vax-acc-header--applied .vax-acc-status {
  background: #bbf7d0;
  color: #14532d;
}

.vax-acc-header--overdue {
  background: #fef2f2;
}

.vax-acc-header--overdue .vax-acc-status {
  background: #fecaca;
  color: #991b1b;
}

.vax-acc-header--upcoming {
  background: #fffbeb;
}

.vax-acc-header--upcoming .vax-acc-status {
  background: #fde68a;
  color: #92400e;
}

[data-theme="dark"] .vax-acc-header--applied {
  background: rgba(16, 185, 129, 0.15);
}

[data-theme="dark"] .vax-acc-header--applied .vax-acc-status {
  background: rgba(16, 185, 129, 0.35);
  color: #6ee7b7;
  box-shadow: 0 0 10px rgba(52, 211, 153, 0.2);
}

[data-theme="dark"] .vax-acc-header--overdue {
  background: rgba(127, 29, 29, 0.35);
}

[data-theme="dark"] .vax-acc-header--overdue .vax-acc-status {
  background: rgba(239, 68, 68, 0.35);
  color: #fca5a5;
}

.vax-acc-body {
  padding: 0 14px 14px;
  border-top: 1px solid var(--line);
}

.vax-acc-details {
  margin: 12px 0 0;
  display: grid;
  gap: 10px;
}

.vax-acc-details > div {
  display: grid;
  gap: 2px;
}

.vax-acc-details dt {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--muted);
}

.vax-acc-details dd {
  margin: 0;
  font-size: 13px;
}

.vax-acc-signature dd {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.vax-acc-signature .nursing-qr-svg {
  width: 44px;
  height: 44px;
  opacity: 0.5;
}

.vax-acc-actions {
  margin-top: 10px;
}

@media (max-width: 767px) {
  .vax-mobile-accordions {
    display: grid;
  }

  .vax-table-wrap--desktop {
    display: none !important;
  }
}

@media (max-width: 640px) {
  .vaccine-card {
    border-radius: 18px;
  }

  .vaccine-card-intro,
  .vaccine-tabs-sticky,
  .vaccine-card-tabs,
  .vaccine-card-meta {
    padding-left: 14px;
    padding-right: 14px;
  }

  .vaccine-card-intro {
    padding-top: 14px;
  }

  .vaccine-card-panel {
    padding: 14px;
  }

  .vaccine-inner-tab {
    font-size: 11px;
    padding: 8px 10px;
  }

  .vaccine-status-strip {
    gap: 6px;
  }

  .vax-next-hero {
    grid-template-columns: 1fr;
    text-align: left;
  }

  .vax-next-icon {
    width: 44px;
    height: 44px;
  }

  .vax-next-actions,
  .vax-next-actions .primary,
  .vax-next-actions .ghost {
    width: 100%;
  }
}
}

/* —— Ultra-wide, notebook, tablet —— */

@media (min-width: 1200px) {
  .profile-layout,
  .profile-chrome-sticky,
  .profile-sticky-nav,
  .profile-head,
  .profile-content {
    max-width: min(1100px, 94vw);
  }
}

@media (min-width: 1600px) {
  .profile-layout,
  .profile-chrome-sticky,
  .profile-sticky-nav,
  .profile-head,
  .profile-content {
    max-width: min(1280px, 92vw);
  }

  .vaccine-card,
  .nursing-workspace {
    max-width: min(96rem, 100%);
  }

  .dashboard-panel {
    max-width: min(1600px, 96vw);
    margin: 0 auto;
  }
}

@media (min-width: 2000px) {
  .children-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

/* —— Segurança: PII, marca d'água, hardening —— */

body:not(.pii-revealed) .pii-field,
body:not(.pii-revealed) .child-card-name,
body:not(.pii-revealed) .vaccine-card-name,
body:not(.pii-revealed) .profile-intro h2 {
  filter: blur(5px);
  user-select: none;
}

body.pii-revealed .pii-field,
body.pii-revealed .child-card-name,
body.pii-revealed .vaccine-card-name,
body.pii-revealed .profile-intro h2 {
  filter: none;
}

.navbar-pii-toggle {
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.security-watermark-layer {
  pointer-events: none;
  position: absolute;
  inset: 0;
  z-index: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease;
  background-image: repeating-linear-gradient(
    -24deg,
    transparent,
    transparent 120px,
    rgba(15, 23, 42, 0.12) 120px,
    rgba(15, 23, 42, 0.12) 121px
  );
}

body.pii-revealed .security-watermark-layer {
  opacity: 0.07;
  visibility: visible;
}

.security-watermark-layer::after {
  content: attr(data-watermark);
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12%;
  font-size: clamp(11px, 1.6vw, 15px);
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.35;
  text-align: center;
  color: #64748b;
  transform: rotate(-18deg);
  white-space: normal;
  overflow: hidden;
}

[data-theme="dark"] .security-watermark-layer::after {
  color: #94a3b8;
}

body.devtools-detected::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 10000;
  pointer-events: none;
  background: rgba(15, 23, 42, 0.04);
}

/* Tour de onboarding (Driver.js) — UI pediátrica dark / glass */
body.onboarding-tour-active .modal-backdrop {
  z-index: 1200;
}

body.driver-active .driver-overlay {
  z-index: 1000000000 !important;
}

body.driver-active .driver-active-element {
  z-index: 1000000001 !important;
  border-radius: 16px !important;
  box-shadow: 0 0 0 2px rgba(52, 211, 153, 0.45), 0 0 32px rgba(16, 185, 129, 0.2);
}

body.driver-active .driver-popover,
body.driver-active #driver-popover-content,
body.driver-active .driver-popover *,
body.driver-active #driver-popover-content * {
  pointer-events: auto !important;
}

.driver-popover.abrigo-driver-popover,
#driver-popover-content.abrigo-driver-popover {
  --tour-bg: #0f172a;
  --tour-glass: rgba(15, 23, 42, 0.82);
  --tour-border: rgba(148, 163, 184, 0.22);
  --tour-emerald: #34d399;
  --tour-emerald-deep: #10b981;
  --tour-text: #f1f5f9;
  --tour-muted: #94a3b8;
  z-index: 1000000002 !important;
  width: min(440px, calc(100vw - 28px)) !important;
  max-width: min(440px, calc(100vw - 28px));
  padding: 0 !important;
  border-radius: 16px !important;
  font-family: "Inter", "DM Sans", system-ui, sans-serif;
  color: var(--tour-text);
  background: var(--tour-glass) !important;
  border: 1px solid var(--tour-border) !important;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.04) inset,
    0 24px 48px rgba(2, 6, 23, 0.55),
    0 8px 24px rgba(15, 23, 42, 0.4) !important;
  isolation: isolate;
  overflow: hidden;
}

.abrigo-tour-chrome {
  padding: 14px 16px 0;
}

.abrigo-tour-progress {
  height: 3px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.2);
  overflow: hidden;
  margin-bottom: 10px;
}

.abrigo-tour-progress__fill {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--tour-emerald-deep), var(--tour-emerald));
  box-shadow: 0 0 12px rgba(52, 211, 153, 0.55);
  transition: width 0.35s ease;
}

.abrigo-tour-step-label {
  margin: 0 0 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--tour-emerald);
}

.driver-popover.abrigo-driver-popover .driver-popover-title,
#driver-popover-content.abrigo-driver-popover .driver-popover-title {
  display: block !important;
  margin: 0;
  padding: 4px 18px 0;
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: -0.02em;
  color: var(--tour-text);
}

.driver-popover.abrigo-driver-popover .driver-popover-description,
#driver-popover-content.abrigo-driver-popover .driver-popover-description {
  display: block !important;
  margin: 0;
  padding: 10px 18px 4px;
  font-size: 0.9375rem;
  font-weight: 400;
  line-height: 1.65;
  color: var(--tour-muted);
}

.driver-popover.abrigo-driver-popover .driver-popover-description strong {
  color: var(--tour-text);
  font-weight: 600;
}

.driver-popover.abrigo-driver-popover .driver-popover-progress-text,
#driver-popover-content.abrigo-driver-popover .driver-popover-progress-text {
  display: none !important;
}

.driver-popover.abrigo-driver-popover .driver-popover-footer,
#driver-popover-content.abrigo-driver-popover .driver-popover-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin: 0;
  padding: 14px 16px 16px;
  border-top: 1px solid rgba(148, 163, 184, 0.12);
  background: rgba(2, 6, 23, 0.28);
}

.driver-popover.abrigo-driver-popover .driver-popover-navigation-btns,
#driver-popover-content.abrigo-driver-popover .driver-popover-navigation-btns {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
  width: 100%;
  justify-content: flex-end;
}

.driver-popover.abrigo-driver-popover .driver-popover-footer button,
#driver-popover-content.abrigo-driver-popover .driver-popover-footer button {
  all: unset;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  min-height: 42px;
  padding: 0 18px;
  border-radius: 999px;
  text-shadow: none;
  cursor: pointer;
  pointer-events: auto !important;
  position: relative;
  z-index: 1;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.15s ease;
}

.driver-popover.abrigo-driver-popover .driver-popover-next-btn,
#driver-popover-content.abrigo-driver-popover .driver-popover-next-btn {
  min-width: 118px;
  background: linear-gradient(135deg, var(--tour-emerald-deep), var(--tour-emerald));
  color: #042f2e;
  border: none;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
}

.driver-popover.abrigo-driver-popover .driver-popover-next-btn:hover,
#driver-popover-content.abrigo-driver-popover .driver-popover-next-btn:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
}

.driver-popover.abrigo-driver-popover .driver-popover-prev-btn,
#driver-popover-content.abrigo-driver-popover .driver-popover-prev-btn {
  min-width: 100px;
  background: transparent;
  color: var(--tour-muted);
  border: 1px solid rgba(148, 163, 184, 0.35);
}

.driver-popover.abrigo-driver-popover .driver-popover-prev-btn:hover:not(:disabled),
#driver-popover-content.abrigo-driver-popover .driver-popover-prev-btn:hover:not(:disabled) {
  color: var(--tour-text);
  border-color: rgba(148, 163, 184, 0.55);
  background: rgba(148, 163, 184, 0.08);
}

.driver-popover.abrigo-driver-popover .driver-popover-prev-btn:disabled,
.driver-popover.abrigo-driver-popover .driver-popover-btn-disabled,
#driver-popover-content.abrigo-driver-popover .driver-popover-prev-btn:disabled,
#driver-popover-content.abrigo-driver-popover .driver-popover-btn-disabled {
  opacity: 0.35;
  pointer-events: none !important;
}

.driver-popover.abrigo-driver-popover .driver-popover-close-btn,
#driver-popover-content.abrigo-driver-popover .driver-popover-close-btn {
  all: unset;
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: auto;
  min-height: auto;
  padding: 4px 8px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--tour-muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.2;
  cursor: pointer;
  pointer-events: auto !important;
}

.driver-popover.abrigo-driver-popover .driver-popover-close-btn:hover,
#driver-popover-content.abrigo-driver-popover .driver-popover-close-btn:hover {
  color: var(--tour-text);
  background: rgba(148, 163, 184, 0.1);
}

.driver-popover.abrigo-driver-popover .driver-popover-arrow,
#driver-popover-content.abrigo-driver-popover .driver-popover-arrow {
  border-color: var(--tour-glass);
}

@media (max-width: 640px) {
  .driver-popover.abrigo-driver-popover,
  #driver-popover-content.abrigo-driver-popover {
    left: 14px !important;
    right: 14px !important;
    width: auto !important;
    max-width: none;
  }

  .driver-popover.abrigo-driver-popover .driver-popover-navigation-btns,
  #driver-popover-content.abrigo-driver-popover .driver-popover-navigation-btns {
    flex-wrap: wrap;
  }

  .driver-popover.abrigo-driver-popover .driver-popover-footer button,
  #driver-popover-content.abrigo-driver-popover .driver-popover-footer button {
    flex: 1 1 calc(50% - 6px);
    min-width: 0;
  }
}

@media print {
  .security-watermark-layer,
  .navbar-pii-toggle,
  .navbar-notifications-mount,
  .driver-overlay,
  .driver-popover {
    display: none !important;
  }
}

/* —— Meu perfil (layout rede social) —— */

.account-profile-backdrop .account-profile-modal {
  position: relative;
  width: min(640px, calc(100vw - 24px));
  max-height: min(92vh, 960px);
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.account-profile {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
}

.account-profile-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 5;
  width: 36px;
  height: 36px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(15, 23, 42, 0.45);
  color: #fff;
  backdrop-filter: blur(8px);
  cursor: pointer;
}

.account-profile-close:hover {
  background: rgba(15, 23, 42, 0.65);
}

.account-profile-close .icon-lucide,
.account-profile-close svg {
  width: 18px;
  height: 18px;
}

[data-theme="dark"] .account-profile-close {
  background: rgba(0, 0, 0, 0.55);
  border-color: rgba(255, 255, 255, 0.2);
}

.account-profile-hero {
  position: relative;
  flex-shrink: 0;
}

.account-profile-hero__cover {
  height: 120px;
  background: linear-gradient(135deg, #0ea5e9 0%, #6366f1 55%, #8b5cf6 100%);
}

[data-theme="dark"] .account-profile-hero__cover {
  background: linear-gradient(135deg, #0369a1 0%, #4338ca 55%, #6d28d9 100%);
}

.account-profile-hero__body {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 0 20px 18px;
  margin-top: -36px;
  gap: 12px;
}

.account-profile-hero__avatar-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.account-profile-avatar {
  width: 104px;
  height: 104px;
  border-radius: 50%;
  overflow: hidden;
  border: 4px solid #fff;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.22);
  background: var(--surface-2, #e2e8f0);
  display: grid;
  place-items: center;
}

[data-theme="dark"] .account-profile-avatar {
  border-color: #0f172a;
}

.account-profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.account-profile-initials {
  font-size: 2rem;
  font-weight: 800;
  color: #fff;
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  background: hsl(var(--avatar-hue, 210) 55% 42%);
}

.account-profile-photo-btn {
  font-size: 12px;
  padding: 6px 14px;
  min-height: 36px;
}

.account-profile-hero__eyebrow {
  margin: 0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.account-profile-hero__name {
  margin: 4px 0 0;
  font-size: 1.45rem;
  line-height: 1.2;
}

.account-profile-hero__login {
  margin: 6px 0 0;
  font-size: 14px;
  color: var(--text);
}

.account-profile-hero__email {
  margin: 2px 0 0;
  font-size: 13px;
}

.account-profile-hero__role {
  margin: 6px 0 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
}

.account-profile-hero__meta {
  margin: 4px 0 0;
  font-size: 14px;
  color: var(--muted);
}

.account-profile-hero__badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 12px;
}

.account-profile-hero__coren {
  margin: 8px 0 0;
  font-size: 13px;
}

.account-profile-required-banner {
  margin: 0;
  padding: 10px 16px;
  background: rgba(245, 158, 11, 0.15);
  border-top: 1px solid rgba(245, 158, 11, 0.35);
  font-size: 13px;
  text-align: center;
}

.account-profile-scroll {
  flex: 1;
  overflow: auto;
  padding: 8px 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.account-profile-footer {
  flex-shrink: 0;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  background: var(--surface);
  position: sticky;
  bottom: 0;
  z-index: 2;
}

.account-profile-footer .primary,
.account-profile-footer .secondary,
.account-profile-footer .ghost {
  min-height: 42px;
}

.account-profile-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  padding: 16px;
  box-shadow: var(--shadow-sm, 0 1px 3px rgba(15, 23, 42, 0.06));
}

.account-profile-card__head {
  margin-bottom: 14px;
}

.account-profile-card__head h3 {
  margin: 0 0 6px;
  font-size: 1rem;
}

.account-profile-card__lead {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
}

.account-profile-guide-hint {
  margin: 8px 0 0;
  font-size: 12px;
}

.account-profile-form {
  gap: 12px;
}

.account-profile-form--confirm {
  margin-top: 12px;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
}

.account-profile-form__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.account-profile-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.account-profile-card__actions--stack {
  flex-direction: column;
}

.account-profile-card__actions--stack .primary,
.account-profile-card__actions--stack .secondary {
  width: 100%;
  justify-content: center;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.account-profile-card--guide {
  background: linear-gradient(180deg, rgba(14, 165, 233, 0.08), transparent);
}

.account-profile-hint {
  margin: 0;
  font-size: 12px;
}

.success-hint {
  margin: 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.35);
  color: var(--text);
  font-size: 13px;
}

@media (min-width: 560px) {
  .account-profile-hero__body {
    flex-direction: row;
    text-align: left;
    align-items: flex-end;
    margin-top: -32px;
    padding-inline: 24px;
  }

  .account-profile-hero__avatar-wrap {
    align-items: flex-start;
  }

  .account-profile-hero__badges {
    justify-content: flex-start;
  }

  .account-profile-hero__identity {
    flex: 1;
    padding-bottom: 4px;
  }
}

/* Chrome da página em fluxo normal — rola com o conteúdo */
.app-header-sticky,
.app-navbar,
.dashboard-pin-bar,
.profile-chrome-sticky,
.profile-sticky-nav,
.profile-sticky-nav__inner,
.profile-sticky-nav__top,
.dashboard-home-tabs,
.dashboard-command,
.dashboard-filters-scroll,
.app-bottom-nav {
  position: relative !important;
  top: auto !important;
  bottom: auto !important;
  left: auto !important;
  right: auto !important;
  z-index: auto !important;
}

.profile-chrome-spacer,
.dashboard-pin-wrap,
.profile-sticky-sentinel {
  display: none !important;
  min-height: 0 !important;
}

/* Ajustes finais de impressao A4: tabelas anuais e controladas */
@media print {
  @page {
    margin: 0.55cm;
  }

  body.antibiotics-print-mode .annual-book-print-sheet,
  body.appointments-print-mode .annual-book-print-sheet,
  body.hospital-events-print-mode .annual-book-print-sheet,
  body.growth-print-mode .annual-book-print-sheet,
  body.prescriptions-print-mode .annual-book-print-sheet {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    border-width: 1px !important;
    box-sizing: border-box !important;
  }

  body.antibiotics-print-mode .annual-book-print-sheet .official-gov-letterhead,
  body.appointments-print-mode .annual-book-print-sheet .official-gov-letterhead,
  body.hospital-events-print-mode .annual-book-print-sheet .official-gov-letterhead,
  body.growth-print-mode .annual-book-print-sheet .official-gov-letterhead,
  body.prescriptions-print-mode .annual-book-print-sheet .official-gov-letterhead,
  body.controlled-print-mode .controlled-print-root .official-gov-letterhead,
  body.vaccine-print-mode .vaccine-print-root .official-gov-letterhead {
    margin: 0 0 4mm !important;
  }

  body.antibiotics-print-mode .annual-book-print-sheet .official-gov-logo,
  body.appointments-print-mode .annual-book-print-sheet .official-gov-logo,
  body.hospital-events-print-mode .annual-book-print-sheet .official-gov-logo,
  body.growth-print-mode .annual-book-print-sheet .official-gov-logo,
  body.prescriptions-print-mode .annual-book-print-sheet .official-gov-logo,
  body.controlled-print-mode .controlled-print-root .official-gov-logo,
  body.vaccine-print-mode .vaccine-print-root .official-gov-logo {
    width: 24mm !important;
    height: 12mm !important;
    margin: 0 auto 2.5mm !important;
  }

  body.antibiotics-print-mode .annual-book-print-sheet .official-print-child-id__line,
  body.appointments-print-mode .annual-book-print-sheet .official-print-child-id__line,
  body.hospital-events-print-mode .annual-book-print-sheet .official-print-child-id__line,
  body.growth-print-mode .annual-book-print-sheet .official-print-child-id__line,
  body.prescriptions-print-mode .annual-book-print-sheet .official-print-child-id__line,
  body.controlled-print-mode .controlled-print-root .official-print-child-id__line,
  body.vaccine-print-mode .vaccine-print-root .official-print-child-id__line {
    margin: 0 0 1.45mm !important;
    font-size: 8.4pt !important;
    line-height: 1.12 !important;
  }

  body.antibiotics-print-mode .annual-book-print-sheet table,
  body.appointments-print-mode .annual-book-print-sheet table,
  body.hospital-events-print-mode .annual-book-print-sheet table,
  body.growth-print-mode .annual-book-print-sheet table,
  body.prescriptions-print-mode .annual-book-print-sheet table {
    width: 100% !important;
    max-width: 100% !important;
    table-layout: fixed !important;
    border-collapse: collapse !important;
    font-size: 4.9pt !important;
  }

  body.antibiotics-print-mode .annual-book-print-sheet th,
  body.antibiotics-print-mode .annual-book-print-sheet td,
  body.appointments-print-mode .annual-book-print-sheet th,
  body.appointments-print-mode .annual-book-print-sheet td,
  body.hospital-events-print-mode .annual-book-print-sheet th,
  body.hospital-events-print-mode .annual-book-print-sheet td,
  body.growth-print-mode .annual-book-print-sheet th,
  body.growth-print-mode .annual-book-print-sheet td,
  body.prescriptions-print-mode .annual-book-print-sheet th,
  body.prescriptions-print-mode .annual-book-print-sheet td {
    padding: 1.6px 1px !important;
    line-height: 1.02 !important;
    overflow: hidden !important;
    overflow-wrap: anywhere !important;
    word-break: break-word !important;
    white-space: normal !important;
    hyphens: auto !important;
  }

  body.antibiotics-print-mode .annual-book-print-sheet .abx-sector-col,
  body.hospital-events-print-mode .annual-book-print-sheet .hosp-sector-col,
  body.growth-print-mode .annual-book-print-sheet .gro-sector-col {
    width: 8% !important;
  }

  body.antibiotics-print-mode .annual-book-print-sheet .abx-patient-name,
  body.hospital-events-print-mode .annual-book-print-sheet .hosp-patient-name,
  body.growth-print-mode .annual-book-print-sheet .gro-patient-name {
    width: 10.5% !important;
    font-size: 5.1pt !important;
  }

  body.appointments-print-mode .annual-book-print-sheet .apt-sector-col {
    width: 6.5% !important;
  }

  body.appointments-print-mode .annual-book-print-sheet .apt-patient-name {
    width: 9.5% !important;
    font-size: 5pt !important;
  }

  body.antibiotics-print-mode .annual-book-print-sheet .abx-month-col,
  body.antibiotics-print-mode .annual-book-print-sheet .abx-month-cell,
  body.hospital-events-print-mode .annual-book-print-sheet .hosp-month-col,
  body.hospital-events-print-mode .annual-book-print-sheet .hosp-month-cell,
  body.growth-print-mode .annual-book-print-sheet .gro-month-col,
  body.growth-print-mode .annual-book-print-sheet .gro-month-cell {
    width: 6.79% !important;
  }

  body.appointments-print-mode .annual-book-print-sheet .apt-month-col,
  body.appointments-print-mode .annual-book-print-sheet .apt-month-cell,
  body.appointments-print-mode .annual-book-print-sheet .apt-prev-col,
  body.appointments-print-mode .annual-book-print-sheet .apt-prev-cell {
    width: 6.46% !important;
  }

  body.antibiotics-print-mode .annual-book-print-sheet :where(.annual-cell-card, .abx-date-range, .abx-drug, .abx-meta, .abx-prescriber, .abx-notes),
  body.appointments-print-mode .annual-book-print-sheet :where(.annual-cell-card, .apt-date-chip, .apt-specialty, .apt-doctor, .apt-status-note, .apt-location),
  body.hospital-events-print-mode .annual-book-print-sheet :where(.annual-cell-card, .hosp-date-chip, .hosp-action-line, .hosp-internada-flag, .hosp-diagnosis),
  body.growth-print-mode .annual-book-print-sheet :where(.annual-cell-card, .gro-triplet, .gro-p-line, .gro-e-line, .gro-imc-line),
  body.prescriptions-print-mode .annual-book-print-sheet :where(.presc-annual-table span, .presc-annual-table div) {
    max-width: 100% !important;
    min-width: 0 !important;
    padding-left: 1px !important;
    padding-right: 1px !important;
    overflow: hidden !important;
    overflow-wrap: anywhere !important;
    word-break: break-word !important;
    white-space: normal !important;
    line-height: 1.02 !important;
    font-size: 4.75pt !important;
  }

  body.antibiotics-print-mode .annual-book-print-sheet .abx-date-range,
  body.appointments-print-mode .annual-book-print-sheet .apt-date-chip,
  body.hospital-events-print-mode .annual-book-print-sheet .hosp-date-chip,
  body.hospital-events-print-mode .annual-book-print-sheet .hosp-internada-flag {
    display: block !important;
    border-radius: 2px !important;
    text-align: center !important;
  }

  body.controlled-print-mode .controlled-med-sheet,
  body.controlled-print-mode .controlled-med-book-panel,
  body.controlled-print-mode .controlled-print-root {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
    border-width: 1px !important;
  }

  body.controlled-print-mode .controlled-med-table {
    width: 100% !important;
    table-layout: fixed !important;
    font-size: 7.2pt !important;
  }

  body.controlled-print-mode .controlled-med-table th,
  body.controlled-print-mode .controlled-med-table td {
    padding: 3px 4px !important;
    line-height: 1.12 !important;
    overflow: hidden !important;
    overflow-wrap: anywhere !important;
    word-break: break-word !important;
    white-space: normal !important;
  }

  body.controlled-print-mode .controlled-med-table--with-disp .controlled-med-cell--name {
    width: 31% !important;
  }

  body.controlled-print-mode .controlled-med-table--with-disp .controlled-med-cell--dose {
    width: 13% !important;
  }

  body.controlled-print-mode .controlled-med-table--with-disp .controlled-med-cell--rx {
    width: 22% !important;
  }

  body.controlled-print-mode .controlled-med-table--with-disp .controlled-med-cell--disp {
    width: 34% !important;
  }

body.controlled-print-mode .controlled-med-row--blank .controlled-med-cell {
  height: 8mm !important;
  background: #fff !important;
}

body.controlled-print-mode .controlled-med-doc-title {
  padding: 6px 8px !important;
  font-size: 10pt !important;
}
}
