/*
 * adminator-app.css
 * ---------------------------------------------------------------------------
 * Complemento do design system do Adminator (wwwroot/adminator/style.css).
 *
 * As paginas usam os componentes nativos do Adminator (.card, .table, .field,
 * .btn--*, .tag, .alert, .modal) e do Bootstrap fica apenas a camada de
 * UTILITARIOS (espacamento, flex, display, texto). Medido: adminator/style.css
 * x bootstrap-utilities.min.css = ZERO colisoes de seletor. Por isso nao ha
 * mais nenhuma disputa entre os dois arquivos.
 *
 * Ordem de carga no layout:
 *   1. adminator/style.css            -> shell, tokens e componentes
 *   2. bootstrap-utilities.min.css    -> so utilitarios
 *   3. este arquivo                   -> tokens dos utilitarios + o que falta
 */

/* ==========================================================================
   0. Marca — Instituto Beneví. Tipografia (Poppins) e paleta (verde petroleo
      + dourado + cinza) sobrepostas aos tokens do Adminator. --primary e lido
      por mais de cem regras do vendor (botoes, links, foco, estado ativo),
      entao redefini-lo aqui ja propaga a marca pelo sistema inteiro sem tocar
      no arquivo do template.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800&display=swap');

:root {
    --gold: #b98a2e;
    --gold-light: #e4c888;
    --gold-dark: #8a692a;
    --gold-soft: #fbf3e1;
    --gold-ring: rgba(185, 138, 46, .25);
    --gold-gradient: linear-gradient(135deg, #8a692a, #e4c888 50%, #b98a2e 100%);
    --gray: #6b7280;
    --gray-soft: #f1f2f4;

    /* Preto e branco puros ja existem como --t-base/--t-inverse (invertem
       com o tema); estes ficam disponiveis para quem precisar do valor fixo. */
    --color-white: #fff;
    --color-black: #000;
}

/* :root[data-theme=...] (nao so [data-theme=...]): o vendor define --primary
   nesse mesmo seletor com :root, que tem especificidade maior — sem o :root
   aqui, esta sobrescrita perde a cascata mesmo carregando por ultimo. */
:root[data-theme=light] {
    --primary: #074038;
    --primary-light: #0e5f4f;
    --primary-dark: #052d26;
    --primary-soft: #e6f0ed;
    --primary-ring: rgba(7, 64, 56, .18);
}

:root[data-theme=dark] {
    --primary: #22a67f;
    --primary-light: #4fcba6;
    --primary-dark: #0f7a5c;
    --primary-soft: #0f2a22;
    --primary-ring: rgba(34, 166, 127, .24);
    --gold: #e0bb6a;
    --gold-light: #f0d9a2;
    --gold-dark: #a9853f;
    --gold-soft: #2e2510;
    --gray: #9ca3af;
    --gray-soft: #20242b;
}

/* Poppins vira a fonte do sistema. Os rotulos em versalete/monoespacado
   (cabecalhos de tabela, timestamps, paleta de comando, calendario, chat)
   continuam em JetBrains Mono: e um acento tipografico do template, nao
   texto corrido, e a marca nao pede para tira-lo. */
* {
    font-family: 'Poppins', 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif !important;
}

.attach-ico, .attach-size, .auth-aside-eyebrow, .auth-aside-footer, .auth-divider,
.brand-tag, .cal-chip-time, .cal-list-count, .cal-weekdays > div, .chart-meta-label,
.chart-svg .axis-label, .chat-conv-time, .chat-day-sep, .chat-msg-meta,
.chat-rail-title .meta, .chat-ts, .d-footer-meta, .data-cell-mono,
.data-cell-user-email, .data-table thead th, .dd-profile-email, .dd-time,
.error-eyebrow, .error-meta, .eyebrow, .fc .fc-col-header-cell-cushion,
.fc .fc-event-time, .fc .fc-timegrid-axis-cushion, .fc .fc-timegrid-slot-label-cushion,
.input-group .addon, .kbd, .kpi-compare strong, .kpi-pill, .mail-folder-count,
.mail-list-title .meta, .mail-rail-label, .mail-row-time, .mail-storage-head .num,
.mail-tab .num, .mini-cal-wd, .mono, .nav-label, .palette-esc, .palette-foot kbd,
.palette-result-section, .reader-attach-head, .reader-collapsed-time,
.reader-from-email, .reader-time-block .mono, .section-h .num, .sv-region-value .pct,
.table thead th, .upc-date .mo, .upc-time .mono, .wx-date p {
    font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, monospace !important;
}

/* Dourado e cinza como variantes de marca para tag/botao, no mesmo contrato
   das variantes que ja existem (success, danger, info...). */
.tag.t-gold { background: var(--gold-soft); color: var(--gold); }
.tag.t-gray { background: var(--gray-soft); color: var(--gray); }

