/* spa.css — Sistema Virtualize */

/* ============================================================
   Tokens
   ============================================================ */
:root {
  /* Accent — Secretária */
  --navy:           #1B2B4B;
  --navy-light:     rgba(27,43,75,0.08);
  --navy-hover:     rgba(27,43,75,0.12);

  /* Accent — Médico */
  --teal:           #1A3A2A;
  --teal-light:     rgba(26,58,42,0.08);
  --teal-hover:     rgba(26,58,42,0.12);

  /* Superfícies */
  --bg:             #FAFAFC;
  --bg-card:        #FFFFFF;
  --shell-fill:     rgba(245,247,250,0.62);
  --shell-fill-strong: rgba(249,250,252,0.76);
  --shell-line:     rgba(98,108,132,0.09);
  --shell-ink:      #4C4F69;
  --shell-muted:    #6E7590;
  --shell-faint:    #9AA0B7;
  --card-line:      rgba(27,43,75,0.06);

  /* Glass — camada de controles apenas */
  --glass-sidebar:  rgba(244,247,252,0.72);
  --glass-topbar:   rgba(245,247,250,0.78);
  --glass-modal:    rgba(255,255,255,0.88);
  --glass-login:    rgba(255,255,255,0.10);
  --sidebar-glass-top:    rgba(239,243,249,0.84);
  --sidebar-glass-bottom: rgba(229,234,243,0.74);
  --sidebar-glass-core:   rgba(222,228,239,0.34);
  --sidebar-item-hover:   rgba(209,217,231,0.64);
  --sidebar-item-active:  rgba(191,201,219,0.82);
  --sidebar-item-border:  rgba(111,124,151,0.18);
  --blur-sm:        blur(12px);
  --blur-md:        blur(20px);
  --blur-lg:        blur(40px);

  /* Texto */
  --text:           #111827;
  --text-ink:       #2F3140;
  --text-cool:      #7F8193;
  --text-muted:     #6B7280;
  --text-xmuted:    #9CA3AF;

  /* Tints suaves */
  --surface-tint:         rgba(114,128,186,0.05);
  --surface-tint-hover:   rgba(118,132,192,0.08);
  --surface-tint-border:  rgba(124,133,170,0.10);
  --chrome-soft:          rgba(246,247,250,0.58);
  --chrome-soft-hover:    rgba(242,244,248,0.72);
  --chrome-soft-active:   rgba(236,239,244,0.82);
  --chrome-soft-border:   rgba(132,144,169,0.09);
  --patient-status-lead:        #7E6AB7;
  --patient-status-lead-bg:     rgba(126,106,183,0.12);
  --patient-status-lead-border: rgba(126,106,183,0.18);
  --patient-status-active:        #5B8471;
  --patient-status-active-bg:     rgba(91,132,113,0.12);
  --patient-status-active-border: rgba(91,132,113,0.18);
  --patient-status-inactive:        #8A90A3;
  --patient-status-inactive-bg:     rgba(138,144,163,0.12);
  --patient-status-inactive-border: rgba(138,144,163,0.16);

  /* Bordas */
  --border:         rgba(0,0,0,0.08);      /* 0.5px — cards, modais */
  --border-solid:   #E5E7EB;               /* 1px — tabelas, separadores, inputs */
  --border-soft:    rgba(0,0,0,0.05);
  --border-glass:   rgba(255,255,255,0.60);

  /* Inputs */
  --bg-input:       rgba(0,0,0,0.03);

  /* Sombras */
  --shadow-sm:  0 1px 2px rgba(0,0,0,0.05);
  --shadow-md:  0 0 0 0.5px rgba(0,0,0,0.05), 0 2px 8px rgba(0,0,0,0.04), 0 8px 24px rgba(0,0,0,0.06);
  --shadow-lg:  0 8px 40px rgba(0,0,0,0.18), 0 2px 8px rgba(0,0,0,0.10);
  --shadow-shell: 0 1px 2px rgba(21,32,54,0.03), 0 10px 24px rgba(21,32,54,0.05);
  --shadow-card-soft: 0 1px 2px rgba(21,32,54,0.04), 0 12px 32px rgba(21,32,54,0.06);
  --shadow-card-hover: 0 1px 2px rgba(21,32,54,0.04), 0 16px 34px rgba(21,32,54,0.09);

  /* Tipografia */
  --font:           -apple-system, "SF Pro Text", BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-display:   -apple-system, "SF Pro Display", BlinkMacSystemFont, "Segoe UI", sans-serif;
  --size-xs:        11px;
  --size-sm:        13px;
  --size-base:      15px;
  --size-md:        17px;
  --size-lg:        20px;
  --size-xl:        22px;
  --size-2xl:       28px;
  --weight-regular:  400;
  --weight-medium:   500;
  --weight-semibold: 600;
  --weight-bold:     700;

  /* Espaçamento */
  --space-1:  4px;
  --space-2:  8px;
  --space-3:  12px;
  --space-4:  16px;
  --space-5:  20px;
  --space-6:  24px;
  --space-8:  32px;
  --space-10: 40px;

  /* Radius */
  --radius-sm:   6px;
  --radius-md:   10px;
  --radius-lg:   16px;
  --radius-xl:   20px;
  --radius-pill: 999px;

  /* Status */
  --s-agendada:      #3B82F6;
  --s-agendada-bg:   rgba(59,130,246,0.10);
  --s-confirmada:    #10B981;
  --s-confirmada-bg: rgba(16,185,129,0.10);
  --s-atendida:      #8B5CF6;
  --s-atendida-bg:   rgba(139,92,246,0.10);
  --s-falta:         #F59E0B;
  --s-falta-bg:      rgba(245,158,11,0.10);
  --s-cancelada:     #EF4444;
  --s-cancelada-bg:  rgba(239,68,68,0.10);
  --s-pendente:      #F59E0B;
  --s-pendente-bg:   rgba(245,158,11,0.10);
  --s-paga:          #10B981;
  --s-paga-bg:       rgba(16,185,129,0.10);
  --s-vencida:       #EF4444;
  --s-vencida-bg:    rgba(239,68,68,0.10);

  /* Layout */
  --sidebar-w:       220px;
  --sidebar-w-mini:  64px;
  --topbar-h:        56px;
}

/* ============================================================
   Reset & base
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font);
  font-size: var(--size-base);
  font-weight: var(--weight-regular);
  color: var(--text);
  background: #FAFAFC;
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
}

a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: inherit; }
input, select, textarea { font-family: inherit; font-size: inherit; }
img { max-width: 100%; }
ul, ol { list-style: none; }

/* Reduce motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ============================================================
   Utilitários
   ============================================================ */
.hidden  { display: none !important; }
.text-muted  { color: var(--text-muted); font-size: var(--size-sm); }
.text-xmuted { color: var(--text-xmuted); font-size: var(--size-xs); }

/* ============================================================
   Tela de Login
   ============================================================ */
.login-screen {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(ellipse at 20% 20%, rgba(180,170,220,0.30) 0%, transparent 55%),
    radial-gradient(ellipse at 80% 80%, rgba(160,165,215,0.24) 0%, transparent 55%),
    #F2F3F7;
  padding: var(--space-4);
}

.login-card {
  width: 100%;
  max-width: 380px;
  background: rgba(235,236,242,0.55);
  backdrop-filter: blur(40px) saturate(1.6);
  -webkit-backdrop-filter: blur(40px) saturate(1.6);
  border: 1px solid rgba(255,255,255,0.70);
  border-radius: var(--radius-xl);
  padding: var(--space-8) var(--space-6);
  box-shadow: 0 8px 32px rgba(0,0,0,0.08), 0 1px 3px rgba(0,0,0,0.04);
  animation: fadeInDown 280ms ease-out both;
}

.login-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-8);
}

.login-icon {
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 4px 16px rgba(27,42,74,0.25));
}

.login-wordmark {
  font-family: -apple-system, "SF Pro Text", BlinkMacSystemFont, sans-serif;
  font-size: var(--size-md);
  font-weight: var(--weight-medium);
  letter-spacing: 0.02em;
  color: var(--text-muted);
  line-height: 1;
}

.login-welcome {
  font-family: -apple-system, "SF Pro Display", BlinkMacSystemFont, sans-serif;
  font-size: var(--size-2xl);
  font-weight: var(--weight-semibold);
  letter-spacing: -0.02em;
  color: var(--text);
  line-height: 1.1;
  margin-top: var(--space-3);
}

.login-card .field {
  margin-bottom: var(--space-4);
}

.login-card label {
  display: block;
  font-size: var(--size-sm);
  font-weight: var(--weight-medium);
  color: var(--text);
  margin-bottom: var(--space-2);
}

.login-card input {
  width: 100%;
  height: 42px;
  padding: 0 var(--space-3);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text);
  font-size: var(--size-base);
  transition: border-color 150ms, box-shadow 150ms;
}

.login-card input::placeholder { color: var(--text-xmuted); }
.login-card input:focus {
  outline: none;
  border-color: var(--navy);
  box-shadow: 0 0 0 3px var(--navy-light);
}

.input-icon-right { position: relative; }
.input-icon-right input { padding-right: 40px; }
.input-icon-right .btn-icon {
  position: absolute;
  right: var(--space-2);
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}
.input-icon-right .btn-icon:hover { color: var(--text); }

.login-error {
  font-size: var(--size-sm);
  color: #DC2626;
  margin-bottom: var(--space-3);
  padding: var(--space-2) var(--space-3);
  background: rgba(220,38,38,0.06);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(220,38,38,0.15);
}

.btn-full { width: 100%; }

.login-forgot {
  display: block;
  text-align: center;
  margin-top: var(--space-4);
  font-size: var(--size-sm);
  color: var(--text-muted);
  transition: color 150ms;
}
.login-forgot:hover { color: var(--navy); }

/* ============================================================
   App shell
   ============================================================ */
.app {
  display: flex;
  height: 100dvh;
  overflow: hidden;
  background:
    radial-gradient(circle at -2% 0%, rgba(110,146,214,0.11) 0%, transparent 18%),
    radial-gradient(circle at 16% 8%, rgba(174,160,223,0.09) 0%, transparent 15%),
    radial-gradient(circle at 46% -8%, rgba(185,170,229,0.05) 0%, transparent 18%),
    radial-gradient(circle at 100% 0%, rgba(138,170,220,0.08) 0%, transparent 18%),
    radial-gradient(circle at 88% 100%, rgba(170,178,228,0.06) 0%, transparent 22%),
    linear-gradient(180deg, #F7F8FB 0%, #F9FAFC 100%);
}

/* ============================================================
   Sidebar
   ============================================================ */
.sidebar {
  position: fixed;
  left: 0; top: 0; bottom: 0;
  width: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  z-index: 200;
  transition: width 220ms ease, transform 250ms ease;
  overflow: hidden;
  isolation: isolate;
  box-shadow:
    1px 0 0 rgba(121,129,157,0.10),
    18px 0 30px -30px rgba(95,104,140,0.56);
}

.sidebar::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 8% 4%, rgba(110,152,220,0.17) 0%, transparent 18%),
    radial-gradient(circle at 68% 12%, rgba(170,154,228,0.10) 0%, transparent 20%),
    linear-gradient(180deg, var(--sidebar-glass-top) 0%, var(--sidebar-glass-bottom) 100%),
    var(--sidebar-glass-core);
  backdrop-filter: blur(28px) saturate(150%) brightness(0.995);
  -webkit-backdrop-filter: blur(28px) saturate(150%) brightness(0.995);
  border-right: 1px solid rgba(255,255,255,0.38);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.30);
  pointer-events: none;
  z-index: 0;
}

.sidebar::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 1px;
  background: rgba(121,129,157,0.10);
  pointer-events: none;
  z-index: 0;
}

/* Mini sidebar (colapsada) */
.sidebar-collapsed {
  width: var(--sidebar-w-mini);
}

/* Fix: Safari não anima width corretamente em elementos com backdrop-filter — remove o filtro durante a transição */
.sidebar-transitioning {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.sidebar-transitioning::before {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

/* Fix: no Safari, camadas com backdrop-filter podem "engolir" clique de filhos */
.sidebar > * {
  position: relative;
  z-index: 1;
}

.sidebar-collapsed .sidebar-logo-text,
.sidebar-collapsed .sidebar-item span,
.sidebar-collapsed .sidebar-logout-label,
.sidebar-collapsed .sidebar-footer-divider {
  opacity: 0;
  pointer-events: none;
  width: 0;
  overflow: hidden;
  white-space: nowrap;
}

.sidebar-collapsed .sidebar-header {
  justify-content: center;
  padding: 0;
  gap: 0;
}

.sidebar-collapsed .sidebar-nav {
  padding: var(--space-3) 0;
  align-items: stretch;
  gap: var(--space-2);
}

.sidebar-collapsed .sidebar-item {
  justify-content: center;
  padding: 0;
  width: 44px;
  height: 44px;
  margin: 0 auto;
  border-radius: 14px;
  gap: 0;
}

.sidebar-collapsed .sidebar-footer {
  align-items: stretch;
  padding: var(--space-3) 0;
}

.sidebar-collapsed .sidebar-logout {
  justify-content: center;
  padding: 0;
  width: 44px;
  height: 44px;
  margin: 0 auto;
  border-radius: 14px;
  gap: 0;
}

.sidebar-collapsed .sidebar-nav-divider {
  width: 24px;
  margin: var(--space-2) auto;
}

.sidebar-header {
  display: flex;
  align-items: center;
  gap: 8px;
  height: var(--topbar-h);
  padding: 0 14px;
  color: var(--shell-ink);
  border-bottom: 1px solid rgba(124,140,168,0.10);
  flex-shrink: 0;
}

.sidebar-brand-icon {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  display: block;
  color: var(--navy);
}

.sidebar-item svg,
.sidebar-logout-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
}

.sidebar-collapsed .sidebar-brand-icon {
  width: 36px;
  height: 36px;
  flex-basis: 36px;
  transform: none;
}

.sidebar-logo-text {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: var(--weight-semibold);
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--shell-ink);
}

.sidebar-nav {
  flex: 1;
  padding: var(--space-3) var(--space-3);
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  overflow-y: auto;
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 9px var(--space-3);
  border-radius: var(--radius-md);
  color: var(--shell-muted);
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: var(--weight-medium);
  letter-spacing: -0.01em;
  border: 1px solid transparent;
  transition: background 140ms, color 140ms, border-color 140ms, box-shadow 140ms;
}

.sidebar-item:hover {
  background: var(--sidebar-item-hover);
  border-color: rgba(111,124,151,0.08);
  color: var(--shell-ink);
}

.sidebar-item-active {
  background: var(--sidebar-item-active) !important;
  border-color: var(--sidebar-item-border);
  color: var(--shell-ink) !important;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.36),
    0 1px 2px rgba(89,102,130,0.08);
  font-weight: var(--weight-medium);
}

/* Variante médico */
.role-medico .sidebar-item:hover       { background: var(--sidebar-item-hover); border-color: rgba(111,124,151,0.08); color: var(--shell-ink); }
.role-medico .sidebar-item-active      { background: var(--sidebar-item-active) !important; border-color: var(--sidebar-item-border); color: var(--shell-ink) !important; box-shadow: inset 0 1px 0 rgba(255,255,255,0.36), 0 1px 2px rgba(89,102,130,0.08); font-weight: var(--weight-medium); }
.role-medico .sidebar-header           { color: var(--teal); }
.role-medico .sidebar-logo-text        { color: var(--teal); }

.sidebar-footer {
  padding: var(--space-3);
  border-top: 1px solid rgba(124,140,168,0.10);
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.sidebar-footer-divider {
  height: 1px;
  background: rgba(124,140,168,0.10);
  margin-top: var(--space-3);
  margin-bottom: 0;
}

.sidebar-nav-divider {
  height: 1px;
  background: rgba(124,140,168,0.10);
  margin: var(--space-2) var(--space-3);
}

.sidebar-item-config {
  color: var(--shell-muted);
}
.sidebar-item-config:hover { color: var(--shell-ink); }

.sidebar-logout {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 9px var(--space-3);
  border-radius: var(--radius-md);
  color: var(--shell-muted);
  font-size: var(--size-base);
  font-weight: var(--weight-medium);
  background: transparent;
  border: none;
  width: 100%;
  border: 1px solid transparent;
  transition: background 140ms, color 140ms, border-color 140ms;
}
.sidebar-logout:hover { background: var(--sidebar-item-hover); border-color: rgba(111,124,151,0.08); color: var(--shell-ink); }

/* ============================================================
   Main wrapper
   ============================================================ */
.main-wrapper {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  transition: margin-left 220ms ease;
}

.sidebar.sidebar-collapsed ~ .main-wrapper {
  margin-left: var(--sidebar-w-mini);
}

/* ============================================================
   Topbar
   ============================================================ */
.topbar {
  position: sticky;
  top: 0;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-6) 0 var(--space-4);
  z-index: 100;
  flex-shrink: 0;
  gap: var(--space-5);
  isolation: isolate;
}

.topbar::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(248,249,252,0.70) 0%, rgba(244,246,250,0.58) 100%);
  backdrop-filter: blur(22px) saturate(132%);
  -webkit-backdrop-filter: blur(22px) saturate(132%);
  border-bottom: 1px solid var(--shell-line);
  box-shadow: 0 1px 0 rgba(255,255,255,0.60);
  pointer-events: none;
  z-index: 0;
}

