/* ============================================================
   Painel da Clínica — design system no padrão da Lunar Fitness
   Navy profundo + cor da clínica (--accent, vem da configuração),
   Inter, ícones Lucide, sem emoji na interface.
   ============================================================ */

:root {
  /* cor da clínica: o painel sobrescreve com a config clinic_accent */
  --accent: #14b8a6;
  --accent-light: color-mix(in srgb, var(--accent) 80%, white);
  --accent-dark: color-mix(in srgb, var(--accent) 78%, black);
  --accent-glow: color-mix(in srgb, var(--accent) 25%, transparent);
  --accent-subtle: color-mix(in srgb, var(--accent) 9%, transparent);

  --bg-deepest: #0a0e1a;
  /* a prévia da folha impressa é papel nos dois temas */
  --papel: #ffffff;
  --papel-texto: #111111;
  --papel-suave: #555555;
  --papel-linha: #dddddd;
  --bg-deep: #0f1423;
  --bg-card: #151a2e;
  --bg-elevated: #1a2038;
  --bg-hover: #1e2642;
  --bg-input: #121730;

  --text-primary: #e8eaf0;
  --text-secondary: #9aa2bc;
  --text-muted: #7c86a2;
  --text-bright: #ffffff;

  --border: rgba(138, 148, 178, 0.14);
  --border-hover: color-mix(in srgb, var(--accent) 40%, transparent);

  --success: #22c55e; --success-bg: rgba(34, 197, 94, 0.14);
  --warning: #f59e0b; --warning-bg: rgba(245, 158, 11, 0.14);
  --danger: #ef4444;  --danger-bg: rgba(239, 68, 68, 0.14);
  --info: #3b82f6;    --info-bg: rgba(59, 130, 246, 0.14);

  --glass-bg: rgba(21, 26, 46, 0.75);
  --glass-border: rgba(255, 255, 255, 0.08);

  --radius: 10px; --radius-sm: 6px; --radius-lg: 16px;
  --sidebar-w: 240px; --sidebar-collapsed-w: 64px;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.25);
  --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.35);

  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px;
  --space-5: 20px; --space-6: 24px; --space-8: 32px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
  font-family: 'Inter', -apple-system, sans-serif;
  background: var(--bg-deepest); color: var(--text-primary);
  font-size: 14px; line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
.hidden { display: none !important; }
svg { width: 18px; height: 18px; flex-shrink: 0; }
a { color: var(--accent); }
button { font-family: inherit; }
.muted { color: var(--text-muted); font-size: 13px; }
.sub { color: var(--text-secondary); font-size: 13px; }

/* ------------------------------------------------------------ login */
.login-page {
  position: fixed; inset: 0; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 20% 20%, var(--accent-subtle), transparent 45%),
              linear-gradient(135deg, #0a0e1a 0%, #0f1a3a 50%, #0a1628 100%);
  z-index: 100; padding: 16px;
}
.login-card {
  background: var(--glass-bg); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border); border-radius: var(--radius-lg);
  padding: 40px 36px; width: 380px; max-width: 100%;
  display: flex; flex-direction: column; gap: 18px; box-shadow: var(--shadow-lg);
}
.login-mark, .sidebar-mark {
  width: 52px; height: 52px; border-radius: 14px; margin: 0 auto;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: var(--bg-deepest); box-shadow: 0 0 24px var(--accent-glow);
}
.login-mark svg { width: 26px; height: 26px; }
.login-titulo { text-align: center; }
.login-titulo h1 { font-size: 20px; font-weight: 600; color: var(--text-bright); }
.login-titulo p { color: var(--text-secondary); font-size: 13px; margin-top: 4px; }
.login-erro { background: var(--danger-bg); color: var(--danger); padding: 10px 14px;
  border-radius: var(--radius-sm); font-size: 13px; text-align: center; }
.login-field input {
  width: 100%; padding: 14px 16px; background: var(--bg-input); border: 1px solid var(--border);
  border-radius: var(--radius); color: var(--text-primary); font-size: 14px; font-family: inherit; outline: none;
}
.login-field input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.login-btn {
  padding: 14px; border: none; border-radius: var(--radius); cursor: pointer;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark)); color: var(--bg-deepest);
  font-size: 14px; font-weight: 600; letter-spacing: 1.5px; transition: all .2s;
}
.login-btn:hover { box-shadow: 0 0 20px var(--accent-glow); }

/* ----------------------------------------------------------- layout */
.layout { display: flex; height: 100vh; overflow: hidden; }
.sidebar {
  width: var(--sidebar-w); flex-shrink: 0; background: var(--bg-deep);
  border-right: 1px solid var(--border); display: flex; flex-direction: column;
  transition: width .2s ease; overflow: hidden;
}
.sidebar-collapsed .sidebar { width: var(--sidebar-collapsed-w); }
.sidebar-header { display: flex; align-items: center; gap: 12px; padding: 18px 14px; border-bottom: 1px solid var(--border); }
.sidebar-mark { width: 36px; height: 36px; border-radius: 10px; margin: 0; }
.sidebar-mark svg { width: 18px; height: 18px; }
.sidebar-title { display: flex; flex-direction: column; min-width: 0; }
.sidebar-title b { color: var(--text-bright); font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-title span { color: var(--text-muted); font-size: 11px; }
.sidebar-nav { flex: 1; padding: 12px 8px; display: flex; flex-direction: column; gap: 2px; overflow-y: auto; }
.nav-label { font-size: 10px; font-weight: 600; letter-spacing: 1px; text-transform: uppercase;
  color: var(--text-muted); padding: 14px 12px 6px; white-space: nowrap; }
.sidebar-link {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--radius-sm);
  color: var(--text-secondary); font-size: 14px; font-weight: 500; background: none; border: none;
  cursor: pointer; text-align: left; width: 100%; white-space: nowrap; transition: all .15s; position: relative;
}
.sidebar-link:hover { background: var(--bg-hover); color: var(--text-primary); }
.sidebar-link.active { background: var(--accent-subtle); color: var(--accent); }
.sidebar-link.active::before { content: ""; position: absolute; left: -8px; top: 8px; bottom: 8px; width: 3px;
  border-radius: 0 3px 3px 0; background: var(--accent); }
.sidebar-link .count { margin-left: auto; background: var(--warning); color: var(--bg-deepest);
  font-size: 11px; font-weight: 700; border-radius: 10px; padding: 0 7px; line-height: 18px; }
.sidebar-collapsed .sidebar-title, .sidebar-collapsed .nav-label, .sidebar-collapsed .sidebar-link span,
.sidebar-collapsed .sidebar-user-info, .sidebar-collapsed .sidebar-link .count { display: none; }
.sidebar-collapsed .sidebar-link { justify-content: center; }
.sidebar-footer { border-top: 1px solid var(--border); padding: 10px 8px; display: flex; flex-direction: column; gap: 8px; }
.sidebar-toggle { align-self: flex-end; display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; padding: 0; background: none; border: 1px solid var(--border); color: var(--text-muted);
  border-radius: var(--radius-sm); cursor: pointer; }
.sidebar-toggle svg { display: block; width: 16px; height: 16px; }
.sidebar-collapsed .sidebar-toggle { align-self: center; transform: rotate(180deg); }
.sidebar-user { display: flex; align-items: center; gap: 10px; padding: 6px; }
.sidebar-collapsed .sidebar-user { flex-direction: column; }
.avatar-sm { width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0; display: flex; align-items: center;
  justify-content: center; font-size: 12px; font-weight: 600; color: var(--bg-deepest);
  background: linear-gradient(135deg, var(--accent), var(--accent-dark)); }
.sidebar-user-info { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.sidebar-user-name { font-size: 13px; color: var(--text-primary); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-role { font-size: 11px; color: var(--text-muted); }
.sidebar-logout { background: none; border: none; color: var(--text-muted); cursor: pointer; padding: 6px; border-radius: var(--radius-sm); display: flex; }
.sidebar-logout:hover { color: var(--danger); background: var(--danger-bg); }
.main-content { flex: 1; overflow-y: auto; background: var(--bg-deepest); }

/* ------------------------------------------------------------ página */
.page { padding: 28px 32px 90px; width: 100%; max-width: 1400px; }
.page-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.page-header h1 { font-size: 24px; font-weight: 600; color: var(--text-bright); }
.page-sub { color: var(--text-secondary); font-size: 13px; margin-top: 2px; }
.page-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.header-direita { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.notif { position: relative; }
.notif-bell { position: relative; }
.notif-badge {
  position: absolute; top: -4px; right: -4px; min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: 99px; background: var(--danger); color: #fff; font-size: 10px; font-weight: 700;
  line-height: 16px; text-align: center; pointer-events: none;
}
.notif-menu {
  position: fixed; z-index: 180; width: 320px; max-width: min(320px, calc(100vw - 24px));
  background: var(--bg-card); border: 1px solid var(--glass-border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); overflow: hidden;
}
.notif-menu h4 { margin: 0; padding: 12px 14px 8px; font-size: 13px; color: var(--text-bright); }
.notif-item {
  display: block; width: 100%; text-align: left; background: none; border: none;
  border-top: 1px solid var(--border); padding: 10px 14px; cursor: pointer;
}
.notif-item:hover { background: var(--bg-hover); }
.notif-item b { display: block; color: var(--text-bright); font-size: 13px; font-weight: 600; }
.notif-item span { display: block; color: var(--text-secondary); font-size: 12px; margin-top: 2px; }
.notif-vazio { padding: 16px 14px; color: var(--text-muted); font-size: 13px; }
.page-loading, .carregando { padding: 60px 0; text-align: center; color: var(--text-muted); }

/* ------------------------------------------------------------- botões */
.btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; border-radius: var(--radius);
  font-size: 13px; font-weight: 600; border: 1px solid var(--border); background: var(--bg-elevated);
  color: var(--text-primary); cursor: pointer; transition: all .15s; white-space: nowrap;
}
.btn:hover { border-color: var(--border-hover); }
.btn:disabled { opacity: .5; cursor: default; }
.btn svg { width: 16px; height: 16px; }
.btn-primary { background: linear-gradient(135deg, var(--accent), var(--accent-dark)); color: var(--bg-deepest); border: none; }
.btn-primary:hover { box-shadow: 0 0 16px var(--accent-glow); }
.btn-ghost { background: none; }
.btn-danger { background: var(--danger-bg); color: var(--danger); border-color: transparent; }
.btn-success { background: var(--success-bg); color: var(--success); border-color: transparent; }
.btn-sm { padding: 6px 11px; font-size: 12px; }
.btn-icon { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px;
  border-radius: var(--radius-sm); background: none; border: 1px solid transparent; color: var(--text-secondary); cursor: pointer; }
.btn-icon:hover { background: var(--bg-hover); color: var(--text-primary); }
.btn-icon-danger:hover { background: var(--danger-bg); color: var(--danger); }
.btn-icon svg { width: 16px; height: 16px; }

/* ------------------------------------------------- cartões e números */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 20px; }
.stat-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px 18px; display: flex; align-items: center; gap: 14px; }
.stat-card.clicavel { cursor: pointer; transition: all .15s; }
.stat-card.clicavel:hover { border-color: var(--border-hover); transform: translateY(-1px); }
.stat-icon { width: 42px; height: 42px; border-radius: 10px; display: flex; align-items: center; justify-content: center;
  background: var(--accent-subtle); color: var(--accent); flex-shrink: 0; }
.stat-card.alerta .stat-icon { background: var(--warning-bg); color: var(--warning); }
.stat-card.ok .stat-icon { background: var(--success-bg); color: var(--success); }
.stat-value { display: block; font-size: 26px; font-weight: 700; color: var(--text-bright); line-height: 1.1; }
.stat-label { display: block; font-size: 12px; color: var(--text-muted); margin-top: 4px; }

.panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: var(--space-6);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.18);
  transition: border-color .15s, box-shadow .15s;
}
.panel-header {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 20px; border-bottom: 1px solid var(--border); flex-wrap: wrap;
}
.panel-header h3 {
  display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 600; color: var(--text-bright);
}
.panel-header h3 svg { color: var(--accent); }
.panel-body { padding: 20px; }
.panel-body > p.sub { margin-bottom: 14px; }
.grid2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: var(--space-6);
  align-items: start;
  margin-bottom: var(--space-6);
}
.grid2 > .panel { margin-bottom: 0; }
.grid2 > div > .panel:last-child { margin-bottom: 0; }

