﻿/* ============================================================
   pos-tratamento.css
   Design system for CRC Pós Tratamento – Clínica AMA
   Fonts: Instrument Serif (titles/KPIs) + Geist (body)
   ============================================================ */

/* ── Google Fonts import ─────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Instrument+Serif&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Geist:wght@300;400;500;600;700&display=swap');

/* ── CSS custom properties ───────────────────────────────── */
:root {
  --color-a:          #1E8449;
  --color-b:          #1A5276;
  --color-c:          #6B6A64;
  --color-accent:     #1E8449;
  --color-amber:      #D97706;
  --color-red:        #DC2626;
  --color-bg:         #F8F9FA;
  --color-surface:    #FFFFFF;
  --color-border:     #E5E7EB;
  --color-text:       #111827;
  --color-text-muted: #6B7280;
}
/* ── Dark / Light theme (CRM tokens) ────────────────────── */
[data-theme="dark"] {
  --bg:  #0f1117; --bg2: #181b24; --bg3: #1e2230; --border: #2a2f42;
  --text: #e8eaf0; --muted: #6b7280; --accent: #4f8ef7;
  --color-bg:         #0f1117;
  --color-surface:    #181b24;
  --color-border:     #2a2f42;
  --color-text:       #e8eaf0;
  --color-text-muted: #9ca3af;
}
[data-theme="light"] {
  --bg:  #f7f8fa; --bg2: #ffffff; --bg3: #f1f3f7; --border: #e3e6ed;
  --text: #1a1d29; --muted: #6b7280; --accent: #3b82f6;
  --color-bg:         #F8F9FA;
  --color-surface:    #FFFFFF;
  --color-border:     #E5E7EB;
  --color-text:       #111827;
  --color-text-muted: #6B7280;
}

/* ── Shell layout ────────────────────────────────────────── */
.shell { display: flex; height: 100vh; overflow: hidden; }

/* ── CRM Sidebar ─────────────────────────────────────────── */
.crm-nav {
  width: 220px; min-width: 220px; background: var(--bg2);
  border-right: 1px solid var(--border);
  padding: 22px 14px; display: flex; flex-direction: column;
  gap: 4px; flex-shrink: 0; height: 100vh; overflow-y: auto;
}
.logo { font-size: 18px; font-weight: 700; padding: 6px 12px 22px; letter-spacing: -.4px; color: var(--text); }
.logo span { color: var(--accent); }
.nav-btn {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px;
  border-radius: 8px; cursor: pointer; font-size: 13.5px; font-weight: 500;
  color: var(--muted); border: none; background: none; width: 100%;
  text-align: left; transition: all .15s; text-decoration: none; font-family: inherit;
}
.nav-btn:hover { background: var(--bg3); color: var(--text); }
.nav-btn--section { font-weight: 600; color: var(--text); }
.nav-icon { width: 16px; height: 16px; flex-shrink: 0; }
.nav-section { display: flex; flex-direction: column; }
.nav-submenu { padding-left: 10px; display: flex; flex-direction: column; gap: 2px; margin-top: 2px; }
.nav-subitem {
  display: flex; align-items: center; padding: 7px 12px; border-radius: 8px;
  font-size: 13px; color: var(--muted); text-decoration: none; transition: all .15s;
}
.nav-subitem:hover { background: var(--bg3); color: var(--text); }
.nav-subitem--active { background: var(--accent); color: #fff; font-weight: 600; }
.nav-subitem--active:hover { background: var(--accent); color: #fff; }
.nav-logout { margin-top: 8px; }
.theme-btn {
  margin-top: auto; padding: 9px 12px; background: var(--bg3); color: var(--text);
  border: 1px solid var(--border); border-radius: 8px; cursor: pointer;
  font-size: 13px; font-weight: 500; font-family: inherit;
  display: flex; align-items: center; justify-content: center;
  gap: 8px; transition: all .15s;
}
.theme-btn:hover { background: var(--border); }

/* ── Main area ───────────────────────────────────────────── */
.crm-main { flex: 1; overflow-x: hidden; overflow-y: auto; height: 100vh; background: var(--color-bg); }


/* ── 1. Base reset ───────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: 'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

/* ── 2. Layout ───────────────────────────────────────────── */
.page-layout {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 2rem;
}

.page-title {
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: 2rem;
  font-weight: 400;
  margin: 0;
  color: var(--color-text);
}

.page-subtitle {
  color: var(--color-text-muted);
  font-size: 0.9rem;
  margin-top: 0.25rem;
  margin-bottom: 0;
}

/* ── 3. KPI cards ────────────────────────────────────────── */
.kpi-row {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
}

.kpi-card {
  flex: 1;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.kpi-card__label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
}

.kpi-card__value {
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: 2.5rem;
  font-weight: 400;
  line-height: 1;
  color: var(--color-text);
}

.kpi-card__value--green { color: var(--color-a); }
.kpi-card__value--amber { color: var(--color-amber); }
.kpi-card__value--red   { color: var(--color-red); }

/* ── 4. Template bar ─────────────────────────────────────── */
.template-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: #F0FDF4;
  border: 1px solid #BBF7D0;
  border-radius: 8px;
  padding: 0.75rem 1rem;
  margin-bottom: 1.5rem;
}

.template-bar__icon {
  font-size: 1.1rem;
}

.template-bar__label {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-a);
  white-space: nowrap;
}

