/* CURA SENES — sistema visual conforme o "Guia de Identidade Visual Cura Senes".
   Paleta: Verde Sálvia, Rosa Suave, Bege Claro, Cinza Quente, Marrom Suave e Blush.
   Tipografia: Playfair Display (títulos e destaques) e Inter (textos, menus e conteúdos).
   Botões usam tons mais profundos das cores do guia para manter contraste AA com texto branco;
   os tons claros do guia aparecem em fundos, destaques e superfícies.
   Controles com no mínimo 44px para uso por toque. */

@font-face {
  font-family: "Inter";
  src: url("../fonts/inter-latin.ebdd319644fc.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "Playfair Display";
  src: url("../fonts/playfair-latin.d8ae5ac4c89d.woff2") format("woff2");
  font-weight: 400 900;
  font-display: swap;
}

:root {
  /* Guia: Bege Claro #F7F1EA, Cinza Quente #A7A199, Marrom Suave #6B645E */
  --paper: #f7f1ea;
  --paper-deep: #efe7df;
  --surface: #fffcf9;
  --line: #e8ded5;
  --line-strong: #d6cbc1;
  --warm-gray: #a7a199;

  --ink: #4a4440;
  --ink-2: #6b645e;
  --ink-3: #8e867e;

  /* Guia: Blush #EAD4CE, Rosa Suave #D9B6B2 */
  --blush-50: #f6eae6;
  --blush-100: #ead4ce;
  --blush-300: #d9b6b2;
  --rose-600: #9b625d;
  --rose-700: #82504b;

  /* Guia: Verde Sálvia (amostra da paleta: #768375) */
  --sage-50: #eef0eb;
  --sage-100: #dde2d8;
  --sage-400: #768375;
  --sage-600: #647264;
  --sage-700: #4e5b50;
  --brand-ink: #4e5b50;

  --ok: #3f6b48;
  --ok-bg: #e3eee4;
  --danger: #a33a30;
  --danger-bg: #f8e1de;
  --warn: #8a5a12;
  --warn-bg: #fbebd6;
  --info: #3d6480;
  --info-bg: #e2ecf3;

  --radius-s: 10px;
  --radius-m: 14px;
  --radius-l: 18px;
  --shadow: 0 1px 2px rgb(74 68 64 / 5%), 0 6px 18px rgb(74 68 64 / 5%);
  --focus: 0 0 0 3px rgb(155 98 93 / 32%);

  --font-ui: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-display: "Playfair Display", Georgia, "Times New Roman", serif;

  --sidebar-w: 248px;
  --gutter: clamp(16px, 3vw, 32px);
  --touch: 44px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1rem/1.55 var(--font-ui);
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; }
a { color: var(--rose-700); text-underline-offset: 3px; }
a:hover { color: var(--rose-600); }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 6px; }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; color: var(--ink); }
h1, h2 { font-family: var(--font-display); font-weight: 600; letter-spacing: -0.01em; }
h1 { font-size: clamp(1.7rem, 1.3rem + 1.4vw, 2.25rem); }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.05rem; font-weight: 600; }
p { margin: 0 0 0.75em; }
.muted { color: var(--ink-2); }
.small { font-size: 0.875rem; }
.nowrap { white-space: nowrap; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--surface); padding: 8px 14px; }
.skip-link:focus { left: 8px; }
.env-banner { margin: 0; padding: 6px var(--gutter, 16px); background: var(--warn-bg); color: var(--warn); font-size: .875rem; font-weight: 600; text-align: center; }

.icon { width: 1.25em; height: 1.25em; flex: none; vertical-align: -0.25em; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.icon--l { width: 1.6em; height: 1.6em; }
.icon--xl { width: 2.4em; height: 2.4em; stroke-width: 1.4; }

/* Estrutura ---------------------------------------------------------------- */
.shell { min-height: 100vh; display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); }
.sidebar {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  display: flex; flex-direction: column; gap: 4px;
  padding: 22px 14px; background: var(--paper-deep); border-right: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 22px; text-decoration: none; color: var(--ink); }
.brand__mark { width: 38px; height: 38px; flex: none; }
.brand__name { font-family: var(--font-ui); font-size: 1.3rem; font-weight: 700; letter-spacing: 0.03em; line-height: 1; white-space: nowrap; }
.brand__cura { color: var(--brand-cura); }
.brand__senes { color: var(--brand-senes); }
.brand__sub { display: block; font-family: var(--font-ui); font-size: 0.72rem; letter-spacing: 0; color: var(--sage-600); font-weight: 600; margin-top: 4px; line-height: 1.25; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
  display: flex; align-items: center; gap: 12px; min-height: var(--touch);
  padding: 8px 12px; border-radius: var(--radius-s);
  color: var(--ink-2); text-decoration: none; font-weight: 500;
}
.nav a:hover { background: rgb(255 255 255 / 55%); color: var(--ink); }
.nav a.is-active { background: var(--surface); color: var(--rose-700); box-shadow: inset 3px 0 0 var(--rose-600); }
.nav__group { margin-top: 18px; padding: 0 12px 6px; font-size: 0.8rem; color: var(--ink-3); font-weight: 600; }
.sidebar__footer { margin-top: auto; padding-top: 16px; border-top: 1px solid var(--line); }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 8px 10px; }
.avatar {
  width: 36px; height: 36px; border-radius: 50%; flex: none;
  display: grid; place-items: center; background: var(--blush-100); color: var(--rose-700);
  font-weight: 700; font-size: 0.95rem;
}
.user-chip__name { font-weight: 600; font-size: 0.95rem; line-height: 1.2; }
.user-chip__meta { font-size: 0.8rem; color: var(--ink-2); }

.topbar, .nav-scrim { display: none; }
.main { min-width: 0; padding: 28px var(--gutter) 64px; }
.container { max-width: 1180px; margin: 0 auto; }
.container--narrow { max-width: 860px; }

.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.page-head__text { min-width: 0; }
.page-head p { margin: 6px 0 0; color: var(--ink-2); }
.page-head__actions { display: flex; flex-wrap: wrap; gap: 10px; }
.breadcrumb { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 10px; padding: 0; list-style: none; font-size: 0.9rem; color: var(--ink-2); }
.breadcrumb li + li::before { content: "/"; margin-right: 6px; color: var(--line-strong); }
.breadcrumb a { color: var(--ink-2); }