.grid-hoje {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: var(--space-6);
  align-items: start;
  margin-bottom: var(--space-6);
}
@media (max-width: 1040px) {
  .grid-hoje { grid-template-columns: 1fr; }
}
.hoje-atalhos { display: flex; flex-direction: column; gap: 12px; }
.hoje-atalho {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  padding: 14px 16px; background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); color: var(--text-primary); cursor: pointer;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.18);
  transition: border-color .15s, transform .15s;
}
.hoje-atalho:hover { border-color: var(--border-hover); transform: translateY(-1px); }
.hoje-atalho-ico {
  width: 36px; height: 36px; border-radius: 10px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent-subtle); color: var(--accent);
}
.hoje-atalho-txt { flex: 1; min-width: 0; }
.hoje-atalho-txt b { display: block; font-size: 14px; font-weight: 600; color: var(--text-bright); line-height: 1.2; }
.hoje-atalho-txt span { display: block; font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.hoje-atalho-n {
  min-width: 28px; height: 28px; padding: 0 8px; border-radius: 99px;
  background: var(--bg-elevated); color: var(--text-secondary); font-weight: 700; font-size: 13px;
  font-variant-numeric: tabular-nums; display: inline-flex; align-items: center; justify-content: center;
}
.hoje-atalho-n.tem { background: var(--accent-subtle); color: var(--accent); }
.hoje-atalho-go { color: var(--text-muted); display: flex; }
.lista-hoje { margin: -8px -20px -20px; }
.hoje-vazio { margin: 0; }
.hoje-pag-info { margin-right: auto; align-self: center; }
.section-gap { margin-top: var(--space-6); }

.aviso-card { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--radius);
  background: var(--warning-bg); border: 1px solid rgba(245, 158, 11, .25); color: var(--warning); margin-bottom: 18px; font-size: 13px; }
.aviso-card.erro { background: var(--danger-bg); border-color: rgba(239, 68, 68, .25); color: var(--danger); }
.aviso-card.info { background: var(--accent-subtle); border-color: var(--border-hover); color: var(--text-primary); }
.aviso-card ul { margin: 4px 0 0 16px; }

/* ------------------------------------------------------------- tabela */
.table-container { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); overflow-x: auto; }
.panel .table-container { border: none; border-radius: 0 0 var(--radius) var(--radius); }
.data-table { width: 100%; border-collapse: collapse; }
.data-table thead { background: var(--bg-elevated); }
.data-table th { padding: 11px 16px; text-align: left; font-size: 11px; font-weight: 600; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .5px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.data-table td { padding: 11px 16px; font-size: 13px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover { background: var(--bg-hover); }
.data-table .acoes { display: flex; gap: 4px; justify-content: flex-end; }
.cell-main { color: var(--text-bright); font-weight: 500; }
.cell-sub { display: block; color: var(--text-muted); font-size: 12px; }

/* ------------------------------------------------------------- badges */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 20px;
  font-size: 11px; font-weight: 600; white-space: nowrap; }
.badge svg { width: 12px; height: 12px; }
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-info { background: var(--info-bg); color: var(--info); }
.badge-accent { background: var(--accent-subtle); color: var(--accent); }
.badge-neutral { background: var(--bg-elevated); color: var(--text-secondary); }

/* ---------------------------------------------------------- formulário */
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.form-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.form-grid .form-group { margin-bottom: 0; }
.form-group label { font-size: 12px; font-weight: 600; color: var(--text-secondary); }
.form-group small { font-size: 12px; color: var(--text-muted); }
input, select, textarea {
  width: 100%; padding: 10px 13px; background: var(--bg-input); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text-primary); font-size: 13px; font-family: inherit; outline: none;
  transition: border-color .15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
input::placeholder, textarea::placeholder { color: var(--text-muted); }
input.campo-reais { font-variant-numeric: tabular-nums; }
textarea { min-height: 110px; resize: vertical; line-height: 1.5; }
input[type=color] { padding: 3px; height: 38px; width: 70px; cursor: pointer; }
input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--accent); }
.checkbox-label { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-primary); cursor: pointer; }
.form-actions { display: flex; gap: 8px; margin-top: 6px; align-items: center; flex-wrap: wrap; }
.charcount { font-size: 11px; color: var(--text-muted); text-align: right; margin-top: -8px; margin-bottom: 10px; }
.dias { display: flex; gap: 5px; flex-wrap: wrap; }
.dias label { cursor: pointer; }
.dias input { display: none; }
.dias span { display: inline-block; padding: 6px 10px; border-radius: var(--radius-sm); border: 1px solid var(--border);
  font-size: 12px; color: var(--text-secondary); }
.dias input:checked + span { background: var(--accent-subtle); border-color: var(--accent); color: var(--accent); }
.seg { display: inline-flex; background: var(--bg-input); border: 1px solid var(--border); border-radius: var(--radius); padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg button { background: none; border: none; color: var(--text-secondary); padding: 7px 12px; border-radius: var(--radius-sm); cursor: pointer; font-size: 12px; font-weight: 600; }
.seg button.ativo { background: var(--accent-subtle); color: var(--accent); }

/* ------------------------------------------------------------- modal */
.modal-overlay { position: fixed; inset: 0; background: rgba(5, 8, 16, .7); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; z-index: 200; padding: 16px; animation: fade .15s; }
.modal { background: var(--bg-card); border: 1px solid var(--glass-border); border-radius: var(--radius-lg);
  width: 560px; max-width: 100%; max-height: 90vh; display: flex; flex-direction: column; box-shadow: var(--shadow-lg); }
.modal-sm { width: 420px; } .modal-lg { width: 760px; }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.modal-header h2 { font-size: 16px; font-weight: 600; color: var(--text-bright); }
.modal-body { padding: 20px; overflow-y: auto; }
.modal-footer { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--border); }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* ------------------------------------------------------ cards de serviço */
.cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.svc-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px;
  display: flex; flex-direction: column; gap: 10px; transition: border-color .15s; }
.svc-card:hover { border-color: var(--border-hover); }
.svc-card.inativo { opacity: .5; }
.svc-capa { margin: -18px -18px 4px; aspect-ratio: 16 / 10; overflow: hidden;
  border-radius: var(--radius) var(--radius) 0 0; background: var(--bg-elevated); }
.svc-capa img { width: 100%; height: 100%; object-fit: cover; display: block; }
.svc-capa-vazia { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
  color: var(--text-muted); opacity: .6; }
.svc-capa-editar { position: relative; margin-bottom: 16px; }
.svc-capa-editar > img { width: 100%; aspect-ratio: 16 / 7; object-fit: cover; display: block;
  border-radius: var(--radius); }
.svc-capa-acoes { position: absolute; right: 10px; bottom: 10px; display: flex; gap: 6px; }
.svc-capa-acoes .btn, .svc-capa-acoes .btn-icon { background: rgba(0, 0, 0, .55); color: #fff; border-color: transparent;
  backdrop-filter: blur(6px); }
.svc-capa-add { width: 100%; height: 84px; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 6px; border: 1.5px dashed var(--border); border-radius: var(--radius);
  background: transparent; color: var(--text-secondary); font: inherit; font-size: 13px; cursor: pointer;
  transition: border-color .15s, color .15s; }
#sv-produtos-box { margin-top: 16px; }
.sv-areas { display: flex; flex-direction: column; gap: 10px; margin-bottom: 6px; }
.sv-areas:empty { display: none; }
.sv-area { border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 12px; }
.sv-area-topo { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 14px; }
.sv-area-fotos { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.sv-area-foto { position: relative; width: 64px; height: 64px; border-radius: var(--radius-sm); overflow: hidden; }
.sv-area-foto img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sv-area-foto button { position: absolute; top: 3px; right: 3px; width: 20px; height: 20px; padding: 0;
  border: 0; border-radius: 50%; background: rgba(0, 0, 0, .6); color: #fff; display: flex;
  align-items: center; justify-content: center; cursor: pointer; }
.sv-area-foto button svg { width: 12px; height: 12px; }
.sv-area-add { width: 64px; height: 64px; border: 1.5px dashed var(--border); border-radius: var(--radius-sm);
  background: transparent; color: var(--text-secondary); display: flex; align-items: center;
  justify-content: center; cursor: pointer; }
.sv-area-add:hover { border-color: var(--accent); color: var(--accent); }
.sv-area-add svg { width: 20px; height: 20px; }
.svc-capa-add:hover { border-color: var(--accent); color: var(--accent); }
.svc-head { display: flex; align-items: flex-start; gap: 10px; }
.svc-head svg { color: var(--accent); margin-top: 2px; }
.svc-head h3 { font-size: 15px; font-weight: 600; color: var(--text-bright); flex: 1; }
.svc-price { font-size: 22px; font-weight: 700; color: var(--accent); }
.svc-price.vazio { font-size: 13px; font-weight: 500; color: var(--text-muted); }
.svc-meta { display: flex; gap: 6px; flex-wrap: wrap; }
.svc-actions { display: flex; gap: 4px; justify-content: flex-end; margin-top: auto; }
.svc-switch { display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-top: 4px; font-size: 13px; color: var(--text-secondary); cursor: pointer; }
.switch { position: relative; width: 42px; height: 26px; flex: none; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
.switch i { position: absolute; inset: 0; border-radius: 999px; border: 1px solid var(--border);
  background: color-mix(in srgb, var(--text-muted) 28%, var(--bg-card)); transition: background .15s, border-color .15s; }
.switch i::after { content: ""; position: absolute; width: 20px; height: 20px; left: 2px; top: 2px;
  background: #fff; border-radius: 50%; box-shadow: 0 1px 2px rgba(0, 0, 0, .18); transition: transform .15s; }
.switch input:checked + i { background: var(--accent); border-color: var(--accent); }
.switch input:checked + i::after { transform: translateX(16px); }

.empty-state { text-align: center; padding: 44px 16px; color: var(--text-muted); }
.empty-state svg { width: 36px; height: 36px; color: var(--text-muted); margin-bottom: 10px; }
.empty-state b { display: block; color: var(--text-primary); font-size: 14px; margin-bottom: 4px; }

/* ------------------------------------------------------------ lista */
.lista { display: flex; flex-direction: column; }
.lista-item { display: flex; align-items: center; gap: 14px; padding: 12px 18px; border-bottom: 1px solid var(--border); }
.lista-item:last-child { border-bottom: none; }
.lista-item .hora { font-weight: 700; color: var(--text-bright); font-size: 15px; min-width: 52px; }
.lista-item .info { flex: 1; min-width: 0; }
.lista-item .info b { color: var(--text-primary); font-weight: 500; }
.lista-item .info span { display: block; color: var(--text-muted); font-size: 12px; }
.lista-item .fim { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.fi-alca {
  flex: none; width: 28px; border: 0; background: none; color: var(--text-muted);
  cursor: grab; font: inherit; font-size: 14px; letter-spacing: -2px; padding: 8px 0;
  touch-action: none;
}
.fi-alca:active { cursor: grabbing; }
.fi-arrastando { opacity: 0.45; }
.resposta-inline { display: flex; gap: 6px; margin-top: 8px; }

/* -------------------------------------------------------- agenda grade */
.page:has(.agenda-toolbar) {
  max-width: 100%;
  padding: 20px 28px 32px;
}
.page:has(.agenda-toolbar) .page-header {
  margin-bottom: 12px;
}

.agenda-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.agenda-toolbar .semana {
  font-weight: 600;
  color: var(--text-bright);
  min-width: 170px;
  text-align: center;
  font-size: 14px;
}
.agenda-toolbar .legenda {
  margin-left: auto;
  display: flex;
  gap: 14px;
  font-size: 12px;
  color: var(--text-muted);
  flex-wrap: wrap;
  align-items: center;
}
.legenda span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.legenda i {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 3px;
}

.grade-wrap {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: auto;
  height: calc(100vh - 210px);
  min-height: 520px;
  max-height: none;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}
.grade {
  display: grid;
  grid-template-columns: 56px repeat(7, minmax(130px, 1fr));
  min-width: 960px;
  position: relative;
  background: var(--bg-card);
}
.grade-head {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
  padding: 10px 8px;
  text-align: center;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  backdrop-filter: blur(8px);
}
.grade-head b {
  display: block;
  font-size: 16px;
  font-weight: 700;
  color: var(--text-bright);
  margin-top: 2px;
}
.grade-head.hoje {
  color: var(--accent);
}
.grade-head.hoje b {
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent-subtle);
  margin: 2px auto 0;
}
.grade-horas {
  border-right: 1px solid var(--border);
  background: var(--bg-elevated);
}
.grade-hora {
  height: 60px;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  text-align: right;
  padding: 4px 8px 0 0;
  border-bottom: 1px solid var(--border);
  box-sizing: border-box;
  font-variant-numeric: tabular-nums;
}
.grade-col {
  position: relative;
  border-right: 1px solid var(--border);
}
.grade-col:last-child {
  border-right: none;
}
.grade-slot {
  height: 30px;
  border-bottom: 1px dashed rgba(138, 148, 178, .12);
  cursor: pointer;
  box-sizing: border-box;
  transition: background-color 0.12s ease;
}
.grade-slot.fora {
  background: repeating-linear-gradient(135deg, transparent, transparent 6px, color-mix(in srgb, var(--text-muted) 8%, transparent) 6px, color-mix(in srgb, var(--text-muted) 8%, transparent) 12px);
  cursor: default;
}
.grade-slot:not(.fora):hover {
  background: var(--accent-subtle);
}
.grade-slot.cheia {
  border-bottom: 1px solid var(--border);
}
.evento {
  position: absolute;
  left: 3px;
  right: 3px;
  border-radius: 8px;
  padding: 4px 8px;
  font-size: 11px;
  line-height: 1.3;
  overflow: hidden;
  cursor: pointer;
  z-index: 2;
  border-left: 3.5px solid;
  transition: filter .15s, transform 0.12s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}
.evento:hover {
  filter: brightness(1.1);
  transform: scale(1.01);
  z-index: 5;
}
.evento b {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-bright);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.evento span {
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
  font-size: 11px;
}
.evento.pendente {
  background: color-mix(in srgb, var(--warning) 22%, var(--bg-card));
  border-color: var(--warning);
}
.evento.confirmado {
  background: color-mix(in srgb, var(--info) 22%, var(--bg-card));
  border-color: var(--info);
}
.evento.pendente b, .evento.confirmado b {
  color: var(--text-bright);
}
.evento.pendente span, .evento.confirmado span {
  color: var(--text-primary);
}
.evento.bloqueio {
  background: repeating-linear-gradient(135deg, rgba(90,97,120,.2), rgba(90,97,120,.2) 6px, rgba(90,97,120,.1) 6px, rgba(90,97,120,.1) 12px);
  border-color: var(--text-muted);
}
.evento .ok {
  color: var(--success);
}
.evento.com-concluido {
  padding-right: 76px;
}
.evento-concluido {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 10px;
  font-weight: 600;
  line-height: 1.2;
  pointer-events: none;
  color: var(--text-primary);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 2px 7px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}
.agora-linha {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--danger);
  z-index: 4;
}
.agora-linha::before {
  content: "";
  position: absolute;
  left: -4px;
  top: -3px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--danger);
}
/* ======================================================== TELA DE ATENDIMENTO */
.page:has(.at-folha) { max-width: 1040px; margin: 0 auto; }
.at-folha { width: 100%; }

.at-cabecalho {
  margin-bottom: var(--space-4);
}
.at-voltar {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 0 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--accent);
  background: none;
  border: none;
  cursor: pointer;
  transition: opacity 0.15s;
}
.at-voltar:hover { opacity: 0.8; }
.at-voltar svg { width: 16px; height: 16px; }