.template-bar__preview {
  flex: 1;
  color: var(--color-text-muted);
  font-size: 0.875rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── 5. Calendar strip ───────────────────────────────────── */
.calendar-strip {
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  gap: 0.5rem;
  margin-bottom: 2rem;
}

.strip-cell {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 0.75rem 0.5rem;
  text-align: center;
  cursor: pointer;
  transition: background 0.15s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
}

.strip-cell:hover {
  background: #F3F4F6;
}

.strip-cell--hoje {
  border-color: var(--color-accent);
  border-width: 2px;
}

.strip-cell--selected {
  background: #F0FDF4;
  border-color: var(--color-a);
}

.strip-cell__dia-sem {
  font-size: 0.65rem;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.strip-cell__dia-num {
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--color-text);
}

.strip-cell__mes {
  font-size: 0.65rem;
  color: var(--color-text-muted);
}

.strip-cell__dots {
  display: flex;
  gap: 3px;
  justify-content: center;
  min-height: 10px;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.strip-cell__count {
  font-size: 0.7rem;
  color: var(--color-text-muted);
}

/* ── 6. List sections ────────────────────────────────────── */
.list-section {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 1.5rem;
}

.list-section__title {
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: 1.3rem;
  font-weight: 400;
  margin: 0 0 1rem 0;
  color: var(--color-text);
}

/* ── 7. Patient cards ────────────────────────────────────── */
.patient-card {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1rem;
  border-bottom: 1px solid var(--color-border);
}

.patient-card:last-child {
  border-bottom: none;
}

.patient-card__avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  color: white;
  font-weight: 600;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.patient-card__info {
  flex: 1;
}

.patient-card__info strong {
  display: block;
  font-size: 0.95rem;
}

.patient-card__meta {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  display: block;
  margin-top: 0.2rem;
}

.patient-card__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.5rem;
}
/* ── 8. Data table ───────────────────────────────────────── */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.data-table th {
  text-align: left;
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-muted);
  padding: 0.75rem 1rem;
  border-bottom: 2px solid var(--color-border);
}

.data-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--color-border);
  vertical-align: middle;
}

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

.data-table tr:hover td {
  background: #F9FAFB;
}

/* ── 9. Badges ───────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
}

.badge--classe      { color: white; }
.badge--classe-a    { background: var(--color-a); color: white; }
.badge--classe-b    { background: var(--color-b); color: white; }
.badge--classe-c    { background: var(--color-c); color: white; }
.badge--agenda      { background: #DBEAFE; color: #1E40AF; }
.badge--sem-agenda  { background: #F3F4F6; color: var(--color-text-muted); }
.badge--amber       { background: #FEF3C7; color: #92400E; }
.badge--red         { background: #FEE2E2; color: #991B1B; }

/* ── 10. Controls ────────────────────────────────────────── */
.controls-row {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 1rem;
}

.tabs {
  display: flex;
  gap: 0.5rem;
}

.tab {
  background: transparent;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  padding: 0.5rem 1.1rem;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
  color: var(--color-text);
}

.tab--active {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: white;
  font-weight: 600;
}

.chip-group {
  display: flex;
  gap: 0.5rem;
}