.topbar > * {
  position: relative;
  z-index: 1;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  padding-left: 0;
}

.page-title { display: none; }

.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.topbar-datetime {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  height: 32px;
  padding: 0 10px;
  background: var(--shell-fill-strong);
  border: 1px solid var(--shell-line);
  border-radius: var(--radius-pill);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.74);
  font-size: 12px;
  color: var(--shell-muted);
  white-space: nowrap;
}

/* Versão esquerda — sem pill, texto simples ao lado do hamburger */
.topbar-datetime-left {
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
  gap: 10px;
}

.topbar-datetime-icon {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  color: var(--shell-faint);
}

.topbar-date {
  color: var(--shell-muted);
  font-size: 13px;
  font-weight: var(--weight-regular);
  letter-spacing: 0;
}

.topbar-separator {
  width: 4px;
  height: 4px;
  background: #AEB7C7;
  border-radius: 50%;
  flex-shrink: 0;
}

.topbar-clock-wrap {
  display: flex;
  align-items: center;
  gap: 2px;
}

.flip-card {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 16px;
  width: auto;
  height: auto;
  background: transparent;
  border-radius: 0;
  box-shadow: none;
  font-size: 14px;
  font-weight: var(--weight-semibold);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  color: var(--shell-ink);
  line-height: 1;
}

.flip-sep {
  font-size: 14px;
  font-weight: var(--weight-medium);
  color: var(--shell-faint);
  line-height: 1;
  margin: 0;
}

.hamburger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  background: transparent;
  border: none;
  border-radius: 10px;
  color: var(--shell-faint);
  cursor: pointer;
  padding: 0;
  transition: color 140ms ease, background 140ms ease;
}
.hamburger:hover {
  color: var(--shell-ink);
  background: rgba(27,43,75,0.06);
}

/* Filtro de médico — dropdown estilizado com busca inline */
.mf-root {
  position: relative;
  width: 224px;
}
.mf-trigger {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  max-height: 36px;
  overflow: hidden;
  width: 100%;
  padding: 0 9px 0 10px;
  background: var(--chrome-soft);
  border: 1px solid var(--chrome-soft-border);
  border-radius: 12px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.72);
  cursor: pointer;
  transition: border-color 150ms, background 150ms, box-shadow 150ms;
  box-sizing: border-box;
}
.mf-trigger:hover {
  background: var(--chrome-soft-hover);
  border-color: rgba(132,144,169,0.12);
}
.mf-trigger:focus-within {
  background: rgba(245,247,250,0.88);
  border-color: rgba(109,127,170,0.18);
  box-shadow: 0 0 0 3px rgba(122,140,186,0.07), inset 0 1px 0 rgba(255,255,255,0.72);
}
.mf-input {
  flex: 1;
  background: transparent !important;
  border: none !important;
  font-size: 13px;
  color: var(--shell-ink);
  outline: none !important;
  box-shadow: none !important;
  appearance: none;
  -webkit-appearance: none;
  min-width: 0;
  height: 22px;
  padding: 0;
  margin: 0;
  cursor: pointer;
  line-height: 22px;
  display: block;
}
.mf-input:focus {
  cursor: text;
  outline: none !important;
  box-shadow: none !important;
  border-color: transparent !important;
}
.mf-input::placeholder { color: var(--shell-muted); }
.mf-chevron {
  flex-shrink: 0;
  color: var(--shell-faint);
  transition: transform 200ms;
  pointer-events: none;
}
.mf-root.mf-open .mf-chevron { transform: rotate(180deg); }
.mf-list {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: rgba(249,250,252,0.92);
  backdrop-filter: var(--blur-sm);
  -webkit-backdrop-filter: var(--blur-sm);
  border: 1px solid rgba(132,144,169,0.10);
  border-radius: 14px;
  box-shadow: var(--shadow-card-soft);
  z-index: 200;
  max-height: 220px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: var(--space-1) 0;
}
.mf-item {
  padding: var(--space-2) var(--space-3);
  font-size: var(--size-sm);
  cursor: pointer;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  box-sizing: border-box;
}
.mf-item:hover { background: rgba(238,241,246,0.66); }
.mf-item-active { color: var(--navy); font-weight: var(--weight-semibold); }
.mf-empty { padding: var(--space-2) var(--space-3); font-size: var(--size-sm); color: var(--text-muted); }

/* Select ghost — legado */
.select-ghost {
  height: 34px;
  min-width: 172px;
  padding: 0 var(--space-3);
  background: rgba(255,255,255,0.44);
  border: 1px solid rgba(255,255,255,0.62);
  border-radius: 11px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.24);
  font-size: var(--size-sm);
  color: var(--text);
  font-weight: var(--weight-medium);
  cursor: pointer;
  transition: border-color 150ms, background 150ms;
}
.select-ghost:hover { background: rgba(255,255,255,0.54); }
.select-ghost:focus { outline: none; border-color: var(--navy); }

/* ============================================================
   Notificações
   ============================================================ */
.notif-wrap { position: relative; }

.topbar .btn-icon,
.topbar .select-ghost,
.topbar .mf-root,
.notif-wrap,
.sidebar .sidebar-item,
.sidebar .sidebar-logout {
  position: relative;
  z-index: 2;
  pointer-events: auto;
}

.notif-badge {
  position: absolute;
  top: 4px; right: 4px;
  width: 8px; height: 8px;
  background: var(--s-cancelada);
  border-radius: var(--radius-pill);
  border: 2px solid rgba(255,255,255,0.94);
}

.notif-popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 300px;
  background: rgba(255,255,255,0.97);
  border: 1px solid rgba(27,43,75,0.08);
  border-radius: 18px;
  box-shadow: var(--shadow-card-soft);
  z-index: 300;
  overflow: hidden;
  animation: fadeInDown 180ms ease-out both;
}

.notif-wrap .btn-icon {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  background: rgba(255,255,255,0.60);
  border: 1px solid var(--shell-line);
  color: #778397;
}

.notif-wrap .btn-icon:hover {
  background: rgba(255,255,255,0.84);
  border-color: rgba(27,43,75,0.12);
  color: var(--navy);
}

.notif-loading, .notif-empty {
  padding: var(--space-4);
  font-size: var(--size-sm);
  color: var(--text-muted);
  text-align: center;
}

.notif-item {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border);
  transition: background 120ms;
  cursor: pointer;
}
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: var(--bg); }

.notif-content { font-size: var(--size-sm); line-height: 1.45; }
.notif-time    { font-size: var(--size-xs); color: var(--text-xmuted); }

/* ============================================================
   View
   ============================================================ */
.view-header {
  padding: 24px 64px 0;
  flex-shrink: 0;
}

.view-header-greeting {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: var(--weight-semibold);
  color: var(--text-ink);
  letter-spacing: -0.02em;
  margin: 0;
}

.view-header-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: var(--weight-semibold);
  color: var(--text-ink);
  letter-spacing: -0.02em;
  margin: 0;
}

.view {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-6) 64px;
}


.view-content {
  width: 100%;
}

/* ============================================================
   Botões
   ============================================================ */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  height: 36px;
  padding: 0 var(--space-4);
  background: var(--navy);
  color: #FFFFFF;
  border: none;
  border-radius: var(--radius-md);
  font-size: var(--size-sm);
  font-weight: var(--weight-semibold);
  transition: opacity 150ms;
}
.btn-primary:hover   { opacity: 0.90; }
.btn-primary:active  { opacity: 0.82; }
.btn-primary:disabled { opacity: 0.50; cursor: not-allowed; }

.btn-cta {
  height: 40px;
  padding: 0 16px;
  border-radius: 14px;
  box-shadow: 0 8px 18px rgba(27,43,75,0.14);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  height: 36px;
  padding: 0 var(--space-4);
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: var(--size-sm);
  font-weight: var(--weight-medium);
  transition: background 150ms, border-color 150ms;
}
.btn-secondary:hover { background: var(--bg); border-color: var(--text-xmuted); }

.btn-destructive {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  height: 36px;
  padding: 0 var(--space-4);
  background: transparent;
  color: #DC2626;
  border: 1px solid #DC2626;
  border-radius: var(--radius-md);
  font-size: var(--size-sm);
  font-weight: var(--weight-medium);
  transition: background 150ms;
}
.btn-destructive:hover { background: rgba(220,38,38,0.06); }

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  border-radius: var(--radius-md);
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-muted);
  transition: background 140ms, color 140ms;
}
.btn-icon:hover { background: var(--navy-light); color: var(--navy); }

/* ============================================================
   Campos de formulário
   ============================================================ */
.field { display: flex; flex-direction: column; gap: var(--space-1); }

.field label {
  font-size: var(--size-sm);
  font-weight: var(--weight-medium);
  color: var(--text);
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="time"],
select,
textarea {
  height: 38px;
  padding: 0 var(--space-3);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: var(--size-base);
  transition: border-color 150ms, box-shadow 150ms;
  width: 100%;
}

textarea {
  height: auto;
  padding: var(--space-2) var(--space-3);
  resize: vertical;
  min-height: 80px;
  line-height: 1.5;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--navy);
  box-shadow: 0 0 0 3px var(--navy-light);
}

input::placeholder, textarea::placeholder { color: var(--text-xmuted); }

/* ============================================================
   Cards
   ============================================================ */
.card {
  background: var(--bg-card);
  border: 0.5px solid rgba(0,0,0,0.06);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: var(--space-5);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-4);
}

.card-title {
  font-size: var(--size-base);
  font-weight: var(--weight-semibold);
  letter-spacing: -0.01em;
}

.home-card-add-btn {
  width: 24px;
  height: 24px;
  background: transparent;
  border: none;
  color: var(--text-xmuted);
  box-shadow: none;
}

.home-card-add-btn:hover {
  background: transparent;
  color: var(--text-muted);
}

/* ============================================================
   KPIs grid
   ============================================================ */
.kpi-grid {
  display: block;
  margin-bottom: 18px;
}

.kpi-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  padding: 0;
  overflow: hidden;
}

.kpi-strip.card {
  background: #FFFFFF;
  border: 1px solid rgba(27,43,75,0.07);
  border-radius: 16px;
  box-shadow: 0 1px 3px rgba(21,32,54,0.06), 0 8px 24px rgba(21,32,54,0.07);
}

.kpi-strip-item {
  min-width: 0;
  padding: 18px 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.kpi-strip-item + .kpi-strip-item {
  border-left: 1px solid rgba(27,43,75,0.06);
}

.kpi-strip-head {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  margin-bottom: 2px;
}

.kpi-strip-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  color: var(--text-xmuted);
  flex-shrink: 0;
}

.kpi-strip-label {
  min-width: 0;
  font-size: 11px;
  font-weight: var(--weight-medium);
  color: var(--text-cool);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kpi-strip-body {
  display: flex;
  align-items: baseline;
  gap: 7px;
  min-width: 0;
}

.kpi-strip-value {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: var(--weight-semibold);
  letter-spacing: -0.04em;
  line-height: 1;
  color: var(--text-ink);
  white-space: nowrap;
}

.kpi-strip-desc {
  min-width: 0;
  font-size: 12px;
  line-height: 1.35;
  color: var(--text-cool);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding-bottom: 2px;
}

/* ============================================================
   Tabelas
   ============================================================ */
.table-wrap  { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--size-sm);
}

thead th {
  text-align: left;
  padding: var(--space-2) var(--space-3);
  font-size: var(--size-xs);
  font-weight: var(--weight-semibold);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--border-solid);
  white-space: nowrap;
}

tbody tr {
  border-bottom: 1px solid var(--border-solid);
  transition: background 120ms;
}
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: rgba(17,24,39,0.04); }
tbody tr:active { background: rgba(17,24,39,0.07); }

tbody td {
  padding: 11px var(--space-3);
  vertical-align: middle;
}

/* Chevron de linha — visível só no hover */
.row-chevron {
  opacity: 0;
  transition: opacity 150ms;
  color: var(--text-xmuted);
}
tbody tr:hover .row-chevron { opacity: 1; }

/* ============================================================
   Badges de status
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 22px;
  padding: 0 var(--space-2);
  border-radius: var(--radius-pill);
  font-size: var(--size-xs);
  font-weight: var(--weight-semibold);
  white-space: nowrap;
}

.status-badge-sm {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 22px;
  padding: 0 8px;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  font-size: var(--size-xs);
  font-weight: var(--weight-medium);
  line-height: 1;
  white-space: nowrap;
}

.status-badge-sm--interactive {
  cursor: pointer;
  user-select: none;
  transition: filter 140ms;
}

.badge-agendada   { background: var(--s-agendada-bg);   color: var(--s-agendada); }
.badge-confirmada { background: var(--s-confirmada-bg); color: var(--s-confirmada); }
.badge-atendida   { background: var(--s-atendida-bg);   color: var(--s-atendida); }
.badge-falta      { background: var(--s-falta-bg);      color: var(--s-falta); }
.badge-cancelada  { background: var(--s-cancelada-bg);  color: var(--s-cancelada); }
.badge-pendente   { background: var(--s-pendente-bg);   color: var(--s-pendente); }
.badge-paga       { background: var(--s-paga-bg);       color: var(--s-paga); }
.badge-vencida    { background: var(--s-vencida-bg);    color: var(--s-vencida); }

/* ============================================================
   Avatar
   ============================================================ */
.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px; height: 32px;
  border-radius: var(--radius-pill);
  background: var(--navy-light);
  color: var(--navy);
  font-size: var(--size-xs);
  font-weight: var(--weight-semibold);
  flex-shrink: 0;
}

.avatar-lg {
  width: 44px; height: 44px;
  font-size: var(--size-sm);
}

/* ============================================================
   Modais
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.32);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 400;
  padding: var(--space-4);
  opacity: 0;
  transition: opacity 200ms ease-out;
}

.modal-overlay.modal-visible { opacity: 1; }

.modal-overlay.modal-visible .modal {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.modal {
  background: var(--glass-modal);
  backdrop-filter: var(--blur-md);
  -webkit-backdrop-filter: var(--blur-md);
  border: 0.5px solid rgba(0,0,0,0.08);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-height: 90dvh;
  display: flex;
  flex-direction: column;
  transform: translateY(16px) scale(0.97);
  opacity: 0;
  transition: transform 260ms cubic-bezier(0.34,1.56,0.64,1), opacity 200ms ease-out;
}

.modal-hide {
  animation: fadeOut 180ms ease-in both;
}

@keyframes modal-in {
  from { transform: translateY(20px) scale(0.97); opacity: 0; }
  to   { transform: translateY(0) scale(1); opacity: 1; }
}

.modal-sm { max-width: 400px; }
.modal-md { max-width: 560px; }
.modal-lg { max-width: 760px; }

.modal-stack { z-index: 410; }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-5) var(--space-5) 0;
  flex-shrink: 0;
}

.modal-title {
  font-family: var(--font-display);
  font-size: var(--size-lg);
  font-weight: var(--weight-semibold);
  letter-spacing: -0.02em;
}

.modal-body {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-5);
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5) var(--space-5);
  border-top: 1px solid rgba(27,43,75,0.06);
  background: linear-gradient(180deg, rgba(255,255,255,0), rgba(255,255,255,0.36));
  flex-shrink: 0;
}

/* Footer com ação destrutiva à esquerda + botões à direita */
.modal-footer-actions {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  width: 100%;
  gap: var(--space-3);
}

.modal-footer-left {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  min-width: 0;
  color: var(--text-muted);
  font-size: var(--size-xs);
  line-height: 1.45;
}

.modal-footer-right {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-left: auto;
  flex-wrap: wrap;
}

.modal-footer-compact {
  justify-content: flex-end;
}

.modal-footer-primary {
  min-width: 124px;
}

.modal-footer-primary.btn-primary,
.modal-footer-primary.btn-destructive {
  height: 40px;
  padding: 0 16px;
  border-radius: 14px;
}

.modal-footer-dismiss {
  min-width: 100px;
}

.modal-icon-group {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.modal-icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  border: 1px solid rgba(27,43,75,0.10);
  background: rgba(255,255,255,0.72);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.68);
  color: var(--text-cool);
}

.modal-icon-btn:hover {
  background: rgba(255,255,255,0.92);
  border-color: rgba(123,108,168,0.20);
  color: var(--text-ink);
}

.modal-icon-btn-wa {
  color: #059669;
  border-color: rgba(5,150,105,0.14);
  background: rgba(16,185,129,0.10);
}

.modal-icon-btn-wa:hover {
  background: rgba(16,185,129,0.14);
  border-color: rgba(5,150,105,0.18);
  color: #047857;
}

.modal-icon-btn-danger {
  color: var(--s-cancelada);
  border-color: rgba(239,68,68,0.14);
  background: rgba(239,68,68,0.08);
}

.modal-icon-btn-danger:hover {
  background: rgba(239,68,68,0.14);
  border-color: rgba(239,68,68,0.18);
  color: #dc2626;
}

.row-icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  border: 1px solid rgba(123,108,168,0.10);
  background: rgba(255,255,255,0.76);
  color: var(--text-cool);
}

