:root {
    --primary: #194c4c;
    --primary-dark: #143838;
    --secondary: #1f5e5e;
    --accent: #339999;
    --light: #b3e0e0;
    --lighter: #e0f2f2;
    --bg: #F5F5F5;
    --card: #FFFFFF;
    --text: #333333;
    --text-muted: #666666;
    --danger: #D32F2F;
    --warning: #FF9800;
    --info: #2196F3;
    --sidebar-width: 260px;
    --shadow: 0 2px 8px rgba(0,0,0,0.08);
    --shadow-lg: 0 4px 16px rgba(0,0,0,0.12);
    --radius: 8px;
    --radius-lg: 12px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
}

/* LOGIN */
.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
}

.login-container {
    width: 100%;
    max-width: 420px;
    padding: 20px;
}

.login-card {
    background: var(--card);
    border-radius: var(--radius-lg);
    padding: 40px;
    box-shadow: var(--shadow-lg);
}

.login-logo {
    text-align: center;
    margin-bottom: 30px;
}

.login-logo h1 {
    color: var(--primary);
    font-size: 28px;
    font-weight: 800;
}

.login-logo p {
    color: var(--text-muted);
    font-size: 13px;
    margin-top: 5px;
}

/* FORMS */
.form-group {
    margin-bottom: 18px;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    align-items: end;
}

.form-group label {
    display: block;
    font-weight: 600;
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-control {
    width: 100%;
    padding: 12px 14px;
    font-size: 15px;
    border: 2px solid #E0E0E0;
    border-radius: var(--radius);
    transition: border-color 0.2s, box-shadow 0.2s;
    background: #FAFAFA;
}

.form-control:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.15);
    background: #fff;
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
}

textarea.form-control {
    resize: vertical;
    min-height: 80px;
}

/* BUTTONS */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
}

.btn-primary:hover { background: var(--primary-dark); }

.btn-success {
    background: var(--accent);
    color: #fff;
}

.btn-success:hover { background: var(--secondary); }

.btn-warning {
    background: var(--warning);
    color: #fff;
}