.chip {
  background: #F3F4F6;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  padding: 0.3rem 0.85rem;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  color: var(--color-text-muted);
  font-family: inherit;
}

.chip--active {
  background: var(--color-a);
  border-color: var(--color-a);
  color: white;
}

/* ── 11. Progress ────────────────────────────────────────── */
.progress-row {
  margin-bottom: 1rem;
}

.progress-label {
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

/* ── 12. Buttons ─────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  border: none;
  font-family: inherit;
  font-size: 0.875rem;
  padding: 0.6rem 1.2rem;
  text-decoration: none;
}

.btn--primary {
  background: var(--color-accent);
  color: white;
}

.btn--primary:hover {
  opacity: 0.88;
}

.btn--success {
  background: #059669;
  color: white;
}

.btn--success:hover {
  opacity: 0.88;
}

.btn--danger {
  background: var(--color-red);
  color: white;
}

.btn--danger:hover {
  opacity: 0.88;
}

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

.btn--ghost:hover {
  background: #F3F4F6;
}

.btn--whatsapp {
  background: #25D366;
  color: white;
}

.btn--whatsapp:hover {
  opacity: 0.88;
}

.btn--sm {
  padding: 0.4rem 0.85rem;
  font-size: 0.8rem;
}

.btn--xs {
  padding: 0.25rem 0.6rem;
  font-size: 0.72rem;
  border-radius: 6px;
}

.btn:disabled {
  opacity: 0.5;
  cursor: default;
}

/* ── 13. Batch mark wrapper ──────────────────────────────── */
.btn-marcar-wrap {
  margin-top: 1.5rem;
  display: flex;
  justify-content: flex-end;
}

.hidden {
  display: none !important;
}

/* ── 14. VIP grid ────────────────────────────────────────── */
.vip-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
}

.vip-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  overflow: hidden;
}

.vip-card__header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  border-bottom: 1px solid var(--color-border);
}

.vip-card__name-block {
  flex: 1;
  min-width: 0;
}

.vip-card__name-block strong {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.vip-card__name-block small {
  color: var(--color-text-muted);
  font-size: 0.78rem;
}

.vip-card__remove {
  margin-left: auto;
  flex-shrink: 0;
}

.vip-card__body {
  padding: 0.75rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.vip-card__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.vip-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  font-size: 0.78rem;
  color: var(--color-text-muted);
}

.vip-card__obs {
  font-size: 0.82rem;
  color: var(--color-text-muted);
  border-top: 1px solid var(--color-border);
  padding-top: 0.5rem;
}

.vip-card__footer {
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--color-border);
}

/* ── 15. Modals ──────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.modal {
  background: var(--color-surface);
  border-radius: 16px;
  padding: 2rem;
  width: 100%;
  max-width: 480px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

.modal__title {
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: 1.4rem;
  font-weight: 400;
  margin: 0 0 1rem 0;
  color: var(--color-text);
}

.modal__hint {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  margin-bottom: 0.75rem;
}

.modal__textarea,
.modal__input {
  width: 100%;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 0.65rem;
  font-family: inherit;
  font-size: 0.875rem;
  resize: vertical;
  box-sizing: border-box;
  color: var(--color-text);
  background: var(--color-surface);
}

.modal__input {
  resize: none;
}

.modal__textarea:focus,
.modal__input:focus {
  outline: 2px solid var(--color-accent);
  outline-offset: -1px;
  border-color: var(--color-accent);
}

.modal__label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
  color: var(--color-text);
}

.modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 1.25rem;
}

/* ── 16. Search results ──────────────────────────────────── */
.search-results {
  margin-top: 0.5rem;
  max-height: 200px;
  overflow-y: auto;
}

.search-result-item {
  display: flex;
  flex-direction: column;
  padding: 0.6rem 0.75rem;
  cursor: pointer;
  border-radius: 6px;
  gap: 0.1rem;
}

.search-result-item:hover {
  background: #F3F4F6;
}

.search-result-item strong {
  font-size: 0.875rem;
}

.search-result-item small {
  color: var(--color-text-muted);
  font-size: 0.78rem;
}