.row-icon-btn:hover {
  background: rgba(124,107,200,0.08);
  border-color: rgba(123,108,168,0.16);
  color: var(--text-ink);
}

.row-icon-btn-wa {
  color: #059669;
}

.row-icon-btn-wa:hover {
  background: rgba(16,185,129,0.12);
  border-color: rgba(5,150,105,0.16);
  color: #047857;
}

.row-icon-btn-danger {
  color: var(--s-cancelada);
}

.row-icon-btn-danger:hover {
  background: rgba(239,68,68,0.10);
  border-color: rgba(239,68,68,0.16);
  color: #dc2626;
}

.action-pop {
  position: absolute;
  top: calc(100% + 4px);
  z-index: 100;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  padding: var(--space-1);
  display: none;
}
.action-pop.ag-pop-open { display: block; }

.action-pop-right {
  right: 0;
}

.action-pop-left {
  left: 0;
}

.action-pop-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 8px var(--space-4);
  border-radius: var(--radius-sm);
  font-size: var(--size-sm);
  cursor: pointer;
  transition: background 100ms, color 100ms;
  color: var(--text);
  width: 100%;
  border: none;
  background: none;
  text-align: left;
  font-family: inherit;
  box-sizing: border-box;
}

.action-pop-item:hover {
  background: var(--navy-light);
}

.action-pop-item-danger {
  color: var(--s-cancelada);
}

.action-pop-item-danger:hover {
  background: var(--s-cancelada-bg);
}

.modal-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

.modal-form .form-section-title {
  margin-bottom: var(--space-2);
  margin-top: var(--space-3);
}
.modal-form .form-section-title:first-child {
  margin-top: 0;
}

.modal-form .field,
.modal-form .form-grid,
.modal-form .form-grid-2,
.modal-form .form-grid-3 {
  gap: var(--space-3);
}

.modal-form .field label {
  color: var(--text-cool);
}

.modal-form textarea {
  min-height: 96px;
}

.modal-confirm-desc {
  color: var(--text-muted);
  font-size: var(--size-base);
  line-height: 1.5;
}

/* ============================================================
   Toasts
   ============================================================ */
.toast-container {
  position: fixed;
  bottom: var(--space-5);
  right: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  z-index: 500;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  background: var(--text);
  color: #FFFFFF;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  font-size: var(--size-sm);
  font-weight: var(--weight-medium);
  max-width: 360px;
  pointer-events: all;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 220ms ease-out, transform 220ms ease-out;
}

.toast-visible { opacity: 1; transform: translateY(0); }
.toast-hide    { opacity: 0; transform: translateY(8px); transition: opacity 180ms ease-in, transform 180ms ease-in; }

.toast-success { background: var(--navy); }
.toast-error   { background: #7F1D1D; }
.toast-warning { background: #78350F; }

.toast-msg  { flex: 1; }
.toast-icon { flex-shrink: 0; }

.toast-close {
  flex-shrink: 0;
  background: transparent;
  border: none;
  color: rgba(255,255,255,0.60);
  padding: 2px;
  display: flex;
  align-items: center;
  transition: color 140ms;
}
.toast-close:hover { color: #FFFFFF; }

.toast-undo-btn {
  flex-shrink: 0;
  background: rgba(255,255,255,0.15);
  border: none;
  color: #FFFFFF;
  font-size: var(--size-sm);
  font-weight: var(--weight-semibold);
  padding: 3px var(--space-2);
  border-radius: var(--radius-sm);
  transition: background 140ms;
}
.toast-undo-btn:hover { background: rgba(255,255,255,0.25); }

/* ============================================================
   Paginação
   ============================================================ */
.pagination {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-4) 0;
  justify-content: center;
}

.page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  padding: 0 var(--space-2);
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  font-size: var(--size-sm);
  font-weight: var(--weight-medium);
  transition: background 140ms, color 140ms, border-color 140ms;
}
.page-btn:hover:not([disabled]) { background: var(--navy-light); color: var(--navy); }
.page-btn-active { background: var(--navy) !important; color: #FFFFFF !important; border-color: var(--navy); }
.page-btn[disabled] { opacity: 0.35; cursor: not-allowed; }
.page-ellipsis { color: var(--text-xmuted); padding: 0 var(--space-1); font-size: var(--size-sm); }

/* ============================================================
   Skeleton loading
   ============================================================ */
.skeleton-wrap { display: flex; flex-direction: column; gap: var(--space-3); padding: var(--space-2); }

.skeleton {
  background: linear-gradient(90deg, var(--border) 25%, rgba(229,231,235,0.5) 50%, var(--border) 75%);
  background-size: 200% 100%;
  border-radius: var(--radius-sm);
  animation: shimmer 1.4s infinite;
}
.skeleton-title { height: 24px; width: 40%; }
.skeleton-row   { height: 40px; width: 100%; }
.skeleton-row.short { width: 70%; }

/* ============================================================
   Spinner
   ============================================================ */
.spinner {
  width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,0.30);
  border-top-color: #FFFFFF;
  border-radius: var(--radius-pill);
  animation: spin 0.7s linear infinite;
}

/* ============================================================
   Estado vazio
   ============================================================ */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  padding: var(--space-10);
  color: var(--text-muted);
  text-align: center;
}

.empty-state p { font-size: var(--size-base); line-height: 1.5; }

/* ============================================================
   Sidebar mobile overlay
   ============================================================ */
.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.32);
  z-index: 190;
  display: none; /* oculto no desktop */
}

/* ============================================================
   Animações
   ============================================================ */
@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

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

@keyframes shimmer {
  from { background-position: 200% 0; }
  to   { background-position: -200% 0; }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ============================================================
   Boards (Home)
   ============================================================ */
.home-boards {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(280px, 0.86fr);
  gap: 18px;
  align-items: start;
}

.board-col {
  background: #FFFFFF;
  border: 1px solid rgba(27,43,75,0.08);
  border-top-width: 2px;
  border-radius: 14px;
  box-shadow: 0 1px 3px rgba(21,32,54,0.06), 0 8px 24px rgba(21,32,54,0.07);
  display: flex;
  flex-direction: column;
  min-height: 0;
  max-height: 548px;
}

.board-col-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px 14px;
  border-bottom: 1px solid rgba(27,43,75,0.06);
  flex-shrink: 0;
}

.board-col-title {
  font-size: 14px;
  font-weight: var(--weight-semibold);
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-ink);
}

.board-col-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 7px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: var(--weight-semibold);
}

.board-col--hoje { border-top-color: #9B8FD4; }
.board-col--hoje .board-col-title { color: var(--text-ink); }
.board-col--hoje .board-col-badge {
  background: rgba(155,143,212,0.12);
  color: #7A69AE;
}

.board-col--urgentes { border-top-color: #D4608A; }
.board-col--urgentes .board-col-title { color: var(--text-ink); }
.board-col--urgentes .board-col-badge {
  background: rgba(194,24,91,0.09);
  color: #B5185A;
}

.board-col--todo { border-top-color: #6B88B8; }
.board-col--todo .board-col-title { color: var(--text-ink); }
.board-col--todo .board-col-badge {
  background: rgba(72,96,140,0.10);
  color: #48608C;
}

.board-col-body {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.board-card {
  background: rgba(255,255,255,0.98);
  border: 1px solid rgba(27,43,75,0.05);
  border-radius: 16px;
  padding: 12px 13px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: box-shadow 150ms, transform 150ms, border-color 150ms;
}

.board-card-clickable {
  cursor: pointer;
}

.board-card-clickable:hover {
  border-color: rgba(27,43,75,0.08);
  box-shadow: var(--shadow-card-hover);
  transform: translateY(-1px);
}

.board-card-accent {
  display: none;
}

.board-card-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.board-card-info {
  flex: 1;
  min-width: 0;
}

.board-card-nome {
  font-size: 13.5px;
  font-weight: var(--weight-semibold);
  color: var(--text-ink);
  letter-spacing: -0.01em;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.board-card-medico {
  font-size: 12px;
  color: #7D889A;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.board-card-chips {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  flex-shrink: 0;
}

.board-todo-text {
  font-size: 13.5px;
  color: var(--text-ink);
  flex: 1;
  line-height: 1.45;
}

.board-card-todo {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.board-card-todo .board-todo-row + .board-todo-row {
  border-top: 1px solid rgba(27,43,75,0.05);
}

.board-card-todo .board-todo-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  padding: 11px 24px;
  border-radius: var(--radius-md);
  transition: background 120ms;
}
.board-card-todo .board-todo-row:hover {
  background: rgba(27,43,75,0.04);
}
.board-card-todo .board-todo-row:hover .board-todo-del {
  opacity: 1;
}

.board-todo-del {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: none;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  color: var(--text-xmuted);
  opacity: 0;
  transition: opacity 120ms, color 120ms, background 120ms;
  margin-left: auto;
}
.board-todo-del:hover {
  color: #DC2626;
  background: rgba(220,38,38,0.08);
}

/* Checkbox */
.board-todo-check {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1.5px solid rgba(27,43,75,0.22);
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  color: transparent;
  transition: border-color 150ms, background 150ms, color 150ms;
}
.board-todo-check:hover {
  border-color: #1A7A4A;
  color: #1A7A4A;
}

/* Concluída — riscado + fade */
.board-card-todo.board-todo-done .board-todo-text {
  text-decoration: line-through;
  color: var(--text-xmuted);
}
.board-card-todo.board-todo-done {
  opacity: 0.45;
  transition: opacity 400ms;
}

.board-col-footer {
  padding: 8px 12px 12px;
  flex-shrink: 0;
}

.board-add-btn {
  width: 100%;
  min-height: 34px;
  background: rgba(255,255,255,0.58);
  border: 1px dashed rgba(27,43,75,0.14);
  border-radius: 12px;
  padding: 8px 10px;
  font-size: 12px;
  color: #718095;
  cursor: pointer;
  transition: border-color 150ms, color 150ms, background 150ms;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.board-add-btn:hover {
  background: rgba(27,43,75,0.04);
  border-color: rgba(27,43,75,0.20);
  color: var(--navy);
}

.board-todo-compose {
  padding: 0 0 6px;
}

.board-todo-compose input {
  width: 100%;
  height: 36px;
  padding: 0 var(--space-3);
  background: rgba(27,43,75,0.04);
  border: 1px solid rgba(27,43,75,0.10);
  border-radius: 12px;
  font-size: 13px;
  color: var(--text-ink);
  box-sizing: border-box;
}

.board-todo-compose input:focus {
  outline: none;
  background: rgba(255,255,255,0.92);
  border-color: rgba(27,43,75,0.18);
  box-shadow: 0 0 0 3px rgba(27,43,75,0.08);
}

.board-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 24px 16px;
  color: #95A0AF;
  font-size: 12px;
  text-align: center;
}

/* ============================================================
   Pacientes
   ============================================================ */
.pac-wrap { width: 100%; }

.pac-toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-6);
  flex-wrap: wrap;
}

.pac-search-wrap {
  position: relative;
  flex: 1 1 460px;
  max-width: 640px;
  min-width: 200px;
}

.pac-search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.pac-search {
  width: 100%;
  height: 42px;
  padding: 0 var(--space-4) 0 38px;
  background: rgba(255,255,255,0.78);
  border: 1px solid var(--surface-tint-border);
  border-radius: 14px;
  font-size: var(--size-sm);
  color: var(--text-ink);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.7);
  transition: border-color 150ms, box-shadow 150ms, background 150ms;
}
.pac-search:focus {
  outline: none;
  background: rgba(255,255,255,0.94);
  border-color: rgba(124,107,200,0.24);
  box-shadow: 0 0 0 3px rgba(124,107,200,0.10);
}

.pac-toolbar-right {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.pac-filters {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  padding: 0 0 var(--space-4);
}
.pac-filter-divider {
  width: 1px;
  height: 16px;
  background: var(--border);
  margin: 0 var(--space-1);
  flex-shrink: 0;
}

.btn-active {
  background: var(--surface-tint-hover) !important;
  color: var(--text-ink) !important;
  border-color: rgba(123,108,168,0.20) !important;
}

.td-muted { color: var(--text-muted); font-size: var(--size-sm); }

.action-row { display: flex; align-items: center; gap: var(--space-1); justify-content: flex-end; }

/* Seção de form no modal */
.form-section-title {
  font-size: var(--size-xs);
  font-weight: var(--weight-semibold);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-3);
  margin-top: var(--space-1);
}

.form-grid   { display: grid; gap: var(--space-3); }
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3); }
.form-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: var(--space-3); }

/* Status toggle */
.field-label {
  font-size: var(--size-sm);
  font-weight: var(--weight-medium);
  color: var(--text);
  margin-bottom: var(--space-2);
}

.status-toggle {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.status-opt {
  min-width: 84px;
  height: 34px;
  padding: 0 14px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--surface-tint-border);
  background: rgba(255,255,255,0.76);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.58);
  color: var(--text-cool);
  font-size: var(--size-sm);
  font-weight: var(--weight-medium);
  cursor: pointer;
  transition: background 150ms, border-color 150ms, color 150ms, box-shadow 150ms;
}
.status-opt:hover {
  border-color: rgba(123,108,168,0.22);
  background: rgba(255,255,255,0.92);
  color: var(--text-ink);
}

.status-opt-active {
  box-shadow: none;
}
.status-opt-lead {
  background: var(--patient-status-lead-bg) !important;
  border-color: var(--patient-status-lead-border) !important;
  color: var(--patient-status-lead) !important;
}
.status-opt-ativo {
  background: var(--patient-status-active-bg) !important;
  border-color: var(--patient-status-active-border) !important;
  color: var(--patient-status-active) !important;
}
.status-opt-inativo {
  background: var(--patient-status-inactive-bg) !important;
  border-color: var(--patient-status-inactive-border) !important;
  color: var(--patient-status-inactive) !important;
}

/* Origem pills */
.origem-pills {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.origem-pill {
  height: 30px;
  padding: 0 var(--space-3);
  border-radius: var(--radius-pill);
  border: 1px solid var(--surface-tint-border);
  background: rgba(255,255,255,0.72);
  color: var(--text-cool);
  font-size: var(--size-xs);
  font-weight: var(--weight-medium);
  cursor: pointer;
  transition: all 150ms;
}
.origem-pill:hover {
  border-color: rgba(123,108,168,0.20);
  background: rgba(255,255,255,0.92);
  color: var(--text-ink);
}
.origem-pill-active {
  background: var(--surface-tint);
  border-color: rgba(123,108,168,0.20);
  color: var(--text-ink);
}

/* Tabela de pacientes */
.pac-table {
  width: 100%;
  border-collapse: collapse;
}
.pac-table thead th {
  padding: 11px 16px;
  font-size: 11px;
  font-weight: var(--weight-medium);
  color: var(--text-muted);
  text-align: left;
  border-bottom: 1px solid rgba(27,43,75,0.07);
  background: rgba(27,43,75,0.015);
  white-space: nowrap;
}
.pac-table tbody td {
  padding: 0 16px;
  height: 46px;
  font-size: 13px;
  color: var(--text-ink);
  border-bottom: 1px solid rgba(27,43,75,0.05);
  vertical-align: middle;
  line-height: 1;
}
.pac-table tbody tr:last-child td { border-bottom: none; }
.pac-table-row {
  cursor: pointer;
  transition: background 100ms;
}
.pac-table-row:hover { background: rgba(27,43,75,0.02); }
.pac-table-row.pac-row-active { background: rgba(27,43,75,0.04); }

.pac-cell-nome-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}
.pac-row-icon { flex-shrink: 0; display: block; }
.pac-avatar-sm {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 10px;
  font-weight: var(--weight-semibold);
  flex-shrink: 0;
  letter-spacing: 0.01em;
}
.pac-nome-text { font-weight: var(--weight-medium); }
.pac-cpf-inline { font-weight: var(--weight-regular); color: var(--text-muted); font-size: 12px; }
.pac-cell-medico { color: var(--text-muted); font-size: 12px; }
.pac-cell-actions {
  white-space: nowrap;
  vertical-align: middle;
}
.pac-actions-wrap {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 2px;
}
.pac-retorno-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: var(--weight-medium);
  color: var(--text-muted);
  background: rgba(27,43,75,0.05);
  border-radius: var(--radius-pill);
  padding: 2px 8px;
}
.pac-retorno-vencido {
  color: #D97706;
  background: rgba(245,158,11,0.10);
}

