/*
 * MyHubSaúde — camada sobre o Metronic 8 (public/assets/css/style.bundle.css).
 *
 * O Metronic dá a base (grid, card, btn, form-control, table, ícones ki-*).
 * Este arquivo só faz três coisas:
 *   1. aplica a identidade "Acolhida" (brand-identity/myhubsaude/kit/C);
 *   2. corrige a tipografia para o público 60+: o Metronic força
 *      html{font-size:13px!important} (12px no celular); aqui a raiz volta a
 *      16px e o texto base fica em 18px, alvos de toque >= 56px;
 *   3. desenha a cena 3D das telas de convidado (auth-scene.js).
 *
 * Regra de produto: resultado de exame nunca é vermelho nem verde; valores e
 * gráfico usam o grafite neutro (--data). O vermelho é só da marca e das ações.
 */

@font-face {
    font-family: Nunito;
    src: url("../fonts/NunitoVariable.woff2") format("woff2");
    font-weight: 200 1000;
    font-display: swap;
}

/* ---------- 1. Identidade sobre as variáveis do Metronic ---------- */

:root,
[data-bs-theme=light] {
    --brand: #a50f1f;          /* Vermelho Sangue: branco sobre ele 7,8:1 */
    --brand-dark: #8b0517;
    --brand-deep: #5e0812;
    --brand-soft: #ffe9e7;
    --brand-tint: #fff5f4;
    --ink: #211a19;
    --muted: #5b5352;          /* 7:1 sobre branco */
    --line: #e8e5e5;
    --field: #8a8281;          /* borda de campo 3,6:1 (WCAG 1.4.11) */
    --data: #2b2523;           /* resultado de exame: neutro */
    --data-soft: #ece8e7;
    --data-range: #d7d3d3;
    --danger: #af3a0e;
    --danger-soft: #fff5f2;
    --touch: 44px;
    --ease: cubic-bezier(.2, .7, .2, 1);
    --surface-line: #e6e2e2;   /* contorno de card no fundo branco (padrão Medical Support) */
    --shadow: 0 4px 20px rgba(33, 26, 25, .06);
    --radius: 8px;
    --radius-card: 12px;
    --title: clamp(24px, 18px + .6vw, 30px);
    /* Sidebar: escura é o padrão; a vermelha vem de [data-menu-theme="vermelho"] no <html>. */
    --sidebar-bg: #1f1a19;
    --sidebar-line: rgba(255, 255, 255, .13);
    --sidebar-active-bg: var(--brand);
    --sidebar-active-text: #fff;
    --sidebar-hover: rgba(255, 255, 255, .08);
    --rail-bg: rgba(255, 255, 255, .08);
    --rail-hover: var(--brand);

    --bs-font-sans-serif: Nunito, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
    --bs-body-font-family: var(--bs-font-sans-serif);
    --bs-body-font-size: 1.125rem;
    --bs-body-line-height: 1.6;
    --bs-body-color: var(--ink);
    --bs-body-bg: #fff;
    --bs-app-bg-color: #fff;
    --bs-heading-color: var(--ink);
    --bs-text-muted: var(--muted);
    --bs-gray-600: #6b6362;
    --bs-gray-700: var(--muted);
    --bs-gray-800: #352d2b;
    --bs-gray-900: var(--ink);
    --bs-border-color: var(--line);

    --bs-primary: var(--brand);
    --bs-primary-rgb: 165, 15, 31;
    --bs-primary-active: var(--brand-dark);
    --bs-primary-light: var(--brand-soft);
    --bs-primary-inverse: #fff;
    --bs-primary-clarity: rgba(165, 15, 31, .2);
    --bs-primary-bg-subtle: var(--brand-soft);
    --bs-primary-text-emphasis: var(--brand-deep);
    --bs-link-color: var(--brand-dark);
    --bs-link-color-rgb: 139, 5, 23;
    --bs-link-hover-color: var(--brand);
    --bs-link-hover-color-rgb: 165, 15, 31;

    --bs-danger: var(--danger);
    --bs-danger-rgb: 175, 58, 14;
    --bs-danger-active: #8f2f0b;
    --bs-danger-light: var(--danger-soft);
    --bs-form-invalid-color: var(--danger);
    --bs-form-invalid-border-color: var(--danger);
    --bs-focus-ring-color: rgba(165, 15, 31, .35);
}

/* ---------- 2. Tipografia: escala do Medical Support ----------
   Raiz 14px, como na referência (o Metronic força 13px, 12px abaixo de 992px;
   por isso o !important). Texto 15px (a Nunito é mais baixa que a Inter da
   referência), campos em 16px (o iOS não dá zoom ao focar), títulos 24–30px,
   12px só em rótulos e selos, alvos de 44px e foco sempre visível. */
html { font-size: 14px !important; font-family: var(--bs-font-sans-serif); }
body {
    font-family: var(--bs-font-sans-serif);
    font-size: 15px !important;
    line-height: 1.5;
    font-variant-numeric: tabular-nums;
    color: var(--ink);
}

h1, .h1 { font-size: var(--title); font-weight: 800; line-height: 1.2; letter-spacing: -.02em; }
h2, .h2 { font-size: 1.3rem; font-weight: 800; line-height: 1.3; }
h3, .h3 { font-size: 1.15rem; font-weight: 700; }
.lead { font-size: 1.1rem; font-weight: 400; color: var(--muted); }
.text-muted, .text-gray-600 { color: var(--muted) !important; }

