/* ═══════════════════════════════════════════════════════
   CardioVitta — Design System v5
   Paleta: Coral #C94B3A + Azul Petróleo #3A5F7D
   Dark mode nativo via data-theme="dark"
═══════════════════════════════════════════════════════ */

/* ── LIGHT MODE (padrão) ── */
:root {
  --navy:         #0D1B2A;
  --coral:        #C94B3A;
  --coral-dim:    rgba(201,75,58,.15);
  --coral-hover:  #A83D2E;
  --blue:         #3A5F7D;
  --blue-light:   #EEF4F8;

  --bg:           #F2F5F8;
  --surface:      #FFFFFF;
  --surface-2:    #F8FAFB;
  --border:       #E2E8EE;
  --border-light: #EEF2F6;

  --text:         #14202C;
  --text-mid:     #2A3C4E;
  --text-muted:   #5A6B7C;
  --text-sub:     #6E8093;

  --green:        #1A7A4A;
  --green-bg:     rgba(26,122,74,.1);
  --amber:        #B07010;
  --amber-bg:     rgba(176,112,16,.1);
  --red:          #C94B3A;
  --red-bg:       rgba(201,75,58,.1);

  --sidebar-bg:   #0D1B2A;
  --sidebar-text: #7A90A4;
  --sidebar-active-bg: rgba(201,75,58,.18);

  --shadow-sm:    0 1px 3px rgba(0,0,0,.07);
  --shadow-md:    0 4px 16px rgba(0,0,0,.08);
  --radius:       12px;
  --radius-sm:    8px;
  --font: 'Hanken Grotesk', system-ui, sans-serif;
}

/* ── DARK MODE ── */
[data-theme="dark"] {
  --bg:           #0A1520;
  --surface:      #0F1E2E;
  --surface-2:    #142030;
  --border:       #1E3048;
  --border-light: #192840;

  --text:         #E8F0F8;
  --text-mid:     #B8CCE0;
  --text-muted:   #6A8AA8;
  --text-sub:     #4A6A88;

  --green-bg:     rgba(26,122,74,.2);
  --amber-bg:     rgba(176,112,16,.2);
  --red-bg:       rgba(201,75,58,.2);
  --blue-light:   rgba(58,95,125,.2);

  --sidebar-bg:   #060E18;
  --surface:      #0F1E2E;
  --shadow-sm:    0 1px 4px rgba(0,0,0,.3);
  --shadow-md:    0 4px 20px rgba(0,0,0,.4);
}

/* ── RESET & BASE ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; font-family: var(--font); background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.5; transition: background .2s, color .2s; }
a { text-decoration: none; color: inherit; }
button { font-family: var(--font); cursor: pointer; }
input, select, textarea { font-family: var(--font); }
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-thumb { background: #2A3F55; border-radius: 6px; }

/* ── LAYOUT ── */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: 236px; flex-shrink: 0;
  background: var(--sidebar-bg);
  display: flex; flex-direction: column;
  position: fixed; top: 0; left: 0; height: 100vh;
  overflow-y: auto; z-index: 100;
  transition: background .2s;
}