/* Superfícies ---------------------------------------------------------------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l); box-shadow: var(--shadow); }
.panel__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px 0; }
.panel__body { padding: 18px 22px 22px; }
.panel__body--flush { padding: 8px 0 0; }
.panel + .panel { margin-top: 20px; }
.grid { display: grid; gap: 20px; }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--main-side { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; }
.stack > * + * { margin-top: 20px; }
.row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.row--between { justify-content: space-between; }
.divider { border: 0; border-top: 1px solid var(--line); margin: 20px 0; }

/* Indicadores do início: faixa única, não cartões repetidos */
.summary {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l);
  box-shadow: var(--shadow); margin-bottom: 24px;
}
.summary__item { padding: 18px 22px; text-decoration: none; color: inherit; display: block; }
.summary__item + .summary__item { border-left: 1px solid var(--line); }
.summary__value { font-family: var(--font-display); font-size: 2rem; line-height: 1; font-weight: 600; color: var(--ink); }
.summary__label { margin-top: 6px; color: var(--ink-2); font-size: 0.92rem; }
a.summary__item:hover .summary__value { color: var(--rose-700); }

/* Saudação */
.greeting { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 24px; }
.greeting h1 { font-size: clamp(1.9rem, 1.4rem + 1.8vw, 2.6rem); }
.greeting__date { color: var(--ink-2); margin-top: 4px; }

/* Botões --------------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: var(--touch); padding: 10px 18px; border-radius: var(--radius-s);
  border: 1px solid transparent; font: 600 0.97rem/1.2 var(--font-ui);
  text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}
.btn--primary { background: var(--rose-600); color: #fff; }
.btn--primary:hover { background: var(--rose-700); color: #fff; }
.btn--secondary { background: var(--sage-50); color: var(--sage-700); border-color: var(--sage-100); }
.btn--secondary:hover { background: var(--sage-100); color: var(--sage-700); }
.btn--ghost { background: transparent; color: var(--ink-2); border-color: var(--line-strong); }
.btn--ghost:hover { background: var(--surface); color: var(--ink); }
.btn--danger { background: var(--surface); color: var(--danger); border-color: #e3b9b2; }
.btn--danger:hover { background: var(--danger-bg); color: var(--danger); }
.btn--small { min-height: 36px; padding: 6px 12px; font-size: 0.9rem; }
.btn--block { width: 100%; }
.btn[disabled], .btn.is-loading { opacity: 0.6; cursor: not-allowed; }
.btn.is-loading::after {
  content: ""; width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid currentColor; border-right-color: transparent; animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.link-btn { background: none; border: 0; padding: 0; font: inherit; color: var(--rose-700); text-decoration: underline; cursor: pointer; }

/* Mensagens ------------------------------------------------------------------ */
.messages { list-style: none; margin: 0 0 20px; padding: 0; display: grid; gap: 10px; }
.alert {
  display: flex; gap: 12px; align-items: flex-start; padding: 12px 16px;
  border-radius: var(--radius-m); border: 1px solid; background: var(--info-bg); color: var(--info); border-color: #cddbe5;
}
.alert--success { background: var(--sage-50); color: var(--sage-700); border-color: var(--sage-100); }
.alert--error { background: var(--danger-bg); color: var(--danger); border-color: #edc6bf; }
.alert--warning { background: var(--warn-bg); color: var(--warn); border-color: #ead7ad; }
.alert p:last-child { margin: 0; }
.alert__body { flex: 1; }

/* Badges ---------------------------------------------------------------------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px;
  font-size: 0.8rem; font-weight: 600; line-height: 1.4; white-space: nowrap;
  background: var(--paper-deep); color: var(--ink-2);
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge--draft { background: var(--warn-bg); color: var(--warn); }
.badge--final, .badge--ok { background: var(--sage-50); color: var(--sage-700); }
.badge--info { background: var(--info-bg); color: var(--info); }
.badge--warn { background: var(--blush-50); color: var(--rose-700); }

/* Formulários ----------------------------------------------------------------- */
.form-section { padding: 22px; }
.form-section + .form-section { border-top: 1px solid var(--line); }
.form-section__title { margin-bottom: 4px; color: var(--sage-700); }
.form-section__intro { color: var(--ink-2); margin: 0 0 16px; font-size: 0.95rem; }
.fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px 18px; }
.fields--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.field { min-width: 0; }
.field--wide { grid-column: 1 / -1; }
.field[hidden] { display: none; }
.field__label { display: block; margin-bottom: 6px; font-weight: 600; font-size: 0.93rem; }
.field__label .req { color: var(--rose-600); margin-left: 2px; }
.field__hint { margin-top: 5px; font-size: 0.85rem; color: var(--ink-2); }
.field__error { margin-top: 5px; font-size: 0.87rem; color: var(--danger); font-weight: 500; }
.field__control { position: relative; display: flex; align-items: center; }
.field__suffix { position: absolute; right: 12px; color: var(--ink-3); font-size: 0.9rem; pointer-events: none; }

input[type="text"], input[type="email"], input[type="password"], input[type="tel"], input[type="number"],
input[type="date"], input[type="datetime-local"], input[type="time"], input[type="search"], select, textarea {
  width: 100%; min-height: var(--touch); padding: 10px 12px;
  background: #fff; color: var(--ink); border: 1px solid var(--line-strong); border-radius: var(--radius-s);
  font: 400 1rem/1.4 var(--font-ui);
}
textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
select { appearance: none; padding-right: 36px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23665c56' stroke-width='1.6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--rose-600); box-shadow: var(--focus); }
.field.has-error input, .field.has-error select, .field.has-error textarea { border-color: var(--danger); }
input[type="file"] { width: 100%; padding: 10px; border: 1px dashed var(--line-strong); border-radius: var(--radius-s); background: #fff; min-height: var(--touch); }

/* Seleções como "pílulas" tocáveis (rádio e múltipla escolha) */
.choices-fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.choices { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; border: 0; }
.choices > div { display: contents; }
.choices label {
  position: relative; display: inline-flex; align-items: center; gap: 8px; min-height: 40px;
  padding: 8px 14px; border: 1px solid var(--line-strong); border-radius: 999px; background: #fff;
  cursor: pointer; font-size: 0.95rem; user-select: none;
}
.choices input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.choices label:has(input:checked) { background: var(--sage-50); border-color: var(--sage-600); color: var(--sage-700); font-weight: 600; }
.choices label:has(input:checked)::before {
  content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--sage-600);
}
.choices label:has(input:focus-visible) { box-shadow: var(--focus); }
.check { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.check input { width: 22px; height: 22px; margin: 1px 0 0; accent-color: var(--rose-600); flex: none; }
.form-actions {
  position: sticky; bottom: 0; z-index: 5; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px;
  padding: 14px 22px; background: rgb(255 252 247 / 94%); border-top: 1px solid var(--line);
  border-radius: 0 0 var(--radius-l) var(--radius-l); backdrop-filter: blur(6px);
}
.form-actions--plain { position: static; background: none; border: 0; padding: 0; }
.form-errors { margin: 0 22px; }

/* Listas e tabelas ------------------------------------------------------------ */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.table th { text-align: left; font-weight: 600; color: var(--ink-2); font-size: 0.85rem; padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--blush-50); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.row-link { color: var(--ink); font-weight: 600; text-decoration: none; }
.row-link:hover { color: var(--rose-700); text-decoration: underline; }

.list { list-style: none; margin: 0; padding: 0; }
.list__item { display: flex; align-items: center; gap: 14px; padding: 12px 22px; border-top: 1px solid var(--line); }
.list__item:first-child { border-top: 0; }
.list__main { flex: 1; min-width: 0; }
.list__title { font-weight: 600; color: var(--ink); text-decoration: none; display: block; overflow: hidden; text-overflow: ellipsis; }
a.list__title:hover { color: var(--rose-700); }
.list__meta { font-size: 0.88rem; color: var(--ink-2); }
.time-tag { flex: none; min-width: 58px; text-align: center; padding: 6px 8px; border-radius: var(--radius-s); background: var(--blush-50); color: var(--rose-700); font-weight: 700; font-variant-numeric: tabular-nums; }
.time-tag small { display: block; font-weight: 500; font-size: 0.72rem; color: var(--ink-2); }

.dl { display: grid; grid-template-columns: minmax(140px, 34%) 1fr; gap: 8px 16px; margin: 0; }
.dl dt { color: var(--ink-2); font-size: 0.92rem; }
.dl dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }
.dl--stack { grid-template-columns: 1fr; gap: 2px; }
.dl--stack dd { margin-bottom: 10px; }
.prose { white-space: pre-line; overflow-wrap: anywhere; }