.btn--gold { background: var(--gold); box-shadow: 0 1px 2px var(--gold-ring); color: #fff; }
.btn--gold:hover { background: var(--gold-dark); }

/* ==========================================================================
   1. Os utilitarios do Bootstrap passam a falar a paleta do Adminator.
      O bootstrap-utilities.min.css traz seu proprio :root com a paleta padrao;
      sem este bloco, .text-muted/.border/.bg-light ficariam fora do tema.
   ========================================================================== */

[data-theme=light] {
    --t-base-rgb: 30, 41, 59;
    --primary-rgb: 37, 99, 235;
    --success-rgb: 16, 185, 129;
    --warning-rgb: 245, 158, 11;
    --danger-rgb: 239, 68, 68;
    --info-rgb: 14, 165, 233;
}

[data-theme=dark] {
    --t-base-rgb: 241, 245, 249;
    --primary-rgb: 96, 165, 250;
    --success-rgb: 52, 211, 153;
    --warning-rgb: 251, 191, 36;
    --danger-rgb: 248, 113, 113;
    --info-rgb: 56, 189, 248;
}

[data-theme=light],
[data-theme=dark] {
    --bs-body-color: var(--t-base);
    --bs-body-color-rgb: var(--t-base-rgb);
    --bs-secondary-color: var(--t-muted);
    --bs-emphasis-color: var(--t-base);
    --bs-border-color: var(--border);
    --bs-border-width: 1px;
    --bs-border-style: solid;

    --bs-primary-rgb: var(--primary-rgb);
    --bs-success-rgb: var(--success-rgb);
    --bs-warning-rgb: var(--warning-rgb);
    --bs-danger-rgb: var(--danger-rgb);
    --bs-info-rgb: var(--info-rgb);
    --bs-light-rgb: 241, 245, 249;
    --bs-secondary-rgb: 100, 116, 139;
}

/* ==========================================================================
   2. Grade. O Adminator define .grid (12 colunas) mas so publica .col-6 e
      .col-12. As paginas precisam de tercos e quartos, entao o restante da
      escala e completado aqui, no mesmo contrato.
   ========================================================================== */

.grid > .col-1  { grid-column: span 1; }
.grid > .col-2  { grid-column: span 2; }
.grid > .col-3  { grid-column: span 3; }
.grid > .col-4  { grid-column: span 4; }
.grid > .col-5  { grid-column: span 5; }
.grid > .col-7  { grid-column: span 7; }
.grid > .col-8  { grid-column: span 8; }
.grid > .col-9  { grid-column: span 9; }
.grid > .col-10 { grid-column: span 10; }
.grid > .col-11 { grid-column: span 11; }

@media (max-width: 1100px) {
    .grid > .col-3, .grid > .col-4, .grid > .col-5 { grid-column: span 6; }
    .grid > .col-7, .grid > .col-8, .grid > .col-9,
    .grid > .col-10, .grid > .col-11 { grid-column: span 12; }
}

@media (max-width: 720px) {
    .grid > [class*="col-"] { grid-column: span 12; }
}

/* Variante de tres colunas para formularios largos. */
.form-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid.cols-3 .span-2 { grid-column: span 2; }
.form-grid.cols-3 .span-3 { grid-column: span 3; }

@media (max-width: 900px) {
    .form-grid.cols-3 { grid-template-columns: 1fr; }
    .form-grid.cols-3 .span-2,
    .form-grid.cols-3 .span-3 { grid-column: span 1; }
}

/* ==========================================================================
   3. Validacao do jquery-validation-unobtrusive.
      O unobtrusive marca os campos com .input-validation-error e as mensagens
      com .field-validation-error; o Adminator so conhece .is-invalid.
   ========================================================================== */

.input.input-validation-error,
.select.input-validation-error,
.textarea.input-validation-error { border-color: var(--danger); }

.field-validation-error,
.validation-summary-errors {
    color: var(--danger);
    display: block;
    font-size: 12px;
    margin-top: 5px;
}

.validation-summary-errors ul { list-style: none; margin: 0; padding: 0; }
.validation-summary-valid { display: none; }

/* ==========================================================================
   4. Peças que as paginas precisam e o template nao traz prontas.
   ========================================================================== */

/* Estado vazio de listagem. */
.empty-state { color: var(--t-muted); padding: 40px 20px; text-align: center; }
.empty-state svg {
    fill: none; height: 34px; margin-bottom: 12px; opacity: .5;
    stroke: currentColor; stroke-width: 1.5; width: 34px;
}
.empty-state-title { color: var(--t-base); font-size: 14px; font-weight: 600; margin-bottom: 4px; }

/* Linha rotulo/valor, usada nas telas de detalhe (ex.: Minha conta). */
.detail-row {
    border-bottom: 1px solid var(--border-soft);
    display: grid;
    gap: 16px;
    grid-template-columns: 150px 1fr;
    padding: 11px 0;
}
.detail-row:last-child { border-bottom: 0; }
.detail-label { color: var(--t-muted); font-size: 12.5px; }
.detail-value { color: var(--t-base); font-size: 13px; font-weight: 500; }

/* Formulario inline dentro de celula de tabela (ativar/desativar/excluir). */
.inline-form { display: inline-block; margin: 0; }

/* Barra de acoes acima de uma listagem. */
.toolbar {
    align-items: flex-end;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 18px;
}
.toolbar .field { margin: 0; }
.toolbar-spacer { flex: 1; }

/* Modal: o template so traz .modal-demo estatico, sem overlay nem JS.
   O comportamento vive em wwwroot/js/adminator-app.js. */
.modal-overlay {
    align-items: center;
    background: var(--overlay);
    backdrop-filter: blur(2px);
    display: none;
    inset: 0;
    justify-content: center;
    padding: 20px;
    position: fixed;
    z-index: 200;
}
.modal-overlay.is-open { display: flex; }
.modal-overlay .modal-demo {
    animation: rise-in .24s cubic-bezier(.2, .7, .2, 1) both;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    width: 100%;
}
.modal-overlay .modal-demo.modal-lg { max-width: 720px; }
body.has-modal-open { overflow: hidden; }

/* Tabela: coluna de acoes encostada a direita. */
.table .cell-actions { text-align: right; white-space: nowrap; }
.table .cell-actions > * + * { margin-left: 6px; }

/* O .pager-btn do template só prevê :disabled (button). Nas listagens os
   controles são links, então precisam de um estado inerte equivalente. */
.pager-btn.is-disabled { cursor: not-allowed; opacity: .4; pointer-events: none; }

/* Rodapé de listagem: contagem à esquerda, paginador à direita. */
.list-foot {
    align-items: center;
    border-top: 1px solid var(--border-soft);
    display: flex;
    justify-content: space-between;
    margin-top: 16px;
    padding-top: 14px;
}
.list-foot-info { color: var(--t-muted); font-size: 12px; }

/* Linha do tempo de prontuário: entradas cronológicas com autor e data. */
.entry-list { list-style: none; margin: 0; padding: 0; }
.entry {
    border-bottom: 1px solid var(--border-soft);
    padding: 14px 0;
}
.entry:first-child { padding-top: 0; }
.entry:last-child { border-bottom: 0; padding-bottom: 0; }
.entry-head {
    align-items: baseline;
    display: flex;
    gap: 12px;
    justify-content: space-between;
    margin-bottom: 6px;
}
.entry-author { color: var(--t-base); font-size: 13px; font-weight: 600; }
.entry-date { color: var(--t-muted); font-size: 12px; white-space: nowrap; }
.entry-body { color: var(--t-base); font-size: 13px; line-height: 1.6; margin: 0; white-space: pre-wrap; }

/* Linha destacada de tabela (registro selecionado em listagem mestre/detalhe). */
.table tbody tr.is-selected td { background: var(--primary-soft); }

/* Lista de escolha (seleção de clínica no login). */
.pick-list { display: grid; gap: 8px; }
.pick-item {
    align-items: center;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    gap: 12px;
    justify-content: space-between;
    padding: 12px 14px;
    text-align: left;
    transition: border-color .16s, background .16s;
    width: 100%;
}
.pick-item:hover { background: var(--bg-hover); border-color: var(--primary); }
.pick-name { color: var(--t-base); font-size: 13px; font-weight: 600; }
.pick-meta { color: var(--t-muted); font-size: 12px; }

/* ==========================================================================
   Exames — cartões de exame e faixa de destaque.
   Reescrito sobre os tokens do tema: a versão anterior tinha o verde
   (#1b6b43) fixo no HTML, o que não acompanhava o modo escuro.
   ========================================================================== */

.exam-banner {
    align-items: center;
    background: var(--success-soft);
    border: 1px solid color-mix(in oklab, var(--success) 30%, transparent);
    border-radius: 14px;
    display: flex;
    gap: 16px;
    margin-bottom: 22px;
    padding: 18px 20px;
}
.exam-banner-icon {
    align-items: center;
    background: var(--bg-card);
    border: 1px solid color-mix(in oklab, var(--success) 30%, transparent);
    border-radius: 12px;
    display: flex;
    flex-shrink: 0;
    height: 50px;
    justify-content: center;
    width: 50px;
}
.exam-banner-icon svg { fill: none; height: 22px; stroke: var(--success); stroke-width: 1.8; width: 22px; }
.exam-banner-title { color: var(--t-base); font-size: 14px; font-weight: 700; margin-bottom: 2px; }
.exam-banner-sub { color: var(--t-muted); font-size: 12.5px; margin: 0; }

.exam-card {
    align-items: flex-start;
    background: var(--bg-card);
    border: 1px solid var(--border-soft);
    border-radius: 14px;
    box-shadow: var(--shadow-card);
    color: inherit;
    display: flex;
    gap: 14px;
    margin-bottom: 10px;
    padding: 16px 18px;
    text-decoration: none;
    transition: box-shadow .18s, border-color .18s;
    width: 100%;
}
.exam-card.is-clickable { cursor: pointer; text-align: left; }
.exam-card.is-clickable:hover { border-color: var(--primary); box-shadow: var(--shadow-lg); }

.exam-icon-wrap {
    align-items: center;
    border-radius: 50%;
    display: flex;
    flex-shrink: 0;
    height: 46px;
    justify-content: center;
    width: 46px;
}
.exam-icon-wrap svg { fill: none; height: 20px; stroke: currentColor; stroke-width: 1.8; width: 20px; }
.exam-icon-wrap.icon-bio { background: var(--success-soft); color: var(--success); }
.exam-icon-wrap.icon-drop { background: var(--info-soft); color: var(--info); }
.exam-icon-wrap.icon-heart { background: var(--purple-soft); color: var(--purple); }
.exam-icon-wrap.icon-blood { background: var(--danger-soft); color: var(--danger); }
.exam-icon-wrap.is-sm { border-radius: 9px; height: 34px; width: 34px; }
.exam-icon-wrap.is-sm svg { height: 15px; width: 15px; }

.exam-card-body { flex: 1; min-width: 0; }
.exam-card-title { color: var(--t-base); font-size: 14px; font-weight: 700; margin-bottom: 4px; }
.exam-meta {
    align-items: center;
    color: var(--t-muted);
    display: flex;
    font-size: 12px;
    gap: 6px;
    margin-bottom: 2px;
}
.exam-meta svg { fill: none; height: 13px; stroke: currentColor; stroke-width: 1.8; width: 13px; }

.exam-section-title {
    color: var(--t-muted);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .08em;
    margin-bottom: 12px;
    text-transform: uppercase;
}

/* Linha rótulo/valor com ícone, usada no detalhe do exame. */
.exam-detail {
    align-items: center;
    border-bottom: 1px solid var(--border-soft);
    display: flex;
    gap: 12px;
    padding: 10px 0;
}
.exam-detail:last-of-type { border-bottom: 0; }
.exam-detail-label { color: var(--t-base); font-size: 13px; font-weight: 600; }
.exam-detail-value { color: var(--t-muted); font-size: 12.5px; }

/* Linha de tabela em destaque — usada no histórico de exames para separar as medições de
   bioimpedância, que são as únicas com relatório detalhado, dos demais exames. */
.table tbody tr.is-highlight {
    background: var(--primary-soft);
    box-shadow: inset 3px 0 0 0 var(--primary);
}

/* ==========================================================================
   Logo do Instituto Beneví — substitui o ícone + nome genéricos do template.
   A arte é um lockup horizontal (não um glifo quadrado), então a caixa
   .brand-logo deixa de ser um quadrado colorido e passa a ocupar a largura
   do cabeçalho da sidebar; o <img> fica limitado por max-height/max-width
   (em vez de height:100%) para não herdar o tamanho intrínseco do arquivo
   (4505x4505) quando o container também está em auto.
   ========================================================================== */

.brand {
    justify-content: center;
    padding: 1px 10px 20px;
}
.brand-logo {
    background: none;
    box-shadow: none;
    height: auto;
    padding: 0;
    width: 100%;
}
.brand-logo img {
    display: block;
    height: auto;
    margin: 0 auto;
    max-height: 100px;
    max-width: 100%;
    width: auto;
}

.auth-brand .logo {
    background: hsla(0, 0%, 100%, .92);
    height: 44px;
    padding: 6px 10px;
    width: auto;
}
.auth-brand .logo img {
    display: block;
    height: 100%;
    width: auto;
}

/* Marca campos obrigatórios com um asterisco vermelho após o rótulo. */
.field-label.required::after {
    content: " *";
    color: #dc3545;
    font-weight: 700;
}

/* Seções do menu lateral (Clínica, Atendimento, Sistema, Conta) recolhíveis pela setinha. */
.nav-label.nav-label--toggle {
    align-items: center;
    cursor: pointer;
    display: flex;
    font-size: 12px;
    justify-content: space-between;
    padding-bottom: 8px;
    user-select: none;
}
.nav-label.nav-label--toggle .nav-label-caret {
    height: 14px;
    transition: transform .25s ease;
    width: 14px;
}
.nav-section.is-collapsed > .nav-label--toggle .nav-label-caret {
    transform: rotate(-90deg);
}
/* Corpo animado: grid de 1fr -> 0fr anima a altura sem precisar medi-la. */
.nav-section-body {
    display: grid;
    grid-template-rows: 1fr;
    opacity: 1;
    transition: grid-template-rows .28s ease, opacity .22s ease;
}
.nav-section-body > .nav-section-inner {
    min-height: 0;
    overflow: hidden;
}
.nav-section.is-collapsed > .nav-section-body {
    grid-template-rows: 0fr;
    opacity: 0;
}
/* Faixa de ícones (721–1100px): sem rótulo não há como reabrir, então nada fica recolhido. */
@media (min-width: 721px) and (max-width: 1100px) {
    .nav-section.is-collapsed > .nav-section-body {
        grid-template-rows: 1fr;
        opacity: 1;
    }
}
@media (prefers-reduced-motion: reduce) {
    .nav-section-body, .nav-label.nav-label--toggle .nav-label-caret { transition: none; }
}

/* Ícone "i" com balão de orientações (.info-wrap > .info-btn + .info-pop). */
.info-wrap { position: relative; display: inline-flex; align-items: center; vertical-align: middle; margin-left: 10px; }
.info-btn { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; padding: 0;
    border-radius: 50%; border: 0; background: var(--primary); color: #fff; cursor: pointer; transition: transform .15s, box-shadow .15s; }
.info-btn:hover, .info-btn[aria-expanded="true"] { transform: scale(1.08); box-shadow: 0 0 0 4px var(--primary-ring); }
.info-btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.info-btn svg { width: 14px; height: 14px; fill: #fff; stroke: none; }
.info-pop { position: absolute; z-index: 30; top: calc(100% + 8px); left: 0; width: min(520px, 86vw); padding: 14px 16px;
    background: var(--surface, #fff); border: 1px solid var(--border, #d6dbe3); border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,.14); font-size: 14px; line-height: 1.5; font-weight: 400; }
.info-pop[hidden] { display: none; }

/* ── Detalhes em seções: cartão com ícone no título e linhas rótulo/valor ── */
.detail-head { align-items: center; display: flex; gap: 12px; padding-bottom: 14px; border-bottom: 1px solid var(--border-soft); margin-bottom: 4px; }
.detail-head-icon { align-items: center; background: var(--icon-green-soft); border-radius: 10px; color: var(--icon-green); display: inline-flex; flex: none; height: 34px; justify-content: center; width: 34px; }
.detail-head-icon svg { fill: none; height: 18px; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; width: 18px; }
.detail-title { color: var(--t-base); font-size: 16px; font-weight: 700; margin: 0; }
.detail-list { margin: 0; }
.detail-row { align-items: center; border-bottom: 1px solid var(--border-soft); display: grid; gap: 16px; grid-template-columns: minmax(150px, 38%) 1fr; padding: 13px 0; }
.detail-row:last-child { border-bottom: 0; }
.detail-label { align-items: center; color: var(--t-muted); display: flex; font-size: 13px; font-weight: 600; gap: 10px; margin: 0; }
.detail-label svg { fill: none; flex: none; height: 15px; stroke: var(--icon-green); stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; width: 15px; }
.detail-value { color: var(--t-base); font-size: 14px; line-height: 1.4; margin: 0; overflow-wrap: anywhere; }
.detail-value.is-multiline { white-space: pre-line; }
.detail-value.is-empty { color: var(--t-muted); font-style: italic; }
.detail-value a { color: var(--primary); text-decoration: none; }
.detail-value a:hover { text-decoration: underline; }
.detail-value a.is-whatsapp { color: var(--success); }
.detail-value a { white-space: nowrap; }
.detail-value a svg { fill: none; height: 13px; margin-left: 4px; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2; vertical-align: -1px; width: 13px; }
@media (max-width: 600px) { .detail-row { gap: 4px; grid-template-columns: 1fr; } }

/* Espaço entre os cartões de detalhe consecutivos. */
.detail-card + .detail-card,
form > .card + .card { margin-top: 28px; }
.detail-card + .form-actions { margin-top: 28px; }

/* Verde dos ícones de detalhe: o mesmo do tema escuro, também no claro (onde --primary é quase preto). */
:root { --icon-green: #22a67f; --icon-green-soft: #e3f5ef; }
:root[data-theme=dark] { --icon-green: #22a67f; --icon-green-soft: #0f2a22; }

/* Ícone dentro do rótulo dos formulários de proprietário. */
.field-label:has(> svg) { align-items: center; display: flex; gap: 8px; }
.field-label > svg { fill: none; flex: none; height: 15px; stroke: var(--icon-green); stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; width: 15px; }
.detail-card .detail-head, form > .card .detail-head { margin-bottom: 18px; }

/* ── Toasts (mensagens de sucesso/aviso/erro no canto da tela) ───────────── */
.toast-stack { display: flex; flex-direction: column; gap: 10px; pointer-events: none; position: fixed; right: 24px; top: 84px; width: min(420px, calc(100vw - 32px)); z-index: 1100; }
.toast-stack:empty { display: none; }
.toast { animation: toast-in .35s cubic-bezier(.2, .8, .2, 1); background: var(--surface, var(--bg-card, #fff)); border-radius: 12px; box-shadow: 0 12px 32px rgba(15, 23, 42, .18), 0 2px 6px rgba(15, 23, 42, .08); margin: 0 !important; overflow: hidden; padding-bottom: 16px; pointer-events: auto; position: relative; }
.toast.success { border-left: 4px solid var(--success); }
.toast.warning { border-left: 4px solid var(--warning, #d97706); }
.toast.danger { border-left: 4px solid var(--danger); }
.toast .body { font-weight: 600; }
.toast.is-leaving { animation: toast-out .3s ease forwards; }
.toast-progress { animation: toast-progress linear forwards; background: currentColor; bottom: 0; height: 3px; left: 0; opacity: .55; position: absolute; width: 100%; }
.toast.success .toast-progress { color: var(--success); }
.toast.warning .toast-progress { color: var(--warning, #d97706); }
.toast.is-paused .toast-progress { animation-play-state: paused; }
@keyframes toast-in { from { opacity: 0; transform: translateX(32px); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateX(32px); } }
@keyframes toast-progress { from { transform: scaleX(1); transform-origin: left; } to { transform: scaleX(0); transform-origin: left; } }
@media (max-width: 600px) { .toast-stack { right: 16px; top: 72px; } }
@media (prefers-reduced-motion: reduce) { .toast, .toast.is-leaving { animation-duration: .01s; } .toast-progress { animation: none; } }

/* ── Abas de situação (Ativos / Inativos) ─────────────────────────────────── */
.tabs { background: var(--border-soft); border-radius: 10px; display: inline-flex; gap: 4px; padding: 4px; }
.tab { align-items: center; border-radius: 8px; color: var(--t-muted); display: inline-flex; font-size: 13.5px; font-weight: 600; gap: 7px; padding: 7px 14px; text-decoration: none; transition: background .15s, color .15s; }
.tab svg { fill: none; height: 15px; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2; width: 15px; }
.tab:hover { color: var(--t-base); }
.tab.is-active { background: var(--bg-card, #fff); box-shadow: 0 1px 3px rgba(15, 23, 42, .12); color: var(--icon-green); }

/* ── Listagem: ícones no cabeçalho/nome e documento em destaque verde ─────── */
.th-icon { align-items: center; display: inline-flex; gap: 6px; }
.th-icon svg { fill: none; flex: none; height: 13px; stroke: var(--icon-green); stroke-linecap: round; stroke-linejoin: round; stroke-width: 2; width: 13px; }
.cell-with-icon { align-items: center; display: inline-flex; gap: 10px; }
.cell-avatar { align-items: center; background: var(--icon-green-soft); border-radius: 50%; color: var(--icon-green); display: inline-flex; flex: none; height: 30px; justify-content: center; width: 30px; }
.cell-avatar svg { fill: none; height: 15px; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; width: 15px; }
.doc-badge { border: 1.5px solid var(--icon-green); border-radius: 8px; color: var(--icon-green); display: inline-block; font-family: var(--font-mono, ui-monospace, monospace); font-size: 13px; font-weight: 600; padding: 3px 9px; white-space: nowrap; }

/* Listagem de proprietários: a tabela se ajusta à largura da tela, sem rolagem horizontal.
   Fonte, espaçamento, avatar e botões encolhem com a largura (clamp); em telas mais estreitas
   as colunas secundárias saem (Tipo já aparece no formato do documento).
   O vendor usa ".table tbody td" / ".table thead th", então a especificidade precisa ser maior. */
.table.table--spaced { table-layout: auto; width: 100%; }
.table.table--spaced thead th,
.table.table--spaced tbody td {
    font-size: clamp(11px, .9vw, 13px);
    padding-left: clamp(5px, .9vw, 14px);
    padding-right: clamp(5px, .9vw, 14px);
}
.table.table--spaced thead th { font-size: clamp(8.5px, .7vw, 10px); letter-spacing: clamp(.02em, .08vw, .1em); }
.table.table--spaced thead th:first-child,
.table.table--spaced tbody td:first-child { padding-left: 0; }
.table.table--spaced thead th:last-child,
.table.table--spaced tbody td:last-child { padding-right: 0; }
.table.table--spaced .cell-name { min-width: 0; overflow-wrap: anywhere; }
.table.table--spaced .cell-date,
.table.table--spaced .doc-badge { white-space: nowrap; }
.table.table--spaced .doc-badge { font-size: clamp(10.5px, .85vw, 13px); padding: 2px clamp(5px, .6vw, 9px); }
.table.table--spaced .cell-avatar { height: clamp(22px, 2vw, 30px); width: clamp(22px, 2vw, 30px); }
.table.table--spaced .cell-with-icon { gap: clamp(6px, .7vw, 10px); }
.table.table--spaced .cell-actions .btn--icon { height: clamp(26px, 2.2vw, 32px); width: clamp(26px, 2.2vw, 32px); }
.table.table--spaced .cell-actions .btn--icon svg { height: clamp(13px, 1.1vw, 16px); width: clamp(13px, 1.1vw, 16px); }
@media (max-width: 1000px) { .table.table--spaced .th-icon svg { display: none; } }
@media (max-width: 1400px) { .table.table--spaced .col-tipo { display: none; } }
@media (max-width: 900px) { .table.table--spaced .cell-avatar { display: none; } }
.table.table--spaced thead th { font-weight: 700; }

/* ── Breadcrumb do topo: pílula com início, separadores e página atual em destaque ── */
.breadcrumb-pill { align-items: center; background: var(--bg-card, #fff); border: 1px solid var(--border-soft); border-radius: 999px; box-shadow: 0 1px 2px rgba(15, 23, 42, .05); display: inline-flex; gap: 8px; max-width: 100%; min-width: 0; padding: 7px 16px 7px 12px; }
.breadcrumb-pill .crumb-home { align-items: center; color: var(--t-muted); display: inline-flex; font-size: 13px; font-weight: 600; gap: 8px; text-decoration: none; transition: color .15s; white-space: nowrap; }
.breadcrumb-pill .crumb-home svg { fill: none; height: 16px; stroke: var(--icon-green); stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.9; width: 16px; }
.breadcrumb-pill .crumb-home:hover { color: var(--icon-green); }
.breadcrumb-pill .sep { color: var(--t-light); flex: none; }
.breadcrumb-pill .crumb-mid { color: var(--t-muted); font-size: 13px; font-weight: 500; white-space: nowrap; }
.breadcrumb-pill .current { color: var(--t-base); font-size: 13.5px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.breadcrumb-pill .current::before { background: var(--icon-green); border-radius: 50%; content: ""; display: inline-block; height: 7px; margin-right: 8px; vertical-align: 1px; width: 7px; }
@media (max-width: 900px) { .breadcrumb-pill .crumb-home span { display: none; } }
@media (max-width: 600px) { .breadcrumb-pill .crumb-mid { display: none; } }
.breadcrumb-pill .crumb-link { border-radius: 6px; color: var(--t-muted); margin: -2px -4px; padding: 2px 4px; text-decoration: none; transition: background .15s, color .15s; }
.breadcrumb-pill .crumb-link:hover { background: var(--icon-green-soft); color: var(--icon-green); }
.input--readonly { background: var(--border-soft); color: var(--t-base); cursor: not-allowed; display: flex; align-items: center; min-height: 40px; }
@media (max-width: 1400px) { .table.table--spaced .col-secundaria { display: none; } }

/* Campo com prefixo (ex.: "R$"). */
.input-prefix { align-items: stretch; display: flex; }
.input-prefix-text { align-items: center; background: var(--border-soft); border: 1px solid var(--border); border-right: 0; border-radius: 8px 0 0 8px; color: var(--t-muted); display: inline-flex; font-size: 13px; font-weight: 600; padding: 0 12px; }
.input-prefix .input { border-radius: 0 8px 8px 0; flex: 1; min-width: 0; }

/* ── Formulário de usuário: subtítulo de seção, regras de senha e cartões de papel ── */
.detail-subtitle { color: var(--t-muted); font-size: 12.5px; margin-top: 2px; }
.req-mark { color: var(--danger); }
.pwd-rules { display: grid; gap: 6px; list-style: none; margin: 12px 0 0; padding: 0; }
.pwd-rules li { align-items: center; color: var(--t-muted); display: flex; font-size: 12.5px; gap: 8px; transition: color .15s; }
.pwd-rules li svg { background: var(--border-soft); border-radius: 50%; fill: none; flex: none; height: 16px; padding: 3px; stroke: transparent; stroke-linecap: round; stroke-linejoin: round; stroke-width: 3; width: 16px; transition: background .15s, stroke .15s; }
.pwd-rules li.is-ok { color: var(--icon-green); }
.pwd-rules li.is-ok svg { background: var(--icon-green); stroke: #fff; }
.pwd-rules li.is-pending { color: var(--danger); }
.role-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); margin-top: 14px; }
.role-card { cursor: pointer; display: block; position: relative; }
.role-card input { height: 0; opacity: 0; position: absolute; width: 0; }
.role-card-body { background: var(--bg-card, #fff); border: 1.5px solid var(--border); border-radius: 12px; display: grid; gap: 4px; padding: 14px 16px 14px 44px; position: relative; transition: border-color .15s, box-shadow .15s, background .15s; }
.role-card-body::before { background: var(--bg-card, #fff); border: 2px solid var(--border); border-radius: 50%; content: ""; height: 16px; left: 16px; position: absolute; top: 17px; transition: border-color .15s, background .15s; width: 16px; }
.role-card:hover .role-card-body { border-color: var(--icon-green); }
.role-card input:checked + .role-card-body { background: var(--icon-green-soft); border-color: var(--icon-green); box-shadow: 0 0 0 3px color-mix(in oklab, var(--icon-green) 18%, transparent); }
.role-card input:checked + .role-card-body::before { background: radial-gradient(circle, var(--icon-green) 0 4px, transparent 5px); border-color: var(--icon-green); }
.role-card input:focus-visible + .role-card-body { outline: 2px solid var(--icon-green); outline-offset: 2px; }
.role-card-title { color: var(--t-base); font-size: 13px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.role-card-desc { color: var(--t-muted); font-size: 12.5px; }

/* Campo com botão dentro (ex.: mostrar/ocultar senha). */
.input-affix { position: relative; }
.input-affix .input { padding-right: 44px; }
.input-affix-btn { align-items: center; background: transparent; border: 0; border-radius: 6px; color: var(--t-muted); cursor: pointer; display: inline-flex; height: 32px; justify-content: center; position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 32px; }
.input-affix-btn:hover { background: var(--icon-green-soft); color: var(--icon-green); }
.input-affix-btn svg { fill: none; height: 18px; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; width: 18px; }
.input-affix-btn [hidden] { display: none; }

/* ── Planos e assinaturas ─────────────────────────────────────────────────── */
.page-intro { margin-bottom: 18px; }
.page-intro-title { color: var(--t-base); font-size: 20px; font-weight: 700; margin: 0; }
.page-intro-text { color: var(--t-muted); font-size: 13.5px; margin: 4px 0 0; }
.link-btn { background: none; border: 0; color: var(--icon-green); cursor: pointer; font: inherit; font-weight: 600; padding: 0; text-decoration: underline; text-underline-offset: 2px; }
.link-btn:hover { color: var(--primary); }
.resource-grid { display: grid; gap: 12px 20px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); margin-top: 14px; }
.resource-item { align-items: center; }
.tag-list { display: flex; flex-wrap: wrap; gap: 6px; }

/* Botão neutro (ex.: Desativar): cinza com fundo translúcido, legível nos temas claro e escuro. */
.btn--soft-gray { background: color-mix(in oklab, var(--gray) 18%, transparent); color: var(--gray); }
.btn--soft-gray:hover { background: color-mix(in oklab, var(--gray) 30%, transparent); }

/* Indicador de progresso das ações (wwwroot/js/acao-progresso.js). */
.progresso-overlay {
    align-items: center;
    background: var(--overlay, rgba(15, 23, 42, .45));
    backdrop-filter: blur(2px);
    display: none;
    inset: 0;
    justify-content: center;
    padding: 20px;
    position: fixed;
    z-index: 400;
}
.progresso-overlay.is-aberto { display: flex; }
.progresso-card {
    align-items: center;
    animation: rise-in .2s cubic-bezier(.2, .7, .2, 1) both;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: var(--shadow-lg);
    color: var(--t-base);
    display: flex;
    flex-direction: column;
    gap: 14px;
    max-width: 320px;
    min-width: 220px;
    padding: 24px 28px;
    text-align: center;
}
.progresso-texto { font-size: 14px; font-weight: 600; }
.progresso-spinner {
    animation: progresso-giro .8s linear infinite;
    border: 3px solid color-mix(in oklab, var(--gray) 25%, transparent);
    border-radius: 50%;
    border-top-color: var(--primary);
    height: 34px;
    width: 34px;
}
.progresso-overlay.is-sucesso .progresso-spinner {
    animation: none;
    border-color: var(--success);
    position: relative;
}
.progresso-overlay.is-sucesso .progresso-spinner::after {
    border: solid var(--success);
    border-width: 0 3px 3px 0;
    content: "";
    height: 14px;
    left: 9px;
    position: absolute;
    top: 3px;
    transform: rotate(45deg);
    width: 8px;
}
@keyframes progresso-giro { to { transform: rotate(360deg); } }

/* ── Minha conta ─────────────────────────────────────────────────────────── */
.conta-hero { align-items: center; display: flex; flex-wrap: wrap; gap: 20px; margin-bottom: 20px; padding: 22px 24px; }
.conta-avatar {
    align-items: center; background: linear-gradient(135deg, var(--primary), var(--icon-green, var(--primary)));
    border-radius: 50%; box-shadow: 0 6px 16px -6px var(--primary); color: #fff; display: inline-flex; flex: none;
    font-family: "Inter Tight", sans-serif; font-size: 26px; font-weight: 700; height: 72px; justify-content: center;
    letter-spacing: .02em; width: 72px;
}
.conta-hero-body { flex: 1; min-width: 220px; }
.conta-nome { color: var(--t-base); font-size: 22px; font-weight: 700; letter-spacing: -.01em; margin: 0; }
.conta-sub { color: var(--t-muted); font-size: 13.5px; margin-top: 2px; }
.conta-chips { align-items: center; display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.conta-chip-clinica {
    align-items: center; background: var(--icon-green-soft); border-radius: 999px; color: var(--icon-green);
    display: inline-flex; font-size: 12px; font-weight: 600; gap: 6px; padding: 3px 10px;
}
.conta-chip-clinica svg { fill: none; height: 13px; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; width: 13px; }
.conta-hero-meta { border-left: 1px solid var(--border-soft); display: flex; flex-direction: column; gap: 2px; padding-left: 20px; }
.conta-meta-label { color: var(--t-muted); font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; }
.conta-meta-valor { color: var(--t-base); font-size: 15px; font-weight: 700; }
@media (max-width: 700px) { .conta-hero-meta { border-left: 0; border-top: 1px solid var(--border-soft); padding: 12px 0 0; width: 100%; } }

.conta-coluna { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.conta-clinicas { display: grid; gap: 8px; list-style: none; margin: 0; padding: 0; }
.conta-clinicas li {
    align-items: center; border: 1px solid var(--border-soft); border-radius: 10px; display: flex; gap: 12px; padding: 10px 12px;
}
.conta-clinicas li.is-atual { background: var(--icon-green-soft); border-color: transparent; }
.conta-clinica-info { display: flex; flex: 1; flex-direction: column; min-width: 0; }
.conta-clinica-info strong { color: var(--t-base); font-size: 13.5px; }
.conta-clinica-info span { color: var(--t-muted); font-size: 12px; }

.senha-forca { align-items: center; display: flex; gap: 12px; margin-top: 12px; }
.senha-forca-barra { background: var(--border-soft); border-radius: 999px; flex: 1; height: 6px; overflow: hidden; }
.senha-forca-barra span { border-radius: 999px; display: block; height: 100%; transition: width .2s, background .2s; width: 0; }
.senha-forca-texto { color: var(--t-muted); font-size: 12px; font-weight: 600; min-width: 96px; text-align: right; }
.senha-confere { font-size: 12.5px; font-weight: 600; margin-top: 6px; }
.senha-confere.is-ok { color: var(--icon-green); }
.senha-confere.is-erro { color: var(--danger); }

.conta-dicas-lista { color: var(--t-muted); display: grid; font-size: 13px; gap: 8px; line-height: 1.55; margin: 0; padding-left: 18px; }
.conta-dicas-lista li::marker { color: var(--icon-green); }
.conta-dicas-lista strong { color: var(--t-base); }

/* ── Usuários online ─────────────────────────────────────────────────────── */
.toolbar-filtro { align-items: center; display: flex; gap: 10px; }
.toolbar-filtro .field-label { margin: 0; }
.online-resumo { align-items: center; display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 16px; }
.online-stat {
    background: var(--bg-card); border: 1px solid var(--border-soft); border-radius: 12px;
    display: flex; flex-direction: column; gap: 2px; min-width: 130px; padding: 12px 16px;
}
.online-stat-num { color: var(--t-base); font-family: "Inter Tight", sans-serif; font-size: 26px; font-weight: 700; line-height: 1; }
.online-stat.is-online .online-stat-num { color: var(--success); }
.online-stat-label { color: var(--t-muted); font-size: 12px; letter-spacing: .04em; text-transform: uppercase; }
.online-atualizado { align-items: center; color: var(--t-muted); display: inline-flex; font-size: 12.5px; gap: 8px; margin-left: auto; }
.online-pulso, .online-dot { background: var(--success); border-radius: 50%; display: inline-block; height: 8px; width: 8px; }
.online-pulso { animation: online-pulso 1.8s ease-out infinite; }
.online-dot { margin-right: 6px; }
@keyframes online-pulso {
    0% { box-shadow: 0 0 0 0 color-mix(in oklab, var(--success) 55%, transparent); }
    100% { box-shadow: 0 0 0 9px transparent; }
}

/* ── Botões de ícone coloridos (listagem de pacientes) ───────────────────── */
.btn--soft-violet { background: color-mix(in oklab, #8b5cf6 16%, transparent); color: #8b5cf6; }
.btn--soft-violet:hover { background: color-mix(in oklab, #8b5cf6 28%, transparent); }
:root[data-theme="dark"] .btn--soft-violet { color: #a78bfa; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn--soft-violet { color: #a78bfa; } }

/* ── Listagem de pacientes ───────────────────────────────────────────────── */
.pac-busca { align-items: flex-end; display: flex; flex-wrap: wrap; gap: 10px; }
.pac-busca .field { margin: 0; width: 280px; }
.pac-resumo { align-items: center; color: var(--t-muted); display: inline-flex; font-size: 13px; gap: 8px; }
.pac-resumo strong { color: var(--t-base); }

.table.table--pacientes { border-collapse: separate; border-spacing: 0; table-layout: auto; width: 100%; }
.table.table--pacientes thead th {
    border-bottom: 1px solid var(--border-soft); font-size: 11px; letter-spacing: .08em;
    padding: 14px 20px; text-transform: uppercase; white-space: nowrap;
}
.table.table--pacientes tbody td { border-bottom: 1px solid var(--border-soft); padding: 20px 20px; vertical-align: middle; }
.table.table--pacientes tbody tr:last-child td { border-bottom: 0; }
.table.table--pacientes tbody tr { transition: background .15s; }
.table.table--pacientes tbody tr:hover { background: color-mix(in oklab, var(--icon-green) 5%, transparent); }
.table.table--pacientes th:first-child, .table.table--pacientes td:first-child { padding-left: 24px; }
.table.table--pacientes th:last-child, .table.table--pacientes td:last-child { padding-right: 24px; }

.pac-nome { align-items: center; display: flex; gap: 14px; min-width: 220px; }
.pac-avatar {
    align-items: center; background: var(--icon-green-soft); border-radius: 50%; color: var(--icon-green); display: inline-flex;
    flex: none; font-size: 14px; font-weight: 700; height: 40px; justify-content: center; width: 40px;
}
.pac-nome-texto { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pac-nome-texto strong { color: var(--t-base); font-size: 14.5px; font-weight: 700; }
.pac-nome-texto small { color: var(--t-muted); font-size: 12px; }
.pac-dupla { display: flex; flex-direction: column; gap: 3px; }
.pac-dupla small { color: var(--t-muted); font-size: 12px; }
.pac-contato { display: flex; flex-direction: column; gap: 5px; }
.pac-contato span { align-items: center; color: var(--t-base); display: inline-flex; font-size: 13px; gap: 8px; }
.pac-contato span.is-sec { color: var(--t-muted); }
.pac-contato svg { fill: none; flex: none; height: 14px; stroke: var(--t-muted); stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; width: 14px; }
.table.table--pacientes .cell-actions { white-space: nowrap; }
.table.table--pacientes .cell-actions > * + * { margin-left: 8px; }
.table.table--pacientes .cell-actions .btn--icon { height: 34px; width: 34px; }

/* Atalhos da ficha do paciente */
.pac-atalhos { display: grid; gap: 10px; }
.pac-atalho {
    align-items: center; border: 1px solid var(--border-soft); border-radius: 12px; color: var(--t-base); display: flex;
    gap: 14px; padding: 12px 14px; text-decoration: none; transition: border-color .15s, background .15s, transform .15s;
}
.pac-atalho:hover { background: var(--bg-soft, rgba(127, 127, 127, .07)); transform: translateY(-1px); }
.pac-atalho strong { display: block; font-size: 14px; }
.pac-atalho small { color: var(--t-muted); font-size: 12px; }
.pac-atalho-ico { align-items: center; border-radius: 10px; display: inline-flex; flex: none; height: 40px; justify-content: center; width: 40px; }
.pac-atalho-ico svg { fill: none; height: 20px; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; width: 20px; }
.pac-atalho.is-azul .pac-atalho-ico { background: var(--info-soft); color: var(--info); }
.pac-atalho.is-verde .pac-atalho-ico { background: var(--success-soft); color: var(--success); }
.pac-atalho.is-violeta .pac-atalho-ico { background: color-mix(in oklab, #8b5cf6 16%, transparent); color: #8b5cf6; }

/* ═══════════════════════════════════════════════════════════════════════════
   Configuração das cores dos botões de ação
   ---------------------------------------------------------------------------
   Os botões de ação (ícones das tabelas e botões de ação das telas de detalhes) usam fundo
   sólido e ícone/texto branco, em vez do fundo claro translúcido do template. Para mudar uma
   cor em todas as telas de uma vez, basta alterar o token correspondente aqui.
   Valores escolhidos para ter contraste suficiente nos temas claro e escuro.
   ═══════════════════════════════════════════════════════════════════════════ */
:root {
    --acao-detalhes: #0284c7;     /* azul     — Detalhes / informações */
    --acao-editar: #d97706;       /* âmbar    — Editar */
    --acao-excluir: #dc2626;      /* vermelho — Excluir */
    --acao-sucesso: #16a34a;      /* verde    — Reativar / registrar / confirmar */
    --acao-neutra: #64748b;       /* cinza    — Desativar */
    --acao-destaque: #7c3aed;     /* violeta  — Bioimpedância */
    --acao-texto: #ffffff;
}

.btn--icon.btn--soft-info,
.form-actions .btn--soft-info { background: var(--acao-detalhes); color: var(--acao-texto); }
.btn--icon.btn--soft-warning,
.form-actions .btn--soft-warning { background: var(--acao-editar); color: var(--acao-texto); }
.btn--icon.btn--soft-danger,
.form-actions .btn--soft-danger { background: var(--acao-excluir); color: var(--acao-texto); }
.btn--icon.btn--soft-success,
.form-actions .btn--soft-success { background: var(--acao-sucesso); color: var(--acao-texto); }
.btn--icon.btn--soft-gray,
.form-actions .btn--soft-gray { background: var(--acao-neutra); color: var(--acao-texto); }
.btn--icon.btn--soft-violet,
.form-actions .btn--soft-violet { background: var(--acao-destaque); color: var(--acao-texto); }

.btn--icon.btn--soft-info:hover, .form-actions .btn--soft-info:hover,
.btn--icon.btn--soft-warning:hover, .form-actions .btn--soft-warning:hover,
.btn--icon.btn--soft-danger:hover, .form-actions .btn--soft-danger:hover,
.btn--icon.btn--soft-success:hover, .form-actions .btn--soft-success:hover,
.btn--icon.btn--soft-gray:hover, .form-actions .btn--soft-gray:hover,
.btn--icon.btn--soft-violet:hover, .form-actions .btn--soft-violet:hover {
    filter: brightness(1.1);
    box-shadow: 0 4px 10px -4px rgba(0, 0, 0, .45);
}
.btn--icon.btn--soft-info svg, .btn--icon.btn--soft-warning svg, .btn--icon.btn--soft-danger svg,
.btn--icon.btn--soft-success svg, .btn--icon.btn--soft-gray svg, .btn--icon.btn--soft-violet svg { stroke: currentColor; }

/* Os botões "Editar" e "Detalhes" de texto (telas de detalhes e edição) seguem a mesma paleta. */
.btn--warning { background: var(--acao-editar); }
.btn--info { background: var(--acao-detalhes); }

/* ── Pacientes: responsividade da tabela ─────────────────────────────────────
   A tabela encolhe em etapas: fontes e espaçamentos fluidos, colunas secundárias que migram para
   dentro da célula do paciente (.pac-extra) e, no celular, cada linha vira um cartão. */
.pac-extra { display: none; }
.table.table--pacientes { font-size: clamp(12px, .95vw, 14px); }
.table.table--pacientes .pac-nome-texto strong { font-size: clamp(13px, 1vw, 14.5px); }
.table.table--pacientes thead th { padding-left: clamp(10px, 1.3vw, 20px); padding-right: clamp(10px, 1.3vw, 20px); }
.table.table--pacientes tbody td { padding: clamp(12px, 1.4vw, 20px) clamp(10px, 1.3vw, 20px); }
.table.table--pacientes th:first-child, .table.table--pacientes td:first-child { padding-left: clamp(14px, 1.6vw, 24px); }
.table.table--pacientes th:last-child, .table.table--pacientes td:last-child { padding-right: clamp(14px, 1.6vw, 24px); }
/* Sem rolagem horizontal: layout fixo com colunas proporcionais, tudo dimensionado por vw. O texto
   que não cabe quebra entre palavras; o e-mail, que não tem espaços, termina em reticências (o
   texto completo fica no title). A coluna de ações tem largura calculada para os 5 botões. */
.table-scroll.table-scroll--fit { overflow-x: hidden; }
.table.table--pacientes {
    --pac-btn: clamp(24px, 2.1vw, 34px);
    --pac-gap: clamp(3px, .45vw, 8px);
    --pac-pad: clamp(6px, 1vw, 16px);
    table-layout: fixed;
    width: 100%;
    font-size: clamp(11px, .88vw, 14px);
}
.table.table--pacientes thead th { font-size: clamp(8.5px, .68vw, 11px); letter-spacing: clamp(.02em, .07vw, .08em); }
.table.table--pacientes thead th, .table.table--pacientes tbody td { padding-left: var(--pac-pad); padding-right: var(--pac-pad); }
.table.table--pacientes tbody td { padding-top: clamp(10px, 1.2vw, 18px); padding-bottom: clamp(10px, 1.2vw, 18px); }
.table.table--pacientes th:first-child, .table.table--pacientes td:first-child { padding-left: clamp(10px, 1.4vw, 22px); }
.table.table--pacientes th:last-child, .table.table--pacientes td:last-child { padding-right: clamp(10px, 1.4vw, 22px); }
.table.table--pacientes th:nth-child(1) { width: 24%; }
.table.table--pacientes th.col-cpf { width: 15%; }
.table.table--pacientes th.col-nasc { width: 10%; }
.table.table--pacientes th.col-medico { width: 17%; }
.table.table--pacientes th.col-contato { width: 21%; }
.table.table--pacientes th.cell-actions { width: calc(5 * var(--pac-btn) + 4 * var(--pac-gap) + var(--pac-pad) + clamp(10px, 1.4vw, 22px)); }
.table.table--pacientes td { overflow: hidden; }
.table.table--pacientes .cell-actions .btn--icon { height: var(--pac-btn); width: var(--pac-btn); }
.table.table--pacientes .cell-actions > * + * { margin-left: var(--pac-gap); }
.table.table--pacientes .cell-actions .btn--icon svg { height: 100%; width: 100%; }
.table.table--pacientes .doc-badge { font-size: clamp(10px, .8vw, 13px); padding: 2px clamp(4px, .5vw, 9px); }
.table.table--pacientes .pac-avatar { height: clamp(28px, 2.6vw, 40px); width: clamp(28px, 2.6vw, 40px); font-size: clamp(10px, .9vw, 14px); }
.table.table--pacientes .pac-nome { gap: clamp(8px, .9vw, 14px); min-width: 0; }
.table.table--pacientes .pac-nome-texto { min-width: 0; }
.table.table--pacientes .pac-nome-texto strong { font-size: clamp(11.5px, .95vw, 14.5px); overflow-wrap: break-word; }
.table.table--pacientes .pac-nome-texto small { font-size: clamp(10px, .75vw, 12px); }
.table.table--pacientes .pac-contato { min-width: 0; }
.table.table--pacientes .pac-contato span { display: flex; font-size: clamp(10.5px, .82vw, 13px); gap: clamp(4px, .5vw, 8px); max-width: 100%; min-width: 0; }
.table.table--pacientes .pac-contato .txt { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.table.table--pacientes .pac-contato svg { height: clamp(11px, .9vw, 14px); width: clamp(11px, .9vw, 14px); }

/* Telas médias: o médico responsável vai para a célula do paciente. */
.pac-extra span { display: none; }
@media (max-width: 1280px) {
    .table.table--pacientes .col-medico { display: none; }
    .table.table--pacientes .pac-extra { color: var(--t-muted); display: flex; flex-direction: column; font-size: 11.5px; gap: 1px; margin-top: 4px; }
    .table.table--pacientes .pac-extra .ex-medico { display: inline; }
    .table.table--pacientes th:nth-child(1) { width: 29%; }
    .table.table--pacientes th.col-cpf { width: 17%; }
    .table.table--pacientes th.col-nasc { width: 12%; }
    .table.table--pacientes th.col-contato { width: 26%; }
    .pac-nome-texto small { display: none; }
}

/* Telas pequenas: também saem nascimento e CPF (vão para a célula do paciente). */
@media (max-width: 1000px) {
    .table.table--pacientes .col-nasc, .table.table--pacientes .col-cpf { display: none; }
    .table.table--pacientes .pac-extra .ex-cpf, .table.table--pacientes .pac-extra .ex-nasc { display: inline; }
    .table.table--pacientes th:nth-child(1) { width: 34%; }
    .table.table--pacientes th.col-contato { width: 30%; }
}

/* Celular: a linha vira um cartão; o contato vem para a célula do paciente e as ações ficam embaixo. */
@media (max-width: 720px) {
    .table.table--pacientes, .table.table--pacientes tbody, .table.table--pacientes tr, .table.table--pacientes td { display: block; width: 100%; }
    .table.table--pacientes thead { display: none; }
    .table.table--pacientes tbody tr { border-bottom: 1px solid var(--border-soft); padding: 14px 4px; }
    .table.table--pacientes tbody tr:last-child { border-bottom: 0; }
    .table.table--pacientes tbody td { border: 0; padding: 4px 12px; }
    .table.table--pacientes th:first-child, .table.table--pacientes td:first-child,
    .table.table--pacientes th:last-child, .table.table--pacientes td:last-child { padding-left: 12px; padding-right: 12px; }
    .table.table--pacientes .col-contato { display: none; }
    .table.table--pacientes .pac-extra { font-size: 12px; }
    .table.table--pacientes .pac-extra .ex-contato { display: inline; }
    .table.table--pacientes .cell-actions {
        align-items: center; display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-start; padding-top: 10px; text-align: left;
    }
    .table.table--pacientes .cell-actions > * + * { margin-left: 0; }
    .table.table--pacientes .cell-actions .btn--icon { height: 36px; width: 36px; }
    .pac-busca, .pac-busca .field { width: 100%; }
}

/* ── Bioimpedância › Relatório por paciente ──────────────────────────────── */
.bio-filtros { margin-bottom: 20px; padding: 18px 20px; }
.bio-filtros-form { align-items: flex-end; display: grid; gap: 14px; grid-template-columns: minmax(260px, 3fr) repeat(2, minmax(150px, 1fr)) auto; }
.bio-filtros-form .field { margin: 0; min-width: 0; }
.bio-f-aplicar { height: 40px; justify-content: center; }
.bio-atalhos { align-items: center; border-top: 1px solid var(--border-soft); display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; padding-top: 14px; }
.bio-atalhos-rotulo { color: var(--t-muted); font-size: 12px; letter-spacing: .06em; margin-right: 4px; text-transform: uppercase; }
.bio-chip {
    border: 1px solid var(--border-soft); border-radius: 999px; color: var(--t-muted); font-size: 12.5px; font-weight: 600;
    padding: 5px 12px; text-decoration: none; transition: background .15s, color .15s, border-color .15s;
}
.bio-chip:hover { background: var(--icon-green-soft); color: var(--icon-green); }
.bio-chip.is-ativo { background: var(--icon-green); border-color: var(--icon-green); color: #fff; }
@media (max-width: 1100px) { .bio-filtros-form { grid-template-columns: repeat(2, minmax(0, 1fr)); } .bio-f-paciente { grid-column: 1 / -1; } .bio-f-aplicar { grid-column: 1 / -1; } }
@media (max-width: 560px) { .bio-filtros-form { grid-template-columns: 1fr; } }

.bio-acoes { align-items: center; display: flex; flex-wrap: wrap; gap: 10px; margin-left: auto; }
.bio-vazio { padding: 36px 20px; }

.bio-kpis { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); margin-bottom: 6px; }
.bio-kpi {
    --kpi: var(--icon-green); /* cor única (verde padrão do sistema) para todos os indicadores */
    background: var(--bg-card); border: 1px solid var(--border-soft); border-radius: 12px; display: flex; flex-direction: column; gap: 8px;
    overflow: hidden; padding: 12px 14px 10px; position: relative; transition: border-color .15s, box-shadow .15s;
}
.bio-kpi::before { background: var(--kpi); content: ""; height: 2px; left: 0; position: absolute; right: 0; top: 0; }
.bio-kpi:hover { border-color: color-mix(in oklab, var(--kpi) 45%, var(--border-soft)); box-shadow: 0 6px 16px -12px rgba(0, 0, 0, .5); }
.bio-kpi-topo { align-items: center; display: flex; gap: 8px; }
.bio-kpi-ico { align-items: center; background: color-mix(in oklab, var(--kpi) 14%, transparent); border-radius: 8px; color: var(--kpi); display: inline-flex; flex: none; height: 28px; justify-content: center; width: 28px; }
.bio-kpi-ico svg { fill: none; height: 16px; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.9; width: 16px; }
.bio-kpi-rotulo { color: var(--t-muted); font-size: 10.5px; font-weight: 700; letter-spacing: .07em; overflow: hidden; text-overflow: ellipsis; text-transform: uppercase; white-space: nowrap; }
.bio-kpi-linha { align-items: flex-end; display: flex; gap: 10px; justify-content: space-between; }
.bio-kpi-valor { color: var(--t-base); font-family: "Inter Tight", sans-serif; font-size: 24px; font-weight: 700; letter-spacing: -.02em; line-height: 1; white-space: nowrap; }
.bio-kpi-valor small { color: var(--t-muted); font-size: 11.5px; font-weight: 600; letter-spacing: 0; margin-left: 3px; }
.bio-kpi-spark { color: var(--kpi); flex: none; height: 24px; width: 72px; }
.bio-kpi-spark polyline { fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2; }
.bio-kpi-spark circle { fill: currentColor; }
.bio-kpi-rodape { align-items: center; border-top: 1px solid var(--border-soft); color: var(--t-muted); display: flex; font-size: 11px; gap: 6px; padding-top: 7px; }
.bio-kpi-rodape .bio-delta { font-size: 10.5px; margin: 0; }
.bio-kpis-nota { color: var(--t-muted); font-size: 12px; margin: 0 2px 20px; }

.bio-delta { border-radius: 999px; display: inline-block; font-size: 11px; font-weight: 700; margin-left: 4px; padding: 1px 7px; white-space: nowrap; }
.bio-delta.is-up { background: color-mix(in oklab, var(--info) 15%, transparent); color: var(--info); }
.bio-delta.is-down { background: color-mix(in oklab, var(--gray) 20%, transparent); color: var(--t-muted); }

.table.table--bio { border-collapse: separate; border-spacing: 0; font-size: clamp(11.5px, .9vw, 13.5px); table-layout: auto; width: 100%; }
.table.table--bio thead th { border-bottom: 1px solid var(--border-soft); font-size: 11px; letter-spacing: .06em; padding: 12px 14px; text-transform: uppercase; }
.table.table--bio tbody td { border-bottom: 1px solid var(--border-soft); padding: 14px 14px; vertical-align: middle; }
.table.table--bio tbody tr:last-child td { border-bottom: 0; }
.table.table--bio tbody tr:hover { background: color-mix(in oklab, var(--icon-green) 5%, transparent); }
.table.table--bio .bio-valor { color: var(--t-base); font-size: 1.08em; font-weight: 700; }
.bio-data-dia { color: var(--t-base); display: block; font-weight: 600; }
.bio-data-hora { color: var(--t-muted); display: block; font-size: 11.5px; }
@media (max-width: 1180px) { .table.table--bio .bio-col-equip { display: none; } }
@media (max-width: 900px) { .table.table--bio .bio-col-mcm { display: none; } .table.table--bio thead th, .table.table--bio tbody td { padding-left: 8px; padding-right: 8px; } }

.bio-secao-titulo { align-items: baseline; display: flex; flex-wrap: wrap; gap: 4px 12px; margin: 28px 0 14px; }
.bio-secao-titulo .exam-section-title { margin: 0; }
.bio-graficos { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 460px), 1fr)); margin-bottom: 16px; }
.bio-graficos > .card { margin: 0; }

/* Cabeçalho compacto do paciente (Bioimpedância › Relatório por paciente). */
.bio-paciente { align-items: center; display: flex; flex-wrap: wrap; gap: 14px 16px; margin-bottom: 16px; padding: 14px 20px; }
.bio-paciente-avatar {
    align-items: center; background: linear-gradient(135deg, var(--primary), var(--icon-green, var(--primary))); border-radius: 50%;
    color: #fff; display: inline-flex; flex: none; font-family: "Inter Tight", sans-serif; font-size: 16px; font-weight: 700;
    height: 48px; justify-content: center; width: 48px;
}
.bio-paciente-info { flex: 1; min-width: 240px; }
.bio-paciente-nome { color: var(--t-base); font-size: 17px; font-weight: 700; letter-spacing: -.01em; line-height: 1.25; margin: 0; }
.bio-paciente-meta { align-items: center; color: var(--t-muted); display: flex; flex-wrap: wrap; font-size: 12.5px; gap: 6px 14px; margin-top: 5px; }
.bio-paciente-meta > span { align-items: center; display: inline-flex; gap: 6px; }
.bio-paciente-meta svg { fill: none; flex: none; height: 13px; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; width: 13px; }
.bio-paciente-meta .badge { font-size: 11px; padding: 2px 8px; }
.bio-paciente-sep { background: var(--border-soft); height: 14px; width: 1px; }
.bio-paciente .bio-acoes { margin-left: auto; }
@media (max-width: 720px) { .bio-paciente-sep { display: none; } .bio-paciente .bio-acoes { margin-left: 0; width: 100%; } }

/* Select com busca (wwwroot/js/select-pesquisavel.js). */
.sp { position: relative; width: 100%; }
.sp-gatilho { background-image: none; align-items: center; cursor: pointer; display: flex; gap: 8px; justify-content: space-between; padding-right: 12px; text-align: left; width: 100%; }
.sp-texto { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp-texto.is-placeholder { color: var(--t-muted); }
.sp-seta { fill: none; flex: none; height: 16px; stroke: var(--t-muted); stroke-linecap: round; stroke-linejoin: round; stroke-width: 2; transition: transform .15s; width: 16px; }
.sp.is-aberto .sp-seta { transform: rotate(180deg); }
.sp.is-aberto .sp-gatilho { border-color: var(--icon-green); box-shadow: 0 0 0 3px color-mix(in oklab, var(--icon-green) 22%, transparent); }
.sp-painel {
    animation: rise-in .16s cubic-bezier(.2, .7, .2, 1) both; background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px;
    box-shadow: var(--shadow-lg); left: 0; margin-top: 6px; min-width: 260px; overflow: hidden; position: absolute; right: 0; top: 100%; z-index: 150;
}
.sp-busca-wrap { align-items: center; border-bottom: 1px solid var(--border-soft); display: flex; gap: 8px; padding: 10px 12px; }
.sp-busca-wrap svg { fill: none; flex: none; height: 16px; stroke: var(--t-muted); stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; width: 16px; }
.sp-busca { background: transparent; border: 0; color: var(--t-base); flex: 1; font: inherit; font-size: 13.5px; min-width: 0; outline: 0; }
.sp-lista { list-style: none; margin: 0; max-height: 280px; overflow-y: auto; padding: 6px; }
.sp-item { align-items: center; border-radius: 8px; cursor: pointer; display: flex; flex-direction: column; gap: 1px; align-items: flex-start; padding: 8px 10px; }
.sp-item.is-ativo { background: var(--icon-green-soft); }
.sp-item.is-selecionado .sp-item-nome { color: var(--icon-green); }
.sp-item-nome { color: var(--t-base); font-size: 13.5px; font-weight: 600; }
.sp-item-sub { color: var(--t-muted); font-size: 11.5px; }
.sp-vazio { color: var(--t-muted); font-size: 13px; padding: 18px 12px; text-align: center; }
.sp-rodape { border-top: 1px solid var(--border-soft); color: var(--t-muted); font-size: 11.5px; padding: 7px 12px; }

/* .card é flex em coluna: os cabeçalhos em linha precisam pedir a direção explicitamente. */
.conta-hero, .bio-paciente { flex-direction: row; }