/* Logo */
.sb-logo {
  display: flex; align-items: center; gap: 10px;
  padding: 16px 16px 14px;
  border-bottom: 1px solid rgba(255,255,255,.07);
  cursor: pointer;
}
.sb-logo img { height: 40px; width: auto; object-fit: contain; display: block; }
.sb-logo-text { color: #fff; font-size: 13px; font-weight: 600; line-height: 1.2; }
.sb-logo-sub  { color: rgba(255,255,255,.35); font-size: 10px; margin-top: 1px; }

/* Nav */
.sb-nav { flex: 1; padding: 10px 8px; display: flex; flex-direction: column; gap: 2px; overflow-y: auto; }
.nav-btn {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 12px; border-radius: 9px;
  border: none; background: transparent;
  color: var(--sidebar-text); font-size: 13.5px; font-weight: 400;
  width: 100%; text-align: left;
  transition: background .15s, color .15s;
}
.nav-btn:hover  { background: rgba(255,255,255,.06); color: #C8D8E8; }
.nav-btn.active { background: var(--sidebar-active-bg); color: #fff; font-weight: 600; }
.nav-btn svg    { flex-shrink: 0; opacity: .75; width: 18px; height: 18px; }
.nav-btn.active svg { opacity: 1; }
.nav-section {
  font-size: 10px; font-weight: 600; letter-spacing: .1em;
  text-transform: uppercase; color: rgba(255,255,255,.2);
  padding: 14px 12px 4px;
}

/* Footer */
.sb-footer {
  padding: 12px 14px; border-top: 1px solid rgba(255,255,255,.07);
  display: flex; align-items: center; gap: 10px;
}
.avatar { width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; color: #fff; flex-shrink: 0; }
.avatar.coral { background: var(--coral); }
.avatar.blue  { background: var(--blue); }
.sb-user-name { color: #EAF0F5; font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-user-role { color: rgba(255,255,255,.35); font-size: 11px; }
.sb-logout { color: rgba(255,255,255,.3); margin-left: auto; padding: 4px; border: none; background: none; transition: color .15s; }
.sb-logout:hover { color: #fff; }

/* Dark mode toggle */
.theme-btn {
  display: flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 8px;
  border: 1px solid rgba(255,255,255,.1);
  background: rgba(255,255,255,.05);
  color: rgba(255,255,255,.5); cursor: pointer;
  transition: all .15s; flex-shrink: 0;
}
.theme-btn:hover { background: rgba(255,255,255,.1); color: #fff; }

/* ── MAIN ── */
.main { margin-left: 236px; flex: 1; display: flex; flex-direction: column; min-height: 100vh; }
.topbar {
  height: 60px; background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px; position: sticky; top: 0; z-index: 50;
  transition: background .2s, border-color .2s;
}
.topbar-title { font-size: 17px; font-weight: 600; color: var(--text); }
.topbar-actions { display: flex; gap: 8px; align-items: center; }
.page { flex: 1; padding: 22px 26px; }

/* ── BUTTONS ── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; border-radius: var(--radius-sm);
  font-size: 13.5px; font-weight: 500; border: none;
  cursor: pointer; transition: opacity .15s, background .15s;
  white-space: nowrap;
}
.btn:hover { opacity: .88; }
.btn-primary  { background: var(--coral); color: #fff; }
.btn-outline  { background: var(--surface); color: var(--text-mid); border: 1px solid var(--border); }
.btn-ghost    { background: transparent; color: var(--text-muted); }
.btn-sm       { padding: 6px 12px; font-size: 12.5px; }
.btn-icon     { width: 36px; height: 36px; padding: 0; justify-content: center; border-radius: var(--radius-sm); border: none; background: transparent; color: #777; }
.btn-full     { width: 100%; justify-content: center; }

/* ── CARDS ── */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: background .2s, border-color .2s;
}
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px; border-bottom: 1px solid var(--border);
}
.card-title { font-size: 13px; font-weight: 600; color: var(--text); }
.card-body  { padding: 16px 20px; }

/* Stat cards */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px,1fr)); gap: 12px; margin-bottom: 20px; }
.stat-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px 18px;
  display: flex; align-items: center; gap: 14px;
  box-shadow: var(--shadow-sm); transition: background .2s;
}
.stat-icon { width: 38px; height: 38px; border-radius: 10px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.stat-icon.blue   { background: rgba(58,95,125,.12); color: var(--blue); }
.stat-icon.green  { background: var(--green-bg); color: var(--green); }
.stat-icon.amber  { background: var(--amber-bg); color: var(--amber); }
.stat-icon.red    { background: var(--red-bg);   color: var(--red); }
.stat-val { font-size: 24px; font-weight: 700; color: var(--text); line-height: 1; }
.stat-lbl { font-size: 11.5px; color: var(--text-muted); margin-top: 3px; }

/* ── TABLE ── */
.table-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow-x: auto; box-shadow: var(--shadow-sm); }
.table { width: 100%; border-collapse: collapse; }
.table th {
  font-size: 11px; font-weight: 600; letter-spacing: .08em;
  text-transform: uppercase; color: var(--text-sub);
  padding: 12px 18px; border-bottom: 1px solid var(--border);
  background: var(--surface-2); text-align: left;
}
.table td { padding: 12px 18px; border-bottom: 1px solid var(--border-light); font-size: 13.5px; color: var(--text-mid); }
.table tr:last-child td { border-bottom: none; }
.table tbody tr { transition: background .1s; }
.table tbody tr:hover { background: var(--bg); cursor: pointer; }

/* ── BADGES ── */
.badge { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 99px; font-size: 11px; font-weight: 600; }
.badge-green { background: var(--green-bg); color: var(--green); }
.badge-amber { background: var(--amber-bg); color: var(--amber); }
.badge-red   { background: var(--red-bg);   color: var(--red); }
.badge-blue  { background: rgba(58,95,125,.12); color: var(--blue); }
.badge-gray  { background: var(--border); color: var(--text-muted); }

/* ── FORMS ── */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 22px; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field label { font-size: 11.5px; color: var(--text-muted); font-weight: 600; letter-spacing: .02em; }
.field input, .field select, .field textarea {
  padding: 9px 12px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); font-size: 14px;
  color: var(--text-mid); background: var(--surface);
  transition: border-color .15s, background .2s; width: 100%;
  box-sizing: border-box;
}
/* Altura uniforme em input/select numa mesma linha (evita desalinhamento — padrão 40px) */
.field input:not([type=checkbox]):not([type=radio]),
.field select { min-height: 40px; }
.field textarea { min-height: 72px; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--coral); box-shadow: 0 0 0 3px rgba(201,75,58,.1); }
.field-wide { grid-column: 1 / -1; }