/* Card de detalhe lateral */
.pac-detail-card {
  position: fixed;
  top: 80px;
  right: 64px;
  width: 360px;
  max-height: calc(100vh - 112px);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  z-index: 120;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  transform: translateX(16px);
  transition: opacity 200ms ease-out, transform 200ms ease-out;
}
.pac-detail-card--open {
  opacity: 1;
  transform: translateX(0);
}
.pac-detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 18px 18px 14px;
  border-bottom: 1px solid rgba(27,43,75,0.07);
  flex-shrink: 0;
}
.pac-detail-header-info { display: flex; align-items: center; gap: 10px; }
.pac-detail-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 13px;
  font-weight: var(--weight-semibold);
  flex-shrink: 0;
}
.pac-detail-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  background: rgba(27,43,75,0.07);
  border: 1px solid rgba(27,43,75,0.11);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--navy);
  flex-shrink: 0;
  transition: background 150ms;
}
.pac-detail-icon:hover {
  background: rgba(27,43,75,0.12);
}
.pac-detail-nome {
  font-size: var(--size-base);
  font-weight: var(--weight-semibold);
  color: var(--text-ink);
  line-height: 1.3;
}
.pac-detail-sub {
  font-size: var(--size-xs);
  color: var(--text-muted);
  margin-top: 2px;
}
.pac-detail-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 18px;
}
.pac-detail-consulta-next {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--size-xs);
  color: var(--text-muted);
  background: rgba(27,43,75,0.04);
  border-radius: var(--radius-md);
  padding: 8px 10px;
  margin-bottom: 14px;
}
.pac-detail-consulta-retorno { color: #1A7A4A; background: rgba(26,122,74,0.07); }
.pac-detail-consulta-vencido { color: #D97706; background: rgba(245,158,11,0.08); }
.pac-detail-section-title {
  font-size: 10px;
  font-weight: var(--weight-semibold);
  color: var(--text-xmuted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 14px 0 8px;
}
.pac-detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0; }
.pac-detail-col { display: flex; flex-direction: column; }
.pac-detail-linha {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 7px 0;
  border-bottom: 1px solid rgba(27,43,75,0.05);
  font-size: 12px;
  color: var(--text-ink);
  line-height: 1.4;
}
.pac-detail-linha small { color: var(--text-muted); font-size: 11px; }
.pac-detail-linha-valor {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(27,43,75,0.05);
  padding: 6px 0;
}
.pac-detail-servico-nome { font-size: 12px; color: var(--text-muted); }
.pac-detail-servico-valor { font-size: 12px; }
.pac-ic { color: var(--text-xmuted); flex-shrink: 0; margin-top: 1px; }
.pac-detail-obs {
  margin-top: 12px;
  font-size: 12px;
  color: var(--text-muted);
  background: rgba(27,43,75,0.03);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  line-height: 1.5;
}
.pac-detail-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 18px;
  border-top: 1px solid rgba(27,43,75,0.07);
  flex-shrink: 0;
}
.pac-detail-loading {
  padding: 32px;
  text-align: center;
  color: var(--text-muted);
  font-size: var(--size-sm);
}

/* ============================================================
   Home — 4 cards 2×2
   ============================================================ */
.home-wrap {
  max-width: 1280px;
  margin: 0 auto;
}

.home-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  padding: 4px 0 24px;
}

/* Card base */
.home-card {
  background: linear-gradient(180deg, rgba(251,252,254,0.98) 0%, #FFFFFF 22%);
  border: 1px solid rgba(27,43,75,0.08);
  border-radius: 16px;
  box-shadow: 0 1px 3px rgba(21,32,54,0.05), 0 12px 30px rgba(21,32,54,0.07);
  display: flex;
  flex-direction: column;
  min-height: 322px;
  overflow: hidden;
  cursor: default;
}

.home-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 24px 18px;
  border-bottom: 1px solid rgba(27,43,75,0.07);
  flex-shrink: 0;
}

.home-card-title {
  font-size: 15px;
  font-weight: var(--weight-semibold);
  color: var(--text-ink);
  letter-spacing: -0.015em;
}

.home-card-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: var(--weight-semibold);
  background: rgba(27,43,75,0.07);
  color: var(--text-cool);
}

.home-card-link {
  font-size: 13px;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 140ms;
}
.home-card-link:hover { color: var(--navy); }

.home-card-body {
  flex: 1;
  overflow-y: auto;
  padding: 0;
}

.home-card-footer {
  padding: 8px 20px 14px;
  flex-shrink: 0;
}

.home-card-loading {
  height: 3px;
  background: linear-gradient(90deg, rgba(27,43,75,0.06) 25%, rgba(27,43,75,0.14) 50%, rgba(27,43,75,0.06) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: 2px;
  margin: 20px;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.home-card-empty {
  padding: 40px 24px;
  font-size: 14px;
  color: var(--text-xmuted);
  text-align: center;
}

/* Card Pendências */
#home-pend-body {
  display: flex;
  flex-direction: column;
}

.home-pend-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 24px;
  flex: 1;
  border-bottom: 1px solid rgba(27,43,75,0.04);
  transition: background 120ms;
  min-height: 54px;
}
.home-pend-row:last-child { border-bottom: none; }
.home-pend-row--active { cursor: pointer; }
.home-pend-row--active:hover { background: rgba(27,43,75,0.025); }

.home-pend-icon { display: flex; align-items: center; color: var(--text-xmuted); flex-shrink: 0; transform: scale(1.05); }
.home-pend-label { flex: 1; font-size: 14px; color: var(--text-ink); letter-spacing: -0.012em; }
.home-pend-count {
  font-size: 14px;
  font-weight: var(--weight-semibold);
  color: var(--text-xmuted);
  min-width: 20px;
  text-align: right;
}
.home-pend-count--has { color: var(--text-ink); }

/* Modal lista por tipo */
.pend-tipo-list { list-style: none; margin: 0; padding: 0; }
.pend-tipo-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 4px;
  border-bottom: 1px solid rgba(27,43,75,0.05);
  cursor: pointer;
  transition: background 100ms;
  border-radius: var(--radius-sm);
}
.pend-tipo-item:last-child { border-bottom: none; }
.pend-tipo-item:hover { background: rgba(27,43,75,0.03); }
.pend-tipo-nome { font-size: 14px; color: var(--text-ink); }

.home-agenda-summary {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 18px 24px 12px;
  border-bottom: 1px solid rgba(27,43,75,0.04);
}

.home-agenda-summary-count {
  font-size: 28px;
  line-height: 1;
  letter-spacing: -0.04em;
  font-weight: var(--weight-semibold);
  color: var(--text-ink);
}

.home-agenda-summary-label {
  font-size: 14px;
  color: var(--text-cool);
  letter-spacing: -0.014em;
}

/* Card Agenda */
.home-agenda-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 24px;
  border-bottom: 1px solid rgba(27,43,75,0.04);
  cursor: pointer;
  transition: background 120ms;
}
.home-agenda-row:last-child { border-bottom: none; }
.home-agenda-row:hover { background: rgba(27,43,75,0.025); }
.home-agenda-hora { font-size: 13px; font-weight: var(--weight-semibold); color: var(--text-cool); min-width: 44px; flex-shrink: 0; }
.home-agenda-nome { font-size: 14px; color: var(--text-ink); flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: -0.012em; }
.home-agenda-medico { font-size: 13px; color: var(--text-muted); white-space: nowrap; flex-shrink: 0; }

/* Card Financeiro */
.home-fin-toggle {
  display: flex;
  background: rgba(27,43,75,0.05);
  border-radius: var(--radius-sm);
  padding: 2px;
  gap: 2px;
}
.home-fin-toggle-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 24px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: background 140ms, color 140ms;
}
.home-fin-toggle-btn--active {
  background: #FFFFFF;
  color: var(--text-ink);
  box-shadow: 0 1px 2px rgba(0,0,0,0.08);
}

#home-fin-body { padding: 16px 24px 20px; }

.home-fin-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.home-fin-stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(244,246,250,0.9);
  border: 1px solid rgba(27,43,75,0.05);
}

.home-fin-stat-label {
  font-size: 12px;
  color: var(--text-cool);
  letter-spacing: -0.01em;
}

.home-fin-stat-value {
  font-size: 15px;
  line-height: 1.2;
  color: var(--text-ink);
  letter-spacing: -0.02em;
}

.home-fin-stat-value--positive { color: #1A7A4A; }

.home-fin-chart-wrap {
  min-height: 184px;
}

.home-fin-table {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.home-fin-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid rgba(27,43,75,0.05);
  font-size: 14px;
  color: var(--text-ink);
}
.home-fin-row:last-child { border-bottom: none; }
.home-fin-row--muted { color: var(--text-muted); }
.home-fin-recebido { color: #1A7A4A; font-weight: var(--weight-semibold); }

/* Card To Do */
.home-todo-body { padding: 4px 0; overflow-y: auto; align-self: flex-start; width: 100%; }

.home-todo-summary {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 18px 24px 12px;
  border-bottom: 1px solid rgba(27,43,75,0.04);
}

.home-todo-summary-count {
  font-size: 28px;
  line-height: 1;
  letter-spacing: -0.04em;
  font-weight: var(--weight-semibold);
  color: var(--text-ink);
}

.home-todo-summary-label {
  font-size: 14px;
  color: var(--text-cool);
  letter-spacing: -0.014em;
}

/* Sidebar badge */
.sidebar-item-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: var(--radius-pill);
  font-size: 10px;
  font-weight: var(--weight-semibold);
  background: rgba(194,24,91,0.12);
  color: #B5185A;
  margin-left: auto;
}
.sidebar-item-badge:empty,
.sidebar-item-badge.hidden { display: none; }

/* Modal pendências (ficha do paciente — mantido) */
.pm-header-inner {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--border);
}

.pm-pac-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: var(--navy-light);
  color: var(--navy);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 150ms;
}
.pm-header-inner:hover .pm-pac-icon { background: var(--navy-hover); }

.pm-header-info { display: flex; flex-direction: column; gap: 4px; }
.pm-header-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

.pm-nome { font-size: var(--size-md); font-weight: var(--weight-semibold); }
.pm-meta { font-size: var(--size-xs); color: var(--text-muted); }
.pm-actions { display: flex; flex-direction: column; gap: 0; }

.pm-action-row {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.pm-action-row:last-child { border-bottom: none; }

.pm-action-icon {
  width: 32px; height: 32px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  background: rgba(17,24,39,0.05);
  color: var(--text-muted);
}
.pm-action-info { flex: 1; min-width: 0; }
.pm-action-label { font-size: var(--size-sm); font-weight: var(--weight-medium); }
.pm-action-desc  { font-size: var(--size-xs); color: var(--text-muted); margin-top: 2px; }
.pm-action-btns  { display: flex; gap: var(--space-2); flex-shrink: 0; flex-wrap: wrap; justify-content: flex-end; max-width: 160px; }

.pm-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; padding: 0;
  border-radius: var(--radius-sm); border: none; cursor: pointer;
  transition: opacity 140ms, transform 140ms;
}
.pm-btn:hover { opacity: 0.88; transform: translateY(-1px); }
.pm-btn-wa      { background: rgba(17,24,39,0.05); color: var(--text-muted); }
.pm-btn-primary { background: rgba(17,24,39,0.05); color: var(--text-muted); }
.pm-btn-muted   { background: rgba(17,24,39,0.05); color: var(--text-muted); }
.pm-btn-wa:hover, .pm-btn-primary:hover, .pm-btn-muted:hover { background: rgba(17,24,39,0.09); color: var(--text); opacity: 1; transform: none; }

.pm-footer-actions {
  display: flex; align-items: center; justify-content: flex-end;
  gap: var(--space-2); width: 100%;
}

/* View Pendências */
.pend-view {
  display: flex;
  flex-direction: column;
  min-height: 0;
  width: 100%;
}

.pend-view .pend-toolbar {
  flex-shrink: 0;
}

.pend-view .pend-table-wrap {
  width: 100%;
}

/* Bulk bar — flutuante na base */
.pend-bulk-bar {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px 8px 14px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  box-shadow: 0 4px 24px rgba(0,0,0,0.10), 0 1px 4px rgba(0,0,0,0.06);
  white-space: nowrap;
}
.pend-bulk-bar.hidden { display: none; }
.pend-bulk-count {
  font-size: var(--size-sm);
  font-weight: var(--weight-medium);
  color: var(--text-muted);
  padding-right: 6px;
  border-right: 1px solid var(--border);
}
.pend-bulk-actions {
  display: flex;
  gap: 4px;
}
.pend-bulk-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: var(--radius-md);
  border: none;
  background: transparent;
  color: var(--text);
  font-size: var(--size-sm);
  font-weight: var(--weight-medium);
  cursor: pointer;
  transition: background 120ms;
}
.pend-bulk-btn:hover { background: var(--navy-light); color: var(--navy); }
.pend-bulk-btn--danger { color: #DC2626; }
.pend-bulk-btn--danger:hover { background: rgba(220,38,38,0.06); color: #DC2626; }
.pend-bulk-clear {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: none;
  background: rgba(0,0,0,0.04);
  color: var(--text-muted);
  cursor: pointer;
  transition: background 120ms;
  flex-shrink: 0;
  margin-left: 2px;
}
.pend-bulk-clear:hover { background: rgba(0,0,0,0.08); color: var(--text); }

.pend-toolbar {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.pend-toggles {
  display: flex;
  background: rgba(27,43,75,0.05);
  border-radius: var(--radius-sm);
  padding: 3px;
  gap: 2px;
}

.pend-toggle {
  padding: 5px 16px;
  border-radius: 6px;
  border: none;
  font-size: 13px;
  font-weight: var(--weight-medium);
  color: var(--text-muted);
  background: transparent;
  cursor: pointer;
  transition: background 140ms, color 140ms, box-shadow 140ms;
}
.pend-toggle--active {
  background: #FFFFFF;
  color: var(--text-ink);
  box-shadow: 0 1px 2px rgba(0,0,0,0.08);
}

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

.pend-filter-select {
  height: 32px;
  padding: 0 10px;
  border: 1px solid rgba(27,43,75,0.10);
  border-radius: var(--radius-sm);
  background: #FFFFFF;
  font-size: 13px;
  color: var(--text-ink);
  cursor: pointer;
}

.pend-table-wrap {
  background: #FFFFFF;
  border: 1px solid rgba(27,43,75,0.08);
  border-radius: 14px;
  box-shadow: 0 1px 3px rgba(21,32,54,0.06), 0 8px 24px rgba(21,32,54,0.07);
  overflow: hidden;
}

.pend-table {
  width: 100%;
  border-collapse: collapse;
}

.pend-table thead th {
  padding: 11px 16px;
  font-size: 11px;
  font-weight: var(--weight-medium);
  color: var(--text-muted);
  text-align: left;
  border-bottom: 1px solid rgba(27,43,75,0.07);
  background: rgba(27,43,75,0.015);
  white-space: nowrap;
}

.pend-table tbody td {
  padding: 0 16px;
  height: 46px;
  font-size: 13px;
  color: var(--text-ink);
  border-bottom: 1px solid rgba(27,43,75,0.05);
  vertical-align: middle;
}

.pend-table tbody tr:last-child td { border-bottom: none; }

.pend-row { transition: background 100ms; }
.pend-row-link { cursor: pointer; }
.pend-row-link:hover { background: rgba(27,43,75,0.02); }
.pend-row--selected { background: rgba(27,43,75,0.04) !important; }

/* Checkbox column */
.pend-th-check { padding: 11px 4px 11px 16px !important; }
.pend-cell-check {
  width: 40px;
  padding: 0 8px 0 16px !important;
  vertical-align: middle;
}
.pend-checkbox {
  width: 15px;
  height: 15px;
  border-radius: 4px;
  border: 1.5px solid rgba(27,43,75,0.22);
  background: #fff;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  display: block;
  flex-shrink: 0;
  transition: border-color 120ms, background 120ms;
  position: relative;
}
.pend-checkbox:checked {
  background: var(--navy);
  border-color: var(--navy);
}
.pend-checkbox:checked::after {
  content: '';
  position: absolute;
  left: 3px;
  top: 1px;
  width: 5px;
  height: 8px;
  border: 1.5px solid #fff;
  border-top: none;
  border-left: none;
  transform: rotate(45deg);
}
.pend-checkbox:indeterminate {
  background: var(--navy);
  border-color: var(--navy);
}
.pend-checkbox:indeterminate::after {
  content: '';
  position: absolute;
  left: 2px;
  top: 5px;
  width: 7px;
  height: 1.5px;
  background: #fff;
}
/* Checkbox visível só no hover ou quando selecionado */
.pend-checkbox-row {
  opacity: 0;
  transition: opacity 120ms;
}
.pend-row-link:hover .pend-checkbox-row,
.pend-row--selected .pend-checkbox-row,
.pend-checkbox-row:checked {
  opacity: 1;
}

.pend-cell-icon { width: 24px; padding: 0 6px 0 0 !important; }
.pend-cell-nome { font-weight: var(--weight-medium); }
.pend-cell-medico { color: var(--text-muted); font-size: 12px; }
.pend-cell-desc { color: var(--text-cool); font-size: 12px; }
.pend-cell-actions { text-align: right; white-space: nowrap; }

.row-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: background 120ms, color 120ms;
}
.row-action-btn svg {
  display: block;
  pointer-events: none;
  flex-shrink: 0;
}

.row-action-btn:hover {
  background: rgba(27,43,75,0.07);
  color: var(--text-ink);
}
.row-action-btn--danger:hover {
  background: rgba(220,38,38,0.07);
  color: #DC2626;
}

.pend-loading {
  padding: 48px;
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
}

.pend-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-top: 1px solid rgba(27,43,75,0.07);
  background: rgba(27,43,75,0.015);
}

.pend-pag-info {
  font-size: 12px;
  color: var(--text-muted);
}

.pend-pag-btns {
  display: flex;
  align-items: center;
  gap: 4px;
}

.pend-page-btn {
  min-width: 30px;
  height: 30px;
  padding: 0 6px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: var(--weight-medium);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 120ms, color 120ms;
}

.pend-page-btn:hover:not(:disabled) {
  background: rgba(27,43,75,0.07);
  color: var(--text-ink);
}

.pend-page-btn--active {
  background: var(--navy);
  color: #fff;
  border-color: var(--navy);
}

.pend-page-btn--active:hover {
  background: var(--navy);
  color: #fff;
}

.pend-page-btn:disabled {
  opacity: 0.3;
  cursor: default;
}

.pend-page-nav {
  color: var(--text-cool);
}

/* filter-pill — mantido para outras views */
.filter-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 0 var(--space-3);
  border-radius: var(--radius-pill);
  border: 1px solid var(--surface-tint-border);
  background: rgba(255,255,255,0.76);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.58);
  color: var(--text-cool);
  font-size: var(--size-xs);
  font-weight: var(--weight-medium);
  cursor: pointer;
  transition: background 150ms, border-color 150ms, color 150ms, box-shadow 150ms;
}
.filter-pill:hover { border-color: rgba(123,108,168,0.22); background: rgba(255,255,255,0.92); color: var(--text-ink); }
.filter-pill-active { background: var(--surface-tint); border-color: rgba(123,108,168,0.20); color: var(--navy); box-shadow: none; }
.filter-pill-circle { width: 34px; min-width: 34px; height: 34px; padding: 0; border-radius: 50%; font-size: var(--size-sm); }
.filter-pill-mono { color: var(--navy); font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; }
.filter-pill-mono:hover { color: var(--navy); }