.btn-warning:hover { background: #F57C00; }

.btn-info {
    background: #0288D1;
    color: #fff;
}

.btn-info:hover { background: #01579B; }

.btn-danger {
    background: var(--danger);
    color: #fff;
}

.btn-danger:hover { background: #B71C1C; }

.btn-sm {
    padding: 6px 14px;
    font-size: 13px;
}

.btn-block {
    width: 100%;
    justify-content: center;
}

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

.btn-ghost:hover {
    background: var(--primary);
    color: #fff;
}

.btn-danger-ghost {
    background: transparent;
    color: var(--danger);
    border: 2px solid var(--danger);
}

.btn-danger-ghost:hover {
    background: var(--danger);
    color: #fff;
}

.btn-hollow {
    background: transparent;
    color: #194c4c;
    border: 2px solid #194c4c;
}

.btn-hollow:hover {
    background: #194c4c;
    color: #fff;
}

.mc-tabs {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    margin-bottom: 18px;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 0;
}

.mc-tab {
    padding: 10px 18px;
    border-radius: 8px 8px 0 0;
    font-weight: 600;
    font-size: 14px;
    color: #64748b;
    text-decoration: none;
    border: 1px solid transparent;
    border-bottom: none;
    transition: all 0.2s;
}

.mc-tab:hover {
    color: #194c4c;
    background: #f0fdfa;
}

.mc-tab.active {
    color: #fff;
    background: #194c4c;
    border-color: #194c4c;
}

/* SIDEBAR */
.layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: #fff;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    z-index: 100;
    overflow-y: auto;
}

.sidebar-logo {
    padding: 24px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    text-align: center;
}

.sidebar-logo h2 {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: 1px;
}

.sidebar-logo img.sidebar-logo-img {
    max-width: 78%;
    max-height: 60px;
    object-fit: contain;
    display: block;
    margin: 0 auto;
}

.sidebar-logo img.sidebar-logo-padrao {
    max-width: 130px;
}

.sidebar-logo small {
    color: var(--light);
    font-size: 11px;
}

.sidebar-logo small .assinatura-status {
    font-weight: 700;
    color: #fff;
}

.sidebar-nav {
    flex: 1;
    padding: 15px 0;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.sidebar-nav a:hover {
    background: rgba(255,255,255,0.1);
    color: #fff;
}

.sidebar-nav a.active {
    background: rgba(255,255,255,0.15);
    color: #fff;
    border-left-color: var(--accent);
    font-weight: 700;
}

.sidebar-nav a .icon {
    font-size: 18px;
    width: 24px;
    text-align: center;
}

.sidebar-nav a svg {
    width: 19px;
    height: 19px;
    flex-shrink: 0;
    color: rgba(255,255,255,0.8);
}

.sidebar-nav a:hover svg,
.sidebar-nav a.active svg {
    color: #fff;
}

.sidebar-user {
    padding: 15px 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
    background: rgba(0,0,0,0.15);
}

.sidebar-user .user-name {
    font-weight: 700;
    font-size: 13px;
}

.sidebar-user .user-role {
    font-size: 11px;
    color: var(--light);
}

.sidebar-user a {
    color: #FFCDD2;
    text-decoration: none;
    font-size: 12px;
    display: inline-block;
    margin-top: 5px;
}

.sidebar-user a:hover { color: #fff; }

/* ASSINATURA (badge dias restantes + modal de planos) */
.sidebar-assinatura {
    padding: 10px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.assinatura-box {
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.18);
    border-radius: 10px;
    padding: 10px 12px;
    text-align: center;
}

.assinatura-box.assinatura-urgente {
    background: rgba(198,40,40,0.35);
    border-color: #ff8a80;
    animation: assinaturaPisca 1.2s infinite;
}

.assinatura-box.assinatura-erro {
    background: rgba(198,40,40,0.45);
    border-color: #ff8a80;
}

@keyframes assinaturaPisca {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255,138,128,0.4); }
    50% { box-shadow: 0 0 0 5px rgba(255,138,128,0); }
}

.assinatura-titulo {
    font-weight: 700;
    font-size: 13px;
}

.assinatura-dias {
    font-size: 12px;
    color: var(--light);
    margin: 2px 0 8px;
}

.assinatura-btn {
    display: inline-block;
    background: #fff;
    color: var(--primary);
    border: none;
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
}

.assinatura-btn:hover { opacity: 0.9; }

/* Estrelas do formulario de cancelamento */
.estrelas-input { display: flex; gap: 4px; }
.estrelas-input .estrela {
  font-size: 28px;
  color: #ccc;
  cursor: pointer;
  transition: color .15s;
  user-select: none;
}
.estrelas-input .estrela:hover,
.estrelas-input .estrela.ativa { color: #f5a623; }

/* CIF — Diagnostico Cinesiologico Funcional */
.cif-resultado-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; border-bottom: 1px solid #eee;
  flex-wrap: wrap;
}
.cif-resultado-item:last-child { border-bottom: none; }
.cif-resultado-item:hover { background: #f5f5f5; }
.cif-resultado-item.cif-ja-selecionado { opacity: 0.55; }
.cif-resultado-codigo { min-width: 60px; color: var(--primary); }
.cif-resultado-desc { flex: 1; font-size: 0.9em; }
.cif-resultado-dom { width: 100%; font-size: 0.8em; color: #888; margin-top: -4px; }
.cif-selecionados { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.cif-chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: #e0f2f2; border: 1px solid #b2dfdb; border-radius: 6px;
  padding: 4px 8px; font-size: 0.85em;
}
.cif-chip-codigo { white-space: nowrap; }
.cif-chip-remove {
  background: none; border: none; color: #e53935; font-size: 16px;
  cursor: pointer; padding: 0 2px; line-height: 1;
}
.cif-chip-remove:hover { color: #c62828; }
.cif-ext-select { font-size: 0.8em; padding: 2px 4px; height: auto; }
.cif-visualizacao { display: flex; flex-direction: column; gap: 4px; }
.cif-item-readonly {
  padding: 4px 0; font-size: 0.9em; border-bottom: 1px solid #f0f0f0;
}
.cif-item-readonly:last-child { border-bottom: none; }
.cif-codigo-text { color: var(--primary); margin-right: 4px; }
.cif-ext-badge {
  display: inline-block; background: #fff3e0; color: #e65100;
  border-radius: 4px; padding: 0 4px; font-size: 0.8em; font-weight: 600;
}
.cif-campo-wrap {
  background: #f8fffe; border: 1px solid #b2dfdb; border-radius: 8px;
  padding: 14px; margin-top: 10px;
}
.cif-campo-header {
  display: flex; align-items: center; gap: 8px; margin-bottom: 10px;
  flex-wrap: wrap;
}
.cif-campo-header h4 { margin: 0; font-size: 1em; color: var(--primary); }
.cif-btn-gerar {
  background: #194c4c; color: #fff; border: none; border-radius: 6px;
  padding: 6px 12px; cursor: pointer; font-size: 0.85em; font-weight: 600;
  display: inline-flex; align-items: center; gap: 4px;
}
.cif-btn-gerar:hover { background: #0d3636; }
.cif-btn-gerar:disabled { opacity: 0.5; cursor: not-allowed; }
.cif-texto-livre {
  width: 100%; min-height: 60px; border: 1px solid #ccc; border-radius: 6px;
  padding: 8px; font-family: inherit; font-size: 0.9em; resize: vertical;
  margin-top: 8px;
}

.assinatura-erro .assinatura-btn,
.assinatura-urgente .assinatura-btn { background: var(--accent); color: #fff; }

.assinatura-atual {
    background: #e8f5e9;
    color: #2e7d32;
    border-radius: 10px;
    padding: 10px 14px;
    margin-bottom: 16px;
    font-size: 13px;
}

.planos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
}

.plano-card {
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 12px;
    padding: 16px;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.plano-card .btn { margin-top: auto; }

.plano-nome {
    font-weight: 800;
    font-size: 16px;
    color: var(--primary);
}

.plano-preco {
    font-size: 18px;
    font-weight: 700;
}

.plano-desc {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.5;
}

/* MAIN CONTENT */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    padding: 30px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

#content { flex: 1; }

.app-footer {
    margin-top: auto;
    text-align: center;
    padding: 18px 0 4px;
    font-size: 12px;
    color: var(--text-muted);
}
.app-footer .app-footer-info { margin-top: 4px; }
.app-footer a {
    color: var(--primary);
    text-decoration: underline;
    cursor: pointer;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.page-header h1 {
    font-size: 26px;
    color: var(--primary);
    font-weight: 800;
}

.page-header p {
    color: var(--text-muted);
    font-size: 14px;
}
.page-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}
.page-header-plus,
.page-header-clock { display: none; }
.page-header-desktop-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.bh-text-desktop { display: inline; }
.bh-text-mobile { display: none; }
.pac-text-desktop { display: inline; }
.pac-text-mobile { display: none; }
.crud-novo-desktop { display: inline; }
.crud-novo-mobile { display: none; }
.fich-btn-desktop { display: inline; }
.fich-btn-mobile { display: none; }
.pos-text-desktop { display: inline; }
.pos-text-mobile { display: none; }

/* STATS CARDS */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.stat-card {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: #fff;
    border-radius: var(--radius-lg);
    padding: 22px;
    box-shadow: var(--shadow);
}

.stat-card:nth-child(2) { background: linear-gradient(135deg, #1565C0, #1E88E5); }
.stat-card:nth-child(3) { background: linear-gradient(135deg, #00838F, #00ACC1); }
.stat-card:nth-child(4) { background: linear-gradient(135deg, #E65100, #FF9800); }

.stat-card .stat-number {
    font-size: 36px;
    font-weight: 800;
    line-height: 1;
}

.stat-card .stat-label {
    font-size: 13px;
    color: rgba(255,255,255,0.85);
    margin-top: 5px;
}

/* TOOLBAR */
.toolbar {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    align-items: center;
}

.toolbar .form-control {
    max-width: 250px;
}

.toolbar select.form-control {
    max-width: 220px;
}

/* TABLE */
.table-card {
    background: var(--card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.table-card .card-header {
    padding: 16px 16px 10px;
    margin-bottom: 0;
}

.table-responsive {
    overflow-x: auto;
}

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

table thead th {
    background: var(--lighter);
    color: var(--primary);
    font-weight: 700;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 14px 16px;
    text-align: left;
    border-bottom: 2px solid var(--light);
}

table tbody td {
    padding: 12px 16px;
    border-bottom: 1px solid #F0F0F0;
    font-size: 14px;
    vertical-align: middle;
}

table tbody tr:hover {
    background: var(--lighter);
}

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

.table-actions {
    display: flex;
    gap: 6px;
}

/* ALERTS */
.alert {
    padding: 12px 18px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-success {
    background: var(--lighter);
    color: var(--primary);
    border: 1px solid var(--light);
}

.alert-danger {
    background: #FFEBEE;
    color: var(--danger);
    border: 1px solid #FFCDD2;
}

.alert-warning {
    background: #FFF3E0;
    color: #E65100;
    border: 1px solid #FFE0B2;
}

.alert-info {
    background: #E3F2FD;
    color: #1565C0;
    border: 1px solid #BBDEFB;
}

.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: capitalize;
}

.badge.badge-success {
    background: var(--lighter);
    color: var(--primary);
    border: 1px solid var(--light);
}

.gcal-info {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}
.gcal-email {
    font-size: 11px;
    color: var(--text-muted, #888);
}

.badge.badge-warning {
    background: #FFF3E0;
    color: #E65100;
    border: 1px solid #FFE0B2;
}

.badge.badge-danger {
    background: #FFEBEE;
    color: var(--danger);
    border: 1px solid #FFCDD2;
}

.badge {
    background: var(--lighter);
    color: var(--primary);
    border: 1px solid var(--light);
}

.pagination {
    display: flex;
    gap: 6px;
    align-items: center;
    justify-content: center;
    padding: 14px 16px;
    flex-wrap: wrap;
}

.pagination a {
    display: inline-block;
    min-width: 32px;
    text-align: center;
    padding: 6px 10px;
    border: 1px solid #CBD5E1;
    border-radius: 8px;
    color: var(--primary);
    font-size: 13px;
    text-decoration: none;
}

.pagination a:hover { background: var(--lighter); }

.pagination a.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.editor-toolbar {
    display: flex;
    gap: 6px;
    align-items: center;
    padding: 8px;
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    border-radius: 8px 8px 0 0;
    flex-wrap: wrap;
}

.editor-toolbar button {
    min-width: 34px;
    padding: 5px 9px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
    font-size: 13px;
}

.editor-toolbar button:hover { background: #e2e8f0; }

.editor-toolbar input[type="color"] {
    width: 34px;
    height: 32px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 2px;
    cursor: pointer;
}


/* MODAL */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 10000;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: var(--card);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}

.modal-header {
    padding: 20px 25px;
    border-bottom: 1px solid #F0F0F0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-size: 18px;
    color: var(--primary);
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
}

.modal-close:hover { color: var(--danger); }

.modal-body {
    padding: 25px;
}

.modal-footer {
    padding: 15px 25px;
    border-top: 1px solid #F0F0F0;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* POPUP DO PDF NO DESKTOP (Abrir / Salvar / Salvar Como) */
.pdf-acao-botoes { display: grid; gap: 10px; }
.pdf-acao-botoes .btn { width: 100%; justify-content: center; }

/* BOAS-VINDAS E NOVIDADES */
.dicas-body { text-align: center; padding: 30px 25px; }
.dicas-body .dicas-icone { font-size: 56px; margin-bottom: 12px; }
.dicas-body h3 { margin: 0 0 8px; font-size: 20px; color: var(--text); }
.dicas-body p { margin: 0 auto 20px; color: var(--text-muted); line-height: 1.6; max-width: 480px; }
.dicas-dots { display: flex; justify-content: center; gap: 6px; margin-bottom: 10px; }
.dicas-dots span { width: 8px; height: 8px; border-radius: 50%; background: #d8dee9; transition: all .2s; }
.dicas-dots span.ativo { background: var(--primary); width: 24px; border-radius: 4px; }
.dicas-contador { font-size: 12px; color: #999; }
.dicas-checkbox { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-muted); cursor: pointer; margin-right: auto; }
.dicas-checkbox input { cursor: pointer; }
.novidades-body { padding: 25px; }
.novidades-versao-atual { margin: 0 0 18px; color: var(--text-muted); }
.novidades-versao-atual b { color: var(--primary); }
.novidade-item { border-left: 3px solid var(--primary); background: #f8fafc; padding: 12px 14px; border-radius: 8px; margin-bottom: 12px; text-align: left; }
.novidade-item .novidade-versao { display: block; font-weight: 700; font-size: 13px; color: var(--primary); margin-bottom: 4px; }
.novidade-item p { margin: 0; color: #444; line-height: 1.5; }

/* EMPTY STATE */
.empty-state {
    text-align: center;
    padding: 50px 20px;
    color: #999;
}

.empty-state .icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.empty-state h3 {
    font-size: 18px;
    color: #666;
    margin-bottom: 8px;
}

/* Menu toggle — hidden on desktop, visible on mobile */
.menu-toggle {
    display: none;
}

/* AGENDA — desktop: tabela visível, accordion oculto */
.agenda-accordion { display: none; }
/* PACIENTES — desktop: tabela visível, accordion oculto */
.pacientes-accordion { display: none; }
/* CRUD (Profissionais etc.) — desktop: tabela visível, accordion oculto */
.crud-accordion { display: none; }
/* FICHAS DE AVALIAÇÃO — desktop: tabela visível, accordion oculto */
.fichas-accordion { display: none; }
/* FICHAS (Avaliação) no prontuário do paciente — sanfona */
.fichas-acc { display: flex; flex-direction: column; gap: 8px; }
.fichas-acc-item { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: #fff; }
.fichas-acc-cab { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; background: #f3fafa; border: none; cursor: pointer; text-align: left; font-size: 14px; color: var(--texto); }
.fichas-acc-cab:hover { background: #e6f6f6; }
.fichas-acc-tit b { font-weight: 700; }
.fichas-acc-setinha { color: var(--primary); transition: transform .2s; flex: 0 0 auto; }
.fichas-acc-item.aberto .fichas-acc-setinha { transform: rotate(180deg); }
.fichas-acc-corpo { padding: 12px 14px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 10px; }
.fichas-acc-info { color: var(--muted); font-size: 13px; }
.fichas-acc-acoes { display: flex; flex-wrap: wrap; gap: 8px; }
/* AGENDAMENTOS DO PACIENTE (Meu Espaço) — sanfonas agrupadas por mês */
.pac-ag-group { margin-bottom: 14px; }
.pac-ag-group-header { font-weight: 700; color: var(--primary); margin: 6px 0 4px; font-size: 14px; }
.pac-ag-item { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: #fff; margin-bottom: 8px; }
.pac-ag-cab { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; background: #f3fafa; border: none; cursor: pointer; text-align: left; font-size: 14px; color: var(--texto); }
.pac-ag-cab:hover { background: #e6f6f6; }
.pac-ag-setinha { color: var(--primary); transition: transform .2s; flex: 0 0 auto; }
.pac-ag-item.aberto .pac-ag-setinha { transform: rotate(180deg); }
.pac-ag-corpo { padding: 12px 14px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 8px; }
.pac-ag-linha { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; }
.pac-ag-linha span { color: var(--muted); }
.pac-ag-paginacao { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 12px; }
.pac-ag-pag-info { font-size: 13px; color: var(--muted); }
/* HISTÓRICO FISIA — desktop: grade visível, acordeão oculto */
.hist-mobile-accordion { display: none; }

/* LINKS de telefone/e-mail (WhatsApp / mailto) em todo o app */
.link-app {
    color: var(--primary);
    text-decoration: underline;
    text-decoration-style: dotted;
    text-underline-offset: 2px;
}
.link-app:hover { opacity: 0.75; }

/* Editor de fichas - base (desktop); as regras mobile estao no media query */
.fich-campo-acc { margin-bottom: 8px; }
.fich-campo-cab { display: none; }
.fich-campo-acc.inativa { opacity: 0.55; }
.fich-campo-tag-inativo { font-style: normal; font-weight: 400; font-size: 12px; }
.fich-campo-corpo .form-group label { font-size: 12px; }
.fich-campo-ativo .chave-switch { vertical-align: middle; }
#modalCampoNovo { z-index: 10010; }

/* RESPONSIVE */
@media (max-width: 768px) {
    .sidebar {
        width: 56px;
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        z-index: 1000;
        align-items: center;
        overflow: hidden;
    }
    .sidebar-logo {
        text-align: center;
        position: sticky;
        top: 0;
        z-index: 20;
        background: var(--primary);
        padding: 12px 0;
        width: 100%;
    }
    .sidebar-logo h2 {
        font-size: 15px;
        letter-spacing: 0;
        margin: 0;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        padding: 0 4px;
    }
    .sidebar-logo small {
        display: none;
    }
    .sidebar-logo img.sidebar-logo-padrao {
        max-width: 60%;
        max-height: 28px;
    }
    .sidebar-logo .sidebar-logo-img + h2 {
        display: none;
    }
    .menu-toggle {
        display: flex !important;
        justify-content: center;
        align-items: center;
        background: none;
        border: none;
        color: rgba(255,255,255,0.7);
        cursor: pointer;
        padding: 12px 0;
        margin: 0;
        width: 100%;
    }
    .menu-toggle:active {
        color: #fff;
    }
    .sidebar-assinatura {
        display: none;
    }
    .sidebar-nav {
        padding: 4px 0;
        flex: 1;
        width: 100%;
        min-height: 0;
        overflow-y: auto;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
        scrollbar-color: rgba(255,255,255,0.25) transparent;
    }
    .sidebar-nav::-webkit-scrollbar { width: 3px; }
    .sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.25); border-radius: 2px; }
    .sidebar-nav::-webkit-scrollbar-track { background: transparent; }
    .sidebar-nav a {
        padding: 12px 0;
        justify-content: center;
        flex-direction: column;
        gap: 0;
        font-size: 0;
        border-left: none;
        border-bottom: 1px solid rgba(255,255,255,0.06);
    }
    .sidebar-nav a .nav-label {
        display: none;
        font-size: 11px;
        font-weight: 400;
        white-space: nowrap;
    }
    .sidebar-nav a svg {
        width: 22px;
        height: 22px;
        color: rgba(255,255,255,0.7);
        stroke-width: 1.5;
        flex-shrink: 0;
    }
    .sidebar-nav a.active svg {
        color: #fff;
    }
    .sidebar-nav a.active {
        border-left-color: transparent;
        background: rgba(255,255,255,0.12);
    }
    .sidebar-user {
        padding: 8px 0;
        text-align: center;
        width: 100%;
        border-top: 1px solid rgba(255,255,255,0.1);
        background: rgba(0,0,0,0.15);
    }
    .sidebar-user .user-name,
    .sidebar-user .user-role,
    .sidebar-user a {
        display: none;
    }

    .sidebar.sidebar-expanded {
        width: 240px;
        align-items: stretch;
        position: fixed;
        z-index: 1000;
    }
    .sidebar.sidebar-expanded .sidebar-logo {
        text-align: center;
    }
    .sidebar.sidebar-expanded .sidebar-logo h2 {
        font-size: 22px;
        letter-spacing: 1px;
    }
    .sidebar.sidebar-expanded .sidebar-logo small {
        display: block;
        color: var(--light);
        font-size: 11px;
    }
    .sidebar.sidebar-expanded .sidebar-logo .sidebar-logo-img + h2 {
        display: block;
    }
    .sidebar.sidebar-expanded .menu-toggle {
        transform: rotate(180deg);
    }
    .sidebar.sidebar-expanded .sidebar-nav {
        padding: 10px 0;
    }
    .sidebar.sidebar-expanded .sidebar-nav a {
        padding: 12px 20px;
        justify-content: flex-start;
        flex-direction: row;
        font-size: 14px;
        border-bottom: none;
        border-left: 3px solid transparent;
        gap: 12px;
    }
    .sidebar.sidebar-expanded .sidebar-nav a .nav-label {
        display: inline;
    }
    .sidebar.sidebar-expanded .sidebar-nav a svg {
        width: 19px;
        height: 19px;
    }
    .sidebar.sidebar-expanded .sidebar-nav a.active {
        border-left-color: var(--accent);
    }
    .sidebar.sidebar-expanded .sidebar-user {
        padding: 15px 20px;
        text-align: left;
    }
    .sidebar.sidebar-expanded .sidebar-user .user-name,
    .sidebar.sidebar-expanded .sidebar-user .user-role,
    .sidebar.sidebar-expanded .sidebar-user a {
        display: block;
    }
    .main-content {
        margin-left: 56px;
        width: calc(100% - 56px);
        padding: 16px;
        position: relative;
    }
    .main-content::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0,0,0,0.4);
        backdrop-filter: blur(3px);
        -webkit-backdrop-filter: blur(3px);
        z-index: 999;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.2s ease;
    }
    .sidebar.sidebar-expanded ~ .main-content::before {
        opacity: 1;
        pointer-events: auto;
    }
    .sidebar.sidebar-expanded ~ .main-content {
        margin-left: 56px;
        width: calc(100% - 56px);
    }
    .layout {
        flex-direction: row;
    }
.stats-grid {
        grid-template-columns: 1fr 1fr;
    }
    #finCards {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    #finCards .stat-card {
        min-width: 0;
    }
    .page-header {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        flex-wrap: wrap;
    }
    .page-header h1 { font-size: 20px; }
    .page-header > div:first-child { flex: 1; min-width: 0; }
    .page-header-actions { gap: 6px; margin-left: auto; }
    .page-header-plus,
    .page-header-clock { display: inline-flex; }
    .page-header-desktop-btns { display: none; }
    .page-header-plus { background: var(--primary); color: #fff; border-radius: var(--radius); padding: 6px 10px; }
    .page-header-plus:hover { opacity: 0.9; }
    .page-header-clock { background: var(--light); color: var(--primary); border-radius: var(--radius); padding: 6px 10px; }
    #gcalBadge {
        flex-basis: 100%;
        flex-shrink: 0;
        order: 99;
        text-align: center;
        margin-top: 10px;
    }
    #gcalBadge .btn,
    #gcalBadge .gcal-info {
        width: 100%;
        justify-content: center;
    }
    .gcal-text-desktop { display: inline; }
    .gcal-text-mobile { display: none; }
    .toolbar {
        flex-direction: column;
        gap: 8px;
    }
    .toolbar .form-control,
    .toolbar select.form-control {
        max-width: 100%;
    }
    .toolbar.bh-filtros {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 6px;
        align-items: stretch;
    }
    .toolbar.bh-filtros > *:first-child {
        flex: 1 1 100%;
    }
    .toolbar.bh-filtros > select.form-control {
        flex: 1 1 calc(33.333% - 4px);
        min-width: 0;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .pront-doc-btns {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 10px;
        width: 100%;
        box-sizing: border-box;
        padding: 0 12px;
    }
    .pront-doc-btns .btn {
        width: 100%;
        margin: 0;
        box-sizing: border-box;
    }
    #modalDocumento .modal-footer {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 10px;
        padding: 15px 18px;
        justify-content: stretch;
    }
    #modalDocumento .modal-footer .btn {
        width: 100%;
        margin: 0;
        box-sizing: border-box;
        justify-content: center;
    }
    #modalVerAvaliacao .modal-footer {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 10px;
        padding: 15px 18px;
        justify-content: stretch;
    }
    #modalVerAvaliacao .modal-footer .btn {
        width: 100%;
        margin: 0;
        box-sizing: border-box;
        justify-content: center;
    }
    #modalAgDetalhes .modal-footer {
        display: grid;
        grid-template-columns: 1fr;
        gap: 10px;
        padding: 15px 18px;
        justify-content: stretch;
    }
    #modalAgDetalhes .modal-footer .btn {
        width: 100%;
        margin: 0;
        box-sizing: border-box;
        justify-content: center;
        white-space: normal;
    }
    #modalAgDetalhes .ag-acc-linha {
        word-break: break-word;
    }
    .app-footer {
        font-size: 10px;
        padding: 12px 8px 4px;
    }
    .gcal-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
    }
    .gcal-text-desktop { display: none; }
    .gcal-text-mobile { display: inline; }
    .bh-text-desktop { display: none; }
    .bh-text-mobile { display: inline; }
    .page-header .bh-text-mobile {
        margin-left: auto;
    }
    .pac-text-desktop { display: none; }
    .pac-text-mobile { display: inline; }
    .agenda-nav {
        flex-direction: row;
        align-items: center;
        justify-content: center;
        gap: 4px;
        flex-wrap: nowrap;
    }
    .agenda-nav-btns { display: contents; }
    .ag-nav-label { display: none; }
    .ag-nav-prev { order: 0; }
    .agenda-nav-cal {
        border: none;
        width: auto;
        height: auto;
        padding: 2px;
        background: transparent;
        flex-shrink: 0;
        order: 1;
    }
    .ag-nav-next { order: 2; }
    .agenda-dia-titulo {
        font-size: 14px;
        text-align: center;
        white-space: nowrap;
        order: 3;
    }
    .tabela-somente-desktop { display: none; }
    .agenda-accordion { display: block; }
    .pacientes-accordion { display: block; }
    .crud-accordion { display: block; }
    .fichas-accordion { display: block; }
    .hist-mobile-accordion { display: block; }
    .fich-btn-desktop { display: none; }
    .fich-btn-mobile { display: inline; }
    .fich-campo-acc {
        border-bottom: 1px solid #cfe8db;
        margin-bottom: 0;
        padding: 2px 0;
    }
    .fich-campo-acc:last-child { border-bottom: none; }
    .fich-campo-cab {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 12px 4px;
        cursor: pointer;
    }
    .fich-campo-cab-nome {
        flex: 1;
        min-width: 0;
        font-size: 14px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .fich-campo-cab .crud-acc-seta { flex-shrink: 0; }
    .fich-campo-acc.open .crud-acc-seta { transform: rotate(180deg); }
    .fich-campo-corpo { display: none; padding: 4px 4px 14px; }
    .fich-campo-acc.open .fich-campo-corpo { display: block; }
    .fich-campo-corpo .form-group { margin-bottom: 10px !important; }
    .fich-campos-regiao {
        max-height: 42vh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        padding-right: 2px;
    }
    .fich-campos-acoes {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        margin-top: 10px;
    }
    .crud-novo-desktop { display: none; }
    .crud-novo-mobile { display: inline; }
    .post-nova-grid {
        display: flex;
        gap: 8px;
        align-items: flex-end;
    }
    .post-nova-grid .form-group:first-child { flex: 1; min-width: 0; margin: 0; }
    .post-nova-grid .form-group:last-child { flex-shrink: 0; margin: 0; }
    #btnNovaPost { padding-left: 12px; padding-right: 12px; white-space: nowrap; }
    .pos-label-desktop { display: none; }
    .pos-text-desktop { display: none; }
    .pos-text-mobile { display: inline; }
    .post-acordeao-vista {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
    .post-acordeao-vista-botoes {
        width: 100%;
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
    }
    .post-acordeao-vista-botoes .btn {
        font-size: 12px;
        padding: 6px 8px;
        width: 100%;
        box-sizing: border-box;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}

/* AGENDA ACCORDION */
.ag-acc-item {
    background: var(--lighter);
    border-radius: var(--radius);
    margin-bottom: 8px;
    overflow: hidden;
}
.ag-acc-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    cursor: pointer;
    user-select: none;
}
.ag-acc-hora {
    min-width: 50px;
    color: var(--primary);
}
.ag-acc-nome {
    flex: 1;
    font-weight: 600;
    font-size: 14px;
}
.ag-acc-seta {
    color: var(--text-muted, #999);
    font-size: 14px;
    transition: none;
}
.ag-acc-item.open .ag-acc-seta { transform: rotate(180deg); }
.ag-acc-detalhes {
    display: none;
    padding: 0 14px 14px;
    border-top: 1px solid var(--light);
}
.ag-acc-item.open .ag-acc-detalhes { display: block; }
.ag-acc-linha {
    padding: 8px 0;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    font-size: 13px;
}
.ag-acc-linha:last-child { border-bottom: none; }
.ag-acc-acoes {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    padding-top: 10px;
}
.ag-acc-acoes .form-control { flex: 1; min-width: 120px; }
.ag-acc-acoes .btn { flex-shrink: 0; }

/* PACIENTES ACCORDION */
.pac-acc-item {
    background: var(--lighter);
    border-radius: var(--radius);
    margin-bottom: 8px;
    overflow: hidden;
}
.pac-acc-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    cursor: pointer;
    user-select: none;
}
.pac-acc-nome {
    flex: 1;
    font-size: 14px;
}
.pac-acc-seta {
    color: var(--text-muted, #999);
    font-size: 14px;
    transition: none;
}
.pac-acc-item.open .pac-acc-seta { transform: rotate(180deg); }
.pac-acc-detalhes {
    display: none;
    padding: 0 14px 14px;
    border-top: 1px solid var(--light);
    font-size: 13px;
    line-height: 1.6;
    color: var(--text-muted, #666);
}
.pac-acc-item.open .pac-acc-detalhes { display: block; }
.pac-acc-detalhes .table-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.pac-acc-detalhes .table-actions .btn {
    font-size: 12px;
    padding: 4px 8px;
}

/* CRUD ACCORDION (Profissionais etc.) */
.crud-acc-item {
    background: var(--lighter);
    border-radius: var(--radius);
    margin-bottom: 8px;
    overflow: hidden;
}
.crud-acc-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    cursor: pointer;
    user-select: none;
}
.crud-acc-nome { flex: 1; font-size: 14px; }
.fin-acc-desc { display: block; font-size: 12px; font-weight: normal; color: var(--text-muted, #888); margin-top: 2px; }
.crud-acc-seta {
    color: var(--text-muted, #999);
    transition: none;
}
.crud-acc-item.open .crud-acc-seta { transform: rotate(180deg); }
.crud-acc-detalhes {
    display: none;
    padding: 0 14px 14px;
    border-top: 1px solid var(--light);
    font-size: 13px;
}
.crud-acc-item.open .crud-acc-detalhes { display: block; }
.crud-acc-linha {
    padding: 8px 0;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}
.crud-acc-linha:last-of-type { border-bottom: none; }
.crud-acc-label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted, #888);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
}
.crud-acc-valor { word-break: break-word; }
.crud-acc-detalhes .table-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.crud-acc-detalhes .table-actions .btn {
    font-size: 12px;
    padding: 4px 8px;
}

/* QUICK ACTIONS */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    margin-top: 25px;
}

.quick-action {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: var(--lighter);
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--primary);
    font-weight: 600;
    font-size: 14px;
    transition: all 0.2s;
    border: 2px solid transparent;
}

.quick-action:hover {
    background: var(--light);
    border-color: var(--accent);
    transform: translateY(-1px);
}

.quick-action .icon {
    font-size: 22px;
}

/* FISIA - Assistente de Diagnosticos e Tratamentos */
.fisia-wrap {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    /* Deixa "passar" os cliques para o conteúdo atrás (ex.: sanfona das
       Avaliações perto do canto inferior). O box da janela/botão continuaria
       transparente e bloquearia o toque; os filhos reativam abaixo. */
    pointer-events: none;
}
.fisia-btn {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: #fff;
    border: 4px solid var(--accent);
    box-shadow: var(--shadow-lg);
    cursor: pointer;
    padding: 6px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
    pointer-events: auto;
}
.fisia-btn:hover { transform: scale(1.06); }
.fisia-btn img { width: 100%; height: 100%; object-fit: contain; border-radius: 50%; }
.fisia-balloon {
    background: #fff;
    border: 1px solid var(--lighter);
    border-radius: 14px;
    padding: 12px 16px;
    margin-bottom: 12px;
    max-width: 300px;
    font-size: 13px;
    color: var(--text);
    box-shadow: var(--shadow-lg);
    position: relative;
    opacity: 0;
    transform: translateY(8px);
    pointer-events: none;
    transition: all 0.3s;
}
.fisia-balloon::after {
    content: '';
    position: absolute;
    bottom: -8px;
    right: 28px;
    width: 14px;
    height: 14px;
    background: #fff;
    border-right: 1px solid var(--lighter);
    border-bottom: 1px solid var(--lighter);
    transform: rotate(45deg);
}
.fisia-balloon.show { opacity: 1; transform: translateY(0); pointer-events: auto; }
.fisia-balloon-close {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 12px;
    line-height: 1;
}
.fisia-window {
    position: fixed;
    bottom: 110px;
    right: 24px;
    width: 380px;
    max-width: calc(100vw - 32px);
    height: 540px;
    max-height: calc(100vh - 150px);
    background: #fff;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    transform: translateY(12px) scale(0.98);
    pointer-events: none;
    transition: all 0.25s;
}
.fisia-window.open { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }
.fisia-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: #fff;
}
.fisia-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: #fff;
    border: 3px solid var(--accent);
    padding: 3px;
    flex-shrink: 0;
}
.fisia-avatar img { width: 100%; height: 100%; object-fit: contain; border-radius: 50%; }
.fisia-header-info { flex: 1; }
.fisia-header-info strong { display: block; font-size: 15px; }
.fisia-header-info small { font-size: 11px; opacity: 0.85; }
.fisia-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 22px;
    cursor: pointer;
    line-height: 1;
    padding: 0 4px;
}
.fisia-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    background: var(--bg);
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.fisia-msg {
    max-width: 82%;
    padding: 10px 12px;
    border-radius: 12px;
    font-size: 13px;
    line-height: 1.5;
    white-space: pre-wrap;
    word-wrap: break-word;
}
.fisia-msg strong { font-weight: 700; }
.fisia-msg code { background: rgba(0,0,0,0.06); padding: 1px 5px; border-radius: 4px; font-size: 12px; }
.fisia-msg.user { align-self: flex-end; background: var(--primary); color: #fff; border-bottom-right-radius: 3px; }
.fisia-msg.fisia-ia { align-self: flex-start; background: #fff; color: var(--text); border: 1px solid var(--lighter); border-bottom-left-radius: 3px; }
.fisia-caret {
    display: inline-block;
    width: 2px;
    height: 14px;
    margin-left: 2px;
    vertical-align: -2px;
    background: var(--accent);
    animation: fisia-caret 0.8s step-end infinite;
}
@keyframes fisia-caret { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }
.fisia-input-area {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px;
    border-top: 1px solid var(--lighter);
    background: #fff;
}
.fisia-input-area input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid var(--lighter);
    border-radius: 20px;
    font-size: 13px;
    outline: none;
    font-family: inherit;
}
.fisia-input-area input:focus { border-color: var(--accent); }
.fisia-input-area button {
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 20px;
    padding: 0 16px;
    font-size: 13px;
    cursor: pointer;
    font-family: inherit;
}
.fisia-input-area button:hover { background: var(--primary); }
.fisia-dots { display: inline-flex; gap: 4px; }
.fisia-dots span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--accent);
    animation: fisia-blink 1.2s infinite;
}
.fisia-dots span:nth-child(2) { animation-delay: 0.2s; }
.fisia-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes fisia-blink {
    0%, 80%, 100% { opacity: 0.3; }
    40% { opacity: 1; }
}

/* FISIA - anexos e voz */
.fisia-input-row { display: flex; gap: 6px; align-items: center; width: 100%; }
.fisia-input-row input[type="text"] { flex: 1; min-width: 0; }
.fisia-icon-btn, .fisia-send-btn {
    width: 32px; height: 32px; border-radius: 50%; border: none;
    background: transparent !important; color: #194c4c !important; font-size: 16px; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; transition: all .2s; padding: 0;
}
.fisia-icon-btn svg, .fisia-send-btn svg { width: 22px !important; height: 22px !important; }
.fisia-icon-btn.gravando { background: #ef4444; color: #fff; animation: fisiaPulse 1s infinite; }
@keyframes fisiaPulse { 0%,100% { box-shadow: 0 0 0 0 rgba(239,68,68,.45); } 50% { box-shadow: 0 0 0 8px rgba(239,68,68,0); } }
.fisia-anexos-preview { display: flex; flex-direction: column; gap: 6px; padding: 4px 0 6px; }
.fisia-anexos-preview:empty { display: none; padding: 0; }
.fisia-anexo-item {
    display: flex; align-items: center; gap: 5px; background: var(--light);
    border-radius: 16px; padding: 3px 8px 3px 4px; font-size: 11px; color: var(--text);
}
.fisia-anexo-item.fisia-anexo-oculto { display: none; }
.fisia-anexo-thumb-preview { width: 26px; height: 26px; object-fit: cover; border-radius: 6px; }
.fisia-anexo-icon { display: flex; align-items: center; margin-left: 4px; color: var(--text); }
.fisia-anexo-nome { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fisia-anexo-remove { background: none; border: none; color: #999; font-size: 15px; cursor: pointer; padding: 0 2px; line-height: 1; }
.fisia-anexo-remove:hover { color: #ef4444; }
.fisia-anexo-mais {
    align-self: flex-start; border: none; cursor: pointer;
    background: var(--primary, #194c4c); color: #fff;
    border-radius: 12px; padding: 4px 12px; font-size: 11px; font-weight: 700;
}
.fisia-anexo-mais:hover { background: var(--accent, #339999); }
.fisia-anexos-msg { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; align-items: center; }
.fisia-anexo-thumb { max-width: 130px; max-height: 130px; border-radius: 8px; object-fit: cover; }
.fisia-anexo-badge {
    display: inline-flex; align-items: center; gap: 4px;
    background: rgba(255,255,255,.25); color: #fff;
    padding: 3px 10px; border-radius: 12px; font-size: 11px;
}
.fisia-anexo-badge svg { flex-shrink: 0; }
.fisia-msg.fisia-ia .fisia-anexo-badge { background: var(--light); color: var(--text); }

/* ---- classes complementares (modulos web) ---- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 20px; margin-bottom: 20px; }
.card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.card-header h3 { margin: 0; }
.card-divider { height: 1px; background: var(--light); border: 0; margin: 20px 0; }
.form-check { display: flex; align-items: center; gap: 8px; }
.form-check label { display: flex; align-items: center; gap: 8px; cursor: pointer; margin: 0; }
.text-success { color: #2e7d32; font-weight: 600; }
.text-danger { color: #c62828; font-weight: 600; }
.modal-lg { max-width: 720px; }
.agenda-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.agenda-nav-btns { display: flex; align-items: center; gap: 10px; order: 1; }
.agenda-nav-date {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    padding: 0;
    border: 0;
    pointer-events: none;
}
.agenda-nav-cal {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 1.5px solid #305b5b;
    border-radius: 6px;
    background: transparent;
    color: #305b5b;
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
}
.agenda-nav-cal:hover { background: rgba(48, 91, 91, 0.08); }
.agenda-dia-titulo { font-weight: 600; text-transform: capitalize; font-size: 15px; }
.agenda-vista-btns { display: flex; gap: 4px; order: 0; }
.agenda-vista-btns .btn { padding: 6px 14px; font-size: 13px; border-radius: 20px; }

@media (max-width: 768px) {
    .agenda-nav { flex-direction: column; align-items: stretch; }
    .agenda-vista-btns { width: 100%; }
    .agenda-vista-btns .btn { flex: 1; text-align: center; }
    .agenda-dia-titulo { order: 1; font-size: 14px; text-align: center; white-space: nowrap; }
    .agenda-nav-btns { display: flex; order: 2; justify-content: center; align-items: center; }
      .ag-nav-prev { order: 0; }
      .agenda-nav-cal { order: 1; }
      .ag-nav-next { order: 2; }
      /* Acordeão Mês no mobile: distinguir níveis */
      .agenda-accordion .ag-acc-item--semana > .ag-acc-header {
          background: #e6f3ff;
          color: #0f6ab4;
      }
      .agenda-accordion .ag-acc-item--dia > .ag-acc-header {
          background: #f0f9f0;
          color: #2f7d32;
      }
      .agenda-accordion .ag-acc-item--semana > .ag-acc-header .ag-acc-seta svg,
      .agenda-accordion .ag-acc-item--dia > .ag-acc-header .ag-acc-seta svg {
          stroke: currentColor;
      }
      .agenda-accordion .ag-acc-item--dia > .ag-acc-detalhes {
          padding-left: 10px;
      }
  }

/* ============ CALENDARIO SEMANA/MES ============ */
.ag-cal-semana { margin-top: 16px; border: 1px solid var(--border, #e2e8f0); border-radius: 10px; overflow: hidden; background: #fff; }
.ag-cal-header { display: grid; grid-template-columns: 56px repeat(7, 1fr); background: #f8fafb; border-bottom: 1px solid var(--border, #e2e8f0); }
.ag-cal-hora-col { width: 56px; }
.ag-cal-dia-header { padding: 8px 4px; text-align: center; font-size: 13px; border-left: 1px solid var(--border, #e2e8f0); }
.ag-cal-dia-header b { display: block; color: var(--text-muted, #6b7b80); font-size: 11px; text-transform: uppercase; }
.ag-cal-dia-header span { font-weight: 700; color: var(--primary, #194c4c); }
.ag-cal-dia-header.hoje { background: #e8f5f3; }
.ag-cal-body { max-height: 520px; overflow-y: auto; }
.ag-cal-linha { display: grid; grid-template-columns: 56px repeat(7, 1fr); min-height: 44px; border-bottom: 1px solid #f0f0f0; }
.ag-cal-hora { font-size: 11px; color: var(--text-muted, #6b7b80); padding: 4px 6px; text-align: right; border-right: 1px solid var(--border, #e2e8f0); }
.ag-cal-celula { border-left: 1px solid #f0f0f0; padding: 2px; min-height: 44px; display: flex; flex-direction: column; gap: 2px; }
.ag-cal-evt { font-size: 11px; color: #fff; border-radius: 4px; padding: 2px 5px; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ag-cal-evt b { font-weight: 700; }

.ag-cal-mes { margin-top: 16px; border: 1px solid var(--border, #e2e8f0); border-radius: 10px; overflow: hidden; background: #fff; }
.ag-cal-mes-titulo { padding: 12px 16px; font-size: 16px; font-weight: 700; color: var(--primary, #194c4c); background: #f8fafb; border-bottom: 1px solid var(--border, #e2e8f0); text-align: center; }
.ag-cal-mes-dias { display: grid; grid-template-columns: repeat(7, 1fr); }
.ag-cal-mes-dow { padding: 8px 4px; text-align: center; font-size: 11px; font-weight: 700; color: var(--text-muted, #6b7b80); text-transform: uppercase; background: #f8fafb; border-bottom: 1px solid var(--border, #e2e8f0); }
.ag-cal-mes-celula { min-height: 80px; border: 1px solid #f0f0f0; padding: 4px; cursor: pointer; transition: background 0.15s; }
.ag-cal-mes-celula:hover { background: #f0faf9; }
.ag-cal-mes-celula.vazia { background: #fafafa; cursor: default; }
.ag-cal-mes-celula.hoje { background: #e8f5f3; }
.ag-cal-mes-num { font-size: 13px; font-weight: 700; color: var(--primary, #194c4c); margin-bottom: 3px; }
.ag-cal-mes-evt { font-size: 10px; color: #fff; border-radius: 3px; padding: 1px 4px; margin-bottom: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ag-cal-mes-mais { font-size: 10px; color: var(--text-muted, #6b7b80); font-weight: 600; }
@media (max-width: 768px) { .ag-cal-semana { display: none; } }
.ag-status-cancelado td { opacity: 0.5; text-decoration: line-through; }
.ag-status-concluido td { opacity: 0.7; }
.ag-status-sel { min-width: 130px; padding: 4px 8px; font-size: 13px; }
.table-actions { display: flex; gap: 6px; align-items: center; justify-content: flex-end; }
.sig-img, .img-thumb {
    max-height: 40px;
    max-width: 110px;
    display: inline-block;
    vertical-align: middle;
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 4px;
    padding: 2px;
}
.sig-thumb { display: inline-block; vertical-align: middle; }
.muted { color: var(--muted); font-size: 13px; }
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.badge-agendado { background: #e3f2fd; color: #1565c0; }
.badge-confirmado { background: #e8f5e9; color: #2e7d32; }
.badge-em_andamento { background: #fff3e0; color: #e65100; }
.badge-concluido { background: #f3e5f5; color: #6a1b9a; }
.badge-faltou { background: #ffebee; color: #c62828; }
.badge-cancelado { background: #eceff1; color: #546e7a; }
.badge-admin { background: #e8eaf6; color: #283593; }
.badge-super_admin { background: #fce4ec; color: #880e4f; }
.badge-profissional { background: #e0f7fa; color: #00695c; }
.badge-recepcionista { background: #efebe9; color: #4e342e; }
.badge-paciente { background: #eceff1; color: #37474f; }
.form-readonly { padding: 9px 12px; border: 1px solid var(--border); border-radius: 8px; background: #f5f7f7; color: var(--texto); font-size: 14px; }

/* ---- toasts (avisos globais) ---- */
.toast {
  position: fixed;
  top: 24px;
  bottom: auto;
  left: 50%;
  transform: translateX(-50%) translateY(-12px);
  background: #2e7d32;
  color: #fff;
  padding: 12px 20px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 6px 24px rgba(0,0,0,.2);
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s ease, transform .3s ease;
  z-index: 30000;
  max-width: 90vw;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast-danger { background: #c62828; }
.toast-warning { background: #e65100; }

/* ---- documento da Avaliação Postural (impressão) ---- */
#printDoc {
  display: none;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  color: #222;
  background: #ffffff;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}
@media print {
  html, body { background: #ffffff !important; }
  body > *:not(#printDoc) { display: none !important; }
  #printDoc { display: block !important; background: #ffffff !important; -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }
  #printDoc img { max-width: 100%; }
}
#printDoc .doc-header {
  display: flex;
  align-items: center;
  gap: 16px;
  border-bottom: 3px solid #194c4c;
  padding-bottom: 12px;
  margin-bottom: 16px;
}
#printDoc .doc-logo { max-height: 48px; max-width: 96px; object-fit: contain; }
#printDoc .doc-clinica h1 { font-size: 20px; color: #194c4c; margin: 0; }
#printDoc .doc-clinica p { margin: 2px 0 0; font-size: 12px; color: #555; }
#printDoc .doc-titulo {
  text-align: center;
  font-size: 15px;
  color: #333;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin: 0 0 10px;
}
#printDoc .doc-datahora {
  text-align: center;
  background: #ebf7f4;
  color: #194c4c;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13px;
  margin-bottom: 14px;
}
#printDoc .doc-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}
#printDoc .doc-cards .stat-card {
  border: 1px solid #194c4c;
  border-radius: 8px;
  background: #f0faf9;
  padding: 10px 12px;
  text-align: center;
}
#printDoc .doc-cards .stat-number {
  font-size: 18px;
  font-weight: 800;
  color: #194c4c;
  white-space: nowrap;
}
#printDoc .doc-cards .stat-label {
  font-size: 11px;
  color: #555;
  margin-top: 2px;
}
#printDoc .doc-donuts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 14px;
}
#printDoc .doc-secao-titulo {
  font-size: 13px;
  font-weight: 800;
  color: #194c4c;
  text-transform: uppercase;
  letter-spacing: .4px;
  margin: 0 0 8px;
}
#printDoc .doc-tabela {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  margin-bottom: 8px;
}
#printDoc .doc-tabela th,
#printDoc .doc-tabela td {
  border: 1px solid #ddd;
  padding: 6px 8px;
  text-align: left;
}
#printDoc .doc-tabela th {
  background: #ebf7f4;
  color: #194c4c;
}
#printDoc .doc-tabela-valor {
  text-align: right;
  white-space: nowrap;
}
#printDoc .doc-tabela .doc-total td {
  font-weight: 800;
  background: #f0faf9;
}
#printDoc .doc-footer {
  margin-top: 18px;
  padding-top: 12px;
  border-top: 1px solid #ccc;
  font-size: 12px;
  text-align: center;
  color: #555;
}
#printDoc .doc-gerado {
  margin-bottom: 4px;
}
#printDoc .doc-fisio {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-weight: 700;
  color: #194c4c;
}
#printDoc .doc-fisio-logo {
  width: 48px;
  height: 48px;
  object-fit: contain;
}
#printDoc .doc-emitido {
  margin-top: 4px;
  font-size: 11px;
}
#printDoc .doc-paciente {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 24px;
  font-size: 13px;
  border-bottom: 1px solid #ddd;
  padding-bottom: 12px;
  margin-bottom: 14px;
}
#printDoc .doc-paciente p { margin: 0; }
#printDoc .doc-laudo {
  border: 1px solid #194c4c;
  border-radius: 8px;
  background: #f0faf9;
  padding: 12px 14px;
  margin-bottom: 16px;
}
#printDoc .doc-laudo-titulo {
  font-weight: 800;
  font-size: 13px;
  color: #194c4c;
  text-transform: uppercase;
  letter-spacing: .4px;
  margin-bottom: 6px;
}
#printDoc .doc-laudo-corpo {
  font-size: 12.5px;
  line-height: 1.6;
  color: #22303c;
  white-space: normal;
}
#printDoc .doc-laudo-pag {
  page-break-after: always;
}
#printDoc .doc-foto {
  text-align: center;
  margin-bottom: 14px;
}
#printDoc .doc-foto img {
  max-width: 100mm;
  max-height: 100mm;
  border: 1px solid #ddd;
  border-radius: 6px;
}
#printDoc .doc-medidas {
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 10px;
  margin-bottom: 10px;
  font-size: 10px;
}
#printDoc .doc-medidas h3 { margin: 0 0 6px; font-size: 12px; color: #194c4c; }
#printDoc .doc-medidas table { width: 100%; border-collapse: collapse; }
#printDoc .doc-medidas td {
  padding: 1.5px 6px;
  border-bottom: 1px solid #f0f0f0;
}
#printDoc .doc-medidas td:last-child { text-align: right; }
#printDoc .doc-assimetrias { color: #b04a12; font-weight: 600; margin: 6px 0 0; }
#printDoc .doc-ok { color: #2e7d32; font-weight: 600; margin: 6px 0 0; }
#printDoc .doc-qualidade { color: #555; font-size: 10px; margin: 6px 0 0; }

/* Dicas da avaliação postural (abaixo da linha de adição de pontos) */
.post-mid { display: block; }
.post-dicas {
  margin: 8px 0 0;
  padding: 8px 12px;
  background: #fdf6e3;
  border-left: 3px solid #e6c200;
  border-radius: 6px;
  color: #5c4d00;
  font-size: 12.5px;
  line-height: 1.5;
}
.post-dicas b { color: #8a7300; }
.post-dica-linha { margin-top: 2px; }

/* Lupa (loupe) exibida durante o arraste de um ponto */
.post-loupe {
  position: fixed;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  border: 3px solid #fff;
  box-shadow: 0 2px 10px rgba(0,0,0,.45);
  background: #fff;
  display: none;
  pointer-events: none;
  z-index: 60;
}

/* Canvas da avaliacao postural: evitar scroll no mobile ao arrastar pontos */
#postCanvas { touch-action: none; }

/* Segunda folha do documento: laudo da vista */
#printDoc .doc-pagina2 { page-break-before: always; padding-top: 8px; padding-bottom: 70px; }
#printDoc .doc-laudo-texto {
  white-space: pre-wrap;
  font-size: 11px;
  line-height: 1.55;
  color: #222;
  margin-top: 6px;
}
#printDoc .doc-conclusao { margin-top: 14px; }
#printDoc .doc-conclusao h3 { color: #194c4c; font-size: 12px; margin: 0 0 4px; }
#printDoc .doc-conclusao ul { margin: 0; padding-left: 18px; font-size: 11px; line-height: 1.5; }
#printDoc .doc-conclusao li { margin-bottom: 2px; }
#printDoc .doc-assinatura {
  margin-top: 40px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}
#printDoc .doc-assinatura .doc-sig, #printDoc .doc-rodape .doc-sig { max-height: 46px; max-width: 140px; object-fit: contain; }
#printDoc .doc-assinatura .doc-nome, #printDoc .doc-rodape .doc-nome {
  margin: 4px 0 0;
  font-weight: 700;
  font-size: 13px;
  border-top: 1px solid #888;
  padding-top: 6px;
  min-width: 260px;
}
#printDoc .doc-assinatura.com-sig .doc-nome, #printDoc .doc-rodape.com-sig .doc-nome { border-top: none; min-width: 0; }
#printDoc .doc-assinatura .doc-cred, #printDoc .doc-rodape .doc-cred { margin: 2px 0 0; font-size: 12px; color: #555; }

/* Rodapé fixo do profissional (assinatura, nome, especialidade e CREFITO):
   position:fixed é repetido pelo navegador em TODAS as páginas impressas. */
#printDoc .doc-rodape { display: none; }
@media print {
  #printDoc .doc-rodape {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    background: #ffffff;
    padding: 6px 0 4px;
    z-index: 10;
  }
}

/* ---- PRONTUÁRIO (evoluções do paciente) ---- */
.pront-topo {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.pront-topo-info h3 { font-size: 20px; color: var(--primary); margin-bottom: 4px; }
.pront-topo-info p { margin: 0; }
.pront-evolucao {
  background: var(--card);
  border: 1px solid #e8e8e8;
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
}
.pront-evolucao-topo {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.pront-evolucao-data {
  font-size: 13px;
  color: var(--primary);
  font-weight: 600;
}
.pront-evolucao-acoes { display: flex; gap: 6px; flex-wrap: wrap; }
.pront-evolucao-conteudo {
  white-space: pre-wrap;
  color: #333;
  line-height: 1.6;
  font-size: 14px;
  margin-bottom: 10px;
}
.pront-evolucao-docs {
  display: flex;
  flex-direction: column;
  gap: 6px;
  border-top: 1px dashed #e0e0e0;
  padding-top: 10px;
  margin-top: 2px;
}
.pront-doc-btn {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  text-align: left;
  font-weight: 600;
}
.pront-doc-btn.aberto { background: var(--primary); color: #fff; }
.pront-setinha { display: inline-block; transition: transform 0.15s; }
.pront-doc-btn.aberto .pront-setinha { transform: rotate(180deg); }
.pront-doc-grupo { display: flex; flex-direction: column; gap: 8px; margin: 2px 0; }
.pront-doc-item {
  border: 1px solid #e8e8e8;
  border-radius: 8px;
  background: #fbfcfd;
  padding: 10px 12px;
}
.pront-doc-item-topo {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.pront-doc-item-info { font-size: 12.5px; color: var(--primary); font-weight: 600; }
.pront-doc-item-conteudo { white-space: pre-wrap; color: #444; font-size: 13px; line-height: 1.5; margin-top: 6px; }

/* Botoes de novo documento (+ Solicitação etc.): alinhados na toolbar ao lado
   do Voltar e do + Nova Evolução; no mobile em grade de 2 colunas. */
.pront-doc-btns { display: flex; flex-wrap: wrap; gap: 8px; }

/* Sanfona da evolucao: cabecalho com seta recolhe/expande conteudo + documentos */
.pront-evolucao-corpo { display: block; }
.pront-evol-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 8px;
  font-size: 12px;
}
.pront-evol-toggle.aberto .pront-setinha { transform: rotate(180deg); }

/* Prontuário agrupado por dia (sanfona iniciando recolhida) */
.pront-dia {
  border: 1px solid #e3ecec;
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
}
.pront-dia.aberto .pront-setinha { transform: rotate(180deg); }
.pront-dia-cab {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 12px 16px;
  background: #e0f2f2;
  cursor: pointer;
}
.pront-dia-info {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 14px;
}
.pront-dia-data { font-weight: 700; color: var(--primary); }
.pront-dia-prof { color: #333; font-weight: 600; }
.pront-dia-counts { font-weight: 700; color: var(--primary); }
.pront-dia-hora { font-size: 12px; color: #5b6e6e; }
.pront-dia-acoes { display: flex; align-items: center; gap: 8px; }
.pront-dia-corpo { background: var(--card); padding: 14px 16px; }
.pront-dia-evols {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 12px;
}
.pront-evol-dia {
  border-left: 3px solid #cfe3e3;
  padding: 2px 0 2px 12px;
}
.pront-evol-dia-topo {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--primary);
  font-weight: 600;
  margin-bottom: 4px;
}
.pront-evol-dia-conteudo {
  white-space: pre-wrap;
  color: #333;
  line-height: 1.6;
  font-size: 14px;
}
.pront-dia-docs {
  border-top: 1px dashed #e0e0e0;
  padding-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.pront-dia-doc-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.pront-dia-doc-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 600;
  border-radius: var(--radius);
  border: 1px solid #d5e0e0;
  background: #f4f8f8;
  color: #9aa8a8;
  cursor: default;
}
.pront-dia-doc-btn:disabled { opacity: 0.8; }
.pront-dia-doc-btn.tem {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  cursor: pointer;
}
.pront-dia-doc-btn.tem:hover { background: var(--primary-dark); }
.pront-dia-doc-btn.tem.aberto { background: var(--primary-dark); }
.pront-dia-doc-count {
  background: #fff;
  color: var(--primary);
  border-radius: 999px;
  padding: 0 7px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.5;
}

/* ACORDEÃO DA AVALIAÇÃO POSTURAL */
.post-acordeao { display: flex; flex-direction: column; gap: 8px; }
.post-acordeao-item,
.post-acordeao-mes,
.post-acordeao-data { border: 1px solid #e3ecec; border-radius: 8px; background: #fff; overflow: hidden; }
.post-acordeao-cab,
.post-acordeao-mes-cab,
.post-acordeao-data-cab {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: var(--lighter);
  border: none;
  cursor: pointer;
  font: inherit;
  color: var(--primary);
  text-align: left;
}
.post-acordeao-mes-cab { background: #ecf4f4; padding-left: 34px; }
.post-acordeao-data-cab { background: #f2f7f7; padding: 10px 14px 10px 30px; }
.post-acordeao-seta { font-size: 10px; color: var(--accent); transition: transform 0.2s; }
.post-acordeao-item.aberto > .post-acordeao-cab .post-acordeao-seta,
.post-acordeao-mes.aberto > .post-acordeao-mes-cab .post-acordeao-seta,
.post-acordeao-data.aberto > .post-acordeao-data-cab .post-acordeao-seta { transform: rotate(90deg); }
.post-acordeao-nome { flex: 1; font-weight: 600; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
.post-acordeao-data-vista b { font-weight: 700; color: var(--primary); }
.post-acordeao-data-hora { order: 2; }
.post-acordeao-qtd { font-size: 12px; color: var(--text-muted); background: #fff; border-radius: 20px; padding: 2px 10px; }
.post-acordeao-corpo { display: none; padding: 10px 14px; }
.post-acordeao-item.aberto > .post-acordeao-corpo { display: block; }
.post-acordeao-mes.aberto > .post-acordeao-corpo { display: block; }
.post-acordeao-data.aberto > .post-acordeao-corpo { display: block; }
.post-acordeao-vista {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding: 8px 6px;
  border-bottom: 1px dashed #e3ecec;
}
.post-acordeao-vista:last-child { border-bottom: none; }
.post-acordeao-vista-nome { font-size: 14px; color: var(--text); }
.post-acordeao-vista-botoes { display: flex; gap: 6px; flex-wrap: wrap; }

/* Overlay de progresso (laudo FisIA / PDF): circulo girando + barra de porcentagem */
.overlay-progresso {
  position: fixed;
  inset: 0;
  background: rgba(8, 25, 25, 0.55);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 100000;
}
.overlay-progresso-card {
  background: var(--card);
  border-radius: var(--radius-lg);
  padding: 32px 36px;
  max-width: 400px;
  width: calc(100% - 40px);
  text-align: center;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
}
.overlay-progresso-spin {
  width: 48px;
  height: 48px;
  margin: 0 auto 18px;
  border: 4px solid #e3ecec;
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: overlay-progresso-girar 0.8s linear infinite;
}
@keyframes overlay-progresso-girar { to { transform: rotate(360deg); } }
.overlay-progresso-titulo { font-weight: 700; font-size: 15px; margin-bottom: 8px; color: var(--text); }
.overlay-progresso-txt { font-size: 13px; color: var(--text-muted); margin-bottom: 16px; min-height: 18px; }
.overlay-progresso-bar {
  height: 10px;
  background: #e8eef0;
  border-radius: 6px;
  overflow: hidden;
}
.overlay-progresso-fill {
  display: block;
  height: 100%;
  width: 0;
  background: var(--primary);
  border-radius: 6px;
  transition: width 0.3s ease;
}
.overlay-progresso-pct { font-size: 12px; color: var(--text-muted); margin-top: 8px; font-weight: 600; }

/* ---- Histórico FisIA: ações da tabela, exibição do conteúdo e editor ---- */
.hist-grid-wrap { overflow-x: auto; }
.hist-grid { display: grid; gap: 0; }
.hist-grid-5 { grid-template-columns: 140px 150px 100px 1fr 340px; }
.hist-grid-4 { grid-template-columns: 140px 100px 1fr 340px; }
.hist-grid-header { background: var(--primary); color: #fff; font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px; }
.hist-grid-header .hg-cell { padding: 10px 12px; text-align: center; }
.hist-grid-row { border-bottom: 1px solid #eee; transition: background 0.15s; }
.hist-grid-row:hover { background: #f7fbfb; }
.hg-cell { padding: 10px 12px; font-size: 13px; overflow: hidden; }
.hg-data { white-space: nowrap; }
.hg-usuario { white-space: nowrap; }
.hg-assunto { white-space: nowrap; }
.hg-resumo { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; text-overflow: ellipsis; word-break: break-word; }
.hg-acoes { white-space: nowrap; }
.hg-acoes .hist-botoes { display: flex; gap: 5px; flex-wrap: nowrap; justify-content: flex-end; }
.hg-acoes .hist-botoes .btn { padding: 3px 8px; font-size: 11px; }

/* HISTÓRICO FISIA — acordeão mobile (datas -> resumos -> detalhes) */
.hist-dia-item {
    background: var(--lighter);
    border-radius: var(--radius);
    margin-bottom: 8px;
    overflow: hidden;
}
.hist-dia-cab {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    cursor: pointer;
    user-select: none;
    background: #f2f7f7;
}
.hist-dia-titulo { flex: 1; font-weight: 700; color: var(--primary); font-size: 14px; }
.hist-dia-qtd { font-size: 12px; color: var(--text-muted); background: #fff; border-radius: 20px; padding: 2px 10px; }
.hist-dia-corpo { display: none; }
.hist-dia-item.open .hist-dia-corpo { display: block; }
.fis-acc-item { border-bottom: 1px dashed var(--light); }
.fis-acc-item:last-child { border-bottom: none; }
.fis-acc-cab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    cursor: pointer;
    user-select: none;
}
.fis-acc-resumo1 {
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 13px;
}
.fis-acc-hora {
    flex-shrink: 0;
    font-size: 12px;
    font-weight: 600;
    color: var(--primary);
}
.fis-acc-corpo { display: none; padding: 0 12px 12px; font-size: 13px; }
.fis-acc-item.open .fis-acc-corpo { display: block; }
.fis-acc-resumo3 {
    margin: 0 0 10px;
    color: var(--text-muted);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.fis-acc-linha { padding: 6px 0; border-bottom: 1px solid rgba(0,0,0,0.05); }
.fis-acc-linha:last-of-type { border-bottom: none; }
.fis-acc-acoes {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}
.fis-acc-acoes .btn { font-size: 12px; padding: 4px 8px; }
.fisia-conteudo { white-space: normal; word-break: break-word; line-height: 1.7; }
.fisia-conteudo p { margin: 6px 0; }
.fisia-conteudo ul, .fisia-conteudo ol { padding-left: 22px; }
.fisia-conteudo font[size="1"] { font-size: 11px; }
.fisia-conteudo font[size="3"] { font-size: 14px; }
.fisia-conteudo font[size="5"] { font-size: 18px; }
.fisia-conteudo font[size="7"] { font-size: 24px; }

.fisia-editor-toolbar {
  position: sticky; top: 0; z-index: 2;
  background: #f2f7f7; border-radius: 8px 8px 0 0;
  padding: 8px; display: flex; gap: 6px; flex-wrap: wrap; align-items: center;
}
.fisia-editor-btn {
  width: 34px; height: 34px; border: 1px solid #cde0e0; background: #fff;
  border-radius: 6px; cursor: pointer; color: var(--text); font-size: 14px;
  line-height: 1; display: inline-flex; align-items: center; justify-content: center;
}
.fisia-editor-btn:hover { background: #e3ecec; }
.fisia-editor-select {
  height: 34px; border: 1px solid #cde0e0; border-radius: 6px; background: #fff;
  font-size: 12px; padding: 0 6px; color: var(--text); cursor: pointer;
}
.fisia-editor-cor-label {
  display: inline-flex; align-items: center; gap: 4px; font-size: 12px;
  border: 1px solid #cde0e0; border-radius: 6px; background: #fff;
  padding: 0 6px; height: 34px; cursor: pointer; color: var(--text);
}
.fisia-editor-cor-label input[type="color"] {
  width: 24px; height: 24px; border: none; padding: 0; background: transparent; cursor: pointer;
}
.fisia-editor-conteudo {
  min-height: 280px; max-height: 62vh; overflow-y: auto;
  border: 1px solid #d5e3e3; border-radius: 0 0 8px 8px;
  padding: 14px; background: #fff; font-size: 14px; line-height: 1.7;
  outline: none;
}
.fisia-editor-conteudo:focus { border-color: var(--primary); }
.fisia-editor-conteudo ul, .fisia-editor-conteudo ol { padding-left: 22px; }
.fisia-editor-conteudo blockquote { border-left: 3px solid #cde0e0; margin: 8px 0; padding: 2px 10px; color: var(--text-muted); }
.fisia-editor-conteudo font[size="1"] { font-size: 11px; }
.fisia-editor-conteudo font[size="3"] { font-size: 14px; }
.fisia-editor-conteudo font[size="5"] { font-size: 18px; }
.fisia-editor-conteudo font[size="7"] { font-size: 24px; }

#printDoc .doc-usuario { font-size: 12px; color: #333; margin: 0 0 10px; }
#printDoc .fisia-print-bloco { margin-bottom: 12px; }
#printDoc .fisia-print-bloco h3 { font-size: 12px; color: #194c4c; margin: 0 0 4px; }
#printDoc .fisia-print-corpo { font-size: 12px; line-height: 1.6; }
#printDoc .fisia-print-corpo ul, #printDoc .fisia-print-corpo ol { padding-left: 20px; }
#printDoc .doc-gerado-por { text-align: center; font-size: 11px; color: #666; margin-top: 40px; }

/* ---- Mapa do corpo interativo (campo 'mapa_corpo') ---- */
.mapa-corpo-grid { display: flex; gap: 24px; flex-wrap: wrap; justify-content: center; }
.mapa-corpo-view { text-align: center; }
.mapa-corpo-titulo { font-weight: 700; color: var(--primary); margin-bottom: 6px; }
.mapa-corpo-svg { width: 240px; max-width: 100%; height: auto; }
.mapa-corpo-svg .mc-regioes path {
  fill: none;
  pointer-events: all;
  cursor: pointer;
  transition: fill 0.15s;
}
.mapa-corpo-svg .mc-regioes path:not(.sel):hover { fill: color-mix(in srgb, var(--cor, #194c4c) 45%, #ffffff); }
.mapa-corpo-svg .mc-regioes path.mc-musculo.sel { fill: var(--cor, #e63946); }
.mapa-corpo-svg .mc-regioes path.mc-sombra.sel { fill: rgba(0, 0, 0, 0.28); }
.mapa-corpo-carregando { font-size: 13px; color: var(--text-muted); padding: 40px 10px; }
.mapa-corpo-legenda-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; justify-content: center; }
.mapa-corpo-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
  border: 1px solid #dbe6e6;
  border-radius: 20px;
  padding: 3px 11px 3px 5px;
  cursor: pointer;
  user-select: none;
  background: #fff;
  transition: all 0.12s;
}
.mapa-corpo-chip .sw { width: 12px; height: 12px; border-radius: 3px; flex: none; background: var(--cor); }
.mapa-corpo-chip:hover { border-color: var(--primary); }
.mapa-corpo-chip.ativo { background: var(--primary); border-color: var(--primary); color: #fff; }
.mapa-corpo-rodape {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px dashed #e3ecec;
}
.mapa-corpo-legenda { font-size: 13px; color: var(--text-muted); }
.mapa-corpo-selecionadas { font-weight: 700; color: #e63946; }
@media (max-width: 768px) { .mapa-corpo-svg { width: 185px; } }

/* ---- Chave liga/desliga (switch) ---- */
.chave-switch { position: relative; display: inline-block; width: 40px; height: 22px; vertical-align: middle; cursor: pointer; }
.chave-switch input { opacity: 0; width: 0; height: 0; }
.chave-switch .slider {
  position: absolute; inset: 0; background: #d3dde0; border-radius: 22px;
  transition: background 0.15s;
}
.chave-switch .slider::before {
  content: ''; position: absolute; width: 16px; height: 16px; left: 3px; top: 3px;
  background: #fff; border-radius: 50%; transition: transform 0.15s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}
.chave-switch input:checked + .slider { background: var(--primary); }
.chave-switch input:checked + .slider::before { transform: translateX(18px); }

/* ---- Preenchimento de fichas de avaliação (fichas_preenchidas) ---- */
.fich-campo { margin-bottom: 16px; }
.fich-campo > label { display: block; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.fich-slide { display: flex; align-items: center; gap: 10px; }
.fich-slide input[type="range"] { flex: 1; }
.fich-slide-val {
  min-width: 34px; text-align: center; background: var(--lighter);
  border: 1px solid #cde0e0; border-radius: 6px; padding: 4px 8px; color: var(--primary);
}
.fich-mapa { padding: 6px; border: 1px solid #e3ecec; border-radius: 8px; background: #fafcfc; }
#fpCampos, #verAvCampos { max-height: 60vh; overflow-y: auto; padding-right: 4px; }
#printDoc .fich-print-campo { margin-bottom: 10px; page-break-inside: avoid; }
#printDoc .fich-print-label { display: block; font-size: 11px; font-weight: 700; color: #194c4c; text-transform: uppercase; letter-spacing: 0.4px; margin-bottom: 2px; }
#printDoc .fich-print-valor { font-size: 12px; color: #222; line-height: 1.5; white-space: pre-wrap; }
#printDoc .fich-print-valor.cif-print-valor strong { color: #194c4c; }
#printDoc .fich-print-valor.cif-print-valor > strong,
#printDoc .fich-print-valor.cif-print-valor strong:first-child { font-weight: 800; }

/* ---- Diagnóstico CIF em destaque nos documentos ---- */
.cif-doc-box {
  margin-top: 16px; padding: 12px 14px;
  border: 1.5px solid #194c4c; border-radius: 8px;
  background: #f0faf7;
  page-break-inside: avoid;
}
.cif-doc-box p { margin: 0 0 6px; line-height: 1.5; }
.cif-doc-titulo { font-size: 13px; }
.cif-doc-titulo strong { color: #194c4c; }
.cif-doc-item { font-size: 12px; color: #222; }
.cif-doc-item strong { color: #194c4c; }
.cif-doc-resumo { font-size: 12px; color: #222; white-space: pre-wrap; }

/* ---- Mapa do corpo: seleção bilateral + popup de instrução de teste ---- */
.fich-info-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 16px; height: 16px; margin-left: 6px;
  border-radius: 50%; background: #194c4c; color: #fff;
  font-size: 11px; font-weight: 700; font-style: normal; cursor: pointer;
  vertical-align: middle; user-select: none;
}
.fich-info-btn:hover { background: #e63946; }
.fich-bilateral {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; color: var(--text); margin: 0 0 8px; cursor: pointer;
}
.fich-bilateral-chk { margin: 0; }
#modalInfoTeste .modal-body { max-height: 65vh; overflow-y: auto; }
#modalInfoTeste .modal-body p { margin: 0 0 10px; line-height: 1.6; }
#printDoc .fich-print-mapa { margin-bottom: 8px; }
#printDoc .mapa-corpo-svg { width: 185px; }

/* ===== Blocos de Horário ===== */
.bh-filtros { gap: 8px; flex-wrap: wrap; }
.bh-accordion { margin-bottom: 8px; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.bh-accordion-header {
  display: flex; align-items: center; gap: 8px; padding: 12px 16px;
  background: var(--bg-card); cursor: pointer; user-select: none;
  font-size: 14px; transition: background .15s;
}
.bh-accordion-header:hover { background: var(--bg-hover, #f0f0f0); }
.bh-acc-icon { font-size: 11px; color: var(--text-muted, #888); transition: transform .2s; }
.bh-acc-count { margin-left: auto; font-size: 12px; color: var(--text-muted, #888); }
.bh-acc-sub { font-size: 12px; color: var(--text-muted, #888); margin-left: 4px; }
.bh-accordion-body { display: none; padding: 8px 12px 12px; background: var(--bg-page, #fafafa); }
.bh-grupo { margin-bottom: 16px; }
.bh-grupo h3, .bh-grupo h4 { margin: 0 0 8px; color: var(--primary); }
.bh-card {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 10px 14px; margin-bottom: 6px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 8px; transition: box-shadow .15s;
}
.bh-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,.08); }
.bh-card-dia { font-weight: 600; min-width: 120px; color: var(--primary); }
.bh-card-hora { font-weight: 600; min-width: 110px; }
.bh-card-vagas { min-width: 80px; }
.bh-card-data { font-size: 12px; color: var(--text-muted, #888); }
.bh-card-obs { font-size: 12px; color: var(--text-muted, #888); flex-basis: 100%; }
.bh-card-acoes { margin-left: auto; display: flex; gap: 6px; }

/* Aba Configurações (super_admin) — ícone equalizador + texto em amarelo, para diferenciar das demais abas */
.sidebar-nav a.nav-cfg,
.sidebar-nav a.nav-cfg.active,
.sidebar-nav a.nav-cfg:hover {
    color: #ffd100 !important;
}
.sidebar-nav a.nav-cfg svg,
.sidebar-nav a.nav-cfg.active svg,
.sidebar-nav a.nav-cfg:hover svg {
    color: #ffd100 !important;
}

/* ============ Aba Vendas (super_admin) ============ */
.vnd-filtros {
    display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end;
    background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px;
    padding: 14px; margin-bottom: 6px;
}
.vnd-filtros .form-group { display: flex; flex-direction: column; }
.vnd-filtros .form-group label { font-size: 12px; margin-bottom: 4px; }
.vnd-filtros select, .vnd-filtros input { min-width: 150px; }
.vnd-dates { display: flex; gap: 8px; align-items: flex-end; }
.vnd-periodo-txt { font-size: 13px; color: var(--text-muted, #888); margin: 6px 2px 14px; }
.kpi-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 12px; margin-bottom: 8px;
}
.kpi-card {
    background: var(--bg-card, #fff); border: 1px solid var(--border); border-radius: 10px;
    padding: 14px 16px;
}
.kpi-rotulo { font-size: 12px; color: var(--text-muted, #888); text-transform: uppercase; letter-spacing: .4px; }
.kpi-valor { font-size: 26px; font-weight: 700; margin-top: 4px; }
.kpi-delta { display: inline-block; margin-top: 6px; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 20px; }
.kpi-up { color: #2e7d32; background: rgba(46,125,50,.12); }
.kpi-down { color: #c62828; background: rgba(198,40,40,.12); }
.kpi-eq { color: #888; background: rgba(0,0,0,.06); }
.vnd-secao { margin: 22px 0 10px; font-size: 16px; }
.vnd-origem {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
}
.origem-item {
    background: var(--bg-card, #fff); border: 1px solid var(--border); border-radius: 10px;
    padding: 14px 16px;
}
.origem-nome { font-size: 13px; color: var(--text-muted, #888); }
.origem-valor { font-size: 24px; font-weight: 700; display: flex; align-items: baseline; gap: 8px; }
.origem-pct { font-size: 13px; font-weight: 600; color: var(--primary); }
.fonte-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 12px;
}
.fonte-card {
    background: var(--bg-card, #fff); border: 1px solid var(--border); border-radius: 10px;
    padding: 12px 14px;
}
.fonte-nome { font-size: 13px; font-weight: 600; }
.fonte-nums { font-size: 13px; margin-top: 4px; }
.fonte-conv { font-size: 12px; color: #2e7d32; margin-top: 4px; font-weight: 600; }
.vnd-fisia-resposta { line-height: 1.7; font-size: 14px; }
.vnd-fisia-resposta b { color: var(--primary); }

/* ============ Aba Leads (super_admin e afiliados) ============ */
.lead-busca {
    display: grid; grid-template-columns: 1.6fr 1.4fr 0.9fr auto; gap: 12px;
    align-items: end;
}
.lead-campo { display: flex; flex-direction: column; }
.lead-campo label { font-size: 12px; margin-bottom: 4px; color: var(--text-muted, #888); }
.lead-campo input, .lead-campo select { width: 100%; }
.lead-acoes { display: flex; gap: 8px; }
.lead-lista { margin-top: 14px; }
.lead-res-barra { display: flex; justify-content: flex-end; margin-bottom: 10px; }
.lead-item {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    flex-wrap: wrap;
    background: var(--bg-card, #fff); border: 1px solid var(--border);
    border-radius: 10px; padding: 12px 14px; margin-bottom: 8px;
}
.lead-item-main { flex: 1; min-width: 200px; }
.lead-item-acoes { flex: none; }
.lead-item-acoes .btn:disabled { opacity: .7; cursor: default; }
.sel-status {
    padding: 4px 8px; border-radius: 6px; border: 1px solid var(--border);
    background: var(--bg-card, #fff); font-size: 13px; color: var(--text);
}
@media (max-width: 768px) {
    .lead-busca { grid-template-columns: 1fr; }
    .lead-campo-uf { grid-column: 1 / 2; }
    .lead-acoes { width: 100%; }
    .lead-acoes .btn { flex: 1; justify-content: center; }
}



/* Leads - contador de resultados da ultima busca */
.lead-geo-stats {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  margin-top: 10px;
  padding: 8px 12px;
  font-size: 12.5px;
  line-height: 1.5;
  background: #f0faf9;
  border: 1px solid #cfe8db;
  border-radius: 8px;
  color: #194c4c;
}

/* Leads - filtros e total de "Meus leads" */
.lead-meus-filtros {
    display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 14px;
    margin: 10px 0 14px; padding: 10px 12px;
    background: var(--bg-soft, #f7f9fb); border: 1px solid var(--border);
    border-radius: 10px;
}
.lead-meus-filtros label { display: flex; flex-direction: column; font-size: 12px; color: var(--text-muted, #888); gap: 4px; }
.lead-meus-filtros select { min-width: 150px; }
@media (max-width: 768px) {
    .lead-meus-filtros label { flex: 1 1 calc(50% - 14px); }
    .lead-meus-filtros select { width: 100%; min-width: 0; }
}


/* DASH - questionário de funcionalidade do membro superior */
.dash-wrap { margin-top: 4px; }
.dash-acoes {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 8px; margin-bottom: 8px;
}
.dash-total { font-size: 12.5px; color: var(--muted, #666); }
.dash-lista { border: 1px solid var(--border, #ddd); border-radius: 8px; overflow: hidden; }
.dash-recolhido { max-height: 56px; overflow: hidden; }
.dash-item { border-bottom: 1px solid var(--border, #eee); padding: 8px 12px; }
.dash-item:last-child { border-bottom: none; }
.dash-item-cab { display: flex; gap: 8px; align-items: flex-start; font-size: 13.5px; line-height: 1.4; }
.dash-item-cab b { flex: none; color: var(--primary, #194c4c); }
.dash-item-slide { margin-top: 6px; padding-left: 20px; }
.dash-item-resp { font-size: 13px; color: var(--primary, #194c4c); margin-top: 4px; padding-left: 20px; font-weight: 600; }
.dash-resultado {
  margin-top: 10px; padding: 8px 12px; font-size: 14px;
  background: #f0faf9; border: 1px solid #cfe8db; border-radius: 8px; color: #194c4c;
}
.dash-visualizacao .dash-resultado { margin-top: 0; margin-bottom: 8px; }
.dash-visualizacao .dash-item { padding: 6px 0; border-bottom: 1px dashed #e0e0e0; }
.dash-visualizacao .dash-item-cab { font-size: 13px; }

/* =====================================================================
   TERMOGRAFIA CLINICA — visualizador termico, pontos e impressao
   ===================================================================== */
.termo-avisos { font-size: 13px; color: var(--text-muted); background: #f0faf9; border: 1px solid #cfe8db; border-radius: 8px; padding: 10px 12px; margin-top: 10px; }
.termo-avisos p { margin: 0; }
.termo-src-btns { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.termo-src-btns .btn { flex: 1 1 0; min-width: 120px; }
.termo-imagens { display: flex; gap: 16px; flex-wrap: wrap; }
.termo-imagem-box { border: 1px solid #e3ecec; border-radius: 8px; padding: 10px; background: #fff; max-width: 220px; }
.termo-imagem-box b { display: block; font-size: 12px; color: var(--text-muted); margin-bottom: 6px; }
.termo-imagem-box img { width: 100%; border-radius: 6px; display: block; }
.termo-toolbar { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 12px; }
.termo-toolbar .form-group { margin: 0; min-width: 90px; }
.termo-canvas-wrap { position: relative; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.termo-canvas-wrap canvas { border: 1px solid #194c4c; border-radius: 8px; cursor: crosshair; max-width: 100%; height: auto; touch-action: none; }
.termo-colorbar { display: flex; justify-content: center; width: 100%; }
.termo-colorbar canvas { border: 1px solid #194c4c; border-radius: 4px; }
.termo-legend { font-size: 11px; color: var(--text-muted); text-align: center; line-height: 1.4; }
.termo-pts-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 12px; font-size: 13px; color: var(--text); }
.termo-pts-bar b { color: var(--primary); }
.termo-hint { color: var(--text-muted); font-size: 12px; }
.termo-pontos { margin-top: 14px; }
.termo-pontos-titulo { font-weight: 700; color: var(--primary); margin-bottom: 8px; }
.termo-pontos-vazio { font-size: 13px; color: var(--text-muted); }
.termo-ponto-item { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 6px 0; border-bottom: 1px dashed #e3ecec; }
.termo-ponto-item.sel { background: #f0faf9; border-radius: 6px; padding-left: 8px; padding-right: 8px; }
.termo-ponto-item:last-child { border-bottom: none; }
.termo-ponto-label { font-weight: 600; min-width: 60px; color: var(--primary); }
.termo-ponto-temp { font-size: 13px; color: var(--text-muted); white-space: nowrap; }
.termo-forma-item { font-size: 13px; }
.termo-forma-qf { color: var(--text); white-space: nowrap; }
.termo-q { color: #e53935; font-weight: 600; }
.termo-f { color: #2196f3; font-weight: 600; }
.termo-ferramentas { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 0 0 12px; }
.termo-ferr-titulo { font-size: 13px; color: var(--text-muted); font-weight: 600; }
.termo-ferr-btn { border: 1px solid #cfe8db; background: #fff; color: var(--primary); border-radius: 8px; padding: 7px 12px; font-size: 13px; cursor: pointer; }
.termo-ferr-btn:hover { background: #f0faf9; }
.termo-ferr-btn.ativo { background: var(--primary); color: #fff; border-color: var(--primary); }
.termo-ver-imgs { display: flex; gap: 14px; flex-wrap: wrap; margin: 10px 0; }
.termo-ver-box { border: 1px solid #e3ecec; border-radius: 8px; padding: 8px; max-width: 260px; background: #fff; }
.termo-ver-box b { display: block; font-size: 12px; color: var(--text-muted); margin-bottom: 6px; }
.termo-ver-box img { width: 100%; border-radius: 6px; display: block; }
.termo-ver-escala { font-size: 14px; color: var(--text); margin-top: 8px; }
.termo-ver-pontos { font-size: 14px; margin-top: 10px; }
.termo-print-imgs { display: flex; gap: 14px; flex-wrap: wrap; margin: 10px 0; }
.termo-print-box { flex: 1 1 40%; min-width: 200px; }
.termo-print-box h3 { font-size: 14px; color: var(--text-muted); margin-bottom: 6px; }
.termo-print-box img { width: 100%; border: 1px solid #e3ecec; border-radius: 6px; }

/* Termografia — layout impressão/PDF: imagem ao lado da info */
.termo-doc-lado { display: flex; gap: 14px; margin: 10px 0; align-items: flex-start; }
.termo-doc-img { flex: 0 0 auto; max-width: 45%; }
.termo-doc-img img { width: 100%; max-width: 320px; border: 1px solid #e3ecec; border-radius: 6px; display: block; }
.termo-doc-info { flex: 1 1 auto; min-width: 0; }

/* Escala de cores com linhas arrastaveis (min/max) — horizontal, acima da imagem */
.termo-col-cont { position: relative; width: 240px; height: 28px; }
.termo-col-canvas { border: 1px solid #194c4c; border-radius: 4px; display: block; width: 240px; height: 28px; }
.termo-col-linha { position: absolute; top: -2px; width: 4px; height: 32px; border-radius: 3px; cursor: ew-resize; box-shadow: 0 0 3px rgba(0,0,0,.5); touch-action: none; }
.termo-col-max { background: #e53935; }
.termo-col-min { background: #2196f3; }
.termo-col-max-label, .termo-col-min-label { position: absolute; top: -16px; transform: translateX(-50%); font-size: 10px; font-weight: 700; white-space: nowrap; text-shadow: 0 0 2px #fff; }

/* Menu de contexto (long-press no ponto, mobile) */
.termo-ctx-menu { position: fixed; z-index: 40000; min-width: 150px; background: #fff; border: 1px solid #cfe8db; border-radius: 10px; box-shadow: 0 6px 24px rgba(0,0,0,.18); overflow: hidden; display: none; padding: 4px; }
.termo-ctx-menu.visivel { display: block; }
.termo-ctx-item { padding: 10px 14px; font-size: 14px; color: #194c4c; cursor: pointer; border-radius: 7px; }
.termo-ctx-item:hover { background: #f0faf9; }
.termo-ctx-item.termo-ctx-excluir { color: #c62828; }

/* Slider de tamanho da fonte dos rótulos */
.termo-fs-bar { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; font-size: 13px; color: var(--text-muted); }
.termo-fs-titulo { font-weight: 600; white-space: nowrap; }
.termo-fs-slider { flex: 1 1 auto; min-width: 120px; max-width: 260px; accent-color: var(--primary); }
.termo-fs-valor { font-weight: 700; color: var(--primary); min-width: 34px; text-align: right; }


@media (max-width: 768px) {
  .termo-toolbar { flex-direction: column; align-items: stretch; }
  /* a escala horizontal (em cima) e o canvas ficam centralizados e com largura total */
  .termo-canvas-wrap { align-items: center; }

  /* Reordena a termografia no mobile: imagem original → ferramentas → imagem avaliada
     (canvas+escala) → controles da escala → pontos/formas */
  #termoViewer { display: flex !important; flex-direction: column; }
  #termoViewer .termo-ferramentas { order: 1; }
  #termoViewer .termo-fs-bar { order: 2; }
  #termoViewer .termo-canvas-wrap { order: 3; }
  #termoViewer .termo-toolbar { order: 4; }
  #termoViewer .termo-pts-bar { order: 5; }
  #termoViewer #termoPontos { order: 6; }
  #termoViewer #termoFormas { order: 7; }

  /* Ferramentas: título "Ferramenta:" em sua própria linha e botões lado a lado,
     apenas com ícones (sem palavras) */
  .termo-ferramentas { flex-wrap: wrap; }
  .termo-ferr-titulo { flex-basis: 100%; }
  .termo-ferr-txt { display: none; }
  .termo-ferr-btn { display: inline-flex; align-items: center; justify-content: center; }
}


/* Mobile: acordeão da avaliação postural — empilha vista/data/hora com alinhamento à esquerda */
@media (max-width: 768px) {
    .post-acordeao-nome {
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
        text-align: left;
    }
    .post-acordeao-data-vista { order: 0; }
    .post-acordeao-data-hora { order: 1; }
    .post-acordeao-mes-cab { padding-left: 30px; }
    .post-acordeao-data-cab { padding-left: 30px; }
}

/* Mobile: formulários de avaliação (termografia e postural) empilham em largura total,
   com o campo de arquivo de imagem em largura total; na postural a Vista aparece acima da Foto. */
@media (max-width: 768px) {
    #termoNova .form-grid,
    #postNova .form-grid {
        grid-template-columns: 1fr;
    }
    #termoNova input[type="file"],
    #postNova input[type="file"] {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        white-space: normal;
    }
    /* Chrome/Chromium (incl. WebView2): botão "Escolher Arquivo" em sua própria linha,
       com "Nenhum arquivo escolhido" logo abaixo */
    #termoNova input[type="file"]::-webkit-file-upload-button,
    #postNova input[type="file"]::-webkit-file-upload-button {
        display: block;
        white-space: nowrap;
    }
    /* Postural: a Foto vem primeiro no DOM → reordenamos para a Vista ficar acima */
    #postNova .form-grid .form-group:nth-child(1) { order: 2; } /* Foto */
    #postNova .form-grid .form-group:nth-child(2) { order: 1; } /* Vista */
    /* Postural: a imagem importada (canvas) fica ACIMA da região amarela das Dicas no mobile */
    .post-mid { display: flex; flex-direction: column; }
    .post-mid .post-mid-canvas { order: 1; }
    .post-mid .post-dicas { order: 2; }
}

/* Mobile: formulário de Cobrança PIX (Chaves PIX) empilha em 1 coluna para não exceder a largura do aparelho */
@media (max-width: 768px) {
    #finQrFormBody .form-grid { grid-template-columns: 1fr; }
}

/* Dashboard: cards clicáveis abrem painéis inline (sem navegar) */
.stat-card-clicavel {
    cursor: pointer;
    transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
}
.stat-card-clicavel:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, .12);
}
.stat-card-clicavel.ativo {
    border-color: var(--accent, #0ea5e9);
    box-shadow: 0 0 0 2px rgba(14, 165, 233, .35);
}
.dash-secao {
    margin-top: 16px;
}
.dash-painel {
    display: none;
}
.dash-painel.aberto {
    display: block;
    margin-top: 16px;
    animation: dashAbrir .2s ease;
}
@keyframes dashAbrir {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}
.dash-empty-acao {
    margin-top: 14px;
}

/* ===== Chat/Suporte ===== */
.cs-api {
    display: flex;
    flex-direction: column;
    gap: 14px;
    height: calc(100vh - 220px);
    min-height: 420px;
}
.cs-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}
.cs-head h2 {
    margin: 0;
}
.cs-total {
    color: #666;
    font-size: 13px;
}
.cs-corpo {
    display: flex;
    flex: 1;
    min-height: 0;
    border: 1px solid #dce8e8;
    border-radius: 10px;
    overflow: hidden;
}
.cs-lista {
    width: 320px;
    min-width: 260px;
    border-right: 1px solid #dce8e8;
    overflow-y: auto;
    background: #f7fbfb;
}
.cs-thread {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    background: #fff;
}
.cs-lista-vazio,
.cs-thread-vazio {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 32px 16px;
    text-align: center;
    color: #666;
    font-size: 14px;
    height: 100%;
}
.cs-lista-vazio .icon {
    color: var(--primary);
}
.cs-thread-vazio svg {
    color: var(--primary);
    opacity: .5;
    width: 34px;
    height: 34px;
}
.cs-item {
    display: block;
    padding: 12px 14px;
    border-bottom: 1px solid #e6efef;
    cursor: pointer;
    transition: background .15s ease;
}
.cs-item:hover {
    background: #eef6f6;
}
.cs-item.cs-item-ativo {
    background: #e0f0f0;
    border-left: 3px solid var(--primary);
}
.cs-item-topo {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
.cs-item-topo b {
    font-size: 14px;
}
.cs-item-wa {
    font-size: 12px;
    color: #888;
}
.cs-item-ago {
    margin-left: auto;
    font-size: 11px;
    color: #999;
    white-space: nowrap;
}
.cs-item-msg {
    margin-top: 3px;
    font-size: 13px;
    color: #555;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.cs-item-roda {
    margin-top: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.cs-item-nova {
    margin-left: auto;
    background: #e53935;
    color: #fff;
    border-radius: 999px;
    font-size: 11px;
    line-height: 1;
    padding: 3px 7px;
    min-width: 18px;
    text-align: center;
    font-weight: 700;
}
.cs-badge {
    display: inline-block;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 999px;
    background: #e9eef0;
    color: #556;
}
.cs-badge-eu {
    background: #d5efe9;
    color: #194c4c;
}
.cs-badge-ag {
    background: #fff3cd;
    color: #8a6d1a;
}
.cs-badge-f {
    background: #fdecea;
    color: #c62828;
}
.cs-thread-cab {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-bottom: 1px solid #dce8e8;
    background: #f7fbfb;
}
.cs-voltar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: 1px solid #c4d6d6;
    border-radius: 8px;
    background: #fff;
    color: var(--primary);
    cursor: pointer;
}
.cs-voltar svg {
    width: 17px;
    height: 17px;
}
.cs-thread-cab-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.cs-thread-cab-info b {
    font-size: 15px;
}
.cs-thread-cab-info span {
    font-size: 12px;
    color: #888;
}
.cs-thread-cab-acoes {
    margin-left: auto;
}
.cs-btn-ghost {
    border: 1px solid #d3a2a2;
    background: #fdf6f6;
    color: #c62828;
    border-radius: 8px;
    padding: 7px 12px;
    font-size: 13px;
    cursor: pointer;
}
.cs-btn-ghost:hover {
    background: #fbeeee;
}
.cs-thread-msgs {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: #fbfdfd;
}
.cs-msg-vazio {
    color: #999;
    font-size: 13px;
    text-align: center;
    margin: auto;
}
.cs-msg {
    max-width: 78%;
    padding: 9px 12px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.45;
    word-wrap: break-word;
    white-space: normal;
}
.cs-msg-atendente {
    align-self: flex-end;
    background: var(--primary);
    color: #fff;
    border-bottom-right-radius: 4px;
}
.cs-msg-visitante {
    align-self: flex-start;
    background: #fff;
    border: 1px solid #dce8e8;
    color: #222;
    border-bottom-left-radius: 4px;
}
.cs-msg-ia {
    align-self: flex-start;
    background: #eef4f4;
    border: 1px solid #dce8e8;
    color: #222;
    border-bottom-left-radius: 4px;
}
.cs-msg-sistema {
    align-self: center;
    background: transparent;
    color: #888;
    font-size: 12px;
    font-style: italic;
    text-align: center;
}
.cs-msg-quem {
    display: block;
    font-size: 11px;
    margin-bottom: 3px;
    font-weight: 700;
    color: var(--primary);
}
.cs-msg-hora {
    display: block;
    margin-top: 4px;
    font-size: 10px;
    opacity: .65;
    text-align: right;
}
.cs-anexo-img {
    max-width: 260px;
    max-height: 200px;
    border-radius: 8px;
    display: block;
}
.cs-arquivo {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.cs-link {
    color: var(--primary);
    text-decoration: underline;
    word-break: break-all;
}
.cs-msg-atendente .cs-link {
    color: #d9fff7;
}
.cs-cupom {
    background: #194c4c;
    color: #ffd100;
    padding: 2px 8px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 13px;
}
.cs-thread-rodape {
    border-top: 1px solid #dce8e8;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: #fff;
}
.cs-tools {
    display: flex;
    gap: 6px;
}
.cs-tool {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border: 1px solid #c4d6d6;
    border-radius: 8px;
    background: #fff;
    color: var(--primary);
    cursor: pointer;
    font-size: 15px;
}
.cs-tool:hover {
    background: #eef6f6;
}
.cs-tool svg {
    width: 17px;
    height: 17px;
}
.cs-form {
    display: flex;
    gap: 8px;
}
.cs-input {
    flex: 1;
    min-width: 0;
    border: 1px solid #c4d6d6;
    border-radius: 8px;
    padding: 9px 12px;
    font-size: 14px;
    font-family: inherit;
}
.cs-input:focus {
    outline: none;
    border-color: var(--primary);
}
.cs-enviar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border: none;
    border-radius: 8px;
    background: var(--primary);
    color: #fff;
    cursor: pointer;
}
.cs-enviar svg {
    width: 18px;
    height: 18px;
}
.cs-enviar:hover {
    background: #194c4c;
}

/* Ponto vermelho de nao lidas no menu */
.nav-dot {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #e53935;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, .85);
}
.sidebar-nav a {
    position: relative;
}

@media (max-width: 768px) {
    .cs-api {
        height: auto;
        min-height: 60vh;
    }
    .cs-corpo {
        flex-direction: column;
    }
    .cs-lista {
        width: 100%;
        min-width: 0;
        max-height: 260px;
        border-right: none;
        border-bottom: 1px solid #dce8e8;
    }
    .cs-thread {
        min-height: 60vh;
    }
    .cs-msg {
        max-width: 92%;
    }
}

/* E-mail do visitante (lista + cabecalho do thread) */
.cs-item-email {
    font-size: 12px;
    color: #888;
    margin-left: 8px;
    text-decoration: none;
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: inline-block;
    vertical-align: bottom;
}

/* Botao de link enviado ao visitante (aparece com o titulo) */
.cs-link-btn {
    display: inline-block;
    background: #194c4c;
    color: #fff;
    border-radius: 8px;
    padding: 9px 16px;
    margin-top: 2px;
    font-weight: 600;
    text-decoration: none;
    font-size: 14px;
}
.cs-link-btn:hover {
    background: #267373;
    color: #fff;
}
.cs-msg-atendente .cs-link-btn {
    background: #fff;
    color: #194c4c;
    box-shadow: inset 0 0 0 1px #194c4c;
}
.cs-msg-atendente .cs-link-btn:hover {
    background: #eef6f6;
}

/* Modal "Enviar link" (titulo + copiar) */
.cs-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 27, .45);
    z-index: 30010;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}
.cs-modal {
    width: 100%;
    max-width: 460px;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 12px 40px rgba(25, 76, 76, .28);
    overflow: hidden;
}
.cs-modal-cab {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    background: #f0faf9;
    border-bottom: 1px solid #dce8e8;
    font-size: 15px;
    color: var(--primary);
}
.cs-modal-fechar {
    border: none;
    background: transparent;
    color: #555;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    padding: 0 4px;
}
.cs-modal-fechar:hover {
    color: #c62828;
}
.cs-modal-corpo {
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.cs-modal-label {
    font-size: 13px;
    font-weight: 600;
    color: #333;
    margin-top: 6px;
}
.cs-modal-input {
    width: 100%;
}
.cs-modal-linkrow {
    display: flex;
    gap: 8px;
}
.cs-modal-linkrow .cs-input {
    flex: 1;
}
.cs-modal-linkrow .cs-btn-ghost {
    white-space: nowrap;
}
.cs-modal-dica {
    font-size: 12px;
    color: #888;
    line-height: 1.5;
    margin: 6px 0 0;
}
.cs-modal-acoes {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 12px 18px;
    border-top: 1px solid #e3eeee;
    background: #fbfdfd;
}
.cs-msg-status {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    margin-top: 4px;
}
.cs-msg-status .cs-check {
    display: inline-flex;
    align-items: center;
    gap: 0;
    color: #b0bec5;
}
.cs-msg-status .cs-check .cs-tick {
    display: block;
    flex: none;
}
.cs-msg-status .cs-check .cs-tick-2 {
    margin-left: -6px;
}
.cs-msg-status .cs-check.lido {
    color: #4fc3f7;
}
.cs-msg-status .cs-msg-hora {
    margin-top: 0;
    line-height: 1;
}
.cs-msg-atendente .cs-msg-status .cs-check,
.cs-msg-atendente .cs-msg-hora {
    color: #d9fff7;
}
.cs-msg-atendente .cs-msg-status .cs-check.lido {
    color: #8be0ff;
}
.cs-typing {
    align-self: flex-start;
    background: #eef4f4;
    border: 1px solid #dce8e8;
    color: #666;
    border-bottom-left-radius: 4px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    padding: 10px 14px;
    border-radius: 12px;
    max-width: 78%;
}
.cs-typing-dots {
    display: inline-flex;
    align-items: center;
    gap: 3px;
}
.cs-typing-dots i {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #8aa;
    display: block;
    animation: csTypingPulso 1.2s infinite ease-in-out;
}
.cs-typing-dots i:nth-child(2) { animation-delay: .15s; }
.cs-typing-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes csTypingPulso {
    0%, 60%, 100% { transform: translateY(0); opacity: .45; }
    30% { transform: translateY(-4px); opacity: 1; }
}
.af-acc {
    background: var(--card);
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 10px;
    margin-bottom: 10px;
    overflow: hidden;
}
.af-acc-cab {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    cursor: pointer;
    user-select: none;
}
.af-acc-cab:hover { background: #ecf4f4; }
.af-acc-bola {
    width: 11px;
    height: 11px;
    border-radius: 50%;
    flex: 0 0 auto;
    background: #b0b0b0;
}
.af-acc-bola.on {
    background: #2e7d32;
    box-shadow: 0 0 0 3px rgba(46, 125, 50, .18);
}
.af-acc-nome {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 15px;
}
.af-acc-login {
    display: inline-block;
    margin-left: 6px;
    font-size: 12px;
    font-weight: 400;
    color: var(--text-muted, #666);
}
.af-acc-seta {
    flex: 0 0 auto;
    width: 8px;
    height: 8px;
    border-right: 2px solid var(--text-muted, #666);
    border-bottom: 2px solid var(--text-muted, #666);
    transform: rotate(45deg);
    margin: -4px 4px 0 0;
    transition: transform .2s;
}
.af-acc.aberto .af-acc-seta { transform: rotate(225deg); margin: 0 4px 0 0; }
.af-acc-corpo {
    display: none;
    padding: 0 16px 16px;
    border-top: 1px solid var(--border, #e2e8f0);
}
.af-acc.aberto .af-acc-corpo { display: block; }
.af-info-topo {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px 18px;
    margin: 14px 0 0;
}
.af-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px 18px;
    margin: 14px 0 16px;
}
.af-info-linha {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}
.af-info-rot {
    font-size: 12px;
    color: var(--text-muted, #666);
    text-transform: uppercase;
    letter-spacing: .4px;
}
.af-acoes {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.nav-on {
    color: #7ad5c4;
    font-weight: 700;
    font-size: 13px;
}
@media (max-width: 768px) {
    .af-acoes {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }
    .af-acoes .btn {
        width: 100%;
        margin: 0;
    }
}

/* Modal "Enviar cupom de desconto" (selecao + criar novo) */
.cs-modal-largo {
    max-width: 560px;
}
.cs-modal-overlay-top {
    z-index: 30020;
}
.cs-modal-corpo-scroll {
    max-height: 70vh;
    overflow-y: auto;
}
.cs-cupom-lista {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.cs-cupom-item {
    border: 1px solid #e0ecec;
    border-radius: 10px;
    padding: 10px 12px;
    cursor: pointer;
    background: #fff;
    transition: border-color .15s, background .15s;
}
.cs-cupom-item:hover {
    border-color: var(--primary);
    background: #f0faf9;
}
.cs-cupom-topo {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.cs-cupom-topo b {
    font-size: 14px;
    letter-spacing: .3px;
    word-break: break-all;
}
.cs-cupom-desc {
    flex: 0 0 auto;
    font-size: 12px;
    font-weight: 700;
    color: var(--primary);
    background: rgba(25, 76, 76, .08);
    border: 1px solid rgba(25, 76, 76, .18);
    border-radius: 20px;
    padding: 3px 10px;
}
.cs-cupom-info {
    margin-top: 4px;
    font-size: 12px;
    color: #777;
    line-height: 1.5;
}
.cs-cupom-lista .cs-lista-vazio {
    text-align: center;
    padding: 22px 10px;
    color: #888;
}
.af-filtros {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-end;
    margin: 4px 0 16px;
    padding: 14px;
    background: var(--card, #FFFFFF);
    border: 1px solid var(--border, #e2e8f0);
    border-radius: var(--radius, 8px);
}
#afBuscaTexto.af-busca {
    flex: 1 1 220px;
    min-width: 0;
    padding: 9px 12px;
    font-size: 14px;
    color: var(--text, #333333);
    background: var(--card, #FFFFFF);
    border: 1px solid var(--border, #e2e8f0);
    border-radius: var(--radius, 8px);
}
#afBuscaTexto.af-busca:focus {
    outline: none;
    border-color: var(--accent, #339999);
    box-shadow: 0 0 0 2px rgba(51, 153, 153, .18);
}
.af-filtro-campo {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.af-filtro-campo label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted, #666666);
}
.af-filtro-campo select {
    padding: 9px 12px;
    font-size: 14px;
    color: var(--text, #333333);
    background: var(--card, #FFFFFF);
    border: 1px solid var(--border, #e2e8f0);
    border-radius: var(--radius, 8px);
}
.af-filtro-campo select:focus {
    outline: none;
    border-color: var(--accent, #339999);
}
.af-grupo {
    margin-bottom: 22px;
}
.af-grupo-titulo {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 14px;
    margin-bottom: 10px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .3px;
    color: var(--primary, #194c4c);
    background: rgba(25, 76, 76, .06);
    border-left: 3px solid var(--primary, #194c4c);
    border-radius: var(--radius, 8px);
}
.af-grupo-titulo small {
    font-size: 12px;
    font-weight: 700;
    color: var(--card, #FFFFFF);
    background: var(--accent, #339999);
    border-radius: 12px;
    padding: 2px 9px;
    line-height: 1.5;
}
@media (max-width: 768px) {
    .af-filtros {
        padding: 12px;
    }
    .af-filtro-campo {
        flex: 1 1 calc(50% - 6px);
        min-width: 0;
    }
    #afBuscaTexto.af-busca {
        flex: 1 1 100%;
    }
}

/* ---- Pilates Clinico ---- */
.pil-abas {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    border-bottom: 2px solid #e2e8f0;
    margin-bottom: 20px;
}
.pil-aba {
    padding: 10px 18px;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    border-radius: 8px 8px 0 0;
    background: transparent;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s;
}
.pil-aba:hover {
    color: var(--primary, #194c4c);
    background: var(--lighter, #e0f2f2);
}
.pil-aba.ativa {
    color: #fff;
    background: var(--primary, #194c4c);
    border-color: var(--primary, #194c4c);
}
.pil-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-bottom: 18px;
}
.pil-btn,
.pil-btn-primario {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    line-height: 1;
    border: none;
    border-radius: var(--radius, 8px);
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}
.pil-btn {
    background: var(--lighter, #e0f2f2);
    color: var(--primary, #194c4c);
    border: 1px solid var(--border, #e2e8f0);
}
.pil-btn:hover {
    background: #cfe8e8;
}
.pil-btn-primario {
    background: var(--primary, #194c4c);
    color: #fff;
}
.pil-btn-primario:hover {
    background: var(--accent, #339999);
}
.pil-btn svg,
.pil-btn-primario svg,
.pil-btn-ico svg {
    width: 16px;
    height: 16px;
}
.pil-btn-ico {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    padding: 0;
    background: transparent;
    color: var(--primary, #194c4c);
    border: 1px solid var(--border, #e2e8f0);
    border-radius: var(--radius, 8px);
    cursor: pointer;
    transition: all 0.2s;
}
.pil-btn-ico:hover {
    background: var(--lighter, #e0f2f2);
}
.pil-btn-ico.pil-btn-perigo {
    color: var(--danger, #D32F2F);
}
.pil-btn-ico.pil-btn-perigo:hover {
    background: #fdecea;
    border-color: var(--danger, #D32F2F);
}
.pil-btn.pil-btn-perigo {
    color: var(--danger, #D32F2F);
    background: #fdecea;
    border-color: #f5c6c3;
}
.pil-btn-sm {
    padding: 6px 14px;
    font-size: 13px;
}
.pil-vazio {
    padding: 28px 20px;
    text-align: center;
    color: var(--text-muted, #666666);
    background: #f7fbfb;
    border: 1px dashed var(--border, #e2e8f0);
    border-radius: var(--radius, 8px);
}
.pil-turma {
    background: var(--card, #FFFFFF);
    border: 1px solid var(--border, #e2e8f0);
    border-radius: var(--radius, 8px);
    padding: 16px 18px;
    margin-bottom: 14px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .04);
}
.pil-turma.inativo {
    opacity: .6;
}
.pil-turma-cabecalho {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}
.pil-turma-titulo {
    font-size: 16px;
    font-weight: 700;
    color: var(--primary, #194c4c);
}
.pil-turma-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}
.pil-turma-detalhes {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 14px;
    color: var(--text, #333333);
}
.pil-turma-rodape {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid #f0f0f0;
}
.pil-label {
    font-weight: 600;
    color: var(--text-muted, #666666);
}
.pil-config {
    max-width: 560px;
    background: var(--card, #FFFFFF);
    border: 1px solid var(--border, #e2e8f0);
    border-radius: var(--radius, 8px);
    padding: 20px 22px;
}
.pil-config h3 {
    margin: 0 0 16px;
    font-size: 17px;
    color: var(--primary, #194c4c);
}
.pil-form-grupo {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 14px;
}
.pil-form-grupo label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted, #666666);
}
.pil-input {
    width: 100%;
    box-sizing: border-box;
    padding: 10px 12px;
    font-family: inherit;
    font-size: 14px;
    color: var(--text, #333333);
    background: #fff;
    border: 1px solid var(--border, #e2e8f0);
    border-radius: var(--radius, 8px);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.pil-input:focus {
    border-color: var(--accent, #339999);
    box-shadow: 0 0 0 3px rgba(51, 153, 153, .15);
}
textarea.pil-input {
    resize: vertical;
}
.pil-tabela {
    width: 100%;
    border-collapse: collapse;
    background: var(--card, #FFFFFF);
    border-radius: var(--radius, 8px);
    overflow: hidden;
    font-size: 14px;
}
.pil-tabela th,
.pil-tabela td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid #f0f0f0;
}
.pil-tabela th {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .3px;
    color: var(--text-muted, #666666);
    background: #f7fbfb;
}
.pil-tabela tbody tr:hover {
    background: #fafefe;
}
.pil-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}
.pil-badge-ok {
    background: #e6f4ea;
    color: #2e7d32;
    border: 1px solid #c3e6cb;
}
.pil-badge-off {
    background: #fdecea;
    color: var(--danger, #D32F2F);
    border: 1px solid #f5c6c3;
}
.pil-historico,
.pil-planos,
.pil-minhas {
    display: block;
}
.pil-hist-turma {
    margin-bottom: 18px;
}
.pil-hist-titulo {
    font-size: 15px;
    font-weight: 700;
    color: var(--primary, #194c4c);
    margin-bottom: 8px;
}
.pil-modal-fundo {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, .5);
    z-index: 10000;
    justify-content: center;
    align-items: center;
    padding: 20px;
}
.pil-modal-fundo.active {
    display: flex;
}
.pil-modal {
    background: var(--card, #FFFFFF);
    border-radius: var(--radius-lg, 12px);
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 12px 32px rgba(0, 0, 0, .2);
}
.pil-modal-grande {
    max-width: 760px;
}
.pil-modal-cabecalho {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 18px 22px;
    border-bottom: 1px solid #f0f0f0;
}
.pil-modal-cabecalho h3 {
    margin: 0;
    font-size: 18px;
    color: var(--primary, #194c4c);
}
.pil-modal-corpo {
    padding: 22px;
}
.pil-modal-rodape {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 22px;
    border-top: 1px solid #f0f0f0;
}
.pil-part-busca {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 14px;
}
.pil-part-busca .pil-input {
    flex: 1 1 240px;
}
.pil-part-resultado,
.pil-part-lista {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.pil-part-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid var(--border, #e2e8f0);
    border-radius: var(--radius, 8px);
    background: #fff;
}
.pil-check {
    width: 18px;
    height: 18px;
    accent-color: var(--accent, #339999);
    cursor: pointer;
}
.pil-ch-info {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 14px;
}
.pil-ch-lista {
    margin-top: 6px;
}
.pil-ch-evo-texto {
    min-height: 38px;
    display: inline-block;
}
.pil-ch-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid #f0f0f0;
    border-radius: var(--radius, 8px);
}
.pil-tabela-chamada {
    border-radius: 0;
    overflow: visible;
    min-width: 100%;
}
.pil-tabela-chamada th,
.pil-tabela-chamada td {
    padding: 8px 10px;
    vertical-align: top;
    white-space: nowrap;
}
.pil-tabela-chamada th.pil-ch-pac,
.pil-tabela-chamada td.pil-ch-pac {
    position: sticky;
    left: 0;
    z-index: 1;
    background: #fff;
    font-weight: 600;
    border-right: 1px solid #ececec;
}
.pil-tabela-chamada th.pil-ch-pac {
    background: #f7fbfb;
    z-index: 2;
}
.pil-ch-dia {
    text-align: center;
}
.pil-ch-vazio {
    text-align: center;
    color: #c8c8c8;
    background: #fafafa;
}
.pil-ch-cel {
    min-width: 150px;
}
.pil-ch-pres {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 6px;
    cursor: pointer;
}
.pil-ch-ap {
    width: 100%;
    margin-bottom: 4px;
}
.pil-ch-evo {
    width: 100%;
    font-size: 13px;
    resize: vertical;
}
.pil-ch-ciclo {
    font-size: 12px;
    color: var(--text-muted, #666666);
}
.pil-erro {
    padding: 12px 14px;
    margin-bottom: 14px;
    font-size: 14px;
    color: var(--danger, #D32F2F);
    background: #fdecea;
    border: 1px solid #f5c6c3;
    border-radius: var(--radius, 8px);
}
@media (max-width: 768px) {
    .pil-abas {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .pil-aba {
        white-space: nowrap;
    }
    .pil-turma-cabecalho {
        flex-direction: column;
    }
    .pil-turma-rodape .pil-btn {
        flex: 1 1 calc(50% - 5px);
        justify-content: center;
    }
    .pil-part-busca .pil-input {
        flex: 1 1 100%;
    }
    .pil-modal-fundo {
        padding: 12px;
    }
    .pil-modal-cabecalho,
    .pil-modal-corpo,
    .pil-modal-rodape {
        padding-left: 16px;
        padding-right: 16px;
    }
    .pil-tabela th,
    .pil-tabela td {
        padding: 8px 10px;
    }
    .pil-tabela-chamada thead {
        display: none;
    }
    .pil-tabela-chamada,
    .pil-tabela-chamada tbody {
        display: block;
    }
    .pil-tabela-chamada tr.pil-ch-row {
        display: block;
        margin-bottom: 10px;
        border: 1px solid var(--border, #e2e8f0);
        border-radius: var(--radius, 8px);
        overflow: hidden;
    }
    .pil-tabela-chamada td.pil-ch-pac {
        display: flex;
        align-items: center;
        justify-content: space-between;
        position: static;
        padding: 12px 14px;
        font-weight: 600;
        background: var(--lighter, #f0faf9);
        cursor: pointer;
    }
    .pil-ch-pac-seta::after {
        content: '\25BE';
        font-size: 12px;
        transition: transform .2s;
    }
    .pil-tabela-chamada tr.aberto .pil-ch-pac-seta::after {
        transform: rotate(180deg);
    }
    .pil-tabela-chamada .pil-ch-vazio {
        display: none;
    }
    .pil-tabela-chamada td.pil-ch-cel {
        display: none;
        min-width: 0;
        white-space: normal;
        padding: 12px 14px;
        border-top: 1px solid var(--border, #e2e8f0);
    }
    .pil-tabela-chamada tr.aberto td.pil-ch-cel {
        display: block;
    }
    .pil-tabela-chamada td.pil-ch-cel::before {
        content: attr(data-dia);
        display: block;
        margin-bottom: 8px;
        font-weight: 600;
        color: var(--primary, #194c4c);
    }
    .pil-tabela-chamada td.pil-ch-cel .pil-ch-ap,
    .pil-tabela-chamada td.pil-ch-cel .pil-ch-evo {
        width: 100%;
        box-sizing: border-box;
    }
}
.bh-int-bloco {
    margin: 4px 0 6px;
}
.bh-int-label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
}
.bh-int-labels {
    display: grid;
    grid-template-columns: 1fr 1fr 96px 80px;
    gap: 8px;
    font-size: 12px;
    color: var(--text-muted, #64748b);
    margin-bottom: 4px;
}
.bh-intervalo {
    display: grid;
    grid-template-columns: 1fr 1fr 96px 80px;
    gap: 8px;
    align-items: center;
    margin-bottom: 8px;
}
.bh-intervalo .form-control {
    width: 100%;
}
.bh-int-add {
    margin: 2px 0 6px;
}
@media (max-width: 768px) {
    .bh-int-labels {
        grid-template-columns: 1fr 1fr 84px;
    }
    .bh-int-labels span:last-child {
        display: none;
    }
    .bh-intervalo {
        grid-template-columns: 1fr 1fr 84px;
    }
    .bh-intervalo .bh-int-rem {
        grid-column: 1 / -1;
    }
}

/* Financeiro - fontes dos cards nao estouram no mobile */
#finCards .stat-number {
    white-space: nowrap;
    overflow: hidden;
}

/* Financeiro - graficos rosca por categoria */
.fin-donut-flex {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
}
.fin-donut-box {
    flex: 1 1 280px;
    min-width: 260px;
}
.fin-donut-titulo {
    font-weight: 600;
    margin-bottom: 12px;
}
.fin-donut-wrap {
    position: relative;
    width: 170px;
    height: 170px;
    margin: 0 auto 14px;
}
.fin-donut {
    width: 170px;
    height: 170px;
    border-radius: 50%;
}
.fin-donut-centro {
    position: absolute;
    top: 22px;
    left: 22px;
    right: 22px;
    bottom: 22px;
    border-radius: 50%;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: 14px;
    box-shadow: 0 0 0 1px rgba(25, 76, 76, 0.08);
}
.fin-donut-centro b {
    font-weight: 800;
}
.fin-donut-vazio {
    color: var(--text-muted, #64748b);
    font-size: 13px;
    padding: 10px 0;
    text-align: center;
}
.fin-donut-legenda {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.fin-donut-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}
.fin-donut-dot {
    width: 10px;
    height: 10px;
    border-radius: 3px;
    flex: 0 0 auto;
}
.fin-donut-nome {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.fin-donut-valor {
    font-weight: 600;
}
.fin-donut-pct {
    color: var(--text-muted, #64748b);
    width: 52px;
    text-align: right;
}

/* Financeiro - Plano de Acao (FisIA) */
.fin-plano-body {
    padding: 2px 0;
}
.fin-plano-body .form-grid {
    margin-bottom: 14px;
}
.fin-plano-acoes {
    display: flex;
    justify-content: flex-end;
}
.fin-plano-res {
    margin-top: 14px;
}
.fin-plano-linha {
    padding: 10px 12px;
    border-left: 3px solid var(--primary, #194c4c);
    border-radius: 6px;
    background: rgba(25, 76, 76, 0.04);
    margin-bottom: 8px;
    font-size: 14px;
    line-height: 1.6;
    white-space: pre-wrap;
}
.fin-plano-vazio {
    color: var(--text-muted, #64748b);
    font-size: 13px;
}

@media (max-width: 768px) {
    .fin-donut-flex {
        flex-direction: column;
        gap: 18px;
    }
    .fin-donut-box {
        min-width: 0;
    }
}

/* ===== Produtos ===== */
.prod-colunas2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
.prod-sug {
    padding: 8px 12px;
    background: rgba(25, 76, 76, 0.06);
    border: 1px solid rgba(25, 76, 76, 0.15);
    border-radius: 8px;
    font-size: 13px;
    color: var(--texto, #1e293b);
}
.prod-sug .btn-link {
    padding: 0;
    font-size: 13px;
    text-decoration: underline;
}
.prod-img-group {
    border: 1px dashed var(--border, #cbd5e1);
    border-radius: 10px;
    padding: 12px;
    background: #fafcfc;
}
.prod-img-linha {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}
.prod-img-vazio {
    color: var(--text-muted, #64748b);
    font-size: 13px;
}
.prod-img {
    width: 64px;
    height: 64px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--border, #cbd5e1);
}
.prod-img-controles {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.prod-img-nome {
    font-size: 12px;
    color: var(--text-muted, #64748b);
}
.prod-lista-nome {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}
.prod-lista-img {
    width: 36px;
    height: 36px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid var(--border, #cbd5e1);
    flex-shrink: 0;
}
.prod-lista-nome-txt {
    min-width: 0;
}
.prod-est-tag {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}
.prod-est-ok { background: #e8f5e9; color: #2e7d32; }
.prod-est-baixo { background: #fff3e0; color: #e65100; }
.prod-est-zerado { background: #ffebee; color: #c62828; }
.prod-aviso {
    border: 1px solid #f3c88b;
    background: #fff8ec;
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 16px;
}
.prod-aviso-titulo {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 700;
    color: #a05a00;
    margin-bottom: 6px;
    font-size: 14px;
}
.prod-aviso-item {
    font-size: 13px;
    color: #7a4b00;
    line-height: 1.7;
}
.prod-aviso-item b { color: #5c3800; }

@media (max-width: 768px) {
    .prod-colunas2 {
        grid-template-columns: 1fr;
    }
}

/* Produtos - variacoes (estoque e preco proprios por variacao) */
.prod-var-secao {
    margin-top: 2px;
}
.prod-var-titulo {
    font-weight: 700;
    font-size: 13px;
    color: var(--primary, #194c4c);
    margin-bottom: 6px;
}
.prod-var-hint {
    font-size: 12px;
    color: var(--text-muted, #64748b);
    line-height: 1.6;
    margin-bottom: 8px;
    display: block;
}
.prod-var-linha {
    display: grid;
    grid-template-columns: 1fr 110px 100px 34px;
    gap: 8px;
    margin-bottom: 8px;
    align-items: center;
}
.prod-var-add {
    margin-top: 2px;
}
.prod-var-rem {
    width: 34px;
    height: 34px;
    border: 1px solid #e2e8f0;
    background: transparent;
    border-radius: 8px;
    color: #b91c1c;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.prod-var-rem:hover {
    background: #fef2f2;
}
@media (max-width: 768px) {
    .prod-var-linha {
        grid-template-columns: 1fr 90px 80px 34px;
    }
}
#menuNav a.dica-alvo {
    background: #395d5d;
    color: #ffffff;
    font-weight: 700;
}
#menuNav a.dica-alvo svg {
    color: #ffffff;
}
@keyframes dicaAlvoPulso {
    0%, 100% {
        box-shadow: inset 0 0 0 2px #22c55e, 0 0 0 0 rgba(34, 197, 94, 0.9);
    }
    50% {
        box-shadow: inset 0 0 0 2px #22c55e, 0 0 0 5px rgba(34, 197, 94, 0.55), 0 0 0 10px rgba(34, 197, 94, 0);
    }
}
.fisia-wrap.dica-alvo-fisia {
    z-index: 30000;
}
.fisia-wrap.dica-alvo-fisia .fisia-btn {
    border-color: #22c55e;
    animation: dicaAlvoPulso 1.2s ease-in-out infinite;
}
#dicaSpot {
    display: none;
    position: fixed;
    z-index: 9999;
    border: 2px solid #22c55e;
    border-radius: 8px;
    box-shadow: 0 0 0 9999px rgba(8, 10, 22, 0.72);
    pointer-events: none;
}
#dicaSpot.ativo {
    display: block;
    animation: dicaSpotPulso 1.2s ease-in-out infinite;
}
@keyframes dicaSpotPulso {
    0%, 100% {
        border-color: #22c55e;
        box-shadow: 0 0 0 9999px rgba(8, 10, 22, 0.72);
    }
    50% {
        border-color: #4ade80;
        box-shadow: 0 0 0 9999px rgba(8, 10, 22, 0.72), 0 0 20px 2px rgba(34, 197, 94, 0.55);
    }
}
body.dica-cutout-ativo #modalDicas.modal-overlay {
    background: transparent;
}
@media (max-width: 768px) {
    #modalDicas .modal {
        width: 100%;
        max-width: 280px;
    }
}
#modalDicas .modal-footer {
    flex-wrap: wrap;
}
#modalDicas .dicas-checkbox {
    flex: 1 1 100%;
    justify-content: flex-start;
    margin-right: 0;
}
#modalDicas .dicas-botoes {
    flex: 1 1 100%;
    display: flex;
    gap: 10px;
}
.dicas-botoes .btn {
    flex: 1;
    justify-content: center;
}
@media (max-width: 768px) {
    .dicas-voltar .dicas-btn-txt,
    .dicas-prox .dicas-btn-txt {
        display: none;
    }
    .dicas-voltar,
    .dicas-prox {
        flex: 0 0 auto;
        width: 44px;
        padding: 0;
    }
    .dicas-botoes .btn:not(.dicas-voltar):not(.dicas-prox) {
        flex: 1;
    }
}
/* ==================== TUTORIAIS ==================== */
.tut-wrap { padding: 0 0 24px; }
.tut-head { margin-bottom: 20px; }
.tut-head-txt h2 { margin: 0 0 6px; }
.tut-head-txt p { margin: 0 0 10px; color: var(--text-muted, #6b7b80); font-size: 14px; }
.tut-stats { display: flex; flex-wrap: wrap; gap: 10px; }
.tut-stat { font-size: 13px; color: var(--text-muted, #6b7b80); }
.tut-stat b { color: var(--primary, #194c4c); }
.tut-stat-ok b { color: #16a34a; }
.tut-stat-off b { color: #ca8a04; }
.tut-head-acoes { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; align-items: center; }
.tut-head-acoes .form-control { max-width: 260px; }
.tut-head-acoes select.form-control { max-width: 160px; }
.tut-filtros { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.tut-filtros .btn { padding: 6px 14px; font-size: 13px; border-radius: 20px; }
.tut-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
.tut-card { background: #fff; border: 1px solid #e6edef; border-radius: 12px; overflow: hidden; display: flex; flex-direction: column; transition: box-shadow 0.15s, transform 0.15s; }
.tut-card:hover { box-shadow: 0 6px 18px rgba(15,118,110,0.12); transform: translateY(-2px); }
.tut-thumb { position: relative; display: block; width: 100%; aspect-ratio: 16/9; background: #0b1f22; border: 0; padding: 0; cursor: pointer; }
.tut-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tut-play { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; pointer-events: none; }
.tut-play svg { width: 54px; height: 54px; padding: 14px; border-radius: 50%; background: rgba(0,0,0,0.62); color: #fff; }
.tut-card-flag { position: absolute; top: 8px; left: 8px; font-size: 11px; }
.tut-pub { position: absolute; top: 8px; right: 8px; font-size: 11px; background: rgba(25,76,76,0.85); color: #fff; border-radius: 10px; padding: 2px 8px; }
.tut-pub-afiliados { background: rgba(13,110,253,0.85); }
.tut-pub-demais { background: rgba(108,117,125,0.85); }
.tut-info { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.tut-titulo { font-size: 14px; font-weight: 600; color: #1f2d30; line-height: 1.35; word-break: break-word; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.tut-info .btn-block { margin-top: auto; }
.tut-card-toggle { display: flex; align-items: center; gap: 8px; }
.tut-card-toggle-lbl { font-size: 12px; color: var(--text-muted, #6b7b80); }
.tut-ver-todos-wrap { text-align: center; margin: 16px 0 8px; }
.tut-admin { margin-top: 28px; }
.tut-admin h3 { margin: 0 0 10px; }
.tut-admin .muted { margin-bottom: 12px; }
.tut-modal-player { max-width: 900px; width: 95vw; }
.tut-player-wrap { position: relative; width: 100%; aspect-ratio: 16/9; background: #000; border-radius: 8px; overflow: hidden; }
.tut-player-wrap iframe { width: 100%; height: 100%; border: 0; display: block; }
.tut-bloco { margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--border, #e2e8f0); }
.tut-bloco-titulo { margin: 0 0 14px; font-size: 17px; font-weight: 700; color: var(--primary, #194c4c); }
.tut-pub-lbl { font-size: 13px; }

/* ============ VISITANTES ============ */
.visit-stats { margin-bottom: 16px; }
.visit-filtros { display: flex; flex-wrap: wrap; gap: 6px; }
.visit-filtros .btn { padding: 6px 12px; font-size: 12px; border-radius: 20px; }
.visit-fonte-tag { display: inline-block; background: rgba(25,76,76,0.08); color: var(--primary, #194c4c); padding: 2px 8px; border-radius: 10px; font-size: 12px; }
.visit-fontes { font-size: 14px; }
.visit-mobile-acc { display: none; }
.visit-acc { border: 1px solid var(--border, #e2e8f0); border-radius: 10px; margin-bottom: 10px; overflow: hidden; background: var(--card, #fff); }
.visit-acc-cab { display: flex; align-items: center; gap: 10px; padding: 12px 16px; cursor: pointer; background: #f8fafb; user-select: none; transition: background 0.15s; }
.visit-acc-cab:hover { background: #ecf4f4; }
.visit-acc-seta { display: inline-block; width: 8px; height: 8px; border-right: 2px solid var(--primary, #194c4c); border-bottom: 2px solid var(--primary, #194c4c); transform: rotate(-45deg); transition: transform 0.2s; flex-shrink: 0; }
.visit-acc.aberto .visit-acc-seta { transform: rotate(45deg); }
.visit-acc-cab b { font-size: 13px; color: var(--primary, #194c4c); }
.visit-acc-cidade { font-size: 12px; color: var(--text-muted, #6b7b80); margin-left: auto; }
.visit-acc-corpo { display: none; padding: 12px 16px; }
.visit-acc.aberto .visit-acc-corpo { display: block; }
.visit-acc-linha { display: flex; justify-content: space-between; padding: 5px 0; font-size: 13px; border-bottom: 1px solid #f0f0f0; }
.visit-acc-linha span { color: var(--text-muted, #6b7b80); }
.visit-acc-acoes { margin-top: 12px; display: flex; gap: 8px; }
@media (max-width: 768px) {
    .visit-mobile-acc { display: block; }
    .visit-filtros { overflow-x: auto; flex-wrap: nowrap; padding-bottom: 4px; }
    .visit-filtros .btn { white-space: nowrap; flex-shrink: 0; }
}
.tut-acc { border: 1px solid var(--border, #e2e8f0); border-radius: 10px; margin-bottom: 12px; overflow: hidden; }
.tut-acc-cab { display: flex; align-items: center; gap: 10px; padding: 12px 16px; cursor: pointer; background: #f8fafb; user-select: none; transition: background 0.15s; }
.tut-acc-cab:hover { background: #ecf4f4; }
.tut-acc-seta { display: inline-block; width: 10px; height: 10px; border-right: 2px solid var(--primary, #194c4c); border-bottom: 2px solid var(--primary, #194c4c); transform: rotate(-45deg); transition: transform 0.2s; flex-shrink: 0; }
.tut-acc.aberto .tut-acc-seta { transform: rotate(45deg); }
.tut-acc-cab b { flex: 1; font-size: 15px; color: var(--primary, #194c4c); }
.tut-acc-qtd { font-size: 13px; color: var(--text-muted, #6b7b80); }
.tut-acc-corpo { display: none; padding: 0; }
.tut-acc.aberto .tut-acc-corpo { display: block; }
.tut-acc-corpo .table-card { margin: 0; border: 0; border-radius: 0; }
.tut-acc-corpo table th { font-size: 12px; }
@media (max-width: 768px) {
    .tut-grid { grid-template-columns: 1fr; }
    .tut-head-acoes { flex-direction: column; }
    .tut-head-acoes .form-control { max-width: 100%; }
    .tut-head-acoes select.form-control { max-width: 100%; }
}
.tele-card { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 12px; }
.tele-card-info { flex: 1; min-width: 0; }
.tele-card-obj { font-size: 16px; font-weight: 700; color: var(--primary, #194c4c); margin-bottom: 6px; }
.tele-card-linha { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-muted, #6b7b80); margin-top: 4px; }
.tele-card-acoes { display: flex; gap: 8px; flex-shrink: 0; }
.tele-badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.tele-badge-aguardando { background: #fff3cd; color: #856404; }
.tele-badge-em_andamento { background: #d4edda; color: #155724; }
.tele-badge-encerrado { background: #e9ecef; color: #6c757d; }
.tele-sala { display: flex; flex-direction: column; gap: 14px; }
.tele-videos { display: flex; gap: 12px; align-items: stretch; }
.tele-video-wrap { position: relative; flex: 1; min-width: 0; background: #111; border-radius: 12px; overflow: hidden; aspect-ratio: 16 / 9; }
.tele-video-wrap video { width: 100%; height: 100%; object-fit: cover; display: block; background: #111; }
.tele-video-local-wrap { max-width: 260px; }
.tele-video-tag { position: absolute; left: 10px; bottom: 10px; background: rgba(0,0,0,0.55); color: #fff; font-size: 12px; padding: 3px 10px; border-radius: 999px; }
.tele-controles { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.tele-btn-off { background: #f8d7da; color: #721c24; border-color: #f5c6cb; }
.tele-aviso { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-muted, #6b7b80); margin: 0; }
.tele-notas textarea { width: 100%; margin: 10px 0; }
.tele-notas-acoes { display: flex; gap: 8px; flex-wrap: wrap; }
.tele-transcricao-titulo { font-size: 11px; font-weight: 700; color: var(--text-muted, #6b7b80); text-transform: uppercase; letter-spacing: 0.4px; margin-top: 10px; }
.tele-transcricao-viva { max-height: 200px; overflow-y: auto; background: #f7faf9; border: 1px solid #e2e8e7; border-radius: 8px; padding: 10px 12px; margin-top: 6px; font-size: 13px; line-height: 1.55; }
.tele-transcricao-linha { margin: 0 0 6px; }
.tele-transcricao-linha strong { color: var(--primary, #194c4c); }
.tele-erro { color: #b02a37; font-weight: 600; }
.tele-cronometro-wrap { display: flex; align-items: center; gap: 12px; justify-content: center; }
.tele-cronometro { font-size: 26px; font-weight: 800; color: var(--primary, #194c4c); background: #eef7f5; border: 2px solid var(--primary, #194c4c); border-radius: 12px; padding: 6px 18px; font-variant-numeric: tabular-nums; }
.tele-cronometro-alerta { color: #b02a37; border-color: #b02a37; background: #fdecea; }
.tele-cronometro-label { font-size: 12px; color: var(--text-muted, #6b7b80); }
.aniv-svg { display: flex; justify-content: center; padding: 4px 0 2px; }
.aniv-sub { text-align: center; margin: 6px 0 12px; }
.aniv-acoes { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin: 10px 0; }
.aniv-painel { border-top: 1px solid #e2e8f0; margin-top: 8px; padding-top: 10px; }
.sidebar-logout-mobile { display: none; }
@media (max-width: 768px) {
    .sidebar-logout-mobile {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        padding: 12px 0;
        background: rgba(229, 57, 53, 0.12);
        border: none;
        border-top: 1px solid rgba(255,255,255,0.1);
        cursor: pointer;
        flex-shrink: 0;
    }
    .sidebar-logout-mobile:active { background: rgba(229, 57, 53, 0.28); }
    .sidebar.sidebar-expanded .sidebar-logout-mobile { display: none; }
}
.ag-acc-detalhes .ag-acc-item { margin: 8px 0 0; }
.ag-acc-detalhes .ag-acc-detalhes { background: rgba(0,0,0,0.03); border-radius: 8px; }
.tele-card-status-txt { font-size: 13px; color: var(--text-muted, #6b7b80); font-weight: 600; padding: 8px 4px; }
.tele-videos-wrap { position: relative; }
.tele-aguardando { position: absolute; inset: 0; background: rgba(255,255,255,0.93); border-radius: 12px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; z-index: 5; }
.tele-aguardando-spin { width: 42px; height: 42px; border: 4px solid #d7e6e3; border-top-color: var(--primary, #194c4c); border-radius: 50%; animation: tele-girar 0.9s linear infinite; }
.tele-aguardando-txt { font-size: 15px; font-weight: 600; color: var(--primary, #194c4c); }
@keyframes tele-girar { to { transform: rotate(360deg); } }
@media (max-width: 768px) {
    .tele-card { flex-direction: column; align-items: stretch; }
    .tele-card-acoes .btn { width: 100%; }
    .tele-videos { flex-direction: column; }
    .tele-video-local-wrap { max-width: 100%; }
    .tele-notas-acoes .btn { flex: 1 1 45%; }
}

/* ---- Termografia: explicacoes (Observacoes/Conclusao) na impressao ----
   Quebra palavras longas (nada e cortado pela margem), divide em varias
   paginas com folga do rodape fixo e evita titulo orfao no fim da pagina. */
#printDoc .doc-conclusao {
  page-break-inside: auto;
  overflow-wrap: break-word;
  word-wrap: break-word;
}
#printDoc .doc-conclusao h3 {
  page-break-after: avoid;
}
#printDoc .doc-conclusao p {
  overflow-wrap: break-word;
  word-wrap: break-word;
  orphans: 2;
  widows: 2;
  margin: 0;
}
@media print {
  #printDoc .doc-conclusao { padding-bottom: 72px; }
}

/* Observacoes / conclusao clinica da Termografia (rich-text) */
#termoObsToolbar { border: 1px solid #d5e3e3; border-bottom: none; border-radius: 8px 8px 0 0; }
#termoObservacoes { min-height: 120px; }
#termoObservacoes ul, #termoObservacoes ol { padding-left: 22px; }
#termoObservacoes p { margin: 0 0 6px; }
.termo-check-item { accent-color: var(--primary); }
#printDoc .doc-obs-rico { font-size: 11px; line-height: 1.6; overflow-wrap: break-word; word-wrap: break-word; }
#printDoc .doc-obs-rico p { margin: 0 0 6px; overflow-wrap: break-word; word-wrap: break-word; orphans: 2; widows: 2; }
#printDoc .doc-obs-rico ul, #printDoc .doc-obs-rico ol { margin: 0 0 6px; padding-left: 18px; }
#printDoc .doc-obs-rico li { margin-bottom: 2px; }
#printDoc .doc-obs-rico b, #printDoc .doc-obs-rico strong { font-weight: 700; }

/* ============ Sanfona de análises salvas (aba Vendas) ============ */
.vnd-analise-grupo { border: 1px solid var(--border); border-radius: 8px; margin: 12px 0; overflow: hidden; }
.vnd-analise-grupo-cab {
  background: var(--bg-card, #fff); padding: 10px 14px; cursor: pointer;
  display: flex; align-items: center; justify-content: space-between; font-weight: 700;
  color: var(--primary);
}
.vnd-analise-grupo-cab:hover { background: var(--bg-hover, #f0f0f0); }
.vnd-analise-grupo-seta { font-size: 12px; transition: transform .2s; }
.vnd-analise-grupo-corpo { padding: 12px; border-top: 1px solid var(--border); }

.vnd-analise-item {
  border: 1px solid var(--border); border-radius: 8px; margin: 8px 0; overflow: hidden;
  background: var(--bg-card, #fff);
}
.vnd-analise-cab {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px; background: var(--bg-hover, #f5f5f5);
  flex-wrap: wrap; gap: 8px;
}
.vnd-analise-botoes-desktop {
  display: flex; gap: 6px; align-items: center;
}
.vnd-analise-cab .btn {
  font-size: 13px;
  padding: 6px 10px;
}
.vnd-analise-cab .btn svg {
  width: 16px; height: 16px;
}
.vnd-analise-data { font-size: 12px; font-weight: 700; color: var(--text-muted, #888); }
.vnd-analise-vendas { font-size: 13px; color: var(--primary); }
.vnd-analise-receita { font-size: 13px; color: #2e7d32; }
.vnd-analise-resumo {
  padding: 8px 14px; font-size: 13px; color: var(--text-muted, #888); border-bottom: 1px solid var(--border);
}
.vnd-analise-conteudo { padding: 12px 14px; }
.vnd-analise-html { line-height: 1.7; font-size: 14px; }
.vnd-analise-html b, .vnd-analise-html strong { color: var(--primary); }
.vnd-analise-html em { color: #555; }
.vnd-analise-html u { text-decoration: underline; }
.vnd-analise-html ul { margin: 6px 0 6px 20px; padding-left: 0; }
.vnd-analise-html li { margin-bottom: 3px; }
.vnd-analise-botoes { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.vnd-analise-botoes .btn { font-size: 13px; white-space: nowrap; }

/* Tabelas dentro da análise (markdown convertido) */
.tabela-analise {
  width: 100%;
  border-collapse: collapse;
  margin: 10px 0;
  font-size: 13px;
}
.tabela-analise th,
.tabela-analise td {
  border: 1px solid var(--border, #ccc);
  padding: 6px 8px;
  text-align: left;
}
.tabela-analise th {
  background: var(--bg-hover, #f5f5f5);
  font-weight: 700;
  color: var(--primary);
}
.tabela-analise tr:nth-child(even) {
  background: #fafafa;
}

/* Impressão: espaço para o rodapé não cortar conteúdo */
@media print {
  #printDoc .doc-conteudo-analise {
    padding-bottom: 60px;
  }
  #printDoc .doc-conteudo-analise table,
  #printDoc .doc-conteudo-analise p,
  #printDoc .doc-conteudo-analise h2,
  #printDoc .doc-conteudo-analise h3,
  #printDoc .doc-conteudo-analise h4,
  #printDoc .doc-conteudo-analise ul,
  #printDoc .doc-conteudo-analise ol {
    page-break-inside: avoid;
  }
  #printDoc .tabela-analise {
    page-break-inside: avoid;
  }
}

/* Mobile: layout vertical para dados e botões de cada análise */
@media (max-width: 768px) {
  .vnd-analise-cab {
    flex-direction: column; align-items: flex-start;
  }
  .vnd-analise-botoes {
    flex-direction: column;
  }
  .vnd-analise-botoes .btn {
    width: 100%;
  }
  .vnd-analise-grupo-cab {
    flex-direction: column; align-items: flex-start; gap: 6px;
  }
  .vnd-analise-grupo-seta {
    align-self: flex-end;
  }
}

/* ============ Despesas recorrentes (aba Financeiro) ============ */
.fin-recorrente-box {
  margin-top: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 10px;
  background: var(--bg-card, #fff);
}
.fin-rec-badge {
  display: block;
  margin-top: 3px;
  font-size: 11px;
  font-weight: 600;
  color: var(--primary, #339999);
}

/* Popup de aviso de despesas próximas do vencimento */
.desp-aviso-lista {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.desp-aviso-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 10px;
  background: var(--bg-hover, #f9fafb);
  flex-wrap: wrap;
}
.desp-aviso-item-info { flex: 1; min-width: 180px; }
.desp-aviso-item-desc { font-weight: 700; font-size: 14px; }
.desp-aviso-item-sub { font-size: 12px; color: var(--text-muted, #888); margin-top: 3px; }
.desp-aviso-dias {
  display: inline-block;
  margin-left: 8px;
  font-weight: 700;
}
.desp-aviso-item-acoes {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.desp-aviso-valor {
  font-weight: 800;
  color: #c62828;
  white-space: nowrap;
}

/* Mobile: empilha os itens do aviso de despesas */
@media (max-width: 768px) {
  .desp-aviso-item {
    flex-direction: column;
    align-items: flex-start;
  }
  .desp-aviso-item-acoes {
    width: 100%;
    justify-content: space-between;
  }
}
