:root {
  --green: #84c6a0;
  --dark: #0e4345;
  --dark-2: #0a3436;
  --primary: #0e4345;
  --ink: #202631;
  --muted: #6e7480;
  --line: #e3e7ee;
  --line-strong: #c9d1dc;
  --soft: #f4f6fb;
  --bg: #ffffff;
  --white: #ffffff;
  --shadow: 0 12px 30px rgba(25, 32, 45, 0.08);
  --shadow-soft: 0 6px 18px rgba(25, 32, 45, 0.06);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: #fff;
  color: var(--ink);
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  line-height: 1.45;
}

a {
  color: var(--dark);
  text-decoration: none;
}

.sidebar {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent 34%),
    linear-gradient(160deg, var(--dark), var(--dark-2));
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 12px 0 35px rgba(1, 52, 55, 0.14);
  color: var(--white);
  display: flex;
  flex-direction: column;
  gap: 22px;
  height: 100vh;
  left: 0;
  padding: 20px 16px;
  position: fixed;
  top: 0;
  width: 260px;
  z-index: 10;
}

.brand {
  align-items: center;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  display: flex;
  gap: 12px;
  padding: 12px;
}

.brand strong {
  display: block;
  font-size: 21px;
  line-height: 1.1;
}

.brand span {
  color: #cce8df;
  display: block;
  font-size: 13px;
  margin-top: 3px;
}

.brand-logo {
  background: var(--white);
  border-radius: 8px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.16);
  flex: 0 0 auto;
  height: 62px;
  object-fit: contain;
  padding: 6px;
  width: 62px;
}

.user-box {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  display: grid;
  gap: 4px;
  margin-top: auto;
  padding: 12px;
}

.user-box span {
  color: var(--white);
  font-weight: 700;
}

.user-box small {
  color: #cce8df;
}

.user-box a {
  color: var(--white);
  font-weight: 700;
  margin-top: 8px;
}

.logout-link {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  display: inline-flex;
  justify-content: center;
  padding: 8px 10px;
}

nav {
  display: grid;
  gap: 7px;
}

nav a {
  align-items: center;
  border: 1px solid transparent;
  border-radius: 8px;
  color: #e8f6f3;
  display: flex;
  font-size: 13.5px;
  font-weight: 500;
  gap: 10px;
  letter-spacing: 0.01em;
  min-height: 44px;
  padding: 9px 10px;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

nav a::before {
  align-items: center;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  color: #fff;
  content: attr(data-icon);
  display: inline-flex;
  flex: 0 0 34px;
  font-size: 12px;
  height: 34px;
  justify-content: center;
}

nav a:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.12);
  transform: translateX(2px);
}

nav a.active {
  background: #fff;
  border-color: rgba(255, 255, 255, 0.28);
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.16);
  color: var(--dark);
}

nav a.active::before {
  background: var(--dark);
  border-color: var(--dark);
}

.main {
  margin-left: 260px;
  min-height: 100vh;
  padding: 30px;
}

.sidebar {
  align-items: center;
  background: #fff;
  border-bottom: 1px solid var(--line);
  border-right: 0;
  box-shadow: 0 4px 14px rgba(25, 32, 45, 0.06);
  color: var(--ink);
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(172px, 186px) minmax(0, 1fr) auto;
  height: auto;
  min-height: 70px;
  overflow: hidden;
  padding: 10px 20px;
  position: sticky;
  width: 100%;
}

.brand {
  background: #fff;
  border: 1px solid var(--line);
  flex: 0 0 auto;
  min-width: 186px;
  padding: 8px 10px;
}

.brand-logo {
  box-shadow: none;
  height: 42px;
  width: 42px;
}

.brand strong {
  color: var(--ink);
  font-size: 17px;
  font-weight: 800;
}

.brand span {
  color: var(--muted);
  font-size: 12px;
}

nav {
  align-items: center;
  display: flex;
  flex: 1 1 auto;
  gap: 5px;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 2px;
  scrollbar-width: thin;
  scroll-behavior: smooth;
}

nav::-webkit-scrollbar {
  height: 4px;
}

nav::-webkit-scrollbar-thumb {
  background: #d8e7e2;
  border-radius: 999px;
}

nav a {
  color: var(--ink);
  flex: 0 0 auto;
  font-size: 14px;
  font-weight: 700;
  min-height: 40px;
  padding: 8px 11px;
  white-space: nowrap;
}

nav .nav-link {
  align-items: center;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--ink);
  flex: 0 0 auto;
  font-size: 14px;
  font-weight: 700;
  min-height: 40px;
  padding: 8px 11px;
  white-space: nowrap;
}

nav a::before {
  display: none;
}

.nav-section-label {
  display: none;
}

nav a:hover,
nav .nav-link:hover {
  background: #f5f2fb;
  border-color: #eadff6;
  color: var(--dark);
  transform: translateY(-1px);
}

nav a.active {
  background: #efe6f8;
  border-color: #e1cff3;
  box-shadow: none;
  color: var(--dark);
}

.nav-dropdown {
  flex: 0 0 auto;
  position: relative;
}

.nav-dropdown summary {
  cursor: pointer;
  list-style: none;
}

.nav-dropdown summary::-webkit-details-marker {
  display: none;
}

.nav-dropdown > .nav-link {
  display: flex;
  gap: 6px;
}

.nav-dropdown b {
  color: var(--muted);
  font-size: 11px;
  line-height: 1;
}

.nav-dropdown-menu {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 14px 34px rgba(25, 32, 45, 0.14);
  display: none;
  min-width: 230px;
  padding: 6px;
  position: absolute;
  top: calc(100% + 6px);
  z-index: 40;
}

.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown:focus-within .nav-dropdown-menu,
.nav-dropdown[open] .nav-dropdown-menu {
  display: grid;
}

.nav-dropdown-menu a {
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  min-height: auto;
  padding: 9px 10px;
}

.nav-dropdown-menu a:hover {
  background: #f5f2fb;
  color: var(--dark);
}

.user-box {
  align-items: center;
  display: flex;
  flex: 0 0 auto;
  gap: 10px;
  justify-self: end;
  margin-top: 0;
  max-width: 230px;
  padding: 8px 10px;
  position: relative;
  z-index: 2;
}

.user-box span {
  color: var(--ink);
}

.user-box small {
  display: none;
}

.logout-link {
  background: var(--dark);
  color: #fff !important;
  margin-top: 0;
  white-space: nowrap;
}

.mobile-menu-toggle,
.mobile-menu-backdrop {
  display: none;
}

.mobile-menu-toggle {
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
  gap: 5px;
  height: 42px;
  justify-content: center;
  padding: 0;
  width: 42px;
}

.mobile-menu-toggle span {
  background: var(--dark);
  border-radius: 999px;
  display: block;
  height: 2px;
  width: 18px;
}

.main {
  margin-left: 0;
  padding: 24px 28px 34px;
}

.app-footer {
  align-items: center;
  background: var(--dark);
  color: #fff;
  display: flex;
  gap: 10px;
  justify-content: center;
  min-height: 46px;
  padding: 12px 18px;
}

.app-footer span {
  color: #cce8df;
  font-size: 13px;
}

.secondary-tabs {
  display: flex;
  gap: 8px;
  margin: -8px 0 18px;
  overflow-x: auto;
}

.secondary-tabs a {
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  flex: 0 0 auto;
  font-size: 14px;
  font-weight: 800;
  padding: 10px 14px;
}

.secondary-tabs a.active {
  background: var(--dark);
  border-color: var(--dark);
  box-shadow: var(--shadow-soft);
  color: #fff;
}

.agenda-section-tabs {
  scroll-margin-top: 90px;
}

#agendamento-avaliacao,
#plano-fixo,
#lista-agendamentos {
  scroll-margin-top: 92px;
}

.page-header {
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow-soft);
  display: flex;
  gap: 18px;
  justify-content: space-between;
  margin-bottom: 22px;
  padding: 18px;
}

.page-subtitle,
.muted-text {
  color: var(--muted);
  margin: 4px 0 0;
}

.eyebrow {
  color: var(--green);
  font-weight: 700;
  letter-spacing: 0;
  margin: 0 0 4px;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
}

h1 {
  color: var(--dark);
  font-size: 32px;
}

h2 {
  color: var(--ink);
  font-size: 20px;
}

.button,
button {
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  font-size: 15px;
  font-weight: 700;
  justify-content: center;
  padding: 11px 16px;
}

.button.primary,
button.primary {
  background: var(--dark);
  color: var(--white);
}

.button.ghost {
  background: #e9f1f0;
  color: var(--dark);
}

.button.tiny {
  border-radius: 8px;
  font-size: 12px;
  min-height: 32px;
  padding: 7px 10px;
  white-space: nowrap;
}

.compact-button {
  min-height: 32px;
  padding: 7px 10px;
  white-space: nowrap;
}

.kpi-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin-bottom: 20px;
}

.kpi {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow-soft);
  display: grid;
  gap: 8px;
  padding: 18px;
}

.kpi span {
  color: var(--muted);
  font-size: 14px;
}

.kpi strong {
  color: var(--dark);
  font-size: 24px;
}

.dashboard-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(320px, 0.92fr) minmax(360px, 1.08fr);
}

.attendance-panel,
.alert-panel {
  align-self: start;
}

.attendance-grid {
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  overflow: hidden;
}

.attendance-grid article {
  align-items: center;
  display: grid;
  gap: 2px;
  min-height: 88px;
  padding: 16px 18px;
}

.attendance-grid article:nth-child(odd) {
  border-right: 1px solid var(--line);
}

.attendance-grid article:nth-child(n + 3) {
  border-top: 1px solid var(--line);
}

.attendance-grid strong {
  color: var(--dark);
  font-size: 25px;
  line-height: 1;
}

.attendance-grid span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.alert-groups {
  display: grid;
  gap: 12px;
}

.alert-groups article {
  background: #fbfcfe;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.alert-groups h3 {
  color: var(--dark);
  font-size: 15px;
  margin: 0 0 8px;
}

.alert-heading {
  display: inline-block;
}

.alert-heading:hover h3 {
  color: var(--primary);
  text-decoration: underline;
}