.pm-footer-btn {
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.64);
}

.pm-footer-btn:hover {
  background: var(--bg);
  border-color: rgba(27,43,75,0.16);
}

.pm-footer-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 14px;
  color: var(--text-ink);
  font-size: 13px;
  font-weight: var(--weight-medium);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.72);
  transition: background 140ms ease, border-color 140ms ease, color 140ms ease;
}

.pm-footer-cta svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* Modal NF */
.nf-modal {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

.nf-summary {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--border);
}

.nf-summary-title {
  font-family: var(--font-display);
  font-size: var(--size-md);
  font-weight: var(--weight-semibold);
  line-height: 1.2;
}

.nf-summary-main {
  font-size: var(--size-sm);
  color: var(--text);
}

.nf-summary-meta {
  font-size: var(--size-xs);
  color: var(--text-muted);
}

.nf-section {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.nf-section-title {
  font-size: var(--size-sm);
  font-weight: var(--weight-semibold);
  color: var(--text);
}

.nf-info-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.nf-info-row {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: var(--space-3);
  align-items: start;
}

.nf-info-label {
  font-size: var(--size-xs);
  color: var(--text-xmuted);
  line-height: 1.4;
}

.nf-info-value {
  font-size: var(--size-sm);
  color: var(--text);
  line-height: 1.45;
  word-break: break-word;
}

.nf-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-3);
}

.nf-footer-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-2);
  width: 100%;
}

.nf-send-btn {
  width: 40px;
  height: 40px;
  background: rgba(16,185,129,0.10);
  color: #059669;
  border: 1px solid rgba(5,150,105,0.14);
}

.nf-send-btn:hover:not(:disabled) {
  background: rgba(16,185,129,0.14);
  color: #047857;
}

.nf-send-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* Notas */
.notes-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  padding: 0 0 var(--space-2);
  max-height: 320px;
  overflow-y: auto;
  align-content: flex-start;
}

.nota-card {
  flex: 1;
  min-width: 130px;
  max-width: 200px;
  border-radius: var(--radius-md);
  padding: 10px 12px 12px;
  position: relative;
  cursor: text;
  border: none;
  box-shadow: inset 0 0 0 1px rgba(17,24,39,0.06);
  transition: box-shadow 140ms ease;
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  min-height: 90px;
}

.nota-card:hover {
  box-shadow: inset 0 0 0 1px rgba(17,24,39,0.10), 0 2px 8px rgba(17,24,39,0.05);
}

.nota-card-compose {
  min-width: 130px;
}

.nota-del {
  width: 18px; height: 18px;
  border-radius: var(--radius-pill);
  background: transparent;
  border: none;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  opacity: 0;
  transition: opacity 140ms, color 140ms;
  color: rgba(0,0,0,0.32);
  flex-shrink: 0;
}

.nota-card:hover .nota-del,
.nota-del:focus-visible,
.nota-compose-close {
  opacity: 1;
}

.nota-card-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}

.nota-color-wrap {
  position: relative;
}

.nota-color-trigger {
  width: 16px;
  height: 16px;
  border: none;
  background: transparent;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 140ms;
}

.nota-card:hover .nota-color-trigger {
  opacity: 1;
}

.nota-color-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-pill);
  box-shadow: inset 0 0 0 1px rgba(17,24,39,0.10);
}

.nota-color-popover {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  display: flex;
  flex-direction: row;
  gap: 5px;
  padding: 7px 8px;
  background: rgba(255,255,255,0.96);
  border: 1px solid rgba(17,24,39,0.08);
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
  z-index: 5;
}

.nota-text {
  width: 100%;
  flex: 1;
  resize: none;
  border: none;
  background: transparent;
  padding: 0;
  font-size: var(--size-sm);
  line-height: 1.55;
  color: rgba(0,0,0,0.78);
  outline: none;
  white-space: pre-wrap;
  word-break: break-word;
  min-height: 36px;
  box-shadow: none !important;
}

.nota-compose-input {
  min-height: 48px;
  font-size: var(--size-sm);
  line-height: 1.55;
  color: var(--text);
  resize: none;
  padding: 0;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

.nota-text::placeholder,
.nota-compose-input::placeholder { color: var(--text-xmuted); }

.nota-text:focus,
.nota-compose-input:focus {
  border-color: transparent !important;
  box-shadow: none !important;
}

.nota-color-btn {
  width: 16px;
  height: 16px;
  border-radius: var(--radius-pill);
  border: 1.5px solid transparent;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.08);
  transition: transform 120ms, border-color 120ms;
  flex-shrink: 0;
}

.nota-color-btn-active {
  border-color: rgba(27,43,75,0.56);
  transform: scale(1.12);
}

.home-inline-empty {
  font-size: var(--size-xs);
  color: var(--text-xmuted);
  padding: var(--space-3) 0 var(--space-2);
}

/* Tarefas */
.tarefas-list {
  display: flex;
  flex-direction: column;
  padding: 0 0 var(--space-2);
  max-height: 380px;
  overflow-y: auto;
}

.tarefa-compose {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 10px var(--space-3);
  margin: 0 calc(-1 * var(--space-3));
}

.tarefa-chk-placeholder {
  opacity: 0.35;
  pointer-events: none;
}

.tarefa-compose-input {
  flex: 1;
  min-width: 0;
  height: 32px;
  padding: 0;
  border: none !important;
  background: transparent !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  font-size: var(--size-sm);
  color: var(--text);
  outline: none;
  width: auto;
}

.tarefa-compose-input::placeholder { color: var(--text-xmuted); }

.tarefa-compose-input:focus {
  border-color: transparent !important;
  box-shadow: none !important;
}

.tarefa-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 10px var(--space-3);
  border-radius: var(--radius-sm);
  margin: 0 calc(-1 * var(--space-3));
  border-bottom: none;
  transition: opacity 180ms ease, transform 180ms ease, background 120ms ease;
}
.tarefa-item:hover { background: var(--bg); }

.tarefa-chk {
  width: 15px; height: 15px;
  border-radius: 4px;
  border: 1.5px solid rgba(27,43,75,0.22);
  background: transparent;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  transition: all 150ms;
  cursor: pointer;
}
.tarefa-chk:hover {
  border-color: var(--navy);
}
.tarefa-chk svg {
  opacity: 0;
  transition: opacity 120ms ease;
}
.tarefa-item-completing .tarefa-chk {
  background: var(--navy);
  border-color: var(--navy);
}
.tarefa-item-completing .tarefa-chk svg { opacity: 1; }

.tarefa-text {
  flex: 1;
  min-width: 0;
  font-size: var(--size-base);
  line-height: 1.4;
  outline: none;
  color: var(--text);
}

.tarefa-done {
  color: var(--text-xmuted);
  text-decoration: line-through;
}

.tarefa-del {
  width: 20px;
  height: 20px;
  border: none;
  background: transparent;
  color: #9CA3AF;
  opacity: 0;
  transition: opacity 140ms ease, color 140ms ease;
}

.tarefa-item:hover .tarefa-del,
.tarefa-del:focus-visible {
  opacity: 1;
}

.tarefa-del:hover {
  color: var(--text-muted);
}

.tarefa-item-completing {
  opacity: 0;
  transform: translateY(-4px);
}

.tarefas-empty {
  padding: var(--space-4) 0 var(--space-3);
  font-size: var(--size-xs);
  color: var(--text-xmuted);
}

/* ============================================================
   Responsive — Tablet (< 1024px)
   ============================================================ */
@media (max-width: 1023px) {
  .kpi-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi-strip-item:nth-child(3),
  .kpi-strip-item:nth-child(4) {
    border-top: 1px solid rgba(27,43,75,0.06);
  }
  .kpi-strip-item:nth-child(3) { border-left: none; }
}

@media (max-width: 1199px) {
  .home-boards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .board-col--todo {
    grid-column: 1 / -1;
  }
}

/* ============================================================
   Responsive — Mobile (< 768px)
   ============================================================ */
@media (max-width: 767px) {
  .sidebar {
    transform: translateX(-100%);
  }

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

  .main-wrapper {
    margin-left: 0;
  }

  .hamburger {
    display: inline-flex;
  }

  .topbar-datetime {
    display: none;
  }

  .view {
    padding: var(--space-4);
  }

  .home-boards {
    grid-template-columns: 1fr;
  }

  .board-col--todo {
    grid-column: auto;
  }

  .board-col {
    max-height: 420px;
  }

  .kpi-strip { grid-template-columns: 1fr; }
  .kpi-strip-item + .kpi-strip-item {
    border-left: none;
    border-top: 1px solid rgba(27,43,75,0.06);
  }
  .kpi-strip-item {
    padding: 16px 18px;
  }
  .kpi-strip-body {
    gap: 8px;
    flex-wrap: wrap;
  }
  .kpi-strip-value {
    font-size: 24px;
  }

  .modal { max-width: 100% !important; border-radius: var(--radius-xl) var(--radius-xl) 0 0; }
  .modal-overlay { align-items: flex-end; padding: 0; }

  .toast-container {
    bottom: var(--space-4);
    right: var(--space-4);
    left: var(--space-4);
  }
  .toast { max-width: 100%; }

  /* Home mobile */
  .home-grid { grid-template-columns: 1fr; }
  .home-fin-summary { grid-template-columns: 1fr; }
  .home-agenda-summary,
  .home-todo-summary {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }
  .notes-list { max-height: 280px; }
  .pm-action-btns { flex-direction: column; align-items: flex-end; }
  .nf-form-grid { grid-template-columns: 1fr; }
  .nf-info-row { grid-template-columns: 1fr; gap: 4px; }

  /* Agenda mobile */
  .ag-calendar { min-width: 600px; }
  .ag-calendar-wrap { overflow-x: auto; }

  /* Overlay mobile: mostrar apenas quando não tem hidden */
  .sidebar-overlay:not(.hidden) { display: block; }

  /* Fix: removido .sidebar-collapsed override — o JS nunca aplica essa classe no mobile (isMobile() guard em app.js:171) */
}

/* ============================================================
   Agenda
   ============================================================ */

/* Layout wrapper */
.ag-wrap {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  gap: var(--space-4);
}

/* Toolbar */
.ag-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  flex-shrink: 0;
}

.ag-nav {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.ag-nav-btn {
  width: 32px;
  height: 32px;
}

.ag-hoje-btn {
  height: 32px;
  padding: 0 var(--space-3);
  font-size: var(--size-sm);
}

.ag-periodo {
  font-size: var(--size-sm);
  font-weight: var(--weight-medium);
  color: var(--text);
  min-width: 140px;
}

.ag-toolbar-right {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

/* Segmented control Dia/Semana */
.ag-view-toggle {
  display: flex;
  gap: 2px;
  background: rgba(0,0,0,0.05);
  border-radius: var(--radius-md);
  padding: 3px;
}
.ag-view-btn {
  padding: 5px 14px;
  border: none;
  background: transparent;
  border-radius: calc(var(--radius-md) - 2px);
  font-size: var(--size-sm);
  font-weight: var(--weight-medium);
  color: var(--text-muted);
  cursor: pointer;
  font-family: var(--font);
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}
.ag-view-btn:hover { color: var(--text); }
.ag-view-btn-active {
  background: white;
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

.ag-loading {
  padding: var(--space-10);
  text-align: center;
  color: var(--text-muted);
  font-size: var(--size-sm);
}

/* Calendário */
.ag-calendar-wrap {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--bg-card);
}

.ag-calendar {
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* Cabeçalho dos dias */
.ag-header {
  display: grid;
  grid-template-columns: 52px repeat(7, 1fr);
  border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,0.60);
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: 2;
}

.ag-time-gutter {
  border-right: 1px solid var(--border);
}

.ag-col-header {
  padding: var(--space-2) var(--space-2);
  text-align: center;
  border-right: 1px solid var(--border);
}
.ag-col-header:last-child { border-right: none; }

.ag-col-hoje {
  background: rgba(27,43,75,0.04);
}

.ag-dow {
  display: block;
  font-size: var(--size-xs);
  color: var(--text-muted);
  text-transform: capitalize;
  line-height: 1;
  margin-bottom: 4px;
}

.ag-day-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: var(--size-sm);
  font-weight: var(--weight-medium);
  color: var(--text);
}

.ag-day-hoje {
  background: var(--navy);
  color: #fff;
}

/* Body scrollável */
.ag-body {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
}

/* Linhas de horário */
.ag-row {
  display: grid;
  grid-template-columns: 52px repeat(7, 1fr);
  min-height: 32px;
  border-bottom: 1px solid var(--border);
}

.ag-row-half {
  border-bottom: 1px dashed rgba(229,231,235,0.6);
}

.ag-time-label {
  font-size: 10px;
  color: var(--text-xmuted);
  padding: 0 var(--space-2);
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  padding-top: 4px;
  border-right: 1px solid var(--border);
  user-select: none;
}

.ag-time-label.ag-half {
  border-right: 1px solid var(--border);
}

/* Células do grid */
.ag-cell {
  border-right: 1px solid var(--border);
  min-height: 32px;
  padding: 2px;
  position: relative;
  cursor: pointer;
  transition: background 100ms;
}
.ag-cell:last-child { border-right: none; }
.ag-cell:hover { background: rgba(27,43,75,0.03); }

.ag-cell-bloqueio {
  background: repeating-linear-gradient(
    45deg,
    rgba(0,0,0,0.02),
    rgba(0,0,0,0.02) 4px,
    transparent 4px,
    transparent 8px
  );
  cursor: not-allowed;
}
.ag-cell-bloqueio:hover { background: repeating-linear-gradient(
  45deg,
  rgba(0,0,0,0.04),
  rgba(0,0,0,0.04) 4px,
  transparent 4px,
  transparent 8px
); }

.ag-bloqueio-label {
  font-size: 10px;
  color: var(--text-xmuted);
  padding: 2px 4px;
  user-select: none;
}

/* Eventos */
.ag-event {
  border-radius: var(--radius-sm);
  padding: 3px 6px;
  font-size: var(--size-xs);
  line-height: 1.3;
  display: flex;
  flex-direction: column;
  gap: 1px;
  overflow: hidden;
  cursor: pointer;
  position: relative;
  transition: filter 100ms;
  min-height: 32px;
}
.ag-event:hover { filter: brightness(0.95); }

.ag-ev-agendada   { background: var(--s-agendada-bg);   border-left: 3px solid var(--s-agendada); }
.ag-ev-confirmada { background: var(--s-confirmada-bg); border-left: 3px solid var(--s-confirmada); }
.ag-ev-atendida   { background: var(--s-atendida-bg);   border-left: 3px solid var(--s-atendida); }
.ag-ev-falta      { background: var(--s-falta-bg);      border-left: 3px solid var(--s-falta); }
.ag-ev-cancelada  { background: var(--s-cancelada-bg);  border-left: 3px solid var(--s-cancelada); opacity: 0.6; }

.ag-ev-nome {
  font-weight: var(--weight-semibold);
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ag-ev-serv {
  color: var(--text-muted);
  font-size: 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ag-ev-badge {
  align-self: flex-start;
}

.ag-ev-badge-agendada   { background: var(--s-agendada-bg);   color: var(--s-agendada); }
.ag-ev-badge-confirmada { background: var(--s-confirmada-bg); color: var(--s-confirmada); }
.ag-ev-badge-atendida   { background: var(--s-atendida-bg);   color: var(--s-atendida); }
.ag-ev-badge-falta      { background: var(--s-falta-bg);      color: var(--s-falta); }
.ag-ev-badge-cancelada  { background: var(--s-cancelada-bg);  color: var(--s-cancelada); }
.ag-ev-badge-pendente   { background: var(--s-pendente-bg);   color: var(--s-pendente); }
.ag-ev-badge-paga       { background: var(--s-paga-bg);       color: var(--s-paga); }

/* -------- Formulário de agendamento -------- */
.ag-form { display: flex; flex-direction: column; gap: var(--space-4); }

/* Autocomplete de paciente */
.ag-pac-search-wrap {
  position: relative;
}
.ag-pac-input-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  position: relative;
}
.ag-pac-search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-xmuted);
  pointer-events: none;
  flex-shrink: 0;
}
.ag-pac-input-row input {
  flex: 1;
  padding-left: 30px;
}
.ag-pac-add-btn {
  flex-shrink: 0;
}