/* Estado vazio ------------------------------------------------------------- */
.empty { text-align: center; padding: 36px 24px; color: var(--ink-2); }
.empty__icon { color: var(--sage-400); margin-bottom: 10px; }
.empty h3 { color: var(--ink); margin-bottom: 6px; }
.empty p { max-width: 46ch; margin: 0 auto 16px; }
.empty--compact { padding: 22px; }

/* Busca e filtros ------------------------------------------------------------ */
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; padding: 16px 22px; border-bottom: 1px solid var(--line); }
.toolbar .field { flex: 1 1 200px; }
.toolbar .field--search { flex: 3 1 280px; }
.pagination { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 22px; border-top: 1px solid var(--line); color: var(--ink-2); font-size: 0.92rem; }

/* Abas ---------------------------------------------------------------------- */
.tabs { display: flex; gap: 4px; overflow-x: auto; border-bottom: 1px solid var(--line); margin-bottom: 20px; scrollbar-width: thin; }
.tabs a {
  display: inline-flex; align-items: center; gap: 8px; min-height: var(--touch); padding: 10px 14px;
  color: var(--ink-2); text-decoration: none; font-weight: 600; white-space: nowrap; border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tabs a:hover { color: var(--ink); }
.tabs a.is-active { color: var(--rose-700); border-bottom-color: var(--rose-600); }
.tabs .count { font-weight: 500; color: var(--ink-3); font-size: 0.85rem; }

/* Ficha do paciente --------------------------------------------------------- */
.patient-head {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 18px; align-items: center;
  padding: 20px 22px; margin-bottom: 20px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l); box-shadow: var(--shadow);
  border-left: 5px solid var(--blush-300);
}
.patient-head.is-archived { border-left-color: var(--line-strong); }
.patient-head__photo { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; background: var(--blush-100); display: grid; place-items: center; color: var(--rose-700); font-family: var(--font-display); font-size: 1.6rem; font-weight: 600; }
.patient-head h1 { font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem); }
.patient-head__facts { display: flex; flex-wrap: wrap; gap: 4px 18px; margin-top: 6px; color: var(--ink-2); font-size: 0.95rem; }
.patient-head__actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.key-dates { display: flex; flex-wrap: wrap; gap: 8px 24px; margin-top: 10px; font-size: 0.9rem; }
.key-dates strong { color: var(--ink); }

/* Seções da anamnese -------------------------------------------------------- */
.steps { list-style: none; margin: 0; padding: 8px; display: grid; gap: 2px; }
.steps a { display: flex; align-items: center; gap: 10px; min-height: var(--touch); padding: 8px 12px; border-radius: var(--radius-s); color: var(--ink-2); text-decoration: none; font-weight: 500; }
.steps a:hover { background: var(--blush-50); color: var(--ink); }
.steps a.is-active { background: var(--blush-50); color: var(--rose-700); font-weight: 600; }
.steps__dot { width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--line-strong); flex: none; display: grid; place-items: center; font-size: 0.75rem; }
.steps a.is-filled .steps__dot { background: var(--sage-600); border-color: var(--sage-600); color: #fff; }
.sticky-side { position: sticky; top: 20px; }

/* Lesões ------------------------------------------------------------------- */
.wound-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.wound-card { display: flex; gap: 14px; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius-m); background: var(--surface); text-decoration: none; color: inherit; }
.wound-card:hover { border-color: var(--blush-300); }
.wound-card__num { flex: none; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--blush-100); color: var(--rose-700); font-weight: 700; }
.wound-card__title { font-weight: 600; color: var(--ink); }
.wound-card__meta { font-size: 0.88rem; color: var(--ink-2); }
.measure { font-variant-numeric: tabular-nums; }

