/* ── Bloco 1: Estilos principais ── */
/* ═══════════════════════════════════
   RESET GLOBAL
═══════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body { background: #f7f8f6; color: #1a1f1c; font-family: 'DM Sans', sans-serif; }

/* ═══════════════════════════════════
   CAMADAS
═══════════════════════════════════ */
#tf-onboarding-layer {
  position: fixed;
  inset: 0;
  z-index: 9999;
  box-sizing: border-box;
  margin: 0;
  padding: 24px 24px calc(24px + env(safe-area-inset-bottom));
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  /* Layout */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  min-height: 100dvh;
  /* Cores e tipografia */
  background: #FAF7F2;
  color: #2B2A26;
  font-family: 'DM Sans', sans-serif;
  /* Tokens do onboarding ALINHADOS ao :root único (Sálvia & Linho) — antes era a
     paleta antiga cinza-fria e o login parecia outro produto. Redesign 10/07. */
  --sage: #4A7A63; --sage-light: #EAF1EC; --sage-mid: #8FB89C;
  --ink: #2B2A26; --ink-soft: #4A4842; --muted: #6B675F;
  --border: #E8E2D8; --bg: #FAF7F2; --white: #ffffff;
  --amber: #B8762A; --amber-light: #F7EBDB;
  --red: #B3564A; --red-light: #F9EEEC;
  --blue: #5A6C8A; --blue-light: #E9EDF3;
  --purple: #5A3D75; --purple-light: #EFE7F5;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(43,42,38,.07);
  --shadow-lg: 0 8px 28px rgba(43,42,38,.10), 0 2px 6px rgba(43,42,38,.05);
}

@media (max-width: 480px) {
  #tf-onboarding-layer { padding: 16px 16px calc(20px + env(safe-area-inset-bottom)); }
  #tf-onboarding-layer .ob-card-body { padding: 24px; }
  #tf-onboarding-layer .ob-logo { margin-bottom: 24px; }
  #tf-onboarding-layer .ob-footer { padding: 16px 24px 24px; }
}

#tf-app-layer {
  display: none;
  width: 100%;
  min-height: 100vh;
}

/* ── DEMO BANNER ── */
#tf-demo-banner {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 200;
  height: 40px;
  background: linear-gradient(90deg, #c97d2e, #d4892a);
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 0 48px;
  box-shadow: 0 2px 8px rgba(201,125,46,.35);
}

/* ═══════════════════════════════════
   CSS DO ONBOARDING (isolado)
═══════════════════════════════════ */
/* ── CONTAINER ── */
.onboarding-wrap {
  width: 100%;
  max-width: 540px;
  flex-shrink: 0;
}
#tf-onboarding-layer /* ── LOGO ── */
.ob-logo {
  text-align: center; margin-bottom: 40px;
}
#tf-onboarding-layer .logo-mark {
  font-family: 'Instrument Serif', serif; font-size: 26px; color: var(--ink);
  letter-spacing: -.3px;
}
#tf-onboarding-layer .logo-sub {
  font-size: 11px; color: var(--muted); margin-top: 2px;
  letter-spacing: .5px; text-transform: uppercase;
}
#tf-onboarding-layer /* ── PROGRESS ── */
.ob-progress {
  display: flex; align-items: center; gap: 6px;
  margin-bottom: 32px; justify-content: center;
}
#tf-onboarding-layer .ob-step-pill {
  display: flex; align-items: center; gap: 7px;
  padding: 6px 13px; border-radius: 20px; cursor: default;
  transition: all .25s; border: 1px solid transparent;
  font-size: 12px; font-weight: 500; color: var(--muted);
  background: transparent;
}
#tf-onboarding-layer .ob-step-pill.done {
  cursor: pointer; color: var(--sage);
  background: var(--sage-light); border-color: rgba(74,124,89,.2);
}
#tf-onboarding-layer .ob-step-pill.done:hover { background: #d4e8d9; }
#tf-onboarding-layer .ob-step-pill.active {
  color: var(--ink); background: var(--white);
  border-color: var(--border);
  box-shadow: 0 1px 4px rgba(0,0,0,.07);
}
#tf-onboarding-layer .ob-step-pill .pill-num {
  width: 18px; height: 18px; border-radius: 50%; display: flex;
  align-items: center; justify-content: center; font-size: 10px;
  font-weight: 700; flex-shrink: 0;
}
#tf-onboarding-layer .ob-step-pill.done .pill-num { background: var(--sage); color: #fff; }
#tf-onboarding-layer .ob-step-pill.active .pill-num { background: var(--ink); color: #fff; }
#tf-onboarding-layer .ob-step-pill.pending .pill-num { background: var(--border); color: var(--muted); }
#tf-onboarding-layer .ob-step-sep { color: var(--border); font-size: 14px; }
#tf-onboarding-layer /* ── CARD ── */
.ob-card {
  background: var(--white); border-radius: 20px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  overflow: hidden;
}
#tf-onboarding-layer .ob-card-body { padding: 40px; }
#tf-onboarding-layer .ob-screen { display: none; }
#tf-onboarding-layer .ob-screen.active { display: block; animation: fadeIn .3s ease; }
#tf-onboarding-layer /* ── HEADER DA TELA ── */
.ob-eyebrow {
  font-size: 11px; font-weight: 600; letter-spacing: .8px;
  text-transform: uppercase; color: var(--sage); margin-bottom: 10px;
}
#tf-onboarding-layer .ob-title {
  font-family: 'Instrument Serif', serif; font-size: 28px;
  color: var(--ink); line-height: 1.25; margin-bottom: 8px;
}
#tf-onboarding-layer .ob-subtitle {
  font-size: 14px; color: var(--muted); line-height: 1.7;
  margin-bottom: 32px;
}
#tf-onboarding-layer /* ── FORMS ── */
.form-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 18px; }
#tf-onboarding-layer label { font-size: 12.5px; font-weight: 600; color: var(--ink-soft); }
#tf-onboarding-layer .form-input {
  border: 1px solid var(--border); border-radius: 10px;
  padding: 11px 14px; font-size: 14px; font-family: inherit;
  outline: none; color: var(--ink); background: var(--bg);
  transition: border-color .15s, background .15s;
}
#tf-onboarding-layer .form-input:focus { border-color: var(--sage); background: var(--white); }
#tf-onboarding-layer .form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
#tf-onboarding-layer .form-hint {
  font-size: 12px; color: var(--muted); margin-top: 4px;
}
#tf-onboarding-layer /* ── ABORDAGENS ── */
.abordagens-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
  margin-bottom: 10px;
}
#tf-onboarding-layer .abordagem-card {
  border: 1.5px solid var(--border); border-radius: 12px;
  padding: 14px 16px; cursor: pointer; transition: all .15s;
  background: var(--bg);
}
#tf-onboarding-layer .abordagem-card:hover { border-color: var(--sage-mid); background: var(--sage-light); }
#tf-onboarding-layer .abordagem-card.selected {
  border-color: var(--sage); background: var(--sage-light);
}
#tf-onboarding-layer .abordagem-card.selected .ab-icon-wrap { background: var(--sage); }
#tf-onboarding-layer .abordagem-card.selected .ab-icon-wrap span { color: #fff; }
#tf-onboarding-layer .ab-icon-wrap {
  width: 36px; height: 36px; border-radius: 9px;
  background: var(--line-2); display: flex; align-items: center;
  justify-content: center; margin-bottom: 10px; transition: background .15s;
}
#tf-onboarding-layer .ab-icon-wrap span { font-size: 17px; }
#tf-onboarding-layer .ab-name { font-size: 13.5px; font-weight: 600; color: var(--ink); margin-bottom: 3px; }
#tf-onboarding-layer .ab-desc { font-size: 11.5px; color: var(--muted); line-height: 1.4; }
#tf-onboarding-layer .abordagem-outra {
  border: 1.5px solid var(--border); border-radius: 12px;
  padding: 12px 14px; display: flex; align-items: center; gap: 10px;
  cursor: pointer; transition: all .15s; margin-top: 0; background: var(--bg);
}
#tf-onboarding-layer .abordagem-outra:hover { border-color: var(--sage-mid); }
#tf-onboarding-layer .abordagem-outra.selected { border-color: var(--sage); background: var(--sage-light); }
#tf-onboarding-layer .abordagem-outra input {
  border: none; background: transparent; outline: none;
  font-size: 13.5px; font-family: inherit; color: var(--ink); flex: 1;
}
#tf-onboarding-layer /* ── SECTION LABEL ── */
.ab-section-label {
  font-size: 11.5px; font-weight: 700; color: var(--ink-soft);
  text-transform: uppercase; letter-spacing: .6px; margin-bottom: 12px;
}
#tf-onboarding-layer .ab-divider {
  height: 1px; background: var(--border); margin: 20px 0 18px;
}
#tf-onboarding-layer /* ── SECUNDÁRIAS ── */
.secundarias-grid {
  display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px;
}
#tf-onboarding-layer .sec-chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 14px; border-radius: 20px; font-size: 13px; font-weight: 500;
  border: 1.5px solid var(--border); background: var(--bg);
  cursor: pointer; transition: all .15s; user-select: none;
  color: var(--ink-soft);
}
#tf-onboarding-layer .sec-chip:hover { border-color: var(--sage-mid); background: var(--sage-light); }
#tf-onboarding-layer .sec-chip.selected {
  border-color: var(--sage); background: var(--sage-light); color: var(--sage);
}
#tf-onboarding-layer .sec-chip .chip-check { font-size: 11px; opacity: 0; transition: opacity .15s; }
#tf-onboarding-layer .sec-chip.selected .chip-check { opacity: 1; }
#tf-onboarding-layer .ab-sec-outra-wrap { margin-top: 4px; }
#tf-onboarding-layer /* ── IA BADGE ── */
.ia-callout {
  display: flex; gap: 12px; align-items: flex-start;
  background: var(--purple-light); border-radius: 10px;
  padding: 14px 16px; margin-top: 20px;
  border: 1px solid rgba(90,62,138,.15);
}
#tf-onboarding-layer .ia-dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--purple);
  flex-shrink: 0; margin-top: 5px;
  animation: pulse 2s infinite;
}
#tf-onboarding-layer .ia-callout-text { font-size: 13px; color: var(--purple); line-height: 1.6; }
#tf-onboarding-layer .ia-callout-text strong { font-weight: 600; }
#tf-onboarding-layer /* ── TELA 3 — PRONTO ── */
.ob-success-icon {
  width: 64px; height: 64px; border-radius: 18px;
  background: var(--sage-light); display: flex; align-items: center;
  justify-content: center; font-size: 28px; margin: 0 auto 20px;
}
#tf-onboarding-layer .ob-success-title {
  font-family: 'Instrument Serif', serif; font-size: 30px;
  text-align: center; margin-bottom: 8px;
}
#tf-onboarding-layer .ob-success-sub {
  font-size: 14px; color: var(--muted); text-align: center;
  line-height: 1.7; margin-bottom: 32px;
}
#tf-onboarding-layer /* Trial badge */
.trial-badge {
  display: flex; align-items: center; gap: 16px;
  background: var(--ink); color: #fff; border-radius: 14px;
  padding: 18px 20px; margin-bottom: 20px;
}
#tf-onboarding-layer .trial-num {
  font-family: 'Instrument Serif', serif; font-size: 44px;
  line-height: 1; color: #fff; flex-shrink: 0;
}
#tf-onboarding-layer .trial-info-title {
  font-size: 14px; font-weight: 600; color: #fff; margin-bottom: 3px;
}
#tf-onboarding-layer .trial-info-sub {
  font-size: 12px; color: rgba(255,255,255,.5); line-height: 1.5;
}
#tf-onboarding-layer .trial-dots {
  display: flex; gap: 5px; margin-top: 10px; flex-wrap: wrap;
}
#tf-onboarding-layer .trial-dot {
  width: 16px; height: 16px; border-radius: 4px;
  background: rgba(255,255,255,.15); border: 1px solid rgba(255,255,255,.1);
}
#tf-onboarding-layer .trial-dot.used { background: var(--sage); border-color: var(--sage); }
#tf-onboarding-layer /* O que você ganhou */
.features-list {
  display: flex; flex-direction: column; gap: 10px; margin-bottom: 24px;
}
#tf-onboarding-layer .feature-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; border-radius: 10px;
  background: var(--bg); border: 1px solid var(--border);
}
#tf-onboarding-layer .feature-icon {
  width: 34px; height: 34px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; flex-shrink: 0;
}
#tf-onboarding-layer .feature-name { font-size: 13.5px; font-weight: 500; color: var(--ink); }
#tf-onboarding-layer .feature-desc { font-size: 12px; color: var(--muted); }
#tf-onboarding-layer .feature-check {
  margin-left: auto; font-size: 13px; color: var(--sage); font-weight: 600;
}
#tf-onboarding-layer /* Alerta paciente */
.ob-alert {
  display: flex; gap: 14px; align-items: flex-start;
  background: var(--amber-light); border: 1px solid rgba(201,125,46,.2);
  border-radius: 12px; padding: 16px 18px; margin-bottom: 24px;
}
#tf-onboarding-layer .ob-alert-icon { font-size: 20px; flex-shrink: 0; margin-top: 1px; }
#tf-onboarding-layer .ob-alert-title {
  font-size: 13.5px; font-weight: 600; color: var(--ink); margin-bottom: 4px;
}
#tf-onboarding-layer .ob-alert-text { font-size: 13px; color: var(--ink-soft); line-height: 1.6; }
#tf-onboarding-layer /* ── FOOTER DO CARD ── */
.ob-footer {
  padding: 20px 40px 32px; display: flex;
  align-items: center; justify-content: space-between;
  border-top: 1px solid var(--border);
}
#tf-onboarding-layer .ob-footer-left { font-size: 12.5px; color: var(--muted); }
#tf-onboarding-layer /* ── BOTÕES ── */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 11px 22px; border-radius: 10px; font-size: 14px;
  font-weight: 500; cursor: pointer; border: none;
  transition: all .15s; font-family: inherit;
}
#tf-onboarding-layer .btn-primary { background: var(--sage); color: #fff; }
#tf-onboarding-layer .btn-primary:hover { background: #3d6b4b; }
#tf-onboarding-layer .btn-secondary {
  background: var(--white); color: var(--ink-soft);
  border: 1px solid var(--border);
}
#tf-onboarding-layer .btn-secondary:hover { border-color: var(--sage-mid); background: var(--sage-light); }
#tf-onboarding-layer .btn-ghost { background: transparent; color: var(--muted); }
#tf-onboarding-layer .btn-ghost:hover { color: var(--ink); }
#tf-onboarding-layer .btn-full { width: 100%; justify-content: center; }
#tf-onboarding-layer .btn-lg { padding: 13px 28px; font-size: 15px; }
#tf-onboarding-layer /* Erro de validação */
.field-error {
  font-size: 12px; color: var(--red); margin-top: 4px; display: none;
}
#tf-onboarding-layer .form-input.error { border-color: var(--red); }
#tf-onboarding-layer /* ── ANIMATIONS ── */
.fade-in { animation: fadeIn .3s ease; }
#tf-onboarding-layer @keyframes fadeIn { from{opacity:0;transform:translateY(8px)} to{opacity:1;transform:none} }
#tf-onboarding-layer @keyframes pulse { 0%,100%{opacity:1;transform:scale(1)} 50%{opacity:.5;transform:scale(.8)} }



/* ═══════════════════════════════════
   CSS DO APP
═══════════════════════════════════ */