.ag-pac-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--glass-modal);
  backdrop-filter: var(--blur-md);
  -webkit-backdrop-filter: var(--blur-md);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  z-index: 50;
  max-height: 220px;
  overflow-y: auto;
  display: none;
}
.ag-pac-dropdown.ag-pop-open { display: block; }

.ag-pac-item {
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  padding: var(--space-2) var(--space-3);
  color: var(--text);
  cursor: pointer;
  transition: background 100ms;
}
.ag-pac-item-name { font-size: var(--size-sm); }
.ag-pac-item-meta {
  margin-top: 2px;
  font-size: var(--size-xs);
  color: var(--text-muted);
}
.ag-pac-item:hover { background: var(--navy-light); }
.ag-pac-empty { color: var(--text-muted); cursor: default; }
.ag-pac-empty:hover { background: transparent; }

/* -------- Pill de modalidade -------- */
.ag-modal-pill {
  border-color: transparent;
}
.ag-modal-pill-presencial {
  background: rgba(27,43,75,0.08);
  border-color: rgba(27,43,75,0.14);
  color: var(--navy);
}
.ag-modal-pill-teleconsulta {
  background: rgba(26,58,42,0.08);
  border-color: rgba(26,58,42,0.14);
  color: var(--teal);
}

/* -------- Vista de Dia -------- */
.ag-calendar-dia .ag-header { grid-template-columns: 56px 1fr; }
.ag-calendar-dia .ag-row,
.ag-calendar-dia .ag-row-dia { grid-template-columns: 56px 1fr; }
.ag-col-header-dia { flex: 1; }

.ag-cell-dia { min-height: 40px; }

.ag-event-dia {
  padding: var(--space-2) var(--space-3);
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-height: 40px;
}
.ag-ev-dia-nome {
  font-size: var(--size-sm);
  font-weight: var(--weight-medium);
  color: inherit;
  line-height: 1.2;
}
.ag-ev-dia-serv {
  font-size: var(--size-xs);
  opacity: 0.75;
  line-height: 1.2;
}

/* -------- Modal de detalhes -------- */
.ag-details { display: flex; flex-direction: column; gap: var(--space-4); }
.ag-details-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--border);
}
.ag-details-avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--navy);
  color: white;
  display: flex; align-items: center; justify-content: center;
  font-size: var(--size-sm);
  font-weight: var(--weight-semibold);
  flex-shrink: 0;
}
.ag-details-nome {
  font-size: var(--size-base);
  font-weight: var(--weight-semibold);
  color: var(--text);
}
.ag-details-contato {
  font-size: var(--size-sm);
  color: var(--text-muted);
  margin-top: 2px;
}
.ag-details-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3);
}
.ag-details-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.ag-details-label {
  font-size: var(--size-xs);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: var(--weight-medium);
}
.ag-details-value {
  font-size: var(--size-sm);
  color: var(--text);
  font-weight: var(--weight-medium);
}
.ag-details-obs {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  padding-top: var(--space-3);
  border-top: 1px solid var(--border);
}
.ag-details-obs p {
  font-size: var(--size-sm);
  color: var(--text);
  margin: 0;
  line-height: 1.5;
}

/* View Dia — multi-coluna (sem filtro de médico) */
.ag-calendar-multi .ag-header,
.ag-calendar-multi .ag-row,
.ag-calendar-multi .ag-row-dia {
  grid-template-columns: var(--ag-gutter, 56px) repeat(var(--ag-ncols, 1), 1fr);
}

/* View Mês */
.ag-mes-wrap {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}

.ag-mes-header {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  border-bottom: 1px solid var(--border);
}

.ag-mes-dow {
  padding: var(--space-2) var(--space-3);
  font-size: var(--size-xs);
  font-weight: var(--weight-medium);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  text-align: center;
}

.ag-mes-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  flex: 1;
  overflow-y: auto;
  align-content: start;
}

.ag-mes-cell {
  min-height: 96px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: var(--space-1) var(--space-2);
  display: flex;
  flex-direction: column;
  gap: 2px;
  cursor: pointer;
  transition: background 0.1s;
}

.ag-mes-cell:hover { background: rgba(27,43,75,0.02); }

.ag-mes-cell:nth-child(7n) { border-right: none; }

.ag-mes-cell-vazia {
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  cursor: default;
}

.ag-mes-hoje {
  background: rgba(27,43,75,0.03);
}

.ag-mes-dia-num {
  font-size: var(--size-sm);
  font-weight: var(--weight-medium);
  color: var(--text-muted);
  line-height: 1;
  padding: 2px 0;
  align-self: flex-start;
}

.ag-mes-dia-hoje {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  background: var(--navy);
  color: white;
  border-radius: 50%;
  font-weight: var(--weight-semibold);
  font-size: var(--size-xs);
}

.ag-mes-chip {
  font-size: 11px;
  font-weight: var(--weight-medium);
  padding: 1px var(--space-2);
  border-radius: var(--radius-sm);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  line-height: 18px;
}

.ag-mes-chip:hover { filter: brightness(0.93); }

.ag-mes-mais {
  font-size: 11px;
  color: var(--text-muted);
  padding: 1px var(--space-1);
  cursor: pointer;
}

.ag-mes-mais:hover { color: var(--navy); }

/* ============================================================
   Agenda — Grade multi-coluna (sem filtro)
   ============================================================ */

.ag-grade-scroll {
  width: 100%;
  height: 100%;
  overflow-x: auto;
  overflow-y: auto;
}

.ag-grade-grid {
  display: grid;
  /* colunas: [corner] + [1 por médico] — definido inline via style */
  min-width: max-content;
}

/* Célula de canto (acima da coluna de horas) */
.ag-grade-corner {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-3);
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,0.7);
  position: sticky;
  left: 0;
  z-index: 3;
}

/* Header de cada médico */
.ag-grade-doc-header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,0.7);
  cursor: pointer;
  transition: background 140ms;
}
.ag-grade-doc-header:last-child { border-right: none; }
.ag-grade-doc-header:hover { background: var(--navy-light); }

.ag-grade-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--size-xs);
  font-weight: var(--weight-semibold);
  flex-shrink: 0;
}

.ag-grade-doc-info { min-width: 0; }
.ag-grade-doc-nome {
  font-size: var(--size-sm);
  font-weight: var(--weight-medium);
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ag-grade-doc-cnt {
  font-size: var(--size-xs);
  color: var(--text-muted);
}

/* Coluna de horários (sticky à esquerda) */
.ag-grade-time {
  padding: var(--space-2) var(--space-3);
  font-size: var(--size-xs);
  color: var(--text-xmuted);
  font-variant-numeric: tabular-nums;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid rgba(27,43,75,0.14);
  background: var(--bg-card);
  display: flex;
  align-items: center;
  position: sticky;
  left: 0;
  z-index: 1;
}

/* Células de agendamento */
.ag-grade-cell {
  padding: var(--space-1) var(--space-2);
  border-right: 1px solid rgba(27,43,75,0.14);
  border-bottom: 1px solid rgba(27,43,75,0.14);
  min-height: 56px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.ag-grade-cell:last-child { border-right: none; }
button.ag-grade-cell,
button.ag-cell,
button.ag-mes-cell {
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  border-radius: 0;
  color: inherit;
  font: inherit;
  text-align: left;
}
button.ag-grade-cell {
  border: 0;
  border-right: 1px solid rgba(27,43,75,0.14);
  border-bottom: 1px solid rgba(27,43,75,0.14);
}
button.ag-cell {
  border: 0;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
button.ag-mes-cell {
  border: 0;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
button.ag-grade-chip,
button.ag-status-badge,
button.ag-wapop-item,
button.ag-ctxpop-item,
button.ag-spop-item {
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
}
button.ag-status-badge {
  width: auto;
}

.ag-grade-cell-bloqueio {
  background: repeating-linear-gradient(
    -45deg,
    transparent,
    transparent 4px,
    rgba(0,0,0,0.025) 4px,
    rgba(0,0,0,0.025) 8px
  );
}

.ag-grade-bloqueio-lbl {
  font-size: 10px;
  color: var(--text-xmuted);
  font-style: italic;
}

/* Chip dentro da grade */
.ag-grade-chip {
  width: 100%;
  padding: 3px var(--space-2);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: filter 140ms;
  overflow: hidden;
}
.ag-grade-chip:hover { filter: brightness(0.93); }

.ag-grade-chip-nome {
  font-size: var(--size-xs);
  font-weight: var(--weight-medium);
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  gap: 4px;
}

.ag-grade-chip-serv {
  font-size: 10px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ============================================================
   Agenda — Tabela (dia, médico filtrado)
   ============================================================ */

.ag-tabela-wrap {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.ag-tabela-inner {
  flex: 1;
  overflow-y: auto;
}

.ag-tabela {
  width: 100%;
  border-collapse: collapse;
}

.ag-tabela thead th {
  padding: var(--space-2) var(--space-3);
  text-align: left;
  font-size: var(--size-xs);
  font-weight: var(--weight-semibold);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,0.7);
  position: sticky;
  top: 0;
  z-index: 2;
}

.ag-tabela tbody tr {
  border-bottom: 1px solid var(--border-soft);
  transition: background 100ms;
}
.ag-tabela tbody tr:hover { background: rgba(27,43,75,0.02); }
.ag-tabela tbody tr:last-child { border-bottom: none; }

.ag-tabela td {
  padding: var(--space-3) var(--space-3);
  vertical-align: middle;
}

.ag-tab-hora {
  font-size: var(--size-sm);
  font-weight: var(--weight-medium);
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
  white-space: nowrap;
  width: 72px;
}

.ag-tab-nome {
  min-width: 180px;
}
.ag-tab-nome strong {
  display: block;
  font-size: var(--size-sm);
  font-weight: var(--weight-medium);
  color: var(--text);
}
.ag-tab-nome small {
  font-size: var(--size-xs);
  color: var(--text-muted);
}

.ag-tab-serv {
  width: 120px;
}

/* Coluna de ações */
.ag-tab-actions {
  width: 80px;
  text-align: right;
}
.ag-tab-action-wrap {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-1);
}

/* Badge de status (inline na tabela) */
.ag-status-wrap { position: relative; display: inline-block; }

.ag-status-badge {
  gap: 5px;
}
.ag-status-badge:hover { filter: brightness(0.93); }

/* Dot no status badge */
.ag-status-badge::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

/* Status popover */
.ag-status-pop {
  min-width: 150px;
}
.ag-status-pop.ag-pop-open { display: block; }

.ag-spop-item {
}
.ag-spop-item-active {
  background: var(--navy-light);
  font-weight: var(--weight-medium);
}

.ag-spop-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* WA popover */
.ag-wa-pop,
.ag-ctx-pop {
  min-width: 140px;
}
.ag-wa-pop.ag-pop-open,
.ag-ctx-pop.ag-pop-open { display: block; }

.ag-wapop-item,
.ag-ctxpop-item {
}
.ag-ctxpop-danger { color: var(--s-cancelada); }
.ag-ctxpop-danger:hover { background: var(--s-cancelada-bg); }

/* Legenda (rodapé da tabela) */
.ag-tabela-legenda {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-3) var(--space-4);
  border-top: 1px solid var(--border);
  flex-shrink: 0;
  flex-wrap: wrap;
}

.ag-leg-label {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--size-xs);
  color: var(--text-muted);
}

.ag-leg-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.ag-leg-badge {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.ag-leg-text {
  font-size: var(--size-xs);
  color: var(--text-muted);
}

/* ============================================================
   Agenda — Modal motivo (falta/cancelada)
   ============================================================ */

.ag-toggle-wrap {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.ag-toggle-wrap input[type="checkbox"] {
  display: none;
}

.ag-toggle-slider {
  position: relative;
  width: 36px;
  height: 20px;
  background: var(--border);
  border-radius: 10px;
  cursor: pointer;
  transition: background 200ms;
  flex-shrink: 0;
}
.ag-toggle-slider::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  background: white;
  border-radius: 50%;
  transition: transform 200ms;
  box-shadow: var(--shadow-sm);
}
.ag-toggle-slider.ag-toggle-on,
input[type="checkbox"]:checked + .ag-toggle-slider {
  background: var(--navy);
}
.ag-toggle-slider.ag-toggle-on::after,
input[type="checkbox"]:checked + .ag-toggle-slider::after {
  transform: translateX(16px);
}

.ag-mot-textarea {
  width: 100%;
  min-height: 80px;
  padding: var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-family: var(--font);
  font-size: var(--size-sm);
  color: var(--text);
  background: var(--bg-input);
  resize: vertical;
  transition: border-color 150ms;
  box-sizing: border-box;
}
.ag-mot-textarea:focus {
  outline: none;
  border-color: var(--navy);
}
.ag-mot-textarea:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ============================================================
   Botões de ação da tabela (wrapper relativo para popovers)
   ============================================================ */

.ag-btn-wa,
.ag-btn-ctx {
  position: relative;
}

/* Asterisco obrigatório */
.req { color: var(--s-cancelada); }

/* form-label (alias para label em modais da agenda) */
.form-label {
  font-size: var(--size-sm);
  font-weight: var(--weight-medium);
  color: var(--text);
}

/* ============================================================
   Financeiro
   ============================================================ */

.fin-wrap {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

/* KPIs */
.fin-kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-4);
}

.fin-kpi {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-4) var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.fin-kpi-skeleton { min-height: 72px; }

.fin-kpi-label {
  font-size: var(--size-xs);
  font-weight: var(--weight-medium);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.fin-kpi-valor {
  font-size: var(--size-xl);
  font-weight: var(--weight-semibold);
  color: var(--text);
  letter-spacing: -0.02em;
}

.fin-kpi-positivo .fin-kpi-valor { color: var(--s-confirmada); }
.fin-kpi-negativo .fin-kpi-valor { color: var(--s-cancelada); }
.fin-kpi-pendente .fin-kpi-valor { color: var(--s-pendente); }

/* Toolbar */
.fin-toolbar {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  flex-wrap: wrap;
}

.fin-tabs {
  display: flex;
  background: rgba(0,0,0,0.04);
  border-radius: var(--radius-md);
  padding: 3px;
  gap: 2px;
  flex-shrink: 0;
}

.fin-tab {
  height: 30px;
  padding: 0 var(--space-4);
  border-radius: calc(var(--radius-md) - 2px);
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: var(--size-sm);
  font-weight: var(--weight-medium);
  cursor: pointer;
  transition: all 150ms;
}
.fin-tab-active {
  background: white;
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

.fin-nav-mes {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-shrink: 0;
}

.fin-mes-label {
  font-size: var(--size-sm);
  font-weight: var(--weight-medium);
  color: var(--text);
  min-width: 72px;
  text-align: center;
}

.fin-toolbar-right {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-left: auto;
  flex-wrap: wrap;
}

/* Status pills */
.fin-status-pills {
  display: flex;
  gap: var(--space-1);
}

.fin-spill {
  min-width: 64px;
}
.fin-spill-active { background: var(--surface-tint); border-color: rgba(123,108,168,0.20); color: var(--navy); box-shadow: none; }

/* Loading */
.fin-loading {
  padding: var(--space-10);
  text-align: center;
  color: var(--text-muted);
  font-size: var(--size-sm);
}

/* Tabela */
.fin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--size-sm);
}

.fin-table thead th {
  padding: var(--space-2) var(--space-3);
  text-align: left;
  font-size: var(--size-xs);
  font-weight: var(--weight-semibold);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--border);
  background: var(--bg-card);
  position: sticky;
  top: 0;
  z-index: 1;
}

.fin-table tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background 100ms;
}

.fin-tr-click {
  cursor: pointer;
}
.fin-tr-click:hover { background: var(--navy-light); }

.fin-table td {
  padding: var(--space-3);
  color: var(--text);
  vertical-align: middle;
}

.fin-td-nome {
  font-weight: var(--weight-medium);
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fin-td-date { color: var(--text-muted); white-space: nowrap; }
.fin-td-serv { color: var(--text-muted); }

.fin-td-valor {
  font-weight: var(--weight-semibold);
  white-space: nowrap;
}
.fin-valor-despesa { color: var(--s-cancelada); }

.fin-td-action {
  width: 92px;
  text-align: right;
  color: var(--text-xmuted);
}
.fin-action-group {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-1);
}
.fin-edit-icon { opacity: 0; transition: opacity 150ms; }
.fin-tr-click:hover .fin-edit-icon { opacity: 1; }
.fin-action-btn { color: var(--text-xmuted); }
.fin-action-btn:hover { color: var(--navy); }