/* Banner de destaque do paciente */
.at-paciente-destaque {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  margin-bottom: var(--space-5);
}
:root[data-theme="light"] .at-paciente-destaque {
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05), 0 4px 12px rgba(0, 0, 0, 0.02);
}
.at-paciente-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 70%, #000));
  color: #ffffff;
  font-size: 20px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}
.at-paciente-dados { flex: 1; min-width: 0; }
.at-paciente-linha-titulo {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 3px;
}
.at-paciente-nome {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-bright);
}
.at-tag-servico {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 15%, transparent);
  color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
}
.at-paciente-meta {
  margin: 0;
  font-size: 13px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
}
.at-paciente-meta svg { width: 14px; height: 14px; color: var(--text-muted); }

/* Guias (Abas) Apple Segmented */
.at-guias { margin-bottom: var(--space-5); }

/* Grid de seções */
.at-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(290px, 0.95fr);
  gap: 20px;
  align-items: start;
}
@media (max-width: 860px) {
  .at-grid { grid-template-columns: 1fr; }
}

.at-coluna-principal,
.at-coluna-lateral {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Cards de Seção */
.at-secao-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  transition: border-color 0.15s ease;
}
:root[data-theme="light"] .at-secao-card {
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 4px 12px rgba(0, 0, 0, 0.02);
}

.at-secao-topo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.at-secao-icone {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.at-secao-icone svg { width: 18px; height: 18px; }
.at-secao-info { flex: 1; min-width: 0; }
.at-secao-titulo {
  margin: 0 0 2px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-bright);
  letter-spacing: -0.01em;
}
.at-secao-desc {
  margin: 0;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.3;
}

/* Observações Textarea */
.at-textarea-clinica {
  width: 100%;
  min-height: 110px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-input);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 14px;
  line-height: 1.5;
  resize: vertical;
  box-sizing: border-box;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.at-textarea-clinica:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent);
}
.at-obs-acoes {
  display: flex;
  justify-content: flex-end;
  margin-top: 12px;
}
.at-salvar-obs {
  min-width: 112px;
  justify-content: center;
}

/* Registro Fotográfico */
.at-btn-add-foto {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: 8px;
}
.at-btn-add-foto svg { width: 14px; height: 14px; }

.at-fotos {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 12px;
}
.at-foto-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
}
.at-foto-img-wrap {
  width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
  background: #000;
}
.at-foto-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.2s ease;
}
.at-foto-card:hover .at-foto-img-wrap img { transform: scale(1.05); }
.at-foto-legenda {
  padding: 6px 8px;
  font-size: 11px;
  color: var(--text-secondary);
  word-break: break-word;
  line-height: 1.3;
}
.at-foto-remover {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 6px;
  font-size: 11px;
  font-weight: 500;
  color: var(--danger, #ef4444);
  background: transparent;
  border: none;
  border-top: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.15s;
}
.at-foto-remover:hover {
  background: color-mix(in srgb, var(--danger, #ef4444) 10%, transparent);
}
.at-foto-remover svg { width: 12px; height: 12px; }

/* Empty state fotos */
.at-fotos-vazio {
  border: 2px dashed var(--border);
  border-radius: 14px;
  padding: 24px 16px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  background: var(--bg-elevated);
  opacity: 0.85;
}
.at-fotos-vazio:hover {
  border-color: var(--accent);
  opacity: 1;
  background: color-mix(in srgb, var(--accent) 4%, var(--bg-elevated));
}
.at-fotos-vazio-icone {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 8px;
}
.at-fotos-vazio-icone svg { width: 18px; height: 18px; }
.at-fotos-vazio-texto {
  margin: 0 0 4px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}
.at-fotos-vazio-dica {
  font-size: 11px;
  color: var(--text-muted);
  display: block;
}

.at-foto-upload-box {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 12px;
  padding: 10px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.at-input-legenda {
  flex: 1;
  padding: 6px 10px;
  font-size: 13px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-input);
  color: var(--text-primary);
}
button.at-foto-img-wrap {
  display: block;
  padding: 0;
  border: 0;
  cursor: zoom-in;
  font: inherit;
  color: inherit;
}
button.at-foto-img-wrap:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.at-ba-acoes {
  display: flex;
  justify-content: flex-end;
  margin-top: 12px;
}
.at-pares {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}
.at-pares:empty { display: none; margin: 0; }
.at-par {
  display: flex;
  align-items: center;
  gap: 4px;
  width: 100%;
  padding: 6px 8px 6px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
}
.at-par:hover { border-color: var(--accent); }
.at-par-abrir {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex: 1;
  min-width: 0;
  padding: 4px 0;
  border: 0;
  background: none;
  cursor: pointer;
  font: inherit;
  color: inherit;
  text-align: left;
}
.at-par-textos { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.at-par-titulo {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-bright);
}
.at-par-legenda {
  font-size: 12px;
  color: var(--text-secondary);
  word-break: break-word;
}
.at-par svg { width: 16px; height: 16px; color: var(--text-muted); flex: none; }

.at-foto-grande {
  display: block;
  width: 100%;
  max-height: 72vh;
  object-fit: contain;
  background: #111;
  border-radius: 12px;
}
.at-foto-grande-legenda {
  margin: 10px 0 0;
  text-align: center;
  color: var(--text-secondary);
  font-size: 14px;
}

.ba-frame {
  position: relative;
  width: 100%;
  height: min(68vh, 640px);
  overflow: hidden;
  border-radius: 12px;
  background: #111;
  touch-action: none;
  user-select: none;
  cursor: ew-resize;
}
.ba-lado {
  position: absolute;
  inset: 0;
  overflow: hidden;
}
.ba-img {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  pointer-events: none;
}
.ba-palco {
  display: flex;
  justify-content: center;
}
.ba-fundo {
  position: absolute;
  inset: -10%;
  width: 120%;
  height: 120%;
  max-width: none;
  object-fit: cover;
  filter: blur(28px) saturate(1.2) brightness(.85);
  pointer-events: none;
}
.ba-frame.ajustando { cursor: grab; }
.ba-img { transform-origin: center center; }
.ba-grade {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  display: none;
  --ba-linha: rgba(255, 255, 255, .6);
  --ba-linha-fina: rgba(255, 255, 255, .28);
}
.ba-grade[data-tipo="tercos"],
.ba-grade[data-tipo="fina"] { display: block; }
.ba-grade[data-tipo="tercos"] {
  background-image:
    linear-gradient(to right, transparent calc(33.333% - .5px), var(--ba-linha) calc(33.333% - .5px), var(--ba-linha) calc(33.333% + .5px), transparent calc(33.333% + .5px),
                              transparent calc(66.666% - .5px), var(--ba-linha) calc(66.666% - .5px), var(--ba-linha) calc(66.666% + .5px), transparent calc(66.666% + .5px)),
    linear-gradient(to bottom, transparent calc(33.333% - .5px), var(--ba-linha) calc(33.333% - .5px), var(--ba-linha) calc(33.333% + .5px), transparent calc(33.333% + .5px),
                               transparent calc(66.666% - .5px), var(--ba-linha) calc(66.666% - .5px), var(--ba-linha) calc(66.666% + .5px), transparent calc(66.666% + .5px));
}
/* fina: uma linha a cada 10%, com a cruz do meio mais forte para achar o centro do rosto */
.ba-grade[data-tipo="fina"] {
  background-image:
    linear-gradient(to right, transparent calc(50% - .5px), var(--ba-linha) calc(50% - .5px), var(--ba-linha) calc(50% + .5px), transparent calc(50% + .5px)),
    linear-gradient(to bottom, transparent calc(50% - .5px), var(--ba-linha) calc(50% - .5px), var(--ba-linha) calc(50% + .5px), transparent calc(50% + .5px)),
    repeating-linear-gradient(to right, transparent 0, transparent calc(10% - 1px), var(--ba-linha-fina) calc(10% - 1px), var(--ba-linha-fina) 10%),
    repeating-linear-gradient(to bottom, transparent 0, transparent calc(10% - 1px), var(--ba-linha-fina) calc(10% - 1px), var(--ba-linha-fina) 10%);
}
.ba-rotulo-editando {
  display: none;
  left: 50%;
  transform: translateX(-50%);
  background: color-mix(in srgb, var(--accent) 85%, transparent);
}
.ba-frame.ajustando .ba-rotulo-editando { display: block; }
.ba-frame.ajustando .ba-barra,
.ba-frame.ajustando .ba-rotulo-antes,
.ba-frame.ajustando .ba-rotulo-depois { display: none; }
.ba-grupo {
  display: inline-flex;
  gap: 4px;
}
.ba-proporcao {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  font-size: 13px;
  color: var(--text-secondary);
}
.ba-proporcao select {
  width: auto;
  padding: 4px 8px;
  font-size: 13px;
}
.ba-editor {
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
}
.ba-editor[hidden] { display: none; }
.ba-editor > .ba-ferramentas { margin-top: 0; }
.ba-pronto { margin-left: auto; }
.ba-regua {
  display: grid;
  grid-template-columns: 84px 1fr 56px;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  font-size: 13px;
  color: var(--text-secondary);
}
.ba-regua input[type="range"] {
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  accent-color: var(--accent);
}
.ba-regua output {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
@media (max-width: 600px) {
  .ba-proporcao { margin-left: 0; }
  .ba-regua { grid-template-columns: 70px 1fr 48px; }
}
.ba-frame.ajustando.arrastando { cursor: grabbing; }
.ba-ferramentas {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
}
.ba-dica {
  margin: 8px 0 0;
  font-size: 12px;
  color: var(--text-secondary);
}
.ba-status {
  margin-right: auto;
  font-size: 13px;
  color: var(--warning);
}
.ba-depois {
  position: absolute;
  inset: 0;
  clip-path: inset(0 0 0 50%);
}
.ba-sumiu {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, .88);
  background: #1a1a1a;
  font-size: 14px;
}
.ba-barra {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 44px;
  transform: translateX(-50%);
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ba-barra::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: #fff;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .28);
}
.ba-puxador {
  position: relative;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .35);
}
.ba-puxador::before,
.ba-puxador::after {
  content: "";
  position: absolute;
  top: 12px;
  border: 6px solid transparent;
}
.ba-puxador::before { left: 8px; border-right-color: #64748b; }
.ba-puxador::after { right: 8px; border-left-color: #64748b; }
.ba-rotulo {
  position: absolute;
  top: 10px;
  z-index: 2;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: #fff;
  background: rgba(0, 0, 0, .45);
  padding: 4px 8px;
  border-radius: 999px;
  pointer-events: none;
}
.ba-rotulo-antes { left: 10px; }
.ba-rotulo-depois { right: 10px; }
.ba-legendas {
  margin: 10px 0 0;
  text-align: center;
  color: var(--text-secondary);
  font-size: 13px;
}

/* Cobrança e Pagamento */
.at-input-moeda-wrap {
  display: flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-input);
  padding: 0 12px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.at-input-moeda-wrap:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent);
}
.at-moeda-simbolo {
  font-weight: 600;
  font-size: 14px;
  color: var(--text-muted);
  margin-right: 6px;
  user-select: none;
}
.at-input-valor {
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-bright);
  padding: 10px 0;
  width: 100%;
}

.at-chips-pagamento {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}
.at-chips-pagamento .chip {
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text-secondary);
  border-radius: 10px;
  padding: 6px 13px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.16s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.at-chips-pagamento .chip:hover {
  border-color: var(--accent);
  color: var(--text-primary);
}
.at-chips-pagamento .chip.on {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
}

/* Card de Finalização */
.at-acoes-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px 20px;
}
.at-concluir {
  width: 100%;
  padding: 12px 18px;
  font-size: 15px;
  font-weight: 600;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
}
.at-concluir svg { width: 18px; height: 18px; }
.at-concluido {
  box-shadow: none;
  cursor: default;
  user-select: none;
  background: color-mix(in srgb, var(--accent) 16%, var(--bg-card));
  color: var(--accent-dark);
  border: 1px solid color-mix(in srgb, var(--accent) 42%, transparent);
}
:root:not([data-theme="light"]) .at-concluido { color: var(--accent-light); }
.at-logistica {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-muted);
  padding: 8px 0;
  background: none;
  border: none;
  cursor: pointer;
}
.at-logistica:hover { color: var(--text-primary); }
.at-logistica svg { width: 15px; height: 15px; }

