@font-face { font-family: 'Gliker'; font-style: normal; font-weight: 400; font-display: swap; src: url('../vendor/fonts/Gliker-Regular.woff') format('woff'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 100 900; font-display: swap; src: url('../vendor/fonts/Inter.woff') format('woff'); }
@font-face { font-family: 'Inter'; font-style: italic; font-weight: 100 900; font-display: swap; src: url('../vendor/fonts/Inter-Italic.woff') format('woff'); }
/* ============================================================
   Crivo — folha de estilos única (sem estilos inline no HTML/JS:
   isso permite uma CSP estrita com style-src 'self').
   Sumário: 1 Tokens · 2 Base · 3 Layout · 4 Componentes · 5 Telas · 6 Responsivo/Print
   ============================================================ */

/* ---------- 1. Tokens ---------- */
:root {
  --primary-blue: #1e3a8a;
  --primary-hover: #1e40af;
  --accent-blue: #3b82f6;
  --light-blue: #e0f2fe;
  --lighter-blue: #f0f9ff;
  --dark-text: #1e293b;
  --gray-text: #64748b;
  --border-color: #cbd5e1;
  --white: #ffffff;

  --success: #10b981;      /* ícones / fundos */
  --success-text: #047857; /* texto (contraste AA sobre branco) */
  --success-bg: #d1fae5;
  --danger: #ef4444;
  --danger-text: #b91c1c;
  --danger-bg: #fee2e2;
  --warning: #f59e0b;
  --warning-text: #92400e;
  --warning-bg: #fef3c7;
  --info-text: #1d4ed8;
  --info-bg: #dbeafe;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 6px 10px -2px rgba(0, 0, 0, 0.1), 0 3px 5px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --radius: 12px;
}

/* ---------- 2. Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
button, input, select, textarea { font-family: inherit; }
body {
  font-optical-sizing: auto; font-kerning: normal;
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  background: var(--lighter-blue);
  color: var(--dark-text);
  line-height: 1.45;
  min-height: 100vh;
}
a { color: var(--info-text); }
ul { list-style: none; }
h1, h2, h3, h4 { line-height: 1.25; }
/* Títulos em Gliker (só existe o peso regular: sem negrito sintético) */
h1, h2, h3, h4, #page-title, .section-title, .modal-title, .notifications-title, .logo-text-main { font-family: 'Gliker', 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif; font-weight: 400; font-synthesis: none; letter-spacing: 0.01em; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }
.muted { color: var(--gray-text); margin-bottom: 16px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
.skip-link { position: absolute; left: 8px; top: -48px; background: var(--primary-blue); color: var(--white); padding: 10px 16px; border-radius: 8px; z-index: 5000; transition: top 0.2s; }
.skip-link:focus { top: 8px; }

:focus-visible { outline: 3px solid var(--accent-blue); outline-offset: 2px; }
[role="button"]:focus-visible, .card-link:focus-visible { outline-offset: 0; }

/* ---------- 3. Layout ---------- */
.app { display: flex; height: calc(100vh / var(--ui-zoom, 1)); zoom: var(--ui-zoom, 1); position: relative; overflow: hidden; background: linear-gradient(135deg, var(--lighter-blue) 0%, var(--light-blue) 100%); }

.main-content { flex: 1; min-width: 0; display: flex; flex-direction: column; overflow: hidden; }
.header { position: relative; z-index: 20; background: var(--white); padding: 20px 40px; box-shadow: var(--shadow); display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.header-brand { display: flex; align-items: center; gap: 16px; min-width: 0; }
.header-logo { font-size: 28px; font-weight: 700; color: var(--primary-blue); letter-spacing: -1px; }
.header-divider { font-size: 32px; color: var(--accent-blue); font-weight: 300; }
#page-title { font-size: 22px; font-weight: 600; color: var(--dark-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-info { display: flex; align-items: center; gap: 12px; background: transparent; border: 0; padding: 4px 6px 4px 10px; border-radius: 40px; color: inherit; text-align: right; }
.user-info:hover { background: var(--lighter-blue); }
.user-caret { font-size: 12px; color: var(--gray-text); transition: transform 0.2s; }
.user-info[aria-expanded="true"] .user-caret { transform: rotate(180deg); }
.user-meta { display: flex; flex-direction: column; text-align: right; }
.user-name { font-weight: 600; }
.user-role { font-size: 12px; color: var(--gray-text); }
.user-avatar { width: 45px; height: 45px; border-radius: 50%; background: var(--primary-blue); color: var(--white); display: flex; align-items: center; justify-content: center; font-weight: 700; flex-shrink: 0; }
.content-area { flex: 1; overflow-y: auto; padding: 32px 40px 110px; outline: none; }

/* ---------- 4. Componentes ---------- */
/* Botões */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 22px; border: none; border-radius: 8px; font-size: 15px; font-weight: 600; text-decoration: none; transition: background 0.2s, transform 0.2s, box-shadow 0.2s; }
.btn-primary { background: var(--primary-blue); color: var(--white); }
.btn-primary:hover { background: var(--primary-hover); transform: translateY(-1px); box-shadow: var(--shadow); }
.btn-secondary { background: var(--light-blue); color: var(--primary-blue); }
.btn-secondary:hover { background: var(--border-color); }
.btn-danger { background: var(--danger-text); color: var(--white); }
.btn-danger:hover { background: #991b1b; }
.btn-sm { padding: 8px 14px; font-size: 13px; }
.actions-row { display: flex; gap: 12px; flex-wrap: wrap; }

/* Formulários */
.form-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.form-group label, fieldset legend { font-weight: 600; font-size: 14px; }
.form-control, .search-bar { width: 100%; padding: 11px 14px; border: 2px solid var(--border-color); border-radius: 8px; font-size: 15px; background: var(--white); transition: border-color 0.2s; }
.form-control:focus, .search-bar:focus { outline: none; border-color: var(--accent-blue); box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2); }
textarea.form-control { resize: vertical; min-height: 80px; }
.search-bar { padding: 14px 18px; border-radius: var(--radius); margin-bottom: 24px; }
.form-error { background: var(--danger-bg); color: var(--danger-text); border-left: 4px solid var(--danger); padding: 12px 14px; border-radius: 8px; font-weight: 500; margin-top: 8px; }
.modal-form { display: block; }
fieldset { border: none; min-width: 0; }
.slot-fieldset { margin-bottom: 16px; }
.slot-fieldset legend { margin-bottom: 10px; }
.checkbox-group { display: flex; flex-direction: column; gap: 8px; max-height: 320px; overflow-y: auto; }
.checkbox-item, .check-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; background: var(--lighter-blue); border-radius: 8px; cursor: pointer; }
.checkbox-item input, .check-row input { width: 20px; height: 20px; flex-shrink: 0; }
.check-row { background: transparent; padding: 8px 0 0; font-weight: 500; }

/* Seletor de horário (radio/checkbox estilizado, acessível por teclado) */
.schedule-grid, .time-slots-editor { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 10px; }
.time-slots-editor { grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 8px; }
.slot-option { position: relative; display: block; }
.slot-option input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; cursor: pointer; }
.slot-option span { display: block; padding: 12px 8px; text-align: center; font-weight: 600; background: var(--lighter-blue); border: 2px solid transparent; border-radius: 8px; transition: all 0.15s; }
.slot-sm span { padding: 8px 4px; font-size: 13px; background: var(--white); border-color: var(--border-color); }
.slot-option:hover span { border-color: var(--accent-blue); background: var(--light-blue); }
.slot-option input:checked + span { background: var(--primary-blue); color: var(--white); border-color: var(--primary-blue); }
.slot-sm input:checked + span { background: var(--success-text); border-color: var(--success-text); }
.slot-option input:focus-visible + span { outline: 3px solid var(--accent-blue); outline-offset: 2px; }
.day-schedule-config { padding: 16px; background: var(--lighter-blue); border-radius: var(--radius); margin-bottom: 14px; }
.day-schedule-config legend { color: var(--primary-blue); font-size: 16px; padding: 0 4px; }