/* Status badges */
.fin-status {
  border-color: transparent;
}
.fin-s-pendente  { background: var(--s-pendente-bg);  color: var(--s-pendente);  }
.fin-s-paga      { background: var(--s-paga-bg);      color: var(--s-paga);      }
.fin-s-cancelada { background: var(--s-cancelada-bg); color: var(--s-cancelada); }

/* NF badge */
.fin-nf-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: var(--weight-medium);
  padding: 2px 6px;
  border-radius: var(--radius-pill);
  background: var(--s-atendida-bg);
  color: var(--s-atendida);
}
.fin-nf-enviada { background: var(--s-confirmada-bg); color: var(--s-confirmada); }
.fin-nf-none    { background: transparent; color: var(--text-xmuted); }
.fin-nf-link {
  border: none;
  background: transparent;
  padding: 0;
  color: var(--navy);
  font-size: var(--size-xs);
  font-weight: var(--weight-semibold);
  cursor: pointer;
}
.fin-nf-link:hover { color: var(--navy-strong, var(--navy)); text-decoration: underline; }

/* Seção NF no modal */
.fin-nf-section {
  padding: var(--space-3);
  background: rgba(0,0,0,0.02);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.fin-nf-row {
  display: flex;
  gap: var(--space-5);
  flex-wrap: wrap;
}

.fin-checkbox-label {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--size-sm);
  color: var(--text);
  cursor: pointer;
}

.fin-checkbox-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--navy);
  cursor: pointer;
}

/* Mobile */
@media (max-width: 768px) {
  .fin-kpis { grid-template-columns: repeat(2, 1fr); gap: var(--space-3); }
  .fin-toolbar { gap: var(--space-3); }
  .fin-toolbar-right { margin-left: 0; width: 100%; }
  .fin-table td, .fin-table th { padding: var(--space-2); }
  .fin-td-serv { display: none; }
}

/* ============================================================
   Configurações
   ============================================================ */

.cfg-wrap {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  height: 100%;
}

/* Tabs */
.cfg-tabs-bar {
  display: flex;
  gap: 2px;
  background: rgba(0,0,0,0.04);
  border-radius: var(--radius-md);
  padding: 3px;
  width: fit-content;
  flex-shrink: 0;
  flex-wrap: wrap;
}

.cfg-tab {
  height: 30px;
  padding: 0 var(--space-4);
  border-radius: calc(var(--radius-md) - 2px);
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: var(--size-sm);
  font-weight: var(--weight-medium);
  cursor: pointer;
  transition: all 150ms;
  white-space: nowrap;
}
.cfg-tab-active { background: white; color: var(--text); box-shadow: var(--shadow-sm); }

.cfg-body { flex: 1; min-height: 0; overflow-y: auto; }
.cfg-loading { padding: var(--space-10); text-align: center; color: var(--text-muted); font-size: var(--size-sm); }

/* Section wrap */
.cfg-section-wrap { display: flex; flex-direction: column; gap: var(--space-6); }
.cfg-section { display: flex; flex-direction: column; gap: var(--space-3); }
.cfg-section-title { font-size: var(--size-sm); font-weight: var(--weight-semibold); color: var(--text); letter-spacing: -0.01em; }
.cfg-section-header { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-4); }
.cfg-section-h2 { font-size: var(--size-lg); font-weight: var(--weight-semibold); color: var(--text); }
.cfg-section-desc { font-size: var(--size-sm); color: var(--text-muted); margin-top: var(--space-1); }
.cfg-empty-text { font-size: var(--size-sm); color: var(--text-muted); padding: var(--space-3) 0; }
.cfg-footer-actions { padding-top: var(--space-4); border-top: 1px solid var(--border); }
.cfg-report-toggle {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--size-sm);
  color: var(--text);
}
.cfg-report-toggle input[type="checkbox"],
.cfg-report-check input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--navy);
}
.cfg-report-sections {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-4);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
.cfg-report-checks {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}
.cfg-report-check {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--size-sm);
  color: var(--text);
}

/* Médicos layout */
.cfg-medicos-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: var(--space-5);
  height: 100%;
  min-height: 0;
}

.cfg-medicos-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-3);
  overflow-y: auto;
}

.cfg-medico-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background 140ms;
}
.cfg-medico-item:hover { background: var(--navy-light); }
.cfg-medico-item-active { background: var(--navy-light); }

.cfg-medico-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--navy);
  color: white;
  display: flex; align-items: center; justify-content: center;
  font-size: var(--size-xs);
  font-weight: var(--weight-semibold);
  flex-shrink: 0;
}

.cfg-medico-info { flex: 1; min-width: 0; }
.cfg-medico-nome { display: block; font-size: var(--size-sm); font-weight: var(--weight-medium); color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cfg-medico-esp  { display: block; font-size: var(--size-xs); color: var(--text-muted); }

.cfg-medico-badge { flex-shrink: 0; }
.badge-ativo   { background: var(--s-confirmada-bg); color: var(--s-confirmada); }
.badge-inativo { background: var(--s-cancelada-bg);  color: var(--s-cancelada); }

.cfg-add-btn {
  display: flex; align-items: center; gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  border: 1px dashed var(--border);
  background: transparent;
  color: var(--text-muted);
  font-size: var(--size-sm);
  cursor: pointer;
  transition: all 150ms;
  margin-top: auto;
}
.cfg-add-btn:hover { border-color: var(--navy); color: var(--navy); }
.cfg-add-btn-inline { margin-top: 0; }

/* Painel edição */
.cfg-medico-painel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.cfg-empty-painel { padding: var(--space-10); text-align: center; color: var(--text-muted); }

.cfg-painel-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.cfg-painel-nome { font-size: var(--size-lg); font-weight: var(--weight-semibold); color: var(--text); }
.cfg-painel-sub  { font-size: var(--size-sm); color: var(--text-muted); }
.cfg-painel-actions { display: flex; align-items: center; gap: var(--space-3); }

.cfg-painel-body {
  flex: 1; overflow-y: auto;
  padding: var(--space-5);
  display: flex; flex-direction: column; gap: var(--space-6);
}

.cfg-painel-footer {
  padding: var(--space-4) var(--space-5);
  border-top: 1px solid var(--border);
  display: flex; justify-content: flex-end;
  flex-shrink: 0;
}

/* Serviços table */
.cfg-servicos-table { width: 100%; border-collapse: collapse; font-size: var(--size-sm); }
.cfg-servicos-table th { padding: var(--space-2); text-align: left; font-size: var(--size-xs); font-weight: var(--weight-semibold); color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; border-bottom: 1px solid var(--border); }
.cfg-servicos-table td { padding: var(--space-2); border-bottom: 1px solid var(--border); }
.cfg-servicos-table input, .cfg-servicos-table select { width: 100%; }
.cfg-srv-del { color: var(--text-xmuted); }
.cfg-srv-del:hover { color: var(--s-cancelada); }

/* Dias de atendimento */
.cfg-dias-wrap { display: flex; gap: var(--space-2); }
.cfg-dia-pill {
  line-height: 1;
}
.cfg-dia-active { background: var(--surface-tint); border-color: rgba(123,108,168,0.20); color: var(--navy); box-shadow: none; }

/* Acesso */
.cfg-acesso-actions { display: flex; gap: var(--space-2); }

/* WhatsApp / NF */
.cfg-wa-vars {
  display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap;
  padding: var(--space-3) var(--space-4);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}
.cfg-vars-label { font-size: var(--size-xs); font-weight: var(--weight-semibold); color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.cfg-var-pill {
  min-height: 26px;
}

.cfg-wa-templates { display: flex; flex-direction: column; gap: var(--space-4); }
.cfg-wa-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.cfg-wa-card-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border);
  background: rgba(0,0,0,0.02);
}
.cfg-wa-card-label { font-size: var(--size-sm); font-weight: var(--weight-medium); color: var(--text); }
.cfg-wa-card-hint  { font-size: var(--size-xs); color: var(--text-muted); }
.cfg-wa-textarea {
  width: 100%; padding: var(--space-3) var(--space-4);
  border: none; resize: vertical;
  font-size: var(--size-sm); color: var(--text);
  background: transparent; font-family: var(--font);
  line-height: 1.6;
  box-sizing: border-box;
}
.cfg-wa-textarea:focus { outline: none; background: rgba(27,43,75,0.02); }

/* NF preview */
.cfg-nf-layout { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-5); }
.cfg-nf-preview { display: flex; flex-direction: column; gap: var(--space-2); }
.cfg-nf-preview-box {
  flex: 1; padding: var(--space-4);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: var(--size-sm); color: var(--text); line-height: 1.6;
  min-height: 120px;
}

/* Dados / Exportar */
.cfg-export-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-4); }
.cfg-export-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: var(--space-4);
  display: flex; flex-direction: column; gap: var(--space-3);
}
.cfg-export-label { font-size: var(--size-sm); font-weight: var(--weight-medium); color: var(--text); }
.cfg-export-actions { display: flex; flex-direction: column; gap: var(--space-2); }

/* Minha conta */
.cfg-conta-wrap { align-items: flex-start; max-width: 480px; }
.cfg-conta-avatar {
  width: 64px; height: 64px; border-radius: 50%;
  background: var(--navy); color: white;
  display: flex; align-items: center; justify-content: center;
  font-size: var(--size-lg); font-weight: var(--weight-semibold);
}
.cfg-conta-form { width: 100%; }
.cfg-conta-actions { display: flex; gap: var(--space-3); }

/* ============================================================
   Ficha do Paciente
   ============================================================ */
.ficha-wrap {
  display: flex;
  flex-direction: column;
  gap: 28px;
  max-width: 1240px;
}

/* Layout 2 colunas */
.ficha-layout {
  display: flex;
  align-items: flex-start;
  gap: 24px;
}

.ficha-sidebar {
  width: 260px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.ficha-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* Identidade (topo da coluna esquerda) */
.fp-identity {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.fp-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: rgba(27,43,75,0.07);
  border: 1px solid rgba(27,43,75,0.11);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--navy);
  flex-shrink: 0;
}

.fp-identity-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.fp-nome-row {
  display: flex;
  align-items: center;
  gap: 7px;
}

.fp-aviso-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: var(--radius-pill);
  background: rgba(236,72,153,0.12);
  color: #be185d;
  flex-shrink: 0;
  border: none;
  cursor: pointer;
  transition: background 150ms;
}
.fp-aviso-badge:hover {
  background: rgba(236,72,153,0.22);
}

.fp-aviso-tooltip {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(100% + 6px);
  background: #1f1f1f;
  color: #fff;
  font-size: var(--size-xs);
  white-space: nowrap;
  padding: 5px 10px;
  border-radius: var(--radius-md);
  pointer-events: none;
  opacity: 0;
  transition: opacity 150ms;
  z-index: 200;
}
.fp-aviso-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: #1f1f1f;
}
.fp-aviso-badge {
  position: relative;
}
.fp-aviso-badge.fp-aviso-open .fp-aviso-tooltip {
  opacity: 1;
}

.fp-nome {
  font-size: 18px;
  font-weight: var(--weight-semibold);
  color: var(--text-ink);
  margin: 0;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.fp-medico-line {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-muted);
}


.fp-pend {
  margin-top: 2px;
}


.fp-proxima-wrap {
  border-top: 1px solid rgba(27,43,75,0.07);
  padding-top: 12px;
  margin-top: -8px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.fp-servicos-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.fp-servicos-table thead th {
  padding: 6px 8px;
  font-size: 11px;
  font-weight: var(--weight-medium);
  color: var(--text-muted);
  text-align: left;
  border-bottom: 1px solid rgba(27,43,75,0.07);
  background: rgba(27,43,75,0.015);
}
.fp-servicos-table thead th:last-child { text-align: right; }
.fp-servicos-table tbody td {
  padding: 7px 8px;
  color: var(--text);
  border-bottom: 1px solid rgba(27,43,75,0.05);
}
.fp-servicos-table tbody tr:last-child td { border-bottom: none; }
.fp-servicos-valor { text-align: right; font-weight: var(--weight-medium); }
.fp-servicos-personalizado { color: var(--navy); }

.fp-proxima {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  background: rgba(27,43,75,0.04);
  border-radius: var(--radius-md);
  font-size: 13px;
  color: var(--text-muted);
}
.fp-proxima svg { flex-shrink: 0; color: var(--text-muted); }
.fp-proxima strong { font-weight: var(--weight-semibold); color: var(--text); }
.fp-proxima-vencido { background: rgba(245,158,11,0.08); color: #9a6c2d; }
.fp-proxima-vencido svg { color: #9a6c2d; }
.fp-retorno-vencido { font-size: 11px; font-weight: var(--weight-medium); color: var(--s-falta); }


/* Breadcrumb / Voltar */
.ficha-breadcrumb {
  display: flex;
  align-items: center;
}

.ficha-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  width: 28px;
  height: 28px;
  padding: 0;
  justify-content: center;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: transparent;
  font-size: 12px;
  font-weight: var(--weight-medium);
  color: var(--text-muted);
  cursor: pointer;
  font-family: var(--font);
  transition: background 120ms, color 120ms;
}
.ficha-back-btn:hover {
  background: rgba(27,43,75,0.04);
  color: var(--text);
}

/* Topbar da ficha (breadcrumb + título + ação) */
.ficha-topbar {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}
.ficha-topbar-action { margin-left: auto; }

/* Header (coluna esquerda — .ficha-sidebar) */
.ficha-header {
  padding: 0;
  background: transparent;
  border: none;
  box-shadow: none;
}

.ficha-header-loading {
  padding: 0;
  color: var(--text-cool);
  font-size: var(--size-sm);
}

.ficha-status-badge {
  letter-spacing: 0.01em;
}

.ficha-status-ativo {
  background: var(--patient-status-active-bg);
  border-color: var(--patient-status-active-border);
  color: var(--patient-status-active);
}

.ficha-status-lead {
  background: var(--patient-status-lead-bg);
  border-color: var(--patient-status-lead-border);
  color: var(--patient-status-lead);
}

.ficha-status-inativo {
  background: var(--patient-status-inactive-bg);
  border-color: var(--patient-status-inactive-border);
  color: var(--patient-status-inactive);
}

.ficha-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 6px;
  font-size: 13px;
  color: var(--text-muted);
}

.ficha-meta-dot {
  color: var(--text-xmuted);
  font-size: 11px;
}

.ficha-badge {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 10px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(123,108,168,0.10);
  background: rgba(255,255,255,0.72);
  font-size: 12px;
  font-weight: var(--weight-medium);
  line-height: 1;
}

.ficha-badge-navy {
  background: var(--surface-tint);
  border-color: rgba(123,108,168,0.16);
  color: var(--text-ink);
}

.ficha-badge-neutral {
  background: rgba(127,129,147,0.10);
  color: var(--text-cool);
}

.ficha-badge-warning {
  background: rgba(196,139,79,0.12);
  border-color: rgba(196,139,79,0.16);
  color: #9a6c2d;
}

.ficha-badge-muted { opacity: 0.6; }

.ficha-pend-trigger {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
}

.pend-chip {
  width: 26px;
  height: 26px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  gap: 3px;
}

.pend-chip svg { flex-shrink: 0; }


/* Tabs bar */
.ficha-tabs-bar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-4);
  padding: 0 2px;
  border-bottom: 1px solid rgba(27,43,75,0.08);
  background: var(--bg);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  box-shadow: none;
  margin-bottom: 20px;
  position: relative;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  padding: 0 var(--space-4);
  padding-top: var(--space-2);
}

.ficha-tabs {
  display: flex;
  gap: 18px;
  background: transparent;
  padding: 0;
}

.ficha-tab {
  padding: 10px 0;
  border: none;
  background: transparent;
  font-size: 14px;
  font-weight: var(--weight-medium);
  color: var(--text-cool);
  cursor: pointer;
  font-family: var(--font);
  transition: color 150ms;
  white-space: nowrap;
  border-radius: 0;
  position: relative;
}

.ficha-tabs .ficha-tab:not(.ficha-tab-active) {
  color: var(--text-cool);
  font-weight: var(--weight-medium);
}

.ficha-tab:hover {
  color: var(--text-ink);
  background: transparent;
}

.ficha-tab-active {
  color: var(--text-ink);
  font-weight: var(--weight-semibold);
  background: transparent;
  box-shadow: none;
}

.ficha-tab-active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 2px;
  background: rgba(123,108,168,0.40);
  border-radius: 2px 2px 0 0;
}

#ficha-tab-action {
  padding-right: 0;
  display: flex;
  align-items: flex-end;
}

#ficha-tab-action.ficha-tab-action-has-cta {
  padding-bottom: 8px;
}

/* Tab content */
.ficha-tab-content {
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  min-height: 0;
}

/* Tabela de consultas e cobranças */
.ficha-table {
  width: 100%;
  border-collapse: collapse;
}

.ficha-table thead th {
  padding: 11px 16px;
  font-size: 11px;
  font-weight: var(--weight-medium);
  color: var(--text-muted);
  text-align: left;
  border-bottom: 1px solid rgba(27,43,75,0.07);
  background: rgba(27,43,75,0.015);
  white-space: nowrap;
}

.ficha-table tbody td {
  padding: 0 16px;
  height: 46px;
  font-size: 13px;
  color: var(--text-ink);
  border-bottom: 1px solid rgba(27,43,75,0.05);
  vertical-align: middle;
  line-height: 1;
}