/* Fichas no Atendimento */
.at-fichas-vazio {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 40px 24px;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}
:root[data-theme="light"] .at-fichas-vazio { background: #ffffff; }
.at-fichas-topo {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.at-fichas-titulo {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-bright);
  display: flex;
  align-items: center;
  gap: 8px;
}
.at-fichas-titulo svg { width: 18px; height: 18px; color: var(--accent); }
.at-fichas-lista {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.at-ficha-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.03);
}
:root[data-theme="light"] .at-ficha-card { background: #ffffff; }
.at-ficha-card:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}
.at-ficha-card-icone {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.at-ficha-card-icone svg { width: 18px; height: 18px; }
.at-ficha-card-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.at-ficha-card-info b { font-size: 14px; font-weight: 600; color: var(--text-bright); }
.at-ficha-card-info span { font-size: 12px; color: var(--text-muted); }
.at-ficha-card-seta { color: var(--text-muted); display: flex; align-items: center; }
.at-ficha-card-seta svg { width: 16px; height: 16px; }

.ficha-preenchida { margin: 8px 0 14px; }
.ficha-topo { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ficha-topo b { font-size: 15px; }
.ficha-acoes { display: flex; align-items: center; gap: 14px; flex-shrink: 0; }
#ficha-impressao { display: none; }
.formula-busca { width: min(420px, 100%); margin: 0 0 12px; }
.formula-pag { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
.formula-pag[hidden] { display: none; }
.formula-pag-info { margin-right: auto; }
.formula-corpo {
  white-space: pre-wrap;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.5px;
  line-height: 1.45;
  margin: 0;
}
/* tour do painel */
.tour-caixa { position: fixed; right: 24px; bottom: 96px; z-index: 1200; width: min(360px, calc(100vw - 32px));
  background: var(--bg-elevated); color: var(--text-primary); border: 1px solid var(--accent);
  border-radius: 14px; padding: 16px; box-shadow: 0 18px 50px rgba(0, 0, 0, .35); }
.tour-caixa b { display: block; font-size: 15px; margin-bottom: 6px; }
.tour-caixa p { margin: 0 0 12px; font-size: 13px; color: var(--text-secondary); line-height: 1.45; }
.tour-passo { font-size: 11px; color: var(--accent); margin-bottom: 4px; text-transform: uppercase; letter-spacing: .04em; }
.tour-acoes { display: flex; justify-content: flex-end; gap: 6px; flex-wrap: wrap; }
.tour-alvo { outline: 2px solid var(--accent) !important; outline-offset: 3px; border-radius: 10px;
  box-shadow: 0 0 0 6px var(--accent-glow) !important; transition: outline-color .2s; }
@media (max-width: 640px) { .tour-caixa { right: 16px; left: 16px; width: auto; bottom: 88px; } }

/* mensalidade da Sofia */
.planos-grade { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.plano-card { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 16px; padding: 18px;
  display: flex; flex-direction: column; gap: 8px; }
.plano-card.destaque { background: var(--accent); color: #fff; border-color: transparent; }
.plano-card.destaque .sub, .plano-card.destaque .plano-de { color: rgba(255,255,255,.82); }
.plano-kicker { font-size: 12px; letter-spacing: .06em; text-transform: uppercase; font-weight: 650; }
.plano-preco { font-size: 40px; line-height: 1; font-weight: 720; letter-spacing: -.03em; }
.plano-de { font-size: 13px; color: var(--text-secondary); text-decoration: line-through; }
.plano-selo { align-self: flex-start; border-radius: 999px; padding: 4px 10px; font-size: 12px; font-weight: 650;
  border: 1px solid var(--border); color: var(--text-secondary); }
.plano-card.destaque .plano-selo { background: #f5b942; color: #1c1403; }
.plano-card .btn { margin-top: auto; }
.mens-email-linha { display: flex; gap: 8px; }
.mens-email-linha input { flex: 1; min-width: 0; }

/* escolha em linha (rádio + texto + explicação embaixo) */
.form-group label.opcao-radio { display: flex; align-items: flex-start; gap: 10px; margin: 8px 0;
  font-size: 13px; font-weight: 500; color: var(--text-primary); cursor: pointer; }
.opcao-radio input { width: auto; margin: 3px 0 0; flex: none; }
.opcao-radio span { display: flex; flex-direction: column; gap: 2px; }
.opcao-radio small { font-weight: 400; }

/* plano do paciente */
.plano-cabeca { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 10px; }
.plano-cabeca .sub { margin: 0; }

/* carimbo do profissional nas folhas: nome em cima, assinatura embaixo */
.carimbo-topo { display: flex; flex-direction: column; align-items: center; gap: 2px; text-align: center;
  padding-bottom: 12px; margin-bottom: 18px; border-bottom: 1px solid var(--border); }
.carimbo-topo b { font-size: 17px; }
.carimbo-topo span { font-size: 13px; color: var(--text-secondary); }
.carimbo-rodape { display: flex; flex-direction: column; align-items: center; gap: 2px; text-align: center;
  margin-top: 40px; break-inside: avoid; page-break-inside: avoid; }
.formula-receita .carimbo-rodape { margin-top: auto; padding-top: 28px; }
.carimbo-assina { max-height: 70px; max-width: 240px; object-fit: contain; margin-bottom: -8px; }
.carimbo-linha { display: block; width: 260px; border-top: 1px solid var(--text-primary); margin-bottom: 4px; }
.carimbo-rodape b { font-size: 14px; }
.carimbo-rodape span { font-size: 12px; color: var(--text-secondary); }
.assina-imagem { display: flex; align-items: center; justify-content: center; min-height: 90px; padding: 10px;
  border: 1px dashed var(--border); border-radius: 10px; background: var(--bg-input); margin-bottom: 8px; }
.assina-imagem img { max-height: 80px; max-width: 100%; object-fit: contain; }
.carimbo-folha { background: var(--papel); color: var(--papel-texto); border-radius: 10px; padding: 18px 16px; }
.carimbo-folha .carimbo-topo { border-bottom-color: var(--papel-linha); }
.carimbo-folha .carimbo-topo span, .carimbo-folha .carimbo-rodape span, .carimbo-folha .sub { color: var(--papel-suave); }
.carimbo-folha .carimbo-linha { border-top-color: var(--papel-texto); }

.formula-editor { min-height: 280px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; }
.formula-receita {
  display: flex;
  flex-direction: column;
  min-height: 70vh;
}
.formula-receita-paciente,
.formula-receita-profissional {
  text-align: center;
  font-weight: 700;
  margin: 0;
}
.formula-receita-paciente { font-size: 20px; margin-bottom: 24px; }
.formula-receita-titulo { text-align: center; font-size: 16px; font-weight: 600; margin: 0 0 16px; }
.formula-receita-miolo { flex: 1; }
.formula-receita-profissional { margin-top: auto; padding-top: 28px; font-size: 15px; }
.ficha-caixas:not(.inline) { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 18px; }
.ficha-caixas.inline { display: flex; flex-wrap: wrap; gap: 8px 14px; }
.ficha-caixa {
  display: flex; align-items: flex-start; gap: 8px; width: 100%;
  background: none; border: 0; color: inherit; font: inherit; font-size: 14px;
  text-align: left; padding: 5px 0; cursor: pointer;
}
.ficha-caixas.inline .ficha-caixa { width: auto; }
.ficha-caixa i {
  width: 16px; height: 16px; margin-top: 2px; flex-shrink: 0;
  border: 1px solid var(--border); border-radius: 4px; background: var(--bg-input);
}
.ficha-caixa.on i { background: var(--accent); border-color: var(--accent); }
.ficha-texto { min-height: 72px; margin: 6px 0; }
.fi-doc { font-size: 20px; font-weight: 600; letter-spacing: -0.02em; margin: 0 0 12px; color: var(--text-bright); }
.fi-titulo { font-size: 13px; font-weight: 600; letter-spacing: 0.03em; margin: 18px 0 8px; color: var(--text-bright); }
.fi-topico { white-space: pre-wrap; margin: 8px 0; font-size: 14px; }
.fi-campo span { display: block; font-size: 12px; color: var(--text-muted); margin-bottom: 2px; }
.fi-campo b { font-weight: 500; }
.fi-traco { display: block; border-bottom: 1px solid var(--border); height: 28px; }
.fi-nota, .fi-top { min-height: 72px; }
.fi-extra { margin: 0 0 8px 24px; max-width: 280px; }
.fi-extra-ver { margin-left: 8px; color: var(--text-secondary); }
.ficha-op { margin: 0; }
.ficha-vista .ficha-caixa { cursor: default; }
.fi-assinatura { display: grid; grid-template-columns: 1fr 1fr; column-gap: 20px; margin-top: 8px; }
.fi-assinatura > .fi-titulo,
.fi-assinatura > .fi-assina-linha { grid-column: 1 / -1; }
.fi-assina-linha { margin: 10px 0 14px; }
.fi-assina-linha span { display: block; font-size: 12px; color: var(--text-muted); margin-bottom: 4px; }
.fi-assina-linha b { font-weight: 500; }
.fi-assina {
  width: 100%; height: 96px; display: block; touch-action: none; color: var(--text-primary);
  background: var(--bg-input); border: 1px solid var(--border); border-radius: 12px;
}
.fi-assina-img { width: 100%; height: 96px; object-fit: contain; background: var(--bg-input); border-radius: 12px; display: block; }
/* Editor de fichas clínicas */
.fi-editor { max-width: 760px; margin: 0 auto; }
.fi-nome-grupo { margin-bottom: 20px; }
.fi-titulo-input { font-size: 15.5px; font-weight: 600; padding: 10px 14px; }
.fi-topo-nav { margin-bottom: 8px; }
.fi-vista-cabecalho { margin-bottom: 18px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }

/* Cartões de blocos */
.fi-cartao {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  margin-bottom: 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.fi-cartao:hover {
  border-color: color-mix(in srgb, var(--accent) 30%, var(--border));
}

.fi-cartao-cab {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.fi-cartao-info {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.fi-cartao-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 99px;
  background: var(--bg-elevated);
  color: var(--text-primary);
  border: 1px solid var(--border);
}
.fi-cartao-tag svg { width: 14px; height: 14px; }
.fi-tag-titulo { background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent); border-color: color-mix(in srgb, var(--accent) 25%, transparent); }
.fi-tag-campos { background: color-mix(in srgb, #0ea5e9 12%, transparent); color: #0284c7; border-color: color-mix(in srgb, #0ea5e9 25%, transparent); }
.fi-tag-caixas { background: color-mix(in srgb, #10b981 12%, transparent); color: #059669; border-color: color-mix(in srgb, #10b981 25%, transparent); }
.fi-tag-topico { background: color-mix(in srgb, #f59e0b 12%, transparent); color: #d97706; border-color: color-mix(in srgb, #f59e0b 25%, transparent); }
.fi-tag-assinatura { background: color-mix(in srgb, #8b5cf6 12%, transparent); color: #7c3aed; border-color: color-mix(in srgb, #8b5cf6 25%, transparent); }

.fi-cartao-sub {
  font-size: 12px;
  color: var(--text-muted);
}
.fi-cartao-acoes-topo {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Opções e itens dentro dos blocos */
.fi-itens-label {
  display: block;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 12px 0 8px;
}
.fi-op {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.fi-op-check {
  font-size: 16px;
  color: var(--text-muted);
  user-select: none;
  width: 22px;
  text-align: center;
  flex: none;
}
.fi-op input {
  flex: 1;
  min-width: 0;
}
.fi-btn-detalhe {
  flex: none;
  font-size: 12px;
  padding: 4px 10px;
  height: 34px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  border: 1px dashed var(--border);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.fi-btn-detalhe svg { width: 14px; height: 14px; }
.fi-btn-detalhe:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.fi-btn-detalhe.ativo {
  background: var(--accent-subtle);
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 600;
}

.fi-campo-linha {
  display: grid;
  grid-template-columns: minmax(160px, 1.2fr) minmax(140px, 1fr) auto;
  gap: 10px;
  align-items: center;
}
.fi-campo-rotulo-wrap {
  min-width: 0;
}
.fi-campo-guia {
  background: var(--bg-elevated);
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 12px;
  color: var(--text-muted);
  font-style: italic;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  user-select: none;
}

.fi-cartao-rodape {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
  flex-wrap: wrap;
}
.fi-inline-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Seção de adicionar blocos */
.fi-adicionar-secao {
  margin: 24px 0 20px;
  background: color-mix(in srgb, var(--accent) 3%, var(--bg-elevated));
  border: 1px dashed color-mix(in srgb, var(--accent) 30%, var(--border));
  border-radius: var(--radius-lg);
  padding: 18px 20px;
}
.fi-adicionar-titulo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 14px;
}
.fi-adicionar-titulo svg {
  color: var(--accent);
  width: 16px;
  height: 16px;
}
.fi-add-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px;
}
.fi-add-btn {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-card);
  text-align: left;
  cursor: pointer;
  transition: all 0.15s ease;
  color: inherit;
}
.fi-add-btn:hover {
  border-color: var(--accent);
  background: var(--bg-hover);
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.05);
}
.fi-add-icon {
  width: 32px;
  height: 32px;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: var(--accent-subtle);
  color: var(--accent);
  margin-top: 1px;
}
.fi-add-icon svg { width: 16px; height: 16px; }
.fi-add-info {
  flex: 1;
  min-width: 0;
}
.fi-add-info b {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}
.fi-add-info span {
  display: block;
  font-size: 11.5px;
  color: var(--text-muted);
  line-height: 1.3;
  margin-top: 3px;
}

/* Empty state */
.fi-blocos-vazio {
  text-align: center;
  padding: 36px 20px;
  background: var(--bg-elevated);
  border: 1px dashed var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 16px;
}
.fi-vazio-icone {
  width: 48px;
  height: 48px;
  margin: 0 auto 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--accent-subtle);
  color: var(--accent);
}
.fi-vazio-icone svg { width: 22px; height: 22px; }
.fi-blocos-vazio h4 {
  margin: 0 0 6px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}
.fi-blocos-vazio p {
  margin: 0 auto;
  font-size: 13px;
  color: var(--text-muted);
  max-width: 420px;
  line-height: 1.4;
}

/* Assinatura configs */
.fi-assina-preview-wrap {
  margin-bottom: 8px;
}
.fi-assina-opcoes {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* Rodapé do editor */
.fi-editor-rodape {
  padding-top: 20px;
  margin-top: 24px;
  border-top: 1px solid var(--border);
}
.fi-rodape-acoes {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.fi-acoes { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: center; }
.btn-text.on { font-weight: 600; }
input.at-arquivo {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); border: 0;
}
#at-legenda { margin-top: 8px; }
.agora-linha { position: absolute; left: 0; right: 0; height: 2px; background: var(--danger); z-index: 3; }

/* -------------------------------------------------------- conversas */
.conversas { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 18px; height: calc(100vh - 160px); min-height: 520px; }
.sofia-pacientes .conversas { height: calc(100vh - 250px); min-height: 420px; }
.ficha { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px 18px; overflow: auto; }
.ficha-nome { font-size: 20px; font-weight: 600; letter-spacing: -0.02em; color: var(--text-bright); }
.ficha-fone { color: var(--text-muted); font-size: 13px; margin: 4px 0 16px; }
.ficha-linha { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; width: 100%;
  background: none; border: 0; color: inherit; text-align: left; cursor: pointer; padding: 8px 0; font: inherit; }
.ficha-linha span { color: var(--text-muted); font-size: 12px; }
.ficha-linha b { font-weight: 500; }
.alergia { color: #e11d48; font-size: 13px; margin: 0 0 12px; background: none; border: 0; padding: 0; text-align: left; cursor: pointer; font: inherit; }
.svc-linha { color: var(--text-muted); font-size: 13px; margin-top: 8px; }
.disclosure, .btn-text { background: none; border: 0; color: var(--accent); cursor: pointer; font: inherit; font-size: 13px; padding: 10px 0; display: inline-flex; align-items: center; gap: 4px; }
.btn-text svg { display: block; width: 16px; height: 16px; }
.at-voltar { display: inline-flex; align-items: center; gap: 2px; padding: 0 0 12px; line-height: 1; }
.at-voltar svg { display: block; width: 16px; height: 16px; }
.interruptores { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.chip { border: 1px solid var(--border); background: var(--bg-elevated); color: var(--text-primary);
  border-radius: 999px; padding: 4px 10px; font: inherit; font-size: 13px; cursor: pointer; }
.chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.retorno-linha { display: flex; gap: 8px; }
.retorno-linha input { width: 72px; }
.retorno-linha select { flex: 1; }
.conversas > .panel { display: flex; flex-direction: column; height: 100%; margin: 0; overflow: hidden; }
.conv-lista { flex: 1; display: flex; flex-direction: column; overflow-y: auto; }
.conv-item { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border: none; background: none;
  border-bottom: 1px solid var(--border); color: var(--text-primary); cursor: pointer; text-align: left; width: 100%; }
.conv-item:hover, .conv-item.ativo { background: var(--bg-hover); }
.conv-item .info { flex: 1; min-width: 0; }
.conv-item .info b { display: block; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv-item .info span { font-size: 12px; color: var(--text-muted); }
.grupo-titulo { padding: 10px 14px 6px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; color: var(--text-muted); }
.search-box { display: flex; align-items: center; gap: 10px; background: var(--bg-input); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 0 12px; }
.search-box svg { color: var(--text-muted); }
.search-box input { border: none; background: none; box-shadow: none !important; padding: 10px 0; }
#conv-detalhe { display: flex; flex-direction: column; height: 100%; overflow: hidden; }
#conv-detalhe .chat {
  flex: 1; display: flex; flex-direction: column; gap: 10px; padding: 18px 20px; overflow-y: auto; min-height: 0; max-height: none;
  background-color: #ece5dd;
  background-image: url("/assets/chat-fundo.svg");
  background-size: 380px;
}
:root:not([data-theme="light"]) #conv-detalhe .chat {
  background-color: #0b141a;
  background-image: linear-gradient(rgba(11, 20, 26, 0.92), rgba(11, 20, 26, 0.92)), url("/assets/chat-fundo.svg");
  background-size: 380px;
}
#conv-detalhe .panel-header { flex-shrink: 0; }
#conv-detalhe .responder { flex-shrink: 0; display: flex; gap: 8px; align-items: flex-end; padding: 12px 16px; background: var(--bg-card); border-top: 1px solid var(--border); }
.msg-linha { display: flex; align-items: flex-end; gap: 8px; max-width: 84%; }
.msg-linha.user { align-self: flex-start; }
.msg-linha.assistant { align-self: flex-end; }

.msg-avatar {
  width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 600; margin-bottom: 2px;
}
.msg-avatar.bot-avatar {
  background: color-mix(in srgb, var(--accent) 18%, #ffffff);
  color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 32%, transparent);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}
:root:not([data-theme="light"]) .msg-avatar.bot-avatar {
  background: color-mix(in srgb, var(--accent) 22%, var(--bg-card));
  color: var(--accent-light);
  border-color: color-mix(in srgb, var(--accent) 35%, transparent);
}
.msg-avatar.bot-avatar svg { width: 17px; height: 17px; }

.msg-avatar.user-avatar {
  background: #e2e8f0; color: #334155;
  border: 1px solid rgba(0, 0, 0, 0.08);
}
:root:not([data-theme="light"]) .msg-avatar.user-avatar {
  background: var(--bg-hover); color: var(--text-primary);
  border-color: var(--border);
}

.msg {
  max-width: 82%; padding: 10px 14px; border-radius: 14px;
  font-size: 13.5px; line-height: 1.45; white-space: pre-wrap; word-break: break-word;
}
.msg-linha .msg { max-width: none; flex: 1; }
.msg .quando { display: block; font-size: 10px; margin-top: 4px; }

/* Balão do Paciente (Entrada - Esquerda) */
.msg.user {
  align-self: flex-start;
  background: #ffffff;
  color: #111b21;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-bottom-left-radius: 3px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}
.msg.user .quando { color: #64748b; text-align: left; }
:root:not([data-theme="light"]) .msg.user {
  background: var(--bg-card);
  color: var(--text-primary);
  border-color: var(--border);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}
:root:not([data-theme="light"]) .msg.user .quando { color: var(--text-muted); }

/* Balão do Profissional / Sofia (Saída - Direita) */
.msg.assistant {
  align-self: flex-end;
  background: #d9fdd3;
  color: #111b21;
  border: 1px solid #c2ecc0;
  border-bottom-right-radius: 3px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}
.msg.assistant .quando { color: #55785f; text-align: right; }
:root:not([data-theme="light"]) .msg.assistant {
  background: #005c4b;
  color: #e9edef;
  border: 1px solid #02735e;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}
:root:not([data-theme="light"]) .msg.assistant .quando { color: rgba(233, 237, 239, 0.65); }

/* Mensagem da Equipe (Humana) */
.msg.equipe {
  background: #e0f2fe;
  color: #0c4a6e;
  border-color: #bae6fd;
}
.msg.equipe .quando { color: #0284c7; }
:root:not([data-theme="light"]) .msg.equipe {
  background: color-mix(in srgb, var(--info) 22%, var(--bg-card));
  color: #bfdbfe;
  border-color: var(--info);
}
:root:not([data-theme="light"]) .msg.equipe .quando { color: #60a5fa; }

.msg.system { align-self: center; background: var(--warning-bg); color: var(--warning); font-size: 12px; }
/* a equipe responde daqui quando a Sofia recua — sem isso, pausar o bot
   deixaria a conversa sem ninguém do outro lado */
.responder textarea { flex: 1; resize: vertical; min-height: 38px; font: inherit;
  font-size: 13px; padding: 9px 12px; border-radius: var(--radius);
  border: 1px solid var(--border); background: var(--bg-input); color: var(--text-primary); }
.responder textarea:focus { outline: none; border-color: var(--accent); }
.responder .btn { height: 38px; }
.selo-equipe { display: inline-block; font-size: 10px; text-transform: uppercase;
  letter-spacing: .04em; color: var(--info); border: 1px solid var(--info);
  border-radius: 4px; padding: 0 4px; margin-right: 5px; vertical-align: 1px; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: 440px; max-width: 100vw; height: 100vh; height: 100dvh; background: var(--bg-card);
  border-left: 1px solid var(--border); z-index: 150; transform: translateX(100%); transition: transform .25s ease;
  display: flex; flex-direction: column; box-shadow: var(--shadow-lg); }
.drawer.open { transform: none; }
.drawer-head { flex-shrink: 0; display: flex; align-items: center; gap: 8px; padding: 14px 16px; border-bottom: 1px solid var(--border); background: var(--bg-card); }
.drawer-head > div { flex: 1; } .drawer-head b { display: block; color: var(--text-bright); } .drawer-head span { font-size: 12px; color: var(--text-muted); }
.drawer .chat {
  flex: 1 1 0%;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px 16px 24px;
  overflow-y: auto;
  min-height: 0;
  overscroll-behavior: contain;
  background-color: #ece5dd;
  background-image: url("/assets/chat-fundo.svg");
  background-size: 380px;
}
:root:not([data-theme="light"]) .drawer .chat {
  background-color: #0b141a;
  background-image: linear-gradient(rgba(11, 20, 26, 0.92), rgba(11, 20, 26, 0.92)), url("/assets/chat-fundo.svg");
  background-size: 380px;
}
.drawer .msg-linha { max-width: 88%; gap: 6px; }
.drawer .msg-avatar { width: 28px; height: 28px; font-size: 10px; margin-bottom: 2px; }
.drawer .msg-avatar.bot-avatar svg { width: 15px; height: 15px; }
.drawer .msg { font-size: 13.5px; padding: 9px 13px; line-height: 1.45; }
.drawer-input { flex-shrink: 0; display: flex; gap: 8px; padding: 12px 14px; border-top: 1px solid var(--border); background: var(--bg-card); }
.drawer-input input { flex: 1; border-radius: var(--radius); border: 1px solid var(--border); background: var(--bg-input); padding: 10px 14px; font: inherit; font-size: 13.5px; color: var(--text-primary); }
.drawer-input input:focus { outline: none; border-color: var(--accent); }
.drawer-input .btn { height: auto; padding: 0 14px; display: flex; align-items: center; justify-content: center; }

.pg-opcoes { display: flex; flex-direction: column; gap: 6px; align-self: flex-end; max-width: 88%; margin-top: -4px; }
.pg-opcoes button { background: #ffffff; border: 1px solid rgba(0, 0, 0, 0.12); color: var(--accent);
  border-radius: 12px; padding: 8px 14px; font-size: 13px; font-weight: 500; text-align: left; cursor: pointer;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04); transition: all .15s ease; line-height: 1.35; }
.pg-opcoes button:hover { background: #f0fdf4; border-color: var(--accent); transform: translateY(-1px); }
:root:not([data-theme="light"]) .pg-opcoes button { background: var(--bg-card); border-color: var(--border); color: var(--accent-light); }
:root:not([data-theme="light"]) .pg-opcoes button:hover { background: var(--bg-hover); }

.typing-linha { align-self: flex-end; }
.typing-linha .typing {
  align-self: flex-end; display: flex; gap: 4px; padding: 10px 14px;
  background: #d9fdd3; border: 1px solid #c2ecc0; border-radius: 14px; border-bottom-right-radius: 3px;
}
:root:not([data-theme="light"]) .typing-linha .typing { background: #005c4b; border-color: #02735e; }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: #55785f; animation: blink 1.2s infinite; }
:root:not([data-theme="light"]) .typing i { background: rgba(233, 237, 239, 0.65); }
.typing i:nth-child(2) { animation-delay: .2s; } .typing i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .3; } 40% { opacity: 1; } }

/* ----------------------------------------------------- playground */
.fab { position: fixed; right: 24px; bottom: 24px; z-index: 50; display: flex; align-items: center; gap: 8px;
  padding: 12px 18px; border-radius: 30px; border: none; cursor: pointer; font-weight: 600; font-size: 13px;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark)); color: var(--bg-deepest); box-shadow: 0 6px 24px var(--accent-glow); }

/* ---------------------------------------------------------- avisos */
.toasts { position: fixed; top: 20px; right: 20px; z-index: 300; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--bg-elevated); border: 1px solid var(--border); border-left: 3px solid var(--success);
  padding: 11px 16px; border-radius: var(--radius-sm); font-size: 13px; box-shadow: var(--shadow); animation: fade .2s; max-width: 360px; }
.toast.erro { border-left-color: var(--danger); }

pre.prompt { background: var(--bg-input); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px;
  font-size: 12px; white-space: pre-wrap; max-height: 460px; overflow: auto; color: var(--text-secondary); }
.dropzone { border: 2px dashed var(--border); border-radius: var(--radius); padding: 26px; text-align: center; cursor: pointer;
  color: var(--text-secondary); transition: all .15s; margin-bottom: 14px; }
.dropzone:hover, .dropzone.dragover { border-color: var(--accent); background: var(--accent-subtle); }
.dropzone svg { width: 28px; height: 28px; color: var(--accent); margin-bottom: 6px; }
.dropzone .hint { font-size: 11px; color: var(--text-muted); margin-top: 4px; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: var(--text-muted); }
.status-dot.ok { background: var(--success); box-shadow: 0 0 8px var(--success); }
.status-dot.warn { background: var(--warning); } .status-dot.err { background: var(--danger); }
.pill { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: var(--text-secondary);
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 20px; padding: 5px 12px; }

/* ------------------------------------------------------------ celular */
@media (max-width: 860px) {
  .layout { flex-direction: column; }
  .sidebar { width: 100% !important; flex-direction: row; height: auto; border-right: none; border-bottom: 1px solid var(--border); }
  .sidebar-header, .sidebar-footer .sidebar-toggle, .sidebar-user-info, .nav-label { display: none; }
  .sidebar-nav { flex-direction: row; overflow-x: auto; padding: 6px; }
  .sidebar-link { width: auto; padding: 8px 10px; }
  .sidebar-link span { display: none; }
  .sidebar-link.active::before { display: none; }
  .sidebar-footer { border-top: none; padding: 6px; }
  .page { padding: 18px 16px 90px; }
  .conversas { grid-template-columns: 1fr; }
  .ficha { display: none; }
  .ficha.folha { display: block; position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    max-height: 78vh; border-radius: 16px 16px 0 0; box-shadow: var(--shadow-lg); }
  .fab span { display: none; }
}

input:disabled, select:disabled, textarea:disabled { opacity: .55; cursor: not-allowed; }

/* resumo do que a Sofia aprendeu de um documento */
.resumo-doc {
  background: var(--bg-input); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 16px; font-size: 13.5px; line-height: 1.6; color: var(--text-secondary);
  max-height: 360px; overflow: auto;
}
.resumo-doc b { color: var(--text-primary); display: inline-block; margin-top: 6px; }
.data-table .doc-nome { padding: 0; font-weight: 600; color: var(--text-primary); text-align: left; }
.data-table .doc-nome:hover { color: var(--accent); }
.doc-tipo { margin-bottom: 14px; }
.grade-doc-wrap { overflow: auto; max-height: 280px; border: 1px solid var(--border); border-radius: var(--radius-sm); margin-bottom: 10px; }
.grade-doc { border-collapse: collapse; width: 100%; }
.grade-doc td { padding: 0; border-bottom: 1px solid var(--border); border-right: 1px solid var(--border); }
.grade-doc .grade-cel { position: relative; }
.grade-doc input { min-width: 120px; width: 100%; border: 0; border-radius: 0; padding: 8px 10px; background: transparent; }
.grade-doc tr:first-child input { font-weight: 600; background: var(--bg-elevated); }
.grade-doc td.grade-alca {
  width: 28px; min-width: 28px; max-width: 28px; background: var(--bg-elevated);
  text-align: center; vertical-align: middle; user-select: none;
}
.grade-doc td.grade-alca[data-sel-linha] { cursor: pointer; }
.grade-doc td.grade-alca[data-sel-linha]:hover { background: var(--bg-hover); }
.grade-doc td.grade-alca[data-sel-linha]::before {
  content: ""; display: inline-block; width: 3px; height: 3px; border-radius: 50%;
  background: var(--text-muted); opacity: .75; vertical-align: middle;
  box-shadow: 0 -5px 0 var(--text-muted), 0 5px 0 var(--text-muted);
}
.grade-doc td.grade-alca.sel::before { content: none; }
.grade-doc td.na-col,
.grade-doc tr.sel td { background: var(--accent-subtle); }
.grade-doc tr:first-child td.na-col input,
.grade-doc tr.sel td input { background: transparent; }
.grade-doc td.grade-cab.na-col { box-shadow: inset 0 -2px 0 var(--accent); }
.grade-doc td.grade-cab.na-col input { padding-right: 30px; }
.grade-doc .grade-lixo { width: 22px; height: 22px; padding: 0; }
.grade-doc .grade-cel .grade-lixo {
  position: absolute; z-index: 1; top: 50%; right: 2px; transform: translateY(-50%);
  background: var(--bg-card); border-radius: 6px;
}
.doc-leitura { white-space: pre-wrap; background: var(--bg-input); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 16px; font-size: 13.5px; line-height: 1.6; max-height: 420px; overflow: auto; color: var(--text-secondary); }
.doc-tabela th, .doc-tabela td { white-space: nowrap; }
.lista-item.clicavel { cursor: pointer; }
.lista-item.clicavel:hover { background: var(--bg-elevated); }
.modal .seg { flex-wrap: wrap; }

/* cada bloco com o próprio salvar */
.panel-footer { display: flex; justify-content: flex-end; padding: 14px 20px; border-top: 1px solid var(--border); }

/* foto de perfil do profissional */
.foto-perfil { display: flex; gap: 14px; align-items: center; margin-bottom: 16px; }
.foto-perfil img, .foto-perfil .foto-vazia { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.foto-perfil .foto-vazia { display: grid; place-items: center; background: var(--bg-elevated); color: var(--text-muted); font-weight: 700; font-size: 22px; border: 1px dashed var(--border); }
/* o botão flutuante "Testar a Sofia" não cobre o salvar do último bloco */
#content { padding-bottom: 88px; }

/* ============================ tema claro (escolha de cada login) */
:root[data-theme="light"] {
  --bg-deepest: #f4f6fa;
  --bg-deep: #ebf0f6;
  --bg-card: #ffffff;
  --bg-elevated: #f7f9fc;
  --bg-hover: #edf2f8;
  --bg-input: #ffffff;
  --text-primary: #192033;
  --text-secondary: #4a5468;
  --text-muted: #647087;
  --text-bright: #0c101a;
  --border: rgba(30, 45, 80, 0.14);
  --glass-bg: rgba(255, 255, 255, 0.9);
  --glass-border: rgba(30, 45, 80, 0.1);
  --shadow: 0 4px 20px rgba(20, 30, 60, 0.06);
  --shadow-lg: 0 8px 36px rgba(20, 30, 60, 0.1);
  --success-bg: rgba(34, 197, 94, 0.14); --warning-bg: rgba(245, 158, 11, 0.16);
  --danger-bg: rgba(239, 68, 68, 0.12);  --info-bg: rgba(59, 130, 246, 0.12);
}
/* texto sobre a cor da clínica continua branco no claro */
:root[data-theme="light"] .btn-primary,
:root[data-theme="light"] .sidebar-link .count { color: #fff; }
:root[data-theme="light"] .grade-slot.fora {
  background: repeating-linear-gradient(135deg, transparent, transparent 6px, rgba(30,40,70,.05) 6px, rgba(30,40,70,.05) 12px); }
:root[data-theme="light"] .evento.pendente { background: color-mix(in srgb, var(--warning) 38%, #fff); }
:root[data-theme="light"] .evento.confirmado { background: color-mix(in srgb, var(--info) 36%, var(--info-bg)); border-color: var(--info); }
:root[data-theme="light"] input[type="date"]::-webkit-calendar-picker-indicator,
:root[data-theme="light"] input[type="time"]::-webkit-calendar-picker-indicator { filter: none; }

/* opções que o paciente viu como botão, no histórico */
.msg-opcoes { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.msg-opcoes span {
  border: 1px solid rgba(0, 0, 0, 0.12); color: #008069; background: rgba(255, 255, 255, 0.85);
  border-radius: 999px; padding: 4px 12px; font-size: 12px; font-weight: 500; white-space: nowrap;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}
:root:not([data-theme="light"]) .msg-opcoes span {
  border-color: rgba(255, 255, 255, 0.2); color: #53bdeb; background: rgba(0, 0, 0, 0.25);
}

/* botão rápido de alternar presença */
.btn-presenca {
  display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 20px;
  font-size: 11.5px; font-weight: 600; cursor: pointer; border: 1px solid var(--border);
  background: var(--bg-elevated); color: var(--text-secondary); transition: all .15s; white-space: nowrap;
}
.btn-presenca:hover { border-color: var(--accent); color: var(--text-primary); }
.btn-presenca.confirmado {
  background: var(--success-bg); border-color: rgba(34, 197, 94, 0.35); color: var(--success);
}
.btn-presenca svg { width: 13px; height: 13px; }

/* abas de navegação */
.tabs-nav {
  display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 20px; flex-wrap: wrap;
}
.tab-btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; background: none;
  border: none; border-bottom: 2px solid transparent; color: var(--text-secondary);
  font-size: 13px; font-weight: 600; cursor: pointer; transition: all .15s; margin-bottom: -1px;
}
.tab-btn:hover { color: var(--text-primary); }
.tab-btn.ativo { color: var(--accent); border-bottom-color: var(--accent); }
.tab-btn svg { width: 16px; height: 16px; }
.tab-btn .badge-pill {
  background: var(--warning); color: var(--bg-deepest); font-size: 10px; font-weight: 700;
  border-radius: 10px; padding: 1px 6px; line-height: 14px;
}

/* segmented control estilo Apple iOS / macOS */
.segmented-apple {
  display: inline-flex;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 4px;
  gap: 4px;
  margin-bottom: var(--space-6);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.2);
  flex-wrap: wrap;
  max-width: 100%;
}
:root[data-theme="light"] .segmented-apple {
  background: rgba(0, 0, 0, 0.04);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.06);
}
.segmented-apple .seg-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  border-radius: 9px;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.16s ease-out;
  white-space: nowrap;
}
.segmented-apple .seg-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.04);
}
.segmented-apple .seg-btn.ativo {
  background: var(--bg-elevated);
  color: var(--text-bright);
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25), 0 0 0 1px var(--border);
}
:root[data-theme="light"] .segmented-apple .seg-btn.ativo {
  background: #ffffff;
  color: var(--text-primary);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08), 0 0 0 1px rgba(0, 0, 0, 0.06);
}
.segmented-apple .seg-btn.ativo svg {
  color: var(--accent);
}
.segmented-apple .seg-btn svg {
  width: 15px;
  height: 15px;
}
.segmented-apple .seg-btn .badge-pill {
  background: var(--warning);
  color: var(--bg-deepest);
  font-size: 10px;
  font-weight: 700;
  border-radius: 10px;
  padding: 1px 6px;
  line-height: 14px;
}

/* dirty state (alterações pendentes nos blocos) */
.panel.is-dirty {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--border));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 30%, transparent);
}
.panel.is-dirty .panel-footer button[data-salvar] {
  animation: pulse-save 2s infinite ease-in-out;
  box-shadow: 0 0 14px var(--accent-glow);
}
.dirty-indicator {
  display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 600;
  color: var(--warning); margin-right: auto;
}
@keyframes pulse-save {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.02); }
}

/* busca e toolbar */
.toolbar-busca {
  display: flex; gap: 12px; align-items: center; margin-bottom: 18px; flex-wrap: wrap;
}
.toolbar-busca .search-box {
  max-width: 360px; flex: 1;
}

/* celular: números do topo em 2×2 e pedidos com os botões embaixo do texto */
@media (max-width: 860px) {
  .at-miolo { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  /* Evita auto-zoom do Safari no iOS */
  input, select, textarea { font-size: 16px !important; }
  .btn-icon { width: 38px; height: 38px; }
  .conversas, .sofia-pacientes .conversas { height: auto; min-height: 0; }
  #conv-detalhe .chat { max-height: 55vh; }
  .stats-grid { grid-template-columns: 1fr 1fr !important; gap: 10px; }
  .stat-card { padding: 12px; gap: 10px; min-width: 0; }
  .stat-card .stat-value { font-size: 20px; }
  .lista-item { flex-wrap: wrap; }
  .lista-item .fim { width: 100%; justify-content: flex-start; }
  .lista-item .hora + .info + .fim { width: auto; }
  .fi-assinatura,
  .ficha-caixas:not(.inline) { grid-template-columns: 1fr; }
}

/* Plano de tratamento, na consulta */
.plano-editor { display: flex; flex-direction: column; gap: 16px; }
.plano-editor-topo {
  display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; flex-wrap: wrap;
}
.plano-editor-topo .sub { margin: 0; max-width: 520px; }
.plano-editor-acoes { display: flex; gap: 8px; flex-wrap: wrap; }
.plano-lista { display: flex; flex-direction: column; gap: 16px; }
.plano-vazio {
  padding: 22px 8px; text-align: center;
}
.plano-vazio p { margin: 0 0 6px; font-weight: 600; color: var(--text-bright); }
.plano-vazio .sub { font-weight: 400; }
.plano-bloco-topo, .plano-achado, .plano-cuidado-linha, .plano-editor-acoes {
  display: flex; align-items: center; gap: 8px;
}
.plano-bloco-topo { justify-content: space-between; margin-bottom: 12px; }
.plano-bloco-topo h3 { margin: 0; font-size: 15px; }
.plano-bloco-acoes { display: flex; gap: 10px; flex-wrap: wrap; }
.plano-precos { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.plano-precos .form-group { margin-bottom: 14px; }
.plano-texto { min-height: 96px; }
.plano-rotulo, .plano-secao { font-weight: 600; color: var(--text-bright); }
.plano-secao { margin: 0 0 4px; font-size: 15px; }
.plano-cuidados { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.plano-cuidado-linha { width: 100%; }
.plano-cuidado-linha input { flex: 1; min-width: 0; }
.plano-achados-lista { display: flex; flex-direction: column; gap: 10px; margin: 12px 0; }
.plano-achado { flex-wrap: wrap; }
.plano-achado input { flex: 1; min-width: 180px; }
.plano-achado img {
  width: 72px; height: 72px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border);
}
@media (max-width: 768px) {
  .plano-precos { grid-template-columns: 1fr; }
}

@media print {
  html:has(body.imprimindo-ficha),
  body.imprimindo-ficha {
    background: #fff !important;
    height: auto !important;
    overflow: visible !important;
  }
  body.imprimindo-ficha #app,
  body.imprimindo-ficha #login,
  body.imprimindo-ficha #modal-root,
  body.imprimindo-ficha .toasts,
  body.imprimindo-ficha .fab,
  body.imprimindo-ficha #playground {
    display: none !important;
  }
  body.imprimindo-ficha #ficha-impressao {
    display: block !important;
    position: static;
    width: 100%;
    padding: 0;
    background: #fff !important;
    color: #111 !important;
  }
  body.imprimindo-ficha #ficha-impressao,
  body.imprimindo-ficha #ficha-impressao * {
    color: #111 !important;
    box-shadow: none !important;
  }
  body.imprimindo-ficha #ficha-impressao * {
    background: transparent !important;
  }
  body.imprimindo-ficha #ficha-impressao .btn-text,
  body.imprimindo-ficha #ficha-impressao .at-voltar {
    display: none !important;
  }
  body.imprimindo-ficha #ficha-impressao input,
  body.imprimindo-ficha #ficha-impressao textarea {
    border: none !important;
    border-bottom: 1px solid #222 !important;
    border-radius: 0 !important;
    -webkit-text-fill-color: #111 !important;
  }
  body.imprimindo-ficha #ficha-impressao .fi-traco {
    border-bottom: 1px solid #111 !important;
  }
  body.imprimindo-ficha #ficha-impressao .ficha-caixa i {
    width: 14px;
    height: 14px;
    border: 1.5px solid #111 !important;
    background: #fff !important;
    position: relative;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }
  body.imprimindo-ficha #ficha-impressao .ficha-caixa.on i::after {
    content: "";
    position: absolute;
    left: 4px;
    top: 0;
    width: 4px;
    height: 8px;
    border: solid #111;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
  }
  body.imprimindo-ficha #ficha-impressao .fi-assina-img {
    width: 100%;
    height: 90px;
    object-fit: contain;
    object-position: left center;
    background: #fff !important;
    border-bottom: 1px solid #222 !important;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }
  body.imprimindo-ficha #ficha-impressao .form-group,
  body.imprimindo-ficha #ficha-impressao .fi-assina-linha,
  body.imprimindo-ficha #ficha-impressao .ficha-op {
    break-inside: avoid;
  }
  body.imprimindo-ficha #ficha-impressao .plano-folha {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    font-family: Inter, sans-serif;
    padding: 8mm 4mm 12mm;
  }
  body.imprimindo-ficha #ficha-impressao .plano-miolo { flex: 1; margin: 28px 0 36px; }
  body.imprimindo-ficha #ficha-impressao .plano-paciente {
    font-size: 22px;
    font-weight: 700;
    margin: 0;
    letter-spacing: -0.02em;
  }
  body.imprimindo-ficha #ficha-impressao .plano-folha h1 {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin: 6px 0 0;
  }
  body.imprimindo-ficha #ficha-impressao .plano-indicacao,
  body.imprimindo-ficha #ficha-impressao .plano-texto {
    white-space: pre-wrap;
    line-height: 1.45;
  }
  body.imprimindo-ficha #ficha-impressao .plano-bloco,
  body.imprimindo-ficha #ficha-impressao .plano-achado {
    break-inside: avoid;
    margin: 0 0 16px;
  }
  body.imprimindo-ficha #ficha-impressao .plano-bloco h2,
  body.imprimindo-ficha #ficha-impressao .plano-achados h2 {
    font-size: 15px;
    margin: 0 0 6px;
  }
  body.imprimindo-ficha #ficha-impressao .plano-bloco p,
  body.imprimindo-ficha #ficha-impressao .plano-achados p { margin: 0 0 4px; }
  body.imprimindo-ficha #ficha-impressao .plano-bloco ul { margin: 4px 0 0; padding-left: 18px; }
  body.imprimindo-ficha #ficha-impressao .plano-achado img {
    width: 220px;
    max-height: 220px;
    object-fit: cover;
    display: block;
    margin-bottom: 4px;
  }
  body.imprimindo-ficha #ficha-impressao .plano-titulo { font-size: 16px; font-weight: 600; margin: 4px 0 0; }
  body.imprimindo-ficha #ficha-impressao .plano-tabela { width: 100%; border-collapse: collapse; margin: 4px 0 10px; font-size: 13px; }
  body.imprimindo-ficha #ficha-impressao .plano-tabela th,
  body.imprimindo-ficha #ficha-impressao .plano-tabela td { text-align: left; padding: 4px 6px; border-bottom: 1px solid #ccc; }
  body.imprimindo-ficha #ficha-impressao .plano-tabela tr { break-inside: avoid; }
  body.imprimindo-ficha #ficha-impressao .plano-rodape {
    border-top: 1px solid #222;
    padding-top: 14px;
    margin-top: 12px;
  }
  body.imprimindo-ficha #ficha-impressao .plano-profissional {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
  }
  body.imprimindo-ficha #ficha-impressao .formula-receita {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
  }
  body.imprimindo-ficha #ficha-impressao .formula-receita-paciente,
  body.imprimindo-ficha #ficha-impressao .formula-receita-profissional {
    text-align: center;
    font-weight: 700;
  }
  body.imprimindo-ficha #ficha-impressao .formula-receita-profissional {
    margin-top: auto;
  }
  body.imprimindo-ficha #ficha-impressao .formula-corpo {
    white-space: pre-wrap;
  }
  body.imprimindo-ficha #ficha-impressao .carimbo-topo { border-bottom-color: #222; }
  body.imprimindo-ficha #ficha-impressao .carimbo-linha { border-top-color: #222; }
}