.selected-patient {
  background: #F0FDF4;
  border: 1px solid #BBF7D0;
  border-radius: 6px;
  padding: 0.5rem 0.75rem;
  margin-top: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.obs-wrap {
  margin-top: 1rem;
}

.search-empty,
.search-error {
  font-size: 0.83rem;
  color: var(--color-text-muted);
  padding: 0.5rem 0;
  text-align: center;
}

/* ── 17. Pagination ──────────────────────────────────────── */
.pagination {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-top: 1rem;
  justify-content: center;
}

.page-btn {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  padding: 0.35rem 0.75rem;
  font-size: 0.82rem;
  cursor: pointer;
  font-family: inherit;
  color: var(--color-text);
}

.page-btn--active {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: white;
  font-weight: 600;
}

.page-btn:hover:not(.page-btn--active) {
  background: #F3F4F6;
}

/* ── 18. Inline obs editing ──────────────────────────────── */
.obs-inline-ta {
  width: 100%;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  padding: 0.4rem;
  font-family: inherit;
  font-size: 0.82rem;
  resize: vertical;
  box-sizing: border-box;
  margin-bottom: 0.4rem;
  color: var(--color-text);
  background: var(--color-surface);
}

.obs-inline-ta:focus {
  outline: 2px solid var(--color-accent);
  outline-offset: -1px;
  border-color: var(--color-accent);
}

.obs-inline-actions {
  display: flex;
  gap: 0.4rem;
  justify-content: flex-end;
}

/* ── 19. Confirm inline ──────────────────────────────────── */
.confirm-inline__text {
  font-size: 0.82rem;
  color: var(--color-red);
}

/* ── 20. Toasts ──────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  background: #111827;
  color: white;
  padding: 0.75rem 1.25rem;
  border-radius: 8px;
  font-size: 0.875rem;
  z-index: 200;
  animation: fadeInUp 0.2s ease;
}

.toast--error {
  background: var(--color-red);
}

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

/* ── 21. Empty state ─────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--color-text-muted);
}

.empty-state p {
  font-size: 1rem;
  margin-bottom: 0.5rem;
}

.empty-state__hint {
  font-size: 0.85rem;
  color: var(--color-text-muted);
}
/* ============================================================
   ADDENDUM – CRC nav + Curva ABC + Aniversariantes (new design)
   ============================================================ */

/* ── CRC Sidebar ─────────────────────────────────────────── */
.crc-logo {
  display: flex; flex-direction: column; gap: 2px;
  padding: 14px 4px 20px;
}
.crc-logo__clinic {
  font-size: 17px; font-weight: 700; color: var(--color-text); letter-spacing: -.3px;
}
.crc-logo__sub {
  font-size: 10px; font-weight: 600; letter-spacing: .08em;
  text-transform: uppercase; color: var(--color-text-muted);
}
.nav-group-label {
  font-size: 10px; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: var(--color-text-muted);
  padding: 0 4px; margin-bottom: 4px; margin-top: 4px;
}
.nav-badge {
  margin-left: auto; background: var(--color-a); color: #fff;
  font-size: 10px; font-weight: 700; padding: 2px 7px;
  border-radius: 999px; white-space: nowrap;
}
.nav-spacer { flex: 1; min-height: 16px; }
.nav-actions {
  display: flex; flex-direction: column; gap: 4px; padding: 4px 0;
  border-top: 1px solid var(--color-border); margin-top: 8px; padding-top: 12px;
}
.nav-action-btn {
  display: flex; align-items: center; gap: 8px;
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: 8px; padding: 8px 10px; cursor: pointer;
  font-size: 12px; font-weight: 500; color: var(--color-text);
  font-family: inherit; transition: all .15s; width: 100%; text-align: left;
}
.nav-action-btn svg { width: 13px; height: 13px; flex-shrink: 0; }
.nav-action-btn:hover { background: var(--color-bg); border-color: var(--color-a); }
.nav-action-btn:disabled { opacity: .5; cursor: default; }
.nav-timestamp {
  font-size: 10px; color: var(--color-text-muted);
  padding: 2px 4px; margin-top: 2px;
}

/* ── KPI addons ──────────────────────────────────────────── */
.kpi-card--featured {
  background: var(--color-a); color: #fff;
}
.kpi-card--featured .kpi-card__label { color: rgba(255,255,255,.75); }
.kpi-card--featured .kpi-card__value { color: #fff; }
.kpi-card__sub {
  font-size: 0.72rem; color: var(--color-text-muted); margin-top: 2px;
}
.kpi-card--featured .kpi-card__sub { color: rgba(255,255,255,.7); }
.kpi-big {
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: 2.5rem; line-height: 1; display: block;
}
.kpi-dots {
  font-size: 0.76rem; color: rgba(255,255,255,.85);
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 6px;
}
.kpi-dot {
  display: inline-block; width: 9px; height: 9px; border-radius: 50%;
}
.kpi-dots-row {
  display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 4px; font-size: 0.76rem;
  color: var(--color-text-muted);
}

/* ── Aniversariantes layout ──────────────────────────────── */
.kpi-row--aniv { flex-wrap: wrap; }
.kpi-card--aniv-hoje { min-width: 180px; }
.aniv-layout {
  display: grid; grid-template-columns: 380px 1fr; gap: 1.5rem; margin-top: 1.5rem;
}
@media (max-width: 900px) { .aniv-layout { grid-template-columns: 1fr; } }

/* Calendar panel */
.aniv-cal-panel {
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: 12px; padding: 1.25rem; display: flex; flex-direction: column; gap: .5rem;
}
.cal-header {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: .25rem;
}
.cal-month-label {
  font-size: 0.85rem; font-weight: 700; letter-spacing: .04em;
}
.cal-nav-btn {
  background: none; border: 1px solid var(--color-border); border-radius: 6px;
  width: 28px; height: 28px; cursor: pointer; font-size: 1.1rem;
  color: var(--color-text); line-height: 1; padding: 0; font-family: inherit;
  display: flex; align-items: center; justify-content: center;
}
.cal-nav-btn:hover { background: var(--color-bg); }
.cal-weekdays {
  display: grid; grid-template-columns: repeat(7, 1fr);
  text-align: center;
}
.cal-weekdays span {
  font-size: 0.65rem; font-weight: 700; letter-spacing: .06em;
  color: var(--color-text-muted); text-transform: uppercase; padding: 4px 0;
}
.aniv-calendar {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px;
}
.cal-cell {
  border-radius: 8px; padding: 4px 2px 5px; text-align: center;
  cursor: pointer; transition: background .12s; position: relative;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  min-height: 52px;
}
.cal-cell:hover { background: var(--color-bg); }
.cal-cell--empty { cursor: default; }
.cal-cell--today {
  background: var(--color-a); color: #fff; border-radius: 8px;
}
.cal-cell--today .cal-day-num { color: #fff; }
.cal-cell--selected {
  background: #e8f5e9; border: 1.5px solid var(--color-a);
}
[data-theme="dark"] .cal-cell--selected { background: rgba(30,132,73,.15); }
.cal-day-num {
  font-size: 0.82rem; font-weight: 600; color: var(--color-text); line-height: 1.2;
}
.cal-badge {
  font-size: 0.6rem; font-weight: 700; background: var(--color-a); color: #fff;
  border-radius: 999px; padding: 1px 5px; line-height: 1.4;
}
.cal-cell--today .cal-badge { background: rgba(255,255,255,.3); }
.cal-dots {
  display: flex; gap: 2px; justify-content: center;
}
.cal-dot {
  width: 5px; height: 5px; border-radius: 50%; display: inline-block;
}
.cal-legend {
  display: flex; gap: 12px; flex-wrap: wrap;
  font-size: 0.7rem; color: var(--color-text-muted); margin-top: 6px;
}
.cal-legend span { display: flex; align-items: center; gap: 4px; }

/* Patient list panel */
.aniv-list-panel {
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: 12px; padding: 1.25rem; display: flex; flex-direction: column; gap: .75rem;
}
.aniv-list-title {
  font-size: 0.75rem; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--color-text-muted);
}
.aniv-select-all {
  display: flex; align-items: center; gap: 8px;
  font-size: 0.85rem; color: var(--color-text); cursor: pointer;
  padding: 6px 0; border-bottom: 1px solid var(--color-border);
}
.aniv-row {
  display: flex; align-items: center; gap: .75rem;
  padding: .75rem 0; border-bottom: 1px solid var(--color-border);
}
.aniv-row:last-child { border-bottom: none; }
.aniv-avatar {
  width: 42px; height: 42px; border-radius: 50%; color: #fff;
  font-weight: 700; font-size: 0.9rem;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.aniv-info { flex: 1; min-width: 0; }
.aniv-name { font-size: 0.92rem; font-weight: 600; color: var(--color-text); }
.aniv-meta {
  display: flex; align-items: center; flex-wrap: wrap; gap: 6px;
  font-size: 0.75rem; color: var(--color-text-muted); margin-top: 4px;
}
.aniv-days { font-size: 0.75rem; font-weight: 600; }
.aniv-days--red   { color: var(--color-red); }
.aniv-days--amber { color: var(--color-amber); }
.aniv-days--green { color: var(--color-a); }
.aniv-agenda { color: var(--color-b); font-size: 0.75rem; }
.aniv-no-agenda { color: var(--color-text-muted); font-size: 0.75rem; }
.aniv-wa-btn {
  background: #25D366; color: #fff; border: none; border-radius: 8px;
  width: 36px; height: 36px; cursor: pointer; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; padding: 0;
}
.aniv-wa-btn:hover { opacity: .88; }
.aniv-wa-btn svg { width: 18px; height: 18px; }

/* ── Curva ABC styles ────────────────────────────────────── */
.abc-class-tabs { display: flex; gap: .4rem; }
.abc-tab {
  background: transparent; border: 1px solid var(--color-border);
  border-radius: 6px; padding: .4rem 1rem; font-size: .82rem; font-weight: 500;
  cursor: pointer; font-family: inherit; color: var(--color-text); transition: all .15s;
}
.abc-tab--active { background: var(--color-text); color: var(--color-surface); font-weight: 600; }
.abc-dist-section {
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: 12px; padding: 1.25rem 1.5rem; margin-bottom: 1.5rem;
}
.abc-dist-label {
  font-size: .68rem; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: var(--color-text-muted); margin-bottom: .75rem;
}
.abc-bar {
  height: 10px; border-radius: 5px; display: flex; overflow: hidden; margin-bottom: .75rem;
}
.abc-bar__a { background: var(--color-a); }
.abc-bar__b { background: var(--color-b); }
.abc-bar__c { background: var(--color-c); }
.abc-bar-legend {
  display: flex; flex-wrap: wrap; gap: 1.2rem; font-size: .75rem;
  color: var(--color-text-muted); margin-bottom: 1rem;
}
.abc-bar-legend span { display: flex; align-items: center; gap: 5px; }
.abc-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; }
.abc-dot--a { background: var(--color-a); }
.abc-dot--b { background: var(--color-b); }
.abc-dot--c { background: var(--color-c); }
.abc-cards-row { display: grid; grid-template-columns: repeat(3,1fr); gap: 1rem; }
.abc-summary-card {
  border-radius: 10px; padding: 1rem 1.25rem;
  border: 1px solid var(--color-border);
}
.abc-summary-card--a { background: rgba(30,132,73,.06); }
.abc-summary-card--b { background: rgba(26,82,118,.06); }
.abc-summary-card--c { background: var(--color-bg); }
.abc-summary-card__badge {
  display: inline-flex; width: 24px; height: 24px; border-radius: 50%;
  align-items: center; justify-content: center;
  font-size: .75rem; font-weight: 700; color: #fff; margin-bottom: .5rem;
}
.abc-summary-card--a .abc-summary-card__badge { background: var(--color-a); }
.abc-summary-card--b .abc-summary-card__badge { background: var(--color-b); }
.abc-summary-card--c .abc-summary-card__badge { background: var(--color-c); }
.abc-summary-card__count { font-weight: 700; font-size: .95rem; }
.abc-summary-card__ticket { font-size: .76rem; color: var(--color-text-muted); margin-top: 2px; }

.abc-list-section {
  background: var(--color-surface); border: 1px solid var(--color-border); border-radius: 12px;
  padding: 1.25rem 1.5rem;
}
.abc-list-header {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem;
}
.abc-list-title {
  font-size: .68rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--color-text-muted);
}
.abc-list-count { font-size: .78rem; color: var(--color-text-muted); }
.abc-search-row {
  display: flex; gap: .75rem; align-items: center; margin-bottom: 1rem;
}
.abc-search-wrap {
  flex: 1; display: flex; align-items: center; gap: .5rem;
  border: 1px solid var(--color-border); border-radius: 8px; padding: .5rem .75rem;
  background: var(--color-surface);
}
.abc-search-wrap svg { width: 15px; height: 15px; color: var(--color-text-muted); flex-shrink: 0; }
.abc-search-input {
  border: none; outline: none; background: transparent; font-family: inherit;
  font-size: .875rem; color: var(--color-text); flex: 1;
}
.abc-clear-btn {
  background: transparent; border: 1px solid var(--color-border); border-radius: 6px;
  padding: .4rem .85rem; font-size: .78rem; cursor: pointer; font-family: inherit;
  color: var(--color-text-muted); white-space: nowrap;
}
.abc-clear-btn:hover { background: var(--color-bg); }
.abc-filters {
  display: flex; gap: 1.5rem; flex-wrap: wrap; align-items: flex-start; margin-bottom: 1rem;
  padding-bottom: 1rem; border-bottom: 1px solid var(--color-border);
}
.abc-filter-group { display: flex; align-items: center; gap: .6rem; }
.abc-filter-label {
  font-size: .62rem; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--color-text-muted); white-space: nowrap;
}
.abc-chips { display: flex; gap: .35rem; flex-wrap: wrap; }
.abc-chip {
  border: 1px solid var(--color-border); border-radius: 999px;
  padding: .25rem .8rem; font-size: .75rem; font-weight: 600;
  cursor: pointer; font-family: inherit; color: var(--color-text-muted);
  background: transparent; transition: all .15s;
}
.abc-chip--active { border-color: currentColor; }
.abc-chip--a.abc-chip--active { color: var(--color-a); background: rgba(30,132,73,.08); }
.abc-chip--b.abc-chip--active { color: var(--color-b); background: rgba(26,82,118,.08); }
.abc-chip--c.abc-chip--active { color: var(--color-c); background: rgba(107,106,100,.08); }
.abc-chip--days.abc-chip--active { color: var(--color-red); background: rgba(220,38,38,.08); border-color: var(--color-red); }
.abc-chip--days180.abc-chip--active { color: var(--color-amber); background: rgba(217,119,6,.08); border-color: var(--color-amber); }
.abc-chip--days90.abc-chip--active { color: var(--color-a); background: rgba(30,132,73,.08); border-color: var(--color-a); }
.abc-chip--agenda.abc-chip--active { color: #1d4ed8; background: rgba(29,78,216,.08); border-color: #1d4ed8; }

.abc-table th:first-child, .abc-table td:first-child { width: 32px; padding-right: 0; }
.abc-patient-cell { display: flex; align-items: center; gap: .65rem; }
.abc-avatar {
  width: 36px; height: 36px; border-radius: 50%; color: #fff;
  font-weight: 700; font-size: .8rem; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.abc-avatar--a { background: var(--color-a); }
.abc-avatar--b { background: var(--color-b); }
.abc-avatar--c { background: var(--color-c); }
.abc-patient-name { font-weight: 600; font-size: .85rem; }
.abc-patient-id { font-size: .7rem; color: var(--color-text-muted); }
.abc-receita { font-weight: 700; }
.abc-agenda-cell { display: flex; align-items: center; gap: 5px; font-size: .8rem; }
.abc-agenda-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.abc-agenda-dot--ok   { background: var(--color-a); }
.abc-agenda-dot--none { background: var(--color-text-muted); }
.abc-agenda-none { color: var(--color-text-muted); }
.abc-agenda-date { color: var(--color-b); }
.abc-wa-btn {
  background: #25D366; color: #fff; border: none; border-radius: 8px;
  width: 34px; height: 34px; cursor: pointer; padding: 0;
  display: flex; align-items: center; justify-content: center;
}
.abc-wa-btn:hover { opacity: .88; }
.abc-wa-btn svg { width: 16px; height: 16px; }
.badge--green-soft { background: #d1fae5; color: #065f46; }
.page-ellipsis { font-size: .78rem; color: var(--color-text-muted); padding: .35rem .5rem; }

/* ── Sync button ─────────────────────────────────────────── */
@keyframes spin-icon { to { transform: rotate(360deg); } }
.btn--sync svg { transition: transform .15s; }
.btn--sync.loading svg { animation: spin-icon .7s linear infinite; }
.btn--sync.loading { opacity: .7; cursor: default; }
.aniv-id { font-size: 11px; color: var(--muted); font-weight: 400; margin-left: 4px; }