:root {
  /* ── "Sálvia & Linho" — FONTE ÚNICA de tokens (redesign aprovado 10/07/2026).
     Nomes preservados p/ compatibilidade; valores são a nova paleta. Não criar
     outro :root em lugar nenhum — onboarding e landing herdam ESTES valores. ── */
  --sage: #4A7A63; --sage-light: #EAF1EC; --sage-mid: #8FB89C; --sage-dark: #3D6653;
  --sage-50: #F0F5F1; --sage-100: #EAF1EC; --sage-700: #3D6653; --sage-800: #2E4F3E;
  --ink: #2B2A26; --ink-soft: #4A4842; --muted: #6B675F; --muted-2: #9A948A;
  --border: #E8E2D8; --line-2: #F0EBE2; --bg: #FAF7F2; --white: #ffffff;
  --amber: #B8762A; --amber-light: #F7EBDB;
  --red: #B3564A; --red-light: #F9EEEC;
  --blue: #5A6C8A; --blue-light: #E9EDF3;
  --purple: #5A3D75; --purple-light: #EFE7F5;
  --terra: #C4795A;
  /* Humor (sem arco-íris, sem julgamento): difícil → leve */
  --mood-1: #7D8CA3; --mood-2: #8FA391; --mood-3: #A9B27E; --mood-4: #D3B36A; --mood-5: #E39A5B;
  --radius: 12px; --radius-sm: 8px; --radius-lg: 16px;
  --shadow: 0 1px 3px rgba(43,42,38,.07);
  --shadow-lg: 0 8px 28px rgba(43,42,38,.10), 0 2px 6px rgba(43,42,38,.05);
  font-family: 'DM Sans', sans-serif;
}
[data-theme="dark"] {
  /* Dark QUENTE (não preto): escada de luminância, elevação sem sombra */
  --sage: #8FBCA4; --sage-light: #2A332C; --sage-mid: #6FA184; --sage-dark: #A5CBB5;
  --sage-50: #242B26; --sage-100: #2A332C; --sage-700: #A5CBB5; --sage-800: #B8D8C6;
  --ink: #EDE9E1; --ink-soft: #C9C4B8; --muted: #A39E92; --muted-2: #7A756A;
  --border: #3A362C; --line-2: #2E2B22; --bg: #1C1A16; --white: #262319;
  --amber: #DDB061; --amber-light: #332A18;
  --red: #CF7E72; --red-light: #33211E;
  --blue: #93A2B8; --blue-light: #20242C;
  --purple: #B396D6; --purple-light: #2A2133;
  --terra: #D99A7E;
  --mood-1: #8B99AE; --mood-2: #9CAF9E; --mood-3: #B5BE8C; --mood-4: #DBBE7C; --mood-5: #E8A96F;
  --shadow: none;
  --shadow-lg: none;
}
[data-theme="dark"] .sidebar { background: #131a15; border-right-color: rgba(255,255,255,.05); }
[data-theme="dark"] .sidebar-logo { border-bottom-color: rgba(255,255,255,.06); }
[data-theme="dark"] .sidebar-logo::before { background-color: var(--sage); }
[data-theme="dark"] .nav-item { color: #8fb89c; }
[data-theme="dark"] .nav-section { color: #4a6050; }
[data-theme="dark"] .therapist-card { background: rgba(255,255,255,.05); }
[data-theme="dark"] .dash-hero-title { color: #f0f4f1; }
[data-theme="dark"] .dash-hero-sub { color: rgba(255,255,255,.45); }
[data-theme="dark"] .logo-mark { color: #e8ede9; }
[data-theme="dark"] .nav-item { color: #a8b4ae; }
[data-theme="dark"] .nav-item:hover { background: rgba(255,255,255,.07); color: #fff; }
[data-theme="dark"] .nav-section { color: #556; }
[data-theme="dark"] .sidebar-footer { border-top-color: rgba(255,255,255,.08); }
[data-theme="dark"] .therapist-card { background: rgba(255,255,255,.06); }
[data-theme="dark"] .therapist-name { color: #fff; }
[data-theme="dark"] .nav-ai-item { border-color: rgba(90,62,138,.35); background: rgba(90,62,138,.12); }
[data-theme="dark"] .nav-ai-header { color: #c4b4e8; }
[data-theme="dark"] .nav-ai-tag { background: rgba(90,62,138,.4); color: #c4b4e8; }
/* Fase C (14/07): dark completo do consultório — superfícies que ficavam claras */
[data-theme="dark"] .topbar { background: rgba(28,26,22,.88); }
[data-theme="dark"] .charge-btn-wpp:hover { background: rgba(37,211,102,.12); color: #6fd39a; }
[data-theme="dark"] .charge-btn-wpp { color: #6fbf9a; }
/* No dark o acento fica CLARO (#8FBCA4) — texto branco perdia contraste; tinta escura */
[data-theme="dark"] .btn-primary, [data-theme="dark"] .btn-purple { color: #1C1A16; }
[data-theme="dark"] #tf-onboarding-layer .btn-primary { color: #1C1A16; }
* { box-sizing: border-box; margin: 0; padding: 0; }
body { background: var(--bg); color: var(--ink); min-height: 100vh; display: flex; }

/* ── SIDEBAR ── */
.sidebar {
  width: 248px; min-height: 100vh; background: #f1ede1;
  display: flex; flex-direction: column; flex-shrink: 0;
  position: fixed; left: 0; top: 0; bottom: 0; z-index: 100;
  border-right: 1px solid var(--border);
}
.sidebar-logo {
  display: flex; align-items: center; gap: 10px;
  padding: 22px 16px 20px; border-bottom: 1px solid var(--border);
}
.sidebar-logo::before {
  content: ''; flex-shrink: 0;
  width: 26px; height: 26px; border-radius: 8px; background-color: var(--sage);
  background-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 120'><path d='M32 34 H88' fill='none' stroke='%23F3EFE6' stroke-width='13' stroke-linecap='round'/><path d='M60 47 C46 61, 74 71, 60 92' fill='none' stroke='%23F3EFE6' stroke-width='13' stroke-linecap='round'/><circle cx='60' cy='92' r='9' fill='%23E8B79E'/></svg>");
  background-size: 80% 80%; background-position: center; background-repeat: no-repeat;
}
.logo-mark { font-family: 'Instrument Serif', serif; font-size: 20px; color: var(--ink); letter-spacing: -.3px; line-height: 1; }
.logo-sub { font-size: 9.5px; color: var(--muted); letter-spacing: .18em; text-transform: uppercase; margin-top: 2px; display: block; }
.sidebar-nav { flex: 1; padding: 14px 12px; display: flex; flex-direction: column; gap: 1px; overflow-y: auto; }
.nav-section { font-size: 10px; color: var(--muted-2); letter-spacing: .16em; text-transform: uppercase; padding: 12px 10px 4px; font-weight: 500; }
.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 8px 10px; border-radius: 9px; cursor: pointer;
  color: var(--ink-soft); font-size: 13.5px; font-weight: 400;
  transition: all .15s; user-select: none; border: none; background: none; width: 100%; font-family: inherit; text-align: left;
}
.nav-item:hover { background: rgba(74,124,89,.07); color: var(--ink); }
.nav-item.active { background: var(--sage); color: #fff; }
.nav-item .icon { width: 18px; text-align: center; font-size: 15px; flex-shrink: 0; }
.nav-badge { margin-left: auto; background: #f1a45c; color: #3a2410; font-size: 10.5px; font-weight: 600; padding: 1px 7px; border-radius: 999px; }
.nav-badge-purple { margin-left: auto; background: var(--purple); color: #fff; font-size: 10.5px; font-weight: 600; padding: 1px 7px; border-radius: 999px; }
.nav-item.active .nav-badge { background: rgba(255,255,255,.25); color: #fff; }
.nav-badge-soft { margin-left: auto; background: var(--white); color: var(--sage-800); border: 1px solid var(--border); font-size: 10.5px; font-weight: 600; padding: 1px 7px; border-radius: 999px; }
.nav-item.active .nav-badge-soft { background: rgba(255,255,255,.18); color: #fff; border-color: transparent; }

/* IA toggle na sidebar */
.nav-ai-item {
  margin: 2px 0; border-radius: 9px; overflow: hidden;
  border: 1px solid rgba(90,61,117,.18);
  background: var(--purple-light);
}
.nav-ai-header {
  display: flex; align-items: center; gap: 11px;
  width: 100%; padding: 8px 10px; cursor: pointer; color: var(--purple);
  font-size: 13.5px; font-weight: 500; user-select: none;
  transition: all .15s; background: none; border: none; text-align: left;
}
.nav-ai-header:hover { background: rgba(90,61,117,.1); }
.nav-ai-header.active { color: #fff; background: var(--purple); }
.nav-ai-header .icon { width: 16px; text-align: center; font-size: 14px; flex-shrink: 0; }
.nav-ai-tag { margin-left: auto; font-size: 9.5px; font-weight: 700; letter-spacing: .06em; background: var(--purple); color: #fff; padding: 2px 6px; border-radius: 5px; text-transform: uppercase; }
.nav-ai-header.active .nav-ai-tag { background: rgba(255,255,255,.2); color: #fff; }

.sidebar-footer { padding: 12px; border-top: 1px solid var(--border); flex-shrink: 0; display: flex; flex-direction: column; gap: 8px; }
.therapist-card { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 11px; background: #fbfaf4; border: 1px solid var(--border); }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--sage); display: flex; align-items: center; justify-content: center; font-size: 12px; color: #fff; font-weight: 600; letter-spacing: .04em; flex-shrink: 0; }
.therapist-name { font-size: 13px; color: var(--ink); font-weight: 600; line-height: 1.15; }
.therapist-role { font-size: 10.5px; color: var(--muted); margin-top: 1px; }

/* ── MAIN ── */
.main { margin-left: 248px; flex: 1; min-height: 100vh; display: flex; flex-direction: column; }
.page { display: none; padding: 28px 36px 56px; }
/* Fase C (14/07): em monitores largos o conteúdo esticava de borda a borda
   ("deserto de tela") — teto de leitura confortável, alinhado à esquerda como
   o topbar (a faixa do topbar continua varrendo a largura toda). */
.page { max-width: 1480px; }
.page.active { display: block; animation: pageEnter .3s cubic-bezier(.16,1,.3,1); }

/* ── TOPBAR ── */
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 18px 36px; background: rgba(247,245,239,.88); backdrop-filter: saturate(140%) blur(8px); -webkit-backdrop-filter: saturate(140%) blur(8px); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 5; margin-bottom: 0; }
.page-title { font-family: 'Instrument Serif', serif; font-size: 42px; color: var(--ink); letter-spacing: -.4px; line-height: 1.05; }
.page-subtitle { font-size: 13.5px; color: var(--muted); margin-top: 6px; display: flex; align-items: center; gap: 10px; }
.topbar-actions { display: flex; gap: 8px; align-items: center; }

/* ── BUTTONS ── */
.btn { display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px; border-radius: 9px; font-size: 13px; font-weight: 500; cursor: pointer; border: 1px solid var(--border); background: var(--white); color: var(--ink); transition: all .15s; font-family: inherit; white-space: nowrap; }
.btn:hover { border-color: #d8d3c2; }
.btn-primary { background: var(--sage); color: #fff; border-color: var(--sage); }
.btn-primary:hover { background: var(--sage-700); border-color: var(--sage-700); }
.btn-secondary { background: var(--white); color: var(--ink-soft); border: 1px solid var(--border); }
.btn-secondary:hover { border-color: #d8d3c2; background: #fbfaf4; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--ink-soft); }
.btn-ghost:hover { background: rgba(74,124,89,.07); border-color: transparent; }
.btn-purple { background: var(--purple); color: #fff; border-color: var(--purple); }
.btn-purple:hover { background: #4a2e6a; border-color: #4a2e6a; }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-sage { background: var(--sage-50); color: var(--sage-800); border: 1px solid var(--sage-100); }
.btn-sage:hover { background: var(--sage); color: #fff; border-color: var(--sage); }

/* ── CARDS ── */
.card { background: var(--white); border-radius: var(--radius); border: 1px solid var(--border); padding: 24px; box-shadow: var(--shadow); }
.card-sm { padding: 16px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }

/* ── STATS ── */
.stat-card { background: var(--white); border-radius: var(--radius); border: 1px solid var(--border); padding: 18px 18px 16px; box-shadow: var(--shadow); min-height: 140px; display: flex; flex-direction: column; gap: 10px; position: relative; overflow: hidden; }
.stat-icon { position: absolute; top: 18px; right: 18px; width: 26px; height: 26px; border-radius: 7px; background: var(--sage-50); display: flex; align-items: center; justify-content: center; font-size: 14px; color: var(--sage-800); }
.stat-label { font-size: 10.5px; color: var(--muted); font-weight: 500; text-transform: uppercase; letter-spacing: .14em; padding-right: 36px; }
.stat-value { font-family: 'Instrument Serif', serif; font-size: 54px; color: var(--ink); margin: 0; line-height: .95; letter-spacing: -.02em; }
.stat-delta { font-size: 12.5px; color: var(--muted); margin-top: auto; padding-top: 6px; border-top: 1px dashed var(--line-2); }

/* ── TAGS ── */
.tag { display: inline-flex; align-items: center; gap: 5px; font-size: 10.5px; font-weight: 500; padding: 1px 7px; border-radius: 5px; letter-spacing: .02em; }
.tag-green { background: var(--sage-light); color: var(--sage-dark); }
.tag-amber { background: var(--amber-light); color: var(--amber); }
.tag-red { background: var(--red-light); color: var(--red); }
.tag-blue { background: var(--blue-light); color: var(--blue); }
.tag-purple { background: var(--purple-light); color: var(--purple); }
.tag-gray { background: var(--line-2); color: var(--muted); }
.tag-tcc { background: #e7eef0; color: #3c5a64; }
.tag-sis { background: #efe7e0; color: #6a4a30; }
.tag-psi { background: #ece4ef; color: var(--purple); }
.tag-dot::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; display: inline-block; }

/* ── TABLE ── */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-size: 11.5px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; padding: 10px 16px; border-bottom: 1px solid var(--border); }
td { padding: 14px 16px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
tr:hover td { background: var(--bg); }
tr:last-child td { border-bottom: none; }
.patient-info { display: flex; align-items: center; gap: 12px; }
.patient-avatar { width: 44px; height: 44px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 16px; font-weight: 700; flex-shrink: 0; }
.patient-name { font-weight: 500; font-size: 14px; }
.patient-meta { font-size: 12px; color: var(--muted); }

/* ── SPLIT PANELS ── */
.split { display: grid; grid-template-columns: 340px 1fr; gap: 20px; height: calc(100vh - 160px); }
.panel-list { overflow-y: auto; display: flex; flex-direction: column; gap: 8px; }
.panel-detail { overflow-y: auto; display: flex; flex-direction: column; }

/* ── PATIENT DETAIL TABS ── */
.patient-tab-bar { display: flex; overflow-x: auto; border-bottom: 1px solid var(--border); flex-shrink: 0; margin: 4px -20px 0; padding: 0 20px; }
.patient-tab-bar::-webkit-scrollbar { display: none; }
.ptab { padding: 8px 14px; font-size: 12.5px; font-weight: 500; color: var(--muted); cursor: pointer; border: none; background: transparent; border-bottom: 2px solid transparent; margin-bottom: -1px; transition: all .15s; font-family: inherit; white-space: nowrap; flex-shrink: 0; }
.ptab:hover { color: var(--ink); }
.ptab.active { color: var(--sage); border-bottom-color: var(--sage); font-weight: 600; }
.ptab-content { flex: 1; overflow-y: auto; }
.list-item { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px 16px; cursor: pointer; transition: all .15s; box-shadow: var(--shadow); }
.list-item:hover { border-color: #d8d3c2; background: #fbfaf4; }
.list-item.active { border-color: var(--sage); border-left: 3px solid var(--sage); padding-left: 14px; background: var(--sage-50); }

/* ── AGENDA ── */
.agenda-grid { display: grid; grid-template-columns: 80px 1fr; }
.time-slot { height: 64px; display: flex; align-items: flex-start; justify-content: flex-end; padding-right: 16px; padding-top: 6px; font-size: 12px; color: var(--muted); }
.appt-col { display: flex; flex-direction: column; border-left: 1px solid var(--border); padding-left: 12px; }
.appt-slot { height: 64px; display: flex; align-items: flex-start; padding-top: 4px; }
.appt-block { border-radius: 10px; padding: 8px 12px; font-size: 12.5px; width: 100%; cursor: pointer; transition: transform .1s; border-left: 3px solid currentColor; }
.appt-block:hover { transform: translateX(2px); }
.appt-green { background: #e8f5ec; color: #2e7d4f; }
.appt-blue { background: var(--blue-light); color: var(--blue); }
.appt-amber { background: var(--amber-light); color: var(--amber); }
.appt-empty { color: transparent; pointer-events: none; }

/* ── SESSION ── */
.session-layout { display: grid; grid-template-columns: 1fr 380px; gap: 20px; height: calc(100vh - 160px); }
.video-area { background: #0f1410; border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; height: 100%; }
.video-main { flex: 1; display: flex; align-items: center; justify-content: center; position: relative; }
.video-placeholder { text-align: center; color: #6a7a6d; }
.video-avatar-large { width: 80px; height: 80px; border-radius: 50%; background: #2a3f2d; display: flex; align-items: center; justify-content: center; font-size: 30px; color: #8fb89c; margin: 0 auto 12px; }
.video-controls { background: rgba(0,0,0,.4); padding: 12px 20px 26px; display: flex; align-items: center; justify-content: center; gap: 12px; }
.ctrl-btn { width: 42px; height: 42px; border-radius: 50%; border: none; cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 17px; transition: all .15s; }
.ctrl-btn-light { background: rgba(255,255,255,.12); color: #fff; }
.ctrl-btn-light:hover { background: rgba(255,255,255,.22); }
.ctrl-btn-red { background: #c0392b; color: #fff; }
#page-agenda.agenda-compacto .appt-slot { min-height: 32px !important; }
#page-agenda.agenda-compacto .appt-block { padding: 4px 8px !important; font-size: 11px !important; gap: 3px !important; margin-bottom: 2px !important; }
#page-agenda.agenda-compacto .time-slot { padding: 4px 8px !important; font-size: 10px !important; padding-top: 5px !important; }
#page-agenda.agenda-compacto .slot-add { min-height: 28px !important; font-size: 11px !important; }
.session-live-badge { position: absolute; top: 16px; left: 16px; background: #c0392b; color: #fff; font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: 20px; letter-spacing: .5px; display: flex; align-items: center; gap: 6px; }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: #fff; animation: blink 1.2s infinite; }
.session-timer { position: absolute; top: 16px; right: 16px; background: rgba(0,0,0,.5); color: #fff; font-size: 13px; font-weight: 500; padding: 4px 12px; border-radius: 20px; }
.sess-patient-picker { display: inline-flex; align-items: center; gap: 3px; padding: 2px 7px 2px 8px; border-radius: 6px; background: rgba(74,124,89,.09); border: 1px solid rgba(74,124,89,.22); cursor: pointer; transition: background .15s; }
.sess-patient-picker:hover { background: rgba(74,124,89,.17); }
.sess-picker-arrow { font-size: 10px; color: var(--sage); opacity: .8; pointer-events: none; line-height: 1; margin-top: 1px; }
.ai-panel { display: flex; flex-direction: column; gap: 16px; overflow-y: auto; min-height: 0; }
/* EM SESSÃO: a coluna se reordena para o que importa ao vivo — notas e perguntas
   sobem, histórico (útil só nos primeiros minutos) desce. Revisão 10/07. */
.ai-panel.live #sess-nota-card { order: -2; }
.ai-panel.live #sess-guia { order: -1; }
.ai-panel.live #sess-historico { order: 2; }
/* !important: vence o min-height/font-size inline do textarea no modo sessão */
.ai-panel.live #session-ai-note { min-height: 220px !important; font-size: 13px !important; }
/* Indicador de captura ao vivo (confiança: o áudio ESTÁ sendo gravado) */
.sess-capture { display: flex; align-items: center; gap: 9px; background: var(--sage-light); border: 1px solid var(--sage-mid); border-radius: var(--radius); font-size: 12.5px; color: var(--sage-800); padding: 10px 14px; }
.sess-capture .sess-cap-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--red); animation: sessCapPulse 1.6s ease-out infinite; flex-shrink: 0; }
@keyframes sessCapPulse { 0%,100% { opacity: 1; } 50% { opacity: .35; } }
/* Briefing em overlay (sem sair da sessão ao vivo) */
#sess-briefing-overlay { position: fixed; inset: 0; z-index: 9000; display: none; }
#sess-briefing-overlay.open { display: block; }
#sess-briefing-overlay .sbo-back { position: absolute; inset: 0; background: rgba(20,25,20,.45); }
#sess-briefing-overlay .sbo-panel { position: absolute; top: 0; right: 0; bottom: 0; width: min(480px, 92vw); background: var(--white); border-left: 1px solid var(--border); box-shadow: var(--shadow-lg); display: flex; flex-direction: column; }
#sess-briefing-overlay .sbo-head { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; flex-shrink: 0; }
#sess-briefing-overlay .sbo-body { padding: 18px 20px; overflow-y: auto; font-size: 13.5px; line-height: 1.7; color: var(--ink-soft); }
#sess-briefing-overlay .sbo-body h4 { font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--purple); margin: 16px 0 6px; font-weight: 700; }
#sess-briefing-overlay .sbo-body h4:first-child { margin-top: 0; }
.ai-section-title { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 10px; }
.sess-nota-item { display: flex; flex-direction: column; gap: 2px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.sess-nota-item:last-child { border-bottom: none; }
.sess-nota-date { font-size: 11px; color: var(--muted); font-weight: 600; }
.sess-nota-txt { font-size: 12px; color: var(--ink-soft); line-height: 1.4; }
.sess-nota-empty { font-size: 12px; color: var(--muted); padding: 8px 0; }
.sess-humor { font-size: 12px; color: var(--sage); font-weight: 600; margin-top: 8px; }
.sess-briefing-badge { font-size: 11px; color: var(--sage); margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--border); }
.sess-perguntas-title { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 6px; }
.sess-pergunta { font-size: 12px; color: var(--ink-soft); line-height: 1.5; padding: 3px 0; }
.insight-item { display: flex; gap: 10px; padding: 12px 14px; background: var(--amber-light); border-radius: 10px; border-left: 3px solid var(--amber); margin-bottom: 8px; font-size: 13px; color: var(--ink-soft); line-height: 1.55; }
/* Banner primeiro paciente */
.first-patient-banner { background: linear-gradient(135deg, #f0f4ff 0%, #faf5ff 100%); border: 1.5px dashed #b4c6f5; border-radius: 16px; padding: 40px 32px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 12px; margin-bottom: 24px; }
.first-patient-banner .fpb-icon { font-size: 48px; line-height: 1; margin-bottom: 4px; }
.first-patient-banner .fpb-title { font-size: 18px; font-weight: 700; color: var(--ink); }
.first-patient-banner .fpb-sub { font-size: 14px; color: var(--muted); max-width: 380px; line-height: 1.6; }
.first-patient-banner .fpb-actions { display: flex; gap: 12px; margin-top: 8px; flex-wrap: wrap; justify-content: center; }
.first-patient-banner .fpb-steps { display: flex; gap: 24px; margin-top: 16px; flex-wrap: wrap; justify-content: center; }
.first-patient-banner .fpb-step { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-soft); }
.first-patient-banner .fpb-step-num { width: 22px; height: 22px; border-radius: 50%; background: var(--primary); color: #fff; font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.insight-icon { font-size: 15px; flex-shrink: 0; }
.note-area { width: 100%; border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; font-size: 13.5px; font-family: inherit; color: var(--ink); resize: none; line-height: 1.7; outline: none; min-height: 140px; transition: border-color .15s, box-shadow .15s; }
.note-area:focus { border-color: var(--sage); box-shadow: 0 0 0 3px rgba(74,124,89,.08); }

/* ── PRONTUÁRIO ── */
.detail-header { display: flex; align-items: center; gap: 16px; margin-bottom: 24px; }
.detail-avatar { width: 72px; height: 72px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 26px; font-weight: 700; color: #fff; flex-shrink: 0; }
.detail-name { font-family: 'Instrument Serif', serif; font-size: 30px; }
.detail-meta { font-size: 13px; color: var(--muted); display: flex; gap: 16px; flex-wrap: wrap; margin-top: 4px; }
.timeline { display: flex; flex-direction: column; }
.tl-item { display: flex; gap: 16px; }
.tl-line { display: flex; flex-direction: column; align-items: center; }
.tl-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--sage); flex-shrink: 0; margin-top: 4px; }
.tl-bar { width: 2px; flex: 1; background: var(--border); margin: 4px 0; min-height: 24px; }
.tl-content { padding-bottom: 20px; flex: 1; }
.tl-date { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.tl-title { font-size: 14px; font-weight: 500; }
.tl-body { font-size: 13px; color: var(--ink-soft); line-height: 1.6; margin-top: 4px; }
.tabs { display: flex; border-bottom: 1px solid var(--border); margin-bottom: 20px; }
.tab { padding: 10px 18px; font-size: 13.5px; font-weight: 500; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; transition: all .15s; }
.tab:hover { color: var(--ink); }
.tab.active { color: var(--sage); border-bottom-color: var(--sage); font-weight: 600; }

/* ── MODALS ── */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 400; display: none; align-items: flex-start; justify-content: center; overflow-y: auto; padding: 24px 16px; }
.modal-overlay.open { display: flex; }
.modal { background: var(--white); border-radius: 16px; padding: 32px; max-width: 480px; width: 100%; box-shadow: var(--shadow-lg); margin: auto; }
.modal-box { background: #ffffff; border-radius: 16px; box-shadow: 0 24px 64px rgba(0,0,0,.28); overflow: hidden; }
.modal-header { padding: 20px 24px 16px; border-bottom: 1px solid var(--border); background: #fff; }
.modal-title { font-family: 'Instrument Serif', serif; font-size: 22px; margin-bottom: 8px; }
.modal-body { font-size: 14px; color: var(--ink-soft); line-height: 1.7; margin-bottom: 24px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; }
.consent-item { display: flex; gap: 10px; align-items: flex-start; padding: 12px; background: var(--bg); border-radius: 8px; margin-bottom: 10px; }
.consent-icon { font-size: 18px; }
.consent-text { font-size: 13px; color: var(--ink-soft); line-height: 1.5; }
.consent-text strong { color: var(--ink); }

/* ── MISC ── */
.search-bar { display: flex; align-items: center; gap: 10px; background: var(--white); border: 1px solid var(--border); border-radius: 8px; padding: 9px 14px; margin-bottom: 20px; }
.search-bar input { border: none; outline: none; background: transparent; font-size: 14px; font-family: inherit; color: var(--ink); flex: 1; }
.divider { height: 1px; background: var(--border); margin: 20px 0; }
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.section-title { font-size: 15px; font-weight: 600; }
.progress-bar { height: 6px; background: var(--border); border-radius: 10px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--sage); border-radius: 10px; transition: width .3s; }
.mini-chart { display: flex; align-items: flex-end; gap: 6px; }
.bar-mini { width: 30px; border-radius: 3px 3px 0 0; background: var(--sage); opacity: .7; }
.bar-mini:hover { opacity: 1; }
.notif { position: relative; }
.notif::after { content: ''; position: absolute; top: -2px; right: -2px; width: 8px; height: 8px; background: var(--amber); border-radius: 50%; border: 2px solid var(--ink); }
select { border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px; font-size: 13.5px; font-family: inherit; background: var(--white); color: var(--ink); outline: none; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.form-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
label { font-size: 12.5px; font-weight: 600; color: var(--ink-soft); }
.form-input { border: 1px solid var(--border); border-radius: 8px; padding: 9px 13px; font-size: 14px; font-family: inherit; outline: none; color: var(--ink); }
.form-input:focus { border-color: var(--sage); }
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-thumb { background: #cdd4ce; border-radius: 10px; }
.fade-in { animation: fadeIn .25s ease; }
@keyframes fadeIn { from{opacity:0;transform:translateY(6px)} to{opacity:1;transform:none} }
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:.3} }
@keyframes pulse { 0%,100%{opacity:1;transform:scale(1)} 50%{opacity:.5;transform:scale(.8)} }
@keyframes spin { from{transform:rotate(0deg)} to{transform:rotate(360deg)} }

/* ══════════════════════════════════════
   STARTUP POLISH — animações & UX
══════════════════════════════════════ */

/* 1. Page enter */
@keyframes pageEnter { from{opacity:0;transform:translateY(12px)} to{opacity:1;transform:none} }

/* 2. Card hover lift */
.stat-card { transition: transform .2s ease, box-shadow .2s ease; cursor: default; }
.stat-card:hover { transform: translateY(-3px); box-shadow: 0 10px 30px rgba(0,0,0,.1); }

/* 3. Button shimmer + press */
.btn:active { transform: scale(0.97); }
.btn-primary { position: relative; overflow: hidden; }
.btn-primary::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(105deg, transparent 40%, rgba(255,255,255,.2) 50%, transparent 60%);
  transform: translateX(-120%); transition: transform .5s ease;
  pointer-events: none;
}
.btn-primary:hover::after { transform: translateX(120%); }

/* 4. Modal entrance + exit */
@keyframes modalIn { from{opacity:0;transform:scale(.95) translateY(10px)} to{opacity:1;transform:none} }
@keyframes modalOut { from{opacity:1;transform:none} to{opacity:0;transform:scale(.95) translateY(8px)} }
@keyframes overlayIn { from{opacity:0} to{opacity:1} }
@keyframes overlayOut { from{opacity:1} to{opacity:0} }
.modal-overlay.open { animation: overlayIn .2s ease; }
.modal-overlay.open .modal { animation: modalIn .3s cubic-bezier(.16,1,.3,1); }

/* 5. Toast slide-in from right */
@keyframes toastSlideIn { from{opacity:0;transform:translateX(calc(100% + 32px))} to{opacity:1;transform:translateX(0)} }
@keyframes toastSlideOut { from{opacity:1;transform:translateX(0)} to{opacity:0;transform:translateX(calc(100% + 32px))} }
@keyframes toastBar { from{width:100%} to{width:0%} }
.tf-toast {
  position: fixed; bottom: 24px; right: 24px; left: auto;
  background: #1a1f1c; color: #fff;
  padding: 13px 16px 16px; border-radius: 12px;
  font-size: 13.5px; font-family: inherit;
  z-index: 9999; box-shadow: 0 8px 32px rgba(0,0,0,.28);
  display: flex; align-items: center; gap: 10px;
  min-width: 260px; max-width: 360px;
  animation: toastSlideIn .38s cubic-bezier(.16,1,.3,1);
  overflow: hidden;
}
.tf-toast.hiding { animation: toastSlideOut .28s ease forwards; }
.tf-toast-bar {
  position: absolute; bottom: 0; left: 0; height: 3px;
  border-radius: 0 0 12px 12px;
  animation: toastBar 3s linear forwards;
}

/* 6. List stagger */
@keyframes itemStagger { from{opacity:0;transform:translateY(7px)} to{opacity:1;transform:none} }

/* 7. Sidebar active: glow sutil */
.nav-item.active {
  background: var(--sage); color: #fff;
  box-shadow: 0 0 0 1px rgba(74,124,89,.5), 0 3px 12px rgba(74,124,89,.3);
}

/* 8. Dashboard hero — clean page heading */
.dash-hero {
  background: transparent;
  border-radius: 0;
  padding: 4px 0 32px 0;
  margin-bottom: 8px;
  position: relative; overflow: visible;
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px;
}
.dash-hero::before, .dash-hero::after { display: none; }
.dash-hero-title {
  font-family: 'Instrument Serif', serif; font-size: 42px;
  color: var(--ink); margin-bottom: 6px; line-height: 1.05; letter-spacing: -.015em;
}
.dash-hero-sub { font-size: 14px; color: var(--muted); }
.dash-hero-actions { display: flex; gap: 10px; align-items: center; padding-top: 8px; flex-shrink: 0; }

/* 9. Avatar gradient */
.patient-avatar { transition: transform .15s ease; }
.list-item:hover .patient-avatar { transform: scale(1.08); }

/* ── BRIEFING ── */
.briefing-hero {
  background: linear-gradient(135deg, var(--sage-light) 0%, #ffffff 70%);
  border: 1px solid rgba(74,124,89,.15);
  border-radius: 20px; padding: 28px 32px;
  display: flex; align-items: center; gap: 20px; margin-bottom: 24px;
  position: relative; overflow: hidden;
}
.briefing-hero::before {
  content: ''; position: absolute; right: -60px; top: -60px;
  width: 240px; height: 240px; border-radius: 50%;
  background: radial-gradient(circle, rgba(74,124,89,.08) 0%, transparent 70%);
  pointer-events: none;
}
.hero-av { width: 56px; height: 56px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 18px; font-weight: 700; color: #fff; flex-shrink: 0; border: 2px solid rgba(74,124,89,.2); box-shadow: 0 4px 14px rgba(74,124,89,.2); }
.hero-name { font-family: 'Instrument Serif', serif; font-size: 22px; color: var(--ink); }
.hero-sub { font-size: 12px; color: var(--muted); margin-top: 4px; display: flex; gap: 14px; flex-wrap: wrap; }
.hero-right { margin-left: auto; text-align: right; flex-shrink: 0; }
.session-num { font-family: 'Instrument Serif', serif; font-size: 38px; color: var(--sage); line-height: 1; }
.session-lbl { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .8px; margin-top: 2px; }

.ai-badge-inline { display: inline-flex; align-items: center; gap: 7px; background: var(--purple-light); color: var(--purple); font-size: 12px; font-weight: 600; padding: 5px 12px; border-radius: 20px; border: 1px solid rgba(90,62,138,.15); margin-bottom: 18px; }
.ai-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--purple); animation: pulse 2s infinite; }

.memory-bar { display: flex; gap: 8px; flex-wrap: wrap; padding: 14px 20px; background: #faf8f4; border-bottom: 1px solid var(--border); }
.memory-chip { display: flex; align-items: center; gap: 6px; background: var(--white); border: 1px solid var(--border); border-radius: 8px; padding: 4px 10px; font-size: 12px; color: var(--ink-soft); }
.memory-chip b { color: var(--purple); }

.insight-block { border-radius: 12px; padding: 16px 18px; border-left: 3px solid transparent; margin-bottom: 12px; }
.insight-block.priority { background: #fdf3e6; border-color: var(--amber); }
.insight-block.pattern { background: var(--purple-light); border-color: var(--purple); }
.insight-block.progress { background: var(--sage-light); border-color: var(--sage); }
.insight-block.alert { background: var(--red-light); border-color: var(--red); }
.insight-block.question { background: var(--blue-light); border-color: var(--blue); }
.insight-type { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .7px; margin-bottom: 6px; opacity: .75; }
.insight-block.priority .insight-type { color: var(--amber); }
.insight-block.pattern .insight-type { color: var(--purple); }
.insight-block.progress .insight-type { color: var(--sage); }
.insight-block.alert .insight-type { color: var(--red); }
.insight-block.question .insight-type { color: var(--blue); }
.insight-text { font-size: 14px; line-height: 1.7; color: var(--ink-soft); }
.insight-text strong { color: var(--ink); }
.insight-evidence { margin-top: 8px; padding: 9px 11px; background: rgba(0,0,0,.04); border-radius: 8px; font-size: 12.5px; color: var(--muted); font-style: italic; line-height: 1.6; }
.question-item { display: flex; align-items: flex-start; gap: 10px; padding: 9px 11px; background: rgba(44,95,138,.07); border-radius: 8px; font-size: 13.5px; color: var(--blue); cursor: pointer; transition: background .15s; border: none; font-family: inherit; text-align: left; width: 100%; margin-bottom: 6px; }
.question-item:hover { background: rgba(44,95,138,.14); }
.q-num { font-size: 11px; font-weight: 700; opacity: .5; flex-shrink: 0; margin-top: 2px; }

.gen-state { padding: 40px; text-align: center; }
.gen-icon { font-size: 38px; margin-bottom: 14px; }
.gen-title { font-family: 'Instrument Serif', serif; font-size: 20px; margin-bottom: 8px; }
.gen-sub { font-size: 14px; color: var(--muted); line-height: 1.6; max-width: 380px; margin: 0 auto 22px; }

.loading-steps { display: flex; flex-direction: column; gap: 14px; padding: 36px; }
.loading-step { display: flex; align-items: center; gap: 12px; }
.step-icon { width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 15px; flex-shrink: 0; }
.step-pending { background: #f0ede8; }
.step-running { background: var(--purple-light); }
.step-done { background: var(--sage-light); }
.step-label { font-size: 13.5px; }
.step-label.done { color: var(--muted); text-decoration: line-through; }
.step-label.running { color: var(--purple); font-weight: 500; }

.themes-wrap { display: flex; flex-wrap: wrap; gap: 8px; }
.theme-chip { padding: 5px 13px; border-radius: 20px; font-size: 13px; font-weight: 500; display: flex; align-items: center; gap: 5px; }
.theme-chip .freq { font-size: 11px; opacity: .55; }

.tl-row { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 12px; }
.tl-dot-mini { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; margin-top: 4px; }
.tl-date-mini { font-size: 11px; color: var(--muted); margin-bottom: 2px; }
.tl-content-mini { font-size: 13px; color: var(--ink-soft); line-height: 1.5; }

.section-lbl { font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .8px; margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.section-lbl::after { content: ''; flex: 1; height: 1px; background: var(--border); }

.regen-btn { background: none; border: 1px solid var(--border); color: var(--muted); padding: 7px 13px; border-radius: 8px; font-size: 12.5px; font-weight: 500; cursor: pointer; font-family: inherit; display: flex; align-items: center; gap: 5px; transition: all .15s; }
.regen-btn:hover { border-color: var(--purple); color: var(--purple); }

/* ── PORTAL DO PACIENTE ── */

/* ── FINANCEIRO V2 ── */
.fin-session-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; border-bottom: 1px solid var(--line-2);
  transition: background .1s;
}
.fin-session-row:last-child { border-bottom: none; }
.fin-session-row:hover { background: var(--bg); }
.fin-date-col { min-width: 80px; text-align: center; }
.fin-date-day { font-size: 14px; font-weight: 600; color: var(--ink); }
.fin-date-sub { font-size: 11px; color: var(--muted); }
.fin-patient-col { flex: 1; display: flex; align-items: center; gap: 10px; }
.fin-value-col { font-family: 'Instrument Serif', serif; font-size: 18px; color: var(--ink); min-width: 80px; text-align: right; }
.fin-status-col { min-width: 120px; text-align: center; }
.fin-actions-col { min-width: 90px; display: flex; gap: 6px; justify-content: flex-end; }

.fin-wpp-btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 11px; border-radius: 8px; font-size: 12px; font-weight: 500;
  cursor: pointer; border: none; font-family: inherit;
  background: #25D366; color: #fff; transition: all .15s;
}
.fin-wpp-btn:hover { background: #1eba57; }
.fin-wpp-btn.sent { background: var(--sage-light); color: var(--sage); cursor: default; }

.fin-confirm-btn {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 5px 11px; border-radius: 8px; font-size: 12px; font-weight: 500;
  cursor: pointer; border: 1px solid var(--border); font-family: inherit;
  background: var(--white); color: var(--ink-soft); transition: all .15s;
}
.fin-confirm-btn:hover { border-color: var(--sage); color: var(--sage); }
.fin-confirm-btn.confirmed { background: var(--sage); color: #fff; border-color: var(--sage); cursor: default; }

.fin-tab-bar { display: flex; border-bottom: 1px solid var(--border); margin-bottom: 0; }
.fin-tab {
  padding: 11px 18px; font-size: 13.5px; font-weight: 500;
  color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent;
  margin-bottom: -1px; transition: all .15s; background: none; border-top: none;
  border-left: none; border-right: none; font-family: inherit;
}
.fin-tab:hover { color: var(--ink); }
.fin-tab.active { color: var(--sage); border-bottom-color: var(--sage); font-weight: 600; }

.fin-filter-row {
  display: flex; align-items: center; gap: 10px; padding: 14px 16px;
  border-bottom: 1px solid var(--border); background: var(--bg);
}
.fin-filter-btn {
  padding: 5px 12px; border-radius: 20px; font-size: 12px; font-weight: 500;
  cursor: pointer; border: 1px solid var(--border); background: var(--white);
  color: var(--ink-soft); font-family: inherit; transition: all .15s;
}
.fin-filter-btn:hover { border-color: var(--sage-mid); }
.fin-filter-btn.active { background: var(--sage); color: #fff; border-color: var(--sage); }

.fin-patient-card {
  padding: 16px; border: 1px solid var(--border); border-radius: 10px;
  margin-bottom: 10px; cursor: pointer; transition: all .15s;
}
.fin-patient-card:hover { border-color: var(--sage-mid); }
.fin-patient-card.active { border-color: var(--sage); background: var(--sage-light); }

.fin-summary-bar {
  display: flex; gap: 6px; padding: 12px 16px;
  background: var(--sage-light); border-radius: 8px; margin-bottom: 16px;
  align-items: center; font-size: 13px; color: var(--sage);
}

.wpp-preview {
  background: #e5ddd5; border-radius: 12px; padding: 16px; margin-top: 12px;
  max-width: 360px;
}
.wpp-msg {
  background: #dcf8c6; border-radius: 8px 8px 0 8px; padding: 10px 13px;
  font-size: 13px; line-height: 1.6; color: #303030; position: relative;
}
.wpp-msg-time { font-size: 10px; color: #8a9490; text-align: right; margin-top: 4px; }
.wpp-pix-link {
  display: flex; align-items: center; gap: 8px; padding: 8px 12px;
  background: rgba(0,0,0,.05); border-radius: 6px; margin-top: 8px;
  font-size: 12px; color: #075e54; text-decoration: underline; cursor: pointer;
}

.receipt-preview {
  border: 1px solid var(--border); border-radius: 8px; padding: 20px;
  background: var(--white); max-width: 400px;
}
.receipt-header { text-align: center; padding-bottom: 14px; border-bottom: 1px dashed var(--border); margin-bottom: 14px; }
.receipt-row { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 6px; }
.receipt-row-label { color: var(--muted); }
.receipt-row-value { font-weight: 500; color: var(--ink); }
.receipt-total { font-family: 'Instrument Serif', serif; font-size: 22px; color: var(--ink); text-align: center; margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--border); }

/* ── PLANOS MENSAIS ── */
.plan-badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 10px; font-weight: 600; padding: 2px 8px;
  border-radius: 4px; text-transform: uppercase; letter-spacing: .3px;
}
.plan-badge-mensal { background: var(--blue-light); color: var(--blue); }
.plan-badge-avulso { background: var(--line-2); color: var(--muted); }

.plan-card {
  border: 1px solid var(--border); border-radius: 12px; padding: 18px 20px;
  margin-bottom: 12px; transition: all .15s; position: relative; overflow: hidden;
}
.plan-card:hover { border-color: var(--sage-mid); }
.plan-card-mensal { border-left: 3px solid var(--blue); }
.plan-card-avulso { border-left: 3px solid var(--muted); }
.plan-card-header { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.plan-card-body { display: flex; gap: 16px; flex-wrap: wrap; }
.plan-card-stat { display: flex; flex-direction: column; gap: 2px; }
.plan-card-stat-label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .3px; }
.plan-card-stat-value { font-size: 15px; font-weight: 600; color: var(--ink); }

.plan-sessions-grid {
  display: flex; gap: 6px; margin-top: 10px; padding-top: 10px;
  border-top: 1px solid var(--border);
}
.plan-session-dot {
  width: 28px; height: 28px; border-radius: 6px; display: flex;
  align-items: center; justify-content: center; font-size: 11px;
  font-weight: 600; border: 1px solid var(--border); transition: all .15s;
}
.plan-session-dot.used { background: var(--sage); color: #fff; border-color: var(--sage); }
.plan-session-dot.pending { background: var(--amber-light); color: var(--amber); border-color: var(--amber); }
.plan-session-dot.unused { background: var(--white); color: var(--muted); }

.monthly-charge-row {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px;
  border-bottom: 1px solid var(--line-2); transition: background .1s;
}
.monthly-charge-row:last-child { border-bottom: none; }
.monthly-charge-row:hover { background: var(--bg); }

.plan-config-card {
  border: 1px solid var(--border); border-radius: 10px; padding: 16px;
  display: flex; align-items: center; gap: 14px; margin-bottom: 10px;
  cursor: pointer; transition: all .15s;
}
.plan-config-card:hover { border-color: var(--sage-mid); background: var(--bg); }
.plan-config-card.selected { border-color: var(--sage); background: var(--sage-light); }

/* Inline editable fields */
.fin-editable {
  cursor: pointer; padding: 2px 6px; border-radius: 4px;
  border: 1px solid transparent; transition: all .15s;
  display: inline-block; min-width: 50px;
}
.fin-editable:hover { background: var(--sage-light); border-color: var(--sage-mid); }
.fin-editable-input {
  border: 1px solid var(--sage); border-radius: 4px;
  padding: 2px 6px; font-size: inherit; font-family: inherit;
  font-weight: inherit; color: var(--ink); outline: none;
  background: var(--white); width: 85px;
}
.fin-editable-input:focus { box-shadow: 0 0 0 2px rgba(74,124,89,.2); }

/* Delete button */
.charge-btn-delete {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 4px 8px; border-radius: 6px; font-size: 11px;
  cursor: pointer; border: 1px solid transparent; font-family: inherit;
  background: transparent; color: var(--muted); transition: all .15s;
}
.charge-btn-delete:hover { background: var(--red-light); color: var(--red); border-color: rgba(192,57,43,.2); }

/* Undo bar */
.fin-undo-bar {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px; background: var(--ink); color: #fff;
  font-size: 13px; border-radius: 10px;
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  z-index: 999; box-shadow: 0 8px 32px rgba(0,0,0,.25);
  animation: fadeIn .25s ease;
}
.fin-undo-btn {
  background: rgba(255,255,255,.15); color: #fff; border: none;
  padding: 5px 14px; border-radius: 6px; font-size: 12.5px;
  font-weight: 600; cursor: pointer; font-family: inherit;
  transition: background .15s;
}
.fin-undo-btn:hover { background: rgba(255,255,255,.25); }

/* Delete confirm row */
.charge-row-deleting {
  background: var(--red-light) !important;
  opacity: .7; transition: all .3s;
}

/* ── PORTAL DO PACIENTE (end marker) ── */
.portal-banner {
  background: linear-gradient(135deg, var(--sage-light) 0%, #ffffff 70%);
  border: 1px solid rgba(74,124,89,.15);
  border-radius: 20px; padding: 28px 32px;
  position: relative; overflow: hidden; margin-bottom: 24px;
}
.portal-banner::before {
  content: ''; position: absolute; right: -40px; top: -40px;
  width: 200px; height: 200px; border-radius: 50%;
  background: radial-gradient(circle, rgba(74,124,89,.08) 0%, transparent 70%);
  pointer-events: none;
}
.portal-banner::after { display: none; }
.portal-greeting { font-family: 'Instrument Serif', serif; font-size: 26px; color: var(--ink); margin-bottom: 4px; }
.portal-sub { font-size: 14px; color: var(--muted); }
.portal-next-session {
  margin-top: 16px; display: inline-flex; align-items: center; gap: 10px;
  background: rgba(74,124,89,.08); border: 1px solid rgba(74,124,89,.15);
  padding: 10px 18px; border-radius: 12px; font-size: 13.5px; color: var(--ink);
}
.portal-next-session strong { font-size: 15px; color: var(--sage); }

.portal-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 20px; }
@media (max-width: 900px) { .portal-grid { grid-template-columns: 1fr; } }

/* ── MOBILE TAREFAS — card layout ── */
@media (max-width: 768px) {
  .task-table thead { display: none; }
  .task-table, .task-table tbody, .task-table tr, .task-table td { display: block; width: 100%; }
  .task-table tr.task-row {
    position: relative;
    padding: 14px 16px 12px;
    border-bottom: 1px solid var(--border);
    display: grid;
    grid-template-columns: auto 1fr auto;
    grid-template-rows: auto auto;
    column-gap: 10px;
    row-gap: 4px;
  }
  /* Botão ação: col 1, row 1 */
  .task-table tr.task-row td:nth-child(1) { grid-column: 1; grid-row: 1 / 3; display: flex; align-items: center; width: auto; }
  /* Número: oculto em mobile */
  .task-table tr.task-row td:nth-child(2) { display: none; }
  /* Assunto: col 2, row 1 */
  .task-table tr.task-row td:nth-child(3) { grid-column: 2; grid-row: 1; font-size: 13.5px; font-weight: 500; }
  /* Paciente: col 2, row 2 — pequeno */
  .task-table tr.task-row td:nth-child(4) { grid-column: 2; grid-row: 2; font-size: 12px; color: var(--muted); }
  /* Vencimento: col 3, row 1 */
  .task-table tr.task-row td:nth-child(5) { grid-column: 3; grid-row: 1; font-size: 12px; white-space: nowrap; display: flex; align-items: center; width: auto; }
  /* Status: col 3, row 2 */
  .task-table tr.task-row td:nth-child(6) { grid-column: 3; grid-row: 2; display: flex; align-items: center; width: auto; }
  /* Delete: absoluto canto direito */
  .task-table tr.task-row td:nth-child(7) { position: absolute; top: 8px; right: 8px; width: auto; }
  .task-table td::before { display: none; }
}

/* ── MOBILE GRIDS & LAYOUT ── */
@media (max-width: 768px) {
  .grid-2 { grid-template-columns: 1fr; }
  /* minmax(0,…) permite as colunas encolherem abaixo do min-content dos cards,
     evitando overflow horizontal em viewports estreitas (ex: 390px) */
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split  { grid-template-columns: 1fr; height: auto; }
  .form-row { grid-template-columns: 1fr; }
  .abordagens-grid { grid-template-columns: 1fr; }
  .topbar { flex-wrap: wrap; gap: 10px; }
  .topbar-actions { flex-wrap: wrap; gap: 6px; }
  .topbar-actions .btn { font-size: 12px; padding: 6px 10px; }
  .agenda-grid { grid-template-columns: 44px 1fr; }
  .time-slot { padding-right: 8px; font-size: 11px; }
  #tf-onboarding-layer .form-row { grid-template-columns: 1fr; }
}

/* ── MOBILE ESTREITO: stats em coluna única para não estourar ── */
@media (max-width: 480px) {
  .grid-4 { grid-template-columns: 1fr; }
  /* Padding lateral das páginas (36px no desktop) estoura a viewport estreita:
     reduz para 14px, devolvendo largura ao conteúdo. */
  .page { padding-left: 14px; padding-right: 14px; }
  /* Insights do dashboard usam grid auto-fit que vira 3 colunas fixas e estoura;
     força coluna única em telas estreitas. */
  #dash-insights-list { grid-template-columns: 1fr !important; }
  /* Containers de conteúdo respeitam a largura da tela e quebram texto longo. */
  .perfil-section, .sup-alert-card, .insight-item, .card { max-width: 100%; min-width: 0; overflow-wrap: anywhere; }
  .perfil-section { padding: 16px 16px; }
  /* Barras de ação com botões quebram em vez de empurrar para fora. */
  .fin-tools, .fin-toolbar, .card-actions, .panel-actions { flex-wrap: wrap; }
  /* Barra de abas do Financeiro: rola horizontalmente em vez de estourar. */
  .fin-tab-bar { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .fin-tab { flex-shrink: 0; white-space: nowrap; }
  /* Supervisão: hero, dashboard e cards encolhem com a tela.
     min-width:auto (padrão de itens flex/grid) impede encolher abaixo do
     min-content e estoura a viewport — forçar 0 nos cards e itens do grid. */
  #sup-dashboard, .sup-hero, .sup-hero-right { min-width: 0; }
  .sup-hero { flex-wrap: wrap; }
  .sup-metric-card, .grid-4 > *, .sup-alert-card { min-width: 0; }
  .sup-tab-bar { flex-wrap: wrap; }
}

/* Flex-item <main> com min-width:auto (padrão) não encolhe abaixo do seu
   min-content, estourando a viewport. min-width:0 (em TODOS os tamanhos) deixa
   o main respeitar a largura do container — o conteúdo de largura fixa (ex:
   Kanban da Captação, 6 colunas) passa a rolar dentro do seu próprio
   overflow-x:auto em vez de esticar a página. Correção raiz do overflow. */
.app-main, main.app-main, .main, #tf-app-layer > main { min-width: 0; }

/* ── MOBILE SESSION ── */
@media (max-width: 768px) {
  .session-layout {
    grid-template-columns: 1fr;
    height: auto;
    gap: 12px;
  }
  .video-main { min-height: 240px; }
  .ai-panel { overflow-y: visible; }
}

/* ── MOBILE SIDEBAR ── */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform .28s cubic-bezier(.16,1,.3,1);
    z-index: 300;
  }
  .sidebar.sidebar-open {
    transform: translateX(0);
    box-shadow: 8px 0 40px rgba(0,0,0,.4);
  }
  .main { margin-left: 0; }
  .sidebar-overlay {
    display: block !important;
    opacity: 0;
    pointer-events: none;
    transition: opacity .28s;
  }
  .sidebar-overlay.visible {
    opacity: 1;
    pointer-events: auto;
  }
  .hamburger-btn { display: flex !important; }
}
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 299;
  cursor: pointer;
}
.hamburger-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  flex-shrink: 0;
  font-size: 18px;
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: 200;
  box-shadow: 0 2px 8px rgba(0,0,0,.1);
}

/* ── Busca global (Ctrl+K) ── */
#global-search-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.55);
  z-index: 10000; display: flex; align-items: flex-start; justify-content: center;
  padding-top: 80px; backdrop-filter: blur(4px);
  opacity: 0; pointer-events: none; transition: opacity .18s;
}
#global-search-overlay.visible { opacity: 1; pointer-events: auto; }
#global-search-box {
  background: #fff; border-radius: 16px; width: 100%; max-width: 580px;
  box-shadow: 0 28px 90px rgba(0,0,0,.32); overflow: hidden;
  transform: translateY(-12px); transition: transform .18s;
}
#global-search-overlay.visible #global-search-box { transform: translateY(0); }
#global-search-input {
  width: 100%; padding: 16px 20px; border: none; font-size: 16px;
  font-family: inherit; color: var(--ink); outline: none;
  border-bottom: 1px solid var(--border); box-sizing: border-box;
}
.gs-section-label {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .7px; color: var(--muted); padding: 10px 16px 4px;
}
.gs-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px; cursor: pointer; transition: background .12s;
}
.gs-item:hover, .gs-item.gs-active { background: var(--sage-light); border-radius: 8px; }
.gs-item-icon {
  width: 32px; height: 32px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; flex-shrink: 0;
}
.gs-item-title { font-size: 13px; font-weight: 500; color: var(--ink); }
.gs-item-sub   { font-size: 11px; color: var(--muted); margin-top: 1px; }
.gs-empty { padding: 28px; text-align: center; color: var(--muted); font-size: 13px; }
#gs-results { max-height: 380px; overflow-y: auto; }
.gs-footer {
  border-top: 1px solid var(--border); padding: 8px 16px;
  display: flex; gap: 16px; font-size: 11px; color: var(--muted);
}

/* ── Agenda: slots e células clicáveis ── */
.slot-add {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 10px;
  border-radius: 7px;
  /* Invisível até o hover da linha — o "+ Nova sessão" permanente em TODO slot
     vazio era ruído visual; mesma revelação da view Semana (V3). */
  border: 1.5px dashed transparent;
  color: transparent;
  font-size: 12px;
  cursor: pointer;
  transition: all .18s;
  user-select: none;
}
.appt-slot:hover .slot-add {
  border-color: var(--border);
  color: var(--muted);
}
.slot-add:hover,
.appt-slot .slot-add:hover {
  border-color: var(--sage);
  background: var(--sage-light);
  color: var(--sage);
}
.slot-add-icon {
  font-size: 16px;
  line-height: 1;
  font-weight: 300;
}
.slot-add-label { font-weight: 500; }

/* View semana — célula vazia */
.week-cell { overflow: hidden; }
.week-cell-add {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: transparent;
  cursor: pointer;
  transition: all .18s;
  border-radius: 3px;
}
.week-cell:hover .week-cell-add {
  color: var(--sage);
  background: var(--sage-light);
}

/* View mês — hint em dias vazios */
.mes-cell-add-hint {
  font-size: 10px;
  color: transparent;
  font-weight: 500;
  margin-top: 2px;
  transition: color .15s;
}
.mes-cell:hover .mes-cell-add-hint {
  color: var(--sage);
}

/* Mood check-in */
.mood-card { position: relative; overflow: hidden; }
.mood-card::before {
  content: ''; position: absolute; top: -30px; right: -30px;
  width: 100px; height: 100px; border-radius: 50%;
  background: radial-gradient(circle, rgba(74,124,89,.08) 0%, transparent 70%);
  pointer-events: none;
}
.mood-emoji-row { display: flex; gap: 6px; justify-content: center; margin: 16px 0 12px; }
.mood-emoji {
  width: 52px; height: 52px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; cursor: pointer; border: 2px solid var(--border);
  background: var(--white); transition: all .2s;
  position: relative;
}
.mood-emoji:hover { border-color: var(--sage-mid); transform: scale(1.08); }
.mood-emoji.selected {
  border-color: var(--sage); background: var(--sage-light);
  transform: scale(1.12); box-shadow: 0 0 0 4px rgba(74,124,89,.15);
}
.mood-emoji-label {
  font-size: 10px; color: var(--muted); text-align: center; margin-top: 4px;
  opacity: 0; transition: opacity .15s;
}
.mood-emoji.selected + .mood-emoji-label,
.mood-emoji:hover + .mood-emoji-label { opacity: 1; }
.mood-slider-wrap { margin: 12px 0; }
.mood-slider {
  -webkit-appearance: none; width: 100%; height: 6px;
  background: linear-gradient(90deg, #c0392b 0%, #c97d2e 25%, #dbb94e 50%, #8fb89c 75%, #4a7c59 100%);
  border-radius: 10px; outline: none;
}
.mood-slider::-webkit-slider-thumb {
  -webkit-appearance: none; width: 22px; height: 22px;
  background: var(--white); border: 2px solid var(--sage);
  border-radius: 50%; cursor: pointer; box-shadow: 0 2px 6px rgba(0,0,0,.15);
}
.mood-scale-labels { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); margin-top: 4px; }
.mood-note-input {
  width: 100%; border: 1px solid var(--border); border-radius: 8px;
  padding: 10px 13px; font-size: 13.5px; font-family: inherit;
  color: var(--ink); resize: none; outline: none; margin-top: 12px;
  min-height: 60px; transition: border-color .15s;
}
.mood-note-input:focus { border-color: var(--sage); }
.mood-note-input::placeholder { color: var(--muted); }
.mood-history { display: flex; gap: 4px; align-items: flex-end; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border); }
.mood-bar {
  flex: 1; border-radius: 4px 4px 0 0; min-height: 4px;
  transition: height .3s; position: relative; cursor: default;
}
.mood-bar-label { font-size: 9px; color: var(--muted); text-align: center; margin-top: 3px; }
.mood-saved-msg {
  display: none; align-items: center; gap: 6px; padding: 10px 14px;
  background: var(--sage-light); border-radius: 8px; margin-top: 12px;
  font-size: 13px; color: var(--sage); font-weight: 500;
}
.mood-saved-msg.show { display: flex; animation: fadeIn .3s ease; }

/* Exercise cards */
.exercise-item {
  display: flex; gap: 14px; padding: 14px 16px;
  border: 1px solid var(--border); border-radius: 10px;
  margin-bottom: 10px; transition: all .2s; cursor: pointer;
  align-items: flex-start;
}
.exercise-item:hover { border-color: var(--sage-mid); background: var(--bg); box-shadow: 0 2px 8px rgba(0,0,0,.06); }
.exercise-item.completed { background: var(--sage-light); border-color: rgba(74,124,89,.25); }
.exercise-check {
  width: 24px; height: 24px; border-radius: 50%;
  border: 2px solid var(--border); display: flex;
  align-items: center; justify-content: center;
  flex-shrink: 0; margin-top: 2px; transition: all .2s;
  font-size: 13px; color: transparent;
}
.exercise-item.completed .exercise-check {
  background: var(--sage); border-color: var(--sage); color: #fff;
}
.exercise-title { font-weight: 500; font-size: 14px; margin-bottom: 3px; }
.exercise-meta { font-size: 12px; color: var(--muted); line-height: 1.5; }
.exercise-tag { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 12px; margin-top: 6px; }
.exercise-tag-tcc { background: var(--sage-light); color: var(--sage-dark); }
.exercise-tag-diario { background: var(--sage-light); color: var(--sage-dark); }
.exercise-tag-relaxa { background: var(--sage-light); color: var(--sage-dark); }

/* Progress ring */
.progress-ring-wrap { display: flex; align-items: center; gap: 20px; }
.progress-ring { position: relative; width: 90px; height: 90px; flex-shrink: 0; }
.progress-ring svg { transform: rotate(-90deg); }
.progress-ring-text {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
}
.progress-ring-num { font-family: 'Instrument Serif', serif; font-size: 26px; color: var(--ink); line-height: 1; }
.progress-ring-lbl { font-size: 10px; color: var(--muted); }
.progress-stats { display: flex; flex-direction: column; gap: 8px; }
.progress-stat-row { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.progress-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }

/* Message area */
.portal-msg-input {
  display: flex; gap: 10px; padding: 14px 16px;
  border-top: 1px solid var(--border); align-items: center;
}
.portal-msg-input input {
  flex: 1; border: 1px solid var(--border); border-radius: 8px;
  padding: 10px 14px; font-size: 13.5px; font-family: inherit;
  outline: none; color: var(--ink);
}
.portal-msg-input input:focus { border-color: var(--sage); }
.portal-msg-bubble {
  padding: 10px 14px; border-radius: 12px; font-size: 13.5px;
  line-height: 1.6; max-width: 85%; margin-bottom: 8px;
}
.msg-therapist { background: var(--sage-light); color: var(--ink-soft); align-self: flex-start; border-bottom-left-radius: 4px; }
.msg-patient { background: var(--blue-light); color: var(--ink-soft); align-self: flex-end; border-bottom-right-radius: 4px; }
.msg-time { font-size: 10px; color: var(--muted); margin-top: 2px; }
.msg-thread { display: flex; flex-direction: column; padding: 16px; max-height: 220px; overflow-y: auto; gap: 4px; }

/* Portal view indicator */
.portal-view-badge {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--sage-light); color: var(--sage);
  font-size: 12px; font-weight: 600; padding: 5px 14px;
  border-radius: 20px; border: 1px solid rgba(74,124,89,.2);
}

/* ── FINANCEIRO V2 ── */
.fin-mode-toggle {
  display: inline-flex; background: var(--bg); border: 1px solid var(--border);
  border-radius: 10px; overflow: hidden;
}
.fin-mode-btn {
  padding: 8px 16px; font-size: 12.5px; font-weight: 500;
  cursor: pointer; border: none; background: none;
  color: var(--muted); font-family: inherit; transition: all .15s;
  position: relative;
}
.fin-mode-btn:hover { color: var(--ink); }
.fin-mode-btn.active { background: var(--sage); color: #fff; }
.fin-mode-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px; border-radius: 20px; font-size: 12px; font-weight: 500;
}
.fin-mode-badge-pre { background: var(--sage-light); color: var(--sage); border: 1px solid rgba(74,124,89,.2); }
.fin-mode-badge-post { background: var(--amber-light); color: var(--amber); border: 1px solid rgba(201,125,46,.2); }
.fin-mode-badge-hybrid { background: var(--purple-light); color: var(--purple); border: 1px solid rgba(90,62,138,.2); }

.fin-config-bar {
  background: var(--white); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px 20px; margin-bottom: 20px;
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
}
.fin-config-label { font-size: 13px; font-weight: 500; color: var(--ink-soft); }
.fin-config-desc { font-size: 12px; color: var(--muted); max-width: 400px; line-height: 1.5; }

.charge-row {
  display: grid; grid-template-columns: 2fr 1fr 1fr 1fr 1.2fr 1.4fr;
  align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line-2);
  font-size: 13.5px; transition: background .1s;
}
.charge-row:hover { background: var(--bg); }
.charge-row-header {
  display: grid; grid-template-columns: 2fr 1fr 1fr 1fr 1.2fr 1.4fr;
  padding: 10px 16px; font-size: 11.5px; font-weight: 600; color: var(--muted);
  text-transform: uppercase; letter-spacing: .5px; border-bottom: 1px solid var(--border);
  background: var(--bg);
}
.charge-actions { display: flex; gap: 6px; }
.charge-btn {
  padding: 5px 10px; border-radius: 6px; font-size: 11.5px; font-weight: 500;
  cursor: pointer; border: 1px solid var(--border); background: var(--white);
  font-family: inherit; transition: all .15s; display: inline-flex;
  align-items: center; gap: 4px; color: var(--ink-soft);
}
.charge-btn:hover { border-color: var(--sage-mid); background: var(--sage-light); color: var(--sage); }
.charge-btn-wpp { border-color: rgba(37,211,102,.3); color: #128C7E; }
.charge-btn-wpp:hover { background: #e8faf0; border-color: #25D366; color: #075E54; }
.charge-btn-pix { border-color: rgba(0,189,174,.3); color: #00BDAE; }
.charge-btn-pix:hover { background: #e5f9f7; border-color: #00BDAE; }
.charge-btn-check { border-color: rgba(74,124,89,.3); color: var(--sage); }
.charge-btn-check:hover { background: var(--sage-light); border-color: var(--sage); }

.fin-wpp-preview {
  background: #e5ebe0; border-radius: 12px; padding: 14px 16px;
  font-size: 13px; color: #303030; line-height: 1.7;
  border-left: 3px solid #25D366; max-width: 420px;
  position: relative;
}
.fin-wpp-preview::before { content: '💬'; position: absolute; top: -10px; left: -10px; font-size: 18px; }

.fin-receipt-card {
  background: var(--white); border: 1px dashed var(--border); border-radius: 10px;
  padding: 20px; max-width: 380px; position: relative;
}
.fin-receipt-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px;
  background: var(--sage); border-radius: 10px 10px 0 0;
}
.fin-receipt-header { font-family: 'Instrument Serif', serif; font-size: 16px; margin-bottom: 12px; }
.fin-receipt-row { display: flex; justify-content: space-between; font-size: 13px; padding: 4px 0; }
.fin-receipt-row-label { color: var(--muted); }
.fin-receipt-row-value { font-weight: 500; }
.fin-receipt-divider { border-top: 1px dashed var(--border); margin: 8px 0; }
.fin-receipt-total { font-size: 15px; font-weight: 600; }

.fin-overdue-item {
  display: flex; align-items: center; gap: 12px; padding: 12px;
  border-radius: 8px; border: 1px solid var(--border); margin-bottom: 8px;
  transition: all .15s;
}
.fin-overdue-item:hover { border-color: var(--amber); }
.fin-overdue-days {
  font-family: 'Instrument Serif', serif; font-size: 22px;
  color: var(--red); min-width: 50px; text-align: center;
}
.fin-overdue-escalation {
  display: flex; gap: 4px; margin-top: 4px;
}
.fin-escalation-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--border);
}
.fin-escalation-dot.sent { background: var(--amber); }
.fin-escalation-dot.alert { background: var(--red); }

.fin-tab-bar { display: flex; border-bottom: 1px solid var(--border); margin-bottom: 20px; }
.fin-tab {
  padding: 10px 18px; font-size: 13.5px; font-weight: 500;
  color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent;
  margin-bottom: -1px; transition: all .15s; border: none; background: none;
  font-family: inherit;
}
.fin-tab:hover { color: var(--ink); }
.fin-tab.active { color: var(--sage); border-bottom-color: var(--sage); font-weight: 600; }

/* ── SUPERVISÃO IA ── */
.sup-hero {
  background: linear-gradient(135deg, var(--sage-light) 0%, #ffffff 70%);
  border: 1px solid rgba(74,124,89,.15);
  border-radius: 20px; padding: 28px 32px; margin-bottom: 24px;
  display: flex; align-items: center; gap: 24px; position: relative; overflow: hidden;
}
.sup-hero::before {
  content: ''; position: absolute; right: -80px; top: -80px;
  width: 300px; height: 300px; border-radius: 50%;
  background: radial-gradient(circle, rgba(74,124,89,.08) 0%, transparent 65%);
  pointer-events: none;
}
.sup-hero::after { display: none; }
.sup-hero-icon {
  width: 64px; height: 64px; border-radius: 16px;
  background: rgba(74,124,89,.1); display: flex; align-items: center;
  justify-content: center; font-size: 28px; flex-shrink: 0;
  border: 1px solid rgba(74,124,89,.2);
}
.sup-hero-title { font-family: 'Instrument Serif', serif; font-size: 24px; color: var(--ink); }
.sup-hero-sub { font-size: 13px; color: var(--muted); margin-top: 4px; line-height: 1.5; max-width: 480px; }
.sup-hero-right { margin-left: auto; text-align: right; flex-shrink: 0; }
.sup-streak { font-family: 'Instrument Serif', serif; font-size: 38px; color: var(--sage); line-height: 1; }
.sup-streak-lbl { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .8px; margin-top: 2px; }

/* Onboarding toggle */
.sup-onboarding {
  background: var(--purple-light); border: 1px solid rgba(90,62,138,.2);
  border-radius: 16px; padding: 28px 32px; margin-bottom: 24px;
  display: flex; gap: 24px; align-items: flex-start;
}
.sup-onboarding-icon { font-size: 36px; flex-shrink: 0; margin-top: 4px; }
.sup-onboarding-title { font-family: 'Instrument Serif', serif; font-size: 20px; color: var(--ink); margin-bottom: 8px; }
.sup-onboarding-text { font-size: 14px; color: var(--ink-soft); line-height: 1.7; }
.sup-feature-list { display: flex; flex-direction: column; gap: 8px; margin: 16px 0; }
.sup-feature-item { display: flex; align-items: flex-start; gap: 10px; font-size: 13.5px; color: var(--ink-soft); line-height: 1.5; }
.sup-feature-check { width: 20px; height: 20px; border-radius: 50%; background: var(--purple); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 10px; flex-shrink: 0; margin-top: 2px; }
.sup-privacy-note { font-size: 12px; color: var(--muted); display: flex; gap: 6px; align-items: flex-start; margin-top: 12px; padding: 10px 12px; background: rgba(0,0,0,.03); border-radius: 8px; }

/* Toggle switch */
.toggle-wrap { display: flex; align-items: center; gap: 12px; margin-top: 20px; }
.toggle { position: relative; width: 48px; height: 26px; flex-shrink: 0; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; cursor: pointer; inset: 0; background: #cdd4ce;
  border-radius: 26px; transition: .3s;
}
.toggle-slider::before {
  content: ''; position: absolute; height: 20px; width: 20px;
  left: 3px; bottom: 3px; background: white; border-radius: 50%; transition: .3s;
}
.toggle input:checked + .toggle-slider { background: var(--purple); }
.toggle input:checked + .toggle-slider::before { transform: translateX(22px); }
.toggle-label { font-size: 14px; font-weight: 500; color: var(--ink); }
.toggle-sub { font-size: 12px; color: var(--muted); }

/* Alert cards */
.sup-alert-card {
  border-radius: 12px; padding: 16px 18px; margin-bottom: 12px;
  border-left: 3px solid transparent; display: flex; gap: 14px; align-items: flex-start;
}
.sup-alert-card.risk { background: var(--red-light); border-color: var(--red); }
.sup-alert-card.pattern { background: var(--purple-light); border-color: var(--purple); }
.sup-alert-card.reflection { background: var(--amber-light); border-color: var(--amber); }
.sup-alert-card.note { background: var(--blue-light); border-color: var(--blue); }
.sup-alert-card.positive { background: var(--sage-light); border-color: var(--sage); }
.sup-alert-icon { font-size: 20px; flex-shrink: 0; margin-top: 1px; }
.sup-alert-type { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .8px; margin-bottom: 4px; opacity: .7; }
.sup-alert-card.risk .sup-alert-type { color: var(--red); }
.sup-alert-card.pattern .sup-alert-type { color: var(--purple); }
.sup-alert-card.reflection .sup-alert-type { color: var(--amber); }
.sup-alert-card.note .sup-alert-type { color: var(--blue); }
.sup-alert-card.positive .sup-alert-type { color: var(--sage); }
.sup-alert-title { font-size: 14px; font-weight: 600; color: var(--ink); margin-bottom: 4px; }
.sup-alert-text { font-size: 13.5px; color: var(--ink-soft); line-height: 1.6; }
.sup-alert-patient { font-size: 12px; color: var(--muted); margin-top: 6px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.sup-alert-patient span { background: rgba(0,0,0,.06); padding: 2px 8px; border-radius: 10px; }
.sup-alert-actions { display: flex; gap: 6px; margin-top: 10px; }

/* Reflection modal */
.sup-reflection-modal {
  background: var(--white); border-radius: 16px; padding: 28px 32px;
  max-width: 560px; width: 100%; box-shadow: var(--shadow-lg);
  position: relative;
}
.sup-reflection-q { font-size: 16px; color: var(--ink); line-height: 1.6; margin-bottom: 16px; font-weight: 500; }
.sup-reflection-q em { color: var(--purple); font-style: normal; }
.sup-reflection-area {
  width: 100%; border: 1px solid var(--border); border-radius: 10px;
  padding: 14px; font-size: 14px; font-family: inherit; outline: none;
  min-height: 100px; resize: none; line-height: 1.7; transition: border-color .15s;
}
.sup-reflection-area:focus { border-color: var(--purple); box-shadow: 0 0 0 3px rgba(90,62,138,.1); }

/* Week metric cards */
.sup-metric-card {
  background: var(--white); border: 1px solid var(--border);
  border-radius: 12px; padding: 18px 20px; display: flex; flex-direction: column; gap: 4px;
}
.sup-metric-label { font-size: 11.5px; color: var(--muted); font-weight: 500; text-transform: uppercase; letter-spacing: .5px; }
.sup-metric-value { font-family: 'Instrument Serif', serif; font-size: 30px; color: var(--ink); }
.sup-metric-delta { font-size: 12px; }
.sup-metric-delta.up { color: var(--sage); }
.sup-metric-delta.warn { color: var(--amber); }
.sup-metric-delta.down { color: var(--red); }

/* Tabs */
.sup-tab-bar { display: flex; border-bottom: 1px solid var(--border); margin-bottom: 24px; gap: 4px; }
.sup-tab {
  padding: 10px 18px; font-size: 13.5px; font-weight: 500;
  color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent;
  margin-bottom: -1px; transition: all .15s; background: none;
  border-top: none; border-left: none; border-right: none; font-family: inherit;
}
.sup-tab:hover { color: var(--ink); }
.sup-tab.active { color: var(--purple); border-bottom-color: var(--purple); font-weight: 600; }

/* Theme heatmap */
.sup-theme-row { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.sup-theme-name { font-size: 13.5px; color: var(--ink-soft); min-width: 160px; }
.sup-theme-bar-wrap { flex: 1; height: 8px; background: var(--border); border-radius: 10px; overflow: hidden; }
.sup-theme-bar { height: 100%; border-radius: 10px; background: var(--purple); transition: width .6s; }
.sup-theme-count { font-size: 12px; color: var(--muted); min-width: 60px; text-align: right; }

/* Loading dots */
.sup-loading { display: flex; flex-direction: column; gap: 16px; align-items: center; padding: 48px 0; }
.sup-loading-dots { display: flex; gap: 8px; }
.sup-loading-dot {
  width: 10px; height: 10px; border-radius: 50%; background: var(--purple);
  animation: sup-bounce 1.2s infinite ease-in-out both;
}
.sup-loading-dot:nth-child(1) { animation-delay: -.32s; }
.sup-loading-dot:nth-child(2) { animation-delay: -.16s; }
@keyframes sup-bounce { 0%,80%,100%{transform:scale(0);opacity:.3} 40%{transform:scale(1);opacity:1} }

.evidence-quote {
  background: var(--purple-light); border-left: 3px solid var(--purple);
  border-radius: 0 8px 8px 0; padding: 10px 14px; margin: 8px 0;
  font-size: 13px; color: var(--ink-soft); line-height: 1.6; cursor: pointer;
  transition: background .15s; position: relative;
}
.evidence-quote:hover { background: #e4dbf5; }
.evidence-quote::before {
  content: '"'; font-size: 28px; color: var(--purple); opacity: .25;
  position: absolute; top: -4px; left: 8px; font-family: 'Instrument Serif', serif;
  line-height: 1;
}
.evidence-quote-text { padding-left: 16px; font-style: italic; }
.evidence-quote-meta { font-size: 11px; color: var(--muted); margin-top: 6px; padding-left: 16px; display: flex; gap: 8px; align-items: center; }
.evidence-quote-meta a { color: var(--purple); cursor: pointer; text-decoration: underline; }
.sup-new-badge {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--purple); color: #fff; font-size: 10px; font-weight: 700;
  padding: 2px 8px; border-radius: 10px; animation: fadeIn .4s ease;
}

/* ── PERFIL ── */
.perfil-hero {
  background: linear-gradient(135deg, var(--sage-light) 0%, #ffffff 70%);
  border: 1px solid rgba(74,124,89,.15);
  border-radius: 20px; padding: 32px 36px;
  display: flex; align-items: center; gap: 24px; margin-bottom: 28px;
  position: relative; overflow: hidden;
}
.perfil-hero::before {
  content: ''; position: absolute; right: -80px; top: -80px;
  width: 280px; height: 280px; border-radius: 50%;
  background: radial-gradient(circle, rgba(74,124,89,.08) 0%, transparent 65%);
  pointer-events: none;
}
.perfil-avatar-lg {
  width: 80px; height: 80px; border-radius: 50%; background: var(--sage);
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; font-weight: 700; color: #fff; flex-shrink: 0;
  border: 3px solid rgba(74,124,89,.2);
  box-shadow: 0 4px 20px rgba(74,124,89,.25);
}
.perfil-name { font-family: 'Instrument Serif', serif; font-size: 26px; color: var(--ink); }
.perfil-meta { font-size: 13px; color: var(--muted); margin-top: 4px; display: flex; gap: 16px; flex-wrap: wrap; }
.perfil-crp { display: inline-flex; align-items: center; gap: 6px; background: rgba(74,124,89,.08); border: 1px solid rgba(74,124,89,.18); color: var(--sage); font-size: 12px; font-weight: 500; padding: 4px 12px; border-radius: 20px; margin-top: 10px; }

.perfil-section { margin-bottom: 20px; background: var(--white); border: 1px solid var(--border); border-radius: 14px; padding: 24px 28px; }
.perfil-section-title { font-size: 13px; font-weight: 700; color: var(--ink); text-transform: uppercase; letter-spacing: .6px; margin-bottom: 16px; display: flex; align-items: center; gap: 10px; }
.perfil-section-title::after { content: ''; flex: 1; height: 1px; background: var(--border); }

.abordagem-card {
  border: 2px solid var(--border); border-radius: 12px; padding: 16px 18px;
  cursor: pointer; transition: all .2s; position: relative;
}
.abordagem-card:hover { border-color: var(--sage-mid); background: var(--bg); }
.abordagem-card.selected { border-color: var(--sage); background: var(--sage-light); }
.abordagem-card.selected::after {
  content: '✓'; position: absolute; top: 12px; right: 14px;
  width: 22px; height: 22px; border-radius: 50%; background: var(--sage);
  color: #fff; font-size: 11px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.abordagem-name { font-size: 14px; font-weight: 600; color: var(--ink); margin-bottom: 4px; }
.abordagem-desc { font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.abordagem-impact { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 10px; }
.abordagem-impact span { font-size: 11px; background: rgba(0,0,0,.04); color: var(--ink-soft); padding: 2px 8px; border-radius: 10px; }
.abordagem-card.selected .abordagem-impact span { background: rgba(74,124,89,.12); color: var(--sage); }

.perfil-input {
  width: 100%; border: 1px solid var(--border); border-radius: 10px;
  padding: 10px 14px; font-size: 14px; font-family: inherit; outline: none;
  color: var(--ink); transition: border-color .15s;
}
.perfil-input:focus { border-color: var(--sage); box-shadow: 0 0 0 3px rgba(74,124,89,.08); }
.perfil-label { font-size: 12px; font-weight: 600; color: var(--ink-soft); margin-bottom: 6px; display: block; }

.ia-calibration-card {
  background: var(--purple-light); border: 1px solid rgba(90,62,138,.15);
  border-radius: 12px; padding: 16px 18px; display: flex; gap: 14px;
}
.ia-calibration-item { flex: 1; }
.ia-calibration-label { font-size: 11px; font-weight: 700; color: var(--purple); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 6px; }
.ia-calibration-value { font-size: 13px; color: var(--ink-soft); line-height: 1.5; }

/* ── MINHA PRÁTICA ── */
  background: var(--white); border: 1px solid var(--border);
  border-radius: 12px; padding: 20px 24px;
}


.carga-dot {
  width: 14px; height: 14px; border-radius: 50%; flex-shrink: 0;
}
.sparkline-wrap { display: flex; align-items: flex-end; gap: 4px; height: 48px; }
.sparkline-bar {
  flex: 1; border-radius: 3px 3px 0 0;
  transition: height .4s;
}

/* ── TAREFAS ── */
.task-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.task-table th { text-align: left; padding: 10px 14px; color: var(--muted); font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .4px; border-bottom: 1px solid var(--border); user-select: none; background: var(--bg); }
.task-table th.sortable { cursor: pointer; }
.task-table th.sortable:hover { color: var(--ink); }
.task-row { border-bottom: 1px solid var(--border); transition: background .12s; }
.task-row:hover { background: #f4f7f5; }
.task-row.concluida { opacity: .5; }
.task-row td { padding: 13px 14px; vertical-align: middle; }
.task-row .task-num { color: var(--muted); font-size: 12px; min-width: 28px; }
.task-row .task-check { width: 32px; }
.task-row input[type=checkbox] { width: 16px; height: 16px; cursor: pointer; accent-color: var(--sage); }
.task-assunto { font-weight: 500; color: var(--ink); }
.task-assunto.done { text-decoration: line-through; color: var(--muted); font-weight: 400; }
.task-paciente { color: var(--sage); font-size: 13px; }
.task-paciente.none { color: var(--muted); font-style: italic; }
.task-date { font-size: 13px; white-space: nowrap; }
.task-date.overdue { color: var(--red); font-weight: 600; }
.task-date.today { color: var(--amber); font-weight: 600; }
.task-delete { color: var(--muted); background: none; border: none; cursor: pointer; font-size: 14px; padding: 4px 8px; border-radius: 6px; transition: all .15s; }
.task-delete:hover { color: var(--red); background: var(--red-light); }
.tasks-info-bar { font-size: 12px; color: var(--muted); margin-bottom: 16px; padding: 6px 0; border-bottom: 1px solid var(--border); }
.tasks-filter-btn { background: none; border: 1px solid var(--border); border-radius: 20px; padding: 5px 14px; font-size: 12.5px; font-family: inherit; cursor: pointer; color: var(--ink-soft); display: inline-flex; align-items: center; gap: 6px; transition: all .15s; }
.tasks-filter-btn:hover { border-color: var(--sage); color: var(--sage); }
.tasks-filter-btn.active { background: var(--sage-light); border-color: var(--sage); color: var(--sage); font-weight: 600; }
/* Dashboard task widget */
.dash-task-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.dash-task-row:last-child { border-bottom: none; }
.dash-task-title { flex: 1; font-size: 13.5px; font-weight: 500; }
.dash-task-title.done { text-decoration: line-through; color: var(--muted); font-weight: 400; }
.dash-task-meta { font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.dash-task-meta.overdue { color: var(--red); font-weight: 600; }
.dash-task-meta.today { color: var(--amber); font-weight: 600; }
/* Botões de ação de tarefa */
.task-concluir-btn { display: inline-flex; align-items: center; gap: 5px; padding: 5px 11px; border-radius: 20px; border: 1.5px solid var(--sage); background: var(--sage-light); color: var(--sage); font-size: 12px; font-weight: 600; cursor: pointer; font-family: inherit; transition: all .15s; white-space: nowrap; }
.task-concluir-btn:hover { background: var(--sage); color: #fff; }
.task-reabrir-btn { display: inline-flex; align-items: center; gap: 5px; padding: 5px 11px; border-radius: 20px; border: 1.5px solid var(--border); background: transparent; color: var(--muted); font-size: 12px; font-weight: 500; cursor: pointer; font-family: inherit; transition: all .15s; white-space: nowrap; }
.task-reabrir-btn:hover { border-color: var(--sage); color: var(--sage); }
.task-edit-btn { color: var(--muted); background: none; border: none; cursor: pointer; font-size: 14px; padding: 4px 8px; border-radius: 6px; transition: all .15s; }
.task-edit-btn:hover { color: var(--blue); background: var(--blue-light); }
.dash-concluir-btn { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 20px; border: 1.5px solid var(--sage); background: var(--sage-light); color: var(--sage); font-size: 11.5px; font-weight: 600; cursor: pointer; font-family: inherit; transition: all .15s; white-space: nowrap; flex-shrink: 0; }
.dash-concluir-btn:hover { background: var(--sage); color: #fff; }
/* ── ÁREA DO PACIENTE ── */
#tf-patient-login-layer, #tf-patient-app-layer {
  position: fixed; inset: 0; z-index: 9998;
  background: var(--bg); font-family: 'DM Sans', sans-serif;
  display: none; overflow-y: auto;
}
#tf-patient-login-layer { align-items: center; justify-content: center; flex-direction: column; padding: 24px; }
#tf-patient-login-layer.open { display: flex; }
#tf-patient-app-layer.open { display: block; }

/* Login card */
.pac-login-card { width: 100%; max-width: 400px; }
.pac-login-brand { text-align: center; margin-bottom: 28px; }
.pac-login-logo { font-family: 'Instrument Serif', serif; font-size: 26px; color: var(--ink); letter-spacing: -.02em; }
.pac-login-sub { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .6px; margin-top: 4px; }
.pac-login-box { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 28px 28px 24px; }
.pac-login-title { font-family: 'Instrument Serif', serif; font-size: 20px; font-weight: 400; color: var(--ink); margin-bottom: 4px; }
.pac-login-hint { font-size: 13px; color: var(--muted); margin-bottom: 22px; line-height: 1.5; }

.patient-app-header { background: var(--bg); color: var(--ink); padding: 12px 20px; display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 10; border-bottom: 1px solid var(--border); }
.patient-app-logo { font-family: 'Instrument Serif', serif; font-size: 20px; letter-spacing: -.01em; color: var(--sage); }
.patient-app-name { font-size: 12px; color: var(--muted); margin-top: 1px; }
.patient-app-logout { background: transparent; border: 1px solid var(--border); color: var(--muted); padding: 5px 14px; border-radius: 20px; cursor: pointer; font-size: 13px; font-family: inherit; transition: all .15s; }
.patient-app-logout:hover { background: var(--sage-light); border-color: var(--sage); color: var(--sage); }
.patient-app-body { max-width: 560px; margin: 0 auto; padding: 0 0 80px; display: flex; flex-direction: column; gap: 0; background: var(--bg); }
.patient-section-card { background: var(--white); border-radius: var(--radius); border: 1px solid var(--border); overflow: hidden; box-shadow: var(--shadow); }
.patient-section-header { padding: 16px 20px 14px; border-bottom: 1px solid var(--border); }
.patient-section-title { font-family: 'Instrument Serif', serif; font-size: 17px; font-weight: 400; color: var(--ink); display: flex; align-items: center; gap: 8px; letter-spacing: -.01em; }
.patient-section-body { padding: 18px 20px; }
.patient-banner { background: linear-gradient(135deg, var(--sage-700), var(--sage)); color: #fff; border-radius: var(--radius); padding: 22px 20px; }
.patient-banner-greeting { font-family: 'Instrument Serif', serif; font-size: 26px; margin-bottom: 4px; }
.patient-banner-sub { font-size: 13.5px; opacity: .85; margin-bottom: 14px; }
.patient-next-session { background: rgba(255,255,255,.15); border-radius: 10px; padding: 10px 14px; font-size: 13px; display: flex; align-items: center; gap: 8px; }
.patient-msg-card { background: var(--sage-50); border: 1px solid var(--sage-100); border-radius: 12px; padding: 18px 20px; }
.patient-msg-label { font-size: 11px; font-weight: 700; color: var(--sage); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 8px; }
.patient-msg-text { font-size: 14px; color: var(--ink-soft); line-height: 1.7; font-style: italic; }
/* ── PORTAL PACIENTE — REDESIGN "Sálvia & Linho" (Fase B, 10/07/2026) ── */
.pac-hero{background:linear-gradient(160deg,var(--sage-light),var(--white) 72%);border:1px solid var(--border);border-radius:var(--radius-lg);padding:18px;position:relative;overflow:hidden}
.pac-hero .pac-hero-k{font-size:12px;color:var(--sage-dark);font-weight:600;letter-spacing:.02em}
.pac-hero .pac-hero-v{font-family:'Instrument Serif',serif;font-size:21px;color:var(--ink);margin-top:3px;line-height:1.25}
.pac-hero .pac-hero-s{font-size:13px;color:var(--muted);margin-top:4px;line-height:1.5}
.pac-hero-actions{display:flex;gap:8px;flex-wrap:wrap;align-items:center;margin-top:14px}
.pac-btn-solid{background:var(--sage);color:#fff;border:none;border-radius:10px;padding:10px 18px;font-size:14px;font-weight:600;cursor:pointer;font-family:inherit;text-decoration:none;display:inline-flex;align-items:center;gap:7px}
.pac-btn-soft{background:var(--white);border:1px solid var(--border);color:var(--sage-dark);border-radius:10px;padding:9px 14px;font-size:13px;font-weight:600;cursor:pointer;font-family:inherit;text-decoration:none;display:inline-flex;align-items:center;gap:6px}
.pac-btn-care{background:var(--red-light);border:1px solid color-mix(in srgb,var(--red) 30%,transparent);color:var(--red);border-radius:10px;padding:9px 14px;font-size:13px;font-weight:600;cursor:pointer;font-family:inherit;display:inline-flex;align-items:center;gap:6px}
.pac-mood-row{display:flex;gap:7px;margin:10px 0 4px}
.pac-mood-btn{flex:1;min-height:64px;border:1px solid var(--border);border-radius:10px;padding:9px 2px 7px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:5px;background:var(--white);cursor:pointer;font-family:inherit;transition:border-color .15s,background .15s}
.pac-mood-btn svg{width:22px;height:22px}
.pac-mood-btn .pac-mood-lbl{font-size:10.5px;color:var(--muted);font-weight:600;line-height:1.15;text-align:center}
.pac-mood-btn.sel{border-color:var(--sage);background:var(--sage-light);box-shadow:0 0 0 1px var(--sage)}
.pac-mood-btn.sel .pac-mood-lbl{color:var(--sage-dark)}
.pac-week-dots{font-size:12.5px;color:var(--muted);line-height:1.5}
.pac-week-dots b{color:var(--sage-dark);letter-spacing:3px;font-weight:400}
.pac-week-dots i{color:var(--border);letter-spacing:3px;font-style:normal}
/* Dark do portal: texto sobre acento (sage clareado no dark) precisa ser escuro */
[data-theme="dark"] .pac-btn-solid, [data-theme="dark"] .chat-bubble-patient { color:#1C1A16; }
[data-theme="dark"] .pac-ex-icon.done svg { stroke:#1C1A16; }
[data-theme="dark"] .pac-bottom-nav { box-shadow:none; }
/* ── PORTAL PACIENTE — COMPONENTES v4 ── */
.breath-ring{width:130px;height:130px;border-radius:50%;background:radial-gradient(circle,rgba(90,138,106,.28),rgba(90,138,106,.05));border:3px solid rgba(90,138,106,.4);display:flex;align-items:center;justify-content:center;margin:0 auto;transition:transform 4s ease-in-out,opacity 4s ease-in-out}
.breath-ring.expanding{transform:scale(1.5);opacity:1}
.breath-ring.contracting{transform:scale(.65);opacity:.55}
.breath-inner{width:52px;height:52px;border-radius:50%;background:rgba(90,138,106,.15)}
.streak-week-card{background:#fff;border:1px solid var(--border);border-radius:var(--radius);padding:14px 18px;display:flex;align-items:center;justify-content:space-between}
.streak-week-left{display:flex;align-items:center;gap:6px}
.streak-num{font-size:24px;font-weight:700;color:#c97d2e;line-height:1}
.streak-label{font-size:12px;color:var(--muted)}
.streak-week-dots{display:flex;gap:8px;align-items:flex-end}
.badges-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:10px}
.badge-card{display:flex;flex-direction:column;align-items:center;gap:5px;padding:12px 6px;border-radius:12px;border:1.5px solid var(--border);text-align:center;transition:border-color .2s}
.badge-card.earned{border-color:rgba(90,138,106,.4);background:linear-gradient(135deg,#f0f7f3,#fafff8)}
.badge-card.locked{opacity:.28;filter:grayscale(.9)}
.pac-emergency-overlay{position:fixed;inset:0;background:rgba(10,20,15,.8);z-index:9999;display:flex;align-items:center;justify-content:center;padding:20px;backdrop-filter:blur(6px)}
.pac-emergency-panel{background:var(--white);border-radius:20px;width:100%;max-width:420px;max-height:92vh;overflow-y:auto;padding:28px 22px}
/* ── DIÁRIO ADAPTADO ── */
.diary-label { font-size:11px;font-weight:700;color:var(--muted);text-transform:uppercase;letter-spacing:.5px;display:block;margin-bottom:5px; }
.diary-ta { width:100%;min-height:80px;border:1.5px solid var(--border);border-radius:10px;padding:11px 13px;font-size:13.5px;font-family:inherit;resize:none;outline:none;line-height:1.6;box-sizing:border-box;transition:border-color .15s;background:var(--bg); }
.diary-ta:focus { border-color:var(--sage);background:var(--white); }
.diary-slider { -webkit-appearance:none;width:100%;height:6px;background:linear-gradient(90deg,var(--sage) 50%,#e8f0eb 50%);border-radius:10px;outline:none;cursor:pointer; }
.diary-slider::-webkit-slider-thumb { -webkit-appearance:none;width:18px;height:18px;border-radius:50%;background:var(--sage);cursor:pointer;box-shadow:0 1px 4px rgba(0,0,0,.2); }
.diary-slider::-moz-range-thumb { width:18px;height:18px;border-radius:50%;background:var(--sage);cursor:pointer;border:none;box-shadow:0 1px 4px rgba(0,0,0,.2); }
/* ── STATUS DROPDOWN ── */
.status-dropdown-wrap { position: relative; display: inline-block; }
.status-tag-btn { cursor: pointer; user-select: none; }
.status-tag-btn::after { content: ' ▾'; font-size: 9px; opacity: .7; }
.status-dropdown-menu { position: absolute; top: calc(100% + 6px); right: 0; background: #fff; border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 4px 16px rgba(0,0,0,.12); z-index: 100; min-width: 160px; padding: 6px; display: none; }
.status-dropdown-menu.open { display: block; }
.status-dropdown-item { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 7px; cursor: pointer; font-size: 13px; transition: background .12s; }
.status-dropdown-item:hover { background: var(--bg); }
.status-dropdown-item .dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.status-dropdown-item .desc { font-size: 11px; color: var(--muted); display: block; }
/* ── MATERIAIS ── */
.material-card { display:flex; align-items:flex-start; gap:12px; padding:12px 14px; border-radius:10px; border:1px solid var(--border); background:#fff; transition:box-shadow .15s; }
.material-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,.07); }
.material-icon { width:36px; height:36px; border-radius:8px; display:flex; align-items:center; justify-content:center; font-size:16px; flex-shrink:0; }
.material-icon.link { background:var(--blue-light); }
.material-icon.artigo { background:var(--sage-light); }
.material-icon.video { background:#fdf0ef; }
.material-icon.texto { background:var(--amber-light); }
.material-icon.exercicio { background:var(--purple-light); }
.material-title { font-size:13.5px; font-weight:500; color:var(--ink); }
.material-title a { color:var(--blue); text-decoration:none; }
.material-title a:hover { text-decoration:underline; }
.material-desc { font-size:12.5px; color:var(--muted); margin-top:3px; line-height:1.5; }
.material-date { font-size:11px; color:var(--muted); margin-top:4px; }
.material-actions { margin-left:auto; display:flex; gap:4px; flex-shrink:0; }
/* Edição inline */
.task-inline-trigger { cursor: pointer; border-radius: 5px; padding: 2px 4px; transition: background .12s; display: inline-flex; align-items: center; gap: 5px; }
.task-inline-trigger:hover { background: var(--sage-light); }
.task-inline-icon { font-size: 11px; color: var(--muted); opacity: 0; transition: opacity .12s; }
.task-inline-trigger:hover .task-inline-icon { opacity: 1; }
.task-inline-input { border: 1.5px solid var(--sage); border-radius: 6px; padding: 4px 8px; font-size: 13.5px; font-family: inherit; outline: none; background: #fff; color: var(--ink); }
.task-inline-input[type=date] { font-size: 13px; }

/* ═══════════════════════════════════
   POLISH — Design system refinements
═══════════════════════════════════ */

/* Card section titles → Instrument Serif to match mockup card-title style */
.card > .section-header > .section-title,
.card > div > .section-header > .section-title {
  font-family: 'Instrument Serif', serif;
  font-size: 22px;
  letter-spacing: -.01em;
  font-weight: 400;
  line-height: 1;
}

/* Insight items — 3-type color differentiation via nth-child */
#dash-insights-list .insight-item { margin-bottom: 0; }
#dash-insights-list .insight-item:nth-child(3n+1) {
  background: var(--blue-light);
  border-left-color: var(--blue);
  color: var(--ink-soft);
}
#dash-insights-list .insight-item:nth-child(3n+2) {
  background: var(--amber-light);
  border-left-color: var(--amber);
  color: var(--ink-soft);
}
#dash-insights-list .insight-item:nth-child(3n) {
  background: var(--sage-50);
  border-left-color: var(--sage);
  color: var(--ink-soft);
}

/* Stat cards — icon box styling to match design */
.stat-icon {
  background: var(--sage-50);
  color: var(--sage-800);
  border-radius: 7px;
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
  position: absolute; top: 18px; right: 18px;
  border: none;
}

/* Appointment blocks — sharper left-accent border */
.appt-block {
  border-left-width: 3px;
  border-left-style: solid;
  box-shadow: none;
}
.appt-green  { background: var(--sage-50);   color: var(--sage-800);  border-left-color: var(--sage); }
.appt-blue   { background: var(--blue-light); color: var(--blue);      border-left-color: var(--blue); }
.appt-amber  { background: var(--amber-light);color: var(--amber);     border-left-color: var(--amber); }
.appt-purple { background: var(--purple-light);color: var(--purple);   border-left-color: var(--purple); }

/* Tag pills — match design tag size/weight */
.tag { font-size: 10.5px; font-weight: 500; padding: 2px 8px; border-radius: 5px; letter-spacing: .02em; }

/* Search bar — match design search-box style */
.search-bar {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 12px;
  gap: 8px;
  color: var(--muted);
}
.search-bar input { font-size: 13px; }
.search-bar input::placeholder { color: var(--muted-2); }

/* Tabs within cards — pill style */
.tabs { border: none; margin-bottom: 0; }
.tab { font-size: 13px; padding: 8px 16px; }

/* Page subtitle in topbar */
.page-subtitle {
  font-size: 13px;
  color: var(--muted);
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* List items (patient, note list) — subtle hover */
.list-item:hover { background: #fbfaf4; }
.list-item.active {
  background: var(--sage-50);
  border-left: 3px solid var(--sage);
  border-color: var(--sage);
}

/* select elements — match btn style */
select {
  border-radius: 9px;
  font-size: 13px;
  padding: 7px 13px;
  border-color: var(--border);
  background: var(--white);
  color: var(--ink);
  font-family: inherit;
  cursor: pointer;
}
select:hover { border-color: #d8d3c2; }

/* ── Portal do Paciente — Tab Navigation (v4) ── */
.pac-tab-content { padding-bottom: 80px; }

/* Greeting row */
.pac-greeting-row { display:flex; align-items:center; justify-content:space-between; padding:20px 16px 10px; }
.pac-greeting-name { font-family:'Instrument Serif',serif; font-size:22px; color:var(--ink); letter-spacing:-.01em; line-height:1.2; }
.pac-greeting-date { font-size:12px; color:var(--muted); margin-top:2px; }
.pac-streak-pill { display:flex; align-items:center; gap:4px; background:linear-gradient(135deg,#fff8ec,#fffcf4); border:1px solid rgba(201,125,46,.25); border-radius:20px; padding:5px 11px; font-size:12px; font-weight:600; color:#c97d2e; flex-shrink:0; }

/* Session hero */
.pac-session-hero { background:linear-gradient(135deg,var(--sage-700),var(--sage)); color:#fff; border-radius:var(--radius); padding:20px 18px; position:relative; overflow:hidden; }

/* Section title */
.pac-section-title-row { display:flex; align-items:center; justify-content:space-between; margin-bottom:10px; }
.pac-section-title-serif { font-family:'Instrument Serif',serif; font-size:17px; color:var(--ink); letter-spacing:-.01em; }

/* Week card */
.pac-week-card { background:var(--white); border:1px solid var(--border); border-radius:var(--radius); padding:16px 18px; box-shadow:var(--shadow); }

/* Exercise cards v2 */
.pac-ex-card-v2 { background:var(--white); border:1px solid var(--border); border-radius:var(--radius); padding:13px 14px; display:flex; align-items:center; gap:12px; box-shadow:var(--shadow); }
.pac-ex-card-v2.done { border-color:var(--border); background:var(--bg); opacity:.75; box-shadow:none; }
.pac-ex-icon { width:42px; height:42px; border-radius:11px; background:var(--sage-50); border:1px solid var(--sage-100); display:flex; align-items:center; justify-content:center; flex-shrink:0; transition:background .15s; }
.pac-ex-icon.done { background:var(--sage); border-color:var(--sage-700); }
.pac-ex-time { font-size:11px; color:var(--muted); margin-top:3px; display:flex; align-items:center; gap:4px; }
.pac-ex-btn { background:var(--sage); border:none; color:#fff; border-radius:9px; padding:6px 12px; font-size:12px; font-weight:600; cursor:pointer; font-family:inherit; white-space:nowrap; flex-shrink:0; transition:background .15s; }
.pac-ex-btn:hover { background:var(--sage-700); }
.pac-ex-btn.done { background:var(--sage-50); border:1px solid var(--sage-100); color:var(--sage); cursor:default; }

/* Bottom navigation */
.pac-bottom-nav { position:sticky; bottom:0; left:0; right:0; background:var(--white); border-top:1px solid var(--border); display:flex; z-index:20; box-shadow:0 -1px 8px rgba(20,30,25,.06); }
.pac-nav-btn { flex:1; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:3px; padding:10px 4px 12px; border:none; background:transparent; color:var(--muted); font-size:10px; cursor:pointer; font-family:inherit; transition:color .15s; line-height:1; }
.pac-nav-btn.active { color:var(--sage); }
.pac-nav-btn.active svg { stroke:var(--sage); }
.pac-nav-icon { display:flex; align-items:center; justify-content:center; }

/* Centralização no desktop */
#pac-app-body { max-width: 560px; margin: 0 auto; }

/* Abas do diário (Registro livre / aba esp / Humor) */
.pac-diary-sub-tab { padding: 10px 6px; font-size: 13px; white-space: nowrap; }
@media (max-width: 420px) { .pac-diary-sub-tab { font-size: 11px; padding: 9px 4px; } }
/* Redesign: prompts do diário do PACIENTE em serifa editorial (tom de caderno,
   não de formulário) — só no portal; a prévia do terapeuta mantém labels de UI. */
#pac-tab-diary .diary-label { font-family:'Instrument Serif',serif; font-size:15.5px; text-transform:none; letter-spacing:0; color:var(--ink); font-weight:400; margin-bottom:7px; }
#pac-tab-diary .diary-ta { font-size:14px; background:var(--bg); border-width:1px; }

/* Emoji do check-in */
.pac-mood-em { font-size: 24px; line-height: 1; display: inline-block; transition: transform .2s; }

/* ── Ícones de exercício MONOCROMÁTICOS (redesign: fim da sub-paleta pastel
   multicolorida — a hierarquia vem do conteúdo, não de 5 cores gritando). ── */
.pac-ex-icon { background:var(--sage-light) !important; border-color:var(--border) !important; }
.pac-ex-icon svg.pac-ex-tagicon { stroke:var(--sage-dark); }
.pac-ex-icon.done { background:var(--sage) !important; border-color:var(--sage) !important; }

/* ── Barra de jornada (Sua jornada) ── */
.pac-week-card { background:var(--white); border:1px solid var(--border); border-radius:var(--radius); padding:16px 18px; box-shadow:var(--shadow); }

/* ── Chat assíncrono ── */
.chat-thread { display:flex; flex-direction:column; gap:8px; max-height:220px; overflow-y:auto; padding:4px 0; scroll-behavior:smooth; }
.chat-bubble { max-width:82%; padding:9px 13px; border-radius:14px; font-size:13px; line-height:1.5; word-break:break-word; }
.chat-bubble-therapist { background:var(--sage-light); color:var(--ink); border-bottom-left-radius:4px; align-self:flex-start; }
.chat-bubble-patient   { background:var(--sage); color:#fff; border-bottom-right-radius:4px; align-self:flex-end; }
.chat-ts { font-size:10px; color:var(--muted); }

/* ── Trajetória terapêutica ── */
.traj-entry { background:var(--white); border:1px solid var(--border); border-radius:12px; padding:14px 15px; margin-bottom:10px; box-shadow:0 1px 4px rgba(0,0,0,.04); }
.traj-milestone { border-color:rgba(201,125,46,.4); background:linear-gradient(135deg,#fffbf0 0%,#fff 60%); }
.traj-filter-btn { border:1px solid var(--border); border-radius:20px; padding:5px 13px; font-size:12px; background:none; cursor:pointer; font-family:inherit; color:var(--muted); transition:all .15s; }
.traj-filter-btn.active { background:var(--sage); color:#fff; border-color:var(--sage); }
.traj-filter-btn:hover:not(.active) { background:var(--sage-light); border-color:var(--sage-100); color:var(--sage); }

/* ── Resumo IA + insight do paciente (portal / jornada) ── */
.traj-resumo-ia { background:linear-gradient(135deg,#f0f7f3 0%,#fafafa 100%); border:1px solid rgba(74,124,89,.2); border-radius:10px; padding:11px 13px; margin-bottom:10px; }
.traj-resumo-label { font-size:10.5px; font-weight:700; color:var(--sage); text-transform:uppercase; letter-spacing:.5px; margin-bottom:5px; }
.traj-resumo-text { font-size:13px; color:var(--ink); line-height:1.6; font-style:italic; }
.traj-insight-wrap { margin-top:8px; }
.traj-insight-label { font-size:11px; color:var(--muted); margin-bottom:4px; }
.traj-insight-ta { width:100%; min-height:56px; border:1.5px solid var(--border); border-radius:8px; padding:8px 10px; font-size:12.5px; font-family:'DM Sans',sans-serif; resize:none; outline:none; background:#fafaf8; color:var(--ink); line-height:1.5; box-sizing:border-box; }
.traj-insight-ta:focus { border-color:var(--sage); }
.traj-insight-btn { margin-top:5px; background:var(--sage-light); border:1px solid var(--sage-100); color:var(--sage); border-radius:7px; padding:5px 12px; font-size:11.5px; font-weight:600; cursor:pointer; font-family:inherit; }
.pos-sess-resumo-loading { display:flex; align-items:center; gap:8px; color:var(--muted); font-size:12px; padding:8px 0; }

/* ── KANBAN CAPTAÇÃO ── */
.kanban-board { display:flex; gap:14px; overflow-x:auto; padding-bottom:16px; align-items:flex-start; min-height:360px; }
.kanban-col { flex:0 0 230px; display:flex; flex-direction:column; background:var(--bg); border-radius:12px; border:1px solid var(--border); max-height:calc(100vh - 200px); }
.kanban-col-header { padding:11px 13px 10px; display:flex; align-items:center; gap:7px; font-size:12.5px; font-weight:600; color:var(--ink-soft); background:var(--white); border-radius:12px 12px 0 0; border-bottom:1px solid var(--border); }
.kanban-col-count { margin-left:auto; background:var(--border); color:var(--muted); font-size:11px; font-weight:700; padding:2px 7px; border-radius:10px; min-width:20px; text-align:center; }
.kanban-col-body { flex:1; overflow-y:auto; padding:10px; display:flex; flex-direction:column; gap:8px; min-height:0; }
.kanban-empty { text-align:center; color:var(--muted); font-size:12px; padding:28px 10px; opacity:.65; }
.kanban-card { background:var(--white); border:1px solid var(--border); border-radius:10px; padding:11px 12px; transition:box-shadow .15s, transform .1s; cursor:grab; }
.kanban-card:active { cursor:grabbing; }
.kanban-card:hover { box-shadow:0 4px 16px rgba(74,124,89,.13); transform:translateY(-1px); }
.kanban-col-body.drag-over { background:var(--sage-light); border-radius:0 0 12px 12px; outline:1.5px dashed var(--sage); outline-offset:-4px; }
.kanban-avatar { width:32px; height:32px; border-radius:50%; color:#fff; display:flex; align-items:center; justify-content:center; font-size:11px; font-weight:700; flex-shrink:0; }
.kanban-card-name { font-size:13.5px; font-weight:600; color:var(--ink); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.kanban-card-queixa { font-size:12px; color:var(--muted); line-height:1.45; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; margin-bottom:8px; }
.kanban-card-actions { display:flex; gap:4px; align-items:center; flex-wrap:wrap; margin-top:6px; }
.kanban-btn { padding:3px 7px; font-size:11px; border:1px solid var(--border); border-radius:6px; background:var(--bg); color:var(--ink-soft); cursor:pointer; font-family:inherit; transition:background .12s,color .12s,border-color .12s; white-space:nowrap; }
.kanban-btn:hover { background:var(--sage-light); color:var(--sage); border-color:rgba(74,124,89,.3); }
.kanban-btn-convert { background:var(--sage-light); color:var(--sage); border-color:rgba(74,124,89,.3); font-weight:600; }
.kanban-btn-convert:hover { background:var(--sage); color:#fff; }
.kanban-btn-danger:hover { background:#fef2f2; color:var(--red); border-color:rgba(192,57,43,.3); }