/* Filters */
.filter-bar {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 11px 16px;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  box-shadow: var(--shadow-sm);
}
.filter-bar input, .filter-bar select { border: none; outline: none; font-size: 13px; color: var(--text-muted); background: transparent; }
.filter-bar input { flex: 1; min-width: 120px; color: var(--text-mid); }
.filter-sep { width: 1px; height: 20px; background: var(--border); }

/* Tabs */
.tabs { display: flex; border-bottom: 1px solid var(--border); margin-bottom: 20px; gap: 0; }
.tab-btn { padding: 0 4px 13px; margin-right: 26px; font-size: 14px; font-weight: 400; color: var(--text-muted); background: none; border: none; border-bottom: 2px solid transparent; cursor: pointer; transition: color .15s, border-color .15s; }
.tab-btn.active { color: var(--coral); border-bottom-color: var(--coral); font-weight: 600; }

/* ── FLASH ── */
.flash-wrap { padding: 12px 26px 0; }
.flash { padding: 10px 16px; border-radius: var(--radius-sm); margin-bottom: 8px; font-size: 13.5px; font-weight: 500; }
.flash-success { background: var(--green-bg); color: var(--green); }
.flash-danger  { background: var(--red-bg);   color: var(--red); }
.flash-warning { background: var(--amber-bg); color: var(--amber); }
.flash-info    { background: rgba(58,95,125,.12); color: var(--blue); }

/* ── EMPTY STATE ── */
.empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 48px 24px; text-align: center; color: var(--text-muted); }
.empty span { font-size: 40px; }