.form-label { font-size: 1rem; font-weight: 700; color: var(--ink); margin-bottom: .4rem; }
.form-control, .form-select {
    min-height: var(--touch);
    background-color: #fff;
    font-size: 16px;
    padding: .55rem .9rem;
    border: 1px solid var(--field);
    border-radius: var(--radius);
    color: var(--ink);
}
.form-control:focus, .form-select:focus { background-color: #fff; color: var(--ink); border-color: var(--brand); box-shadow: 0 0 0 3px var(--bs-primary-clarity); }
.form-control.is-invalid { border-color: var(--danger); }
.invalid-feedback { font-size: 1rem; font-weight: 700; color: var(--danger); }
.form-text { font-size: .95rem; }
.form-check-input { width: 24px; height: 24px; flex: none; border: 1px solid var(--field); }   /* WCAG 2.5.8: alvo ≥ 24px */
.form-check { min-height: var(--touch); display: flex; align-items: center; gap: .6rem; padding-left: 0; }
.form-check .form-check-input { float: none; margin: 0; }
.form-check-label { cursor: pointer; }
.form-check-input:checked { background-color: var(--brand); border-color: var(--brand); }
.form-check-label { font-size: 1.05rem; color: var(--ink); }

.btn {
    --bs-btn-font-size: 1.05rem;
    --bs-btn-font-weight: 700;
    --bs-btn-border-radius: var(--radius);
    min-height: var(--touch);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
}
.btn-sm { min-height: var(--touch); --bs-btn-font-size: 1rem; }   /* alvo mínimo do projeto vale também para o botão pequeno */
.btn-lg { --bs-btn-font-size: 1.1rem; }
.btn i { font-size: 1.25rem; }
.btn.btn-outline-primary { border: 1px solid var(--brand) !important; color: var(--brand-dark); background: #fff; }
.btn.btn-outline-primary:hover { background: var(--brand-soft) !important; color: var(--brand-dark) !important; }
.btn.btn-outline-danger { border: 1px solid var(--danger) !important; color: var(--danger); background: #fff; }
.btn.btn-outline-danger:hover { background: var(--danger-soft) !important; color: var(--danger) !important; }

:focus-visible { outline: 3px solid var(--brand); outline-offset: 3px; border-radius: 6px; }

.skip-link {
    position: absolute; left: 16px; top: -80px; z-index: 1000;
    padding: 12px 18px; border-radius: var(--radius);
    color: #fff; background: var(--ink); font-weight: 700; text-decoration: none;
}
.skip-link:focus { top: 16px; color: #fff; }

/* Card no acabamento do Medical Support: contorno discreto + sombra suave sobre fundo branco. */
.card { --bs-card-bg: #fff; background-color: #fff; border: 1px solid var(--surface-line); border-radius: var(--radius-card); box-shadow: var(--shadow); }
.card .card-header { min-height: 60px; border-bottom: 1px solid var(--surface-line); }
.card .card-header .card-title { font-size: 1.2rem; font-weight: 800; color: var(--ink); }
.card .card-body { padding: 1.5rem; }

/* ---------- Área logada: layout do Medical Support (Demo 57) ----------
   Sidebar escura fixa (280px; 80px recolhida), header de 100px com busca no
   centro, conteúdo em largura total sobre fundo branco. Medidas da referência;
   tipografia e alvos maiores (60+). Comportamento em public/js/layout.js. */

.brand { display: inline-flex; align-items: center; min-height: var(--touch); }
.brand-logo { display: block; width: auto; height: 36px; }
.brand-logo-white { display: none; }

[data-menu-theme="vermelho"] {
    --sidebar-bg: var(--brand);
    --sidebar-line: rgba(255, 255, 255, .25);
    --sidebar-active-bg: #fff;
    --sidebar-active-text: var(--brand-dark);
    --sidebar-hover: rgba(255, 255, 255, .15);
    --rail-bg: rgba(255, 255, 255, .15);
    --rail-hover: rgba(255, 255, 255, .28);
}

body.app-shell { background: #fff; }
.app-shell .app-container.container-xxl { max-width: none; }
.app-shell .app-header { background: #fff; border-bottom: 1px solid var(--surface-line); }
.app-shell .app-content { padding-top: 1.25rem; padding-bottom: 0; }

/* Sidebar encostada nas bordas, sem as sobras do Demo 57 (gap e cantos arredondados). */
@media (min-width: 992px) {
    body.app-shell[data-kt-app-sidebar-enabled="true"] {
        --bs-app-sidebar-width: 280px;
        --bs-app-sidebar-gap-start: 0px; --bs-app-sidebar-gap-end: 0px; --bs-app-sidebar-gap-top: 0px; --bs-app-sidebar-gap-bottom: 0px;
    }
    html[data-menu="recolhido"] body.app-shell[data-kt-app-sidebar-enabled="true"] { --bs-app-sidebar-width: 80px; }
    .app-shell .app-sidebar { margin: 0 !important; border-radius: 0 !important; }
}

.app-shell .app-sidebar { flex-direction: column; background: var(--sidebar-bg); }
.app-shell .app-sidebar-header { flex-shrink: 0; display: flex; align-items: center; justify-content: space-between; gap: .5rem; border-bottom: 1px solid var(--sidebar-line); }
.app-shell .app-sidebar-body { display: flex; flex: 1 1 auto; flex-direction: column; min-height: 0; }
.app-shell .app-sidebar-content { display: flex; flex: 1 1 auto; flex-direction: column; min-height: 0; border-left: 0 !important; }
.app-shell #kt_app_sidebar_content { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.app-shell .app-sidebar-nav { display: none; flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }

.sidebar-logo { display: flex; align-items: center; min-height: var(--touch); padding: 6px 0; border-radius: var(--radius); }
.sidebar-logo-full { display: block; width: 210px; max-width: 100%; height: auto; }
.sidebar-logo-symbol { display: none; width: 40px; height: 40px; border-radius: 12px; box-shadow: 0 0 0 1px var(--sidebar-line); }
.sidebar-close { width: var(--touch); height: var(--touch); color: #fff; background: var(--rail-bg); }
.sidebar-close i { color: #fff; }
.sidebar-section { color: #fff; opacity: .78; font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }

/* Ícones do shell com tamanho fixo (o .fs-* daqui é a escala 60+ de texto, grande demais para ícone). */
.app-shell .app-sidebar .menu-icon { width: 2rem; margin-right: .5rem; }
.app-shell .app-sidebar .menu-icon i, .sidebar-rail i, .sidebar-close i, .app-shell .app-header .btn-icon i, .confirm-dialog .btn-icon i { font-size: 1.5rem; }
.app-shell .app-sidebar .menu-link { min-height: var(--touch); padding: .5rem 1rem; border-radius: var(--radius); cursor: pointer; }
.app-shell .app-sidebar .menu-title { font-size: 1.05rem; font-weight: 600; }
.app-shell .app-sidebar .menu-title, .app-shell .app-sidebar .menu-icon i { color: #fff !important; }
.app-shell .app-sidebar .menu-link:not(.active):hover { background: var(--sidebar-hover) !important; }
.app-shell .app-sidebar .menu-link.active { background: var(--sidebar-active-bg) !important; }
.app-shell .app-sidebar .menu-link.active .menu-title, .app-shell .app-sidebar .menu-link.active .menu-icon i { color: var(--sidebar-active-text) !important; }
.app-shell .app-sidebar .menu-item + .menu-item { margin-top: 2px; }
.app-shell .app-sidebar :focus-visible { outline: 3px solid #fff; outline-offset: -4px; }

/* Grupo do menu em <details> (sem o KTMenu): abre e fecha sem JavaScript. */
.app-shell .menu-accordion > summary { list-style: none; }
.app-shell .menu-accordion > summary::-webkit-details-marker { display: none; }
.app-shell .menu-accordion[open] > .menu-sub-accordion { display: flex; flex-direction: column; }
.app-shell .app-sidebar .menu-arrow::after { background-color: #fff; transition: transform .2s var(--ease); }
.app-shell .menu-accordion[open] > summary .menu-arrow::after { transform: rotateZ(90deg); }
.app-shell .menu-accordion > summary.active .menu-arrow::after { background-color: var(--sidebar-active-text); }

/* Barra de ícones do menu recolhido. */
.sidebar-rail { width: var(--touch); height: var(--touch); color: #fff; background: var(--rail-bg); }
.sidebar-rail i { color: #fff; }
.sidebar-rail:hover { background: var(--rail-hover); }
.sidebar-rail[aria-current="page"] { background: var(--sidebar-active-bg); }
.sidebar-rail[aria-current="page"] i { color: var(--sidebar-active-text); }

@media (min-width: 992px) {
    html[data-menu="recolhido"] .app-shell .app-sidebar-nav { display: block; width: 100%; }
    html[data-menu="recolhido"] .app-shell .app-sidebar-content { display: none; }
    html[data-menu="recolhido"] .app-shell .app-sidebar-header { padding: 24px 0 !important; justify-content: center; }
    html[data-menu="recolhido"] .app-shell .sidebar-logo { justify-content: center; padding: 0; }
    html[data-menu="recolhido"] .app-shell .sidebar-logo-full { display: none; }
    html[data-menu="recolhido"] .app-shell .sidebar-logo-symbol { display: block; }
}

/* Gaveta no celular: classes do KTDrawer (drawer, drawer-start, drawer-on) postas pelo layout.js. */
@media (max-width: 991.98px) {
    .app-shell .app-sidebar.drawer { width: 300px; max-width: calc(100vw - 24px); }
    .app-shell .app-sidebar.drawer:not(.drawer-on) { visibility: hidden; transition: transform .3s ease-in-out, visibility 0s .3s !important; }
    .app-shell .app-sidebar.drawer.drawer-on { visibility: visible; }
    .app-shell .app-sidebar-header { padding: 1rem 1.25rem !important; }
    /* Sem JavaScript não há gaveta: o menu aparece aberto, abaixo do cabeçalho. */
    html:not(.js) .app-shell .app-sidebar { display: flex; position: relative; width: 100%; margin-top: var(--bs-app-header-height); }
    html:not(.js) .app-shell #kt_app_sidebar_mobile_toggle, html:not(.js) .app-shell .sidebar-close { display: none !important; }
}
.app-shell .drawer-overlay { background-color: rgba(20, 12, 11, .45); }

/* Cabeçalho: botões, busca no centro e avatar. */
.app-shell .app-header .btn-icon { width: var(--touch); height: var(--touch); flex: 0 0 auto; }
.app-shell .app-header .btn-icon.btn-light { background: #f5f2f2; border: 1px solid var(--surface-line); color: var(--ink); }
.app-shell .app-header .btn-icon.btn-light i { color: var(--ink); }
.app-shell .app-header .btn-icon.btn-light:hover { background: var(--brand-soft) !important; border-color: var(--brand-soft); }
.app-shell .app-header .btn-icon.btn-light:hover i { color: var(--brand-dark); }
html:not(.js) #app-collapse, html:not(.js) #app-theme-toggle, html:not(.js) .app-search { display: none !important; }

.app-search { position: relative; flex: 1 1 auto; min-width: 0; max-width: 480px; }
.app-search-input {
    width: 100%; min-height: var(--touch); padding: .5rem 4.5rem .5rem 2.75rem; font-size: 1rem; color: var(--ink);
    background: #f5f2f2; border: 1px solid var(--surface-line); border-radius: .8rem; outline: none;
    transition: background-color .16s ease, border-color .16s ease;
}
.app-search-input::placeholder { color: var(--muted); opacity: 1; }
.app-search-input:focus { background: #fff; border-color: var(--brand); box-shadow: 0 0 0 3px var(--bs-primary-clarity); }
.app-search-icon { position: absolute; left: .85rem; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.app-search-shortcut { position: absolute; right: .75rem; top: 50%; transform: translateY(-50%); padding: .05rem .4rem; font-size: 12px; color: var(--muted); background: #fff; border: 1px solid var(--surface-line); border-radius: .375rem; pointer-events: none; }
.app-search-list { position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 1100; max-height: min(70vh, 520px); overflow-y: auto; padding: .25rem 0; background: #fff; border: 1px solid var(--surface-line); border-radius: .875rem; box-shadow: 0 16px 48px rgba(33, 26, 25, .14); }
.app-search-item { display: flex; align-items: center; gap: .75rem; min-height: var(--touch); padding: .5rem 1rem; color: var(--ink); text-decoration: none; font-size: 1rem; font-weight: 600; border-bottom: 1px solid #f3f0f0; }
.app-search-item:last-child { border-bottom: 0; }
.app-search-item i { color: var(--muted); font-size: 1.5rem; }
.app-search-item:hover, .app-search-item.is-active { background: var(--brand-soft); color: var(--brand-dark); }
.app-search-item:hover i, .app-search-item.is-active i { color: var(--brand); }
.app-search-section { margin-left: auto; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; font-weight: 400; color: var(--muted); white-space: nowrap; }
.app-search-empty { padding: 1rem; text-align: center; color: var(--muted); }
@media (max-width: 575.98px) { .app-search-shortcut { display: none; } .app-search-input { padding-right: 1rem; } }

/* Desktop: 3 colunas iguais nos lados mantêm a busca no centro. */
@media (min-width: 992px) {
    .app-shell #kt_app_header_container { display: grid !important; grid-template-columns: minmax(210px, 1fr) minmax(0, 480px) minmax(210px, 1fr); align-items: center; }
    .app-shell #kt_app_header_container > .app-header-start { justify-self: start; min-width: 0; }
    .app-shell #kt_app_header_container > .app-search { width: 100%; max-width: none; }
    .app-shell #kt_app_header_container > .app-navbar { justify-self: end; margin-left: 0 !important; }
}

.app-avatar {
    width: var(--touch); height: var(--touch); flex: 0 0 var(--touch); display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--surface-line);
    background: var(--brand-soft); color: var(--brand-dark); font-size: 1rem; font-weight: 800; cursor: pointer; list-style: none;
}
.app-avatar::-webkit-details-marker { display: none; }
.app-avatar-lg { width: 56px; height: 56px; flex-basis: 56px; font-size: 1.15rem; cursor: default; }

/* Dropdowns do cabeçalho em <details>: o conteúdo só existe aberto, posicionado sob o botão. */
.app-dropdown { position: relative; }
.app-dropdown > summary { list-style: none; cursor: pointer; }
.app-dropdown > summary::-webkit-details-marker { display: none; }
.app-dropdown > .menu-sub-dropdown { display: flex; position: absolute; top: calc(100% + 10px); right: 0; z-index: 107; max-width: calc(100vw - 24px); }
.app-dropdown-title { font-size: 1.15rem; font-weight: 800; }
.app-dropdown .menu-link { min-height: var(--touch); font-size: 1.05rem; }
/* "Sair": o .text-danger do Metronic dá 3,9:1 no branco; o laranja-ferrugem do projeto dá 5,8:1. */
.text-danger { color: var(--danger) !important; }
.theme-swatch { display: inline-block; width: 14px; height: 14px; margin-right: 6px; border-radius: 50%; border: 1px solid var(--field); vertical-align: -1px; }
.theme-swatch-dark { background: #1f1a19; }
.theme-swatch-red { background: var(--brand); }

/* Cabeçalho de página (padrão Medical Support: trilha, sobretítulo, título e ações). */
.breadcrumbs ol { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; list-style: none; margin: 0 0 1rem; padding: 0; font-size: .95rem; font-weight: 600; }
.breadcrumbs li { display: inline-flex; align-items: center; gap: .35rem; color: var(--muted); }
.breadcrumbs li + li::before { content: "\203A"; color: var(--muted); font-weight: 400; font-size: 1.15rem; }
.breadcrumbs a { color: var(--brand-dark); text-decoration: none; }
.breadcrumbs a:hover { text-decoration: underline; }
.breadcrumbs [aria-current="page"] { color: var(--ink); }
.page-header { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: .75rem 1.5rem; margin-bottom: 1.5rem; }
.page-header h1 { margin: 0 0 .25rem; font-size: var(--title); font-weight: 800; letter-spacing: -.02em; }
.page-header .page-lead { margin: 0; color: var(--muted); }
.page-eyebrow { display: block; margin-bottom: .4rem; font-size: 12px; font-weight: 800; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); }
.page-actions { display: flex; flex-wrap: wrap; gap: .75rem; }
.page-title { margin: 0; }

/* Rodapé dentro da área de conteúdo, como na referência. */
.app-footer-note { padding: 1.75rem 0 2rem; color: var(--muted); font-size: 13px; }
@media (max-width: 991.98px) { .app-shell .app-container { padding-inline: 1rem !important; } .card .card-body { padding: 1.25rem; } }

.notice-status { background: var(--brand-tint); border: 2px dashed var(--brand); color: var(--ink); }
.notice-error { background: var(--danger-soft); border: 2px solid var(--danger); color: var(--danger); }

/* Cartão de exame no início */
.indicator { transition: transform .2s var(--ease), box-shadow .2s var(--ease); }
.indicator:hover { transform: translateY(-3px); box-shadow: 0 24px 60px rgba(33, 26, 25, .12); }
.indicator-link { color: var(--ink); text-decoration: none; }
.indicator-link::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.indicator-link:hover { color: var(--brand-dark); }
.indicator-value { font-size: 2rem; font-weight: 800; line-height: 1.1; color: var(--data); }
.indicator-value .unit { font-size: 1rem; font-weight: 700; color: var(--muted); }
.symbol-brand { display: inline-grid; place-items: center; width: 52px; height: 52px; border-radius: 1rem; background: var(--brand-soft); color: var(--brand); }
.symbol-brand i { font-size: 1.85rem; color: var(--brand); }

.details { display: grid; grid-template-columns: max-content 1fr; gap: 1rem 2rem; margin: 0; }
.details dt { color: var(--muted); font-weight: 400; }
.details dd { margin: 0; font-weight: 700; }

.consent { padding: 1.25rem; border: 2px solid var(--brand-soft); border-radius: 1rem; background: var(--brand-tint); }
/* float tira o legend de cima da borda do fieldset e o põe dentro da caixa. */
.consent-title { float: left; width: 100%; margin: 0 0 .35rem; padding: 0; font-size: 1.125rem; font-weight: 800; color: var(--ink); }
.consent-title + * { clear: left; }
.consent.is-invalid { border-color: var(--danger); }
.result-row { padding: 1.25rem; border: 1px solid var(--line); border-radius: 1rem; }

/* Conferência: aviso sobre a LEITURA do laudo (não sobre o resultado). Areia
   neutra, nunca vermelho/verde: o valor em si não é julgado. */
.notice-attention { background: #fbf6ec; border: 2px solid #d9c9a3; color: var(--ink); }
.result-row-attention { border: 2px solid #d9c9a3; background: #fffdf8; }
.attention-list { padding-left: 1.25rem; color: #5a4a26; font-weight: 700; }
.provenance { padding: 1rem; border-radius: .75rem; background: #f8f6f5; }
/* .badge do Metronic não quebra linha; "Reconhecido como: Hemoglobina glicada (HbA1c)" estourava a 390px. */
.provenance .badge { white-space: normal; text-align: left; line-height: 1.4; }
.raw-line {
    padding: .5rem .75rem; border-radius: .5rem; background: #fff; border: 1px dashed var(--field);
    font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 1rem; white-space: pre-wrap; word-break: break-word;
}
.result-row legend { float: none; width: auto; padding: 0 .5rem; font-size: 1.125rem; font-weight: 800; }

.table { font-size: 1.05rem; }
.table thead th { font-size: 12px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.table td a { display: inline-flex; align-items: center; gap: .35rem; min-height: var(--touch); font-weight: 700; }
/* O .visually-hidden do cabeçalho é absoluto: sem isto ele escapa da rolagem e alarga a página no celular. */
.table-responsive { position: relative; }

/* ---------- Gráfico (EvolutionChart): uma cor só, neutra ---------- */

.chart { margin: 0; }
/* overflow visível: o último rótulo de data passa um pouco da área do gráfico. */
.chart svg { display: block; width: 100%; max-width: 960px; height: auto; margin-inline: auto; overflow: visible; }
.chart figcaption { margin-top: .75rem; color: var(--muted); }
.chart-legend:empty { display: none; }
.chart-grid { stroke: var(--line); stroke-width: 1; }
.chart-axis { fill: var(--muted); font-size: 13px; font-family: var(--bs-font-sans-serif); }
.chart-band { fill: var(--data-soft); }
.chart-range { stroke: var(--data-range); stroke-width: 10; stroke-linecap: round; }
.chart-line { fill: none; stroke: var(--data); stroke-width: 3; stroke-linejoin: round; }
.chart-point { fill: #fff; stroke: var(--data); stroke-width: 4; }
/* O SVG encolhe junto com a tela (viewBox de 720): os rótulos crescem em unidades do SVG para ficarem com ~12px na tela. */
@media (max-width: 767.98px) { .chart-axis { font-size: 20px; } .chart-point { stroke-width: 5; } }
@media (max-width: 479.98px) { .chart-axis { font-size: 26px; } }

/* ---------- 3. Cena 3D das telas de convidado ---------- */

/* O Metronic deixa o body com display:flex e height:100%: a cena ficava presa
   na altura da janela e o overflow cortava o formulário, sem rolagem. */
body.stage { display: block; height: auto; min-height: 100vh; color: var(--ink); background: #fff; }
.stage .auth-scene :focus-visible { outline-color: #fff; }

.auth-scene {
    --px: 0;
    --py: 0;
    position: relative;
    min-height: 100vh;
    overflow-x: clip;          /* a órbita sai pela lateral; na vertical a página rola */
    isolation: isolate;
    background:
        radial-gradient(70% 60% at 50% 40%, rgba(255, 120, 120, .35) 0%, rgba(255, 120, 120, 0) 60%),
        radial-gradient(120% 90% at 10% 0%, #c21d33 0%, var(--brand) 38%, #7a0a18 72%, var(--brand-deep) 100%);
}
.auth-scene::after { /* vinheta para dar profundidade */
    content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
    background: radial-gradient(120% 100% at 50% 40%, transparent 55%, rgba(30, 4, 8, .45) 100%);
}

.auth-scene__canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.auth-scene__canvas--back { z-index: 1; }
.auth-scene__canvas--front { z-index: 4; }
.auth-scene__orbit { position: absolute; inset: 0; pointer-events: none; }
.auth-scene__orbit--back { z-index: 2; }
.auth-scene__orbit--front { z-index: 5; }

.auth-word {
    position: absolute; left: 0; top: 0;
    padding: .45rem 1rem; border-radius: 999px;
    font-size: 1.05rem; font-weight: 800; white-space: nowrap;
    will-change: transform, opacity;
    backdrop-filter: blur(6px);
}
.auth-word--exam { color: #fff; background: rgba(255, 255, 255, .16); border: 1px solid rgba(255, 255, 255, .35); }
.auth-word--care { color: #ffe3e0; background: rgba(60, 4, 12, .35); border: 1px solid rgba(255, 200, 196, .3); }

/* Hub: laudos de laboratórios diferentes convergindo num gráfico só (CSS 3D). */
.auth-hub {
    position: absolute; z-index: 3; left: 50%; top: 38%;
    width: min(400px, 32vw, 52vh); aspect-ratio: 1;
    transform: translate(-50%, -50%);
    perspective: 1200px;
    pointer-events: none;
}
.auth-hub__stage {
    position: absolute; inset: 0;
    transform-style: preserve-3d;
    transform: rotateX(calc(14deg - var(--py) * 10deg)) rotateY(calc(-22deg + var(--px) * 18deg));
    transition: transform .1s linear;
}
.auth-glass {
    position: absolute;
    border-radius: 1.25rem;
    background: linear-gradient(145deg, rgba(255, 255, 255, .34), rgba(255, 255, 255, .1));
    border: 1px solid rgba(255, 255, 255, .45);
    box-shadow: 0 30px 70px rgba(40, 3, 9, .45), inset 0 1px 0 rgba(255, 255, 255, .5);
    backdrop-filter: blur(10px);
    color: #fff;
}
.auth-hub__laudo { width: 46%; padding: .9rem 1rem; animation: auth-float 7s var(--ease) infinite alternate; }
.auth-hub__laudo strong { display: block; font-size: .95rem; font-weight: 800; }
.auth-hub__laudo span { display: block; font-size: .85rem; opacity: .85; }
.auth-hub__laudo i { display: block; height: 6px; margin-top: .55rem; border-radius: 3px; background: rgba(255, 255, 255, .45); }
.auth-hub__laudo i + i { width: 70%; }
.auth-hub__laudo--a { left: -6%; top: 2%; transform: translateZ(-120px) rotateZ(-6deg); }
.auth-hub__laudo--b { right: -10%; top: 12%; transform: translateZ(-60px) rotateZ(5deg); animation-delay: -2.5s; }
.auth-hub__laudo--c { left: 2%; bottom: 0; transform: translateZ(-90px) rotateZ(3deg); animation-delay: -5s; }
.auth-hub__chart { left: 8%; top: 30%; width: 84%; padding: 1.1rem 1.25rem 1rem; transform: translateZ(70px); }
.auth-hub__chart strong { display: block; font-size: 1.05rem; font-weight: 800; }
.auth-hub__chart span { display: block; font-size: .9rem; opacity: .9; }
.auth-hub__chart svg { display: block; width: 100%; height: auto; margin-top: .5rem; overflow: visible; }
.auth-hub__grid { stroke: rgba(255, 255, 255, .25); stroke-width: 1; }
.auth-hub__line { fill: none; stroke: #fff; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 400; stroke-dashoffset: 400; animation: auth-draw 2.4s .4s var(--ease) forwards; }
.auth-hub__dot { fill: var(--brand); stroke: #fff; stroke-width: 3; opacity: 0; animation: auth-pop .4s var(--ease) forwards; }
.auth-hub__dot:nth-of-type(1) { animation-delay: .6s; }
.auth-hub__dot:nth-of-type(2) { animation-delay: 1.1s; }
.auth-hub__dot:nth-of-type(3) { animation-delay: 1.6s; }
.auth-hub__dot:nth-of-type(4) { animation-delay: 2.1s; }
.auth-hub__dot:nth-of-type(5) { animation-delay: 2.6s; }

@keyframes auth-float { to { translate: 0 -14px; } }
@keyframes auth-draw { to { stroke-dashoffset: 0; } }
@keyframes auth-pop { from { opacity: 0; scale: .4; } to { opacity: 1; scale: 1; } }

/* Tela dividida do Medical Support: formulário em fundo branco à esquerda, painel da marca à direita. */
.auth-split { display: flex; min-height: 100vh; }
.auth-form-side {
    position: relative; z-index: 1; flex: 1 1 50%; min-width: 0; min-height: 100vh;
    display: flex; flex-direction: column; align-items: center;
    padding: clamp(24px, 4vw, 56px) clamp(20px, 5vw, 72px); background: #fff; color: var(--ink);
}
.auth-form-header, .auth-form-panel, .auth-form-footer { width: min(100%, 500px); }
.auth-form-header .brand-logo { height: 36px; }
.auth-form-panel { margin-block: auto; padding-block: 1.5rem; }
.auth-form-footer { padding-top: 1.5rem; color: var(--muted); font-size: 13px; line-height: 1.5; }
.auth-form-side :focus-visible { outline-color: var(--brand); }
.auth-scene { flex: 1 1 50%; min-width: 0; }
/* No desktop o painel fica do tamanho da janela; só o formulário rola. */
@media (min-width: 992px) { .auth-scene { position: sticky; top: 0; align-self: flex-start; height: 100vh; min-height: 0; } }
.auth-card { color: var(--ink); background: transparent; border: 0; border-radius: 0; box-shadow: none; }
.auth-card .card-body { padding: 0; }
.auth-card h1, .auth-card h2 { margin-bottom: 1.5rem; }

.auth-brand { position: absolute; z-index: 6; left: 50%; bottom: clamp(1.5rem, 7vh, 4.5rem); width: min(100% - 3rem, 460px); transform: translateX(-50%); text-align: center; color: #fff; text-shadow: 0 2px 18px rgba(40, 3, 9, .6); }
.auth-brand-badge { display: inline-flex; align-items: center; gap: .4rem; margin-bottom: 1.25rem; padding: .3rem .9rem; border: 1px solid rgba(255, 255, 255, .5); border-radius: 999px; background: rgba(255, 255, 255, .14); font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; text-shadow: none; }
.auth-brand-badge i { font-size: 1.2rem; color: #fff; }
.auth-brand-logo { display: block; width: auto; height: 40px; margin: 0 auto 1.25rem; }
.auth-brand-title { margin: 0 0 .5rem; color: #fff; font-size: clamp(1.375rem, 1rem + 1vw, 1.875rem); font-weight: 800; line-height: 1.2; letter-spacing: -.02em; }
.auth-brand-title span { color: #ffd3cf; white-space: nowrap; }
.auth-brand-lead { margin: 0 auto; max-width: 22rem; color: rgba(255, 255, 255, .88); font-size: 16px; line-height: 1.55; }

/* Atalho só do ambiente local: discreto, não é para o público final. */
.dev-login { margin-top: .75rem; padding-top: .75rem; border-top: 2px dashed var(--line); }
.dev-login .btn { min-height: 44px; font-size: 1rem; }

/* Google / Microsoft (Goal 08): texto inteiro ("Continuar com ..."), um abaixo do outro.
   Cores das diretrizes oficiais de cada provedor (tema claro), não da marca MyHubSaúde. */
.social-buttons { display: grid; grid-template-columns: 1fr; gap: .625rem; }
.btn.btn-social {
    gap: .75rem;
    width: 100%;
    background: #fff;
    border: 1px solid #747775 !important;   /* o Metronic zera a borda de .btn sem variante */
    color: #1f1f1f;
}
.btn.btn-social-google { font-family: Roboto, "Segoe UI", var(--bs-font-sans-serif); font-weight: 500; }
.btn.btn-social-microsoft { font-family: "Segoe UI", var(--bs-font-sans-serif); font-weight: 600; border-color: #8c8c8c !important; color: #5e5e5e; }
.btn.btn-social:hover { background: #f8f9fa !important; color: #1f1f1f !important; }
.btn.btn-social-microsoft:hover { color: #5e5e5e !important; }
.btn.btn-social:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
.social-list { display: grid; gap: .75rem; }
.social-list li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem; padding: 1rem; border: 1px solid var(--line); border-radius: .875rem; }
.social-divider { display: flex; align-items: center; gap: 1rem; margin: 1.25rem 0; color: var(--muted); font-size: 1rem; }
.social-divider::before, .social-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* Notebooks baixos: o formulário cabe sem rolar; a chamada da marca encolhe antes. */
@media (min-width: 992px) and (max-height: 820px) {
    .auth-brand-lead { display: none; }
    .auth-brand-badge { margin-bottom: .75rem; }
    .auth-brand-logo { height: 34px; margin-bottom: .75rem; }
    .auth-form-panel { padding-block: 1rem; }
}
@media (min-width: 992px) and (max-height: 680px) {
    .auth-brand-badge { display: none; }
    .auth-form-side { padding-block: 1.25rem; }
}

/* Telas estreitas: o painel da marca vira uma faixa no topo (só a rede ao fundo) e o formulário vem logo abaixo. */
@media (max-width: 991.98px) {
    .auth-split { flex-direction: column; }
    .auth-scene { order: -1; flex: none; min-height: 0; }
    .auth-hub, .auth-scene__orbit { display: none; }
    .auth-scene__canvas { opacity: .6; }
    .auth-brand { position: relative; left: auto; bottom: auto; transform: none; width: auto; padding: 2rem 1.25rem 1.75rem; }
    .auth-brand-badge { margin-bottom: 1rem; }
    .auth-brand-logo { height: 34px; margin-bottom: .75rem; }
    .auth-brand-title { font-size: 1.25rem; }
    .auth-brand-lead { display: none; }
    .auth-form-header { display: none; }
    .auth-form-side { min-height: 0; flex: none; padding: 1.75rem 1.25rem 1.5rem; }
    .auth-form-panel { padding-block: 0 1rem; }
}
@media (max-width: 575.98px) and (max-height: 720px) {
    .auth-brand-badge { display: none; }
    .auth-brand { padding-block: 1.25rem; }
}

@media (max-width: 575.98px) {
    .details { grid-template-columns: 1fr; gap: .25rem; }
    .details dd { margin-bottom: .75rem; }
}

/* Telas de convidado com escala compacta (16px); as telas clínicas mantêm o texto maior. */
.auth-card { font-size: 1rem; line-height: 1.5; min-width: 0; }
.auth-card p, .auth-card .form-control, .auth-card .form-select, .auth-card .form-check-label, .auth-card .btn { font-size: 16px; }
.auth-card h1, .auth-card h2 { font-size: clamp(1.5rem, 1.2rem + .8vw, 1.875rem); font-weight: 800; margin-bottom: 1rem; }
.auth-card .form-label { font-size: 14px; }
.auth-card .form-label { margin-bottom: .375rem; }
.auth-card .gap-5 { gap: 1rem !important; }
.auth-card .row.g-5 { --bs-gutter-y: 1rem; }
.auth-card .social-divider { margin: .75rem 0; }
.auth-card .social-buttons { gap: .5rem; }
.auth-card .btn-social { gap: .625rem; white-space: normal; }
.auth-card .btn-social svg { flex-shrink: 0; }
.auth-links { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem 1rem; margin-top: .875rem; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
    .auth-hub__line { stroke-dashoffset: 0; }
    .auth-hub__dot { opacity: 1; }
}

/* --- Organizações e administração --------------------------------------- */
/* Código que o paciente digita: grande, espaçado, fácil de ditar. */
.share-code { font-size: 2rem; font-weight: 800; letter-spacing: .2em; color: var(--ink); font-variant-numeric: tabular-nums; }

.admin-tabs { display: flex; flex-wrap: wrap; gap: .5rem; border-bottom: 2px solid var(--line); }
.admin-tabs a {
    display: inline-flex; align-items: center; min-height: 44px; padding: 0 1rem;
    font-weight: 700; color: var(--muted); border-bottom: 3px solid transparent; margin-bottom: -2px;
}
.admin-tabs a:hover { color: var(--ink); }
.admin-tabs a[aria-current="page"] { color: var(--brand); border-bottom-color: var(--brand); }

.pagination { flex-wrap: wrap; gap: .25rem; }
.pagination .page-link { min-width: 44px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; }

/* ---------- Painel de saúde (Goal 07) ---------- */

.category-title { margin-bottom: .85rem; font-size: 1.15rem; font-weight: 800; }
.indicator-value-text { font-size: 1.5rem; }
.timeline-date {
    display: inline-grid; place-items: center; min-width: 7.5rem; min-height: 40px; padding: 0 .85rem;
    border-radius: var(--radius); background: var(--data-soft); color: var(--data); font-weight: 800;
}
.period-filter summary { min-height: 44px; display: inline-flex; align-items: center; gap: .35rem; cursor: pointer; color: var(--brand-dark); list-style: none; }
.period-filter summary::-webkit-details-marker { display: none; }
.period-filter summary::after { content: "\203A"; font-size: 1.35rem; line-height: 1; transition: transform .2s var(--ease); }
.period-filter details[open] > summary::after { transform: rotate(90deg); }
.period-filter summary:hover { text-decoration: underline; }
.compare-table th[scope="row"] { font-weight: 800; }
#comparar-a, #comparar-b { min-width: 12rem; padding-right: 2.75rem; }

/* ---------- Componentes do Medical Support (botões, listas, modal) ---------- */

/* Botões neutros (Cancelar, Voltar, Ver laudo): o btn-light do Metronic some no fundo branco. */
.btn.btn-light:not(.btn-icon) { background-color: #ebe7e6; border: 1px solid #ddd7d6; color: #2f2725; }
.btn.btn-light:not(.btn-icon) i { color: #2f2725; }
.btn.btn-light:not(.btn-icon):hover:not(:disabled) { background-color: #ddd7d6 !important; border-color: #d2cbca !important; color: #2f2725 !important; }
/* Ação secundária em vermelho claro (Limpar, Aplicar, opção escolhida). */
.btn.btn-light-primary { background-color: var(--brand-soft); color: var(--brand-dark); box-shadow: inset 0 0 0 1px #f0b9b3 !important; }
.btn.btn-light-primary i { color: var(--brand-dark); }
.btn.btn-light-primary:hover:not(:disabled) { background-color: var(--brand) !important; color: #fff !important; }
.btn.btn-light-primary:hover:not(:disabled) i { color: #fff; }
/* Botões cheios: o ícone acompanha o texto. */
.btn.btn-primary i, .btn.btn-danger i { color: currentColor !important; }
.btn:focus-visible { outline: 3px solid var(--brand) !important; outline-offset: 2px !important; }
.btn[aria-disabled="true"] { pointer-events: none; opacity: .75; }
[hidden] { display: none !important; }
.min-w-0 { min-width: 0; }

/* Lista em card (padrão Duarte/Medical Support): cabeçalho, filtros, tabela sem margem. */
.card-list { overflow: hidden; }
.card-list .table { margin-bottom: 0; }
.card-list .table th:first-child, .card-list .table td:first-child { padding-left: 1.5rem; }
.card-list .table th:last-child, .card-list .table td:last-child { padding-right: 1.5rem; }
.table > :not(caption) > * > * { padding-block: 1rem; }
.empty-state { padding: 2rem; border: 1px dashed var(--field); border-radius: var(--radius); text-align: center; color: var(--muted); }

/* Modal de confirmação (<dialog>, layout/partials/_confirm-dialog). */
.confirm-dialog { width: min(100% - 2rem, 520px); padding: 0; border: 0; border-radius: var(--radius-card); box-shadow: 0 24px 64px rgba(33, 26, 25, .25); color: var(--ink); }
.confirm-dialog::backdrop { background: rgba(20, 12, 11, .5); }
.confirm-dialog-content { display: flex; flex-direction: column; }
.confirm-dialog-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.25rem 1.5rem; border-bottom: 1px solid var(--surface-line); }
.confirm-dialog-title { font-size: 1.2rem; font-weight: 800; }
.confirm-dialog .btn-icon { width: var(--touch); height: var(--touch); }
.confirm-dialog-text { padding: 1.5rem; font-size: 16px; }
.confirm-dialog-footer { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .75rem; padding: 1rem 1.5rem 1.5rem; }

/* ---------- Home (composição da Home do Medical Support) ---------- */

/* Telas largas: a Home para de esticar em 1440px e fica centralizada, como na referência. */
.home { max-width: 1440px; margin-inline: auto; }
.home-sections { display: flex; flex-direction: column; gap: 1.75rem; }
.home-header { align-items: flex-end; }
.home-date { display: inline-flex; align-items: center; gap: .5rem; font-weight: 700; color: var(--muted); }
.home-date i { font-size: 1.35rem; color: var(--brand); }

.home-banner {
    position: relative; overflow: hidden; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); align-items: center;
    min-height: 280px; max-height: 340px; border-radius: .75rem; color: #fff;
    background:
        radial-gradient(60% 90% at 78% 40%, rgba(255, 140, 140, .32) 0%, rgba(255, 140, 140, 0) 60%),
        linear-gradient(120deg, #7a0a18 0%, var(--brand) 45%, #c21d33 100%);
    box-shadow: 0 4px 14px rgba(33, 26, 25, .08);
}
.home-banner-text { position: relative; z-index: 1; padding: clamp(1.75rem, 3vw, 3rem); }
.home-banner-eyebrow { display: inline-flex; align-items: center; gap: .4rem; margin-bottom: .9rem; padding: .25rem .8rem; border: 1px solid rgba(255, 255, 255, .45); border-radius: 999px; background: rgba(255, 255, 255, .12); font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.home-banner-eyebrow i { color: #fff; font-size: 1.25rem; }
.home-banner-title { margin: 0 0 .5rem; color: #fff; font-size: clamp(24px, 16px + 1.4vw, 34px); font-weight: 800; letter-spacing: -.02em; }
.home-banner-lead { margin: 0 0 1.4rem; max-width: 30rem; color: rgba(255, 255, 255, .92); font-size: 16px; }
.home-banner-actions { display: flex; flex-wrap: wrap; gap: .75rem; }
.btn.btn-white { background: #fff; color: var(--brand-dark); border: 0; }
.btn.btn-white i { color: var(--brand-dark); }
.btn.btn-white:hover { background: var(--brand-soft) !important; color: var(--brand-deep) !important; }
.btn.btn-banner-outline { background: transparent; color: #fff; border: 2px solid rgba(255, 255, 255, .8) !important; }
.btn.btn-banner-outline i { color: #fff; }
.btn.btn-banner-outline:hover { background: rgba(255, 255, 255, .14) !important; color: #fff !important; }
.home-banner :focus-visible { outline-color: #fff !important; }
.home-banner-art { display: block; width: 100%; height: 100%; max-height: 300px; }
.art-ring { fill: none; stroke: rgba(255, 255, 255, .22); stroke-width: 1.5; }
.art-ring-dashed { stroke-dasharray: 5 7; stroke: rgba(255, 255, 255, .18); }
.art-card rect:first-child { fill: rgba(255, 255, 255, .16); stroke: rgba(255, 255, 255, .5); stroke-width: 1.5; }
.art-card-back rect:first-child { fill: rgba(255, 255, 255, .1); stroke: rgba(255, 255, 255, .32); }
.art-line { fill: rgba(255, 255, 255, .85); }
.art-line-soft { fill: rgba(255, 255, 255, .4); }
.art-grid { stroke: rgba(255, 255, 255, .25); stroke-width: 1; }
.art-chart { fill: none; stroke: #fff; stroke-width: 3.5; stroke-linecap: round; stroke-linejoin: round; }
.art-dot { fill: var(--brand); stroke: #fff; stroke-width: 3; }

/* Resumo: quatro cartões no padrão dos cards da referência, valor em grafite (nunca cor de julgamento). */
.summary-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1.25rem; }
.summary-card { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: .875rem; row-gap: .25rem; align-items: center; align-content: start; padding: 1.25rem 1.5rem; background: #fff; border: 1px solid var(--surface-line); border-radius: var(--radius-card); box-shadow: var(--shadow); }
.summary-icon { display: inline-grid; place-items: center; width: 40px; height: 40px; margin-bottom: .5rem; border-radius: var(--radius); background: var(--brand-soft); }
.summary-icon i { font-size: 1.5rem; color: var(--brand); }
.summary-label { margin-bottom: .5rem; font-size: .95rem; font-weight: 700; line-height: 1.3; color: var(--muted); }
.summary-value, .summary-note { grid-column: 1 / -1; }
.summary-value { font-size: 1.6rem; font-weight: 800; line-height: 1.2; color: var(--data); font-variant-numeric: tabular-nums; }
.summary-note { font-size: .95rem; color: var(--muted); overflow-wrap: anywhere; }

/* Cabeçalho das seções: ícone + título, com ou sem "Ver todos". */
.section-header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem; min-height: 44px; margin-bottom: .85rem; }
.section-header h2 { display: flex; align-items: center; gap: .5rem; margin: 0; font-size: 18px; font-weight: 800; }
.section-header h2 i { font-size: 1.5rem; color: var(--brand); }
.see-all { position: relative; isolation: isolate; display: inline-flex; align-items: center; gap: .35rem; min-height: var(--touch); padding: 0 1rem; font-weight: 700; color: var(--brand-dark); white-space: nowrap; border-radius: var(--radius); text-decoration: none; }
.see-all::before { content: ""; position: absolute; inset: 6px 0; z-index: -1; border: 1px solid var(--brand); border-radius: inherit; background: #fff; transition: background-color .16s ease; }
.see-all:hover::before { background: var(--brand-soft); }

.indicator-foot { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; padding-top: .75rem; border-top: 1px solid var(--surface-line); }
.indicator-foot > i { font-size: 1.35rem; }
.indicator-more { margin-left: auto; display: inline-flex; align-items: center; gap: .2rem; font-weight: 700; color: var(--brand-dark); }
.indicator-more i { color: var(--brand-dark); }

/* Faixa inferior: duas colunas 56/44 no desktop largo, como a faixa inferior da referência. */
.home-pair { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.5rem; }
.home-panel { min-width: 0; padding: 1.25rem; background: #fff; border: 1px solid var(--surface-line); border-radius: .75rem; }
@media (min-width: 1200px) { .home-pair[data-home-pair="2"] { grid-template-columns: minmax(0, 56fr) minmax(0, 44fr); align-items: start; } }
.timeline-item { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem 1rem; padding: 1rem 0; border-bottom: 1px solid var(--surface-line); }
.timeline-item:last-child { border-bottom: 0; padding-bottom: 0; }
.timeline-item:first-child { padding-top: 0; }

.quick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: .75rem; }
.quick-card { display: flex; align-items: center; gap: .75rem; height: 100%; min-height: 56px; padding: .75rem .9rem; color: var(--ink); background: #fff; border: 1px solid var(--surface-line); border-radius: var(--radius); text-decoration: none; transition: border-color .15s ease, background-color .15s ease; }
.quick-card:hover { border-color: var(--brand); background: var(--brand-tint); color: var(--ink); }
.quick-icon { display: inline-grid; place-items: center; flex: 0 0 auto; width: 40px; height: 40px; border-radius: var(--radius); background: var(--brand-soft); }
.quick-icon i { font-size: 1.5rem; color: var(--brand); }
.quick-text { flex: 1 1 auto; min-width: 0; }
.quick-name { display: block; font-size: 16px; line-height: 1.3; }
.quick-desc { display: block; font-size: 1rem; color: var(--muted); }
.quick-arrow { flex: 0 0 auto; font-size: 1.25rem; color: var(--muted); }

/* Banner com a altura da referência: 320px nas telas largas; a ilustração encolhe antes do texto. */
@media (min-width: 1600px) { .home-banner { min-height: 320px; } }
@media (max-width: 1399.98px) {
    .summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .home-banner { grid-template-columns: minmax(0, 1fr) minmax(180px, .55fr); }
}
@media (max-width: 767.98px) {
    .home-banner { grid-template-columns: minmax(0, 1fr); max-height: none; min-height: 0; }
    .home-banner-art { position: absolute; right: -90px; bottom: -40px; width: 300px; height: auto; opacity: .35; }
    .home-sections { gap: 1.5rem; }
    .home-panel { padding: 1.25rem; }
}
@media (max-width: 575.98px) {
    .summary-grid { gap: .75rem; }
    .summary-card { padding: .9rem 1rem; column-gap: .6rem; }
    .summary-value { font-size: 1.3rem; }
    .home-banner-eyebrow { letter-spacing: .04em; }
    .home-banner-actions .btn { flex: 1 1 100%; }
    .timeline-item .btn { flex: 1 1 100%; }
}

/* Conferência agrupada pelo exame do laudo (parser, 2026-10-31) */
.result-group { margin: 1rem 0 0; font-size: 1.125rem; font-weight: 800; color: var(--ink, #1f1f1f); }
.result-state { display: inline-block; padding: .25rem .75rem; border: 1px solid var(--line); border-radius: 999px; font-weight: 700; font-size: .9375rem; }
.result-history { padding: 1rem 1.25rem; border: 1px solid var(--line); border-radius: 1rem; }
.result-history > summary { cursor: pointer; font-weight: 800; font-size: 1.0625rem; min-height: var(--touch, 44px); display: flex; align-items: center; }

/* ---------- Responsividade e acessibilidade (Goal 10.6–10.7) ---------- */

/* Tabela do paciente vira lista de cartões no celular: cada célula traz o nome da coluna em data-label.
   Sem rolagem lateral, que esconde colunas de quem tem a tela pequena ou usa zoom. */
@media (max-width: 575.98px) {
    .table-stack thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
    .table-stack, .table-stack tbody, .table-stack tr, .table-stack th, .table-stack td { display: block; width: 100%; }
    .table-stack tr { padding: .9rem 0; border-bottom: 1px dashed var(--line); }
    .table-stack tbody tr:last-child { border-bottom: 0; }
    .table-stack > :not(caption) > * > * { padding: .2rem 0 !important; border: 0 !important; text-align: left !important; }
    .table-stack td[data-label] { display: grid; grid-template-columns: minmax(0, 42%) minmax(0, 1fr); gap: .75rem; align-items: baseline; }
    .table-stack [data-label]::before { content: attr(data-label); font-size: .95rem; font-weight: 400; color: var(--muted); }
    .table-stack th[scope="row"] { font-size: 1.1rem; padding-bottom: .4rem !important; }
    .card-list .table-stack th:first-child, .card-list .table-stack td:first-child,
    .card-list .table-stack th:last-child, .card-list .table-stack td:last-child { padding-inline: 0 !important; }
}

/* Modo de alto contraste do Windows: o foco e as bordas usam as cores do sistema. */
@media (forced-colors: active) {
    :focus-visible, .btn:focus-visible { outline-color: Highlight !important; }
    .card, .summary-card, .home-panel, .quick-card { border: 1px solid CanvasText; }
    .chart-line, .chart-point { stroke: CanvasText; }
}