.ficha-table tbody tr:last-child td { border-bottom: none; }

.ficha-table-row { transition: background 100ms; }
.ficha-table-row:hover { background: rgba(27,43,75,0.02); }

.ficha-td-main {
  display: block;
  font-weight: var(--weight-medium);
  color: var(--text-ink);
}

.ficha-td-sub {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 1px;
}

.ficha-td-valor-num { font-weight: var(--weight-semibold); }

.ficha-td-data { white-space: nowrap; }
.ficha-td-actions { white-space: nowrap; vertical-align: middle; }
.ficha-td-nf { white-space: nowrap; }

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

.ficha-actions-wrap .row-action-btn svg { display: block; }

/* Badge de status clicável (cobranças) */
.ficha-cob-status {
  cursor: pointer;
  border: none;
  font-family: var(--font);
  font-size: 12px;
  font-weight: var(--weight-medium);
  padding: 0 8px;
  min-height: 24px;
  border-radius: var(--radius-pill);
}

.ficha-nf-link {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 10px;
  border: none;
  border-radius: var(--radius-pill);
  background: rgba(124,107,200,0.08);
  color: #6f5ec0;
  font-size: 12px;
  font-weight: var(--weight-medium);
  cursor: pointer;
  transition: background 150ms ease, color 150ms ease;
}

.ficha-nf-link:hover {
  text-decoration: none;
  background: rgba(124,107,200,0.12);
  color: #6859b2;
}

/* Dropdown de mais opções */
.ficha-dropdown-wrap { position: relative; }
.ficha-dd-excluir { color: #c85e66; }
.ficha-dd-excluir:hover { background: rgba(209,106,106,0.08); }

/* Empty state da aba */
.ficha-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 220px;
  padding: var(--space-8) var(--space-6);
  color: var(--text-cool);
  font-size: 14px;
  background: rgba(255,255,255,0.58);
  border: 1px dashed rgba(123,108,168,0.16);
  border-radius: 18px;
}

/* Aba Cadastro */
.ficha-cadastro {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.ficha-form-group {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 18px 20px;
  border: 1px solid rgba(123,108,168,0.08);
  border-radius: 18px;
  background: rgba(255,255,255,0.68);
}

.ficha-cadastro .form-section-title {
  margin: 0 0 14px;
  color: var(--text-cool);
  font-size: 11px;
  letter-spacing: 0.06em;
}

.ficha-cadastro .field label {
  font-size: 12px;
  color: var(--text-cool);
  font-weight: var(--weight-medium);
}

.ficha-cadastro input[type="text"],
.ficha-cadastro input[type="email"],
.ficha-cadastro input[type="number"],
.ficha-cadastro input[type="date"],
.ficha-cadastro select,
.ficha-cadastro textarea {
  border-color: rgba(123,108,168,0.12);
  border-radius: 14px;
  background: rgba(255,255,255,0.84);
  color: var(--text-ink);
}

.ficha-cadastro input:focus,
.ficha-cadastro select:focus,
.ficha-cadastro textarea:focus {
  border-color: rgba(123,108,168,0.24);
  box-shadow: 0 0 0 3px rgba(124,107,200,0.10);
}

.ficha-cadastro textarea {
  min-height: 96px;
}

.ficha-servicos-table {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.ficha-servico-row {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: var(--space-4);
  padding: 14px 0;
  border-bottom: 1px solid rgba(123,108,168,0.08);
}

.ficha-servico-row:last-child { border-bottom: none; }

.ficha-servico-name {
  font-size: 14px;
  font-weight: var(--weight-semibold);
  color: var(--text-ink);
}

.ficha-servico-default {
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-cool);
}

.ficha-servico-field {
  min-width: 170px;
}

.ficha-cadastro-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 20px;
  border-top: 1px solid rgba(123,108,168,0.08);
  margin-top: 4px;
}

/* WhatsApp button na ficha — sem cor especial */
.ficha-wa-btn { color: var(--text-muted); }

/* Card de tabela na ficha — sem overflow hidden para popovers funcionarem */
.ficha-table-card {
  padding: 0;
  overflow: visible;
  position: relative;
}
.ficha-table-card .ficha-table {
  border-radius: 0;
  overflow: visible;
}
.ficha-table-card .ficha-table thead th:first-child { border-radius: var(--radius-lg) 0 0 0; }
.ficha-table-card .ficha-table thead th:last-child  { border-radius: 0 var(--radius-lg) 0 0; }
.ficha-table-card .ficha-table tbody tr:last-child td:first-child { border-radius: 0 0 0 var(--radius-lg); }
.ficha-table-card .ficha-table tbody tr:last-child td:last-child  { border-radius: 0 0 var(--radius-lg) 0; }

/* Status inline de agendamento */
.ficha-status-ag-btn {
  cursor: pointer;
  border: none;
  font-family: var(--font);
}
.ficha-status-ag-pop {
  left: 0;
  right: auto;
  min-width: 140px;
}
.action-pop-item-active {
  font-weight: var(--weight-semibold);
  color: var(--navy);
}

/* Responsive */
@media (max-width: 840px) {
  .ficha-kpi-bar { flex-wrap: wrap; }
  .ficha-kpi-item { flex: 0 0 calc(50% - 1px); }
  .ficha-kpi-divider:nth-child(4) { display: none; }
}

@media (max-width: 640px) {
  .ficha-wrap { gap: var(--space-4); }
  .ficha-header-inner { flex-wrap: wrap; }
  .ficha-nome { font-size: 26px; }
  .ficha-summary-grid { grid-template-columns: 1fr; }
  .ficha-tabs-bar { flex-direction: column; align-items: stretch; gap: 10px; }
  .ficha-tabs { width: 100%; overflow-x: auto; gap: 16px; }
  #ficha-tab-action { width: 100%; padding: 0; }
  #ficha-tab-action.ficha-tab-action-has-cta { padding-bottom: 0; }
  #ficha-tab-action .btn-cta { width: 100%; justify-content: center; }
  .ficha-servico-row { flex-direction: column; align-items: stretch; }
  .ficha-servico-field { min-width: 0; }
}

.btn-sm { height: 28px; padding: 0 var(--space-3); font-size: var(--size-xs); }

/* ============================================================
   Pacientes — grupos por médico (master-detail)
   ============================================================ */

/* Estado inicial — lista full width */
.pac-grupos-card {
  padding: 0;
  overflow: hidden;
}
.pac-grupos-titulo {
  padding: 18px var(--space-6) 14px;
  font-size: var(--size-xs);
  font-weight: var(--weight-medium);
  color: var(--text-xmuted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid rgba(123,108,168,0.08);
}
.pac-grupos-lista {
  display: flex;
  flex-direction: column;
}

/* Estado split — 2 colunas */
.pac-grupos-split {
  padding: 0;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
  height: calc(100vh - var(--topbar-h) - var(--space-8) * 2);
  max-height: 800px;
}
.pac-grupos-col-medicos {
  display: flex;
  flex-direction: column;
  border-right: 1px solid rgba(123,108,168,0.08);
  overflow-y: auto;
}
.pac-grupos-col-pacientes {
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  min-height: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.72), rgba(255,255,255,0.52));
}
.pac-grupos-pac-header {
  padding: var(--space-5) var(--space-6) var(--space-4);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.pac-grupos-pac-titulo {
  display: block;
  font-size: var(--size-base);
  font-weight: var(--weight-semibold);
  color: var(--text);
}
.pac-grupos-pac-sub {
  font-size: var(--size-xs);
  color: var(--text-muted);
}
.pac-grupos-pac-topbar {
  display: flex;
  justify-content: flex-end;
  padding: var(--space-3) var(--space-4) var(--space-2);
  border-bottom: 1px solid rgba(123,108,168,0.08);
  flex-shrink: 0;
}

/* Item de médico (reutilizado nos dois estados) */
.pac-grupo-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px var(--space-6);
  cursor: pointer;
  user-select: none;
  transition: background 140ms ease, box-shadow 140ms ease;
  border-bottom: 1px solid rgba(123,108,168,0.08);
}
.pac-grupo-item:last-child { border-bottom: none; }
.pac-grupo-item:hover { background: var(--surface-tint); }
.pac-grupo-item-ativo {
  background: var(--surface-tint-hover);
  box-shadow: inset 2px 0 0 rgba(124,107,200,0.24);
}
.pac-grupo-left {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.pac-grupo-nome {
  font-size: var(--size-base);
  font-weight: var(--weight-medium);
  color: var(--text-ink);
}
.pac-grupo-esp {
  font-size: var(--size-xs);
  color: var(--text-cool);
}
.pac-grupo-right {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--text-xmuted);
}
.pac-grupo-count {
  font-size: var(--size-xs);
  color: var(--text-cool);
}
.pac-grupo-loading {
  padding: var(--space-4) var(--space-5);
  font-size: var(--size-sm);
  color: var(--text-muted);
}

/* Lista de pacientes (sem tabela) */
.pac-list {
  display: flex;
  flex-direction: column;
}
.pac-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px var(--space-6);
  cursor: pointer;
  position: relative;
  transition: background 140ms ease;
  gap: var(--space-4);
  min-height: 72px;
}
.pac-row:not(:last-child)::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: var(--space-6);
  right: var(--space-6);
  height: 1px;
  background: rgba(123,108,168,0.08);
}
.pac-row:hover { background: rgba(124,107,200,0.04); }
.pac-row-left {
  display: flex;
  align-items: flex-start;
  min-width: 0;
  flex: 1;
}
.pac-row-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.pac-row-nome {
  font-size: var(--size-base);
  font-weight: var(--weight-semibold);
  color: var(--text-ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pac-row-sub {
  font-size: 12px;
  color: var(--text-cool);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pac-row-right {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-shrink: 0;
}
.pac-row-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}
.pac-row-valor {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  min-width: 92px;
  text-align: right;
}
.pac-row-valor-text {
  font-size: 13px;
  font-weight: var(--weight-medium);
  color: var(--text-ink);
  line-height: 1.1;
}
.pac-row-valor-label {
  font-size: 10px;
  font-weight: var(--weight-medium);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-soft);
  line-height: 1;
}
.pac-row-valor-empty {
  color: var(--text-xmuted);
}

/* Layout 2 colunas — card único com divisor */
.pac-2col-card {
  padding: 0;
  overflow: hidden;
  display: grid;
  grid-template-columns: 1fr 0px;
  min-height: 300px;
  height: calc(100vh - var(--topbar-h) - var(--space-8) * 2);
  max-height: 800px;
  transition: grid-template-columns 220ms ease;
}
.pac-2col-card.pac-painel-aberto {
  grid-template-columns: minmax(0, 1.06fr) minmax(360px, 0.94fr);
}
.pac-col-lista {
  display: flex;
  flex-direction: column;
  border-right: 0 solid var(--border);
  overflow: hidden;
  min-height: 0;
  height: 100%;
  transition: border-right-width 220ms ease;
}
.pac-2col-card.pac-painel-aberto .pac-col-lista {
  border-right-width: 1px;
}
.pac-col-lista .pac-medico-header {
  border-radius: 0;
  flex-shrink: 0;
}
.pac-col-lista .pac-list {
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}
.pac-col-painel {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(255,255,255,0.72), rgba(255,255,255,0.50));
  opacity: 0;
  transition: opacity 180ms ease 40ms;
}
.pac-2col-card.pac-painel-aberto .pac-col-painel {
  opacity: 1;
}
.pac-painel-vazio {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  padding: var(--space-10);
  flex: 1;
  color: var(--text-muted);
  font-size: var(--size-sm);
}
.pac-painel-loading {
  padding: var(--space-6);
  font-size: var(--size-sm);
  color: var(--text-cool);
}
.pac-painel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px var(--space-5) 16px;
  border-bottom: 1px solid rgba(123,108,168,0.08);
  position: sticky;
  top: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.90), rgba(255,255,255,0.82));
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  z-index: 5;
  flex-shrink: 0;
}
.pac-painel-nome {
  font-size: var(--size-base);
  font-weight: var(--weight-semibold);
  color: var(--text-ink);
  margin-bottom: 2px;
}
.pac-painel-link {
  font-size: var(--size-xs);
  color: var(--text-cool);
  text-decoration: none;
}
.pac-painel-link:hover { color: var(--text-ink); }
.pac-painel-body {
  padding: var(--space-3) var(--space-5) var(--space-5);
  overflow-y: auto;
}
.pac-painel-body-edicao {
  overflow-y: auto;
  min-height: 0;
  flex: 1;
  padding: var(--space-3) var(--space-5) var(--space-5);
}
.pac-painel-footer {
  padding: var(--space-3) var(--space-5) var(--space-4);
  border-top: 1px solid rgba(123,108,168,0.08);
  display: flex;
  justify-content: flex-end;
}
.pac-row-active {
  background: rgba(124,107,200,0.07) !important;
}
.pac-row-chevron {
  color: var(--text-xmuted);
  flex-shrink: 0;
  opacity: 0;
  transform: translateX(-2px);
  transition: opacity 140ms ease, transform 140ms ease;
}
.pac-row:hover .pac-row-chevron,
.pac-row-active .pac-row-chevron {
  opacity: 1;
  transform: translateX(0);
}

/* Modo leitura do painel */
.pac-leitura {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.pac-leitura-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 var(--space-5);
}
.pac-leitura-col {
  display: flex;
  flex-direction: column;
}
.pac-leitura-linha {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  padding: 14px 0;
  font-size: var(--size-base);
  color: var(--text-ink);
  border-bottom: 1px solid rgba(123,108,168,0.08);
}
.pac-leitura-linha:last-child { border-bottom: none; }
.pac-leitura-vazio {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 14px 0;
  font-size: var(--size-base);
  color: var(--text-xmuted);
  border-bottom: 1px solid rgba(123,108,168,0.08);
}
.pac-leitura-vazio:last-child { border-bottom: none; }
.pac-ic {
  color: var(--text-xmuted);
  flex-shrink: 0;
  margin-top: 3px;
}
.pac-leitura-obs {
  font-size: var(--size-sm);
  color: var(--text-cool);
  padding: var(--space-4);
  border: 1px solid rgba(123,108,168,0.08);
  border-radius: 14px;
  background: rgba(255,255,255,0.56);
  white-space: pre-wrap;
}

/* Botão excluir na linha */
.pac-del-btn {
  opacity: 0;
  transform: translateX(-2px);
  transition: opacity 120ms ease, transform 120ms ease;
  color: var(--text-muted);
}
.pac-del-btn:hover { color: #DC2626; }
.pac-row:hover .pac-del-btn {
  opacity: 1;
  transform: translateX(0);
}

/* ============================================================
   Pacientes — container único com médico (modo filtrado)
   ============================================================ */
.pac-filtro-card {
  padding: 0;
  overflow: hidden;
}
.pac-medico-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: linear-gradient(180deg, rgba(255,255,255,0.90), rgba(255,255,255,0.82));
  border-bottom: 1px solid rgba(123,108,168,0.08);
  padding: var(--space-6) var(--space-6);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.pac-medico-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  flex-wrap: wrap;
}
.pac-medico-header-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.pac-medico-header-nome {
  font-size: var(--size-md);
  font-weight: var(--weight-semibold);
  color: var(--text-ink);
}
.pac-medico-header-sub {
  font-size: var(--size-sm);
  color: var(--text-cool);
}
.pac-medico-header-prefs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.pac-status-badge {
  height: 20px;
  padding: 0 7px;
  border: 1px solid transparent;
  font-size: 10px;
  font-weight: var(--weight-medium);
  letter-spacing: 0.01em;
  line-height: 1;
}

.pac-status-lead {
  background: var(--patient-status-lead-bg);
  border-color: var(--patient-status-lead-border);
  color: var(--patient-status-lead);
}

.pac-status-ativo {
  background: var(--patient-status-active-bg);
  border-color: var(--patient-status-active-border);
  color: var(--patient-status-active);
}

.pac-status-inativo {
  background: var(--patient-status-inactive-bg);
  border-color: var(--patient-status-inactive-border);
  color: var(--patient-status-inactive);
}

/* Card resumo legado (mantido para outros usos) */
.medico-resumo-card {
  padding: var(--space-5);
  margin-bottom: 0;
}
.medico-resumo-header {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
}
.medico-resumo-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.medico-resumo-nome {
  font-size: var(--size-md);
  font-weight: var(--weight-semibold);
  color: var(--text);
}
.medico-resumo-sub {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--size-sm);
  color: var(--text-muted);
  flex-wrap: wrap;
}
.medico-resumo-sep {
  color: var(--text-xmuted);
}
.medico-resumo-prefs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-2);
  padding-top: var(--space-4);
  border-top: 1px solid var(--border);
}
.medico-pref-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: var(--size-xs);
  color: var(--text-muted);
  background: var(--bg);
  border-radius: var(--radius-pill);
  padding: 3px 10px;
}
.medico-pref-item svg { flex-shrink: 0; }
.medico-pref-dias {
  display: flex;
  align-items: center;
  gap: 3px;
  margin-left: var(--space-1);
}
.medico-card-dia {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: var(--weight-medium);
  color: var(--text-xmuted);
  background: transparent;
}
.medico-card-dia-ativo {
  background: var(--navy-light);
  color: var(--navy);
}