/* ── ALERT ── */
.alert { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: var(--radius-sm); font-size: 13px; margin-bottom: 16px; }
.alert-amber { background: var(--amber-bg); border: 1px solid rgba(176,112,16,.25); color: #7A4F06; }
.alert-red   { background: var(--red-bg);   border: 1px solid rgba(201,75,58,.25);  color: #7A2519; }

/* ── LOGIN ── */
.login-body { background: var(--sidebar-bg); display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.login-card { background: var(--surface); border-radius: var(--radius); padding: 36px 32px; max-width: 390px; width: 100%; margin: 16px; box-shadow: var(--shadow-md); }
.login-logo { text-align: center; margin-bottom: 28px; }
.login-logo img { height: 80px; width: auto; object-fit: contain; margin: 0 auto 12px; display: block; }
.login-logo p { font-size: 13px; color: var(--text-muted); margin-top: 4px; }
.login-card .field { margin-bottom: 14px; }

/* ── PAC HEADER ── */
.pac-header { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 22px; display: flex; gap: 18px; align-items: flex-start; margin-bottom: 20px; box-shadow: var(--shadow-sm); }
.pac-avatar-lg { width: 56px; height: 56px; border-radius: 12px; background: var(--blue); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 20px; font-weight: 700; flex-shrink: 0; }
.pac-meta { flex: 1; }
.pac-name { font-size: 19px; font-weight: 600; color: var(--text); margin-bottom: 8px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pac-info-row { display: flex; gap: 18px; flex-wrap: wrap; }
.pac-info-item { display: flex; flex-direction: column; gap: 2px; }
.pac-info-label { font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--text-sub); font-weight: 600; }
.pac-info-val { font-size: 13.5px; color: var(--text-mid); }

/* ── AGENDA TABLE ── */
.agenda-table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.agenda-table { width: 100%; border-collapse: collapse; table-layout: fixed; min-width: 560px; }
.agenda-th {
  padding: 10px 8px; text-align: center;
  border-right: 1px solid var(--border);
  background: var(--surface-2); width: 14.28%;
  vertical-align: top;
}
.agenda-th:last-child { border-right: none; }
.agenda-th.agenda-hoje { background: rgba(201,75,58,.05); }
.day-name { font-size: 10px; font-weight: 600; text-transform: uppercase; color: var(--text-sub); }
.day-num  { font-size: 14px; font-weight: 700; color: var(--text); margin-top: 2px; }
.day-hoje { color: var(--coral) !important; }
.agenda-col { padding: 6px; border-right: 1px solid var(--border); vertical-align: top; min-height: 160px; height: 160px; }
.agenda-col:last-child { border-right: none; }
.agenda-col.agenda-hoje { background: rgba(201,75,58,.02); }
.apt-card { border-left: 3px solid; border-radius: 5px; padding: 6px 8px; margin-bottom: 5px; font-size: 11.5px; cursor: pointer; transition: opacity .1s; }
.apt-card:hover { opacity: .85; }
.apt-card.blue   { border-color: var(--blue);  background: rgba(58,95,125,.1); }
.apt-card.green  { border-color: var(--green); background: var(--green-bg); }
.apt-card.amber  { border-color: var(--amber); background: var(--amber-bg); }
.apt-card.gray   { border-color: #7A90A4; background: var(--bg); }
.apt-time  { font-weight: 700; font-size: 10.5px; color: var(--text-muted); }
.apt-name  { font-weight: 600; color: var(--text-mid); }
.apt-fisio { font-size: 10.5px; color: var(--text-muted); }
.agenda-add { display: block; text-align: center; color: var(--border); font-size: 20px; padding: 4px 0; transition: color .15s; }
.agenda-add:hover { color: var(--coral); }

/* ── TOGGLE SWITCH ── */
.toggle-row { display: flex; align-items: center; justify-content: space-between; padding: 14px 0; border-bottom: 1px solid var(--border-light); }
.toggle-row:last-child { border-bottom: none; }
.toggle-label { font-size: 14px; color: var(--text-mid); font-weight: 500; }
.toggle-sub   { font-size: 12.5px; color: var(--text-muted); margin-top: 2px; }

/* ── MODAL ── */
#modal-fin { align-items: center; justify-content: center; }

/* ── BOTTOM NAV (mobile) ── */
.bottom-nav { display: none; }
.bnav-btn { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: rgba(255,255,255,.4); font-size: 10px; font-weight: 500; padding: 8px 4px; transition: color .15s; border: none; background: none; }
.bnav-btn.active { color: var(--coral); }
.bnav-btn svg { width: 22px; height: 22px; }

/* ── MOBILE ── */
@media (max-width: 768px) {
  .sidebar { display: none; }
  .main { margin-left: 0; }
  .topbar { padding: 0 16px; }
  .page { padding: 16px 16px 90px; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .pac-header { flex-direction: column; gap: 12px; padding: 16px; }
  .form-grid { grid-template-columns: 1fr; }
  .field-wide { grid-column: auto; }
  .agenda-table-wrap { min-width: 0; }
  .agenda-th:not(.agenda-sel) { display: none; }
  .agenda-col:not(.agenda-sel) { display: none; border-right: none; }
  .agenda-day-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
  .agenda-th, .agenda-col { width: 100%; }
  .filter-bar { flex-direction: column; align-items: stretch; }
  .filter-sep { display: none; }
  .mobile-back { display: flex !important; }
  .desktop-only { display: none !important; }
  .bottom-nav { display: flex; position: fixed; bottom: 0; left: 0; right: 0; background: var(--sidebar-bg); border-top: 1px solid rgba(255,255,255,.08); z-index: 100; height: 64px; align-items: stretch; }
}
@media (min-width: 769px) {
  .bottom-nav { display: none; }
  .mobile-back { display: none !important; }
  .mobile-only { display: none !important; }
}

/* ── SIDEBAR LOGO — legível em dark e light ── */
.sb-logo {
  display: block;
  padding: 14px 16px !important;
  border-bottom: 1px solid rgba(255,255,255,.07);
  cursor: pointer;
  text-decoration: none;
}
.sb-logo-wrap {
  background: transparent;
  padding: 4px 0;
  display: flex;
  align-items: center;
}
.sb-logo-img {
  height: 48px;
  width: 100%;
  object-fit: contain;
  display: block;
}

/* ── CHECKBOX customizado (relatório) ── */
.check-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  transition: border-color .15s, background .15s;
  user-select: none;
}
.check-item:hover { border-color: var(--coral); background: var(--bg); }
.check-item.selected { border-color: var(--coral); background: rgba(201,75,58,.05); }
.check-item input[type="checkbox"] { display: none; }
.check-box {
  width: 20px; height: 20px; border-radius: 5px;
  border: 2px solid var(--border); background: var(--surface);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; margin-top: 1px;
  transition: border-color .15s, background .15s;
}
.check-item.selected .check-box {
  border-color: var(--coral); background: var(--coral);
}
.check-box svg { display: none; }
.check-item.selected .check-box svg { display: block; }
.check-title { font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 2px; }
.check-desc  { font-size: 12.5px; color: var(--text-muted); }

/* ── PRINT — relatório PDF ── */
@media print {
  .sidebar, .topbar, .topbar-actions, .bottom-nav,
  .no-print, .btn { display: none !important; }
  .main { margin-left: 0 !important; }
  .page { padding: 0 !important; }
  .card { box-shadow: none !important; border: none !important; }
  body { background: white !important; }
  [data-theme="dark"] { --surface: white; --text: #14202C; --text-mid: #2A3C4E; --border: #E2E8EE; }
  .print-section { display: block !important; }
  .print-hidden  { display: none !important; }
}


/* ── v13: bloqueios (eventos do Google) ── */
.apt-card.bloqueio { background: repeating-linear-gradient(45deg, var(--card-bg, #fff), var(--card-bg, #fff) 6px, rgba(120,120,120,.07) 6px, rgba(120,120,120,.07) 12px); border-left: 3px solid #8a8a8a; }
.apt-card.bloqueio.pendente { border-left-color: #e6a700; }
.apt-card.bloqueio.conflito { border-left-color: #d64545; }
.tag-google { font-size: 9px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; background: rgba(66,133,244,.12); color: #3b6fc4; border-radius: 4px; padding: 1px 5px; vertical-align: middle; }
.badge-cadastro-pendente { display: inline-block; font-size: 10px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; background: rgba(230,167,0,.15); color: #a97b00; border-radius: 4px; padding: 2px 7px; margin-left: 6px; }
@media (min-width: 769px) { .agenda-day-nav { display: none; } }

/* ── v14: PWA + Mobile-first melhorias ── */

/* Safe area pra notch/barra de navegação Android */
@supports (padding: env(safe-area-inset-bottom)) {
  .bottom-nav { padding-bottom: env(safe-area-inset-bottom); }
  .page { padding-bottom: calc(90px + env(safe-area-inset-bottom)); }
}

@media (max-width: 768px) {
  /* Touch targets mínimos 44px (WCAG) */
  .btn, .btn-sm, .nav-btn, .input, select, textarea {
    min-height: 44px;
  }
  .btn-sm { padding: 10px 14px; font-size: 13px; }
  .btn-ghost.btn-sm { padding: 10px 12px; }

  /* Tabelas horizontais scrolláveis */
  .table-wrap, .card > div:has(> .table) {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .table { min-width: 480px; }
  .table th, .table td { padding: 10px 8px; font-size: 13px; }

  /* Cards mais compactos */
  .card-header { padding: 12px 14px; flex-wrap: wrap; gap: 8px; }
  .card-body { padding: 14px; }
  .card-footer { padding: 12px 14px; }

  /* Topbar mobile ajustada */
  .topbar { height: 52px; }
  .topbar-title { font-size: 14px; }
  .topbar-actions { gap: 6px; }
  .topbar-actions .btn { font-size: 12px; padding: 6px 10px; }

  /* Bottom nav melhorada */
  .bottom-nav { height: 60px; }
  .bnav-btn { font-size: 9.5px; gap: 2px; }
  .bnav-btn svg { width: 20px; height: 20px; }

  /* Stat grid empilhado */
  .stat-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .stat-card { padding: 14px; }
  .stat-value { font-size: 22px; }

  /* Modal responsivo */
  .card[style*="width:360px"],
  .card[style*="width: 360px"] {
    width: 95vw !important;
    max-width: 95vw !important;
  }

  /* Prontuário: conteúdo legível */
  .card-body[style*="white-space:pre-wrap"] {
    font-size: 13.5px;
    line-height: 1.6;
    word-break: break-word;
  }

  /* Formulários: labels maiores em touch */
  label, .field-label { font-size: 12.5px; }

  /* Selects e inputs com aparência nativa mobile */
  select, input[type="date"], input[type="time"] {
    font-size: 16px; /* Previne zoom automático no iOS */
  }

  /* Agenda: slot touch-friendly */
  .agenda-slot { min-height: 48px; }
  .apt-card { padding: 8px 10px; }
}

/* Animação suave de transição entre telas */
.page {
  animation: fadeIn .15s ease-out;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Pull-to-refresh visual hint (CSS-only) */
.main { overscroll-behavior-y: contain; }

/* PWA: splash / loading */
.pwa-loading {
  position: fixed; inset: 0; background: #1B2A4A;
  display: flex; align-items: center; justify-content: center;
  z-index: 9999; transition: opacity .3s;
}
.pwa-loading.hide { opacity: 0; pointer-events: none; }

/* ── Campos .inp (modais e telas novas): mesma altura padrão ── */
.inp { box-sizing: border-box; }
input.inp:not([type=checkbox]):not([type=radio]), select.inp { min-height: 40px; }
textarea.inp { min-height: 72px; }

/* ── Toast / aviso do sistema (substitui alert nativo) ── */
.cv-toast-wrap { position: fixed; top: 18px; left: 50%; transform: translateX(-50%); z-index: 9999; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.cv-toast { background: var(--surface); color: var(--text); border: 1px solid var(--border); border-left: 4px solid var(--coral); border-radius: 8px; padding: 12px 16px; font-size: 13.5px; box-shadow: 0 8px 24px rgba(0,0,0,.12); max-width: 420px; pointer-events: auto; animation: cvToastIn .2s ease; }
.cv-toast.info { border-left-color: var(--coral); }
.cv-toast.success { border-left-color: #16a34a; }
@keyframes cvToastIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }

/* ── Modal de confirmação do sistema (substitui confirm nativo) ── */
.cv-confirm-back { position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 9998; display: flex; align-items: center; justify-content: center; }
.cv-confirm-box { background: var(--surface); border-radius: 12px; padding: 22px; max-width: 400px; width: calc(100% - 32px); box-shadow: 0 12px 40px rgba(0,0,0,.25); }
.cv-confirm-box p { font-size: 14px; color: var(--text); margin: 0 0 18px; line-height: 1.5; }
.cv-confirm-actions { display: flex; justify-content: flex-end; gap: 8px; }