.pg-add { display: flex; gap: 8px; align-items: center; }
.pg-add input { flex: 1; min-width: 0; }
.pg-intro { margin: 0 0 14px; }
.pg-forma { display: flex; gap: 8px; align-items: center; margin-top: 12px; flex-wrap: wrap; }
.pg-forma select { flex: 1; min-width: 160px; width: auto; }
.pg-forma .btn-text { padding: 10px 6px; white-space: nowrap; }
.pg-vazio { margin: 12px 0 0; }
.pg-periodo { margin-bottom: 14px; }
.pg-datas { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 14px; }
.pg-datas .form-group { margin: 0; min-width: 160px; flex: 1; }
.pg-filtros {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.pg-filtros .form-group { margin-bottom: 0; }
.pg-barras { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.pg-barra-linha {
  display: grid;
  grid-template-columns: minmax(88px, 150px) 1fr auto;
  gap: 10px;
  align-items: center;
  font-size: 13px;
}
.pg-barra-linha span {
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pg-trilho { height: 8px; border-radius: 99px; background: var(--bg-elevated); overflow: hidden; }
.pg-barra { height: 100%; border-radius: 99px; background: var(--accent); }
.pg-barra-linha b { font-variant-numeric: tabular-nums; color: var(--text-bright); font-size: 13px; }

/* horários de atendimento: layout Apple compacto inline */
.horas-intro {
  padding: 14px 20px;
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--text-muted) 3%, transparent);
}
.horas-dias {
  display: flex;
  flex-direction: column;
}
.horas-painel {
  max-width: 660px;
}
.hora-dia {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 20px;
  border-bottom: 1px solid var(--border);
  transition: background-color 0.15s ease;
}
.hora-dia:last-child {
  border-bottom: none;
}
.hora-dia.fechado {
  background: color-mix(in srgb, var(--text-muted) 2%, transparent);
}
.hora-dia.fechado:hover,
.hora-dia.aberto:hover {
  background: var(--bg-hover);
}
.hora-dia-info {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 155px;
  flex-shrink: 0;
}
.hora-dia-chip {
  flex: none;
  width: 40px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  color: var(--text-muted);
  background: var(--bg-elevated);
  transition: all 0.15s ease;
}
.hora-dia.aberto .hora-dia-chip {
  background: var(--accent-subtle);
  border-color: color-mix(in srgb, var(--accent) 35%, transparent);
  color: var(--accent);
}
.hora-dia-nome {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.2;
}
.hora-dia-corpo {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
}
.hora-dia-relogios {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: stretch;
}
/* colunas fixas: das | início | às | fim | lixeira. A 1ª faixa não tem lixeira,
   mas a coluna fica reservada, e as faixas do mesmo dia (e dos outros) alinham */
.hora-dia-faixa {
  display: grid;
  grid-template-columns: 28px 104px 22px 104px 32px;
  align-items: center;
  gap: 8px;
}
.hora-dia-faixa .hora-label { text-align: right; }
.hora-label {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-muted);
  user-select: none;
}
.hora-input {
  width: 104px;
  height: 34px;
  padding: 4px 8px;
  font-size: 13.5px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  text-align: center;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-primary);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  box-sizing: border-box;
}
.hora-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-subtle);
}
.hora-input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: var(--bg-elevated);
}
.hora-dia-fechado {
  margin: 0;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--bg-elevated);
  padding: 4px 14px;
  border-radius: 99px;
  border: 1px solid var(--border);
  letter-spacing: 0.01em;
}
.hora-dia.aberto .hora-dia-fechado,
.hora-dia.fechado .hora-dia-relogios {
  display: none !important;
}
.hora-btn-del {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border-radius: var(--radius-sm);
  color: var(--danger);
  opacity: 0.7;
  transition: opacity 0.15s ease;
}
.hora-btn-del:hover {
  opacity: 1;
  background: var(--danger-subtle);
}
.hora-dia-acoes {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-shrink: 0;
  width: 48px;
}