/* Diagrama corporal */
.bodymap { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; align-items: end; }
.bodymap--readonly { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.bodymap__view--plantar, .bodymap__view--foot { align-self: start; }
@media (max-width: 760px) { .bodymap { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.bodymap__view { text-align: center; }
.bodymap__view figcaption { font-size: 0.85rem; color: var(--ink-2); margin-top: 4px; }
.bodymap svg { width: 100%; height: auto; touch-action: manipulation; cursor: crosshair; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-m); }
.bodymap .silhouette { fill: var(--blush-50); stroke: var(--blush-300); stroke-width: 1.4; }
.bodymap .marker { fill: var(--rose-600); stroke: #fff; stroke-width: 2; }
.bodymap .marker-ring { fill: none; stroke: var(--rose-600); stroke-width: 1.5; opacity: 0.5; }
.bodymap .other-marker { fill: var(--sage-600); stroke: #fff; stroke-width: 1.5; }
.bodymap--readonly svg { cursor: default; }

/* Evolução */
.chart { width: 100%; height: auto; }
.chart .axis { stroke: var(--line-strong); stroke-width: 1; }
.chart .grid-line { stroke: var(--line); stroke-width: 1; }
.chart .series { fill: none; stroke: var(--rose-600); stroke-width: 2.5; }
.chart .point { fill: var(--surface); stroke: var(--rose-600); stroke-width: 2.5; }
.chart text { fill: var(--ink-2); font: 500 12px var(--font-ui); }
.delta--down { color: var(--sage-700); font-weight: 600; }
.delta--up { color: var(--rose-700); font-weight: 600; }

/* Fotografias -------------------------------------------------------------- */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.photo { margin: 0; position: relative; }
.photo a { display: block; border-radius: var(--radius-m); overflow: hidden; background: var(--paper-deep); aspect-ratio: 1; }
.photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo figcaption { font-size: 0.82rem; color: var(--ink-2); margin-top: 6px; line-height: 1.35; }
.photo-group + .photo-group { margin-top: 24px; }
.photo-group__title { display: flex; align-items: baseline; gap: 10px; margin-bottom: 10px; }
.compare { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.compare figure { margin: 0; }
.compare img { width: 100%; max-height: 62vh; object-fit: contain; background: var(--ink); border-radius: var(--radius-m); }
.compare figcaption { margin-top: 8px; }
.photo-viewer { text-align: center; }
.photo-viewer img { max-width: 100%; max-height: 75vh; border-radius: var(--radius-m); background: var(--ink); }
.upload-preview { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; margin-top: 12px; }
.upload-preview img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--radius-s); border: 1px solid var(--line); }
.dropzone { border: 2px dashed var(--line-strong); border-radius: var(--radius-m); padding: 22px; text-align: center; background: #fff; }
.dropzone.is-over { border-color: var(--rose-600); background: var(--blush-50); }

/* Linha do tempo de atendimentos -------------------------------------------- */
.timeline { list-style: none; margin: 0; padding: 0 22px 8px; }
.timeline__item { position: relative; padding: 14px 0 14px 28px; border-left: 2px solid var(--line); }
.timeline__item::before { content: ""; position: absolute; left: -7px; top: 20px; width: 12px; height: 12px; border-radius: 50%; background: var(--surface); border: 2px solid var(--sage-600); }
.timeline__item.is-draft::before { border-color: var(--warn); }
.addendum { margin-top: 14px; padding: 12px 16px; border-left: 3px solid var(--warn); background: var(--warn-bg); border-radius: 0 var(--radius-s) var(--radius-s) 0; }

/* Agenda --------------------------------------------------------------------- */
.agenda-nav { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.segmented { display: inline-flex; border: 1px solid var(--line-strong); border-radius: var(--radius-s); overflow: hidden; background: #fff; }
.segmented a { padding: 9px 16px; min-height: 42px; display: inline-flex; align-items: center; color: var(--ink-2); text-decoration: none; font-weight: 600; }
.segmented a + a { border-left: 1px solid var(--line-strong); }
.segmented a.is-active { background: var(--sage-50); color: var(--sage-700); }
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: var(--radius-l); overflow: hidden; background: var(--surface); }
.week__day { min-height: 220px; border-left: 1px solid var(--line); padding: 10px; }
.week__day:first-child { border-left: 0; }
.week__day.is-today { background: var(--blush-50); }
.week__head { display: flex; justify-content: space-between; align-items: baseline; font-size: 0.85rem; color: var(--ink-2); margin-bottom: 8px; }
.week__head strong { font-size: 1.25rem; color: var(--ink); font-family: var(--font-display); }
.event { display: block; padding: 8px 10px; margin-bottom: 6px; border-radius: var(--radius-s); background: #fff; border: 1px solid var(--line); border-left: 3px solid var(--sage-600); text-decoration: none; color: var(--ink); font-size: 0.87rem; line-height: 1.3; }
.event:hover { border-color: var(--blush-300); }
.event strong { display: block; font-variant-numeric: tabular-nums; }
.event--cancelado { opacity: 0.6; border-left-color: var(--line-strong); text-decoration: line-through; }
.event--realizado { border-left-color: var(--ink-3); }
.event--conflict { border-left-color: var(--danger); }
.month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: var(--radius-l); overflow: hidden; background: var(--surface); }
.month__dow { padding: 8px; font-size: 0.8rem; font-weight: 600; color: var(--ink-2); background: var(--paper-deep); text-align: center; }
.month__cell { min-height: 96px; padding: 6px; border-top: 1px solid var(--line); border-left: 1px solid var(--line); font-size: 0.82rem; }
.month__cell:nth-child(7n + 1) { border-left: 0; }
.month__cell.is-other { background: var(--paper); color: var(--ink-3); }
.month__cell.is-today .month__num { background: var(--rose-600); color: #fff; }
.month__num { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; font-weight: 600; text-decoration: none; color: inherit; }
.month__more { display: block; color: var(--rose-700); font-weight: 600; }

/* Documentos ----------------------------------------------------------------- */
.pdf-frame { width: 100%; height: 78vh; border: 1px solid var(--line); border-radius: var(--radius-m); background: #fff; }
.items-editor .item-row { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr) auto; gap: 10px; align-items: start; margin-bottom: 10px; }

/* Autenticação --------------------------------------------------------------- */

/* Diálogo ------------------------------------------------------------------- */
dialog { border: 0; border-radius: var(--radius-l); padding: 0; max-width: min(520px, calc(100vw - 32px)); width: 100%; box-shadow: 0 20px 60px rgb(58 51 48 / 25%); color: var(--ink); background: var(--surface); }
dialog::backdrop { background: rgb(58 51 48 / 40%); }
.dialog__body { padding: 22px; }
.dialog__actions { display: flex; justify-content: flex-end; gap: 10px; padding: 0 22px 22px; }

/* Responsivo ------------------------------------------------------------------ */
@media (max-width: 1100px) {
  .grid--main-side { grid-template-columns: minmax(0, 1fr); }
  .sticky-side { position: static; }
  .grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .patient-head { grid-template-columns: auto minmax(0, 1fr); }
  .patient-head__actions { grid-column: 1 / -1; justify-content: flex-start; }
}
@media (max-width: 1023px) {
  .shell { grid-template-columns: minmax(0, 1fr); align-content: start; }
  .sidebar {
    position: fixed; inset: 0 auto 0 0; width: min(300px, 86vw); z-index: 50;
    transform: translateX(-102%); transition: transform 0.2s ease; box-shadow: 0 0 40px rgb(58 51 48 / 20%);
  }
  .shell.nav-open .sidebar { transform: none; }
  .nav-scrim { display: none; }
  .shell.nav-open .nav-scrim { display: block; position: fixed; inset: 0; background: rgb(58 51 48 / 35%); z-index: 40; }
  .topbar {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    position: sticky; top: 0; z-index: 30; padding: 8px var(--gutter);
    background: rgb(247 241 232 / 95%); border-bottom: 1px solid var(--line); backdrop-filter: blur(6px);
  }
  .topbar .brand { padding: 0; }
  .topbar .brand__mark { width: 32px; height: 32px; }
  .icon-btn { display: inline-grid; place-items: center; width: var(--touch); height: var(--touch); border-radius: var(--radius-s); border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); cursor: pointer; }
  .main { padding-top: 20px; }
  .week { grid-template-columns: minmax(0, 1fr); }
  .week__day { min-height: 0; border-left: 0; border-top: 1px solid var(--line); }
  .week__day:first-child { border-top: 0; }
}
@media (max-width: 760px) {
  .grid--2, .grid--3 { grid-template-columns: minmax(0, 1fr); }
  .summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .summary__item:nth-child(3) { border-left: 0; }
  .summary__item:nth-child(n + 3) { border-top: 1px solid var(--line); }
  .dl { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .dl dd { margin-bottom: 10px; }
  .fields--2 { grid-template-columns: minmax(0, 1fr); }
  .compare { grid-template-columns: minmax(0, 1fr); }
  .month__cell { min-height: 64px; }
  .month__cell .event { display: none; }
  .table--stack thead { display: none; }
  .table--stack tr { display: block; padding: 10px 16px; border-bottom: 1px solid var(--line); }
  .table--stack td { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; border: 0; }
  .table--stack td::before { content: attr(data-label); color: var(--ink-2); font-size: 0.85rem; }
  .items-editor .item-row { grid-template-columns: minmax(0, 1fr); }
  .form-actions .btn { flex: 1 1 auto; }
  .form-actions { position: static; backdrop-filter: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
@media print {
  .sidebar, .topbar, .page-head__actions, .form-actions { display: none !important; }
  .shell { display: block; }
  body { background: #fff; }
}

/* Complementos ---------------------------------------------------------------- */
.formset-row { border: 0; margin: 0 0 14px; padding: 14px 0 0; border-top: 1px dashed var(--line); min-width: 0; }
.formset-row:first-child { border-top: 0; padding-top: 0; }
.fields--stack { grid-template-columns: minmax(0, 1fr); align-content: start; }
.bmi-output { display: flex; align-items: center; min-height: var(--touch); padding: 0 12px; border-radius: var(--radius-s); background: var(--sage-50); color: var(--sage-700); font-weight: 700; font-variant-numeric: tabular-nums; }
.branding-preview { display: block; max-width: 180px; max-height: 90px; object-fit: contain; margin: 10px 0; padding: 8px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-s); }
.doc-sample { padding: 14px; border: 1px dashed var(--line-strong); border-radius: var(--radius-s); background: #fff; font-size: 0.92rem; line-height: 1.5; margin: 0; }
.thumb-sm { width: 72px; height: 72px; object-fit: cover; border-radius: var(--radius-s); }
.hash { font-variant-numeric: tabular-nums; overflow-wrap: anywhere; color: var(--ink-2); }
.bodymap .side-label { fill: var(--ink-3); font: 600 12px var(--font-ui); }
.month__count { display: block; font-size: 0.78rem; color: var(--ink-2); }
.week__head a { color: var(--ink-2); text-decoration: none; text-transform: capitalize; }
.list .wound-card__num { width: 34px; height: 34px; font-size: 0.9rem; }
.bodymap__view { margin: 0; }
.table .measure, .table td.num { white-space: nowrap; }
.table td .small { white-space: nowrap; }
.bodymap__view--body svg, .bodymap__view--profile svg { height: 300px; }
.bodymap__view--plantar svg { height: 170px; }
.bodymap__view--foot svg { height: 110px; }
.bodymap--readonly .bodymap__view--body svg, .bodymap--readonly .bodymap__view--profile svg { height: 240px; }
@media (max-width: 760px) {
  .bodymap__view--body svg, .bodymap__view--profile svg { height: 240px; }
}
.mnemonic { margin-top: 18px; padding: 12px 16px; border: 1px dashed var(--line-strong); border-radius: var(--radius-m); background: #fff; }
.mnemonic summary { cursor: pointer; font-weight: 600; color: var(--sage-700); min-height: 32px; }
.mnemonic .dl { grid-template-columns: 28px 1fr; margin-top: 10px; }
.mnemonic dt { font-weight: 700; color: var(--rose-700); }
.limb-columns > div { padding: 14px; border: 1px solid var(--line); border-radius: var(--radius-m); background: #fff; }

/* ===== Identidade visual (Guia Cura Senes) ===================================== */
h1, h2 { font-weight: 500; }

/* Logotipo */
.logo { display: inline-flex; align-items: center; gap: 10px; color: var(--brand-ink); text-decoration: none; }
.logo__mark { width: 40px; height: 28px; flex: none; }
.logo__text { display: flex; flex-direction: column; }
.logo__name { font-family: var(--font-display); font-weight: 500; font-size: 1.12rem; letter-spacing: 0.1em; text-transform: uppercase; line-height: 1; white-space: nowrap; }
.logo__tagline { margin-top: 7px; font-size: 0.56rem; letter-spacing: 0.3em; text-transform: uppercase; color: var(--ink-2); white-space: nowrap; }
.logo--stack { flex-direction: column; text-align: center; gap: 4px; }
.logo--stack .logo__mark { width: 76px; height: 53px; }
.logo--stack .logo__name { font-size: 1.28rem; }
.brand { color: inherit; }
.brand--stack { justify-content: center; padding: 8px 4px 26px; }

/* Barra lateral */
.sidebar { background: #f1ebe4; }
.nav a { font-weight: 500; }
.nav a.is-active { background: var(--blush-50); color: var(--rose-700); box-shadow: none; }
.nav a.is-active .icon { color: var(--rose-600); }
.user-chip { text-decoration: none; color: inherit; border-radius: var(--radius-s); margin-bottom: 8px; }
.user-chip:hover, .user-chip.is-active { background: rgb(255 255 255 / 60%); }
.user-chip__text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.user-chip__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.88rem; }
.user-chip__meta { font-size: 0.75rem; }

/* Busca global */
.main-bar { display: flex; justify-content: flex-end; max-width: 1180px; margin: 0 auto 18px; }
.global-search { position: relative; width: min(340px, 100%); }
.global-search .icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--ink-3); }
.global-search input { padding-left: 42px; border-radius: 999px; background: var(--surface); border-color: var(--line); }

/* Botões */
.btn--sage { background: var(--sage-600); color: #fff; }
.btn--sage:hover { background: var(--sage-700); color: #fff; }
.btn--ghost { background: var(--surface); }

/* Avisos */
.toast { display: flex; align-items: center; gap: 14px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); box-shadow: var(--shadow); color: var(--ink); }
.toast__icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; flex: none; background: var(--sage-600); color: #fff; }
.toast--error .toast__icon { background: var(--danger); }
.toast--warning .toast__icon { background: var(--warn); }
.toast--info .toast__icon { background: var(--info); }
.toast__body { flex: 1; }
.toast__close { display: grid; place-items: center; width: 36px; height: 36px; border: 0; background: none; color: var(--ink-2); cursor: pointer; border-radius: 50%; }
.toast__close:hover { background: var(--paper-deep); }

/* Selos de status */
.badge { gap: 6px; padding: 4px 12px 4px 6px; font-weight: 600; }
.badge::before { content: none; }
.badge__icon { display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: currentColor; }
.badge__icon .icon { width: 12px; height: 12px; stroke: var(--surface); stroke-width: 2.4; }
.badge--done { background: var(--ok-bg); color: var(--ok); }
.badge--progress { background: var(--info-bg); color: var(--info); }
.badge--pending { background: var(--warn-bg); color: var(--warn); }
.badge--cancel { background: var(--danger-bg); color: var(--danger); }
.badge--muted { background: var(--paper-deep); color: var(--ink-2); }
.badge--button { border: 0; cursor: pointer; font: inherit; font-size: 0.8rem; font-weight: 600; }

/* Início */
.greeting h1 { font-size: clamp(1.9rem, 1.5rem + 1.4vw, 2.5rem); }
.greeting__sub { color: var(--ink-2); margin: 4px 0 0; }
.greeting__date { margin-left: 8px; color: var(--ink-3); }
/* Indicadores: balões horizontais (ícone · título e detalhe · número · seta).
   Empilhados até o tablet; 2 colunas no desktop (4 apertariam os títulos). */
.stats { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; margin-bottom: 22px; }
@media (min-width: 1024px) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; } }
.stat {
  display: flex; align-items: center; gap: 14px; min-height: 76px; padding: 14px 16px 14px 14px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow);
  text-decoration: none; color: inherit; transition: border-color 0.15s, box-shadow 0.15s;
}
.stat:hover { border-color: var(--blush-300); box-shadow: 0 1px 2px rgb(74 68 64 / 6%), 0 8px 22px rgb(74 68 64 / 8%); }
.stat__icon { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; flex: none; }
.stat__icon .icon { width: 22px; height: 22px; }
.stat__icon--rose { background: var(--blush-50); color: var(--rose-600); }
.stat__icon--sage { background: var(--sage-50); color: var(--sage-600); }
.stat__icon--sand { background: var(--paper-deep); color: var(--ink-2); }
.stat__body { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.stat__label { font-weight: 600; font-size: 0.95rem; line-height: 1.25; color: var(--ink); }
.stat__hint { font-size: 0.82rem; line-height: 1.3; color: var(--ink-2); }
.stat__value { flex: none; font-family: var(--font-ui); font-weight: 600; font-size: 1.75rem; line-height: 1; letter-spacing: -0.01em; color: var(--ink); font-variant-numeric: lining-nums tabular-nums; }
.stat__go { flex: none; display: grid; place-items: center; margin-left: -4px; color: var(--ink-3); }
.stat__go .icon { width: 18px; height: 18px; }
.stat--cta { background: var(--sage-600); border-color: var(--sage-600); color: #fff; }
.stat--cta:hover { background: var(--sage-700); border-color: var(--sage-700); }
.stat--cta .stat__label { color: #fff; font-size: 1rem; }
.stat--cta .stat__hint { color: rgb(255 255 255 / 88%); }
.stat--cta .stat__go { color: #fff; }
.stat__icon--cta { background: rgb(255 255 255 / 16%); }
.stat__lotus { width: 32px; height: 22px; }
.stat__lotus path[fill="#768375"] { fill: #dde2d8; }
.stat__lotus path[stroke="#768375"] { stroke: #dde2d8; }
.dash-grid { margin-bottom: 20px; }
.link-more { font-size: 0.88rem; font-weight: 500; }
.time { flex: none; width: 52px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--ink); }
.activity__thumb { width: 44px; height: 44px; border-radius: var(--radius-s); object-fit: cover; flex: none; background: var(--paper-deep); }
.activity__icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: var(--radius-s); flex: none; background: var(--blush-50); color: var(--rose-600); }
.activity__icon--warn { background: var(--warn-bg); color: var(--warn); }
.empty__lotus { width: 96px; height: 67px; }

/* Ficha do paciente */
.back-link { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 12px; color: var(--ink-2); text-decoration: none; font-weight: 500; }
.back-link:hover { color: var(--ink); }
.patient-head { border-left: 0; }
.patient-head__photo { width: 72px; height: 72px; border: 3px solid var(--blush-100); }
.wound-rows { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.wound-row { display: flex; gap: 16px; align-items: center; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius-m); background: #fff; text-decoration: none; color: inherit; }
.wound-row:hover { border-color: var(--blush-300); }
.wound-row__thumb { width: 88px; height: 88px; border-radius: var(--radius-s); object-fit: cover; flex: none; background: var(--paper-deep); }
.wound-row__thumb--empty { display: grid; place-items: center; color: var(--rose-600); background: var(--blush-50); }
.wound-row__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.wound-row__title { font-weight: 600; color: var(--ink); }
.wound-row__meta { font-size: 0.86rem; color: var(--ink-2); }


@media (max-width: 1023px) {
  .main-bar { display: none; }
  .topbar .logo__mark { width: 34px; height: 24px; }
}
@media (max-width: 760px) {
  .greeting { margin-bottom: 18px; }
  .stats { gap: 10px; margin-bottom: 18px; }
  .stat { gap: 12px; min-height: 70px; padding: 12px 14px 12px 12px; border-radius: 18px; }
  .stat__icon { width: 42px; height: 42px; }
  .stat__icon .icon { width: 20px; height: 20px; }
  .stat__value { font-size: 1.55rem; }
  @media (max-width: 360px) {
    .stat { gap: 10px; padding: 10px 10px 10px 10px; }
    .stat__icon { width: 38px; height: 38px; }
    .stat__label { font-size: 0.9rem; }
    .stat__hint { font-size: 0.78rem; }
    .stat__go { margin-left: -6px; }
  }
  .greeting__date { display: block; margin: 2px 0 0; }
  .wound-row__thumb { width: 64px; height: 64px; }
}
.grid > .panel + .panel, .grid > .stack + .stack { margin-top: 0; }
.summary__value { font-variant-numeric: lining-nums tabular-nums; }
@media (max-width: 760px) {
  .wound-row { display: grid; grid-template-columns: 64px minmax(0, 1fr); align-items: start; }
  .wound-row .badge { grid-column: 2; justify-self: start; max-width: 100%; white-space: normal; }
  .wound-row__body { min-width: 0; }
  .patient-head__photo { width: 56px; height: 56px; }
}
@media (max-width: 760px) {
  .list__item { flex-wrap: wrap; }
  .list__item > .btn { margin-left: auto; }
  .list__item .list__main { flex-basis: 60%; }
}

/* Seleção de paciente com busca */
.picker__search { position: relative; padding: 18px 22px; border-bottom: 1px solid var(--line); display: flex; gap: 10px; align-items: center; }
.picker__search > .icon { position: absolute; left: 38px; color: var(--ink-3); }
.picker__search input { padding-left: 44px; border-radius: 999px; min-height: 50px; font-size: 1.05rem; }
.picker__list { list-style: none; margin: 0; padding: 6px 0; max-height: min(60vh, 620px); overflow-y: auto; }
.picker__list li[hidden] { display: none; }
.picker__item { display: flex; align-items: center; gap: 14px; width: 100%; padding: 12px 22px; min-height: 64px; border: 0; background: none; text-align: left; font: inherit; color: inherit; cursor: pointer; }
.picker__item:hover, .picker__item:focus-visible { background: var(--blush-50); }
.picker__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.picker__name { font-weight: 600; color: var(--ink); }
.picker__meta { font-size: 0.86rem; color: var(--ink-2); }
.picker__go { color: var(--ink-3); }
.picker__error { margin: 12px 22px 0; }
@media (max-width: 760px) {
  .picker__item { flex-wrap: wrap; padding: 12px 16px; }
  .picker__item .badge { margin-left: 50px; }
  .picker__go { display: none; }
}

/* Documentos: ações sempre visíveis */
.doc-actions { text-align: right; white-space: nowrap; }
.doc-actions .btn + .btn { margin-left: 6px; }
.doc-table .row-link { font-size: 1rem; }
.doc-mini { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 12px; }
.doc-mini li { display: grid; gap: 8px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.doc-mini__title { display: inline-flex; gap: 8px; align-items: center; font-weight: 600; color: var(--ink); text-decoration: none; }
.doc-mini__title:hover { color: var(--rose-700); }
@media (max-width: 760px) {
  .doc-actions { text-align: left; white-space: normal; display: flex !important; gap: 8px; justify-content: flex-start !important; }
  .doc-actions::before { content: none !important; }
}

/* Detalhe do atendimento */
.visit-head { margin-bottom: 18px; }
.visit-head__when { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; font-variant-numeric: tabular-nums; }
.visit-head__when .icon { width: 16px; height: 16px; color: var(--rose-600); }
.visit-head__sep { margin: 0 4px; color: var(--line-strong); }
.visit-summary { margin-bottom: 20px; }
.visit-summary__body { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px 24px; padding: 20px 22px; }
.visit-facts { display: grid; grid-template-columns: repeat(3, minmax(0, auto)); gap: 14px 32px; margin: 0; flex: 1 1 520px; min-width: 0; }
.visit-fact { min-width: 0; }
.visit-fact dt { display: flex; align-items: center; gap: 6px; font-size: 0.8rem; color: var(--ink-3); margin-bottom: 4px; }
.visit-fact dt .icon { width: 15px; height: 15px; color: var(--rose-600); }
.visit-fact dd { margin: 0; font-weight: 500; color: var(--ink); overflow-wrap: anywhere; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.visit-fact__link { font-size: 0.85rem; font-weight: 500; }
.visit-summary__actions { display: flex; flex-wrap: wrap; gap: 10px; flex: 0 1 auto; }
.visit-summary__actions .btn .icon:last-child:not(:first-child) { margin-left: 2px; }

.panel__head .count { font-family: var(--font-ui); font-size: 0.85rem; font-weight: 500; color: var(--ink-3); margin-left: 6px; font-variant-numeric: tabular-nums; }
.panel__head .badge { flex: none; }
.visit-list { list-style: none; margin: 14px 0 0; padding: 0; }
.visit-item { display: flex; align-items: center; gap: 14px; padding: 14px 22px; border-top: 1px solid var(--line); }
.visit-item__main { flex: 1; min-width: 0; }
.visit-item__title { display: block; font-weight: 600; color: var(--ink); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.visit-item__title:hover { color: var(--rose-700); text-decoration: underline; }
.visit-item__meta { display: flex; flex-wrap: wrap; gap: 2px 12px; margin-top: 2px; font-size: 0.85rem; color: var(--ink-2); }
.visit-item__where { display: inline-flex; align-items: center; gap: 4px; min-width: 0; }
.visit-item__where .icon { width: 13px; height: 13px; color: var(--ink-3); flex: none; }
.visit-item__side { display: flex; align-items: center; gap: 10px; flex: none; }
.visit-empty-text { margin: 0; }
#lesoes, #evolucao, #documentos, #finalizar { scroll-margin-top: 80px; }
.is-missing { display: inline-flex; align-items: center; gap: 6px; color: var(--warn); font-weight: 600; }
.is-missing .icon { width: 16px; height: 16px; }
.visit-item--missing { background: #fffaf3; box-shadow: inset 3px 0 0 #e2b46f; }


@media (max-width: 1100px) { .visit-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) {
  .visit-summary__body { padding: 16px; gap: 16px; }
  .visit-facts { grid-template-columns: minmax(0, 1fr); gap: 12px; flex-basis: 100%; }
  .visit-summary__actions { width: 100%; display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .visit-summary__actions .btn { width: 100%; min-height: var(--touch); }
  .visit-summary__actions .btn--sage { order: -1; }
  .visit-grid .panel__head { flex-wrap: wrap; padding: 16px 16px 0; }
  .visit-grid .panel__head h2 { white-space: nowrap; }
  .visit-grid .panel__body { padding: 14px 16px 18px; }
  .visit-item { flex-wrap: wrap; padding: 14px 16px; gap: 10px 12px; align-items: flex-start; }
  .visit-item__side { width: 100%; padding-left: 52px; flex-wrap: wrap; justify-content: flex-start; }
  .visit-item__side .btn { min-height: 40px; }
}

/* Etapas em balões (components/journey.html) */
.section-label { font-family: var(--font-ui); font-size: 0.78rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); margin: 0 0 10px; }
.visit-journey { margin-bottom: 20px; }
.journey { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.journey__step { position: relative; display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); }
.journey__mark { position: relative; z-index: 1; flex: none; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; font-weight: 600; font-size: 0.9rem; border: 1.5px solid var(--line-strong); background: var(--surface); color: var(--ink-3); }
.journey__mark .icon { width: 16px; height: 16px; stroke-width: 2.6; }
.journey__body { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; min-width: 0; flex: 1; padding-top: 1px; }
.journey__title { font-weight: 600; color: var(--ink); text-decoration: none; }
a.journey__title:hover { color: var(--rose-700); text-decoration: underline; }
.journey__detail { font-size: 0.84rem; color: var(--ink-2); }
.journey__chip { display: inline-block; margin-bottom: 4px; padding: 2px 10px; border-radius: 999px; background: var(--sage-600); color: #fff; font-size: 0.7rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; }
.journey__step--concluida .journey__mark { background: var(--sage-600); border-color: var(--sage-600); color: #fff; }
.journey__step--andamento .journey__mark { background: var(--blush-50); border-color: var(--rose-600); color: var(--rose-700); }
.journey__step--andamento .journey__detail { color: var(--rose-700); }
.journey__step--pendente:not(.is-current) { background: transparent; box-shadow: none; border-style: dashed; border-color: var(--line-strong); }
.journey__step.is-current { border: 2px solid var(--sage-600); padding: 11px 13px; box-shadow: 0 1px 2px rgb(74 68 64 / 6%), 0 10px 26px rgb(78 91 80 / 14%); }
.journey__step.is-current .journey__mark { border-color: var(--sage-600); color: var(--sage-700); background: var(--sage-50); }

/* Celular e tablet: linha do tempo vertical, ligando os balões */
@media (max-width: 1023px) {
  .journey__step + .journey__step::before { content: ""; position: absolute; left: 30px; top: -12px; width: 2px; height: 12px; background: var(--line-strong); }
  .journey__step--concluida + .journey__step::before { background: var(--sage-400); }
  .journey__step:not(.is-current) .journey__body { flex-direction: row; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; padding-top: 6px; }
}
/* Desktop: balões lado a lado, ligados por um traço */
@media (min-width: 1024px) {
  .journey { grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 14px; align-items: start; }
  .journey__step { padding: 14px 16px; }
  .journey__step.is-current { padding: 13px 15px; }
  .journey__step + .journey__step::before { content: ""; position: absolute; top: 29px; left: -16px; width: 16px; height: 2px; background: var(--line-strong); }
  .journey__step--concluida + .journey__step::before { background: var(--sage-400); }
}

/* Quadro "Falta preencher" (components/missing.html) */
.todo { margin-bottom: 20px; background: #fffaf3; border: 1px solid #ecd3ad; border-radius: 18px; overflow: hidden; }
.todo__head { display: flex; align-items: center; gap: 10px; padding: 14px 18px 10px; }
.todo__head h2 { font-family: var(--font-ui); font-size: 1rem; font-weight: 600; margin: 0; color: var(--ink); }
.todo__icon { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--warn-bg); color: var(--warn); flex: none; }
.todo__icon .icon { width: 16px; height: 16px; }
.todo__count { margin-left: auto; font-size: 0.8rem; font-weight: 600; color: var(--warn); }
.todo__list { list-style: none; margin: 0; padding: 0 0 6px; }
.todo__item { display: flex; align-items: center; gap: 12px; padding: 10px 18px; border-top: 1px solid #f1e0c7; }
.todo__text { flex: 1; min-width: 0; font-size: 0.92rem; color: var(--ink); }
.todo__item .btn { flex: none; background: var(--surface); }
.todo__item .btn .icon { width: 15px; height: 15px; }
@media (max-width: 560px) {
  .todo__head { padding: 12px 14px 8px; }
  .todo__item { flex-wrap: wrap; padding: 10px 14px; gap: 8px; }
  .todo__text { flex-basis: 100%; }
  .todo__item > .btn, .todo__item > form { margin-left: auto; }
}

/* Telas de acesso (login, recuperação de senha, bloqueio) ---------------------- */
.auth { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1fr); background: var(--paper); }
.auth__aside { display: none; }
.auth__main { position: relative; overflow: hidden; overflow: clip; display: flex; justify-content: center; align-items: flex-start; padding: 40px var(--gutter) 32px; }
.auth__card { position: relative; z-index: 1; width: 100%; max-width: 420px; }
.auth__mobile-brand { display: flex; justify-content: center; margin-bottom: 28px; }
.auth__mobile-brand .logo__mark { width: 84px; height: 59px; }
.auth__mobile-brand .logo__name { font-size: 1.7rem; }
.auth__card h1 { font-size: clamp(1.75rem, 1.5rem + 1vw, 2.2rem); margin-bottom: 8px; }
.auth__lead, .auth__card > p.muted { margin: 0; color: var(--ink-2); max-width: 36ch; }
.auth__card form, .auth__form { margin-top: 26px; display: grid; gap: 18px; }
.auth__links { margin-top: 18px; font-size: 0.95rem; }

.input-icon { position: relative; }
.input-icon > .icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--ink-3); pointer-events: none; }
.input-icon input { min-height: 50px; padding-left: 44px; border-radius: 12px; background: var(--surface); }
.input-icon input:focus { background: #fff; }
.input-icon:focus-within > .icon { color: var(--rose-600); }
.input-icon input:disabled { background: var(--paper-deep); color: var(--ink-3); cursor: not-allowed; }
.has-error .input-icon > .icon { color: var(--danger); }
.input-icon--toggle input { padding-right: 52px; }
.input-icon__toggle { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 10px; background: none; color: var(--ink-3); cursor: pointer; }
.input-icon__toggle:hover { color: var(--ink); }
.input-icon__toggle:focus-visible { outline: none; box-shadow: var(--focus); color: var(--ink); }
.input-icon__toggle .icon { width: 20px; height: 20px; }
.auth__forgot { display: inline-block; justify-self: end; margin-top: 8px; font-size: 0.88rem; font-weight: 500; color: var(--rose-700); }
.auth__form .field { display: grid; }
.btn--large { min-height: 52px; font-size: 1.02rem; border-radius: 12px; }
.auth__privacy { display: flex; gap: 10px; align-items: flex-start; margin: 26px 0 0; padding-top: 18px; border-top: 1px solid var(--line); font-size: 0.82rem; line-height: 1.45; color: var(--ink-2); }
.auth__privacy .icon { flex: none; width: 16px; height: 16px; margin-top: 1px; color: var(--sage-600); }

.botanical { position: absolute; pointer-events: none; fill: none; stroke: var(--sage-400); stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; opacity: 0.35; }
.botanical__leaf { fill: var(--sage-100); }
.botanical--main { width: 96px; top: -12px; right: -18px; transform: rotate(18deg); }

/* Tablet: cartão centralizado com fundo creme */
@media (min-width: 640px) {
  .auth__main { align-items: center; padding: 48px var(--gutter); }
  .auth__card { max-width: 460px; padding: 40px 44px; background: var(--surface); border: 1px solid var(--line); border-radius: 24px; box-shadow: var(--shadow); }
  .botanical--main { width: 150px; top: auto; bottom: -24px; right: -20px; }
}
/* Desktop: identidade de um lado, formulário do outro */
@media (min-width: 1024px) {
  .auth { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .auth__aside { position: relative; overflow: hidden; overflow: clip; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 28px; padding: 56px; background: #f1ebe4; border-right: 1px solid var(--line); text-align: center; }
  .auth__brand .logo__mark { width: 150px; height: 105px; }
  .auth__brand .logo__name { font-size: 2.4rem; }
  .auth__brand .logo__tagline { font-size: 0.74rem; }
  .auth__values { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px 14px; margin: 8px 0 0; font-family: var(--font-display); font-size: 1.1rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--rose-700); }
  .auth__values span + span::before { content: "·"; margin-right: 14px; color: var(--blush-300); }
  .auth__values-text { margin: 0; max-width: 34ch; color: var(--ink-2); }
  .auth__mobile-brand { display: none; }
  .auth__card { padding: 44px 48px; }
  .botanical--aside-top { width: 170px; top: -20px; left: -26px; transform: rotate(160deg); }
  .botanical--aside-bottom { width: 190px; bottom: -26px; right: -22px; }
  .botanical--main { display: none; }
}
@media (prefers-reduced-motion: reduce) { .btn.is-loading::after { animation: none; } }