.alert-groups ul {
  display: grid;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.alert-groups li {
  display: grid;
  gap: 2px;
}

.alert-link {
  border-radius: 8px;
  display: grid;
  gap: 2px;
  margin: -4px;
  padding: 4px;
}

.alert-link:hover {
  background: #eef8f6;
}

.alert-groups strong {
  color: var(--ink);
  font-size: 14px;
}

.alert-groups span {
  color: var(--muted);
  font-size: 13px;
}

.message-templates {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.message-templates article {
  background: #fbfcfd;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}

.message-templates textarea {
  min-height: 140px;
}

.panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
  padding: 20px;
}

.panel-title {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 12px;
}

.panel-title .eyebrow {
  margin-bottom: 2px;
}

.agenda-panel {
  overflow: hidden;
}

.dashboard-week-panel .schedule-days {
  gap: 4px;
}

.dashboard-week-panel .schedule-days-3,
.dashboard-week-panel .schedule-days-7 {
  display: grid;
  overflow-x: visible;
}

.dashboard-week-panel .schedule-days-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.dashboard-week-panel .schedule-days-7 {
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.dashboard-week-panel .schedule-days-3 .schedule-day-card,
.dashboard-week-panel .schedule-days-7 .schedule-day-card {
  flex: initial;
  min-width: 0;
}

.dashboard-week-panel .schedule-day-header {
  justify-content: center;
  padding: 7px 4px;
  text-align: center;
}

.dashboard-week-panel .schedule-day-header strong {
  font-size: 11px;
}

.dashboard-week-panel .schedule-slot {
  grid-template-columns: 34px minmax(0, 1fr);
}

.dashboard-week-panel .compact-schedule .schedule-slot {
  min-height: 28px;
}

.dashboard-week-panel .schedule-hour {
  font-size: 10px;
  padding: 3px 2px;
}

.dashboard-week-panel .schedule-content {
  gap: 3px;
  padding: 3px;
}

.dashboard-week-panel .compact-schedule .schedule-free {
  min-height: 18px;
}

.dashboard-week-panel .schedule-free {
  font-size: 9px;
  overflow: hidden;
  padding: 0 4px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-week-panel .schedule-event {
  border-left-width: 4px;
  gap: 2px;
  grid-template-columns: 34px minmax(0, 1fr);
  min-height: 32px;
  padding: 4px 5px;
}

.dashboard-week-panel .schedule-event-time,
.dashboard-week-panel .schedule-event strong {
  font-size: 10px;
}

.dashboard-week-panel .schedule-event span,
.dashboard-week-panel .schedule-event em {
  font-size: 10px;
}

.dashboard-week-panel .schedule-event em {
  grid-column: 1 / -1;
}

.agenda-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}

.agenda-summary span {
  background: #f6fbfa;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-size: 14px;
  padding: 8px 10px;
}

.agenda-summary strong {
  color: var(--dark);
}

.agenda-toolbar {
  align-items: end;
  display: grid;
  gap: 14px;
  grid-template-columns: 240px 1fr;
}

.view-switch {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.view-switch a {
  background: #f6fbfa;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--dark);
  font-size: 13px;
  font-weight: 800;
  padding: 10px 13px;
}

.view-switch a.active {
  background: var(--dark);
  border-color: var(--dark);
  color: #fff;
}

.dashboard-agenda-switch {
  justify-content: flex-start;
  margin-bottom: 12px;
}

.day-agenda {
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
  overflow: hidden;
}

.dashboard-shell {
  display: grid;
  gap: 18px;
}

.dashboard-hero-v2,
.dashboard-card,
.metric-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 14px 42px rgba(14, 67, 69, 0.06);
}

.dashboard-hero-v2 {
  align-items: center;
  display: grid;
  gap: 18px;
  grid-template-columns: auto 1fr auto;
  padding: 28px;
}

.dashboard-hero-v2 .hero-icon {
  align-items: center;
  background: #e8f6f1;
  border-radius: 999px;
  color: var(--dark);
  display: inline-flex;
  font-size: 28px;
  height: 62px;
  justify-content: center;
  width: 62px;
}

.dashboard-hero-v2 h1 {
  color: #0b2f3b;
  font-size: clamp(28px, 3vw, 38px);
  line-height: 1.05;
  margin: 0 0 6px;
}

.dashboard-hero-v2 p,
.dashboard-card-header p {
  color: var(--muted);
  margin: 0;
}

.metric-grid-v2 {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.metric-card {
  align-items: center;
  display: grid;
  gap: 14px;
  grid-template-columns: auto 1fr;
  min-height: 116px;
  padding: 20px;
}

.metric-icon {
  align-items: center;
  background: #e9f7f1;
  border-radius: 999px;
  color: var(--dark);
  display: inline-flex;
  font-size: 24px;
  font-weight: 900;
  height: 58px;
  justify-content: center;
  width: 58px;
}

.metric-card:nth-child(5) .metric-icon {
  background: #fff1e8;
  color: #f26b21;
}

.metric-card span:not(.metric-icon) {
  color: #263341;
  display: block;
  font-size: 13px;
  font-weight: 800;
}

.metric-card strong {
  color: #0b2f3b;
  display: block;
  font-size: 27px;
  line-height: 1.1;
  margin: 3px 0;
}

.trend {
  color: #6d7480;
  display: block;
  font-size: 12px;
  font-weight: 800;
}

.trend.up {
  color: #15975a;
}

.trend.down {
  color: #f05a28;
}

.dashboard-primary-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(0, 1.25fr) minmax(360px, 0.95fr);
}

.dashboard-primary-grid.secondary,
.dashboard-lower-grid-v2 {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.dashboard-lower-grid-v2 {
  display: grid;
  gap: 14px;
}

.dashboard-lower-grid-v2 .renewal-card {
  grid-column: 1 / -1;
}

.dashboard-card {
  overflow: hidden;
  padding: 22px;
}

.dashboard-card-header {
  align-items: start;
  display: flex;
  gap: 14px;
  justify-content: space-between;
  margin-bottom: 16px;
}

.dashboard-card-header h2 {
  color: #14212d;
  font-size: 22px;
  line-height: 1.1;
  margin: 0 0 3px;
}

.operation-list {
  border: 1px solid var(--line);
  border-radius: 14px;
  max-height: 360px;
  overflow-y: auto;
}

.operation-list::-webkit-scrollbar {
  width: 7px;
}

.operation-list::-webkit-scrollbar-thumb {
  background: #d9e6e3;
  border-radius: 999px;
}

.operation-row {
  align-items: center;
  color: var(--ink);
  display: grid;
  gap: 14px;
  grid-template-columns: 70px 12px minmax(160px, 1.2fr) minmax(110px, .8fr) auto 24px;
  min-height: 58px;
  padding: 10px 16px;
}

.operation-row + .operation-row,
.operation-list .appointment-sheet + .operation-row {
  border-top: 1px solid var(--line);
}

.operation-row strong {
  color: #0b2f3b;
  font-size: 18px;
}

.operation-dot {
  background: #18a567;
  border-radius: 999px;
  height: 10px;
  width: 10px;
}

.operation-patient {
  color: #0b2f3b;
  font-weight: 900;
}

.status-chip {
  border: 0;
  border-radius: 999px;
  display: inline-flex;
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
  justify-content: center;
  padding: 6px 10px;
  white-space: nowrap;
}

.status-chip.agenda-status-verde {
  background: #dcf5e8;
  color: #0b7d49;
}

.status-chip.agenda-status-azul {
  background: #e6f1ff;
  color: #1264d8;
}

.status-chip.agenda-status-amarelo {
  background: #fff5d6;
  color: #8a6400;
}

.status-chip.agenda-status-vermelho {
  background: #fde6e8;
  color: #b4232f;
}

.status-chip.agenda-status-roxo {
  background: #efe7fb;
  color: #5d34a4;
}

.status-chip.agenda-status-laranja {
  background: #fff0e1;
  color: #c4560a;
}

.status-chip.agenda-status-cinza {
  background: #eef1f4;
  color: #59636f;
}

.row-menu {
  color: #66717d;
  font-size: 22px;
  text-align: center;
}

.operation-empty {
  display: grid;
  gap: 4px;
  padding: 24px;
  text-align: center;
}

.operation-empty span {
  color: var(--muted);
}

.dash-alert-list {
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
}

.dash-alert-item {
  align-items: center;
  color: var(--ink);
  display: grid;
  gap: 14px;
  grid-template-columns: 46px 44px 1fr 18px;
  min-height: 60px;
  padding: 10px 14px;
}

.dash-alert-item + .dash-alert-item {
  border-top: 1px solid var(--line);
}

.dash-alert-icon {
  align-items: center;
  border-radius: 999px;
  color: #fff;
  display: inline-flex;
  font-weight: 900;
  height: 40px;
  justify-content: center;
  width: 40px;
}

.dash-alert-icon.orange { background: #f26b21; }
.dash-alert-icon.yellow { background: #f8bd35; }
.dash-alert-icon.green { background: #28a96c; }
.dash-alert-icon.blue { background: #2f80ed; }

.dash-alert-item strong {
  color: #0b2f3b;
  font-size: 19px;
}

.dash-alert-item span:not(.dash-alert-icon) {
  color: #485260;
}

.dash-alert-item em {
  color: #7e8996;
  font-size: 24px;
  font-style: normal;
}

.pipeline-grid-v2 {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.pipeline-step {
  background: linear-gradient(145deg, #f2fbf7, #ffffff);
  border: 1px solid #dfeee9;
  border-radius: 16px;
  min-height: 92px;
  padding: 16px;
}

.pipeline-step span,
.documentation-grid span,
.finance-summary-grid span,
.renewal-grid > article > span {
  color: #536070;
  display: block;
  font-size: 13px;
  font-weight: 800;
}

.pipeline-step strong,
.documentation-grid strong,
.finance-summary-grid strong,
.renewal-grid strong {
  color: #0b2f3b;
  display: block;
  font-size: 26px;
  line-height: 1;
  margin-top: 10px;
}

.documentation-grid,
.finance-summary-grid,
.renewal-grid {
  display: grid;
  gap: 12px;
}

.documentation-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.documentation-grid article,
.finance-summary-grid article,
.renewal-grid article {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
}

.documentation-grid small,
.finance-summary-grid small,
.renewal-mini-card span {
  color: var(--muted);
  display: block;
  font-size: 12px;
  margin-top: 6px;
}

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

.compact-table table {
  font-size: 13px;
}

.mini-badge {
  background: #eaf7f0;
  border-radius: 999px;
  color: var(--dark);
  display: inline-flex;
  font-size: 12px;
  font-weight: 900;
  padding: 6px 10px;
}

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

.renewal-mini-card {
  background: #fbfdfd;
  border: 1px solid var(--line);
  border-radius: 12px;
  display: grid;
  gap: 4px;
  margin-top: 10px;
  padding: 12px;
}

.renewal-mini-card strong {
  font-size: 16px;
  margin: 0;
}

.renewal-mini-card em {
  color: var(--dark);
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
  margin-top: 4px;
}

.muted-card strong {
  color: var(--muted);
}

.mobile-bottom-nav,
.mobile-more-backdrop,
.mobile-more-sheet {
  display: none;
}

.schedule-grid {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.schedule-slot {
  display: grid;
  grid-template-columns: 84px 1fr;
  min-height: 64px;
}

.schedule-slot + .schedule-slot {
  border-top: 1px solid var(--line);
}

.schedule-hour {
  align-items: center;
  background: #f4f8f7;
  color: var(--dark);
  display: flex;
  font-size: 13px;
  font-weight: 800;
  justify-content: center;
  padding: 10px;
}

.schedule-content {
  align-items: stretch;
  background: var(--white);
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  padding: 8px;
}

.schedule-free {
  align-items: center;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  display: flex;
  font-size: 13px;
  justify-content: center;
  min-height: 44px;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.schedule-free:hover {
  background: #e8f7f1;
  border-color: var(--primary);
  color: var(--dark);
  font-weight: 800;
}

.schedule-event {
  border-left: 8px solid #007bff;
  border-radius: 8px;
  color: var(--ink);
  display: grid;
  gap: 5px;
  grid-template-columns: 58px 1fr auto;
  min-height: 50px;
  padding: 8px 10px;
}

.schedule-event:hover {
  box-shadow: inset 0 0 0 2px rgba(1, 92, 96, 0.18);
}

.appointment-sheet {
  inset: 0;
  opacity: 0;
  pointer-events: none;
  position: fixed;
  transition: opacity 0.18s ease;
  z-index: 80;
}

.appointment-sheet:target {
  opacity: 1;
  pointer-events: auto;
}

.appointment-sheet-backdrop {
  background: rgba(15, 23, 42, 0.28);
  inset: 0;
  position: absolute;
}

.appointment-sheet-panel {
  background: #fff;
  border-left: 1px solid var(--line);
  box-shadow: -18px 0 44px rgba(15, 23, 42, 0.18);
  display: flex;
  flex-direction: column;
  gap: 18px;
  height: 100%;
  max-width: 420px;
  overflow-y: auto;
  padding: 22px;
  position: absolute;
  right: 0;
  top: 0;
  transform: translateX(24px);
  transition: transform 0.18s ease;
  width: min(420px, 92vw);
}

.appointment-sheet:target .appointment-sheet-panel {
  transform: translateX(0);
}

.appointment-sheet-handle {
  display: none;
}

.appointment-sheet-header {
  align-items: flex-start;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.appointment-sheet-header h2 {
  color: var(--dark);
  font-size: 24px;
  margin: 0;
}

.appointment-sheet-header span,
.appointment-summary-grid span {
  color: var(--muted);
  font-size: 12px;
}

.sheet-close {
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--ink);
  display: inline-flex;
  font-size: 24px;
  font-weight: 700;
  height: 38px;
  justify-content: center;
  width: 38px;
}

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

.appointment-summary-grid div,
.appointment-notes {
  background: #f8fbfa;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.appointment-summary-grid strong {
  color: var(--dark);
  display: block;
  font-size: 15px;
  margin-top: 4px;
}

.appointment-notes h3 {
  margin: 0 0 6px;
}

.appointment-notes p {
  color: var(--muted);
  margin: 0;
}

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

.small-button {
  min-height: 34px;
  padding: 8px 10px;
}

.schedule-event-time {
  align-self: center;
  color: var(--dark);
  font-weight: 800;
}

.schedule-event strong,
.schedule-event span,
.schedule-event em {
  display: block;
}

.schedule-event span,
.schedule-event em {
  color: var(--muted);
  font-size: 12px;
}

.schedule-event em {
  align-self: center;
  font-style: normal;
  font-weight: 800;
}

.compact-schedule .schedule-slot {
  min-height: 46px;
}

.compact-schedule .schedule-hour {
  font-size: 12px;
}

.compact-schedule .schedule-free {
  min-height: 30px;
}

.schedule-days {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: thin;
}

.schedule-days-3 .schedule-day-card {
  flex: 1 0 31%;
  min-width: 320px;
}

.schedule-days-7 .schedule-day-card {
  flex: 0 0 260px;
}

.schedule-day-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.schedule-day-card > header {
  align-items: center;
  background: #f4f8f7;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  padding: 11px 13px;
}

.schedule-day-header {
  align-items: center;
  background: #f4f8f7;
  border-bottom: 1px solid var(--line);
  color: var(--dark);
  display: flex;
  font-weight: 800;
  justify-content: center;
  padding: 11px 13px;
  text-align: center;
  width: 100%;
}

.schedule-day-header:hover {
  background: #e8f7f1;
  color: var(--primary);
}

.schedule-day-card > header strong {
  color: var(--dark);
}

.schedule-day-card > header a {
  font-size: 13px;
  font-weight: 800;
}

.month-grid {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.month-labels,
.month-cells {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.month-labels span {
  background: #f4f8f7;
  border-bottom: 1px solid var(--line);
  color: var(--dark);
  font-size: 12px;
  font-weight: 800;
  padding: 9px;
  text-align: center;
}

.month-empty,
.month-cell {
  min-height: 132px;
}

.month-cell {
  border-bottom: 1px solid var(--line);
  border-left: 1px solid var(--line);
  color: var(--ink);
  display: grid;
  gap: 4px;
  padding: 10px;
}

.month-cell:hover {
  background: #e8f7f1;
}

.month-cell strong {
  color: var(--dark);
  font-size: 18px;
}

.month-cell span,
.month-cell em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 700;
}

.month-events {
  display: grid;
  gap: 3px;
  margin-top: 4px;
}

.month-cell .month-event {
  border-left: 4px solid #007bff;
  border-radius: 4px;
  color: var(--ink);
  display: block;
  font-size: 11px;
  font-weight: 700;
  overflow: hidden;
  padding: 3px 5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.day-appointment {
  align-items: stretch;
  background: #f6fbff;
  border-left: 8px solid #4da3df;
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: 92px 1fr;
  min-height: 82px;
}

.day-appointment:first-child {
  border-top: 0;
}

.appointment-time {
  align-items: center;
  background: rgba(255, 255, 255, 0.7);
  color: var(--dark);
  display: flex;
  font-size: 18px;
  font-weight: 800;
  justify-content: center;
  padding: 12px;
}

.appointment-main {
  display: grid;
  gap: 8px;
  padding: 12px 14px;
}

.appointment-top,
.appointment-meta {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.appointment-top strong {
  color: var(--ink);
  font-size: 16px;
}

.appointment-meta span {
  color: var(--muted);
  font-size: 13px;
}

.appointment-main p {
  color: var(--muted);
  margin: 0;
}

.agenda-status-verde {
  background: #eaf7ee;
  border-left-color: #28a745;
}

.agenda-status-azul {
  background: #eaf3ff;
  border-left-color: #007bff;
}

.agenda-status-amarelo {
  background: #fff8df;
  border-left-color: #ffc107;
}

.agenda-status-vermelho {
  background: #fdecee;
  border-left-color: #dc3545;
}

.agenda-status-roxo {
  background: #f2ecfa;
  border-left-color: #6f42c1;
}

.agenda-status-laranja {
  background: #fff0e3;
  border-left-color: #fd7e14;
}

.agenda-status-cinza {
  background: #f1f3f5;
  border-left-color: #6c757d;
}

.agenda-pill {
  border: 0;
  color: var(--white);
}

.agenda-pill.agenda-status-verde {
  background: #28a745;
}

.agenda-pill.agenda-status-azul {
  background: #007bff;
}

.agenda-pill.agenda-status-amarelo {
  background: #ffc107;
  color: #3f3200;
}

.agenda-pill.agenda-status-vermelho {
  background: #dc3545;
}

.agenda-pill.agenda-status-roxo {
  background: #6f42c1;
}

.agenda-pill.agenda-status-laranja {
  background: #fd7e14;
}

.agenda-pill.agenda-status-cinza {
  background: #6c757d;
}

.agenda-empty {
  display: grid;
  gap: 12px;
  justify-items: center;
}

.table-wrap {
  overflow-x: auto;
}

.compact-search-panel {
  padding: 18px 20px;
}

.page-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.patient-search {
  align-items: end;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(280px, 1fr) auto auto;
}

.patient-search label {
  display: grid;
  gap: 7px;
}

.patient-search span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.inline-delete-form {
  margin: 0;
}

.icon-danger {
  align-items: center;
  background: #fff5f5;
  border: 1px solid #f3c8c8;
  border-radius: 10px;
  color: #b42318;
  cursor: pointer;
  display: inline-flex;
  font-size: 18px;
  font-weight: 900;
  height: 38px;
  justify-content: center;
  line-height: 1;
  width: 42px;
}

.icon-danger:hover {
  background: #dc3545;
  border-color: #dc3545;
  color: #fff;
}

table {
  border-collapse: collapse;
  min-width: 760px;
  width: 100%;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 11px 10px;
  text-align: left;
  vertical-align: top;
}

th {
  background: var(--soft);
  color: var(--dark);
  font-size: 13px;
}

.pill {
  background: var(--soft);
  border: 1px solid #cae4d7;
  border-radius: 999px;
  color: var(--dark);
  display: inline-block;
  font-size: 13px;
  font-weight: 700;
  padding: 4px 9px;
}

.patient-link {
  color: var(--dark);
}

.patient-link:hover {
  text-decoration: underline;
}

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

.patient-hero div,
.info-grid div {
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 4px;
  padding: 12px;
}

.patient-hero span,
.info-grid span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.patient-hero strong,
.info-grid strong {
  color: var(--dark);
  overflow-wrap: anywhere;
}

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

.info-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 14px 0;
}

.timeline {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
}

.timeline-item {
  border-left: 5px solid var(--dark);
  background: var(--soft);
  border-radius: 8px;
  display: grid;
  gap: 5px;
  padding: 12px;
}

.timeline-item span,
.timeline-item small,
.timeline-item em {
  color: var(--muted);
}

.timeline-item em {
  font-style: normal;
  font-weight: 700;
}

.compact-form {
  background: #fbfdfd;
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-top: 14px;
  padding: 14px;
}

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

.first-contact-form .span-2 {
  grid-column: span 4;
}

.form-disclosure {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  overflow: hidden;
}

.form-disclosure summary {
  align-items: center;
  background: linear-gradient(90deg, rgba(0, 109, 106, 0.1), rgba(45, 156, 96, 0.06));
  border-left: 4px solid var(--primary);
  cursor: pointer;
  display: flex;
  font-size: 14px;
  font-weight: 800;
  justify-content: space-between;
  list-style: none;
  padding: 11px 12px;
}

.form-disclosure summary::-webkit-details-marker {
  display: none;
}

.form-disclosure summary::after {
  color: var(--primary);
  content: "+";
  font-size: 18px;
  line-height: 1;
}

.form-disclosure[open] summary::after {
  content: "-";
}

.compact-form-inner {
  background: transparent;
  border: 0;
  box-shadow: none;
  margin: 0;
  padding: 12px;
}

.triage-smart-form {
  gap: 12px;
}

.triage-head,
.triage-fields {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.linked-patient-box {
  background: linear-gradient(90deg, rgba(0, 109, 106, 0.09), rgba(45, 156, 96, 0.05));
  border: 1px solid var(--line);
  border-left: 4px solid var(--primary);
  border-radius: 8px;
  display: grid;
  gap: 3px;
  padding: 12px;
}

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

.linked-patient-box strong {
  color: var(--dark);
  font-size: 16px;
}

.linked-patient-box small {
  color: var(--muted);
  font-weight: 700;
}

.triage-block {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.triage-block h3 {
  background: linear-gradient(90deg, rgba(0, 109, 106, 0.12), rgba(45, 156, 96, 0.06));
  border-left: 4px solid var(--primary);
  color: var(--dark);
  font-size: 15px;
  margin: 0;
  padding: 11px 12px;
}

.triage-block > .triage-fields,
.triage-block > .field-group {
  padding: 12px;
}

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

.field-group > span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.pre-eval-panel textarea {
  background: #fbfdfd;
}

.pre-eval-modal {
  display: none;
}

.pre-eval-modal:target {
  display: block;
}

.pre-eval-modal-backdrop {
  background: rgba(10, 20, 24, 0.42);
  inset: 0;
  position: fixed;
  z-index: 120;
}

.pre-eval-modal-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 28px 70px rgba(14, 67, 69, 0.22);
  left: 50%;
  max-height: min(86vh, 760px);
  max-width: 760px;
  overflow-y: auto;
  padding: 22px;
  position: fixed;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(92vw, 760px);
  z-index: 121;
}

.pre-eval-modal-card > header {
  align-items: start;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 18px;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 14px;
}

.pre-eval-modal-card h2 {
  color: var(--dark);
  margin: 0 0 4px;
}

.pre-eval-modal-card header span {
  color: var(--muted);
  font-weight: 700;
}

.pre-eval-send-form {
  margin-top: 0;
}

.pre-eval-link-box {
  background: linear-gradient(90deg, rgba(14, 67, 69, 0.08), rgba(132, 198, 160, 0.14));
  border: 1px solid #cfe8de;
  border-radius: 12px;
  display: grid;
  gap: 8px;
  padding: 14px;
}

.pre-eval-link-box span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.pre-eval-link-box strong {
  color: var(--dark);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.pre-eval-modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.lead-kpi-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 16px;
}

.lead-kpi-grid article {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 10px 28px rgba(25, 32, 45, 0.05);
  padding: 16px;
}

.lead-kpi-grid span {
  color: var(--muted);
  display: block;
  font-weight: 700;
  margin-bottom: 8px;
}

.lead-kpi-grid strong {
  color: var(--dark);
  font-size: 30px;
  line-height: 1;
}

.lead-crm-panel .compact-form {
  margin-top: 0;
}

.lead-form {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.lead-form .span-2 {
  grid-column: span 2;
}

.lead-filters {
  display: flex;
  gap: 8px;
  margin: 12px 0 16px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.lead-filter {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  flex: 0 0 auto;
  font-size: 13px;
  font-weight: 800;
  padding: 9px 12px;
}

.lead-filter.active,
.lead-filter:hover {
  background: var(--dark);
  border-color: var(--dark);
  color: #fff;
}

.lead-table td strong,
.lead-table td small {
  display: block;
}

.lead-table td small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  margin-top: 4px;
  max-width: 280px;
}

.lead-status {
  background: #eef8f4;
  border: 1px solid #c7ead8;
  border-radius: 999px;
  color: var(--dark);
  display: inline-flex;
  font-size: 12px;
  font-weight: 900;
  padding: 6px 10px;
  white-space: nowrap;
}

.table-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.empty {
  color: var(--muted);
  padding: 24px 10px;
  text-align: center;
}

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

.form-section {
  background: linear-gradient(90deg, rgba(0, 109, 106, 0.1), rgba(45, 156, 96, 0.08));
  border: 1px solid var(--line);
  border-left: 5px solid var(--primary);
  border-radius: 8px;
  color: var(--dark);
  font-size: 17px;
  margin: 8px 0 2px;
  padding: 12px 14px;
}

.smart-intro-panel {
  align-items: center;
  background:
    linear-gradient(120deg, rgba(132, 198, 160, 0.16), rgba(255, 255, 255, 0.95) 46%),
    #fff;
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.9fr);
}

.smart-intro-panel h2,
.smart-card h2,
.smart-card h3 {
  color: var(--dark);
  letter-spacing: 0;
  margin: 0;
}

.smart-flow {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.smart-flow span,
.smart-preview-grid article,
.smart-patient-strip {
  background: #f8fbfa;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--dark);
  font-weight: 800;
  padding: 12px;
}

.smart-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(14, 67, 69, 0.06);
  display: grid;
  gap: 16px;
  padding: 18px;
}

.smart-section-title {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 12px;
  padding-bottom: 12px;
}

.smart-section-title > span {
  align-items: center;
  background: var(--dark);
  border-radius: 999px;
  color: #fff;
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 13px;
  font-weight: 900;
  height: 36px;
  justify-content: center;
  width: 36px;
}

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

.smart-field {
  align-content: start;
  background: #fbfdfd;
  border: 1px solid var(--line);
  border-radius: 8px;
  gap: 7px;
  padding: 12px;
}

.smart-field span {
  color: var(--dark);
  font-size: 14px;
  font-weight: 900;
}

.smart-field small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.45;
}

.smart-field textarea,
.smart-field input,
.smart-field select {
  background: #fff;
}

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

.smart-patient-strip div {
  display: grid;
  gap: 4px;
}

.smart-patient-strip span {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
}

.smart-patient-strip strong {
  color: var(--dark);
}

.body-map-card {
  grid-template-columns: minmax(240px, 0.72fr) minmax(300px, 1fr);
}

.body-map-card p {
  color: var(--muted);
  margin-bottom: 0;
}

.body-map-stage {
  align-items: center;
  background:
    radial-gradient(circle at 50% 35%, rgba(132, 198, 160, 0.16), transparent 44%),
    #fbfdfd;
  border: 1px dashed #cfe2df;
  border-radius: 8px;
  display: flex;
  justify-content: center;
  min-height: 430px;
  padding: 18px;
}

.body-silhouette {
  height: 360px;
  position: relative;
  width: 270px;
}

.body-head,
.body-trunk,
.body-arm,
.body-leg {
  background: linear-gradient(180deg, rgba(14, 67, 69, 0.13), rgba(132, 198, 160, 0.18));
  border: 1px solid rgba(14, 67, 69, 0.24);
  position: absolute;
}

.body-head {
  border-radius: 50%;
  height: 48px;
  left: 111px;
  top: 6px;
  width: 48px;
}

.body-trunk {
  border-radius: 42px 42px 28px 28px;
  height: 148px;
  left: 93px;
  top: 62px;
  width: 84px;
}

.body-arm {
  border-radius: 28px;
  height: 142px;
  top: 72px;
  width: 30px;
}

.body-arm.left {
  left: 55px;
  transform: rotate(13deg);
}

.body-arm.right {
  right: 55px;
  transform: rotate(-13deg);
}

.body-leg {
  border-radius: 30px;
  height: 145px;
  top: 208px;
  width: 34px;
}

.body-leg.left {
  left: 101px;
  transform: rotate(5deg);
}

.body-leg.right {
  right: 101px;
  transform: rotate(-5deg);
}

.body-marker {
  position: absolute;
  z-index: 2;
}

.body-marker input {
  height: 1px;
  opacity: 0;
  position: absolute;
  width: 1px;
}

.body-marker span {
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--dark);
  cursor: pointer;
  display: inline-flex;
  font-size: 11px;
  font-weight: 900;
  padding: 6px 8px;
  white-space: nowrap;
}

.body-marker input:checked + span {
  background: var(--dark);
  border-color: var(--dark);
  box-shadow: 0 8px 18px rgba(14, 67, 69, 0.2);
  color: #fff;
}

/* Avaliação 360° Inteligente - fluxo clínico guiado */
.clinical-shell {
  display: grid;
  gap: 16px;
}

.clinical-topbar {
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 16px 40px rgba(14, 67, 69, 0.06);
  display: grid;
  gap: 16px;
  grid-template-columns: auto minmax(0, 1fr) auto;
  padding: 16px 18px;
}

.clinical-topbar h1 {
  color: var(--dark);
  font-size: 26px;
  letter-spacing: 0;
  margin: 0 0 4px;
}

.clinical-topbar p {
  color: var(--muted);
  margin: 0;
}

.clinical-top-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.clinical-progress-label,
.autosave-status {
  background: #f2f8f6;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--dark);
  font-size: 12px;
  font-weight: 900;
  padding: 8px 10px;
}

.autosave-status {
  color: #16815f;
}

.clinical-steps {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  overflow: hidden;
}

.clinical-step {
  align-items: center;
  border-right: 1px solid var(--line);
  color: var(--muted);
  display: grid;
  gap: 2px;
  min-height: 78px;
  padding: 12px;
  position: relative;
  text-decoration: none;
}

.clinical-step:last-child {
  border-right: 0;
}

.clinical-step::after {
  background: #dbe7e4;
  bottom: 0;
  content: "";
  height: 3px;
  left: 0;
  position: absolute;
  right: 0;
}

.clinical-step span {
  align-items: center;
  background: #eef4f2;
  border: 1px solid var(--line);
  border-radius: 999px;
  display: inline-flex;
  font-size: 12px;
  font-weight: 900;
  height: 28px;
  justify-content: center;
  width: 28px;
}

.clinical-step strong {
  color: inherit;
  font-size: 13px;
}

.clinical-step small {
  font-size: 11px;
  font-weight: 700;
}

.clinical-step.done {
  color: #16815f;
}

.clinical-step.done span,
.clinical-step.done::after {
  background: #16815f;
  border-color: #16815f;
  color: #fff;
}

.clinical-step.active {
  color: var(--dark);
}

.clinical-step.active span,
.clinical-step.active::after {
  background: var(--dark);
  border-color: var(--dark);
  color: #fff;
}

.clinical-evaluation-form {
  align-items: start;
  display: grid;
  gap: 16px;
  grid-template-columns: 190px minmax(0, 1fr) 280px;
}

.clinical-rail,
.clinical-insights {
  position: sticky;
  top: 92px;
}

.clinical-rail {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  display: grid;
  gap: 4px;
  padding: 12px;
}

.clinical-rail strong {
  color: var(--dark);
  font-size: 12px;
  padding: 8px 10px;
  text-transform: uppercase;
}

.clinical-rail a {
  border-radius: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  padding: 9px 10px;
  text-decoration: none;
}

.clinical-rail a:hover,
.clinical-rail a:focus {
  background: #edf8f2;
  color: var(--dark);
}

.clinical-main,
.clinical-insights {
  display: grid;
  gap: 16px;
}

.clinical-stage,
.insight-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 14px 34px rgba(14, 67, 69, 0.05);
  padding: 18px;
}

.stage-heading {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 16px;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 14px;
}

.stage-heading h2 {
  color: var(--dark);
  font-size: 22px;
  letter-spacing: 0;
  margin: 0 0 4px;
}

.stage-heading p {
  color: var(--muted);
  margin: 0;
}

.method-tip {
  background: #eef8f3;
  border: 1px solid #d7ece3;
  border-radius: 10px;
  color: var(--dark);
  font-size: 12px;
  font-weight: 800;
  max-width: 360px;
  padding: 12px;
}

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

.clinical-grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.clinical-field,
.clinical-fieldset,
.clinical-slider {
  background: #fbfdfd;
  border: 1px solid var(--line);
  border-radius: 10px;
  display: grid;
  gap: 8px;
  padding: 12px;
}

.clinical-field span,
.clinical-slider > span,
.clinical-fieldset legend {
  color: var(--dark);
  font-size: 13px;
  font-weight: 900;
}

.clinical-field small,
.clinical-fieldset p,
.clinical-slider small {
  color: var(--muted);
  font-size: 12px;
  margin: 0;
}

.clinical-field input,
.clinical-field select,
.clinical-field textarea {
  background: #fff;
}

.clinical-field textarea {
  min-height: 88px;
}

.clinical-chip-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.clinical-chip {
  display: inline-flex;
}

.clinical-chip input {
  height: 1px;
  opacity: 0;
  position: absolute;
  width: 1px;
}

.clinical-chip span {
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--dark);
  cursor: pointer;
  font-size: 12px;
  font-weight: 850;
  padding: 8px 10px;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.clinical-chip input:checked + span {
  background: var(--dark);
  border-color: var(--dark);
  color: #fff;
  transform: translateY(-1px);
}

.clinical-slider input[type="range"] {
  accent-color: var(--dark);
}

.clinical-slider output {
  background: var(--dark);
  border-radius: 999px;
  color: #fff;
  display: inline-flex;
  font-size: 12px;
  justify-content: center;
  margin-left: 6px;
  min-width: 30px;
  padding: 3px 7px;
}

.clinical-triage-cards,
.reasoning-grid,
.test-route-grid,
.phase-timeline {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.clinical-triage-cards article,
.reasoning-grid article,
.test-route-grid article,
.phase-card {
  background: #fbfdfd;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 13px;
}

.clinical-triage-cards span,
.reasoning-grid span {
  color: var(--muted);
  display: block;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.clinical-triage-cards strong,
.reasoning-grid strong,
.test-route-grid strong {
  color: var(--dark);
}

.clinical-accordion {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  margin-top: 12px;
  overflow: hidden;
}

.clinical-accordion summary {
  align-items: center;
  cursor: pointer;
  display: grid;
  gap: 8px;
  grid-template-columns: auto auto minmax(0, 1fr);
  list-style: none;
  padding: 14px 16px;
}

.clinical-accordion summary::-webkit-details-marker {
  display: none;
}

.clinical-accordion summary span {
  background: var(--dark);
  border-radius: 999px;
  color: #fff;
  font-size: 11px;
  font-weight: 900;
  padding: 6px 9px;
}

.clinical-accordion summary strong {
  color: var(--dark);
}

.clinical-accordion summary small {
  color: var(--muted);
  font-weight: 700;
  text-align: right;
}

.clinical-accordion[open] {
  box-shadow: 0 12px 28px rgba(14, 67, 69, 0.05);
}

.clinical-accordion > .clinical-grid,
.clinical-accordion > .orthopedic-tests {
  border-top: 1px solid var(--line);
  padding: 14px;
}

.compact-tests .orthopedic-tests {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.clinical-body-map {
  align-items: center;
  background:
    radial-gradient(circle at 50% 38%, rgba(132, 198, 160, 0.18), transparent 45%),
    #fbfdfd;
  border: 1px dashed #cfe2df;
  border-radius: 12px;
  display: flex;
  justify-content: center;
  min-height: 250px;
  overflow: hidden;
  padding: 10px;
}

.clinical-body-map .body-silhouette {
  height: 260px;
  transform: scale(0.72);
  transform-origin: center;
}

.anatomy-page-header {
  align-items: center;
}

.anatomy-shell {
  align-items: start;
  display: grid;
  gap: 16px;
  grid-template-columns: 210px minmax(420px, 1fr) 340px;
  margin-bottom: 18px;
}

.anatomy-side-menu,
.anatomy-main-card,
.anatomy-editor-panel,
.anatomy-summary-strip {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow-soft);
}

.anatomy-side-menu {
  display: grid;
  gap: 9px;
  padding: 16px;
  position: sticky;
  top: 96px;
}

.anatomy-side-menu > strong {
  color: var(--dark);
  font-size: 12px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.anatomy-tab,
.anatomy-view {
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  display: flex;
  font-size: 13px;
  font-weight: 900;
  min-height: 40px;
  padding: 9px 11px;
}

.anatomy-tab.active,
.anatomy-view.active {
  background: var(--dark);
  border-color: var(--dark);
  color: #fff;
}

.anatomy-legend {
  border-top: 1px solid var(--line);
  display: grid;
  gap: 7px 8px;
  grid-template-columns: auto 1fr;
  margin-top: 6px;
  padding-top: 12px;
}

.anatomy-legend-dot {
  align-self: center;
  border-radius: 999px;
  display: inline-block;
  height: 12px;
  width: 12px;
}

.anatomy-normal { --status-color: #6c757d; }
.anatomy-pain { --status-color: #dc3545; }
.anatomy-tension { --status-color: #ffc107; }
.anatomy-stiffness { --status-color: #007bff; }
.anatomy-postural { --status-color: #28a745; }
.anatomy-neural { --status-color: #6f42c1; }

.anatomy-legend-dot.anatomy-normal,
.anatomy-status.anatomy-normal { background: #eef1f4; color: #4d565f; }
.anatomy-legend-dot.anatomy-pain,
.anatomy-status.anatomy-pain { background: #fde9eb; color: #b32735; }
.anatomy-legend-dot.anatomy-tension,
.anatomy-status.anatomy-tension { background: #fff6d8; color: #946900; }
.anatomy-legend-dot.anatomy-stiffness,
.anatomy-status.anatomy-stiffness { background: #e8f1ff; color: #005fc5; }
.anatomy-legend-dot.anatomy-postural,
.anatomy-status.anatomy-postural { background: #e9f7ee; color: #1f7a3a; }
.anatomy-legend-dot.anatomy-neural,
.anatomy-status.anatomy-neural { background: #f0e9fb; color: #56309f; }

.anatomy-main-card {
  overflow: hidden;
  padding: 0;
}

.anatomy-toolbar {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  padding: 16px 18px;
}

.anatomy-toolbar h2 {
  color: var(--dark);
  font-size: 22px;
  margin: 2px 0 0;
}

.anatomy-view-tabs {
  display: flex;
  gap: 8px;
}

.anatomy-stage {
  background:
    radial-gradient(circle at 50% 35%, rgba(132, 198, 160, 0.16), transparent 42%),
    linear-gradient(180deg, #fbfdfd, #fff);
  min-height: 650px;
  overflow: hidden;
  position: relative;
}

.anatomy-stage svg {
  display: block;
  height: 650px;
  margin: 0 auto;
  max-width: 100%;
}

.anatomy-base {
  fill: url(#bodyFill);
  stroke: rgba(14, 67, 69, 0.18);
  stroke-width: 2;
}

.anatomy-limb {
  fill: none;
  stroke: rgba(14, 67, 69, 0.2);
  stroke-linecap: round;
  stroke-width: 34;
}

.anatomy-lines {
  fill: none;
  stroke: rgba(14, 67, 69, 0.18);
  stroke-linecap: round;
  stroke-width: 2;
}

.anatomy-lines.posterior-line {
  stroke: rgba(14, 67, 69, 0.34);
  stroke-dasharray: 8 8;
}

.anatomy-click-layer {
  inset: 0;
  left: 50%;
  pointer-events: none;
  position: absolute;
  top: 0;
  transform: translateX(-50%);
  width: 480px;
}

.anatomy-region {
  align-items: center;
  background: color-mix(in srgb, var(--status-color) 18%, #ffffff);
  border: 1px solid color-mix(in srgb, var(--status-color) 62%, #ffffff);
  border-radius: 999px;
  color: var(--dark);
  cursor: pointer;
  display: flex;
  font-size: 10px;
  font-weight: 900;
  height: var(--h);
  justify-content: center;
  left: calc(var(--x) - (var(--w) / 2));
  line-height: 1.05;
  padding: 3px;
  pointer-events: auto;
  position: absolute;
  text-align: center;
  top: calc(var(--y) - (var(--h) / 2));
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
  width: var(--w);
}

.anatomy-region:hover,
.anatomy-region.selected {
  background: color-mix(in srgb, var(--status-color) 28%, #ffffff);
  box-shadow: 0 10px 24px color-mix(in srgb, var(--status-color) 22%, transparent);
  transform: translateY(-2px) scale(1.03);
}

.evaluation-anatomy-panel,
.evaluation-anatomy-empty {
  display: grid;
  gap: 12px;
}

.evaluation-anatomy-empty {
  background: linear-gradient(135deg, rgba(132, 198, 160, 0.14), #fff);
  border: 1px dashed #cfe2df;
  border-radius: 12px;
  color: var(--muted);
  padding: 16px;
}

.evaluation-anatomy-empty strong,
.evaluation-anatomy-head strong {
  color: var(--dark);
  display: block;
  font-size: 15px;
}

.evaluation-anatomy-head {
  align-items: start;
  display: flex;
  gap: 10px;
  justify-content: space-between;
}

.evaluation-anatomy-head span,
.evaluation-anatomy-head small,
.evaluation-anatomy-note {
  color: var(--muted);
  font-size: 12px;
}

.evaluation-anatomy-head small {
  background: #eff8f4;
  border: 1px solid #cfeee0;
  border-radius: 999px;
  color: var(--dark);
  font-weight: 900;
  padding: 6px 8px;
  white-space: nowrap;
}

.evaluation-anatomy-stage {
  border: 1px dashed #cfe2df;
  border-radius: 12px;
  overflow: hidden;
}

.evaluation-anatomy-stage .anatomy-stage {
  min-height: 310px;
}

.evaluation-anatomy-stage .anatomy-stage svg {
  height: 310px;
}

.evaluation-anatomy-stage .anatomy-click-layer {
  transform: translateX(-50%) scale(0.48);
  transform-origin: top center;
}

.evaluation-anatomy-stage .anatomy-region {
  pointer-events: none;
}

.evaluation-anatomy-actions .button {
  width: 100%;
}

.anatomy-editor-panel {
  max-height: calc(100vh - 120px);
  overflow: auto;
  padding: 16px;
  position: sticky;
  top: 96px;
}

.anatomy-editor-panel form {
  display: grid;
  gap: 11px;
}

.anatomy-editor-panel label {
  color: var(--muted);
  display: grid;
  font-size: 12px;
  font-weight: 900;
  gap: 6px;
}

.anatomy-editor-panel input,
.anatomy-editor-panel textarea,
.anatomy-editor-panel select {
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  min-height: 40px;
  padding: 9px 10px;
  width: 100%;
}

.editor-heading {
  background: linear-gradient(135deg, rgba(132, 198, 160, 0.18), rgba(14, 67, 69, 0.04));
  border: 1px solid #d4e9df;
  border-radius: 12px;
  padding: 13px;
}

.editor-heading span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.editor-heading h2 {
  color: var(--dark);
  font-size: 20px;
  margin: 4px 0 0;
}

.anatomy-eva output {
  color: var(--dark);
  font-size: 20px;
}

.anatomy-eva input {
  accent-color: var(--dark);
  padding: 0;
}

.anatomy-suggestion-box {
  background: #f6fbf8;
  border: 1px solid #d4e9df;
  border-radius: 10px;
  color: var(--muted);
  font-size: 13px;
  padding: 12px;
}

.anatomy-suggestion-box strong {
  color: var(--dark);
  display: block;
  margin-bottom: 4px;
}

.anatomy-summary-strip {
  border-left: 0;
  border-right: 0;
  border-radius: 0;
  box-shadow: none;
  padding: 16px 18px;
}

.anatomy-summary-strip > strong {
  color: var(--dark);
  display: block;
  font-size: 16px;
  margin-bottom: 10px;
}

.anatomy-summary-strip > div {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.anatomy-summary-item {
  align-items: start;
  background: #fbfdfd;
  border: 1px solid var(--line);
  border-radius: 10px;
  display: grid;
  gap: 9px;
  grid-template-columns: auto 1fr;
  padding: 10px;
}

.anatomy-summary-item strong {
  color: var(--dark);
}

.anatomy-summary-item p,
.anatomy-summary-item small {
  color: var(--muted);
  display: block;
  margin: 2px 0 0;
}

.anatomy-status {
  border-radius: 999px;
  display: inline-flex;
  font-size: 12px;
  font-weight: 900;
  padding: 6px 10px;
}

@media (max-width: 1180px) {
  .anatomy-shell {
    grid-template-columns: 180px minmax(360px, 1fr);
  }

  .anatomy-editor-panel {
    grid-column: 1 / -1;
    max-height: none;
    position: static;
  }

  .anatomy-editor-panel form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .anatomy-editor-panel .editor-heading,
  .anatomy-editor-panel .anatomy-suggestion-box,
  .anatomy-editor-panel .button,
  .anatomy-editor-panel label:has(textarea) {
    grid-column: 1 / -1;
  }
}

@media (max-width: 760px) {
  .anatomy-page-header {
    align-items: stretch;
  }

  .anatomy-shell {
    grid-template-columns: 1fr;
  }

  .anatomy-side-menu {
    overflow-x: auto;
    position: static;
  }

  .anatomy-toolbar {
    align-items: stretch;
    display: grid;
    gap: 10px;
  }

  .anatomy-view-tabs,
  .anatomy-side-menu {
    display: flex;
  }

  .anatomy-tab,
  .anatomy-view {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .anatomy-legend {
    display: none;
  }

  .anatomy-stage {
    min-height: 560px;
  }

  .anatomy-stage svg {
    height: 560px;
  }

  .anatomy-click-layer {
    transform: translateX(-50%) scale(0.74);
    transform-origin: top center;
  }

  .anatomy-editor-panel form,
  .anatomy-summary-strip > div {
    grid-template-columns: 1fr;
  }
}

.insight-card {
  padding: 14px;
}

.insight-list {
  display: grid;
  gap: 8px;
  margin: 0;
}

.insight-list div,
.clinical-ai-summary {
  background: #fbfdfd;
  border: 1px solid var(--line);
  border-radius: 9px;
  display: grid;
  gap: 3px;
  padding: 10px;
}

.insight-list dt,
.clinical-ai-summary strong {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.insight-list dd,
.clinical-ai-summary span {
  color: var(--dark);
  font-weight: 900;
  margin: 0;
}

.phase-timeline {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 14px;
}

.phase-card {
  border-left: 5px solid var(--dark);
}

.phase-card.phase-1 {
  border-left-color: #e86f61;
}

.phase-card.phase-2 {
  border-left-color: #28a745;
}

.phase-card.phase-3 {
  border-left-color: var(--dark);
}

.phase-card span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.phase-card h4 {
  color: var(--dark);
  margin: 4px 0 8px;
}

.phase-card p {
  color: var(--muted);
  margin: 0 0 10px;
}

.marker-cervical { left: 92px; top: 48px; }
.marker-ombro_d { left: 158px; top: 72px; }
.marker-ombro_e { right: 158px; top: 72px; }
.marker-toracica { left: 96px; top: 112px; }
.marker-lombar { left: 103px; top: 172px; }
.marker-pelve { left: 106px; top: 211px; }
.marker-quadril_d { left: 152px; top: 232px; }
.marker-quadril_e { right: 152px; top: 232px; }
.marker-joelho_d { left: 149px; top: 286px; }
.marker-joelho_e { right: 149px; top: 286px; }
.marker-panturrilha_d { left: 141px; top: 327px; }
.marker-panturrilha_e { right: 141px; top: 327px; }

.smart-preview-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.smart-preview-grid article {
  display: grid;
  gap: 7px;
}

.smart-preview-grid strong {
  color: var(--dark);
}

.smart-preview-grid span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.smart-diagnosis-card {
  background:
    linear-gradient(180deg, rgba(132, 198, 160, 0.1), transparent 26%),
    #fff;
}

.helper-box {
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-size: 13px;
  padding: 12px;
}

.helper-box p {
  margin: 6px 0 0;
}

.choice-grid {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 8px;
}

.choice-grid-lines {
  margin-top: 0;
}

.choice-chip {
  align-items: center;
  background: #f8fbfa;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  flex-direction: row-reverse;
  gap: 12px;
  justify-content: space-between;
  min-height: 42px;
  padding: 9px 10px;
}

.choice-chip input {
  accent-color: var(--dark);
  flex: 0 0 auto;
  height: 22px;
  margin: 0;
  width: 22px;
}

.choice-chip span {
  color: var(--ink);
  flex: 1 1 auto;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.25;
  text-align: left;
}

.alert-choice-grid .choice-chip {
  background: #fff7ed;
  border-color: #fed7aa;
}

.reference-gallery {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.reference-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  margin: 0;
  overflow: hidden;
}

.reference-card img {
  background: #f7fbfa;
  display: block;
  height: 180px;
  object-fit: contain;
  padding: 8px;
  width: 100%;
}

.reference-card figcaption {
  border-top: 1px solid var(--line);
  color: var(--dark);
  font-size: 12px;
  font-weight: 800;
  padding: 9px 10px;
}

.orthopedic-tests {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.test-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 20px rgba(0, 84, 82, 0.06);
  overflow: hidden;
}

.test-card header {
  background: #f0faf7;
  border-bottom: 1px solid var(--line);
  border-left: 5px solid var(--primary);
  color: var(--dark);
  display: grid;
  gap: 3px;
  min-height: 68px;
  padding: 13px 14px 12px;
}

.test-card header strong {
  color: var(--primary);
  display: block;
  font-size: 17px;
  line-height: 1.2;
}

.test-card header span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.25;
}

.test-card-image {
  background: #f7fbfa;
  border-bottom: 1px solid var(--line);
  display: block;
  height: 140px;
  object-fit: contain;
  padding: 8px;
  width: 100%;
}

.test-choice {
  align-items: center;
  border-top: 1px solid #eef4f3;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(0, 1fr) 180px;
  padding: 10px 12px;
}

.test-choice:nth-child(even) {
  background: #fbfdfd;
}

.test-choice-wrap {
  border-top: 1px solid #eef4f3;
}

.test-choice-wrap:first-of-type {
  border-top: 0;
}

.test-choice-wrap .test-choice {
  border-top: 0;
}

.test-choice span {
  display: grid;
  gap: 2px;
}

.test-choice strong {
  color: var(--dark);
  font-size: 13px;
}

.test-choice small {
  color: var(--muted);
  font-weight: 500;
}

.test-reference {
  background: #f7fbfa;
  border-left: 3px solid #b7dcd8;
  border-top: 1px solid #e5f0ef;
  margin: 0;
  padding: 10px 12px 12px;
}

.test-reference summary {
  align-items: center;
  background: #edf8f6;
  border: 1px solid #d5e9e7;
  border-radius: 8px;
  color: var(--primary);
  cursor: pointer;
  display: flex;
  font-size: 13px;
  font-weight: 800;
  justify-content: space-between;
  list-style: none;
  padding: 9px 10px;
}

.test-reference summary::-webkit-details-marker {
  display: none;
}

.test-reference summary strong {
  align-items: center;
  background: var(--primary);
  border-radius: 999px;
  color: #fff;
  display: inline-flex;
  font-size: 0;
  height: 22px;
  justify-content: center;
  line-height: 1;
  transition: transform 0.2s ease;
  width: 22px;
}

.test-reference summary strong::before {
  content: "v";
  font-size: 12px;
}

.test-reference[open] summary strong {
  transform: rotate(180deg);
}

.test-reference figure {
  background: #fff;
  border: 1px solid #dcebea;
  border-radius: 8px;
  display: grid;
  gap: 10px;
  margin: 10px 0 0;
  padding: 10px;
}

.test-reference img {
  background: #fff;
  border: 1px solid #e4eeee;
  border-radius: 8px;
  display: block;
  margin: 0 auto;
  max-height: 220px;
  max-width: 520px;
  object-fit: contain;
  padding: 4px;
  width: 100%;
}

.test-reference figcaption {
  color: var(--ink);
  display: grid;
  gap: 4px;
  margin: 0;
  padding: 2px 4px 0;
}

.test-reference figcaption strong {
  color: var(--dark);
  font-size: 15px;
  line-height: 1.25;
}

.test-reference figcaption span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.5;
}

.questionnaire-block {
  display: grid;
  gap: 12px;
}

.questionnaire-block h3 {
  color: var(--primary);
  margin: 6px 0 0;
}

.questionnaire-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.question-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 12px;
}

.question-card legend {
  color: var(--dark);
  font-weight: 800;
  padding: 0 4px;
}

.radio-grid {
  display: grid;
  gap: 7px;
}

.radio-option {
  align-items: center;
  background: #fbfdfd;
  border: 1px solid #eef4f3;
  border-radius: 8px;
  color: var(--ink);
  cursor: pointer;
  display: flex;
  font-weight: 600;
  gap: 8px;
  padding: 8px 9px;
}

.radio-option input {
  min-height: auto;
  width: auto;
}

.radio-option:has(input:checked) {
  background: #e8f7f1;
  border-color: var(--primary);
  color: var(--dark);
}

label {
  color: var(--muted);
  display: grid;
  font-size: 13px;
  font-weight: 700;
  gap: 6px;
}

input,
select,
textarea {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  font: inherit;
  min-height: 42px;
  padding: 10px 11px;
  width: 100%;
}

textarea {
  resize: vertical;
}

.span-2 {
  grid-column: span 2;
}

.form-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.login-page {
  align-items: center;
  background:
    radial-gradient(circle at 50% 12%, rgba(132, 198, 160, 0.18), transparent 34%),
    linear-gradient(180deg, #ffffff 0%, #f7fbfa 100%);
  display: flex;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
}

.login-card {
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  max-width: 430px;
  padding: 28px;
  width: 100%;
}

.public-intake-page {
  background:
    radial-gradient(circle at 50% 0%, rgba(132, 198, 160, 0.18), transparent 30%),
    linear-gradient(180deg, #ffffff 0%, #f7fbfa 100%);
  min-height: 100vh;
}

.public-intake-shell {
  margin: 0 auto;
  max-width: 1120px;
  padding: 22px;
}

.public-intake-hero {
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 18px;
  grid-template-columns: 260px 1fr;
  margin-bottom: 18px;
  padding: 18px;
}

.public-intake-brand {
  background: linear-gradient(160deg, var(--dark), var(--dark-2));
  color: #fff;
}

.public-intake-hero h1 {
  color: var(--dark);
  margin-bottom: 6px;
}

.public-intake-hero p:last-child {
  color: var(--muted);
  margin: 0;
}

.public-intake-form {
  box-shadow: var(--shadow);
}

.public-wizard {
  margin: 0 auto;
  max-width: 380px;
}

.wizard-step {
  display: none;
}

.wizard-step.is-active {
  display: block;
}

.wizard-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 24px 70px rgba(14, 67, 69, 0.14);
  min-height: 640px;
  padding: 26px;
}

.wizard-card h1,
.wizard-card h2 {
  color: #0b1f35;
  line-height: 1.18;
}

.wizard-card h1 {
  color: var(--dark);
  font-size: 25px;
  margin: 14px 0;
  text-align: center;
}

.wizard-card h2 {
  font-size: 20px;
  margin: 22px 0 14px;
}

.wizard-welcome {
  align-items: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: center;
}

.wizard-logo {
  height: 72px;
  object-fit: contain;
  width: 72px;
}

.wizard-person-icon {
  align-items: center;
  border: 2px solid #7ec8bb;
  border-radius: 999px;
  color: var(--dark);
  display: flex;
  font-size: 44px;
  height: 116px;
  justify-content: center;
  margin: 12px 0 18px;
  width: 116px;
}

.public-appointment-hint {
  background: #eef8f5;
  border: 1px solid #cfe8df;
  border-radius: 12px;
  color: var(--dark);
  padding: 10px;
}

.wizard-top {
  align-items: center;
  display: grid;
  gap: 12px;
  grid-template-columns: 34px 1fr auto;
  margin-bottom: 18px;
}

.wizard-back {
  background: transparent;
  border: 0;
  color: #0b1f35;
  cursor: pointer;
  font-size: 24px;
}

.wizard-progress {
  background: #d8d8d8;
  border-radius: 999px;
  display: block;
  height: 6px;
  overflow: hidden;
}

.wizard-progress i {
  background: var(--dark);
  border-radius: inherit;
  display: block;
  height: 100%;
}

.public-choice-stack {
  display: grid;
  gap: 12px;
  margin-bottom: 20px;
}

.public-choice-stack.compact {
  gap: 8px;
}

.public-choice {
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
  display: grid;
  gap: 12px;
  grid-template-columns: 42px 1fr auto;
  min-height: 54px;
  padding: 10px 12px;
}

.public-choice-compact {
  grid-template-columns: 1fr auto;
  min-height: 38px;
  padding: 7px 10px;
}

.public-choice-icon {
  align-items: center;
  background: radial-gradient(circle at 35% 35%, #0b7775, var(--dark));
  border-radius: 999px;
  color: #fff;
  display: flex;
  font-size: 22px;
  height: 42px;
  justify-content: center;
  width: 42px;
}

.public-choice input {
  accent-color: var(--dark);
  height: 20px;
  width: 20px;
}

.public-choice span {
  color: #0b1f35;
  font-weight: 800;
}

.public-input {
  color: #0b1f35;
  display: grid;
  font-size: 13px;
  font-weight: 800;
  gap: 7px;
  margin: 10px 0;
}

.public-input input,
.public-input textarea {
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  font: inherit;
  min-height: 44px;
  padding: 12px;
  width: 100%;
}

.public-inline-radios {
  display: grid;
  gap: 8px;
  grid-template-columns: 1fr 1fr;
  margin-bottom: 12px;
}

.public-inline-radios .public-choice {
  grid-template-columns: 1fr auto;
  min-height: 42px;
}

.surgery-fields {
  background: #fbfdfc;
  border: 1px solid var(--line);
  border-radius: 12px;
  margin: 12px 0;
  padding: 12px;
}

.public-safety-note {
  background: #e9f7f1;
  border: 1px solid #c5e6d6;
  border-radius: 10px;
  color: var(--dark);
  font-size: 13px;
  font-weight: 800;
  margin: 12px 0;
  padding: 12px;
}

body[data-has-pain="Sim"] .branch-no-pain,
body[data-has-pain="Não"] .branch-pain {
  display: none;
}

.public-wizard .button.primary {
  margin-top: 12px;
  width: 100%;
}

.wizard-success-card {
  align-items: center;
  min-height: 560px;
  text-align: center;
}

.wizard-success-icon {
  align-items: center;
  border: 3px solid var(--green);
  border-radius: 999px;
  color: var(--dark);
  display: grid;
  font-size: 54px;
  font-weight: 900;
  height: 112px;
  justify-content: center;
  margin: 22px auto 8px;
  width: 112px;
}

.wizard-success-card small {
  color: var(--muted);
  display: block;
  font-weight: 700;
  margin-top: 18px;
}

.success-box {
  background: #e8f7f1;
  border: 1px solid #b6e1cb;
  border-radius: 8px;
  color: var(--dark);
  font-weight: 800;
  margin-bottom: 14px;
  padding: 12px;
}

.login-brand {
  align-items: center;
  background: linear-gradient(145deg, #ffffff 0%, #fbfffd 52%, #eef9f2 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  justify-items: center;
  margin-bottom: 18px;
  padding: 18px;
}

.login-logo {
  background: #fff;
  border-radius: 8px;
  height: 104px;
  justify-self: center;
  object-fit: contain;
  padding: 8px;
  width: 104px;
}

.login-method-logo {
  background: #fff;
  border-radius: 8px;
  height: 104px;
  justify-self: center;
  object-fit: contain;
  padding: 8px;
  width: 104px;
}

.forgot-password {
  color: var(--dark);
  font-size: 13px;
  font-weight: 700;
  justify-self: end;
}

.full-button {
  display: block;
  margin-top: 16px;
  text-align: center;
  width: 100%;
}

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

.login-help {
  color: var(--muted);
  font-size: 13px;
  margin: 16px 0 0;
}

.alert {
  background: #fce8e6;
  border: 1px solid #f4b8b2;
  border-radius: 8px;
  color: #8b1c13;
  margin: 14px 0;
  padding: 10px 12px;
}

.alert.success {
  background: #eefaf3;
  border-color: #bfe4cf;
  color: var(--dark);
}

.document-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}

.doc-status-assinado {
  background: #eaf8ef;
  border-color: #b9e0c7;
  color: #0b6b35;
}

.doc-status-andamento {
  background: #edf7ff;
  border-color: #bddcf8;
  color: #075985;
}

.doc-status-alerta {
  background: #fff7e6;
  border-color: #f5d38a;
  color: #8a5700;
}

.doc-status-neutro {
  background: #f5f7f8;
  border-color: #dbe4e6;
  color: var(--muted);
}

.document-progress-panel {
  display: grid;
  gap: 14px;
}

.document-progress-panel > div:first-child {
  align-items: baseline;
  display: flex;
  justify-content: space-between;
}

.document-progress-panel span {
  color: var(--muted);
  font-weight: 800;
}

.document-progress-panel strong {
  color: var(--dark);
  font-size: 30px;
}

.document-progress {
  background: #edf4f3;
  border-radius: 999px;
  height: 12px;
  overflow: hidden;
}

.document-progress span {
  background: linear-gradient(90deg, var(--dark), var(--accent));
  display: block;
  height: 100%;
}

.document-prefill {
  background: #f7fbfa;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--dark);
  font-family: inherit;
  line-height: 1.6;
  margin: 0;
  padding: 16px;
  white-space: pre-wrap;
}

.document-stage {
  margin-bottom: 22px;
}

.document-stage h2 {
  color: var(--dark);
  font-size: 22px;
  margin: 0 0 12px;
}

.document-card-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.document-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 14px 34px rgba(14, 67, 69, 0.07);
  padding: 18px;
}

.document-card > header {
  align-items: flex-start;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 14px;
}

.document-card header span:first-child {
  color: var(--accent);
  display: block;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.document-card h3 {
  color: var(--dark);
  font-size: 18px;
  margin: 4px 0 0;
}

.document-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.document-update-form {
  background: #fbfdfd;
  border: 1px solid var(--line);
  border-radius: 12px;
  margin-top: 12px;
  padding: 14px;
}

@media (max-width: 980px) {
  .metric-grid-v2 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .dashboard-primary-grid,
  .dashboard-primary-grid.secondary,
  .dashboard-lower-grid-v2 {
    grid-template-columns: 1fr;
  }

  .documentation-grid,
  .pipeline-grid-v2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .lead-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .lead-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--line);
    box-shadow: 0 4px 14px rgba(25, 32, 45, 0.06);
    display: grid;
    gap: 10px;
    grid-template-columns: minmax(0, 1fr) auto;
    height: auto;
    position: sticky;
    top: 0;
    width: 100%;
  }

  .brand {
    justify-content: flex-start;
  }

  .brand-logo {
    height: 42px;
    width: 42px;
  }

  nav {
    background: #f8fbfa;
    border: 1px solid var(--line);
    border-radius: 8px;
    grid-column: 1 / -1;
    order: 3;
    display: flex;
    gap: 8px;
    overflow-x: auto;
    overflow-y: visible;
    padding: 6px;
    scrollbar-width: thin;
  }

  nav a,
  nav .nav-link {
    flex: 0 0 auto;
    min-height: 40px;
    min-width: max-content;
    padding: 8px 10px;
    text-align: center;
  }

  nav a::before {
    flex-basis: 30px;
    height: 30px;
  }

  .nav-dropdown {
    position: static;
  }

  .nav-dropdown-menu {
    left: 6px;
    max-width: calc(100vw - 24px);
    position: absolute;
    top: auto;
  }

  .user-box {
    align-items: center;
    display: flex;
    justify-content: space-between;
    justify-self: end;
  }

  .main {
    margin-left: 0;
    padding: 18px;
  }

  .kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .message-templates {
    grid-template-columns: 1fr;
  }

  .patient-hero,
  .detail-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-week-panel .schedule-days-3,
  .dashboard-week-panel .schedule-days-7 {
    display: flex;
    overflow-x: auto;
  }

  .dashboard-week-panel .schedule-days-3 .schedule-day-card,
  .dashboard-week-panel .schedule-days-7 .schedule-day-card {
    flex: 0 0 220px;
    min-width: 220px;
  }

  .public-intake-hero {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 767px) {
  .mobile-bottom-nav {
    align-items: center;
    background: rgba(255, 255, 255, 0.98);
    border-top: 1px solid var(--line);
    bottom: 0;
    box-shadow: 0 -10px 30px rgba(14, 67, 69, 0.08);
    display: grid;
    gap: 2px;
    grid-template-columns: repeat(5, 1fr);
    left: 0;
    padding: 7px 8px calc(7px + env(safe-area-inset-bottom));
    position: fixed;
    right: 0;
    z-index: 95;
  }

  .mobile-bottom-link {
    align-items: center;
    background: transparent;
    border: 0;
    border-radius: 14px;
    color: #5c6672;
    display: grid;
    font: inherit;
    gap: 2px;
    justify-items: center;
    min-height: 54px;
    padding: 6px 4px;
  }

  .mobile-bottom-link span {
    font-size: 22px;
    font-weight: 900;
    line-height: 1;
  }

  .mobile-bottom-link small {
    font-size: 11px;
    font-weight: 800;
  }

  .mobile-bottom-link.active {
    background: #e8f6f1;
    color: var(--dark);
  }

  .mobile-more-backdrop {
    background: rgba(10, 20, 24, 0.32);
    display: block;
    inset: 0;
    opacity: 0;
    pointer-events: none;
    position: fixed;
    transition: opacity 180ms ease;
    z-index: 96;
  }

  .mobile-more-sheet {
    background: #fff;
    border-radius: 22px 22px 0 0;
    bottom: 0;
    box-shadow: 0 -18px 50px rgba(14, 67, 69, 0.22);
    display: grid;
    gap: 8px;
    left: 0;
    padding: 18px 18px calc(90px + env(safe-area-inset-bottom));
    position: fixed;
    right: 0;
    transform: translateY(105%);
    transition: transform 220ms cubic-bezier(.2, .8, .2, 1);
    z-index: 97;
  }

  .mobile-more-sheet header {
    align-items: center;
    display: flex;
    justify-content: space-between;
    margin-bottom: 4px;
  }

  .mobile-more-sheet header strong {
    color: var(--dark);
    font-size: 20px;
  }

  .mobile-more-sheet header button {
    background: #eef5f3;
    border: 0;
    border-radius: 999px;
    color: var(--dark);
    font-size: 24px;
    height: 38px;
    width: 38px;
  }

  .mobile-more-sheet a {
    border: 1px solid var(--line);
    border-radius: 14px;
    color: var(--ink);
    font-weight: 900;
    min-height: 46px;
    padding: 12px 14px;
  }

  body.mobile-more-open .mobile-more-backdrop {
    opacity: 1;
    pointer-events: auto;
  }

  body.mobile-more-open .mobile-more-sheet {
    transform: translateY(0);
  }

  .dashboard-shell {
    gap: 14px;
  }

  .dashboard-hero-v2 {
    gap: 12px;
    grid-template-columns: 1fr;
    padding: 20px;
  }

  .dashboard-hero-v2 .hero-icon {
    display: none;
  }

  .dashboard-hero-v2 h1 {
    font-size: 28px;
  }

  .dashboard-hero-v2 .button {
    justify-content: center;
    width: 100%;
  }

  .metric-grid-v2 {
    gap: 10px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .metric-card {
    gap: 10px;
    grid-template-columns: 1fr;
    min-height: 126px;
    padding: 14px;
  }

  .metric-icon {
    font-size: 19px;
    height: 42px;
    width: 42px;
  }

  .metric-card strong {
    font-size: 24px;
  }

  .dashboard-card {
    border-radius: 16px;
    padding: 16px;
  }

  .dashboard-card-header {
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 12px;
  }

  .dashboard-card-header h2 {
    font-size: 20px;
  }

  .operation-list {
    max-height: 330px;
  }

  .operation-row {
    gap: 8px;
    grid-template-columns: 58px 10px 1fr 24px;
    min-height: 66px;
    padding: 10px 12px;
  }

  .operation-row > span:nth-of-type(2),
  .operation-row .status-chip {
    grid-column: 3 / 4;
  }

  .operation-row .row-menu {
    grid-column: 4;
    grid-row: 1 / span 2;
  }

  .documentation-grid,
  .finance-summary-grid,
  .renewal-grid {
    grid-template-columns: 1fr;
  }

  .pipeline-grid-v2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .main {
    padding-bottom: 94px;
  }

  .app-footer {
    margin-bottom: 78px;
  }

  .lead-kpi-grid,
  .lead-form {
    grid-template-columns: 1fr;
  }

  .lead-form .span-2 {
    grid-column: span 1;
  }

  .lead-kpi-grid article {
    padding: 14px;
  }

  body.mobile-nav-open {
    overflow: hidden;
  }

  .sidebar {
    align-items: center;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 8px 24px rgba(25, 32, 45, 0.08);
    display: grid;
    gap: 8px;
    grid-template-columns: minmax(0, 1fr) auto auto;
    min-height: 58px;
    padding: 8px 12px;
    position: sticky;
    top: 0;
    z-index: 80;
  }

  .sidebar .brand {
    border-radius: 10px;
    min-width: 0;
    padding: 7px 9px;
  }

  .sidebar .brand-logo {
    height: 34px;
    padding: 4px;
    width: 34px;
  }

  .sidebar .brand strong {
    font-size: 15px;
  }

  .sidebar .brand span {
    font-size: 11px;
  }

  .mobile-menu-toggle {
    display: inline-grid;
  }

  .mobile-menu-toggle span {
    transition: transform 180ms ease, opacity 180ms ease;
  }

  body.mobile-nav-open .mobile-menu-toggle span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }

  body.mobile-nav-open .mobile-menu-toggle span:nth-child(2) {
    opacity: 0;
  }

  body.mobile-nav-open .mobile-menu-toggle span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }

  .mobile-menu-backdrop {
    background: rgba(10, 20, 24, 0.42);
    display: block;
    inset: 0;
    opacity: 0;
    pointer-events: none;
    position: fixed;
    transition: opacity 220ms ease;
    z-index: 88;
  }

  body.mobile-nav-open .mobile-menu-backdrop {
    opacity: 1;
    pointer-events: auto;
  }

  .sidebar nav {
    align-content: start;
    background: #fff;
    border: 0;
    border-right: 1px solid var(--line);
    border-radius: 0 18px 18px 0;
    box-shadow: 18px 0 46px rgba(14, 67, 69, 0.2);
    display: grid;
    gap: 8px;
    grid-column: auto;
    height: 100vh;
    left: 0;
    max-width: 320px;
    overflow-y: auto;
    padding: 82px 16px 18px;
    position: fixed;
    top: 0;
    transform: translateX(-105%);
    transition: transform 240ms cubic-bezier(.2, .8, .2, 1);
    width: min(84vw, 320px);
    z-index: 90;
  }

  body.mobile-nav-open .sidebar nav {
    transform: translateX(0);
  }

  .sidebar nav::before {
    color: var(--dark);
    content: "Menu";
    font-size: 22px;
    font-weight: 900;
    left: 18px;
    position: absolute;
    top: 24px;
  }

  .sidebar nav a,
  .sidebar nav .nav-link {
    align-items: center;
    border: 1px solid var(--line);
    border-radius: 12px;
    color: var(--ink);
    display: flex;
    font-size: 15px;
    justify-content: space-between;
    min-height: 48px;
    padding: 13px 14px;
    width: 100%;
  }

  .sidebar nav a::after,
  .sidebar nav .nav-link::after {
    color: var(--muted);
    content: "›";
    font-size: 22px;
    line-height: 1;
  }

  .sidebar nav a.active {
    background: #eef8f4;
    border-color: #c7ead8;
    color: var(--dark);
  }

  .sidebar nav .nav-section-label {
    color: var(--soft);
    display: block;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .08em;
    margin: 14px 2px 0;
    text-transform: uppercase;
  }

  .sidebar nav .nav-section-label:first-child {
    margin-top: 0;
  }

  .nav-dropdown {
    display: contents;
  }

  .nav-dropdown > .nav-link,
  .nav-dropdown-menu {
    display: none !important;
  }

  .sidebar .user-box {
    background: transparent;
    border: 0;
    display: flex;
    gap: 8px;
    justify-content: end;
    max-width: none;
    padding: 0;
  }

  .sidebar .user-box span {
    display: none;
  }

  .sidebar .logout-link {
    border-radius: 10px;
    font-size: 13px;
    min-height: 42px;
    padding: 11px 13px;
  }

  .main {
    padding: 14px 12px 24px;
  }

  .secondary-tabs {
    gap: 8px;
    margin: -4px 0 14px;
    padding-bottom: 2px;
  }

  .secondary-tabs a {
    flex: 0 0 auto;
    min-height: 42px;
    padding: 11px 13px;
  }
}

@media (max-width: 640px) {
  .public-intake-shell {
    padding: 12px;
  }

  .wizard-card {
    border-radius: 14px;
    min-height: calc(100vh - 24px);
    padding: 20px;
  }

  .sidebar {
    gap: 8px;
    padding: 10px;
  }

  .brand {
    min-width: 0;
    padding: 10px;
  }

  .brand-logo {
    height: 34px;
    width: 34px;
  }

  .brand strong {
    font-size: 16px;
  }

  .brand span {
    font-size: 12px;
  }

  nav a {
    font-size: 13px;
    min-height: 36px;
    padding: 8px 10px;
  }

  .nav-dropdown > .nav-link {
    min-width: 92px;
  }

  .dashboard-week-panel .schedule-days-3 .schedule-day-card,
  .dashboard-week-panel .schedule-days-7 .schedule-day-card {
    flex-basis: 205px;
    min-width: 205px;
  }
  .user-box {
    gap: 8px;
    max-width: none;
    padding: 0;
  }

  .user-box span {
    font-size: 13px;
    max-width: 112px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .logout-link {
    min-height: 38px;
    padding: 9px 12px;
  }

  .page-header {
    align-items: stretch;
    flex-direction: column;
    padding: 15px;
  }

  .dashboard-hero {
    gap: 12px;
    margin-bottom: 14px;
    padding: 14px;
  }

  .dashboard-hero h1 {
    font-size: 28px;
    line-height: 1.08;
  }

  .dashboard-hero .button {
    min-height: 42px;
    padding: 10px 12px;
  }

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

  .view-switch {
    justify-content: flex-start;
  }

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

  .attendance-grid article:nth-child(odd) {
    border-right: 0;
  }

  .attendance-grid article + article {
    border-top: 1px solid var(--line);
  }

  h1 {
    font-size: 25px;
  }

  .dashboard-grid,
  .form,
  .info-grid,
  .orthopedic-tests,
  .questionnaire-grid,
  .reference-gallery,
  .smart-form-grid,
  .smart-intro-panel,
  .smart-preview-grid,
  .smart-patient-strip,
  .body-map-card,
  .patient-hero {
    grid-template-columns: 1fr;
  }

  .smart-card {
    padding: 14px;
  }

  .smart-section-title {
    align-items: flex-start;
  }

  .body-map-stage {
    min-height: 360px;
    overflow-x: auto;
  }

  .body-silhouette {
    transform: scale(0.88);
    transform-origin: center;
  }

  .kpi-grid {
    gap: 10px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-bottom: 14px;
  }

  .kpi {
    gap: 4px;
    min-height: 92px;
    padding: 13px;
  }

  .kpi span {
    font-size: 13px;
  }

  .kpi strong {
    font-size: 24px;
    line-height: 1.1;
  }

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

  .patient-search {
    grid-template-columns: 1fr;
  }

  .page-actions {
    display: grid;
    justify-content: stretch;
  }

  .document-card-grid {
    grid-template-columns: 1fr;
  }

  .document-card > header,
  .document-progress-panel > div:first-child {
    display: grid;
  }

  .first-contact-form,
  .triage-head,
  .triage-fields,
  .compact-form-inner {
    grid-template-columns: 1fr;
  }

  .pre-eval-modal-card {
    border-radius: 18px 18px 0 0;
    bottom: 0;
    left: 0;
    max-height: 92vh;
    padding: 18px;
    top: auto;
    transform: none;
    width: 100%;
  }

  .pre-eval-modal-card > header {
    align-items: start;
  }

  .pre-eval-modal-actions {
    display: grid;
  }

  .first-contact-form .span-2 {
    grid-column: span 1;
  }

  .reference-card img,
  .test-card-image {
    height: auto;
    max-height: 220px;
  }

  .test-choice {
    grid-template-columns: 1fr;
  }

  .span-2 {
    grid-column: span 1;
  }

  .form-actions {
    flex-direction: column-reverse;
  }

  .day-appointment {
    grid-template-columns: 1fr;
  }

  .schedule-slot,
  .schedule-event {
    grid-template-columns: 1fr;
  }

  .month-labels {
    display: none;
  }

  .month-cells {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .month-empty {
    display: none;
  }

  .schedule-hour {
    justify-content: flex-start;
  }

  .appointment-sheet-panel {
    border-left: 0;
    border-radius: 18px 18px 0 0;
    bottom: 0;
    box-shadow: 0 -18px 44px rgba(15, 23, 42, 0.2);
    height: auto;
    max-height: 84vh;
    max-width: none;
    padding: 10px 16px 18px;
    right: 0;
    top: auto;
    transform: translateY(24px);
    width: 100%;
  }

  .appointment-sheet:target .appointment-sheet-panel {
    transform: translateY(0);
  }

  .appointment-sheet-handle {
    background: #d6e2e0;
    border-radius: 999px;
    display: block;
    height: 4px;
    margin: 0 auto 6px;
    width: 48px;
  }

  .appointment-sheet-header h2 {
    font-size: 20px;
  }

  .appointment-summary-grid {
    grid-template-columns: 1fr;
  }

  .appointment-time {
    justify-content: flex-start;
  }

  .button,
  button {
    width: 100%;
  }

  .mobile-menu-toggle {
    width: 42px;
  }

  .user-box {
    align-items: stretch;
    display: grid;
  }
}

@media (max-width: 1180px) {
  .clinical-evaluation-form {
    grid-template-columns: minmax(0, 1fr);
  }

  .clinical-rail,
  .clinical-insights {
    position: static;
  }

  .clinical-rail {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .clinical-rail strong {
    grid-column: 1 / -1;
  }

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

@media (max-width: 820px) {
  .clinical-topbar {
    grid-template-columns: 1fr;
  }

  .clinical-top-actions {
    justify-content: stretch;
  }

  .clinical-steps {
    display: flex;
    overflow-x: auto;
  }

  .clinical-step {
    min-width: 190px;
  }

  .clinical-grid,
  .clinical-grid.two,
  .clinical-triage-cards,
  .reasoning-grid,
  .test-route-grid,
  .phase-timeline,
  .clinical-insights {
    grid-template-columns: 1fr;
  }

  .clinical-rail {
    display: flex;
    overflow-x: auto;
  }

  .clinical-rail strong {
    display: none;
  }

  .clinical-rail a {
    white-space: nowrap;
  }

  .stage-heading {
    align-items: stretch;
    display: grid;
  }

  .method-tip {
    max-width: none;
  }

  .clinical-accordion summary {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .clinical-accordion summary small {
    grid-column: 1 / -1;
    text-align: left;
  }
}

/* ───── MARKETING ───── */
.mkt-page-header {
  align-items: flex-start;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 0;
  padding-bottom: 14px;
}

.mkt-page-header h1 {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -.3px;
  margin: 0 0 2px;
}

.mkt-page-header .mkt-subtitle {
  color: var(--muted);
  font-size: 13px;
  margin: 0;
}

.mkt-header-actions {
  align-items: center;
  display: flex;
  flex-shrink: 0;
  gap: 10px;
}

.mkt-date-range {
  align-items: center;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--ink);
  cursor: pointer;
  display: flex;
  font-size: 13px;
  font-weight: 600;
  gap: 6px;
  padding: 7px 12px;
  white-space: nowrap;
}

.mkt-btn-new {
  align-items: center;
  background: var(--dark);
  border: none;
  border-radius: 7px;
  color: #fff;
  cursor: pointer;
  display: flex;
  font-size: 13px;
  font-weight: 700;
  gap: 6px;
  padding: 8px 16px;
  text-decoration: none;
  white-space: nowrap;
}

.mkt-tabs {
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 0;
  margin-bottom: 20px;
  overflow-x: auto;
  scrollbar-width: none;
}

.mkt-tabs::-webkit-scrollbar { display: none; }

.mkt-tab {
  align-items: center;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  cursor: pointer;
  display: flex;
  font-size: 13.5px;
  font-weight: 600;
  gap: 6px;
  margin-bottom: -1px;
  padding: 10px 16px;
  text-decoration: none;
  white-space: nowrap;
}

.mkt-tab.active {
  border-bottom-color: var(--dark);
  color: var(--dark);
}

.mkt-tab .badge-new {
  background: #22c55e;
  border-radius: 4px;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 5px;
}

.mkt-kpi-row {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  margin-bottom: 18px;
}

.mkt-kpi {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-height: 90px;
  padding: 12px 14px;
}

.mkt-kpi-icon {
  align-items: center;
  border-radius: 7px;
  display: flex;
  font-size: 15px;
  height: 30px;
  justify-content: center;
  margin-bottom: 3px;
  width: 30px;
}

.mkt-kpi-label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
}

.mkt-kpi-value {
  color: var(--dark);
  font-size: 24px;
  font-weight: 800;
  line-height: 1;
}

.mkt-kpi-delta {
  font-size: 11.5px;
  font-weight: 600;
  margin-top: 2px;
}

.mkt-kpi-delta.up { color: #22c55e; }
.mkt-kpi-delta.down { color: #ef4444; }

.mkt-kpi-link {
  color: var(--dark);
  font-size: 12px;
  font-weight: 700;
  margin-top: 4px;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.mkt-body {
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(360px, 400px) 1fr 240px;
}

.mkt-col {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
  overflow: hidden;
}

/* Calendar */
.mkt-panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow-soft);
  padding: 16px;
}

.mkt-panel-title {
  align-items: center;
  display: flex;
  font-size: 14px;
  font-weight: 700;
  justify-content: space-between;
  margin-bottom: 12px;
}

.mkt-cal-nav {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.mkt-cal-btn {
  align-items: center;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  cursor: pointer;
  display: flex;
  font-size: 12px;
  height: 28px;
  justify-content: center;
  padding: 0 8px;
}

.mkt-cal-nav-label {
  font-size: 13px;
  font-weight: 700;
}

.mkt-cal-view-btn {
  align-items: center;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  cursor: pointer;
  display: flex;
  font-size: 12px;
  font-weight: 600;
  gap: 4px;
  height: 28px;
  padding: 0 10px;
}

.mkt-cal-grid {
  overflow: hidden;
  width: 100%;
}

.mkt-cal-grid table {
  border-collapse: collapse;
  table-layout: fixed;
  width: 100%;
}

.mkt-cal-grid th {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  overflow: hidden;
  padding: 4px 1px;
  text-align: center;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.mkt-cal-grid td {
  padding: 2px 1px;
  vertical-align: top;
  width: calc(100% / 7);
}

.mkt-cal-cell {
  border-radius: 5px;
  min-height: 48px;
  overflow: hidden;
  padding: 2px 3px;
  position: relative;
}

.mkt-cal-cell.other-month .mkt-cal-num {
  color: #ccc;
}

.mkt-cal-cell.today .mkt-cal-num {
  background: var(--dark);
  border-radius: 50%;
  color: #fff;
  height: 22px;
  line-height: 22px;
  text-align: center;
  width: 22px;
}

.mkt-cal-num {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  margin-bottom: 3px;
}

.mkt-cal-tags {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.mkt-cal-tag {
  border-radius: 3px;
  display: block;
  font-size: 9.5px;
  font-weight: 700;
  overflow: hidden;
  padding: 2px 4px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mkt-cal-tag.feed     { background: #dbeafe; color: #1d4ed8; }
.mkt-cal-tag.reels    { background: #fce7f3; color: #be185d; }
.mkt-cal-tag.stories  { background: #ffedd5; color: #c2410c; }
.mkt-cal-tag.google   { background: #dcfce7; color: #15803d; }
.mkt-cal-tag.facebook { background: #eff6ff; color: #1d4ed8; }
.mkt-cal-tag.tiktok   { background: #f0fdf4; color: #166534; }
.mkt-cal-tag.youtube  { background: #fef2f2; color: #dc2626; }

.mkt-cal-legend {
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
  padding-top: 10px;
}

.mkt-cal-legend-item {
  align-items: center;
  display: flex;
  font-size: 10.5px;
  font-weight: 600;
  gap: 4px;
}

.mkt-cal-legend-dot {
  border-radius: 3px;
  height: 10px;
  width: 10px;
}

/* Performance panel */
.mkt-perf-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mkt-perf-row {
  align-items: center;
  display: flex;
  justify-content: space-between;
}

.mkt-perf-label {
  color: var(--muted);
  font-size: 12.5px;
}

.mkt-perf-right {
  align-items: center;
  display: flex;
  gap: 8px;
}

.mkt-perf-value {
  font-size: 15px;
  font-weight: 800;
}

.mkt-perf-delta {
  font-size: 11px;
  font-weight: 700;
}

.mkt-perf-delta.up { color: #22c55e; }
.mkt-perf-delta.down { color: #ef4444; }

/* Kanban */
.mkt-kanban {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: thin;
}

.mkt-kanban-col {
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  gap: 6px;
  min-height: 200px;
  padding: 10px;
  width: 160px;
}

.mkt-kanban-col-title {
  align-items: center;
  display: flex;
  font-size: 12px;
  font-weight: 700;
  gap: 6px;
  justify-content: space-between;
  margin-bottom: 4px;
}

.mkt-kanban-count {
  background: var(--line-strong);
  border-radius: 10px;
  color: var(--ink);
  font-size: 10px;
  font-weight: 700;
  padding: 1px 7px;
}

.mkt-kanban-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 7px;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.35;
  padding: 8px 10px;
}

.mkt-kanban-card-tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  margin-top: 4px;
  padding: 2px 6px;
  border-radius: 4px;
}

.mkt-kanban-card-img {
  border-radius: 6px;
  height: 70px;
  object-fit: cover;
  width: 100%;
}

.mkt-kanban-card-img-placeholder {
  background: linear-gradient(135deg, #e2e8f0, #cbd5e1);
  border-radius: 6px;
  height: 70px;
  width: 100%;
}

.mkt-kanban-add {
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
  margin-top: auto;
  padding: 4px 0;
  text-align: center;
}

.mkt-kanban-sched {
  align-items: flex-start;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 7px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 8px 10px;
}

.mkt-kanban-sched-platform {
  align-items: center;
  display: flex;
  font-size: 10px;
  font-weight: 700;
  gap: 4px;
}

.mkt-kanban-sched-icon {
  border-radius: 4px;
  font-size: 11px;
  height: 18px;
  line-height: 18px;
  text-align: center;
  width: 18px;
}

.mkt-kanban-sched-type {
  font-size: 12px;
  font-weight: 700;
}

.mkt-kanban-sched-time {
  color: var(--muted);
  font-size: 11px;
}

.mkt-kanban-more {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 0;
  text-align: center;
}

/* Arts table */
.mkt-arts-table {
  font-size: 12.5px;
  width: 100%;
}

.mkt-arts-table thead th {
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 700;
  padding: 6px 8px;
  text-align: left;
  text-transform: uppercase;
}

.mkt-arts-table tbody td {
  border-bottom: 1px solid var(--line);
  padding: 8px 8px;
  vertical-align: middle;
}

.mkt-arts-table tbody tr:last-child td {
  border-bottom: none;
}

.mkt-art-thumb {
  background: linear-gradient(135deg, #94a3b8, #64748b);
  border-radius: 6px;
  flex-shrink: 0;
  height: 38px;
  overflow: hidden;
  width: 38px;
}

.mkt-art-thumb img {
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.mkt-art-name-cell {
  align-items: center;
  display: flex;
  gap: 8px;
}

.mkt-art-name {
  font-weight: 700;
  line-height: 1.25;
}

.mkt-status-badge {
  border-radius: 5px;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  white-space: nowrap;
}

.mkt-status-badge.revisao  { background: #fef3c7; color: #92400e; }
.mkt-status-badge.agendado { background: #dbeafe; color: #1e40af; }
.mkt-status-badge.pronta   { background: #d1fae5; color: #065f46; }
.mkt-status-badge.ideia    { background: #f3f4f6; color: #374151; }

.mkt-art-actions {
  align-items: center;
  display: flex;
  gap: 4px;
}

.mkt-art-action-btn {
  align-items: center;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 5px;
  color: var(--muted);
  cursor: pointer;
  display: flex;
  font-size: 12px;
  height: 26px;
  justify-content: center;
  width: 26px;
}

.mkt-see-all {
  color: var(--dark);
  display: inline-block;
  font-size: 12.5px;
  font-weight: 700;
  margin-top: 10px;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Platforms */
.mkt-platforms-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.mkt-platform-item {
  align-items: center;
  display: flex;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 600;
}

.mkt-plat-icon {
  border-radius: 5px;
  flex-shrink: 0;
  font-size: 9px;
  font-weight: 800;
  height: 22px;
  letter-spacing: -.3px;
  line-height: 22px;
  text-align: center;
  width: 26px;
}

.mkt-plat-name {
  flex: 1;
}

.mkt-plat-badge {
  border-radius: 4px;
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
}

.mkt-plat-badge-on  { background: #d1fae5; color: #065f46; }
.mkt-plat-badge-off { background: #f3f4f6; color: #6b7280; }

/* Campaigns */
.mkt-campaigns-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mkt-campaign-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
}

.mkt-campaign-header {
  align-items: flex-start;
  display: flex;
  gap: 8px;
  margin-bottom: 6px;
}

.mkt-campaign-icon {
  border-radius: 6px;
  flex-shrink: 0;
  font-size: 14px;
  height: 28px;
  line-height: 28px;
  text-align: center;
  width: 28px;
}

.mkt-campaign-name {
  flex: 1;
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.3;
}

.mkt-campaign-active {
  background: #d1fae5;
  border-radius: 5px;
  color: #065f46;
  flex-shrink: 0;
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 7px;
}

.mkt-campaign-meta {
  color: var(--muted);
  font-size: 12px;
}

.mkt-campaign-meta strong {
  color: var(--ink);
  font-weight: 700;
}

.mkt-campaign-bar-wrap {
  background: var(--line);
  border-radius: 3px;
  height: 4px;
  margin-top: 8px;
  overflow: hidden;
  width: 100%;
}

.mkt-campaign-bar {
  background: var(--dark);
  border-radius: 3px;
  height: 100%;
}

/* Responsive */
@media (max-width: 1400px) {
  .mkt-body {
    grid-template-columns: minmax(320px, 360px) 1fr 220px;
  }
}

@media (max-width: 1200px) {
  .mkt-kpi-row {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .mkt-body {
    grid-template-columns: 1fr 1fr;
  }

  .mkt-col:last-child {
    grid-column: 1 / -1;
    flex-direction: row;
    flex-wrap: wrap;
  }

  .mkt-col:last-child .mkt-panel {
    flex: 1;
    min-width: 200px;
  }
}

@media (max-width: 900px) {
  .mkt-kpi-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mkt-body {
    grid-template-columns: 1fr;
  }

  .mkt-col:last-child {
    flex-direction: column;
  }

  .mkt-kanban-col {
    width: 145px;
  }
}

/* ── Coming soon ── */
.mkt-coming-soon {
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 60px 40px;
  text-align: center;
}
.mkt-coming-icon { font-size: 40px; }
.mkt-coming-soon h2 { font-size: 20px; font-weight: 800; margin: 0; }
.mkt-coming-soon p { color: var(--muted); font-size: 14px; margin: 0; }

/* ── CRM KPI Row ── */
.crm-kpi-row {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  margin-bottom: 20px;
}
.crm-kpi {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow-soft);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-height: 90px;
  padding: 12px 14px;
  transition: box-shadow .15s, transform .15s;
}
.crm-kpi:hover { box-shadow: 0 4px 16px rgba(0,0,0,.12); transform: translateY(-2px); }
.crm-kpi-icon {
  align-items: center;
  border-radius: 7px;
  display: flex;
  font-size: 15px;
  height: 30px;
  justify-content: center;
  margin-bottom: 3px;
  width: 30px;
}
.crm-kpi-label { color: var(--muted); font-size: 11px; font-weight: 600; line-height: 1.2; }
.crm-kpi-value { color: var(--dark); font-size: 24px; font-weight: 800; line-height: 1; }
.crm-kpi-delta { font-size: 11px; font-weight: 600; margin-top: 2px; }
.crm-kpi-delta.up { color: #22c55e; }
.crm-kpi-delta.down { color: #ef4444; }
.crm-kpi-link { color: var(--dark); font-size: 11px; font-weight: 700; margin-top: 2px; text-decoration: underline; text-underline-offset: 2px; }

/* ── CRM body layout ── */
.crm-body {
  display: grid;
  gap: 16px;
  grid-template-columns: 1fr 280px;
}
.crm-main { display: flex; flex-direction: column; gap: 0; min-width: 0; }
.crm-sidebar { display: flex; flex-direction: column; gap: 16px; }
.crm-section-title { font-size: 14px; font-weight: 800; margin-bottom: 12px; }
.crm-panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow-soft);
  padding: 16px;
}
.crm-panel-title { font-size: 13px; font-weight: 800; margin-bottom: 12px; }

/* ── CRM Kanban ── */
.crm-kanban {
  display: flex;
  gap: 10px;
  margin-bottom: 24px;
  min-height: 300px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: thin;
}
.crm-kanban-col {
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  gap: 8px;
  min-height: 200px;
  padding: 10px;
  width: 200px;
}
.crm-kanban-col-header {
  align-items: center;
  display: flex;
  gap: 6px;
  margin-bottom: 4px;
}
.crm-kanban-col-dot { border-radius: 50%; flex-shrink: 0; height: 8px; width: 8px; }
.crm-kanban-col-title { flex: 1; font-size: 12px; font-weight: 800; }
.crm-kanban-col-count {
  border-radius: 10px;
  font-size: 10px;
  font-weight: 800;
  padding: 1px 8px;
}
.crm-lead-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  padding: 10px;
  transition: box-shadow .15s, transform .12s;
}
.crm-lead-card:hover { box-shadow: 0 3px 10px rgba(0,0,0,.1); transform: translateY(-1px); }
.crm-lead-card-name { font-size: 12.5px; font-weight: 700; margin-bottom: 4px; }
.crm-lead-card-meta { display: flex; gap: 6px; margin-bottom: 4px; }
.crm-lead-origin { background: #f1f5f9; border-radius: 4px; color: var(--muted); font-size: 10px; font-weight: 700; padding: 1px 6px; }
.crm-lead-card-complaint { color: var(--muted); font-size: 11px; line-height: 1.3; margin-bottom: 6px; min-height: 14px; }
.crm-lead-card-footer { align-items: center; display: flex; justify-content: space-between; }
.crm-lead-date { color: var(--muted); font-size: 10px; }
.crm-lead-wa {
  background: #dcfce7;
  border-radius: 4px;
  color: #15803d;
  font-size: 10px;
  font-weight: 800;
  padding: 2px 7px;
  text-decoration: none;
}
.crm-kanban-empty { color: var(--muted); font-size: 11px; padding: 8px 0; text-align: center; }
.crm-kanban-more { color: var(--muted); font-size: 11px; font-weight: 600; text-align: center; }
.crm-kanban-add {
  color: var(--muted);
  display: block;
  font-size: 11px;
  font-weight: 700;
  margin-top: auto;
  padding: 4px 0;
  text-align: center;
  text-decoration: none;
}
.crm-kanban-add:hover { color: var(--dark); }

/* ── CRM Follow-up ── */
.crm-followup-item {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 10px;
  padding: 8px 0;
}
.crm-followup-item:last-child { border-bottom: none; }
.crm-followup-icon {
  align-items: center;
  border-radius: 7px;
  display: flex;
  flex-shrink: 0;
  font-size: 14px;
  height: 28px;
  justify-content: center;
  width: 28px;
}
.crm-followup-text { display: flex; flex: 1; flex-direction: column; gap: 1px; }
.crm-followup-title { font-size: 11.5px; font-weight: 700; }
.crm-followup-desc { color: var(--muted); font-size: 10.5px; }
.crm-followup-action {
  border: 1px solid var(--line);
  border-radius: 5px;
  color: var(--ink);
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  text-decoration: none;
  white-space: nowrap;
}

/* ── CRM Origin chart ── */
.crm-origin-row {
  align-items: center;
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}
.crm-origin-name { color: var(--ink); flex-shrink: 0; font-size: 11.5px; font-weight: 600; width: 75px; }
.crm-origin-bar-wrap { background: var(--line); border-radius: 3px; flex: 1; height: 6px; overflow: hidden; }
.crm-origin-bar { border-radius: 3px; height: 100%; transition: width .3s; }
.crm-origin-pct { color: var(--muted); flex-shrink: 0; font-size: 11px; width: 32px; text-align: right; }

/* ── CRM Table ── */
.crm-table { border-collapse: collapse; font-size: 12.5px; width: 100%; }
.crm-table thead th {
  background: var(--soft);
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  padding: 8px 10px;
  text-align: left;
  white-space: nowrap;
}
.crm-table tbody td {
  border-bottom: 1px solid var(--line);
  padding: 8px 10px;
  vertical-align: middle;
}
.crm-table tbody tr:hover { background: var(--soft); }
.crm-status-badge { border-radius: 5px; font-size: 10.5px; font-weight: 700; padding: 2px 8px; white-space: nowrap; }
.crm-table-actions { display: flex; gap: 4px; }
.crm-act-btn {
  align-items: center;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 5px;
  color: var(--ink);
  display: flex;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 7px;
  text-decoration: none;
}
.crm-act-btn.wa { background: #dcfce7; border-color: #bbf7d0; color: #15803d; }
.crm-act-btn:hover { background: var(--line); }

/* ── CRM Modal ── */
.crm-modal {
  border: none;
  border-radius: 12px;
  box-shadow: 0 8px 40px rgba(0,0,0,.2);
  max-width: 480px;
  padding: 0;
  width: 90%;
}
.crm-modal::backdrop { background: rgba(0,0,0,.4); }
.crm-modal-content { display: flex; flex-direction: column; }
.crm-modal-header {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  padding: 16px 20px;
}
.crm-modal-header h3 { font-size: 16px; font-weight: 800; margin: 0; }
.crm-modal-close {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
  padding: 0 4px;
}
.crm-modal-body { display: flex; flex-direction: column; gap: 0; padding: 8px 0; }
.crm-modal-row {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 12px;
  justify-content: space-between;
  padding: 10px 20px;
}
.crm-modal-row:last-child { border-bottom: none; }
.crm-modal-row span { color: var(--muted); font-size: 12px; }
.crm-modal-row strong { font-size: 13px; }
.crm-modal-footer {
  border-top: 1px solid var(--line);
  display: flex;
  gap: 10px;
  padding: 14px 20px;
}
.crm-modal-btn {
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--ink);
  display: flex;
  flex: 1;
  font-size: 13px;
  font-weight: 700;
  gap: 6px;
  justify-content: center;
  padding: 9px 14px;
  text-decoration: none;
}
.crm-modal-btn.wa { background: #dcfce7; border-color: #bbf7d0; color: #15803d; }
.crm-modal-btn:hover { background: var(--soft); }

/* ── CRM Responsive ── */
@media (max-width: 1200px) {
  .crm-kpi-row { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .crm-body { grid-template-columns: 1fr 240px; }
}
@media (max-width: 900px) {
  .crm-kpi-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .crm-body { grid-template-columns: 1fr; }
}

/* CRM modal form fields */
.crm-modal-row label { color: var(--muted); font-size: 12px; font-weight: 600; min-width: 90px; }
.crm-modal-row input,
.crm-modal-row select,
.crm-modal-row textarea {
  border: 1px solid var(--line);
  border-radius: 6px;
  flex: 1;
  font-size: 13px;
  padding: 7px 10px;
  width: 100%;
}
.crm-modal-row { flex-direction: column; gap: 4px; }
.crm-modal-body { gap: 0; }

/* Kanban drag-over highlight */
.crm-kanban-col.drag-over { outline: 2px dashed #0ea5e9; background: #f0f9ff; }
.crm-lead-card.dragging { opacity: 0.5; }
.crm-kanban-cards { display: flex; flex-direction: column; gap: 8px; flex: 1; min-height: 60px; }

/* ── Integrations page ── */
.integ-dashboard-wrap { align-items: center; display: flex; }
.integ-dashboard { display: flex; gap: 20px; }
.integ-dashboard .integ-stat { background: var(--soft); border: 1px solid var(--line); border-radius: 8px; display: flex; flex-direction: column; gap: 2px; padding: 10px 16px; text-align: center; }
.integ-dashboard .integ-stat strong { font-size: 22px; font-weight: 800; }
.integ-dashboard .integ-stat span { color: var(--muted); font-size: 11px; }
.integ-section-title { font-size: 15px; font-weight: 800; margin: 24px 0 14px; }
.integ-grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); }
.integ-card { background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-soft); overflow: hidden; }
.integ-card-header { align-items: flex-start; display: flex; gap: 14px; padding: 18px 18px 12px; }
.integ-icon { align-items: center; border-radius: 10px; display: flex; flex-shrink: 0; font-size: 20px; height: 44px; justify-content: center; width: 44px; }
.integ-card-info { flex: 1; }
.integ-card-info strong { display: block; font-size: 14px; font-weight: 800; margin-bottom: 2px; }
.integ-desc { color: var(--muted); font-size: 12px; margin: 0; }
.integ-badge { border-radius: 20px; font-size: 11px; font-weight: 700; padding: 3px 10px; white-space: nowrap; }
.integ-badge.on { background: #d1fae5; color: #065f46; }
.integ-badge.off { background: #f3f4f6; color: #6b7280; }
.integ-stats { border-top: 1px solid var(--line); display: flex; gap: 16px; padding: 10px 18px; }
.integ-stat { display: flex; flex-direction: column; }
.integ-stat strong { font-size: 18px; font-weight: 800; }
.integ-stat span { color: var(--muted); font-size: 11px; }
.integ-form { border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; padding: 14px 18px; }
.integ-label { display: flex; flex-direction: column; font-size: 11.5px; font-weight: 700; gap: 4px; }
.integ-label input { border: 1px solid var(--line); border-radius: 6px; font-size: 13px; padding: 7px 10px; width: 100%; }
.integ-info { background: #f0f9ff; border-left: 3px solid #0ea5e9; border-radius: 4px; color: #0369a1; font-size: 11.5px; margin-top: 4px; padding: 6px 10px; }
.integ-info code { background: #e0f2fe; border-radius: 3px; font-family: monospace; padding: 1px 5px; }
.integ-actions { display: flex; gap: 8px; margin-top: 4px; }
.integ-btn { border: 1px solid var(--line); border-radius: 6px; cursor: pointer; font-size: 12.5px; font-weight: 700; padding: 7px 14px; }
.integ-btn.primary { background: var(--dark); border-color: var(--dark); color: #fff; }
.integ-btn.danger { background: #fee2e2; border-color: #fca5a5; color: #dc2626; }
.integ-btn:hover:not(.primary) { background: var(--soft); }
.integ-error { background: #fee2e2; color: #dc2626; font-size: 11.5px; margin: 0 18px 12px; padding: 6px 10px; border-radius: 6px; }
.integ-lastsync { color: var(--muted); font-size: 11px; padding: 6px 18px 12px; }
/* Logs */
.integ-logs { background: #fff; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.integ-log-item { align-items: center; border-bottom: 1px solid var(--line); display: flex; gap: 10px; padding: 8px 14px; font-size: 12px; }
.integ-log-item:last-child { border-bottom: none; }
.integ-log-item.error { background: #fff5f5; }
.integ-log-plat { background: #f1f5f9; border-radius: 4px; color: #475569; font-size: 10.5px; font-weight: 700; padding: 1px 7px; white-space: nowrap; }
.integ-log-msg { flex: 1; }
.integ-log-time { color: var(--muted); font-size: 10.5px; white-space: nowrap; }
.integ-log-empty { color: var(--muted); font-size: 13px; padding: 24px; text-align: center; }

@media print {
  .sidebar,
  .page-header .button,
  form,
  .button {
    display: none !important;
  }

  .app-shell {
    display: block;
  }

  .main {
    margin-left: 0;
    padding: 0;
  }

  .panel {
    box-shadow: none;
  }
}

/* ═══════════════════════════════════════════════════════════════════
   TIPOGRAFIA — Inter (hierarchy clean)
   ═══════════════════════════════════════════════════════════════════ */

h1, h2, h3, h4 { font-weight: 700; line-height: 1.2; }
h1 { font-size: 22px; }
h2 { font-size: 16px; font-weight: 600; }
h3 { font-size: 14px; font-weight: 600; }

table th            { font-weight: 600; }
table td            { font-weight: 400; }
.button             { font-weight: 500; }
.pill               { font-weight: 500; }
.eyebrow            { font-weight: 500; letter-spacing: 0.04em; font-size: 11.5px; text-transform: uppercase; }
.page-subtitle      { font-weight: 400; color: var(--muted); font-size: 13.5px; margin-top: 4px; }
.nav-section-label  { font-size: 10px; font-weight: 600; letter-spacing: 0.07em; text-transform: uppercase; }
.muted              { color: var(--muted); font-weight: 400; }
.back-link          { color: var(--muted); font-size: 13px; font-weight: 500; }
.back-link:hover    { color: var(--dark); }

/* ═══════════════════════════════════════════════════════════════════
   BOTÃO DOCS NA TABELA DE PACIENTES
   ═══════════════════════════════════════════════════════════════════ */

.row-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.icon-btn {
  align-items: center;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--dark);
  display: inline-flex;
  font-size: 15px;
  height: 32px;
  justify-content: center;
  transition: background 0.15s, border-color 0.15s;
  width: 32px;
}

.icon-btn:hover {
  background: #e0f2eb;
  border-color: var(--green);
  color: var(--dark);
}

/* ═══════════════════════════════════════════════════════════════════
   BADGES DE STATUS DOCUMENTAL
   ═══════════════════════════════════════════════════════════════════ */

.doc-badge {
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  font-size: 11.5px;
  font-weight: 600;
  gap: 5px;
  letter-spacing: 0.01em;
  padding: 3px 9px;
  white-space: nowrap;
}

.doc-badge::before {
  border-radius: 50%;
  content: '';
  display: inline-block;
  flex: 0 0 6px;
  height: 6px;
  width: 6px;
}

.doc-badge-notgen              { background: #f1f3f5; color: #6b7280; }
.doc-badge-notgen::before      { background: #9ca3af; }
.doc-badge-gerado              { background: #eff6ff; color: #1d4ed8; }
.doc-badge-gerado::before      { background: #3b82f6; }
.doc-badge-pendente            { background: #fffbeb; color: #b45309; }
.doc-badge-pendente::before    { background: #f59e0b; }
.doc-badge-assinado            { background: #ecfdf5; color: #065f46; }
.doc-badge-assinado::before    { background: #10b981; }

/* ═══════════════════════════════════════════════════════════════════
   PÁGINA: DOCUMENTOS DO PACIENTE
   ═══════════════════════════════════════════════════════════════════ */

.patient-doc-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.patient-doc-identity {
  display: flex;
  align-items: center;
  gap: 18px;
}

.patient-avatar-circle {
  align-items: center;
  background: linear-gradient(135deg, var(--dark), #2d6b52);
  border-radius: 50%;
  color: #fff;
  display: flex;
  flex: 0 0 52px;
  font-size: 18px;
  font-weight: 700;
  height: 52px;
  justify-content: center;
  letter-spacing: 0.02em;
  width: 52px;
}

.patient-doc-name   { font-size: 18px; font-weight: 700; margin: 0 0 6px; color: var(--ink); }

.patient-doc-details {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  font-size: 13px;
  gap: 10px;
  color: var(--muted);
}

.patient-doc-progress {
  align-items: flex-end;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 190px;
  text-align: right;
}

.progress-pct   { font-size: 30px; font-weight: 700; color: var(--dark); line-height: 1; }
.progress-label { font-size: 12px; color: var(--muted); font-weight: 400; }

.doc-progress-slim {
  background: var(--line);
  border-radius: 4px;
  height: 6px;
  overflow: hidden;
  width: 190px;
}

.doc-progress-slim span {
  background: linear-gradient(90deg, #84c6a0, #0e4345);
  border-radius: 4px;
  display: block;
  height: 100%;
  transition: width 0.4s ease;
}

.panel-hd {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  margin-bottom: 0;
  padding-bottom: 14px;
  flex-wrap: wrap;
  gap: 10px;
}

.panel-hd h2 { margin: 0; }

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

.doc-list-head {
  color: var(--muted);
  display: grid;
  font-size: 11.5px;
  font-weight: 600;
  gap: 12px;
  grid-template-columns: 1fr 170px 150px 1fr;
  letter-spacing: 0.04em;
  padding: 12px 16px 8px;
  text-transform: uppercase;
}

.doc-list { display: flex; flex-direction: column; }

.doc-row {
  border-bottom: 1px solid var(--line);
  display: grid;
  align-items: center;
  gap: 12px;
  grid-template-columns: 1fr 170px 150px 1fr;
  padding: 14px 16px;
  transition: background 0.12s;
}

.doc-row:last-child { border-bottom: none; }
.doc-row:hover      { background: var(--soft); }

.doc-row-name     { display: flex; flex-direction: column; gap: 3px; }
.doc-row-title    { font-size: 14px; font-weight: 600; color: var(--ink); }
.doc-row-stage    { color: var(--muted); font-size: 12px; font-weight: 400; }
.doc-row-status   { display: flex; align-items: center; }

.doc-row-dates {
  align-items: center;
  color: var(--muted);
  display: flex;
  font-size: 12.5px;
  gap: 6px;
}

.doc-date-item   { font-variant-numeric: tabular-nums; }
.doc-date-sep    { color: var(--line-strong); }
.doc-signed-at   { color: #065f46; }

.doc-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.doc-action-btn {
  border: 1px solid transparent;
  border-radius: 7px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1;
  padding: 6px 12px;
  text-align: center;
  transition: background 0.14s, opacity 0.14s;
  white-space: nowrap;
}

.doc-action-btn:disabled { cursor: not-allowed; opacity: 0.4; }

.doc-action-primary          { background: var(--dark); color: #fff; }
.doc-action-primary:hover    { background: #0a3436; color: #fff; }
.doc-action-ghost            { background: transparent; border-color: var(--line-strong); color: var(--ink); }
.doc-action-ghost:hover      { background: var(--soft); }

.doc-manage          { grid-column: 1 / -1; }
.doc-manage summary  { color: var(--muted); cursor: pointer; font-size: 12px; font-weight: 500; padding: 4px 0; user-select: none; }
.doc-manage summary:hover { color: var(--dark); }

.doc-manage-form {
  border-top: 1px solid var(--line);
  display: grid;
  gap: 10px 16px;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  margin-top: 10px;
  padding-top: 12px;
}

.doc-manage-form label { display: flex; flex-direction: column; font-size: 12px; font-weight: 500; gap: 4px; color: var(--muted); }
.doc-manage-form input,
.doc-manage-form select { border: 1px solid var(--line-strong); border-radius: 6px; font-family: inherit; font-size: 13px; padding: 6px 8px; }
.doc-manage-actions { grid-column: 1 / -1; }

/* ═══════════════════════════════════════════════════════════════════
   PENDÊNCIAS DOCUMENTAIS — KPIs
   ═══════════════════════════════════════════════════════════════════ */

.kpi-row {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  margin-bottom: 24px;
}

.kpi-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-left: 4px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 20px 22px;
}

.kpi-card.kpi-alert { border-left-color: #ef4444; }
.kpi-card.kpi-warn  { border-left-color: #f59e0b; }
.kpi-card.kpi-ok    { border-left-color: #10b981; }

.kpi-value  { display: block; font-size: 32px; font-weight: 700; line-height: 1; color: var(--ink); }
.kpi-label  { color: var(--muted); font-size: 13px; font-weight: 400; }

.col-alert  { color: #dc2626; font-weight: 600; }
.col-warn   { color: #b45309; font-weight: 600; }

/* ═══════════════════════════════════════════════════════════════════
   RESPONSIVO — Mobile
   ═══════════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
  .doc-list-head { display: none; }

  .doc-row {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 16px;
  }

  .doc-row-dates { flex-wrap: wrap; }

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

  .patient-doc-progress {
    align-items: flex-start;
    text-align: left;
    width: 100%;
  }

  .doc-progress-slim { width: 100%; }

  .kpi-row { grid-template-columns: 1fr 1fr; }
}