/* Cards e seções */
.cards-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; margin-bottom: 28px; }
.card { background: var(--white); border-radius: 16px; padding: 24px; box-shadow: var(--shadow); transition: transform 0.2s, box-shadow 0.2s; }
.card-link { display: block; text-decoration: none; color: inherit; }
.card-link:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.card-header { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.card-value { font-size: 36px; font-weight: 700; color: var(--primary-blue); }
.card-label { font-size: 14px; color: var(--gray-text); }
.card-icon { width: 50px; height: 50px; border-radius: var(--radius); display: flex; align-items: center; justify-content: center; font-size: 24px; flex-shrink: 0; }
.card-icon.blue, .list-item-icon.blue { background: var(--light-blue); color: var(--primary-blue); }
.card-icon.green, .list-item-icon.green { background: var(--success-bg); color: var(--success-text); }
.card-icon.red, .list-item-icon.red { background: var(--danger-bg); color: var(--danger-text); }

.section { background: var(--white); border-radius: 16px; padding: 28px; box-shadow: var(--shadow); margin-bottom: 24px; }
.section-title { display: flex; align-items: center; gap: 12px; font-size: 20px; font-weight: 700; color: var(--primary-blue); margin-bottom: 20px; padding-bottom: 12px; border-bottom: 2px solid var(--light-blue); }
.section-title i { font-size: 22px; color: var(--accent-blue); }
.subsection-title { color: var(--primary-blue); margin: 28px 0 16px; font-size: 18px; display: flex; gap: 10px; align-items: center; }

/* Listas, badges, abas */
.list { display: flex; flex-direction: column; gap: 12px; }
.list-item { background: var(--white); border: 1px solid var(--light-blue); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow-sm); display: flex; align-items: center; gap: 16px; cursor: pointer; transition: transform 0.2s, box-shadow 0.2s; color: inherit; text-decoration: none; }
.list-item:hover { transform: translateX(4px); box-shadow: var(--shadow-md); }
.list-item-icon { width: 48px; height: 48px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 20px; flex-shrink: 0; }
.list-item-content { flex: 1; min-width: 0; }
.list-item-title { font-weight: 600; margin-bottom: 2px; }
.list-item-subtitle { font-size: 14px; color: var(--gray-text); }
.badge { display: inline-block; padding: 5px 12px; border-radius: 20px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.badge-success { background: var(--success-bg); color: var(--success-text); }
.badge-danger { background: var(--danger-bg); color: var(--danger-text); }
.badge-warning { background: var(--warning-bg); color: var(--warning-text); }
.badge-info { background: var(--info-bg); color: var(--info-text); }
.badge-neutral { background: #f1f5f9; color: #475569; }

.tabs { display: flex; gap: 8px; margin-bottom: 24px; border-bottom: 2px solid var(--border-color); flex-wrap: wrap; }
.tab { padding: 12px 22px; background: transparent; border: none; color: var(--gray-text); font-weight: 600; position: relative; }
.tab:hover, .tab.active { color: var(--primary-blue); }
.tab.active::after { content: ''; position: absolute; left: 0; right: 0; bottom: -2px; height: 3px; background: var(--primary-blue); }

.timeline { position: relative; padding-left: 40px; }
.timeline::before { content: ''; position: absolute; left: 16px; top: 0; bottom: 0; width: 2px; background: var(--border-color); }
.timeline-item { position: relative; margin-bottom: 20px; background: var(--white); border: 1px solid var(--light-blue); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow-sm); cursor: pointer; transition: transform 0.2s, box-shadow 0.2s; }
.timeline-item:hover { transform: translateX(6px); box-shadow: var(--shadow-md); }
.timeline-item::before { content: ''; position: absolute; left: -31px; top: 24px; width: 14px; height: 14px; border-radius: 50%; background: var(--primary-blue); border: 3px solid var(--white); box-shadow: 0 0 0 2px var(--primary-blue); }
.timeline-date { font-size: 12px; color: var(--gray-text); margin-bottom: 6px; }
.timeline-title { font-weight: 600; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.timeline-subtitle { font-size: 14px; color: var(--gray-text); }

/* Tabelas, laudos, estados vazios, avisos */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--light-blue); vertical-align: top; }
.table thead th { color: var(--gray-text); font-size: 12px; text-transform: uppercase; letter-spacing: 0.4px; }
.table tbody th { font-weight: 600; }
.report { white-space: pre-wrap; font-family: inherit; font-size: 14px; line-height: 1.55; background: var(--lighter-blue); padding: 14px; border-radius: 8px; }
.empty-state { text-align: center; padding: 48px 20px; color: var(--gray-text); }
.empty-state > i { font-size: 48px; color: var(--accent-blue); opacity: 0.35; margin-bottom: 14px; display: block; }
.empty-state h3 { color: var(--dark-text); margin-bottom: 6px; }
.empty-state p { margin-bottom: 18px; }
.banner { display: flex; align-items: flex-start; gap: 14px; padding: 16px 18px; border-radius: var(--radius); margin-bottom: 20px; border-left: 4px solid; }
.banner > i { font-size: 22px; margin-top: 2px; }
.banner p { margin-top: 2px; font-size: 14px; }
.banner-info { background: var(--info-bg); border-color: var(--accent-blue); color: #1e3a8a; }
.banner-success { background: var(--success-bg); border-color: var(--success); color: #065f46; }
.banner-warning { background: var(--warning-bg); border-color: var(--warning); color: var(--warning-text); }
.banner-danger { background: var(--danger-bg); border-color: var(--danger); color: var(--danger-text); }
.alert-box { display: flex; gap: 14px; background: var(--danger-bg); border: 2px solid var(--danger); color: var(--danger-text); padding: 14px 16px; border-radius: var(--radius); margin-bottom: 16px; }
.alert-box > i { font-size: 22px; margin-top: 2px; }
.alert-box p { font-size: 14px; }
.confirm-box { text-align: center; padding: 8px 0 18px; }
.confirm-box > i { font-size: 56px; color: var(--success); margin-bottom: 10px; }
.confirm-box h3 { color: var(--primary-blue); }
.plain-list { margin: 4px 0; padding-left: 18px; list-style: disc; }
.plain-list li { margin: 6px 0; font-weight: 400; }
.check-list { display: grid; gap: 10px; }
.check-list li { position: relative; padding-left: 28px; }
.check-list li::before { content: '\f00c'; font-family: 'Font Awesome 7 Free', 'Font Awesome 6 Free', 'FontAwesome'; font-weight: 900; position: absolute; left: 0; color: var(--success-text); }
.notes-list { display: grid; gap: 14px; }
.note { border: 1px solid var(--light-blue); border-radius: var(--radius); padding: 14px; }
.note header { font-size: 13px; color: var(--gray-text); margin-bottom: 8px; }

/* Modal */
.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(15, 23, 42, 0.6); z-index: 2000; backdrop-filter: blur(4px); padding: 16px; }
.modal-overlay.active { display: flex; align-items: center; justify-content: center; animation: fade 0.2s ease; }
.modal { background: var(--white); border-radius: 20px; padding: 28px; width: 100%; max-width: 600px; max-height: 92vh; overflow-y: auto; box-shadow: var(--shadow-lg); animation: slideUp 0.25s ease; }
.modal-sm { max-width: 440px; }
.modal-lg { max-width: 720px; }
.modal-xl { max-width: 900px; }
.modal-header { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 20px; }
.modal-title { font-size: 22px; font-weight: 700; color: var(--primary-blue); }
.modal-close { width: 36px; height: 36px; border-radius: 8px; border: none; background: var(--light-blue); color: var(--primary-blue); font-size: 22px; line-height: 1; flex-shrink: 0; }
.modal-close:hover { background: var(--primary-blue); color: var(--white); }
.modal-content { margin-bottom: 20px; }
.modal-actions { display: flex; gap: 12px; justify-content: flex-end; flex-wrap: wrap; }
.modal-field { margin-bottom: 16px; }
.modal-label { font-weight: 600; color: var(--gray-text); font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 6px; display: flex; gap: 6px; align-items: center; }
.modal-value { font-size: 16px; }
.highlight-field { background: var(--lighter-blue); border-left: 4px solid var(--accent-blue); padding: 14px; border-radius: 8px; }
.instructions-box { background: var(--light-blue); border-left: 4px solid #0284c7; padding: 14px; border-radius: 8px; }
.warning-box { background: var(--warning-bg); border-left: 4px solid var(--warning); padding: 14px; border-radius: 8px; }
.location-details-box { background: var(--lighter-blue); padding: 14px; border-radius: 8px; margin-top: 8px; }
.location-details-box h4 { color: var(--primary-blue); margin-bottom: 8px; display: flex; gap: 8px; align-items: center; }
.location-details-box p { font-size: 14px; margin: 3px 0; }

/* Toasts e notificações */
.toast-region { position: fixed; top: 16px; right: 16px; z-index: 10000; display: flex; flex-direction: column; gap: 10px; max-width: min(400px, calc(100vw - 32px)); pointer-events: none; }
.toast { display: flex; align-items: center; gap: 12px; padding: 14px 20px; border-radius: var(--radius); color: var(--white); font-weight: 500; box-shadow: var(--shadow-lg); animation: slideIn 0.3s ease; pointer-events: auto; }
.toast i { font-size: 20px; }
.toast-success { background: var(--success-text); }
.toast-warning { background: #b45309; }
.toast-danger { background: var(--danger-text); }
.toast-info { background: var(--primary-hover); }
.toast.leaving { animation: slideOut 0.3s ease forwards; }

.notifications-btn { position: fixed; bottom: 28px; right: 28px; width: 56px; height: 56px; border-radius: 50%; background: var(--accent-blue); color: var(--white); border: none; font-size: 22px; box-shadow: var(--shadow-lg); z-index: 101; display: flex; align-items: center; justify-content: center; transition: transform 0.2s, background 0.2s; }
.notifications-btn:hover { transform: scale(1.08); background: var(--primary-blue); }
.badge-count { position: absolute; top: -6px; right: -6px; background: var(--danger-text); color: var(--white); border-radius: 12px; min-width: 24px; height: 24px; padding: 0 6px; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; border: 3px solid var(--white); }
.notifications-panel { position: fixed; bottom: 96px; right: 28px; width: 380px; max-width: calc(100vw - 32px); max-height: 480px; background: var(--white); border-radius: 20px; box-shadow: var(--shadow-lg); z-index: 1000; display: flex; flex-direction: column; overflow: hidden; animation: slideUp 0.25s ease; }
.notifications-header { padding: 16px 20px; border-bottom: 2px solid var(--light-blue); display: flex; justify-content: space-between; align-items: center; }
.notifications-title { font-size: 18px; color: var(--primary-blue); }
.clear-notifications { background: transparent; border: none; color: var(--gray-text); font-size: 14px; padding: 6px 12px; border-radius: 6px; }
.clear-notifications:hover { background: var(--light-blue); color: var(--primary-blue); }
.notifications-list { overflow-y: auto; padding: 12px; }
.notification-item { padding: 14px; background: var(--lighter-blue); border-radius: var(--radius); margin-bottom: 10px; cursor: pointer; border-left: 4px solid var(--accent-blue); }
.notification-item.unread { background: var(--white); box-shadow: var(--shadow); border-left-color: var(--primary-blue); }
.notification-item.success { border-left-color: var(--success); }
.notification-item.warning, .notification-item.danger { border-left-color: var(--danger); }
.notification-time { font-size: 11px; color: var(--gray-text); margin-bottom: 4px; }
.notification-message { font-size: 14px; }
.notification-text { font-weight: 400; font-size: 13px; }
.notification-empty { text-align: center; padding: 48px 20px; color: var(--gray-text); }
.notification-empty i { font-size: 44px; margin-bottom: 12px; opacity: 0.3; }

@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { transform: translateY(24px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes slideIn { from { transform: translateX(120%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes slideOut { to { transform: translateX(120%); opacity: 0; } }

/* ---------- 5. Telas ---------- */
/* Calendário (paciente) */
.calendar { margin-top: 8px; }
.calendar-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.calendar-title { font-size: 20px; font-weight: 700; color: var(--primary-blue); }
.agenda-nav-btn { width: 40px; height: 40px; border: none; background: var(--lighter-blue); color: var(--primary-blue); border-radius: 8px; display: flex; align-items: center; justify-content: center; transition: all 0.2s; }
.agenda-nav-btn:hover:not(:disabled) { background: var(--accent-blue); color: var(--white); }
.agenda-nav-btn:disabled { opacity: 0.35; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; }
.calendar-day-header { text-align: center; font-weight: 600; color: var(--gray-text); padding: 8px 0; font-size: 13px; }
.calendar-day { min-height: 70px; background: var(--lighter-blue); border: 2px solid transparent; border-radius: var(--radius); padding: 6px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; transition: all 0.15s; }
.calendar-day.blank { background: transparent; }
.calendar-day:disabled { opacity: 0.35; }
.calendar-day.available { border-color: var(--success); background: color-mix(in srgb, var(--success-bg) 28%, var(--white)); }
.calendar-day.available:hover { background: var(--success-bg); transform: scale(1.04); box-shadow: var(--shadow); }
.calendar-day.today { box-shadow: 0 0 0 2px var(--accent-blue); }
.calendar-day-number { font-size: 18px; font-weight: 700; }
.calendar-day-free { font-size: 11px; color: var(--success-text); font-weight: 600; }

/* Agenda (médico) */
.agenda-container { display: flex; flex-direction: column; gap: 20px; }
.agenda-header { display: flex; justify-content: space-between; align-items: center; padding: 18px 20px; background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow-sm); flex-wrap: wrap; gap: 16px; }
.agenda-date-selector { display: flex; align-items: center; gap: 12px; }
.agenda-date-display { position: relative; min-width: 280px; }
.agenda-date-input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; z-index: 2; }
.agenda-date-text { display: block; padding: 10px 20px; background: var(--light-blue); border-radius: 8px; font-weight: 600; text-align: center; }
.agenda-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.agenda-timeline { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 20px; }
.agenda-summary { display: flex; gap: 28px; padding: 18px 20px; background: var(--lighter-blue); border-radius: var(--radius); margin-bottom: 20px; flex-wrap: wrap; }
.agenda-stat { display: flex; align-items: center; gap: 12px; }
.agenda-stat i { font-size: 24px; color: var(--accent-blue); }
.agenda-stat strong { font-size: 20px; color: var(--primary-blue); }
.agenda-timeline-list { display: flex; flex-direction: column; gap: 12px; }
.agenda-slot { border: 2px solid var(--light-blue); border-radius: var(--radius); padding: 14px 16px; cursor: pointer; transition: all 0.15s; background: var(--white); }
.agenda-slot.available { border-color: var(--success-bg); background: color-mix(in srgb, var(--success-bg) 28%, var(--white)); }
.agenda-slot.available:hover { border-color: var(--success); background: var(--success-bg); transform: translateX(4px); }
.agenda-slot.occupied:hover { border-color: var(--accent-blue); background: var(--lighter-blue); transform: translateX(4px); }
.agenda-slot-time { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; gap: 8px; flex-wrap: wrap; }
.time-label { font-size: 18px; font-weight: 700; color: var(--primary-blue); }
.time-status { display: flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 20px; font-size: 13px; font-weight: 600; }
.status-free { background: var(--success-bg); color: var(--success-text); }
.status-busy { background: var(--warning-bg); color: var(--warning-text); }
.agenda-slot-content { display: flex; align-items: center; justify-content: space-between; }
.agenda-slot-content.empty { justify-content: center; }
.add-appointment-text { color: var(--gray-text); font-size: 14px; }
.patient-info { display: flex; align-items: center; gap: 12px; flex: 1; }
.patient-avatar { width: 46px; height: 46px; border-radius: 50%; background: linear-gradient(135deg, var(--accent-blue), var(--primary-blue)); color: var(--white); display: flex; align-items: center; justify-content: center; font-weight: 700; flex-shrink: 0; }
.patient-name { font-weight: 600; }
.patient-reason { color: var(--gray-text); font-size: 14px; }
.agenda-slot-action { width: 36px; height: 36px; background: var(--lighter-blue); color: var(--primary-blue); border-radius: 50%; display: flex; align-items: center; justify-content: center; }

/* Vacinas */
.vaccine-card-header { display: flex; justify-content: space-between; align-items: center; padding: 22px; background: linear-gradient(135deg, var(--accent-blue), var(--primary-blue)); border-radius: var(--radius); color: var(--white); margin-bottom: 24px; flex-wrap: wrap; gap: 16px; }
.vaccine-card-title { display: flex; align-items: center; gap: 12px; }
.vaccine-card-title i { font-size: 30px; }
.vaccine-card-title h2 { font-size: 24px; color: var(--white); }
.vaccine-stats { display: flex; gap: 16px; flex-wrap: wrap; }
.vaccine-stat { display: flex; align-items: center; gap: 8px; background: rgba(255, 255, 255, 0.2); padding: 8px 16px; border-radius: 20px; }
.vaccine-stat strong { font-size: 22px; }
.vaccine-card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; margin-bottom: 20px; }
.vaccine-category-card { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow: hidden; border: 2px solid var(--light-blue); }
.vaccine-category-header { background: var(--lighter-blue); padding: 14px 16px; display: flex; align-items: center; gap: 12px; border-bottom: 2px solid var(--accent-blue); }
.vaccine-category-header i { font-size: 22px; color: var(--accent-blue); }
.vaccine-category-header h3 { flex: 1; color: var(--primary-blue); font-size: 16px; }
.vaccine-count { background: var(--primary-blue); color: var(--white); padding: 3px 12px; border-radius: 20px; font-weight: 600; font-size: 13px; }
.vaccine-category-list { padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.vaccine-item { display: flex; align-items: flex-start; gap: 12px; padding: 12px; border-radius: 8px; cursor: pointer; border: 1px solid transparent; transition: all 0.15s; }
.vaccine-item.completed { background: color-mix(in srgb, var(--success-bg) 28%, var(--white)); }
.vaccine-item.completed:hover { background: var(--success-bg); border-color: var(--success); }
.vaccine-item.pending { background: var(--warning-bg); }
.vaccine-item.pending:hover { background: #fde68a; border-color: var(--warning); }
.vaccine-item-icon { width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 17px; flex-shrink: 0; }
.vaccine-item.completed .vaccine-item-icon { background: var(--success-bg); color: var(--success-text); }
.vaccine-item.pending .vaccine-item-icon { background: #fde68a; color: var(--warning-text); }
.vaccine-item-name { font-weight: 600; font-size: 14px; }
.vaccine-item-dose { font-size: 12px; color: var(--gray-text); }
.vaccine-item-date { font-size: 12px; color: var(--success-text); display: flex; align-items: center; gap: 4px; margin-top: 2px; }
.vaccine-item-date.pending { color: var(--warning-text); }

/* Receita */
.prescription-header { padding: 18px; border-radius: 8px; margin-bottom: 20px; display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.prescription-header.valid { background: linear-gradient(135deg, #d1fae5, #a7f3d0); border: 2px solid var(--success); }
.prescription-header.expired { background: linear-gradient(135deg, #fee2e2, #fecaca); border: 2px solid var(--danger); }
.prescription-status { font-size: 18px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.prescription-header.valid .prescription-status { color: var(--success-text); }
.prescription-header.expired .prescription-status { color: var(--danger-text); }
.prescription-validity { font-size: 14px; font-weight: 600; }
.prescription-medication { font-size: 20px; color: var(--primary-blue); font-weight: 700; }
.prescription-footer { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 20px; padding-top: 20px; border-top: 2px solid var(--light-blue); }

/* Prontuário */
.patient-record-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.patient-record-card { background: var(--white); border: 2px solid var(--light-blue); border-radius: var(--radius); padding: 14px; }
.patient-record-card.full-width { grid-column: 1 / -1; }
.patient-record-card.highlight { background: linear-gradient(135deg, #fef3c7, #fde68a); border-color: var(--warning); }
.patient-record-card.alert-danger { background: var(--danger-bg); border-color: var(--danger); }
.patient-record-card.alert-success { background: var(--success-bg); border-color: var(--success); }
.patient-record-card.alert-warning { background: var(--warning-bg); border-color: var(--warning); }
.record-label { font-size: 12px; font-weight: 600; color: var(--gray-text); text-transform: uppercase; margin-bottom: 6px; }
.record-value { font-weight: 600; }
.record-value.blood-type { font-size: 24px; color: var(--danger-text); font-weight: 700; }

/* Mapa */
.map-legend { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.legend-item { display: flex; align-items: center; gap: 8px; padding: 8px 16px; background: var(--white); border-radius: 20px; box-shadow: var(--shadow-sm); font-size: 14px; }
.legend-marker { width: 18px; height: 18px; border-radius: 50%; }
.legend-marker.posto { background: var(--success); }
.legend-marker.hospital { background: var(--danger); }
.legend-marker.lab { background: var(--accent-blue); }
.map-container-wrapper { margin-bottom: 8px; }
.google-map { width: 100%; height: 480px; border: 0; border-radius: var(--radius); box-shadow: var(--shadow-md); background: var(--lighter-blue); }
.locations-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 18px; }
.location-card { background: var(--white); border: 2px solid var(--light-blue); border-radius: var(--radius); padding: 18px; cursor: pointer; transition: all 0.15s; display: flex; flex-direction: column; gap: 12px; }
.location-card:hover { border-color: var(--accent-blue); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.location-card.posto { border-left: 4px solid var(--success); }
.location-card.hospital { border-left: 4px solid var(--danger); }
.location-card.lab { border-left: 4px solid var(--accent-blue); }
.location-icon { width: 46px; height: 46px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 22px; }
.location-card.posto .location-icon { background: var(--success-bg); color: var(--success-text); }
.location-card.hospital .location-icon { background: var(--danger-bg); color: var(--danger-text); }
.location-card.lab .location-icon { background: var(--info-bg); color: var(--info-text); }
.location-info { flex: 1; }
.location-name { font-size: 18px; color: var(--primary-blue); margin-bottom: 8px; }
.location-address, .location-hours, .location-phone { font-size: 14px; color: var(--gray-text); margin: 4px 0; display: flex; align-items: center; gap: 8px; }
.location-address i, .location-hours i, .location-phone i { color: var(--accent-blue); width: 16px; }
.services-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.service-tag { background: var(--lighter-blue); color: var(--primary-blue); padding: 6px 12px; border-radius: 16px; font-size: 13px; font-weight: 500; }
.exams-highlight { background: var(--warning-bg); border: 2px solid var(--warning); border-radius: 8px; padding: 14px; }
.exams-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; margin-top: 8px; }
.exam-badge { background: var(--white); border: 1px solid #fbbf24; padding: 8px 12px; border-radius: 6px; font-size: 13px; display: flex; align-items: center; gap: 6px; }
.exam-badge i { color: var(--success-text); }

/* Login */
.login-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 20px; background: linear-gradient(135deg, var(--lighter-blue) 0%, var(--light-blue) 100%); }
.login-container { background: var(--white); padding: 48px 44px; border-radius: 20px; box-shadow: var(--shadow-lg); width: 100%; max-width: 460px; }
.logo-section { text-align: center; margin-bottom: 32px; }
.logo-text-main { font-size: 60px; font-weight: 700; color: var(--primary-blue); letter-spacing: -2px; }
.slogan { color: var(--gray-text); font-size: 14px; font-style: italic; max-width: 300px; margin: 8px auto 0; }
.password-row { position: relative; }
.password-row .form-control { padding-right: 48px; }
.password-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 38px; height: 38px; border: none; background: transparent; color: var(--gray-text); border-radius: 8px; }
.password-toggle:hover { background: var(--light-blue); color: var(--primary-blue); }
.login-container .btn-block { width: 100%; padding: 14px; font-size: 16px; }
.demo-box { margin-top: 28px; padding: 16px; border: 2px dashed var(--border-color); border-radius: var(--radius); font-size: 14px; }
.demo-box h2 { font-size: 14px; color: var(--primary-blue); margin-bottom: 4px; text-transform: uppercase; letter-spacing: 0.5px; }
.demo-box .demo-actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0 8px; }
.demo-box code { background: var(--lighter-blue); padding: 2px 6px; border-radius: 4px; }
.login-note { text-align: center; color: var(--gray-text); margin-top: 24px; font-size: 13px; }

/* ---------- 6. Responsivo / movimento / impressão ---------- */
@media (max-width: 900px) {
  .header { padding: 14px 18px; }
  .header-logo, .header-divider { display: none; }
  #page-title { font-size: 18px; }
  .content-area { padding: 18px 16px 100px; }
  .section { padding: 20px 16px; }
  .agenda-date-display { min-width: 0; }
  .prescription-footer { grid-template-columns: 1fr; }
  .calendar-day { min-height: 56px; }
  .calendar-day-free { display: none; }
  .notifications-btn { right: 16px; bottom: 16px; width: 50px; height: 50px; }
  .notifications-panel { right: 16px; bottom: 78px; }
  .login-container { padding: 32px 22px; }
}

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

@media print {
  body { background: #fff; }
  #app, .toast-region, .skip-link { display: none !important; }
  .modal-overlay { position: static; display: block; background: none; backdrop-filter: none; padding: 0; }
  .modal { box-shadow: none; max-width: none; max-height: none; overflow: visible; padding: 0; animation: none; }
  .modal-actions, .modal-close { display: none !important; }
}

/* Versão hospedada: substitutos do mapa embutido e da exportação */
.map-fallback { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 40px 20px; text-align: center; border-radius: var(--radius); background: var(--lighter-blue); color: var(--gray-text); }
.map-fallback > i, .map-fallback > svg { font-size: 40px; color: var(--primary-blue); }
.export-text { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; resize: vertical; }
.login-body .login-container { margin: auto; }
body.login-body { align-items: flex-start; }

/* Logotipo (imagem) */
.logo-img { display: block; max-width: 100%; height: auto; }
.logo-img-login { width: 280px; margin: 0 auto; }

.logo-img-header { width: 96px; }
@media (max-width: 900px) { .logo-img-login { width: 220px; } }

/* QR Code dos documentos */
.qr-box { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; margin-top: 20px; padding: 16px; border: 2px dashed var(--border-color); border-radius: var(--radius); }
.qr-figure { flex: 0 0 auto; background: #fff; padding: 6px; border-radius: 10px; box-shadow: var(--shadow-sm); }
.qr-svg { display: block; width: 200px; max-width: 100%; height: auto; }
.qr-info { flex: 1 1 220px; min-width: 0; font-size: 14px; }
.qr-info h3 { font-size: 15px; color: var(--primary-blue); margin-bottom: 6px; }
.qr-info p { margin-bottom: 6px; color: var(--gray-text); }
.qr-code code, .verify-container code { background: var(--lighter-blue); padding: 2px 6px; border-radius: 4px; overflow-wrap: anywhere; color: var(--dark-text); }
.login-verify { text-align: center; margin-top: 18px; }
.verify-container { max-width: 520px; }
.verify-title { font-size: 20px; color: var(--primary-blue); margin-bottom: 8px; }
#verify-result { margin-top: 18px; }
#verify-result .banner { display: flex; gap: 12px; align-items: flex-start; }

/* 2ª via da farmácia */
.pharm-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: baseline; padding-bottom: 10px; margin-bottom: 12px; border-bottom: 2px solid var(--primary-blue); color: var(--primary-blue); }
.pharm-head code { background: var(--lighter-blue); padding: 2px 6px; border-radius: 4px; color: var(--dark-text); overflow-wrap: anywhere; }
.pharm-register { margin-top: 16px; padding: 14px 16px; border: 2px dashed var(--border-color); border-radius: var(--radius); }
.pharm-register h3 { font-size: 14px; color: var(--primary-blue); margin-bottom: 8px; }
.pharm-register p { margin-bottom: 8px; color: var(--dark-text); overflow-wrap: anywhere; }
.verify-pharm { margin-top: 12px; }

/* Código temporário */
.otp-box { text-align: center; }
.otp-code { font-size: 44px; font-weight: 700; letter-spacing: 6px; color: var(--primary-blue); background: var(--lighter-blue); border-radius: var(--radius); padding: 16px 8px; margin: 14px 0; font-variant-numeric: tabular-nums; }
.otp-code.expired { color: var(--gray-text); }
.otp-timer { font-size: 16px; margin-bottom: 6px; }
.otp-input { font-size: 28px; letter-spacing: 6px; text-align: center; font-variant-numeric: tabular-nums; }
.verify-details { margin-top: 22px; padding: 12px 14px; border: 1px solid var(--border-color); border-radius: var(--radius); }
.verify-details summary { cursor: pointer; font-weight: 600; color: var(--primary-blue); }
.verify-details form { margin-top: 12px; }

/* ---------- Menu lateral retrátil ---------- */

@media (max-width: 900px) {
  .app { padding-left: 76px; }
  .user-meta { display: none; }

  .logo-img-header, .header-divider { display: none; }
}

/* ---------- Menu da conta (avatar) ---------- */
.user-menu-wrap { position: relative; flex-shrink: 0; }
.user-menu { position: absolute; right: 0; top: calc(100% + 10px); z-index: 60; width: 290px; max-width: calc(100vw - 24px); background: var(--white); border: 1px solid var(--border-color); border-radius: 14px; box-shadow: var(--shadow-lg); padding: 8px; }
.user-menu-head { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px 12px; border-bottom: 1px solid var(--border-color); margin-bottom: 6px; min-width: 0; }
.user-menu-head span { font-size: 13px; color: var(--gray-text); overflow-wrap: anywhere; }
.user-menu-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 11px 12px; border: 0; border-radius: 10px; background: transparent; color: var(--dark-text); font-size: 15px; font-weight: 500; text-align: left; text-decoration: none; }
.user-menu-item i { width: 20px; text-align: center; color: var(--primary-blue); }
.user-menu-item:hover, .user-menu-item.active { background: var(--lighter-blue); }
.user-menu-item.danger, .user-menu-item.danger i { color: var(--danger-text); }
.user-menu-item.danger:hover { background: var(--danger-bg); }
.user-menu-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 12px; font-size: 14px; color: var(--gray-text); }
.user-menu-sep { height: 1px; background: var(--border-color); margin: 6px 0; }
.text-size { display: inline-flex; gap: 4px; }
.text-size-btn { min-width: 38px; height: 32px; padding: 0 8px; border: 1px solid var(--border-color); border-radius: 8px; background: var(--white); color: var(--primary-blue); font-weight: 700; font-size: 13px; }
.text-size-btn.active { background: var(--primary-blue); border-color: var(--primary-blue); color: var(--white); }
.profile-head { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.profile-avatar { width: 56px; height: 56px; font-size: 18px; }
.profile-role { margin: 0; }
.pw-hint { margin: -6px 0 14px; font-size: 13px; }
.check-row { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--gray-text); }

/* ---------- Tamanho do texto (zoom da interface) ---------- */
body.text-lg { --ui-zoom: 1.15; }
body.text-xl { --ui-zoom: 1.3; }
body.text-lg .modal, body.text-xl .modal { zoom: var(--ui-zoom); max-height: calc(92vh / var(--ui-zoom)); }
@media (max-width: 900px) { .user-caret { display: none; } .user-info { padding: 2px; } }

/* Importação de PDF (exame externo) */
.pdf-drop { border: 2px dashed var(--border, #cbd5e1); border-radius: 10px; padding: 14px; display: flex; flex-direction: column; gap: 8px; background: var(--lighter-blue); }
.pdf-results input.form-control { padding: 6px 8px; min-width: 70px; }
.pdf-results td:first-child input { min-width: 160px; }
.pdf-sub { font-size: 16px; margin: 6px 0; color: var(--primary-blue); }

/* ================= Mesa de trabalho do médico ================= */
.app-doctor { flex-direction: column; }
.dw-top { position: relative; z-index: 40; display: flex; align-items: center; gap: 10px; padding: 8px 20px; background: var(--white); box-shadow: var(--shadow); min-height: 64px; }
.dw-brand { display: flex; align-items: center; flex-shrink: 0; }
.logo-img-dw { width: 92px; display: block; }
.dw-nav { display: flex; align-items: center; gap: 4px; flex: 1; min-width: 0; margin-left: 14px; overflow-x: auto; scrollbar-width: none; }
.dw-nav::-webkit-scrollbar { display: none; }
.dw-link { display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; border: none; background: none; border-radius: 10px; color: var(--dark-text); font-size: 15px; font-weight: 500; text-decoration: none; cursor: pointer; white-space: nowrap; }
.dw-link:hover { background: var(--lighter-blue); }
.dw-link.active { background: var(--primary-blue); color: var(--white); }
.dw-link i:first-child { color: var(--accent-blue); }
.dw-link.active i:first-child { color: var(--white); }
.dw-link .fa-chevron-down { font-size: 10px; opacity: 0.7; }
.dw-group { position: relative; }
.dw-menu { position: fixed; z-index: 60; min-width: 220px; margin-top: 6px; background: var(--white); border: 1px solid var(--border-color); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 6px; display: flex; flex-direction: column; }
.dw-menu a, .dw-menu button { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: none; background: none; text-align: left; border-radius: 8px; color: var(--dark-text); font-size: 14px; text-decoration: none; cursor: pointer; }
.dw-menu a:hover, .dw-menu button:hover, .dw-menu a:focus-visible, .dw-menu button:focus-visible { background: var(--lighter-blue); }
.dw-body { flex: 1; display: flex; min-height: 0; }
.dw-today { position: relative; width: 290px; flex-shrink: 0; background: var(--white); border-right: 1px solid var(--light-blue); padding: 0; display: flex; flex-direction: column; }
.dw-inner { flex: 1; min-height: 0; padding: 18px 16px; display: flex; flex-direction: column; gap: 12px; overflow-y: auto; }
.dw-collapse { position: absolute; top: 22px; right: -15px; z-index: 36; width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--light-blue); background: var(--white); color: var(--primary-blue); cursor: pointer; font-size: 12px; display: flex; align-items: center; justify-content: center; }
.dw-collapse:hover { background: var(--primary-blue); border-color: var(--primary-blue); color: var(--white); }
.dw-bubble { display: none; position: fixed; z-index: 90; bottom: 56px; right: 96px; width: 56px; height: 56px; border-radius: 50%; border: none; cursor: pointer; background: var(--primary-blue); color: var(--white); font-size: 21px; align-items: center; justify-content: center; box-shadow: var(--shadow-lg); }
.dw-bubble:hover { background: var(--primary-hover); }
.dw-bubble .badge-count { position: absolute; top: -4px; right: -4px; }
.dw-collapsed .dw-today { display: none; }
.dw-collapsed .dw-bubble { display: flex; }
.dw-search { display: flex; align-items: center; gap: 8px; border: 1px solid var(--border-color); border-radius: 10px; padding: 0 12px; background: var(--white); color: var(--gray-text); }
.dw-search:focus-within { border-color: var(--accent-blue); box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2); }
.dw-q { flex: 1; min-width: 0; border: none; outline: none; padding: 11px 0; font: inherit; font-size: 15px; background: transparent; color: var(--dark-text); }
.dw-title { font-size: 13px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--gray-text); font-family: inherit; font-weight: 700; margin: 8px 0 6px; display: flex; align-items: center; justify-content: space-between; }
.dw-count { background: var(--info-bg); color: var(--info-text); border-radius: 999px; padding: 2px 9px; font-size: 12px; font-weight: 700; }
.dw-patients { list-style: none; display: flex; flex-direction: column; gap: 2px; }
.dw-patient { display: flex; align-items: center; gap: 10px; padding: 9px 8px; border-radius: 10px; text-decoration: none; color: var(--dark-text); }
.dw-patient:hover, .dw-patient:focus-visible { background: var(--lighter-blue); }
.dw-pname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; }
.dw-time { font-size: 13px; font-weight: 700; color: var(--primary-blue); background: var(--lighter-blue); border-radius: 8px; padding: 3px 8px; }
.dw-dot { font-size: 20px; line-height: 1; display: inline-flex; }
.dw-wait { color: var(--warning); } .dw-now { color: var(--accent-blue); } .dw-done { color: var(--success); }
.dw-all { display: flex; align-items: center; gap: 8px; justify-content: space-between; padding: 10px 8px; color: var(--primary-blue); text-decoration: none; font-weight: 600; }
.dw-empty { padding: 8px; }
.dw-new { margin-top: auto; text-align: center; text-decoration: none; }
.dw-center { flex: 1; min-width: 0; display: flex; flex-direction: column; background: var(--lighter-blue); }
.dw-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 40px 0; flex-wrap: wrap; }
.dw-center .content-area { padding-top: 18px; }
.dw-chip { display: flex; align-items: center; gap: 12px; background: var(--success-bg); border: 1px solid var(--success); border-radius: 14px; padding: 8px 12px; max-width: 100%; }
.dw-chip-title { font-weight: 700; color: var(--success-text); display: inline-flex; gap: 8px; align-items: center; }
.dw-chip-back { background: var(--white); border-radius: 8px; padding: 6px 10px; color: var(--dark-text); text-decoration: none; font-size: 14px; }
.dw-chip-end { border: none; background: none; cursor: pointer; color: var(--success-text); font-size: 16px; padding: 4px 6px; border-radius: 6px; }
.dw-foot { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 8px 20px; background: var(--white); border-top: 1px solid var(--light-blue); color: var(--gray-text); font-size: 13px; }
.dw-foot span { display: inline-flex; gap: 8px; align-items: center; }
.dw-two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; }
.dw-two > .section { margin-bottom: 20px; }
.dw-chart { display: flex; align-items: flex-end; gap: 10px; height: 190px; padding-top: 10px; }
.dw-col { flex: 1; min-width: 0; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px; }
.dw-bar { width: 100%; max-width: 44px; background: var(--accent-blue); border-radius: 8px 8px 2px 2px; opacity: 0.75; min-height: 4px; }
.dw-today-bar { background: var(--primary-blue); opacity: 1; }
.dw-val { font-weight: 700; color: var(--primary-blue); font-size: 14px; }
.dw-day { font-size: 12px; color: var(--gray-text); white-space: nowrap; }
.dw-h-0 { height: 4px; } .dw-h-1 { height: 10%; } .dw-h-2 { height: 20%; } .dw-h-3 { height: 30%; } .dw-h-4 { height: 40%; } .dw-h-5 { height: 50%; }
.dw-h-6 { height: 60%; } .dw-h-7 { height: 70%; } .dw-h-8 { height: 80%; } .dw-h-9 { height: 90%; } .dw-h-10 { height: 100%; }
.app-doctor .notifications-btn { bottom: 56px; }
@media (max-width: 900px) {
  .app-doctor { padding-left: 0; }
  .dw-top { padding: 8px 12px; gap: 8px; }
  .dw-nav { margin-left: 4px; }
  .dw-link span { display: none; } .dw-link { padding: 10px 12px; }
  .dw-link .fa-chevron-down { display: none; }
  .dw-body { position: relative; }
  .dw-today, .dw-collapsed .dw-today { display: none; position: absolute; z-index: 35; left: 0; top: 0; bottom: 0; width: min(320px, 88vw); box-shadow: var(--shadow-lg); }
  .dw-today-open .dw-today, .dw-today-open.dw-collapsed .dw-today { display: flex; }
  .dw-collapse { right: 10px; top: 12px; }
  .dw-bubble, .dw-collapsed .dw-bubble { display: flex; right: 74px; bottom: 56px; width: 50px; height: 50px; }
  .dw-today-open .dw-bubble, .dw-today-open.dw-collapsed .dw-bubble { display: none; }
  .dw-head { padding: 14px 16px 0; }
  .dw-two { grid-template-columns: minmax(0, 1fr); }
  .user-meta { display: none; }
  .logo-img-dw { width: 72px; }
}
.app-doctor:not(.app-top) .cards-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 900px) { .app-doctor:not(.app-top) .cards-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .app-doctor:not(.app-top) .cards-grid { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Temas por perfil: só trocam as variáveis de cor (todo o resto herda) ---------- */
/* Gestante: rosa-chá e lavanda, suaves, com contraste AA para texto */
body.theme-gestante {
  --primary-blue: #9d3b6b; --primary-hover: #833058; --accent-blue: #d6659a; --light-blue: #fbe4ef; --lighter-blue: #fff5f9;
  --gray-text: #6b5663; --border-color: #e7cfdc; --info-text: #7c2f58; --info-bg: #fbe4ef;
}
body.theme-gestante, body.theme-gestante.login-body { background: linear-gradient(160deg, #fff5f9 0%, #f3e8ff 100%); }
body.theme-gestante .header { border-top: 3px solid #d6659a; }
/* Farmácia: verde-azulado */
body.theme-farmacia {
  --primary-blue: #0f766e; --primary-hover: #115e59; --accent-blue: #14b8a6; --light-blue: #ccfbf1; --lighter-blue: #f0fdfa;
  --border-color: #c3dcd8; --info-text: #0f5f58; --info-bg: #ccfbf1;
}
body.theme-farmacia, body.theme-farmacia.login-body { background: linear-gradient(160deg, #f0fdfa 0%, #e0f2fe 100%); }
body.theme-farmacia .header { border-top: 3px solid #14b8a6; }

/* Seletor de modo no login */
.login-modes { display: flex; gap: 6px; margin: 4px 0 8px; }
.login-mode { flex: 1; border: 1.5px solid var(--border-color); background: var(--white); color: var(--gray-text); border-radius: 10px; padding: 9px 6px; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.login-mode.is-on { background: var(--primary-blue); border-color: var(--primary-blue); color: var(--white); }
.login-mode-text { text-align: center; color: var(--gray-text); font-size: 14px; margin: 0 0 12px; }
@media (max-width: 480px) { .login-modes { flex-direction: column; } }

/* Formulários e tabelas novos */
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 0 14px; }
.check-row { display: flex; align-items: center; gap: 10px; margin: 6px 0 14px; font-weight: 600; font-size: 14px; }
.check-row input { width: 18px; height: 18px; accent-color: var(--primary-blue); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table .pos { color: var(--success-text); font-weight: 700; } .table .neg { color: var(--danger-text); font-weight: 700; }
.row-actions { white-space: nowrap; }
.row-actions .btn + .btn { margin-left: 6px; }
.card-icon.orange { background: var(--warning-bg); color: var(--warning-text); }
.stock-toolbar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 14px; margin-bottom: 14px; }
.stock-toolbar .form-group { margin-bottom: 0; min-width: 200px; flex: 1; }
.ph-otp-form { max-width: 360px; }
.legend-marker.farmacia { background: #7c3aed; }
.location-card.farmacia { border-left: 4px solid #7c3aed; }
.location-card.farmacia .location-icon { background: #ede9fe; color: #5b21b6; }

/* Mapa › meus medicamentos */
.med-card { border: 1px solid var(--border-color); border-radius: var(--radius); background: var(--white); padding: 16px; margin: 12px 0; }
.med-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.med-head h4 { margin: 0 0 2px; font-size: 17px; }
.med-list { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 8px; }
.med-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 12px; border-radius: 10px; background: var(--lighter-blue); }
.med-row-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1 1 240px; }
.med-row-side { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* Carteira de pré-natal */
.pn-hero { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 18px; padding: 22px; border-radius: 16px; margin-bottom: 18px; color: var(--white); background: linear-gradient(135deg, #9d3b6b 0%, #b05a9e 55%, #8a6fd1 100%); }
.pn-hero-main { flex: 1 1 320px; min-width: 0; }
.pn-eyebrow { margin: 0; text-transform: uppercase; letter-spacing: 0.08em; font-size: 12px; font-weight: 700; opacity: 0.9; }
.pn-weeks { margin: 4px 0 12px; font-size: 32px; line-height: 1.15; color: var(--white); }
.pn-progress { width: 100%; height: 12px; border: 0; border-radius: 8px; background: rgba(255, 255, 255, 0.3); overflow: hidden; appearance: none; -webkit-appearance: none; }
.pn-progress::-webkit-progress-bar { background: rgba(255, 255, 255, 0.3); border-radius: 8px; }
.pn-progress::-webkit-progress-value { background: var(--white); border-radius: 8px; }
.pn-progress::-moz-progress-bar { background: var(--white); border-radius: 8px; }
.pn-meta { margin: 12px 0 0; }
.pn-hero-side { display: flex; flex-direction: column; justify-content: space-between; align-items: flex-start; gap: 12px; flex: 0 1 280px; }
.pn-baby { display: flex; gap: 12px; align-items: center; background: rgba(255, 255, 255, 0.18); border-radius: 12px; padding: 12px 14px; }
.pn-baby i { font-size: 26px; }
.pn-baby .muted { display: block; color: rgba(255, 255, 255, 0.9); }
.pn-figure { margin: 0; }
.pn-chart { width: 100%; max-width: 640px; height: auto; }
.pn-grid { stroke: var(--border-color); stroke-width: 1; }
.pn-axis { fill: var(--gray-text); font-size: 11px; }
.pn-line { fill: none; stroke: var(--primary-blue); stroke-width: 3; stroke-linejoin: round; }
.pn-dot { fill: var(--white); stroke: var(--primary-blue); stroke-width: 2.5; }
.pn-list { list-style: none; margin: 0 0 18px; padding: 0; display: grid; gap: 8px; }
.pn-item { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 14px; border: 1px solid var(--border-color); border-radius: 12px; background: var(--white); }
.pn-item.pn-done { background: var(--success-bg); border-color: transparent; }
.pn-item.pn-overdue { border-color: var(--warning); }
.pn-item-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1 1 260px; }
.pn-item-side { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.table-compact th, .table-compact td { padding: 10px 8px; font-size: 14px; }
.table-compact .btn-sm { padding: 8px 10px; }
.med-row-main { gap: 0; }

/* Modelo 3D do bebê */
.b3d { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 22px; align-items: start; }
.b3d-stage { min-width: 0; }
.b3d-canvas { width: 100%; height: auto; aspect-ratio: 1 / 0.78; display: block; border-radius: 16px; cursor: grab; touch-action: none;
  background: radial-gradient(circle at 50% 40%, var(--white) 0%, var(--light-blue) 100%); border: 1px solid var(--border-color);
  --b3d-skin: #f2b9a4; --b3d-hi: #ffe6da; --b3d-lo: #c98072; --b3d-ink: #6b5663; --b3d-line: #9d3b6b; }
.b3d-canvas:active { cursor: grabbing; }
.b3d-canvas:focus-visible { outline: 3px solid var(--primary-blue); outline-offset: 3px; }
.b3d-hint { margin: 8px 0 0; text-align: center; font-size: 13px; }
.b3d-week { margin: 0 0 10px; font-size: 20px; color: var(--primary-blue); }
.b3d-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 0 0 14px; }
.b3d-stats div { background: var(--lighter-blue); border-radius: 12px; padding: 12px; }
.b3d-stats dt { font-size: 12px; color: var(--gray-text); font-weight: 600; }
.b3d-stats dd { margin: 4px 0 0; font-size: 22px; font-weight: 700; color: var(--primary-blue); }
.b3d input[type=range] { width: 100%; accent-color: var(--primary-blue); }
.b3d-note { font-size: 13px; margin-top: 12px; }
@media (max-width: 760px) { .b3d { grid-template-columns: minmax(0, 1fr); } }

/* ---- película de navegação (vidro líquido) ---- */
.has-film { position: relative; }
.has-film > .dw-link, .has-film > .dw-group, .has-film > .login-mode { position: relative; z-index: 1; }
.nav-film { position: absolute; left: 0; top: 0; z-index: 0; border-radius: var(--radius); opacity: 0; pointer-events: none;
  background:
    radial-gradient(120% 140% at 18% 0%, rgba(255, 255, 255, 0.85) 0%, rgba(255, 255, 255, 0) 55%),
    linear-gradient(135deg, color-mix(in srgb, var(--primary-blue) 20%, transparent), color-mix(in srgb, var(--accent-blue, var(--primary-blue)) 9%, transparent));
  -webkit-backdrop-filter: blur(10px) saturate(1.7); backdrop-filter: blur(10px) saturate(1.7);
  border: 1px solid rgba(255, 255, 255, 0.75);
  box-shadow: inset 0 1.5px 0 rgba(255, 255, 255, 0.95), inset 0 -8px 14px -8px color-mix(in srgb, var(--primary-blue) 35%, transparent),
    0 8px 22px -10px color-mix(in srgb, var(--primary-blue) 55%, transparent), 0 1px 3px rgba(0, 0, 0, 0.06);
  transition: transform 0.55s cubic-bezier(0.65, 0, 0.2, 1), width 0.55s cubic-bezier(0.65, 0, 0.2, 1), height 0.55s cubic-bezier(0.65, 0, 0.2, 1), opacity 0.2s; }
.nav-film.on { opacity: 1; }
.nav-film.no-anim { transition: none; }
.nav-film.sweep { animation: film-blob 0.6s cubic-bezier(0.45, 0, 0.2, 1); }
@keyframes film-blob { 0% { scale: 1 1; } 35% { scale: 1.07 0.9; } 70% { scale: 0.98 1.04; } 100% { scale: 1 1; } }
.nav-film::after { content: ""; position: absolute; inset: 0; border-radius: inherit; opacity: 0; pointer-events: none;
  background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, 0.7) 50%, transparent 70%); background-size: 250% 100%; }
.nav-film.sweep::after { animation: film-gleam 0.8s ease-out; }
@keyframes film-gleam { 0% { background-position: 130% 0; opacity: 1; } 100% { background-position: -30% 0; opacity: 0; } }
.dw-nav.has-film .nav-film { border-radius: 12px; clip-path: inset(0 round 12px); }

/* aba ativa: a cor aparece no ícone e no texto, o fundo fica por conta do vidro */
.has-film .dw-link.active { background: transparent; color: var(--primary-blue); }
.has-film .dw-link i:first-child { color: var(--gray-text); transition: color 0.15s, transform 0.3s; }
.has-film .dw-link.active i:first-child { color: var(--accent-blue, var(--primary-blue)); }
.has-film .dw-link { transition: color 0.15s; }
.has-film .dw-link.active { transition: color 0.25s 0.2s; }
.has-film .dw-link.active i:first-child { transition: color 0.3s 0.2s, transform 0.3s; }
.has-film .dw-link:hover:not(.active) { background: var(--lighter-blue); }
.dw-link i.pop { animation: icon-pop 0.55s cubic-bezier(0.34, 1.56, 0.64, 1) 0.15s both; }
@keyframes icon-pop { 0% { transform: scale(0.6) rotate(-12deg); opacity: 0.4; } 100% { transform: scale(1) rotate(0); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .nav-film, .nav-film::after, .dw-link i.pop { transition: none; animation: none; } }

/* ---- vidro líquido na seleção de acesso do login ---- */
.login-modes { position: relative; padding: 4px; border-radius: 14px; background: var(--lighter-blue); border: 1px solid var(--border-color); }
.login-modes.has-film .nav-film { border-radius: 10px; clip-path: inset(0 round 10px); }
.login-modes.has-film .login-mode { background: transparent; border-color: transparent; transition: color 0.15s; }
.login-modes.has-film .login-mode.is-on { background: transparent; border-color: transparent; color: var(--primary-blue); transition: color 0.25s 0.2s; }
.login-mode i { color: inherit; transition: color 0.3s 0.2s; }
.login-modes.has-film .login-mode.is-on i { color: var(--accent-blue, var(--primary-blue)); }
.login-mode { display: inline-flex; align-items: center; justify-content: center; gap: 7px; text-align: center; line-height: 1.2; }

/* abas internas (carteira de vacinas, receitas): vidro no lugar do sublinhado */
.tabs.has-film { position: relative; padding-bottom: 6px; }
.tabs.has-film .nav-film { border-radius: 12px; clip-path: inset(0 round 12px); }
.tabs.has-film .tab { z-index: 1; border-radius: 12px; transition: color 0.15s; }
.tabs.has-film .tab.active { color: var(--primary-blue); transition: color 0.25s 0.2s; }
.tabs.has-film .tab.active::after { display: none; }
.tabs.has-film .tab:hover:not(.active) { background: var(--lighter-blue); }

/* ---------- celular: menu suspenso embaixo, arredondado, em vidro ---------- */
@media (max-width: 700px) {
  .app { padding-left: 0; }

  .content-area { padding: 20px 16px calc(110px + env(safe-area-inset-bottom, 0px)); }
  .notifications-btn { bottom: calc(90px + env(safe-area-inset-bottom, 0px)); right: 16px; width: 50px; height: 50px; }
  .notifications-panel { bottom: calc(150px + env(safe-area-inset-bottom, 0px)); right: 16px; }
  .dw-bubble, .dw-collapsed .dw-bubble { bottom: calc(150px + env(safe-area-inset-bottom, 0px)); right: 16px; }

  /* médico: o menu superior desce para o rodapé */
  .app-doctor .dw-nav { position: fixed; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); margin: 0; z-index: 55; display: flex; justify-content: space-between; gap: 2px; padding: 6px; border-radius: 28px;
    border: 1px solid rgba(255, 255, 255, 0.8); box-shadow: 0 14px 34px -10px rgba(15, 23, 42, 0.35), 0 2px 6px rgba(15, 23, 42, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.9); }
  /* o vidro fica num pseudo-elemento: backdrop-filter direto no menu prendia o submenu da Agenda atrás do conteúdo */
  .app-doctor .dw-nav::before { content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; pointer-events: none;
    background: color-mix(in srgb, var(--white) 72%, transparent); -webkit-backdrop-filter: blur(18px) saturate(1.8); backdrop-filter: blur(18px) saturate(1.8); }
  .dw-nav > .dw-link, .dw-nav .dw-group { flex: 1 1 0; min-width: 0; display: flex; }
  .dw-nav .dw-group > .dw-link { flex: 1; }
  .dw-nav .dw-link { justify-content: center; padding: 13px 0; border-radius: 22px; }
  .dw-nav > .dw-link.active { flex: 2.6 1 0; }
  .dw-nav .dw-group:has(> .dw-link.active) { flex: 2.6 1 0; }
  .dw-nav .dw-group > .dw-link.active span { display: inline; font-size: 13px; font-weight: 700; }
  .dw-nav > .dw-link.active span { display: inline; font-size: 13px; font-weight: 700; }
  .dw-nav.has-film .nav-film { border-radius: 22px; clip-path: inset(0 round 22px); }
  .app-doctor .dw-nav { z-index: 95; }
  .dw-menu { display: none !important; } /* no celular a Agenda abre direto; sem submenu */
}

/* ---------- Recepção (violeta) e Administrativo (bronze) ---------- */
body.theme-recepcao {
  --primary-blue: #6d28d9; --primary-hover: #5b21b6; --accent-blue: #8b5cf6; --light-blue: #ede9fe; --lighter-blue: #f7f4ff;
  --gray-text: #5f5a73; --border-color: #ddd6f3; --info-text: #5b21b6; --info-bg: #ede9fe;
}
body.theme-recepcao, body.theme-recepcao.login-body { background: linear-gradient(160deg, #f7f4ff 0%, #eef2ff 100%); }
body.theme-recepcao .header { border-top: 3px solid #8b5cf6; }
body.theme-admin {
  --primary-blue: #9a5a14; --primary-hover: #7c4710; --accent-blue: #d97706; --light-blue: #fef0d3; --lighter-blue: #fffaf0;
  --gray-text: #6b5f4f; --border-color: #eadbc4; --info-text: #7c4710; --info-bg: #fef0d3;
}
body.theme-admin, body.theme-admin.login-body { background: linear-gradient(160deg, #fffaf0 0%, #fdf0e1 100%); }
body.theme-admin .header { border-top: 3px solid #d97706; }
/* seletor de acesso do login com cinco opções: duas linhas (3 + 2) */
.login-modes { display: grid; grid-template-columns: repeat(6, 1fr); }
.login-modes .login-mode { grid-column: span 2; }
@media (max-width: 480px) { .login-modes { grid-template-columns: repeat(2, 1fr); } .login-modes .login-mode, .login-modes .login-mode:nth-last-child(-n+2) { grid-column: span 1; } .login-modes .login-mode:last-child { grid-column: span 2; } }

/* ---------- Recepção e Administrativo: telas ---------- */
.card-icon.violet { background: #ede9fe; color: #6d28d9; }
.card-extra { font-size: 12px; color: var(--gray-text); margin-top: 2px; }
.small { font-size: 12.5px; }
.staff-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 20px; }
.staff-head h2 { font-size: 24px; margin-bottom: 2px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; }
.btn-ghost { background: transparent; color: var(--primary-blue); border: none; }
.btn-ghost:hover { background: var(--light-blue); }
.btn-danger-ghost { background: transparent; color: var(--danger-text); border: 1px solid var(--danger-bg); }
.btn-danger-ghost:hover { background: var(--danger-bg); }
.back-link { display: inline-flex; gap: 6px; align-items: center; color: var(--primary-blue); font-weight: 600; text-decoration: none; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 14px; }
.toolbar .form-control { width: auto; min-width: 0; }
.toolbar .btn-primary:last-child, .toolbar > .btn-row { margin-left: auto; }
.search-box { position: relative; flex: 1 1 240px; min-width: 0; }
.search-box > i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--gray-text); pointer-events: none; }
.search-box .form-control { width: 100%; padding-left: 36px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 999px; border: 1px solid var(--border-color); background: var(--white); color: var(--dark-text); font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; text-decoration: none; }
.chip:hover { border-color: var(--accent-blue); }
.chip.active { background: var(--primary-blue); border-color: var(--primary-blue); color: #fff; }
.chip-free { background: var(--lighter-blue); border-color: var(--light-blue); color: var(--primary-blue); padding: 5px 11px; }
.chip-free:hover { background: var(--primary-blue); color: #fff; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 20px; margin-bottom: 20px; }
.grid-2 > .section { margin-bottom: 0; }
.kv-list { margin: 0; display: grid; gap: 10px; }
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 10px; }
.kv dt { color: var(--gray-text); font-size: 13.5px; }
.kv dd { margin: 0; font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.form-section { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--primary-blue); margin: 18px 0 8px; padding-bottom: 6px; border-bottom: 1px solid var(--border-color); }
.form-section:first-child { margin-top: 0; }
.pending-list { list-style: none; padding: 0; margin: 12px 0; display: grid; gap: 6px; color: var(--warning-text); }
td.actions { white-space: nowrap; text-align: right; }
.table a { color: var(--primary-blue); font-weight: 700; text-decoration: none; }

/* qualidade do cadastro */
.meter { display: flex; align-items: center; gap: 8px; min-width: 120px; }
.meter-track { flex: 1; height: 8px; border-radius: 99px; background: var(--border-color); overflow: hidden; display: block; }
.meter-fill { display: block; height: 100%; border-radius: 99px; background: var(--m, var(--accent-blue)); }
.meter b { font-size: 12.5px; min-width: 38px; text-align: right; }
.meter-ok { --m: var(--success); } .meter-mid { --m: var(--warning); } .meter-low { --m: var(--danger); }

/* agenda geral / fila */
.day-nav { align-items: center; }
.day-label { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.doc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); gap: 18px; }
.doc-card { margin-bottom: 0; }
.doc-card-head { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; margin-bottom: 10px; }
.doc-card-head h3 { font-size: 16px; }
.doc-card-count { font-size: 12.5px; color: var(--gray-text); text-align: right; }
.slot-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.slot-row { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; gap: 4px 12px; align-items: center; padding: 10px 12px; border: 1px solid var(--border-color); border-left: 4px solid var(--border-color); border-radius: 10px; background: var(--white); }
.slot-row.state-arrived { border-left-color: var(--accent-blue); background: var(--lighter-blue); }
.slot-row.state-done { border-left-color: var(--success); }
.slot-row.state-noshow { border-left-color: var(--danger); }
.slot-row.state-cancelled { opacity: .6; }
.slot-row.state-unset { border-left-color: var(--warning); }
.slot-time { font-weight: 800; color: var(--primary-blue); font-variant-numeric: tabular-nums; }
.slot-main { min-width: 0; }
.slot-main strong { overflow-wrap: anywhere; }
.slot-actions { grid-column: 2 / -1; display: flex; flex-wrap: wrap; gap: 6px; }
.slot-actions:empty { display: none; }
.free-slots { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--border-color); }

/* estatísticas */
.chart-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 18px; margin-bottom: 20px; }
.chart-card { margin-bottom: 0; min-width: 0; }
.chart-card.wide { grid-column: 1 / -1; }
.chart-svg { width: 100%; height: auto; display: block; }
.chart-svg .ax { stroke: var(--border-color); stroke-width: 1; }
.chart-svg .tk { fill: var(--gray-text); font-size: 11px; }
.seg-done { fill: var(--success); background: var(--success); } .seg-other { fill: var(--accent-blue); background: var(--accent-blue); }
.seg-noshow { fill: var(--danger); background: var(--danger); } .seg-cancel { fill: var(--gray-text); background: var(--gray-text); opacity: .55; }
.legend { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 16px; padding: 0; margin: 10px 0 0; font-size: 12.5px; color: var(--gray-text); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; }
.hbars { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.hbars li { display: grid; grid-template-columns: minmax(90px, 36%) 1fr 34px; gap: 10px; align-items: center; }
.hb-label { font-size: 13.5px; overflow-wrap: anywhere; } .hb-label small { display: block; color: var(--gray-text); font-size: 11.5px; }
.hb-track, .vc-track { background: var(--lighter-blue); border-radius: 99px; overflow: hidden; display: block; }
.hb-track { height: 12px; } .hb-fill { display: block; height: 100%; border-radius: 99px; background: var(--primary-blue); }
.hb-fill.c2 { background: var(--accent-blue); } .hb-fill.c3 { background: var(--success); } .hb-fill.c4 { background: var(--warning); }
.hb-val { text-align: right; font-size: 13px; }
.vcols { list-style: none; margin: 0; padding: 0; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 10px; align-items: end; }
.vcols li { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.vc-track { width: 100%; max-width: 44px; height: 130px; display: flex; align-items: flex-end; border-radius: 8px; }
.vc-fill { display: block; width: 100%; background: var(--primary-blue); border-radius: 8px 8px 0 0; }
.vc-fill.c2 { background: var(--accent-blue); }
.vcols small { color: var(--gray-text); font-size: 12px; }

@media (max-width: 700px) {
  .kv { grid-template-columns: 1fr; gap: 0; }
  .doc-grid, .chart-grid { grid-template-columns: minmax(0, 1fr); }
  .toolbar .btn-primary:last-child, .toolbar > .btn-row { margin-left: 0; }
  .slot-row { grid-template-columns: 48px minmax(0, 1fr); }
  .slot-state { grid-column: 2; }
  .hbars li { grid-template-columns: minmax(80px, 40%) 1fr 30px; }
}
body.theme-recepcao .cards-grid, body.theme-admin .cards-grid , body.theme-supremo .cards-grid { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.slot-row.plain { grid-template-columns: minmax(0, 1fr) auto; }
.slot-row.plain .slot-actions { grid-column: 1 / -1; }
@media (max-width: 700px) {
  body.theme-recepcao .cards-grid, body.theme-admin .cards-grid , body.theme-supremo .cards-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  body.theme-recepcao .card-value, body.theme-admin .card-value , body.theme-supremo .card-value { font-size: 28px; }
  body.theme-recepcao .card-icon, body.theme-admin .card-icon , body.theme-supremo .card-icon { width: 40px; height: 40px; font-size: 18px; }
  body.theme-recepcao .card-header, body.theme-admin .card-header , body.theme-supremo .card-header { gap: 8px; }
}

/* financeiro */
.money { font-variant-numeric: tabular-nums; white-space: nowrap; }
.pos { color: var(--success-text); } .neg { color: var(--danger-text); }
td.num, th.num { text-align: right; }
.tabs + #fn-body { margin-top: 18px; }
.tab .fas { margin-right: 4px; }
body.theme-admin .card-value , body.theme-supremo .card-value { font-size: 28px; overflow-wrap: anywhere; }
body.theme-admin .card-header , body.theme-supremo .card-header { gap: 10px; }
body.theme-admin .cards-grid.fin-kpis , body.theme-supremo .cards-grid.fin-kpis { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
body.theme-admin .fin-kpis .card-value , body.theme-supremo .fin-kpis .card-value { font-size: 24px; white-space: nowrap; }
@media (max-width: 700px) { body.theme-admin .cards-grid.fin-kpis , body.theme-supremo .cards-grid.fin-kpis { grid-template-columns: minmax(0, 1fr); } }
body.theme-admin .cards-grid.cols-3 , body.theme-supremo .cards-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 900px) { body.theme-admin .cards-grid.cols-3 , body.theme-supremo .cards-grid.cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.dw-top .user-menu-wrap { margin-left: auto; }

/* ---------- Acessibilidade ---------- */
.a11y-panel { display: grid; gap: 14px; }
.a11y-text { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.a11y-list { display: grid; gap: 8px; }
.a11y-opt { position: relative; display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--border-color); border-radius: 12px; background: var(--white); cursor: pointer; }
.a11y-opt:hover { background: var(--lighter-blue); }
.a11y-opt input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; cursor: pointer; margin: 0; }
.a11y-ico { width: 40px; height: 40px; border-radius: 10px; background: var(--light-blue); color: var(--primary-blue); display: inline-flex; align-items: center; justify-content: center; font-size: 18px; }
.a11y-txt { display: grid; gap: 2px; min-width: 0; }
.a11y-txt small { color: var(--gray-text); font-size: 12.5px; }
.a11y-sw { width: 46px; height: 26px; border-radius: 99px; background: var(--border-color); position: relative; transition: background .2s; flex-shrink: 0; }
.a11y-sw::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: transform .2s; }
.a11y-opt input:checked ~ .a11y-sw { background: var(--primary-blue); }
.a11y-opt input:checked ~ .a11y-sw::after { transform: translateX(20px); }
.a11y-opt input:focus-visible ~ .a11y-sw { outline: 3px solid var(--accent-blue); outline-offset: 2px; }
.a11y-start { border: 1px solid var(--border-color); border-radius: 12px; padding: 12px 14px; margin: 14px 0 0; }
.a11y-start legend { font-weight: 700; color: var(--primary-blue); padding: 0 6px; font-size: 14px; }
.a11y-checks { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 6px 14px; margin-bottom: 6px; }
.a11y-speak { position: fixed; z-index: 95; left: 16px; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); display: inline-flex; align-items: center; gap: 10px; padding: 12px 18px; border: none; border-radius: 999px; background: var(--primary-blue); color: #fff; font: inherit; font-weight: 700; cursor: pointer; box-shadow: var(--shadow-lg); }
.a11y-speak[aria-pressed="true"] { background: var(--danger-text); }
@media (max-width: 700px) { .a11y-speak { bottom: calc(96px + env(safe-area-inset-bottom, 0px)); left: 12px; } }

/* alto contraste */
html.a11y-contrast body { --dark-text: #000; --gray-text: #1b1b1b; --border-color: #111; --light-blue: #fff; --lighter-blue: #fff; --white: #fff; --info-bg: #fff; --success-bg: #fff; --warning-bg: #fff; --danger-bg: #fff; --success-text: #00481f; --danger-text: #8a0000; --warning-text: #5a2800; --info-text: #0b2a8f; background: #fff; }
html.a11y-contrast body, html.a11y-contrast .app, html.a11y-contrast .dw-center, html.a11y-contrast .dw-top { background: #fff; }
html.a11y-contrast .card, html.a11y-contrast .section, html.a11y-contrast .banner, html.a11y-contrast .list-item, html.a11y-contrast .slot-row, html.a11y-contrast .modal, html.a11y-contrast .user-menu { border: 2px solid #000; box-shadow: none; }
html.a11y-contrast .badge { border: 2px solid currentColor; background: #fff; }
html.a11y-contrast .btn-secondary, html.a11y-contrast .chip, html.a11y-contrast .form-control { border: 2px solid #000; }
html.a11y-contrast :focus-visible { outline: 4px solid #000 !important; outline-offset: 2px; box-shadow: 0 0 0 7px #ffd400 !important; }
html.a11y-contrast .dw-link.active, html.a11y-contrast .has-film .dw-link.active { text-decoration: underline; text-underline-offset: 6px; text-decoration-thickness: 3px; }
html.a11y-contrast .nav-film { border: 2px solid #000; background: #fff; }
/* movimento */
html.a11y-motion *, html.a11y-motion *::before, html.a11y-motion *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
/* espaçamento e fonte */
html.a11y-spacing body { line-height: 1.85; letter-spacing: 0.035em; word-spacing: 0.12em; }
html.a11y-spacing p, html.a11y-spacing li { margin-bottom: 0.4em; }
html.a11y-readable body, html.a11y-readable button, html.a11y-readable input, html.a11y-readable select, html.a11y-readable textarea, html.a11y-readable h1, html.a11y-readable h2, html.a11y-readable h3, html.a11y-readable .card-value, html.a11y-readable .section-title { font-family: Verdana, "Trebuchet MS", "Segoe UI", Tahoma, system-ui, sans-serif !important; letter-spacing: 0.02em; }
html.a11y-readable em, html.a11y-readable i:not(.fas):not(.fa) { font-style: normal; }
/* links e foco */
html.a11y-links a:not(.btn):not(.dw-link):not(.dw-brand):not(.card):not(.list-item) { text-decoration: underline !important; text-underline-offset: 3px; }
html.a11y-links :focus-visible { outline: 4px solid #f59e0b !important; outline-offset: 3px; }
/* alvos maiores */
html.a11y-targets .btn, html.a11y-targets .chip, html.a11y-targets .tab, html.a11y-targets .form-control, html.a11y-targets select, html.a11y-targets .text-size-btn, html.a11y-targets .user-menu-item, html.a11y-targets .dw-link { min-height: 48px; }
html.a11y-targets .btn-sm { padding: 12px 18px; }
html.a11y-targets input[type="checkbox"], html.a11y-targets input[type="radio"] { width: 24px; height: 24px; }
html.a11y-targets .dw-link { padding-inline: 18px; }
/* rótulos sempre visíveis no menu */
html.a11y-labels .dw-link span { display: inline !important; }

@media (max-width: 700px) {
  html.a11y-labels .dw-nav .dw-link, html.a11y-labels .dw-nav > .dw-link.active { flex-direction: column; gap: 3px; padding: 8px 2px; flex: 1 1 0; font-size: 10px; line-height: 1.1; }
  html.a11y-labels .dw-nav .dw-link span, html.a11y-labels .dw-nav > .dw-link.active span { display: block !important; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; font-weight: 600; }
}
html.a11y-contrast a:not(.card):not(.list-item):not(.dw-link):not(.btn) { text-decoration: underline; }
html.a11y-contrast a.card, html.a11y-contrast a.list-item { text-decoration: none; }
.dw-nav { flex-wrap: wrap; overflow: visible; row-gap: 4px; }
@media (max-width: 700px) { .app-doctor .dw-nav { flex-wrap: nowrap; } }

/* ---------- sala de espera virtual ---------- */
body.theme-admin .cards-grid.cols-4 , body.theme-supremo .cards-grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1100px) { body.theme-admin .cards-grid.cols-4 , body.theme-supremo .cards-grid.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.slot-row.state-called { border-left-color: var(--accent-green, #16a34a); background: var(--lighter-green, #ecfdf3); }
.wr-card .wr { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; padding: 1rem 1.1rem; border-radius: 14px; border: 1px solid var(--border-color); background: var(--white); }
.wr-card .wr > div { flex: 1 1 14rem; min-width: 0; }
.wr-card .wr p { margin: .15rem 0 0; color: var(--gray-text); }
.wr-card .wr .btn { flex: 0 0 auto; }
.wr-ico { width: 2.6rem; height: 2.6rem; border-radius: 50%; display: grid; place-items: center; background: var(--lighter-blue); color: var(--accent-blue); flex: 0 0 auto; font-size: 1.1rem; }
.wr-pos { display: grid; place-items: center; width: 4.4rem; height: 4.4rem; border-radius: 50%; background: var(--lighter-blue); color: var(--accent-blue); flex: 0 0 auto; text-align: center; line-height: 1; }
.wr-pos b { font-size: 1.5rem; } .wr-pos small { font-size: .7rem; }
.wr-called { background: #ecfdf3; border-color: #16a34a; }
.wr-called .wr-ico { background: #16a34a; color: #fff; animation: wr-ring 1.6s ease-in-out infinite; }
.wr-called strong { font-size: 1.15rem; color: #166534; }
@keyframes wr-ring { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.12); } }
html.a11y-motion .wr-called .wr-ico { animation: none; }
.wr-code-box { text-align: center; }
.wr-code { font-size: 2.6rem; font-weight: 800; letter-spacing: .12em; font-variant-numeric: tabular-nums; padding: .8rem 1rem; border-radius: 14px; background: var(--lighter-blue); color: var(--accent-blue); margin-bottom: .75rem; }
.arrival-box { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; padding: .8rem 1rem; margin-bottom: 1rem; border: 1px dashed var(--border-color); border-radius: 14px; background: var(--white); }
.arrival-box label { font-weight: 600; display: flex; align-items: center; gap: .4rem; }
.arrival-box .form-control { width: 9rem; text-align: center; letter-spacing: .15em; font-weight: 700; }
.arrival-box #arrival-msg { flex: 1 1 12rem; }
html.a11y-contrast .wr-called { background: #fff; border-width: 3px; }

/* ---------- central de notificações (redesenho) ---------- */
.notifications-panel { width: 400px; max-height: min(560px, calc(100vh - 140px)); border: 1px solid var(--border-color); border-radius: 22px; }
.notifications-header { padding: 16px 18px 10px; border-bottom: 0; align-items: flex-start; gap: 10px; }
.notifications-sub { display: block; color: var(--gray-text); font-size: 12.5px; margin-top: 2px; }
.notif-tools { display: flex; gap: 2px; flex: 0 0 auto; }
.notif-tools .clear-notifications { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; padding: 6px 9px; }
.notif-tools .clear-notifications:disabled { opacity: .4; cursor: default; }
.notif-filters { display: flex; gap: 6px; padding: 0 18px 10px; border-bottom: 1px solid var(--border-color); }
.notifications-list { padding: 4px 10px 12px; overscroll-behavior: contain; }
.notif-group-title { font-family: inherit; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--gray-text); margin: 12px 8px 6px; font-weight: 700; }
.notification-item { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 4px; padding: 11px 12px; border-radius: 14px; border: 0; box-shadow: none; background: transparent; transition: background .15s; }
.notification-item:hover, .notification-item:focus-visible { background: var(--lighter-blue); }
.notification-item.unread { background: var(--lighter-blue); box-shadow: none; }
.notif-ico { flex: 0 0 auto; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--light-blue); color: var(--accent-blue); font-size: 15px; }
.notification-item.success .notif-ico { background: #dcfce7; color: #15803d; }
.notification-item.warning .notif-ico { background: #fef3c7; color: #b45309; }
.notification-item.danger .notif-ico { background: #fee2e2; color: #b91c1c; }
.notif-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.notif-row { display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.notif-row strong { font-size: 14px; line-height: 1.3; }
.notification-item:not(.unread) strong { font-weight: 600; color: var(--gray-text); }
.notif-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent-blue); flex: 0 0 auto; }
.notification-text { font-size: 13px; color: var(--gray-text); line-height: 1.4; }
.notification-time { font-size: 11.5px; color: var(--gray-text); margin: 2px 0 0; opacity: .85; }
.notification-empty { padding: 44px 20px; }
.notification-empty i { font-size: 38px; opacity: .35; }
.notification-empty p { margin: 0 0 4px; font-weight: 600; }
@media (max-width: 480px) { .notif-tools .clear-notifications span { display: none; } }
html.a11y-contrast .notification-item { border: 2px solid currentColor; }

/* ---------- AVA, assistente virtual (vermelho do ícone) ---------- */
:root { --ava: #ff4f2b; --ava-d: #d63a17; --ava-dd: #a52a0f; --ava-l: #fff3ee; --ava-b: #ffd5c6; }
.ava-btn { position: fixed; bottom: 28px; right: 96px; width: 56px; height: 56px; border-radius: 50%; background: var(--white); border: 2px solid var(--ava); display: grid; place-items: center; z-index: 101; cursor: pointer; box-shadow: 0 6px 18px rgba(214, 58, 23, .32); transition: transform .2s, box-shadow .2s; padding: 0; }
.ava-btn:hover { transform: scale(1.08); box-shadow: 0 8px 24px rgba(214, 58, 23, .45); }
.ava-btn:focus-visible { outline: 3px solid var(--ava-d); outline-offset: 3px; }
.ava-btn.on { background: var(--ava-l); }
.ava-star { width: 34px; height: 34px; display: block; transition: transform .6s cubic-bezier(.3, 1.4, .5, 1); }
.ava-btn:hover .ava-star { animation: ava-wave 1.1s ease-in-out infinite; }
.ava-btn.thinking .ava-star { animation: ava-wave .8s ease-in-out infinite; }
@keyframes ava-wave { 0%, 100% { transform: skewX(0) translateY(0) scale(1.04); } 25% { transform: skewX(-9deg) translateY(-2px) scale(1.08); } 75% { transform: skewX(9deg) translateY(1px) scale(1.04); } }
/* ao abrir: a fita se desenha da esquerda para a direita e assenta com um balanço */
@property --ava-p { syntax: '<percentage>'; inherits: false; initial-value: 130%; }
.ava-head-star { width: 46px; height: 46px; object-fit: contain; -webkit-mask-image: linear-gradient(100deg, #000 calc(var(--ava-p) - 28%), transparent var(--ava-p)); mask-image: linear-gradient(100deg, #000 calc(var(--ava-p) - 28%), transparent var(--ava-p)); }
.ava-panel.play .ava-head-star { animation: ava-draw 1.25s cubic-bezier(.4, .1, .3, 1) both, ava-settle 1.25s cubic-bezier(.3, 1.5, .5, 1) both; }
.ava-panel.play .ava-head-txt h2 { animation: ava-rise .6s .55s cubic-bezier(.2, .9, .3, 1) both; }
.ava-panel.play .ava-head-txt small { animation: ava-rise .6s .7s cubic-bezier(.2, .9, .3, 1) both; }
.ava-panel.play .ava-msg:first-child .ava-av { animation: ava-settle .9s .5s cubic-bezier(.3, 1.5, .5, 1) both; }
@keyframes ava-draw { from { --ava-p: 0%; } to { --ava-p: 130%; } }
@keyframes ava-settle { 0% { transform: rotate(-14deg) scale(.55); } 60% { transform: rotate(5deg) scale(1.12); } 100% { transform: none; } }
@keyframes ava-rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.ava-btn.burst { animation: ava-burst .7s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes ava-burst { 0% { transform: scale(1); } 40% { transform: scale(1.18) rotate(-6deg); } 100% { transform: scale(1); } }
.ava-hint { position: fixed; bottom: 92px; right: 96px; max-width: 240px; background: var(--white); color: var(--dark-text); border: 1.5px solid var(--ava-b); border-radius: 16px 16px 4px 16px; padding: 10px 14px; font-size: 14px; box-shadow: var(--shadow-lg); z-index: 101; animation: ava-pop .35s cubic-bezier(.3, 1.4, .5, 1); }
@keyframes ava-pop { from { opacity: 0; transform: translateY(8px) scale(.94); } to { opacity: 1; transform: none; } }

.ava-panel { position: fixed; right: 28px; bottom: 96px; width: 410px; max-width: calc(100vw - 32px); height: min(620px, calc(100vh - 130px)); background: var(--white); border: 1px solid var(--ava-b); border-radius: 22px; box-shadow: 0 16px 48px rgba(130, 36, 12, .28); z-index: 1000; display: flex; flex-direction: column; overflow: hidden; animation: slideUp .25s ease; }
.ava-panel[hidden] { display: none; }
.ava-head { display: flex; align-items: center; gap: 10px; padding: 14px 14px 12px 16px; background: linear-gradient(180deg, var(--ava-l), var(--white)); border-bottom: 1px solid var(--ava-b); }
.ava-head-star { flex: 0 0 auto; }
.ava-head-txt { flex: 1; min-width: 0; }
.ava-head-txt h2 { margin: 0; font-size: 20px; color: var(--ava-d); letter-spacing: .08em; line-height: 1.1; }
.ava-head-txt small { color: var(--gray-text); font-size: 12.5px; }
.ava-icon-btn { width: 36px; height: 36px; border-radius: 50%; border: 0; background: transparent; color: var(--ava-d); cursor: pointer; display: grid; place-items: center; font-size: 15px; flex: 0 0 auto; }
.ava-icon-btn:hover { background: var(--ava-l); }
.ava-icon-btn:focus-visible, .ava-send:focus-visible, .ava-chip:focus-visible { outline: 3px solid var(--ava-d); outline-offset: 2px; }
.ava-log { flex: 1; overflow-y: auto; padding: 14px 14px 6px; display: flex; flex-direction: column; gap: 10px; overscroll-behavior: contain; scroll-behavior: smooth; }
.ava-msg { display: flex; gap: 8px; align-items: flex-end; max-width: 100%; animation: ava-pop .28s ease; }
.ava-msg.me { justify-content: flex-end; }
.ava-av { width: 28px; height: 28px; flex: 0 0 auto; margin-bottom: 4px; object-fit: contain; }
.ava-bub { max-width: 86%; padding: 10px 13px; border-radius: 16px; font-size: 14.5px; line-height: 1.5; overflow-wrap: anywhere; }
.ava-msg.ava .ava-bub { background: var(--ava-l); border: 1px solid var(--ava-b); border-bottom-left-radius: 4px; color: var(--dark-text); }
.ava-msg.me .ava-bub { background: linear-gradient(135deg, var(--ava-d), var(--ava)); color: #fff; border-bottom-right-radius: 4px; }
.ava-bub p { margin: 0 0 6px; } .ava-bub p:last-child { margin-bottom: 0; }
.ava-bub ul { margin: 2px 0 6px; padding-left: 18px; list-style: disc; } .ava-bub li { margin: 2px 0; }
.ava-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.ava-typing { display: flex; gap: 5px; align-items: center; padding: 14px 16px; }
.ava-typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--ava-d); opacity: .35; animation: ava-dot 1s infinite ease-in-out; }
.ava-typing i:nth-child(2) { animation-delay: .15s; } .ava-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes ava-dot { 0%, 80%, 100% { transform: translateY(0); opacity: .35; } 40% { transform: translateY(-4px); opacity: 1; } }
.ava-chips { display: flex; gap: 6px; padding: 8px 12px; overflow-x: auto; scrollbar-width: none; border-top: 1px solid var(--ava-b); }
.ava-chips::-webkit-scrollbar { display: none; }
.ava-chip { flex: 0 0 auto; border: 1.5px solid var(--ava); background: var(--white); color: var(--ava-d); border-radius: 999px; padding: 6px 12px; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; transition: background .15s, color .15s; }
.ava-chip:hover { background: var(--ava-d); color: #fff; border-color: var(--ava-d); }
.ava-row .ava-chip { white-space: normal; text-align: left; }
.ava-form { display: flex; gap: 6px; align-items: center; padding: 6px 12px 8px; }
.ava-input { flex: 1; min-width: 0; border: 1.5px solid var(--ava-b); border-radius: 999px; padding: 11px 16px; font: inherit; font-size: 15px; background: var(--white); color: var(--dark-text); }
.ava-input:focus { outline: none; border-color: var(--ava); box-shadow: 0 0 0 3px rgba(255, 79, 43, .2); }
.ava-send { width: 42px; height: 42px; border-radius: 50%; border: 0; background: linear-gradient(135deg, var(--ava-d), var(--ava)); color: #fff; cursor: pointer; display: grid; place-items: center; font-size: 15px; flex: 0 0 auto; }
.ava-send:hover { filter: brightness(1.08); }
.ava-mic.rec { background: var(--ava-d); color: #fff; animation: ava-rec 1.2s infinite; }
@keyframes ava-rec { 50% { box-shadow: 0 0 0 8px rgba(255, 79, 43, .25); } }
.ava-foot { margin: 0; padding: 0 14px 10px; font-size: 11.5px; color: var(--gray-text); text-align: center; }
html.a11y-motion .ava-btn, html.a11y-motion .ava-star, html.a11y-motion .ava-head-star, html.a11y-motion .ava-head-txt h2, html.a11y-motion .ava-head-txt small, html.a11y-motion .ava-av, html.a11y-motion .ava-msg, html.a11y-motion .ava-panel, html.a11y-motion .ava-hint, html.a11y-motion .ava-typing i, html.a11y-motion .ava-mic.rec { animation: none !important; transition: none !important; }
html.a11y-contrast .ava-msg.ava .ava-bub { background: #fff; border: 2px solid #000; color: #000; }
html.a11y-contrast .ava-chip { border-color: #000; color: #000; }
html.a11y-contrast .ava-msg.me .ava-bub { background: #000; }
html.a11y-targets .ava-icon-btn { width: 44px; height: 44px; } html.a11y-targets .ava-chip { padding: 10px 14px; }
@media (prefers-reduced-motion: reduce) { .ava-btn.thinking .ava-star, .ava-btn:hover .ava-star, .ava-typing i, .ava-panel.play .ava-head-star, .ava-panel.play .ava-head-txt h2, .ava-panel.play .ava-head-txt small, .ava-panel.play .ava-av, .ava-btn.burst { animation: none; } }
.app-doctor .ava-btn { bottom: 56px; }
.app-doctor .ava-hint { bottom: 120px; }
.app-doctor .ava-panel { bottom: 124px; }
.dw-bubble { right: 164px; }
@media (max-width: 480px) {
  .ava-btn { right: 74px; bottom: 16px; width: 50px; height: 50px; } .ava-star { width: 30px; height: 30px; }
  .ava-hint { right: 74px; bottom: 76px; }
  .ava-panel { right: 8px; left: 8px; width: auto; max-width: none; bottom: 78px; height: calc(100vh - 100px); }
}
@media (max-width: 900px) {
  .ava-btn { bottom: calc(90px + env(safe-area-inset-bottom, 0px)); right: 74px; width: 50px; height: 50px; } .ava-star { width: 30px; height: 30px; }
  .ava-hint { bottom: calc(150px + env(safe-area-inset-bottom, 0px)); right: 74px; }
  .ava-panel { right: 12px; bottom: calc(150px + env(safe-area-inset-bottom, 0px)); height: min(560px, calc(100vh - 190px - env(safe-area-inset-bottom, 0px))); }
  .app-doctor .ava-btn { bottom: calc(90px + env(safe-area-inset-bottom, 0px)); }
  .app-doctor .ava-panel { bottom: calc(150px + env(safe-area-inset-bottom, 0px)); }
  .app-doctor .ava-hint { bottom: calc(150px + env(safe-area-inset-bottom, 0px)); }
  .dw-bubble, .dw-collapsed .dw-bubble { right: 16px; }
}


/* ---------- menu superior remodelado: barra flutuante de vidro (todos os perfis) ---------- */
.dw-top { margin: 12px 16px 0; padding: 8px 14px; min-height: 66px; border-radius: 22px; background: transparent; box-shadow: 0 12px 32px -14px rgba(15, 23, 42, .35), 0 2px 6px rgba(15, 23, 42, .06); border: 1px solid color-mix(in srgb, var(--accent-blue) 24%, #fff); isolation: isolate; animation: dw-drop .55s cubic-bezier(.2, .9, .3, 1) both; }
/* o vidro fica num pseudo-elemento: backdrop-filter direto na barra prenderia o submenu da Agenda atrás do conteúdo */
.dw-top::before { content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; pointer-events: none; background: linear-gradient(180deg, color-mix(in srgb, var(--white) 92%, transparent), color-mix(in srgb, var(--lighter-blue) 82%, transparent)); -webkit-backdrop-filter: blur(16px) saturate(1.6); backdrop-filter: blur(16px) saturate(1.6); }
.dw-top::after { content: ""; position: absolute; left: 22px; right: 22px; bottom: -1px; height: 2px; border-radius: 2px; background: linear-gradient(90deg, transparent, var(--accent-blue), transparent); opacity: .55; pointer-events: none; }
@keyframes dw-drop { from { opacity: 0; transform: translateY(-14px); } to { opacity: 1; transform: none; } }
.dw-brand { padding-right: 14px; margin-right: 2px; border-right: 1px solid var(--border-color); }
.dw-nav { gap: 6px; margin-left: 10px; }
.dw-link { padding: 7px 14px 7px 8px; border-radius: 16px; font-weight: 600; color: var(--dark-text); transition: background .2s, color .2s, transform .2s; }
.dw-link:hover { transform: translateY(-1px); }
.dw-link i:first-child { width: 30px; height: 30px; display: inline-grid; place-items: center; border-radius: 50%; background: color-mix(in srgb, var(--accent-blue) 14%, #fff); color: var(--accent-blue); font-size: 14px; transition: transform .35s cubic-bezier(.3, 1.6, .5, 1), background .2s, color .2s; flex: 0 0 auto; }
.dw-link:hover i:first-child { transform: translateY(-2px) rotate(-8deg) scale(1.1); }
.dw-link.active i:first-child, .has-film .dw-link.active i:first-child { background: var(--accent-blue); color: #fff; }
.has-film .dw-link i:first-child { color: var(--accent-blue); }
.dw-link .fa-chevron-down { margin-left: 2px; }
.dw-nav .dw-link, .dw-nav .dw-group { animation: dw-in .5s cubic-bezier(.2, .9, .3, 1) both; }
.dw-nav > :nth-child(1) { animation-delay: .08s; } .dw-nav > :nth-child(2) { animation-delay: .14s; } .dw-nav > :nth-child(3) { animation-delay: .2s; } .dw-nav > :nth-child(4) { animation-delay: .26s; }
.dw-nav > :nth-child(5) { animation-delay: .32s; } .dw-nav > :nth-child(6) { animation-delay: .38s; } .dw-nav > :nth-child(7) { animation-delay: .44s; } .dw-nav > :nth-child(8) { animation-delay: .5s; }
@keyframes dw-in { from { opacity: 0; transform: translateY(-8px) scale(.96); } to { opacity: 1; transform: none; } }
.dw-top .user-info { border: 1px solid var(--border-color); background: color-mix(in srgb, var(--white) 70%, transparent); transition: background .2s, box-shadow .2s; }
.dw-top .user-info:hover { background: var(--white); box-shadow: 0 4px 14px -6px rgba(15, 23, 42, .3); }
.dw-top .user-avatar { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-blue) 25%, #fff); }
.dw-foot { margin: 0 16px 8px; border-radius: 14px; border: 1px solid var(--light-blue); }
html.a11y-motion .dw-top, html.a11y-motion .dw-nav .dw-link, html.a11y-motion .dw-nav .dw-group { animation: none !important; }
html.a11y-motion .dw-link, html.a11y-motion .dw-link i:first-child { transition: none; }
html.a11y-motion .dw-link:hover, html.a11y-motion .dw-link:hover i:first-child { transform: none; }
@media (prefers-reduced-motion: reduce) { .dw-top, .dw-nav .dw-link, .dw-nav .dw-group { animation: none; } }
html.a11y-contrast .dw-top { border: 2px solid #000; } html.a11y-contrast .dw-link i:first-child { background: #fff; border: 2px solid #000; color: #000; }
@media (max-width: 900px) { .dw-top { margin: 8px 8px 0; border-radius: 18px; padding: 6px 10px; } .dw-brand { border-right: 0; padding-right: 4px; } .dw-foot { margin: 0 8px 6px; } }
@media (max-width: 700px) {
  .dw-top { animation: none; }
  .dw-nav { animation: none; }
  .dw-nav .dw-link i:first-child { width: auto; height: auto; background: transparent; border-radius: 0; font-size: 19px; }
  .dw-nav .dw-link { padding: 13px 0; }
  .dw-nav > .dw-link, .dw-nav .dw-group { animation: none; }
}
.dw-nav { gap: 2px; margin-left: 6px; }
.dw-link { padding: 6px 11px 6px 6px; font-size: 14px; gap: 6px; }
.dw-link i:first-child { width: 28px; height: 28px; font-size: 13px; }
@media (max-width: 700px) { .dw-nav .dw-link i:first-child { width: auto; height: auto; font-size: 19px; } }

/* ---------- Recepção: mensagens no WhatsApp ---------- */
.btn-wa { background: #0b7a3b; border-color: #0b7a3b; color: #fff; }
.btn-wa:hover, .btn-wa:focus-visible { background: #095f2e; border-color: #095f2e; color: #fff; }
.wa-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 14px; }
.wa-n { display: inline-block; min-width: 20px; padding: 0 6px; margin-left: 4px; border-radius: 99px; background: #0b7a3b; color: #fff; font-size: .75rem; line-height: 20px; text-align: center; }
.wa-tabs .btn-primary .wa-n { background: #fff; color: var(--primary, #1e3a8a); }
.wa-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 12px; }
.wa-row { grid-template-columns: 56px minmax(0, 1fr) auto auto; }
@media (max-width: 720px) { .wa-row { grid-template-columns: 56px minmax(0, 1fr); } .wa-row .slot-state, .wa-row .slot-actions { grid-column: 2; } }
.wa-preview { white-space: pre-wrap; word-break: break-word; margin: 8px 0 0; padding: 10px 12px; border-radius: 10px; background: var(--lighter-blue, #eef5ff); border: 1px solid var(--border-color); font: inherit; font-size: .92rem; }
.wa-models textarea { min-height: 112px; resize: vertical; }
.wa-models code { background: var(--lighter-blue, #eef5ff); padding: 1px 6px; border-radius: 6px; }

/* ---------- Teleconsulta ---------- */
.badge-tele { background: #e0e7ff; color: #312e81; display: inline-flex; align-items: center; gap: 6px; }
.tele-join { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 8px; }
.tele-note { margin: 0; }
.tele-pick { border: 1px solid var(--border-color); border-radius: 10px; padding: 8px 12px; margin: 4px 0 12px; display: flex; flex-wrap: wrap; gap: 4px 18px; }
.tele-pick legend { padding: 0 6px; font-weight: 600; font-size: .9rem; }
.tele-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.tele-row { display: grid; grid-template-columns: 76px minmax(0, 1fr) auto; gap: 8px 14px; align-items: center; padding: 12px 14px; border: 1px solid var(--border-color); border-left: 4px solid var(--warning); border-radius: 12px; background: var(--white); }
.tele-row.ready { border-left-color: var(--success); }
.tele-when { display: grid; line-height: 1.2; } .tele-when b { font-size: 1.25rem; } .tele-when span { color: var(--gray-text); font-size: .85rem; }
.tele-link code { word-break: break-all; }
.tele-form { grid-column: 1 / -1; display: grid; gap: 8px; }
.tele-actions { display: flex; flex-wrap: wrap; gap: 8px; }
@media (max-width: 640px) { .tele-row { grid-template-columns: 64px minmax(0, 1fr); } .tele-state { grid-column: 2; } }

/* ---------- Área do médico: preto e cinza ---------- */
/* claro: papel branco e cinzas, com acentos em grafite */
body.theme-medico {
  --primary-blue: #27272a; --primary-hover: #09090b; --accent-blue: #71717a; --light-blue: #e4e4e7; --lighter-blue: #f4f4f5;
  --gray-text: #52525b; --border-color: #d4d4d8; --info-text: #27272a; --info-bg: #e4e4e7;
}
body.theme-medico, body.theme-medico.login-body { background: linear-gradient(160deg, #f4f4f5 0%, #e4e4e7 100%); }
body.theme-medico .badge-tele { background: #e4e4e7; color: #27272a; }
body.theme-medico .banner-info { border-color: #71717a; color: #27272a; }
body.theme-medico .card-icon.blue, body.theme-medico .card-icon.green, body.theme-medico .card-icon.orange, body.theme-medico .card-icon.violet,
body.theme-medico .list-item-icon.blue, body.theme-medico .list-item-icon.green, body.theme-medico .list-item-icon.orange { background: #e4e4e7; color: #3f3f46; }
body.theme-medico .dw-link i:first-child { background: #e4e4e7; color: #3f3f46; }

/* ---------- Tema escuro (todas as áreas): só trocam as variáveis; cada área mantém o seu matiz ---------- */
body.dark {
  --white: #12151c; --dark-text: #eceef3; --gray-text: #9ca3b3; --border-color: #313746;
  --primary-blue: #9db8ff; --primary-hover: #c3d3ff; --accent-blue: #6c9cff; --light-blue: #1f2a44; --lighter-blue: #1a2236;
  --info-text: #cfe0ff; --info-bg: #1f2a44;
  --success: #34d399; --success-text: #6ee7b7; --success-bg: #0f3d2c;
  --danger: #f87171; --danger-text: #fca5a5; --danger-bg: #4a1d1d;
  --warning: #fbbf24; --warning-text: #fcd34d; --warning-bg: #4a3410;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.5); --shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
  color-scheme: dark; color: var(--dark-text);
}
html:has(body.dark) { color-scheme: dark; }
body.dark, body.dark.login-body { background: linear-gradient(160deg, #0b0e14 0%, #151b29 100%); }
body.dark.theme-gestante { --primary-blue: #f3a6c8; --primary-hover: #f8c4dc; --accent-blue: #e57fb1; --light-blue: #3a1f2e; --lighter-blue: #2c1a24; --gray-text: #c4a9b6; --border-color: #4a2c3c; --info-text: #f8cfe2; --info-bg: #3a1f2e; --white: #1a1217; }
body.dark.theme-gestante, body.dark.theme-gestante.login-body { background: linear-gradient(160deg, #140c11 0%, #221528 100%); }
body.dark.theme-farmacia { --primary-blue: #5eead4; --primary-hover: #99f6e4; --accent-blue: #2dd4bf; --light-blue: #123a37; --lighter-blue: #0f2b29; --border-color: #1f4a46; --info-text: #b8f5ec; --info-bg: #123a37; --white: #0f1a1a; }
body.dark.theme-farmacia, body.dark.theme-farmacia.login-body { background: linear-gradient(160deg, #071211 0%, #0f2224 100%); }
body.dark.theme-recepcao { --primary-blue: #c4b5fd; --primary-hover: #ddd6fe; --accent-blue: #a78bfa; --light-blue: #2a2145; --lighter-blue: #211a38; --gray-text: #aaa4c4; --border-color: #3b3160; --info-text: #e4deff; --info-bg: #2a2145; --white: #15111f; }
body.dark.theme-recepcao, body.dark.theme-recepcao.login-body { background: linear-gradient(160deg, #0d0a16 0%, #1b1530 100%); }
body.dark.theme-admin { --primary-blue: #fbbf6b; --primary-hover: #fcd596; --accent-blue: #f59e0b; --light-blue: #3b2a10; --lighter-blue: #2c200d; --gray-text: #c4b49a; --border-color: #4d3a1b; --info-text: #fde6b8; --info-bg: #3b2a10; --white: #1a150c; }
body.dark.theme-admin, body.dark.theme-admin.login-body { background: linear-gradient(160deg, #120d06 0%, #241a0c 100%); }
/* médico no escuro: preto e cinza */
body.dark.theme-medico { --primary-blue: #e7e7ea; --primary-hover: #ffffff; --accent-blue: #a1a1aa; --light-blue: #2b2b30; --lighter-blue: #212125; --white: #17171a; --dark-text: #f1f1f3; --gray-text: #a3a3ab; --border-color: #36363c; --info-text: #e4e4e7; --info-bg: #2b2b30; }
body.dark.theme-medico, body.dark.theme-medico.login-body { background: linear-gradient(160deg, #09090b 0%, #1a1a1e 100%); }
body.dark.theme-medico .badge-tele { background: #34343a; color: #e4e4e7; }
body.dark.theme-medico .card-icon.blue, body.dark.theme-medico .card-icon.green, body.dark.theme-medico .card-icon.orange, body.dark.theme-medico .card-icon.violet,
body.dark.theme-medico .list-item-icon.blue, body.dark.theme-medico .list-item-icon.green, body.dark.theme-medico .list-item-icon.orange { background: #2b2b30; color: #d4d4d8; }
body.dark.theme-medico .dw-link i:first-child { background: #2b2b30; color: #d4d4d8; }
body.dark.theme-medico .banner-info { border-color: #71717a; }
/* ajustes de cores fixas no escuro */
body.dark .banner-info { color: var(--dark-text); } body.dark .banner-info i { color: var(--primary-blue); }
body.dark .card-icon.violet { background: var(--light-blue); color: var(--primary-blue); }
body.dark .badge-tele { background: var(--light-blue); color: var(--primary-blue); }
body.dark .dw-link i:first-child { background: color-mix(in srgb, var(--accent-blue) 22%, var(--white)); }
body.dark .btn-wa { background: #16a34a; border-color: #16a34a; color: #04130a; } body.dark .btn-wa:hover { background: #22c55e; border-color: #22c55e; color: #04130a; }
body.dark .wa-n { background: #16a34a; color: #04130a; }
body.dark .mode-switch .text-size-btn { width: auto; padding: 0 10px; }
@media print { body.dark { --white: #fff !important; --dark-text: #000 !important; --gray-text: #444 !important; --border-color: #ccc !important; --lighter-blue: #fff !important; --light-blue: #eee !important; background: #fff !important; } }
.mode-switch .text-size-btn { width: auto; padding: 0 10px; gap: 6px; display: inline-flex; align-items: center; }
body.dark .badge-neutral { background: var(--light-blue); color: var(--dark-text); }

/* AVA na tela de entrada (sem notificações ao lado) e no tema escuro */
.login-body .ava-btn { right: 28px; } .login-body .ava-hint { right: 28px; }
@media (max-width: 900px) { .login-body .ava-btn, .login-body .ava-hint { right: 16px; } }
body.dark { --ava-l: #2a1812; --ava-b: #5b2c1d; --ava-d: #ff8a6b; }
body.dark .ava-msg.me .ava-bub, body.dark .ava-send { background: linear-gradient(135deg, #d63a17, #ff4f2b); color: #fff; }
body.dark .ava-chip:hover { background: var(--ava); color: #fff; border-color: var(--ava); }
body.dark .ava-mic.rec { background: #d63a17; color: #fff; }
body.dark .ava-btn { box-shadow: 0 6px 20px rgba(0, 0, 0, .6), 0 0 0 1px rgba(255, 79, 43, .3); }
body.dark .ava-panel { box-shadow: 0 18px 50px rgba(0, 0, 0, .65); }

/* celular: com 7 ou mais itens no menu inferior, só o ícone do item ativo cresce (o nome já aparece no título da página) */
@media (max-width: 700px) {
  .dw-nav:has(> :nth-child(7)) > .dw-link.active span, .dw-nav:has(> :nth-child(7)) .dw-group > .dw-link.active span { display: none; }
  .dw-nav:has(> :nth-child(7)) > .dw-link.active, .dw-nav:has(> :nth-child(7)) .dw-group:has(> .dw-link.active) { flex: 1.4 1 0; }
}

/* ---------- celular: cartões de lista e barra de dia (revisão visual) ---------- */
@media (max-width: 600px) {
  /* ícone + texto na 1ª linha; selos e botões descem para a linha de baixo, alinhados ao texto */
  .list-item { flex-wrap: wrap; gap: 10px 14px; padding: 14px; align-items: flex-start; }
  .list-item-icon { width: 40px; height: 40px; font-size: 17px; }
  .list-item-content { flex: 1 1 0; min-width: calc(100% - 64px); }
  .list-item > .badge, .list-item > .btn, .list-item > .tele-join { margin-left: 54px; }
  .list-item:hover { transform: none; }
  .list-item-subtitle { overflow-wrap: anywhere; }
  /* navegação de dia: setas, data e "Hoje" numa linha só */
  .day-nav { display: grid; grid-template-columns: 44px minmax(0, 1fr) 44px auto; gap: 8px; }
  .day-nav .day-label { display: flex; flex-direction: column; align-items: stretch; gap: 2px; min-width: 0; }
  .day-nav .day-label .form-control { width: 100%; }
  .day-nav > select, .day-nav > .btn-primary { grid-column: 1 / -1; width: 100%; }
}
/* modo escuro: a película da aba ativa é um vidro escuro com brilho no topo; texto branco, em negrito e com sombra para ler bem */
body.dark .tabs.has-film .tab.active { color: #fff; font-weight: 700; text-shadow: 0 1px 2px rgba(0,0,0,.7); }

/* ---------- segunda rodada de melhorias visuais ---------- */
/* escuro: cabeçalho da carteira de vacinação sem o azul claro "estourado"; texto branco sobre azul profundo */
body.dark .vaccine-card-header { background: linear-gradient(135deg, #1e3a8a, #172554); color: #fff; border: 1px solid rgba(147, 170, 255, .25); }
body.dark .vaccine-card-header .vaccine-stat { background: rgba(255, 255, 255, .12); color: #fff; }
body.dark .vaccine-card-header h2, body.dark .vaccine-card-header svg, body.dark .vaccine-card-header i { color: #fff; }
/* celular: botões flutuantes menores e translúcidos, para cobrirem menos o conteúdo */
@media (max-width: 900px) {
  .notifications-btn, .ava-btn, .dw-bubble { width: 44px; height: 44px; font-size: 18px; opacity: .92; }
  .ava-star { width: 26px; height: 26px; }
  .ava-btn { bottom: calc(82px + env(safe-area-inset-bottom, 0px)); right: 16px; }
  main, .main-content, #main { scroll-padding-bottom: 140px; }
}
.chip b { color: inherit; }
.vaccine-item-dose, .muted.small { color: var(--gray-text); }
/* escuro: --primary-blue é claro, então o filtro ativo leva texto escuro */
body.dark .chip.active { color: #14101f; }

/* ---------- LGPD, recuperação de senha e 2FA obrigatório ---------- */
.link-btn { background: none; border: 0; padding: 4px 0; color: var(--primary-blue); text-decoration: underline; cursor: pointer; font: inherit; min-height: 32px; }
.login-forgot { text-align: center; margin: 10px 0 0; }
.consent-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.consent-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px 14px; border: 1px solid var(--border-color, rgba(128, 128, 128, .25)); border-radius: 12px; }
.consent-item > div { min-width: 0; flex: 1 1 220px; }
.consent-history { margin-top: 10px; }
hr.soft { border: 0; border-top: 1px solid var(--border-color, rgba(128, 128, 128, .25)); margin: 16px 0; }
.subsection-title { font-size: 1rem; margin: 18px 0 8px; }
.mail-body { white-space: pre-wrap; overflow-wrap: anywhere; font: inherit; background: rgba(128, 128, 128, .12); padding: 12px; border-radius: 10px; }
.wl-form { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); align-items: end; margin-bottom: 14px; }
.wl-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.wl-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 10px 12px; border: 1px solid var(--border-color, rgba(128, 128, 128, .25)); border-radius: 12px; }
.wl-item > div { min-width: 0; flex: 1 1 200px; }
.search-btn { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--border-color, rgba(128, 128, 128, .3)); background: transparent; color: inherit; cursor: pointer; font: inherit; margin-right: 8px; }
.search-btn:hover { background: rgba(128, 128, 128, .12); }
@media (max-width: 900px) { .search-btn-text { display: none; } .search-btn { width: 40px; padding: 0; justify-content: center; margin-right: 4px; } }
.search-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; max-height: 50vh; overflow: auto; }
.search-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: inherit; text-decoration: none; border: 1px solid transparent; }
.search-item:hover, .search-item:focus-visible { background: rgba(128, 128, 128, .14); border-color: var(--border-color, rgba(128, 128, 128, .3)); }
.search-ico { width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center; border-radius: 10px; background: rgba(128, 128, 128, .15); flex: none; }
.search-sub { display: block; }
.pn-line-2 { stroke-dasharray: 2 0; opacity: .6; }
.pn-dot-2 { opacity: .6; }
.rx-model-save { margin: -4px 0 12px; }

/* celular e tablet: o sino sobe para a barra do topo (ao lado do avatar) e a AVA fica sozinha no canto inferior */
@media (max-width: 900px) {
  .notifications-btn { top: 22px; bottom: auto; right: 78px; width: 40px; height: 40px; font-size: 17px; opacity: 1; box-shadow: none; background: transparent; color: var(--accent-blue, inherit); border: 1px solid var(--border-color, rgba(128, 128, 128, .3)); z-index: 60; }
  .notifications-btn:hover { transform: none; background: rgba(128, 128, 128, .12); }
  .notifications-btn .badge-count { top: -6px; right: -6px; min-width: 20px; height: 20px; font-size: 11px; }
  .notifications-panel { top: calc(env(safe-area-inset-top, 0px) + 74px); bottom: auto; right: 12px; max-height: calc(100vh - 150px); }
}
.empty-hint { max-width: 38ch; margin: 4px auto 10px; }
.doc-card-title { font-size: 1.05rem; margin: 0; }
.hl-list { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 8px; }
.hl-item { display: flex; gap: 12px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--border-color, rgba(128, 128, 128, .25)); border-radius: 12px; }
.hl-item > div { min-width: 0; flex: 1; }
.hl-ok > span:first-child { color: var(--success-text, #15803d); }
.hl-bad > span:first-child { color: var(--danger-text, #b91c1c); }

/* Cartões de indicador: o texto pode encolher e quebrar; o ícone nunca sai do cartão (celular estreito, fonte Inter é mais larga) */
.card-header > :first-child { min-width: 0; }
.card-label { overflow-wrap: break-word; }
@media (max-width: 480px) { .card:has(> .card-header) { padding: 18px 16px; } .card-label { font-size: 12.5px; } .card-header { gap: 6px; } .card-header .card-icon { width: 34px; height: 34px; font-size: 15px; } }

/* Painel de notificações (desktop): fica acima do sino com folga; antes ele se sobrepunha ao botão e ao selo de contagem */
@media (min-width: 901px) { .notifications-panel { bottom: 132px; max-height: min(560px, calc(100vh - 160px)); } }

/* Tablet (601–900 px): o sino fica fixo no topo; reserva o espaço dele ao lado da lupa para os dois não se sobreporem */
@media (min-width: 601px) and (max-width: 900px) { .search-btn { margin-right: 52px; } }

/* Celular/tablet: o sino é posicionado dentro do .app (que já começa depois da área segura do aparelho; somar env(safe-area-inset-top) de novo empurrava o sino para baixo no iPhone) e acompanha o cabeçalho ao rolar a página (antes ficava fixo na tela e descolava da barra do topo, sobretudo no iPhone com a área segura) */
@media (max-width: 900px) { .notifications-btn { position: absolute; } }
/* Barra de navegação inferior (celular): o ícone ativo não ganha fundo quadrado de nenhum tema (farmácia, médico, escuro) */
@media (max-width: 700px) {
  html body .dw-nav .dw-link i:first-child, html body.dark .dw-nav .dw-link i:first-child, html body .has-film .dw-nav .dw-link.active i:first-child, html body .dw-nav .dw-link.active i:first-child,
  html body.theme-medico .dw-nav .dw-link i:first-child, html body.dark.theme-medico .dw-nav .dw-link i:first-child { background: transparent; border-radius: 0; box-shadow: none; }
  html body .dw-nav .dw-link.active i:first-child { color: var(--accent-blue, var(--primary-blue)); }
}

/* ==========================================================================
   LIQUID GLASS — menu superior, cards de destaque e botões principais
   Vidro fosco translúcido: fundo semitransparente + backdrop-filter (blur suave), borda fina clara,
   brilho interno no topo e reflexo que varre o elemento ao passar o mouse.
   Texto sempre sobre fundo com opacidade alta (contraste ≥ 4.5:1). Fallback sólido para navegadores
   sem backdrop-filter, para "reduzir transparência" e para o modo de alto contraste.
   No celular o desfoque cai pela metade e os cards deixam de usar backdrop-filter (menos GPU).
   ========================================================================== */
:root {
  --lg-blur: 18px; --lg-sat: 1.7;
  --lg-tint: color-mix(in srgb, var(--white) 66%, transparent);       /* vidro de cards */
  --lg-tint-bar: color-mix(in srgb, var(--white) 62%, transparent);   /* vidro do menu */
  --lg-edge: rgba(255, 255, 255, .62);                                 /* borda fina */
  --lg-edge-soft: rgba(255, 255, 255, .28);
  --lg-hi: rgba(255, 255, 255, .85);                                   /* brilho interno do topo */
  --lg-shadow: 0 14px 34px -16px rgba(15, 23, 42, .38), 0 2px 8px rgba(15, 23, 42, .06);
  --lg-ease: cubic-bezier(.22, .8, .3, 1);
}
body.dark {
  --lg-tint: color-mix(in srgb, var(--white) 58%, transparent);
  --lg-tint-bar: color-mix(in srgb, var(--white) 56%, transparent);
  --lg-edge: rgba(255, 255, 255, .16); --lg-edge-soft: rgba(255, 255, 255, .08); --lg-hi: rgba(255, 255, 255, .22);
  --lg-shadow: 0 16px 36px -16px rgba(0, 0, 0, .7), 0 2px 8px rgba(0, 0, 0, .3);
}

/* Fundo com manchas suaves de cor do tema: é o que o vidro desfoca (sem isso o blur não teria o que mostrar) */
.app { background:
  radial-gradient(640px 420px at 88% -6%, color-mix(in srgb, var(--accent-blue) 26%, transparent), transparent 70%),
  radial-gradient(560px 420px at 4% 96%, color-mix(in srgb, var(--accent-blue) 18%, transparent), transparent 72%),
  linear-gradient(135deg, var(--lighter-blue) 0%, var(--light-blue) 100%); }

/* ---------- Menu superior ---------- */
.dw-top { border: 1px solid var(--lg-edge); box-shadow: inset 0 1px 0 var(--lg-hi), inset 0 -1px 0 var(--lg-edge-soft), var(--lg-shadow); }
.dw-top::before { background:
  linear-gradient(115deg, rgba(255, 255, 255, .34) 0%, rgba(255, 255, 255, 0) 38%),
  linear-gradient(180deg, var(--lg-tint-bar), color-mix(in srgb, var(--lighter-blue) 48%, transparent));
  -webkit-backdrop-filter: blur(var(--lg-blur)) saturate(var(--lg-sat)); backdrop-filter: blur(var(--lg-blur)) saturate(var(--lg-sat)); }
body.dark .dw-top::before { background: linear-gradient(115deg, rgba(255, 255, 255, .08) 0%, rgba(255, 255, 255, 0) 38%), linear-gradient(180deg, var(--lg-tint-bar), color-mix(in srgb, var(--lighter-blue) 50%, transparent)); }
.dw-link { transition: background .28s var(--lg-ease), color .2s, transform .28s var(--lg-ease), box-shadow .28s var(--lg-ease); }
.dw-link:hover:not(.active) { background: color-mix(in srgb, var(--white) 55%, transparent); box-shadow: inset 0 1px 0 var(--lg-hi), 0 0 0 1px var(--lg-edge-soft); }
.has-film .dw-link:hover:not(.active) { background: color-mix(in srgb, var(--white) 55%, transparent); }
.nav-film { background: color-mix(in srgb, var(--white) 58%, transparent); box-shadow: inset 0 1px 0 var(--lg-hi), inset 0 0 0 1px var(--lg-edge), 0 6px 16px -8px rgba(15, 23, 42, .3); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.search-btn { background: color-mix(in srgb, var(--white) 46%, transparent); border-color: var(--lg-edge); box-shadow: inset 0 1px 0 var(--lg-hi); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); transition: background .25s var(--lg-ease), transform .25s var(--lg-ease); }
.search-btn:hover { background: color-mix(in srgb, var(--white) 72%, transparent); transform: translateY(-1px); }

/* ---------- Cards de destaque (indicadores e cards clicáveis) ---------- */
.card:has(> .card-header), .card-link { position: relative; overflow: hidden; isolation: isolate;
  background: linear-gradient(145deg, color-mix(in srgb, var(--white) 78%, transparent), var(--lg-tint));
  border: 1px solid var(--lg-edge); box-shadow: inset 0 1px 0 var(--lg-hi), inset 0 -1px 0 var(--lg-edge-soft), var(--lg-shadow);
  -webkit-backdrop-filter: blur(14px) saturate(1.5); backdrop-filter: blur(14px) saturate(1.5);
  transition: transform .35s var(--lg-ease), box-shadow .35s var(--lg-ease), background .35s var(--lg-ease); }
.card:has(> .card-header)::after, .card-link::after { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; border-radius: inherit;
  background: linear-gradient(105deg, transparent 30%, rgba(255, 255, 255, .55) 48%, rgba(255, 255, 255, .15) 56%, transparent 70%); transform: translateX(-130%); transition: transform .8s var(--lg-ease); }
@media (hover: hover) {
  .card:has(> .card-header):hover, .card-link:hover { transform: translateY(-3px); box-shadow: inset 0 1px 0 var(--lg-hi), inset 0 -1px 0 var(--lg-edge-soft), 0 22px 40px -18px rgba(15, 23, 42, .42), 0 2px 8px rgba(15, 23, 42, .06); }
  .card:has(> .card-header):hover::after, .card-link:hover::after { transform: translateX(130%); }
}
body.dark .card:has(> .card-header)::after, body.dark .card-link::after { background: linear-gradient(105deg, transparent 30%, rgba(255, 255, 255, .14) 48%, rgba(255, 255, 255, .04) 56%, transparent 70%); }

/* ---------- Botões principais ---------- */
.btn-primary { position: relative; overflow: hidden; isolation: isolate;
  background: linear-gradient(180deg, color-mix(in srgb, var(--primary-blue) 90%, #fff) 0%, var(--primary-blue) 42%, var(--primary-blue) 100%);
  border: 1px solid color-mix(in srgb, #fff 34%, var(--primary-blue)); color: var(--white);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5), inset 0 -1px 0 rgba(0, 0, 0, .14), 0 8px 18px -8px color-mix(in srgb, var(--primary-blue) 70%, transparent);
  -webkit-backdrop-filter: blur(6px) saturate(1.4); backdrop-filter: blur(6px) saturate(1.4);
  transition: transform .3s var(--lg-ease), box-shadow .3s var(--lg-ease), filter .3s var(--lg-ease), background .3s; }
.btn-primary::after { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; border-radius: inherit;
  background: linear-gradient(105deg, transparent 32%, rgba(255, 255, 255, .5) 49%, rgba(255, 255, 255, .12) 57%, transparent 70%); transform: translateX(-130%); transition: transform .75s var(--lg-ease); }
.btn-primary:hover { background: linear-gradient(180deg, color-mix(in srgb, var(--primary-hover) 90%, #fff) 0%, var(--primary-hover) 42%, var(--primary-hover) 100%); transform: translateY(-1px); }
@media (hover: hover) { .btn-primary:hover { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .6), inset 0 -1px 0 rgba(0, 0, 0, .14), 0 14px 26px -10px color-mix(in srgb, var(--primary-blue) 80%, transparent); } .btn-primary:hover::after { transform: translateX(130%); } }
.btn-primary:active { transform: translateY(0) scale(.985); filter: brightness(.96); }
.btn-primary:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent-blue) 70%, #fff); outline-offset: 2px; }
.btn-primary:disabled, .btn-primary[disabled] { filter: saturate(.5) opacity(.7); box-shadow: none; }
.btn-primary:disabled::after { display: none; }

/* ---------- Celular: menos desfoque, sem backdrop-filter nos cards, sem reflexo de hover ---------- */
@media (max-width: 700px) {
  :root { --lg-blur: 10px; --lg-sat: 1.4; }
  .card:has(> .card-header), .card-link { -webkit-backdrop-filter: none; backdrop-filter: none; background: color-mix(in srgb, var(--white) 86%, transparent); }
  .btn-primary { -webkit-backdrop-filter: none; backdrop-filter: none; }
  .nav-film, .search-btn { -webkit-backdrop-filter: none; backdrop-filter: none; }
  .app-doctor .dw-nav::before { -webkit-backdrop-filter: blur(var(--lg-blur)) saturate(var(--lg-sat)); backdrop-filter: blur(var(--lg-blur)) saturate(var(--lg-sat)); background: linear-gradient(180deg, color-mix(in srgb, var(--white) 78%, transparent), var(--lg-tint-bar)); }
  .app-doctor .dw-nav { border-color: var(--lg-edge); box-shadow: inset 0 1px 0 var(--lg-hi), var(--lg-shadow); }
}
@media (hover: none) { .card:has(> .card-header)::after, .card-link::after, .btn-primary::after { display: none; } }

/* ---------- Fallbacks ---------- */
/* navegador sem backdrop-filter: vidro vira superfície quase opaca (o texto continua legível) */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .dw-top::before { background: color-mix(in srgb, var(--white) 96%, var(--lighter-blue)); }
  .card:has(> .card-header), .card-link { background: color-mix(in srgb, var(--white) 95%, transparent); }
  .nav-film, .search-btn { background: color-mix(in srgb, var(--white) 90%, transparent); }
  .app-doctor .dw-nav::before { background: color-mix(in srgb, var(--white) 96%, transparent); }
}
/* navegador sem :has() ou color-mix(): cai nos estilos anteriores (cards e botões já tinham fundo sólido) */
@media (prefers-reduced-transparency: reduce) {
  .dw-top::before, .app-doctor .dw-nav::before { -webkit-backdrop-filter: none; backdrop-filter: none; background: var(--white); }
  .card:has(> .card-header), .card-link, .nav-film, .search-btn, .btn-primary { -webkit-backdrop-filter: none; backdrop-filter: none; }
  .card:has(> .card-header), .card-link { background: var(--white); }
}
@media (prefers-reduced-motion: reduce) { .card:has(> .card-header)::after, .card-link::after, .btn-primary::after { display: none; } .card:has(> .card-header), .card-link, .btn-primary, .dw-link, .search-btn { transition: none; } }
html.a11y-motion .card:has(> .card-header)::after, html.a11y-motion .card-link::after, html.a11y-motion .btn-primary::after { display: none; }
html.a11y-contrast .dw-top::before, html.a11y-contrast .app-doctor .dw-nav::before { -webkit-backdrop-filter: none; backdrop-filter: none; background: var(--white); }
html.a11y-contrast .card:has(> .card-header), html.a11y-contrast .card-link { -webkit-backdrop-filter: none; backdrop-filter: none; background: var(--white); border-color: #000; }
html.a11y-contrast .btn-primary { background: var(--primary-blue); -webkit-backdrop-filter: none; backdrop-filter: none; }
html.a11y-contrast .btn-primary::after { display: none; }
/* ajustes finos do vidro: pílula ativa com tom do tema; barra inferior do celular mais opaca para não deixar o rodapé aparecer por trás */
.nav-film { background: linear-gradient(180deg, color-mix(in srgb, var(--accent-blue) 24%, var(--white) 76%), color-mix(in srgb, var(--accent-blue) 14%, var(--white) 86%)); }
@media (max-width: 700px) { .app-doctor .dw-nav::before { background: linear-gradient(180deg, color-mix(in srgb, var(--white) 92%, transparent), color-mix(in srgb, var(--white) 86%, transparent)); } }

/* ==========================================================================
   MENU EM CÁPSULA (todos os perfis)
   Barra de vidro em formato de cápsula: ícone com rótulo embaixo, item ativo em pílula mais escura,
   grupos separados por um filete e selo de contagem no ícone. No topo (desktop) fica centralizada entre a marca
   e as ações; no tablet mostra só ícones (rótulo no item ativo); no celular vira a cápsula flutuante de baixo.
   ========================================================================== */
html body .dw-nav { position: relative; isolation: isolate; display: flex; align-items: stretch; flex: 0 1 auto; flex-wrap: nowrap; overflow: visible; row-gap: 0; gap: 2px; margin: 0 auto; padding: 5px; border-radius: 999px;
  border: 1px solid var(--lg-edge); box-shadow: inset 0 1px 0 var(--lg-hi), inset 0 -1px 0 var(--lg-edge-soft), 0 10px 24px -16px rgba(15, 23, 42, .4); background: transparent; }
html body .dw-nav::before { content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; pointer-events: none;
  background: linear-gradient(115deg, rgba(255, 255, 255, .32), rgba(255, 255, 255, 0) 40%), color-mix(in srgb, var(--white) 56%, transparent);
  -webkit-backdrop-filter: blur(var(--lg-blur)) saturate(var(--lg-sat)); backdrop-filter: blur(var(--lg-blur)) saturate(var(--lg-sat)); }
body.dark .dw-nav::before { background: linear-gradient(115deg, rgba(255, 255, 255, .07), rgba(255, 255, 255, 0) 40%), color-mix(in srgb, var(--white) 52%, transparent); }
html body .dw-nav .nav-film { border-radius: 999px; clip-path: none; box-shadow: inset 0 1px 0 var(--lg-hi), inset 0 0 0 1px color-mix(in srgb, var(--primary-blue) 22%, transparent), 0 6px 14px -8px color-mix(in srgb, var(--primary-blue) 60%, transparent);
  background: linear-gradient(180deg, color-mix(in srgb, var(--primary-blue) 22%, var(--white)), color-mix(in srgb, var(--primary-blue) 13%, var(--white))); -webkit-backdrop-filter: none; backdrop-filter: none; }

html body .dw-nav .dw-link, html body .dw-nav .dw-group > .dw-link { display: flex; flex-direction: column; align-items: center; justify-content: center; flex: 0 0 auto; gap: 3px; min-width: 72px; padding: 8px 14px 7px; border-radius: 999px;
  font-size: 11.5px; font-weight: 600; line-height: 1.1; letter-spacing: .005em; text-align: center; color: color-mix(in srgb, var(--dark-text) 80%, var(--white)); background: transparent; box-shadow: none; transform: none; }
html body .dw-nav .dw-link:hover:not(.active) { background: color-mix(in srgb, var(--white) 55%, transparent); box-shadow: inset 0 1px 0 var(--lg-hi); transform: translateY(-1px); }
html body .dw-nav .dw-link.active { color: var(--primary-blue); font-weight: 700; background: transparent; }
html body .dw-nav .dw-link:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent-blue) 75%, #fff); outline-offset: 1px; }
html body .dw-nav .dw-ico { position: relative; display: grid; place-items: center; width: 26px; height: 24px; }
html body .dw-nav .dw-link .dw-ico > i:first-child { width: auto; height: auto; display: block; border-radius: 0; background: none; box-shadow: none; border: 0; font-size: 19px; color: color-mix(in srgb, var(--dark-text) 66%, var(--white)); transition: color .2s, transform .35s var(--lg-ease); }
html body .dw-nav .dw-link:hover .dw-ico > i:first-child { transform: translateY(-1px) scale(1.08) rotate(0); }
html body .dw-nav .dw-link.active .dw-ico > i:first-child { color: var(--primary-blue); }
html body .dw-nav .dw-label { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
html body .dw-nav .dw-label i { font-size: 8px; opacity: .65; margin: 0; }
html body .dw-nav .dw-label-s { display: none; }
html body .dw-nav .dw-sep { flex: 0 0 1px; align-self: center; height: 28px; margin: 0 5px; background: color-mix(in srgb, var(--dark-text) 16%, transparent); border-radius: 1px; }
html body .dw-nav .dw-badge { position: absolute; top: -6px; right: -10px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 999px; display: grid; place-items: center; background: #15803d; color: #fff; border: 1.5px solid var(--white); font-size: 10.5px; font-weight: 700; line-height: 1; font-style: normal; box-shadow: 0 2px 6px rgba(21, 128, 61, .4); }
html body .dw-nav .dw-badge[hidden] { display: none; }

/* cabeçalho: marca à esquerda, cápsula no meio, ações à direita */
.dw-top { gap: 12px; padding: 7px 14px; min-height: 76px; }
.dw-top .dw-brand { border-right: 0; margin-right: 0; padding-right: 6px; }

/* notebook pequeno: cápsula mais compacta */
@media (min-width: 1001px) and (max-width: 1220px) {
  html body .dw-nav .dw-link, html body .dw-nav .dw-group > .dw-link { min-width: 60px; padding: 7px 9px 6px; font-size: 11px; }
  html body .dw-nav .dw-sep { margin: 0 3px; }
  .user-meta { display: none; }
}
/* tablet: só ícones; o item ativo mostra o rótulo ao lado */
@media (min-width: 701px) and (max-width: 1000px) {
  html body .dw-nav .dw-link, html body .dw-nav .dw-group > .dw-link { flex-direction: row; gap: 7px; min-width: 0; padding: 10px 13px; font-size: 12.5px; }
  html body .dw-nav .dw-label { display: none; }
  html body .dw-nav .dw-link.active .dw-label { display: inline-flex; }
  html body .dw-nav .dw-sep { display: none; }
  .dw-top { gap: 8px; }
}
/* tablet e janelas estreitas com menu longo (supremo e administrativo): só ícones, busca só com a lupa e só o avatar */
@media (min-width: 701px) and (max-width: 1000px) {
  html body .dw-nav.dw-nav:has(> :nth-child(11)) .dw-link, html body .dw-nav.dw-nav:has(> :nth-child(11)) .dw-group > .dw-link { padding: 10px 9px; gap: 0; }
  html body .dw-nav.dw-nav:has(> :nth-child(11)) .dw-link.active .dw-label { display: none; }
  html body:has(.dw-nav > :nth-child(11)) .search-btn-text, html body:has(.dw-nav > :nth-child(11)) .user-meta, html body:has(.dw-nav > :nth-child(11)) .user-caret { display: none; }
  html body:has(.dw-nav > :nth-child(11)) .search-btn { padding-left: 10px; padding-right: 10px; }
  html body:has(.dw-nav > :nth-child(11)) .user-info { padding: 2px; }
}
@media (min-width: 701px) and (max-width: 780px) {
  html body .dw-nav.dw-nav:has(> :nth-child(11)) .dw-link, html body .dw-nav.dw-nav:has(> :nth-child(11)) .dw-group > .dw-link { padding: 10px 6px; }
  html body:has(.dw-nav > :nth-child(11)) .dw-top { gap: 4px; }
}
/* celular: cápsula flutuante embaixo, todos os itens com rótulo curto */
@media (max-width: 700px) {
  html body .dw-nav { position: fixed; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); margin: 0; padding: 5px; gap: 0; justify-content: space-between; z-index: 55; border-radius: 30px; }
  html body .dw-nav .dw-link, html body .dw-nav .dw-group > .dw-link, html body .dw-nav > .dw-link.active { flex: 1 1 0; min-width: 0; width: 100%; padding: 8px 1px 6px; gap: 2px; font-size: 10px; border-radius: 24px; }
  html body .dw-nav .dw-group { flex: 1 1 0; min-width: 0; display: flex; }
  html body .dw-nav .dw-label, html body .dw-nav > .dw-link.active .dw-label, html body .dw-nav .dw-group > .dw-link.active .dw-label { display: none; }
  html body .dw-nav .dw-label-s { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; font-weight: 600; }
  html body .dw-nav .dw-link.active .dw-label-s { font-weight: 700; }
  html body .dw-nav .dw-link .dw-ico > i:first-child { font-size: 20px; }
  html body .dw-nav .dw-sep { display: none; }
  html body .dw-nav .dw-badge { right: -8px; top: -5px; }
  html body .dw-nav::before { background: linear-gradient(180deg, color-mix(in srgb, var(--white) 92%, transparent), color-mix(in srgb, var(--white) 84%, transparent)); }
  html body .dw-nav .nav-film { background: linear-gradient(180deg, color-mix(in srgb, var(--primary-blue) 20%, var(--white)), color-mix(in srgb, var(--primary-blue) 12%, var(--white))); }
}
@media (prefers-reduced-transparency: reduce) { html body .dw-nav::before { -webkit-backdrop-filter: none; backdrop-filter: none; background: var(--white); } }
html.a11y-contrast .dw-nav::before { -webkit-backdrop-filter: none; backdrop-filter: none; background: var(--white); }
html.a11y-contrast .dw-nav { border: 2px solid #000; }
html body .dw-nav .dw-link, html body .dw-nav .dw-group > .dw-link { position: relative; z-index: 1; }
html body .dw-nav .dw-group { position: relative; z-index: 1; }
html body .dw-nav .dw-label i, html body.dark .dw-nav .dw-label i, html body .dw-nav .dw-link .dw-label i:first-child { width: auto; height: auto; background: none; box-shadow: none; border: 0; border-radius: 0; font-size: 8px; color: inherit; display: inline-block; }
@media (max-width: 900px) {
  html body .dw-nav .dw-link span.dw-ico, html body .dw-nav > .dw-link.active span.dw-ico, html body .dw-nav .dw-group > .dw-link.active span.dw-ico { display: grid; font-size: inherit; }
}
@media (max-width: 700px) {
  html body .dw-nav > .dw-link.active span.dw-label-s, html body .dw-nav .dw-link span.dw-label-s, html body .dw-nav .dw-group > .dw-link.active span.dw-label-s { display: block; font-size: 10px; }
  html body .dw-nav > .dw-link.active span.dw-label, html body .dw-nav .dw-group > .dw-link.active span.dw-label { display: none; }
}
@media (min-width: 701px) and (max-width: 900px) {
  html body .dw-nav > .dw-link.active span.dw-label, html body .dw-nav .dw-group > .dw-link.active span.dw-label { display: inline-flex; font-size: 12.5px; font-weight: 700; }
}
html body .dw-nav .dw-badge { display: grid; }
html body .dw-nav .dw-badge[hidden] { display: none; }

/* ==========================================================================
   COMPUTADOR (≥1001px): visual sólido e organizado, sem Liquid Glass.
   Barra superior reta e cheia, menu em abas (ícone + rótulo lado a lado, linha colorida no item ativo),
   cartões brancos com borda fina e sombra discreta, botões de cor sólida. O vidro fica só no celular/tablet.
   ========================================================================== */
@media (min-width: 1001px) {
  html body .app { background: var(--lighter-blue); }
  html body .app::before, html body .app::after { display: none; }
  /* barra superior */
  html body .dw-top { margin: 0; padding: 0 24px; min-height: 64px; gap: 8px; border-radius: 0; border: 0; border-bottom: 1px solid var(--border-color); background: var(--white); box-shadow: 0 1px 2px rgba(15, 23, 42, .05); animation: none; isolation: auto; }
  html body .dw-top::before, html body .dw-top::after { display: none; }
  html body .dw-top .dw-brand { padding-right: 20px; margin-right: 8px; border-right: 1px solid var(--border-color); }
  /* menu em abas */
  html body .dw-nav { margin: 0; padding: 0; gap: 2px; align-self: stretch; align-items: stretch; border: 0; border-radius: 0; background: none; box-shadow: none; flex: 1 1 auto; justify-content: flex-start; }
  html body .dw-nav::before { display: none; }
  html body .dw-nav .nav-film { display: none; }
  html body .dw-nav .dw-link, html body .dw-nav .dw-group > .dw-link { flex-direction: row; gap: 9px; min-width: 0; padding: 0 16px; height: 100%; border-radius: 0; font-size: 14px; font-weight: 600; color: var(--gray-text); box-shadow: inset 0 -3px 0 transparent; transition: color .15s, background .15s, box-shadow .15s; }
  html body .dw-nav .dw-group { display: flex; align-self: stretch; }
  html body .dw-nav .dw-link:hover:not(.active) { background: color-mix(in srgb, var(--primary-blue) 6%, var(--white)); color: var(--dark-text); transform: none; box-shadow: inset 0 -3px 0 color-mix(in srgb, var(--primary-blue) 22%, transparent); }
  html body .dw-nav .dw-link.active, html body .has-film .dw-nav .dw-link.active { color: var(--primary-blue); background: color-mix(in srgb, var(--primary-blue) 8%, var(--white)); box-shadow: inset 0 -3px 0 var(--primary-blue); }
  html body .dw-nav .dw-ico { width: 20px; height: 20px; }
  html body .dw-nav .dw-link .dw-ico > i:first-child { font-size: 16px; color: inherit; transform: none; }
  html body .dw-nav .dw-link:hover .dw-ico > i:first-child { transform: none; }
  html body .dw-nav .dw-link.active .dw-ico > i:first-child { color: var(--primary-blue); }
  html body .dw-nav .dw-badge { position: static; margin-left: 2px; order: 3; box-shadow: none; border: 0; min-width: 20px; height: 20px; }
  html body .dw-nav .dw-ico .dw-badge { position: absolute; top: -7px; right: -10px; margin: 0; }
  html body .dw-nav .dw-sep { height: 24px; margin: 0 6px; background: var(--border-color); }
  /* busca e usuário */
  html body .search-btn { background: var(--white); border: 1px solid var(--border-color); box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; border-radius: 10px; }
  html body .search-btn:hover { background: var(--lighter-blue); transform: none; border-color: var(--primary-blue); }
  html body .dw-top .user-info { background: var(--white); box-shadow: none; }
  html body .dw-top .user-info:hover { background: var(--lighter-blue); box-shadow: none; }
  html body .dw-top .user-avatar { box-shadow: none; }
  /* cartões */
  html body .card:has(> .card-header), html body .card-link { background: var(--white); border: 1px solid var(--border-color); box-shadow: 0 1px 2px rgba(15, 23, 42, .05); -webkit-backdrop-filter: none; backdrop-filter: none; overflow: visible; transition: border-color .15s, box-shadow .15s; }
  html body .card:has(> .card-header)::after, html body .card-link::after { display: none; }
  html body .card:has(> .card-header):hover, html body .card-link:hover { transform: none; border-color: var(--primary-blue); box-shadow: 0 4px 12px -6px rgba(15, 23, 42, .25); }
  /* botões principais: cor sólida */
  html body .btn-primary { background: var(--primary-blue); border: 1px solid var(--primary-blue); box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; overflow: visible; transition: background .15s; }
  html body .btn-primary::after { display: none; }
  html body .btn-primary:hover { background: var(--primary-hover); transform: none; box-shadow: none; }
  /* rodapé reto */
  html body .dw-foot { margin: 0; border-radius: 0; border: 0; border-top: 1px solid var(--border-color); }
  html body.dark .dw-top, html body.dark .dw-foot { border-color: color-mix(in srgb, #fff 14%, transparent); }
}
@media (min-width: 1001px) {
  html body .dw-nav .dw-ico { margin-right: 6px; }
  html body .dw-nav .dw-ico .dw-badge { top: -9px; right: -9px; min-width: 16px; height: 16px; font-size: 10px; padding: 0 3px; }
}
@media (min-width: 1001px) {
  html body .dw-nav { min-width: 0; }
  html body .dw-top .dw-brand { flex: 0 0 auto; }
  html body .search-btn, html body .dw-top .user-menu-wrap { flex: 0 0 auto; }
}
@media (min-width: 1001px) and (max-width: 1560px) {
  html body .dw-nav .dw-link, html body .dw-nav .dw-group > .dw-link { padding: 0 11px; gap: 7px; font-size: 13px; }
  html body .dw-nav .dw-sep { margin: 0 3px; }
  html body .dw-top { padding: 0 16px; }
  html body .dw-top .dw-brand { padding-right: 14px; }
}
@media (min-width: 1001px) and (max-width: 1280px) {
  html body .dw-nav .dw-link:not(.active) .dw-label { display: none; }
  html body .dw-nav .dw-link, html body .dw-nav .dw-group > .dw-link { padding: 0 14px; }
}
@media (min-width: 1001px) { html body .dw-top::before, html body .dw-nav::before { -webkit-backdrop-filter: none; backdrop-filter: none; } }

/* ==========================================================================
   COMPUTADOR · acabamento: barra flutuante arredondada, abas em pílula com indicador deslizante,
   cartões e botões arredondados com microinterações (elevação, brilho de foco, clique que "afunda").
   Sólido, sem vidro. Respeita movimento reduzido.
   ========================================================================== */
@media (min-width: 1001px) {
  html body .dw-top { margin: 12px 16px 0; padding: 0 12px 0 16px; min-height: 66px; border: 1px solid var(--border-color); border-radius: 20px; box-shadow: 0 1px 2px rgba(15, 23, 42, .05), 0 10px 28px -18px rgba(15, 23, 42, .28); }
  html body .dw-top .dw-brand { border-right: 0; margin-right: 4px; padding-right: 12px; }
  html body .dw-nav { gap: 4px; align-self: center; align-items: center; position: relative; }
  html body .dw-nav .nav-film { display: block; border-radius: 12px; clip-path: none; background: color-mix(in srgb, var(--primary-blue) 11%, var(--white)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--primary-blue) 18%, transparent); -webkit-backdrop-filter: none; backdrop-filter: none; transition: transform .38s cubic-bezier(.3, 1.25, .5, 1), width .38s cubic-bezier(.3, 1.25, .5, 1), height .3s, opacity .2s; }
  html body .dw-nav .dw-link, html body .dw-nav .dw-group > .dw-link { height: 44px; border-radius: 12px; box-shadow: none; transition: background .18s, color .18s, transform .18s; }
  html body .dw-nav .dw-group { align-self: center; }
  html body .dw-nav .dw-link:hover:not(.active) { background: color-mix(in srgb, var(--primary-blue) 7%, var(--white)); box-shadow: none; transform: translateY(-1px); }
  html body .dw-nav .dw-link:active { transform: scale(.97); }
  html body .dw-nav .dw-link.active, html body .has-film .dw-nav .dw-link.active { background: transparent; box-shadow: none; }
  html body .dw-nav .dw-link .dw-ico > i:first-child { transition: transform .25s cubic-bezier(.3, 1.4, .5, 1); }
  html body .dw-nav .dw-link:hover .dw-ico > i:first-child { transform: scale(1.14) rotate(-4deg); }
  html body .dw-nav .dw-sep { height: 22px; margin: 0 4px; opacity: .8; }
  html body .search-btn { border-radius: 12px; height: 44px; transition: border-color .18s, background .18s, box-shadow .18s, transform .18s; }
  html body .search-btn:hover { box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary-blue) 12%, transparent); transform: none; }
  html body .dw-top .user-info { border-radius: 16px; transition: background .18s, box-shadow .18s, border-color .18s; }
  html body .dw-top .user-info:hover { border-color: var(--primary-blue); box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary-blue) 12%, transparent); }
  html body .dw-top .user-avatar { transition: transform .25s cubic-bezier(.3, 1.4, .5, 1); }
  html body .dw-top .user-info:hover .user-avatar { transform: scale(1.06); }
  /* conteúdo */
  html body .card, html body .card:has(> .card-header), html body .card-link { border-radius: 20px; }
  html body .card:has(> .card-header), html body .card-link { transition: transform .22s cubic-bezier(.2, .8, .3, 1), box-shadow .22s, border-color .2s; }
  html body .card:has(> .card-header):hover, html body .card-link:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--primary-blue) 55%, var(--border-color)); box-shadow: 0 14px 30px -16px color-mix(in srgb, var(--primary-blue) 45%, transparent), 0 2px 6px rgba(15, 23, 42, .06); }
  html body .card:has(> .card-header):active, html body .card-link:active { transform: translateY(-1px) scale(.992); }
  html body .card-icon, html body .card:has(> .card-header) .card-icon { border-radius: 14px; transition: transform .25s cubic-bezier(.3, 1.4, .5, 1); }
  html body .card:has(> .card-header):hover .card-icon { transform: scale(1.1) rotate(-5deg); }
  html body .btn, html body .btn-primary, html body .btn-secondary { border-radius: 12px; transition: background .16s, box-shadow .2s, transform .16s, border-color .16s; }
  html body .btn-primary:hover { transform: translateY(-1px); box-shadow: 0 8px 18px -8px color-mix(in srgb, var(--primary-blue) 70%, transparent); }
  html body .btn:active, html body .btn-primary:active, html body .btn-secondary:active { transform: translateY(0) scale(.97); box-shadow: none; }
  html body .btn:focus-visible, html body .btn-primary:focus-visible, html body .dw-link:focus-visible, html body .search-btn:focus-visible { outline: 0; box-shadow: 0 0 0 3px var(--white), 0 0 0 5px var(--accent-blue); }
  html body input, html body select, html body textarea { border-radius: 12px; transition: border-color .15s, box-shadow .15s; }
  html body input:focus, html body select:focus, html body textarea:focus { box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary-blue) 14%, transparent); }
  html body .badge, html body .status-badge { border-radius: 999px; }
  html body .dw-foot { margin: 0 16px 10px; border: 1px solid var(--border-color); border-radius: 14px; }
  /* entrada suave dos cartões ao trocar de tela */
  @keyframes crivo-rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
  html body .content-area .cards-grid > *, html body .content-area > .card { animation: crivo-rise .45s cubic-bezier(.2, .8, .3, 1) backwards; }
  html body .content-area .cards-grid > :nth-child(2) { animation-delay: .04s; } html body .content-area .cards-grid > :nth-child(3) { animation-delay: .08s; } html body .content-area .cards-grid > :nth-child(4) { animation-delay: .12s; }
  html body .content-area .cards-grid > :nth-child(n+5) { animation-delay: .16s; }
}
@media (min-width: 1001px) and (prefers-reduced-motion: reduce) {
  html body .content-area .cards-grid > *, html body .content-area > .card { animation: none; }
  html body .card:has(> .card-header):hover, html body .card-link:hover, html body .btn-primary:hover, html body .dw-nav .dw-link:hover { transform: none; }
}
html.a11y-motion body .content-area .cards-grid > *, html.a11y-motion body .content-area > .card { animation: none !important; }
@media (min-width: 1001px) { html body .dw-nav .nav-film { top: 0; left: 0; margin: 0; border: 0; box-sizing: border-box; align-self: flex-start; } }
@media (min-width: 1001px) { html body .dw-nav > .dw-link, html body .dw-nav .dw-group, html body .dw-nav .dw-sep { animation: none; } }
/* menus longos (gestante e administração) ficam mais compactos em telas médias para não encostar na busca */
@media (min-width: 1001px) and (max-width: 1600px) {
  html body .dw-nav:has(> :nth-child(9)) .dw-link, html body .dw-nav:has(> :nth-child(9)) .dw-group > .dw-link { padding: 0 8px; gap: 6px; font-size: 12.5px; }
  html body .dw-nav:has(> :nth-child(9)) .dw-sep { margin: 0 1px; }
}
@media (min-width: 1001px) and (max-width: 1360px) {
  html body .dw-nav:has(> :nth-child(9)) .dw-link:not(.active) .dw-label { display: none; }
  html body .dw-nav:has(> :nth-child(9)) .dw-link:not(.active) .dw-ico { margin-right: 0; }
  html body .dw-nav:has(> :nth-child(9)) .dw-link, html body .dw-nav:has(> :nth-child(9)) .dw-group > .dw-link { padding: 0 11px; }
}
/* menus muito longos (supremo e administrativo: 8 ou mais itens com separadores) apertam um pouco mais e, até 1560 px, mostram só o ícone (o item ativo mantém o nome) */
@media (min-width: 1001px) and (max-width: 1600px) {
  html body .dw-nav.dw-nav:has(> :nth-child(11)) .dw-link, html body .dw-nav.dw-nav:has(> :nth-child(11)) .dw-group > .dw-link { padding: 0 6px; gap: 5px; }
}
@media (min-width: 1001px) and (max-width: 1560px) {
  html body .dw-nav.dw-nav:has(> :nth-child(11)) .dw-link:not(.active) .dw-label { display: none; }
  html body .dw-nav.dw-nav:has(> :nth-child(11)) .dw-link:not(.active) .dw-ico { margin-right: 0; }
  html body .dw-nav.dw-nav:has(> :nth-child(11)) .dw-link, html body .dw-nav.dw-nav:has(> :nth-child(11)) .dw-group > .dw-link { padding: 0 11px; }
}


/* ==========================================================================
   SUPREMO · gestão da instituição (tema índigo) e personalização da marca
   ========================================================================== */
body.theme-supremo { --primary-blue: #4338ca; --primary-hover: #3730a3; --accent-blue: #6366f1; --light-blue: #e0e7ff; --lighter-blue: #eef2ff; --gray-text: #565b7e; --border-color: #d6dbf7; --info-text: #3730a3; --info-bg: #e0e7ff; }
body.theme-supremo, body.theme-supremo.login-body { background: linear-gradient(160deg, #f6f7ff 0%, #e6eaff 100%); }
body.theme-supremo .header { border-top: 3px solid #6366f1; }
body.dark.theme-supremo { --primary-blue: #a5b4fc; --primary-hover: #c7d2fe; --accent-blue: #818cf8; --light-blue: #23265a; --lighter-blue: #181a40; --gray-text: #aab0d8; --border-color: #363b78; --info-text: #e0e7ff; --info-bg: #23265a; --white: #12142f; }
body.dark.theme-supremo, body.dark.theme-supremo.login-body { background: linear-gradient(160deg, #0d0f26 0%, #1a1d48 100%); }
body.theme-supremo .btn-primary { color: #fff; }
body.dark.theme-supremo .btn-primary { color: #0d0f26; }
.login-modes .login-mode[data-mode="supreme"] { grid-column: 1 / -1; }
@media (max-width: 480px) { .login-modes .login-mode[data-mode="supreme"] { grid-column: span 2; } }
.login-mode[data-mode="supreme"] i { color: #4f46e5; }

.su-hero { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 22px 24px; border-radius: 20px; color: #fff;
  background: radial-gradient(520px 220px at 90% -20%, rgba(255, 255, 255, .22), transparent 70%), linear-gradient(135deg, #3730a3 0%, #4f46e5 60%, #6366f1 100%); box-shadow: 0 16px 34px -22px #3730a3; }
.su-hero h2 { margin: 2px 0 4px; font-size: 26px; color: #fff; } .su-hero .muted { color: rgba(255, 255, 255, .82); }
.su-eyebrow { margin: 0; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: rgba(255, 255, 255, .85); }
html body .su-hero .btn-primary { background: #fff; color: #3730a3; border-color: #fff; } html body .su-hero .btn-primary:hover { background: #eef2ff; }
.su-hello { margin: 12px 2px 16px; }
.su-limits { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.su-col { padding: 16px 18px; border-radius: 16px; background: var(--white); border: 1px solid var(--border-color); }
.su-col h3 { margin: 0 0 8px; font-size: 15px; display: flex; gap: 8px; align-items: center; color: #15803d; } .su-no h3 { color: #b91c1c; }
.su-col ul { margin: 0; padding-left: 18px; display: grid; gap: 5px; font-size: 14px; }
.su-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(280px, 1fr); gap: 20px; align-items: start; margin-top: 14px; }
.su-form { padding: 22px; } .su-form .subsection-title { margin: 18px 0 10px; } .su-form .subsection-title:first-child { margin-top: 0; }
.su-form .form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.su-check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; margin: 6px 0; }
.swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.swatch { display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px 7px 8px; border-radius: 999px; border: 1.5px solid var(--border-color); background: var(--white); cursor: pointer; font: inherit; font-size: 13px; font-weight: 600; color: var(--dark-text); transition: transform .15s, border-color .15s, box-shadow .15s; }
.swatch:hover { transform: translateY(-1px); border-color: var(--primary-blue); }
.swatch.is-on { border-color: var(--primary-blue); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary-blue) 18%, transparent); }
.sw-dot { width: 20px; height: 20px; border-radius: 50%; display: inline-block; background: #1e3a8a; }
.sw-indigo { background: #4338ca; } .sw-teal { background: #0f766e; } .sw-emerald { background: #047857; } .sw-violet { background: #6d28d9; } .sw-rose { background: #be123c; } .sw-amber { background: #b45309; } .sw-slate { background: #334155; }
.su-custom { align-items: end; margin-top: 10px; } .su-color { height: 44px; padding: 4px; cursor: pointer; } .su-hexline { margin: 0 0 10px; }
.su-preview { padding: 18px; position: sticky; top: 14px; }
.brand-preview { --pv: #1e3a8a; border: 1px solid var(--border-color); border-radius: 16px; overflow: hidden; background: var(--white); }
.bp-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--border-color); }
.bp-logo { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; color: #fff; background: var(--pv); }
.bp-nav { display: flex; gap: 6px; padding: 10px 12px; font-size: 13px; font-weight: 600; color: var(--gray-text); } .bp-nav span { padding: 5px 10px; border-radius: 10px; }
.bp-nav .bp-pill { color: var(--pv); background: color-mix(in srgb, var(--pv) 12%, var(--white)); }
.bp-card { display: grid; gap: 2px; margin: 4px 14px 10px; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--border-color); }
.bp-kpi { font-size: 26px; font-weight: 800; color: var(--pv); }
.bp-actions { display: flex; align-items: center; gap: 14px; padding: 0 14px 14px; }
.bp-btn { padding: 8px 16px; border-radius: 12px; background: var(--pv); color: #fff; font-weight: 700; font-size: 13px; } .bp-link { color: var(--pv); font-weight: 700; font-size: 13px; }
.su-mods { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 14px 0 6px; }
.su-mod { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 16px; background: var(--white); border: 1px solid var(--border-color); cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.su-mod:hover { border-color: var(--primary-blue); box-shadow: 0 8px 20px -14px var(--primary-blue); }
.su-mod-ico { display: grid; place-items: center; flex: 0 0 40px; height: 40px; border-radius: 12px; background: var(--light-blue); color: var(--primary-blue); font-size: 17px; }
.su-mod-txt { display: grid; gap: 2px; flex: 1; min-width: 0; }
.switch { position: relative; flex: 0 0 auto; width: 46px; height: 26px; }
.switch input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; z-index: 1; }
.switch-ui { position: absolute; inset: 0; border-radius: 999px; background: #c4c9dd; transition: background .2s; }
.switch-ui::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); transition: transform .22s cubic-bezier(.3, 1.3, .5, 1); }
.switch input:checked + .switch-ui { background: var(--primary-blue); } .switch input:checked + .switch-ui::after { transform: translateX(20px); }
.switch input:focus-visible + .switch-ui { outline: 3px solid var(--accent-blue); outline-offset: 2px; }
.su-pol { padding: 16px 18px; max-width: 520px; margin-bottom: 14px; }
.su-matrix th, .su-matrix td { text-align: center; font-size: 13px; } .su-matrix tbody th { text-align: left; }
.su-matrix .mx-yes { color: #15803d; font-weight: 700; } .su-matrix .mx-no { color: #94a3b8; } .su-matrix .mx-part { color: var(--primary-blue); font-weight: 600; }
.su-matrix .mx-su { color: var(--primary-blue); }
@media (max-width: 1000px) { .su-grid { grid-template-columns: minmax(0, 1fr); } .su-preview { position: static; } }
@media (max-width: 700px) { .su-limits, .su-mods, .su-form .form-row { grid-template-columns: minmax(0, 1fr); } .su-hero { padding: 18px; } .su-hero h2 { font-size: 22px; } }

/* cor da marca da instituição (a variável --inst vem de js/core/settings.js) */
body.inst-brand:not(.theme-gestante):not(.theme-farmacia):not(.theme-recepcao):not(.theme-admin):not(.theme-medico):not(.theme-supremo),
body.inst-brand.inst-staff:not(.theme-gestante):not(.theme-supremo) {
  --primary-blue: var(--inst); --primary-hover: color-mix(in srgb, var(--inst) 80%, #000); --accent-blue: color-mix(in srgb, var(--inst) 80%, #fff);
  --light-blue: color-mix(in srgb, var(--inst) 13%, #fff); --lighter-blue: color-mix(in srgb, var(--inst) 5%, #fff); --border-color: color-mix(in srgb, var(--inst) 15%, #dfe3ec);
  --info-text: color-mix(in srgb, var(--inst) 85%, #000); --info-bg: color-mix(in srgb, var(--inst) 13%, #fff);
}
body.dark.inst-brand:not(.theme-gestante):not(.theme-farmacia):not(.theme-recepcao):not(.theme-admin):not(.theme-medico):not(.theme-supremo),
body.dark.inst-brand.inst-staff:not(.theme-gestante):not(.theme-supremo) {
  --primary-blue: color-mix(in srgb, var(--inst) 42%, #fff); --primary-hover: color-mix(in srgb, var(--inst) 30%, #fff); --accent-blue: color-mix(in srgb, var(--inst) 60%, #fff);
  --light-blue: color-mix(in srgb, var(--inst) 26%, #0f1220); --lighter-blue: color-mix(in srgb, var(--inst) 14%, #0f1220); --border-color: color-mix(in srgb, var(--inst) 30%, #1c2033);
  --info-text: color-mix(in srgb, var(--inst) 25%, #fff); --info-bg: color-mix(in srgb, var(--inst) 26%, #0f1220);
}
body.inst-brand:not(.theme-gestante):not(.theme-farmacia):not(.theme-recepcao):not(.theme-admin):not(.theme-medico):not(.theme-supremo):not(.dark), body.inst-brand.inst-staff:not(.theme-gestante):not(.theme-supremo):not(.dark) { background: linear-gradient(160deg, color-mix(in srgb, var(--inst) 4%, #fff) 0%, color-mix(in srgb, var(--inst) 11%, #fff) 100%); }

/* supremo: gestão (indicadores, operação, segurança) */
.su-grid-even{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,360px),1fr));gap:16px}
.su-form{display:flex;flex-direction:column;gap:12px}
.su-roles{display:flex;flex-wrap:wrap;gap:8px 16px;border:0;padding:0;margin:0}
.su-mod-flat{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px;border:1px solid var(--border,#e2e8f0);border-radius:12px}
.su-mod-txt{display:flex;flex-direction:column;gap:2px}
.su-split{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,340px),1fr));gap:16px;margin-top:16px}
.su-chart{min-width:0}
.mt-chart{width:100%;height:auto;display:block}
.mt-bar{fill:#4338ca}.mt-bar-c{fill:#f59e0b}
.mt-val{font-size:11px;fill:currentColor;font-weight:600}.mt-lab{font-size:10px;fill:currentColor;opacity:.65}
.lg{display:inline-block;width:10px;height:10px;border-radius:3px;vertical-align:middle;margin:0 4px 0 8px}.lg-a{background:#4338ca}.lg-c{background:#f59e0b}
.su-bars{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:10px}
.su-bars li{display:grid;grid-template-columns:minmax(0,1.2fr) minmax(0,2fr) auto;gap:10px;align-items:center}
.su-bars meter{width:100%;height:10px}
.btn-danger-ghost{color:#b91c1c;background:transparent;border:1px solid currentColor}

/* Supremo › modelos de clínica */
.tp-grid { margin-top: 10px; }
.tp-card { cursor: default; align-items: flex-start; }
.tp-card.is-on { border-color: var(--primary-blue); box-shadow: 0 0 0 2px var(--light-blue); }
.tp-card .btn { align-self: center; flex: 0 0 auto; }
.tp-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.tp-current { padding: 22px; margin: 14px 0 22px; }
.tp-cur-head { display: flex; gap: 14px; align-items: center; }
.tp-cur-head .subsection-title { margin: 0; } .tp-cur-head p { margin: 2px 0 0; }
.tp-progress .small { margin: 0; }
.tp-progress { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin: 14px 0 6px; }
.tp-progress progress { flex: 1 1 200px; height: 10px; align-self: center; accent-color: var(--primary-blue); }
.tp-group { border: 0; padding: 0; margin: 16px 0 0; min-width: 0; }
.tp-group legend { font-weight: 700; margin-bottom: 8px; padding: 0; }
.tp-item { display: flex; gap: 12px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--border-color); border-radius: 12px; margin-bottom: 8px; background: var(--white); cursor: pointer; }
.tp-item input { margin-top: 3px; flex: 0 0 auto; width: 18px; height: 18px; accent-color: var(--primary-blue); }
.tp-item > span { display: grid; gap: 2px; min-width: 0; }
.tp-item.is-done .tp-text { text-decoration: line-through; opacity: .7; }
.tp-where { display: inline-flex; gap: 6px; align-items: center; margin: 0; }
.tp-detail { display: grid; gap: 12px; }
.tp-dl { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 8px 16px; margin: 0; }
.tp-dl dt { font-weight: 600; }
.tp-dl dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 700px) { .tp-dl { grid-template-columns: minmax(0, 1fr); } .tp-dl dd { margin-bottom: 6px; } .tp-card { flex-wrap: wrap; } }

/* Administrativo › corpo clínico: grade de horários no cadastro do médico */
.dc-grid { border: 1px solid var(--border-color); border-radius: 12px; padding: 12px 16px 4px; margin: 6px 0 0; min-width: 0; }
.dc-grid legend { font-weight: 700; padding: 0 6px; }
.dc-day { display: grid; grid-template-columns: 90px minmax(0, 1fr); align-items: center; gap: 10px; margin-bottom: 8px; }
.dc-day label { margin: 0; }
@media (max-width: 520px) { .dc-day { grid-template-columns: minmax(0, 1fr); gap: 4px; } }
.dc-kind, .dc-exams { border: 1px solid var(--border-color); border-radius: 12px; padding: 10px 16px 6px; margin: 6px 0 10px; min-width: 0; }
.dc-kind legend, .dc-exams legend { font-weight: 700; padding: 0 6px; }
.dc-kind .check-row { display: flex; gap: 8px; align-items: center; margin-bottom: 6px; flex-wrap: wrap; }
.dc-ex-list { display: grid; gap: 6px; max-height: 320px; overflow-y: auto; padding: 4px 2px 10px; }
.dc-ex-group { border: 1px solid var(--border-color); border-radius: 10px; padding: 6px 12px; }
.dc-ex-group summary { cursor: pointer; font-weight: 600; padding: 4px 0; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.dc-ex-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); gap: 4px 14px; padding: 6px 0 4px; }
.dc-ex-list .check { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; }

/* Administrativo › catálogos de medicamentos e exames */
.cat-search { margin: 6px 0 14px; max-width: 520px; }
.cat-add { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-start; margin-bottom: 10px; }
.cat-add .form-control { flex: 1 1 220px; min-width: 0; }
.cat-add .cat-type { flex: 0 1 180px; }
.cat-add .form-error { flex-basis: 100%; }
.cat-list { list-style: none; margin: 0; padding: 0; max-height: 420px; overflow-y: auto; }
.cat-list li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 6px 4px; border-bottom: 1px solid var(--border-color); }
.cat-list li > span:first-child { display: grid; gap: 2px; min-width: 0; overflow-wrap: anywhere; }
.cat-actions { display: flex; gap: 6px; flex: 0 0 auto; }
.cat-group { margin-bottom: 8px; }
.cat-who { display: inline-flex; gap: 4px; align-items: center; }
.cat-quick { margin-top: 6px; }
.cat-quick summary { cursor: pointer; color: var(--primary-blue); font-size: 14px; font-weight: 600; }
.cat-quick .cat-add { margin-top: 8px; }

/* Administrativo › notas fiscais (NFS-e) */
.nf-mini { margin-top: 4px; display: flex; gap: 6px; align-items: center; justify-content: flex-end; flex-wrap: wrap; }
.nf-erros { color: var(--danger-text, #b91c1c); margin-top: 4px; max-width: 360px; overflow-wrap: anywhere; }
.nf-cert { margin-top: 12px; }
.nf-adv { margin: 8px 0; } .nf-adv summary { cursor: pointer; font-weight: 600; }
.nf-emit-check { display: flex; gap: 8px; align-items: center; margin: 6px 0; font-weight: 600; }
/* valores particulares */
.price-badge { white-space: nowrap; }
.cat-price { white-space: nowrap; }
.price-field .muted { margin: 4px 0 0; }

/* atendimento pelo médico: Chamar → Começar → Finalizar */
.attend { display: inline-flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 6px; }
.attend-big { margin: 0 0 12px; }
.attend-timer { font-variant-numeric: tabular-nums; }
.attend-bar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 18px; margin-bottom: 16px; border-left: 4px solid var(--primary-blue); }
.attend-bar .attend-big { margin: 0; }
.btn-success { background: #15803d; color: #fff; border-color: #15803d; }
.btn-success:hover { background: #166534; }
.nf-export { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: flex-end; padding: 12px 14px; margin-bottom: 14px; border: 1px dashed var(--border-color); border-radius: 12px; }
.nf-export .form-group { margin: 0; min-width: 150px; }
.nf-export .btn-row { margin: 0; }
.nf-export-hint { flex-basis: 100%; margin: 0; }

/* laudos de exame */
.laudo-conc { margin: 0; font-weight: 600; white-space: pre-wrap; }
.laudo-sign { margin: 6px 0 12px; }
.laudo-files { margin-top: 12px; }
.laudo-list { list-style: none; padding: 0; margin: 6px 0 10px; display: grid; gap: 6px; }
.laudo-list li { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; padding: 8px 10px; border: 1px solid var(--border-color); border-radius: 10px; }
.laudo-list a { font-weight: 600; overflow-wrap: anywhere; }
.laudo-upload { cursor: pointer; position: relative; }
.laudo-actions { margin-top: 12px; }
.laudo-text { font-family: inherit; line-height: 1.5; }
/* forma de pagamento na baixa */
.pay-methods { border: 0; padding: 0; margin: 4px 0 10px; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.pay-methods legend { font-weight: 600; margin-bottom: 6px; padding: 0; }
.pay-opt { display: block; cursor: pointer; }
.pay-opt input { position: absolute; opacity: 0; pointer-events: none; }
.pay-opt span { display: flex; gap: 8px; align-items: center; padding: 10px 12px; border: 1.5px solid var(--border-color); border-radius: 12px; font-weight: 600; background: var(--white); }
.pay-opt input:checked + span { border-color: var(--primary-blue); background: var(--light-blue); color: var(--primary-blue); }
.pay-opt input:focus-visible + span { outline: 3px solid var(--primary-blue); outline-offset: 2px; }
.btn-warning { background: #b45309; color: #fff; border-color: #b45309; }
.btn-warning:hover { background: #92400e; }
.price-badge { font-weight: 600; white-space: nowrap; }

/* seletor de paciente (nova consulta): lista clicável no lugar de <select size> — clique confiável no desktop e no toque */
.pick-list { margin-top: 8px; max-height: 210px; overflow-y: auto; border: 2px solid var(--border-color); border-radius: 8px; background: var(--white); display: flex; flex-direction: column; }
.pick-opt { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; width: 100%; text-align: left; padding: 10px 14px; border: 0; border-bottom: 1px solid var(--border-color); background: transparent; cursor: pointer; font: inherit; color: var(--text-primary, inherit); transition: background 0.12s; }
.pick-opt:last-child { border-bottom: 0; }
.pick-opt:hover, .pick-opt:focus-visible { background: var(--light-blue); outline: none; }
.pick-opt.is-on { background: var(--primary-blue); color: var(--white); }
.pick-opt.is-on .pick-sub { color: var(--white); opacity: 0.85; }
.pick-name { font-weight: 600; font-size: 15px; }
.pick-sub { font-size: 12px; color: var(--text-muted, #64748b); }
.pick-empty { margin: 10px 14px; }