@media (max-width: 640px) {
  .hora-dia {
    flex-wrap: wrap;
    padding: 12px 14px;
    gap: 10px 8px;
  }
  .hora-dia-info {
    min-width: 0;
    flex: 1;
  }
  .hora-dia-acoes {
    width: auto;
  }
  .hora-dia-corpo {
    /* flex-basis, não width: o flex: 1 da regra geral ganharia do width */
    flex: 1 0 100%;
    order: 3;
    justify-content: flex-start;
    padding-left: 0;
  }
  .hora-dia-relogios { width: 100%; }
  .hora-dia-faixa { grid-template-columns: 24px minmax(0, 1fr) 18px minmax(0, 1fr) 30px; gap: 6px; }
  .hora-input { width: 100%; }
}

.inv-equiv { display: flex; gap: 8px; align-items: center; }
.inv-equiv input[type="number"] { width: 110px; }
.inv-equiv-um { flex: none; font-weight: 600; color: var(--text-primary); white-space: nowrap; }
.inv-em-estoque { margin-bottom: 14px; }
.inv-equiv-caixa { padding: 12px; border: 1px solid var(--border); border-radius: var(--radius); }
.inv-equiv-topo { display: flex; align-items: center; justify-content: space-between; }
.inv-equiv-topo label { margin: 0; }
#inv-equiv-abrir { display: block; margin: 0 0 14px; }
.inv-equiv select { flex: 1; }
#inv-equiv-outra { margin-top: 8px; }

.inv-uso { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.inv-uso select { flex: 1; min-width: 0; }
.inv-uso input { width: 88px; }
.inv-custo { margin-top: 10px; }
.inv-custo td, .inv-custo th { font-size: 13px; }

/* Portfólio: vitrine para o paciente */
.pf-topo { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; }
.pf-topo h2 { font-size: 22px; font-weight: 700; color: var(--text-bright); }
.pf-topo p { color: var(--text-secondary); margin-top: 2px; }
.pf-avatar { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; }
.pf-valores { font-size: 13px; color: var(--text-secondary); }
.pf-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
.pf-card { display: flex; flex-direction: column; padding: 0; text-align: left; font: inherit; color: inherit;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden;
  cursor: pointer; transition: transform .18s, box-shadow .18s, border-color .18s; }
.pf-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--border-hover); }
.pf-card-img { position: relative; aspect-ratio: 4 / 3; background: var(--bg-elevated); overflow: hidden; }
.pf-card-img img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .4s; }
.pf-card:hover .pf-card-img img { transform: scale(1.04); }
.pf-card-vazio { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--text-muted); }
.pf-card-vazio svg { width: 34px; height: 34px; opacity: .5; }
.pf-card-nome { position: absolute; left: 0; right: 0; bottom: 0; padding: 36px 16px 14px; color: #fff;
  font-size: 18px; font-weight: 700; line-height: 1.2;
  background: linear-gradient(to top, rgba(0, 0, 0, .7), transparent); }
.pf-card-info { display: flex; flex-direction: column; gap: 6px; padding: 12px 16px 16px; }
.pf-card-desc { font-size: 13px; color: var(--text-secondary); line-height: 1.45;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pf-card-meta { font-size: 12px; color: var(--text-muted); }
.pf-card-meta:empty { display: none; }
.pf-secao { margin: 32px 0 14px; font-size: 16px; font-weight: 700; color: var(--text-bright); }
.pf-resultados { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; }
.pf-resultado { margin: 0; }
.pf-resultado figcaption { margin-top: 8px; text-align: center; font-size: 13px; color: var(--text-secondary); }
.pf-comp-frame { height: auto; }

.pf-show { position: fixed; inset: 0; z-index: 1000; display: grid; grid-template-columns: 1fr 340px;
  background: #0b0d12; color: #f1f3f7; }
.pf-palco { position: relative; display: flex; align-items: center; justify-content: center; overflow: hidden;
  touch-action: pan-y; user-select: none; }
.pf-foto { max-width: 100%; max-height: 100%; object-fit: contain; }
.pf-sem-foto svg { width: 64px; height: 64px; opacity: .3; }
.pf-area-rotulo { position: absolute; left: 20px; bottom: 20px; padding: 6px 12px; border-radius: 999px;
  background: rgba(0, 0, 0, .55); font-size: 13px; font-weight: 600; }
.pf-nav, .pf-fechar { position: absolute; width: 44px; height: 44px; border: 0; border-radius: 50%;
  background: rgba(255, 255, 255, .12); color: #fff; display: flex; align-items: center; justify-content: center;
  cursor: pointer; backdrop-filter: blur(6px); }
.pf-nav:hover, .pf-fechar:hover { background: rgba(255, 255, 255, .22); }
.pf-ant { left: 16px; top: 50%; transform: translateY(-50%); }
.pf-prox { right: 16px; top: 50%; transform: translateY(-50%); }
.pf-fechar { top: 16px; right: 16px; z-index: 2; }
.pf-lado { padding: 72px 28px 28px; background: #12151c; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; }
.pf-lado h2 { font-size: 26px; font-weight: 700; line-height: 1.2; }
.pf-meta { color: var(--accent-light); font-weight: 600; }
.pf-desc { color: #c3c8d4; line-height: 1.6; }
.pf-areas { display: flex; flex-wrap: wrap; gap: 8px; }
.pf-area-chip { border: 1px solid rgba(255, 255, 255, .18); background: transparent; color: #e6e9ef;
  padding: 6px 12px; border-radius: 999px; font: inherit; font-size: 13px; cursor: pointer; }
.pf-area-chip.ativo { background: var(--accent); border-color: var(--accent); color: #fff; }
.pf-miniaturas { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: auto; }
.pf-miniaturas button { padding: 0; border: 2px solid transparent; border-radius: 8px; overflow: hidden;
  aspect-ratio: 1; cursor: pointer; background: none; opacity: .6; }
.pf-miniaturas button.ativo { border-color: var(--accent); opacity: 1; }
.pf-miniaturas img { width: 100%; height: 100%; object-fit: cover; display: block; }
@media (max-width: 800px) {
  .pf-show { grid-template-columns: 1fr; grid-template-rows: 58vh auto; }
  .pf-lado { padding: 20px; }
  .pf-miniaturas { grid-template-columns: repeat(5, 1fr); }
}

.lp-livres-wrap { margin: -6px 0 4px; }

.msg-toque { font-weight: 600; }
