@font-face { font-family:Inter; src:url('../fonts/InterVariable.woff2') format('woff2'); font-weight:100 900; font-style:normal; font-display:swap; }
/* Páginas que usam a estrutura compartilhada painel_base.html. */
:root { --ink:#2c253a; --muted:#696273; --purple:#7940d8; --purple-dark:#622bb8; --lavender:#ede7f3; --paper:#f8f7fa; --card:#fff; --line:#e5dfea; }
* { box-sizing:border-box; }
body { margin:0; min-width:320px; background:#e4deeb; color:var(--ink); font:0.875rem/1.55 Inter,'Segoe UI',sans-serif; -webkit-font-smoothing:antialiased; }
a { color:inherit; text-decoration:none; }
button,input,select { font:inherit; }
a,button { transition:background-color .18s,border-color .18s,color .18s,box-shadow .18s,transform .18s; }
button,a,input { -webkit-tap-highlight-color:transparent; }
:focus-visible { outline:3px solid #a27bdd; outline-offset:3px; }
[hidden] { display:none !important; }
.sr-only { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0; }
.icon-library { position:absolute; width:0; height:0; overflow:hidden; }
.icon { width:21px; height:21px; fill:none; stroke:currentColor; stroke-width:1.5; stroke-linecap:round; stroke-linejoin:round; flex-shrink:0; }
.avatar { flex-shrink:0; width:36px; height:36px; border-radius:50%; display:grid; place-items:center; color:#fff; background:var(--purple); font-size:0.875rem; font-weight:600; box-shadow:inset 0 -8px 0 #ffffff1a; }
.avatar-small { width:30px; height:30px; font-size:0.75rem; }
.sidebar .icon { width:20px; height:20px; stroke-width:1.6; }
.app-shell { --sidebar-width:240px; display:grid; grid-template-columns:var(--sidebar-width) minmax(0,1fr); min-height:100vh; background:var(--lavender); }
.app-shell.sidebar-ready { transition:grid-template-columns .28s cubic-bezier(.2,.7,.2,1); }
.sidebar { --ink:#f4eefb; --lavender:#43266b; --purple:#ddbdff; color:var(--ink); position:sticky; top:0; height:100vh; height:100dvh; min-width:0; display:flex; flex-direction:column; padding:30px 16px 20px; border-right:1px solid #624182; background:var(--lavender); box-shadow:4px 0 16px #43216b18; z-index:2; }
.brand { align-self:flex-start; display:flex; align-items:center; width:160px; height:48px; margin-left:8px; padding:0; color:#fbf8ff; line-height:1; }
.brand-full { display:block; width:160px; height:48px; object-fit:contain; object-position:left center; }
.brand strong { font-weight:720; }
.brand b { color:var(--purple); }
.brand-short { display:none; width:40px; height:40px; object-fit:contain; }
.workspace-label { margin:2px 0 35px 14px; color:#d5c0eb; font-size:0.5625rem; font-weight:600; letter-spacing:1.7px; white-space:nowrap; }
.sidebar-toggle { position:absolute; top:33px; right:-14px; width:28px; height:28px; padding:2px; display:grid; place-items:center; border:1px solid #9270b7; border-radius:8px; background:#583381; color:#eee1fc; box-shadow:0 2px 5px #1b102331; cursor:pointer; }
.sidebar-toggle:hover { border-color:#d3b0f4; color:var(--purple); }
.sidebar-toggle .icon { width:22px; height:22px; stroke-width:1.8; transform:none; transition:transform .25s; }
.main-nav { flex:1; min-height:0; overflow-y:auto; overflow-x:hidden; scrollbar-width:thin; }
.nav-label { margin:0 0 10px; padding-left:14px; color:#d0bae9; font-size:0.625rem; font-weight:650; letter-spacing:1.45px; }
.nav-link { position:relative; display:flex; align-items:center; gap:12px; width:100%; padding:12px 14px; margin-top:5px; border:0; border-radius:8px; background:transparent; color:#eee5fa; font-size:0.875rem; font-weight:550; text-align:left; cursor:pointer; }
.nav-link > .icon { width:19px; height:19px; }
.nav-text { flex:1; white-space:nowrap; }
.nav-link .nav-arrow { width:12px; height:12px; margin-left:auto; color:#d0b6e8; transition:transform .24s cubic-bezier(.2,.7,.2,1); }
.nav-group.is-open > .nav-link .nav-arrow { transform:rotate(90deg); }
.nav-link:hover { background:#563582; color:#fff; }
.nav-link.active:hover { background:#f3eafb; color:#4c277d; }
.nav-link.active { background:#eadcfa; color:#4c277d; font-weight:600; box-shadow:inset 0 0 0 1px #f5ecff,0 2px 6px #160e2026; }
.nav-link.active::before { content:''; position:absolute; left:0; top:14px; bottom:14px; width:3px; border-radius:0 3px 3px 0; background:#8b51c7; }
.nav-link[aria-expanded="true"] .nav-arrow,.sidebar-collapsed .nav-link.active .nav-arrow { color:inherit; }
.nav-submenu { display:grid; grid-template-rows:1fr; opacity:1; visibility:visible; }
.submenu-inner { min-height:0; overflow:hidden; }
.sidebar-ready .nav-submenu { transition:grid-template-rows .26s cubic-bezier(.2,.7,.2,1),opacity .2s,visibility .26s; }
.sidebar-ready .nav-group:not(.is-open) .nav-submenu,.sidebar-collapsed .nav-submenu { grid-template-rows:0fr; opacity:0; visibility:hidden; }
.submenu { display:grid; gap:1px; padding:6px 0 12px 45px; }
.submenu a { display:flex; align-items:center; gap:8px; padding:8px 0; color:#dcc8ee; font-size:0.8125rem; white-space:nowrap; transform:translateY(0); transition:color .18s,transform .26s; }
.submenu a::before { content:''; width:4px; height:4px; flex-shrink:0; border-radius:50%; background:transparent; }
.submenu a:hover,.submenu .selected { color:#fbf6ff; background:#65438d; border-radius:6px; }
.submenu .selected { font-weight:600; }
.submenu .selected::before { background:#e4c5ff; }
.sidebar-ready .nav-group:not(.is-open) .submenu a { transform:translateY(-5px); }
.nav-account-section { margin-top:25px; padding-top:22px; border-top:1px solid #6c4d8c; }
.nav-placeholder:disabled { cursor:default; color:#ccb7e2; }
.nav-placeholder:disabled:hover { background:transparent; }
.sidebar-account { display:flex; align-items:center; gap:9px; padding-top:18px; margin-top:20px; border-top:1px solid #6c4d8c; }
.sidebar .avatar { display:grid; place-items:center; width:36px; height:36px; flex-shrink:0; box-shadow:none; border:3px solid #b592d5; border-radius:50%; color:#f9f2ff; background:#79559e; font-size:0.8125rem; font-weight:650; }
.sidebar .avatar-small { width:33px; height:33px; border-width:2px; font-size:0.6875rem; }
.account-text { display:grid; flex:1; min-width:0; }
.account-text strong { color:#f1e9fa; font-size:0.6875rem; font-weight:600; overflow-wrap:anywhere; }
.account-text > span { color:#d8c4e9; font-size:0.625rem; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.logout { padding:5px; border:0; background:none; color:#e2caf5; font-size:1.3125rem; cursor:pointer; }
.logout:hover { color:var(--purple); }
.sidebar-collapsed { --sidebar-width:76px; }
.sidebar-collapsed .sidebar { padding-left:12px; padding-right:12px; }
.sidebar-collapsed .brand { width:40px; height:48px; margin-left:6px; padding:0; margin-bottom:45px; }
.sidebar-collapsed .brand-full,.sidebar-collapsed .workspace-label,.sidebar-collapsed .nav-label,.sidebar-collapsed .nav-text,.sidebar-collapsed .nav-arrow,.sidebar-collapsed .account-text { display:none; }
.sidebar-collapsed .brand-short { display:block; }
.sidebar-collapsed .sidebar-toggle .icon { transform:scaleX(-1); }
.sidebar-collapsed .nav-link { justify-content:center; gap:0; padding:14px; }
.sidebar-collapsed .sidebar-account { flex-direction:column; gap:10px; }
.sidebar-collapsed .nav-account-section { margin-top:20px; padding-top:14px; }
.workspace { min-width:0; padding:0 30px; }
.topbar { min-height:92px; display:flex; align-items:center; justify-content:space-between; gap:24px; }
.topbar > p { font-size:1.3125rem; font-weight:450; letter-spacing:-.6px; margin:0; }
.topbar-account { display:flex; align-items:center; gap:10px; font-size:0.75rem; }
.topbar-account > strong { max-width:180px; }
.clinic { display:grid; gap:2px; border-left:1px solid #cebedc; padding:4px 0 4px 18px; margin-left:8px; max-width:220px; }
.clinic > span { font-size:0.5625rem; letter-spacing:1px; color:#776585; }
.clinic strong { font-size:0.75rem; font-weight:550; overflow-wrap:anywhere; }
.breadcrumbs { display:flex; flex-wrap:wrap; gap:10px; align-items:center; min-height:36px; padding:0 0 12px; margin:0 2px 22px; border-bottom:1px solid #d9cde5; color:#7b688c; font-size:0.75rem; line-height:1.7; }
.breadcrumbs a { display:inline-flex; align-items:center; gap:7px; border-radius:3px; }
.breadcrumbs a:hover { color:#6939a4; text-decoration:underline; text-underline-offset:4px; }
.breadcrumbs .icon { width:15px; height:15px; color:#8b6ca8; }
.breadcrumbs > span[aria-hidden='true'] { display:inline-flex; align-items:center; justify-content:center; width:12px; font-size:0; flex-shrink:0; }
.breadcrumbs > span[aria-hidden='true']::after { content:''; width:5px; height:5px; border-top:1px solid #a58fb8; border-right:1px solid #a58fb8; transform:rotate(45deg); }
.breadcrumbs [aria-current='page'] { position:relative; color:#43266b; font-weight:600; overflow-wrap:anywhere; }
.breadcrumbs [aria-current='page']::after { content:''; position:absolute; left:0; bottom:-13px; width:100%; height:2px; border-radius:2px; background:#9564c7; transform-origin:left center; animation:breadcrumb-underline .45s cubic-bezier(.22,.7,.3,1) both; }
@keyframes breadcrumb-underline { from { transform:scaleX(0); } to { transform:scaleX(1); } }
.content-panel { background:var(--paper); padding:30px; border:1px solid #ffffff80; border-radius:12px; min-height:calc(100vh - 174px); animation:panel-appear .32s ease-out both; }
.page-heading { display:flex; align-items:center; justify-content:space-between; gap:25px; margin-bottom:28px; }
h1,h2,h3,p { margin-top:0; }
h1 { font-size:1.75rem; line-height:1.3; font-weight:600; letter-spacing:-.8px; margin:0 0 9px; overflow-wrap:anywhere; }
h2 { font-size:1rem; font-weight:650; margin:0; letter-spacing:-.2px; }
h3 { font-size:1rem; font-weight:600; line-height:1.4; margin:0 0 5px; letter-spacing:-.15px; overflow-wrap:anywhere; }
.muted { color:var(--muted); font-size:0.875rem; margin-bottom:0; }
.button { display:inline-flex; align-items:center; justify-content:center; gap:9px; flex-shrink:0; min-height:42px; padding:10px 16px; border:1px solid transparent; border-radius:7px; font-size:0.8125rem; line-height:1.4; font-weight:600; cursor:pointer; }
.primary { background:var(--purple); color:#fff; box-shadow:0 2px 5px #6430a815; }
.primary:hover { background:var(--purple-dark); }
.secondary { color:#7138bf; background:#fff; border-color:#dbcee9; }
.secondary:hover { background:#f5effb; border-color:#b99bdc; }
.danger { color:#a13c4c; background:#fff; border-color:#e8cbd2; }
.danger:hover { color:#892d3d; background:#fcf0f2; border-color:#dcaab6; }
.button:hover { transform:translateY(-1px); box-shadow:0 3px 8px #4521540c; }
.button:active { transform:translateY(0); }
.back-link { display:inline-flex; align-items:center; gap:10px; max-width:100%; min-height:43px; padding:9px 14px; margin:0 0 24px; border:1px solid #d9c7eb; border-radius:7px; background:#fff; color:#69419b; font-size:0.8125rem; font-weight:600; line-height:1.5; text-align:left; overflow-wrap:anywhere; }
.back-link-arrow { display:inline-block; flex-shrink:0; font-size:1.1875rem; font-weight:400; line-height:1; transition:transform .18s ease-out; }
.back-link:hover { color:#532c81; background:#f3edf9; border-color:#b291d3; box-shadow:0 3px 8px #43216b0a; }
.back-link:hover .back-link-arrow,.back-link:focus-visible .back-link-arrow { transform:translateX(-3px); }
.back-link:active .back-link-arrow { transform:translateX(-4px); }
.text-link:hover { color:var(--purple-dark); text-decoration:underline; }
.text-link { color:#753ebd; font-weight:550; font-size:0.8125rem; }
.section-heading { display:flex; align-items:center; justify-content:space-between; gap:20px; margin:24px 0 15px; }
.counter { color:#74687d; font-size:0.75rem; }
.workspace-footer { color:#74647f; font-size:0.6875rem; padding:15px 2px; }
.person-heading { display:flex; align-items:center; gap:13px; min-width:0; }
.patient-avatar,.doctor-avatar { display:grid; place-items:center; width:40px; height:40px; flex-shrink:0; border-radius:11px; background:#f0e9f8; color:#8055a9; font-size:1rem; font-weight:600; }
.doctor-avatar { background:#f0eaf6; }
.directory-toolbar { display:grid; grid-template-columns:minmax(160px,1fr) minmax(135px,170px) minmax(120px,150px) max-content; gap:14px; align-items:end; padding:19px 20px; margin:0; border:1px solid var(--line); border-radius:9px; background:#fff; }
.directory-search { display:grid; gap:7px; flex:1; min-width:0; }
.directory-sort,.directory-sex { display:grid; gap:7px; min-width:0; }
.directory-toolbar > .button { height:43px; white-space:nowrap; }
label { color:#4e425b; }
.directory-toolbar label,.directory-search label { font-size:0.75rem; font-weight:600; }
input[type='search'],input[type='date'],select { height:43px; border:1px solid #d9cee3; border-radius:6px; background:#fff; color:var(--ink); width:100%; min-width:0; padding:0 12px; font-size:0.8125rem; }
input::placeholder { color:#817389; }
input[type='search'],input[type='date'],select { transition:border-color .18s,box-shadow .18s; }
input[type='search']:hover,input[type='date']:hover,select:hover { border-color:#b89acc; }
.table-container { background:#fff; border:1px solid var(--line); border-radius:9px; padding-bottom:6px; }
.patient-table { border-collapse:collapse; width:100%; table-layout:fixed; text-align:left; }
.patient-table th { font-size:0.6875rem; color:#75677e; text-transform:uppercase; letter-spacing:.7px; font-weight:600; padding:14px 15px; border-bottom:1px solid var(--line); background:#f5f1f8; }
.patient-table th:first-child { border-radius:9px 0 0 0; width:28%; }
.patient-table th:nth-child(2) { width:16%; }
.patient-table th:nth-child(3) { width:14%; }
.patient-table th:nth-child(4) { width:23%; }
.patient-table th:last-child { border-radius:0 9px 0 0; width:19%; }
.patient-table td { padding:20px 15px; border-bottom:1px solid #eee9f2; font-size:0.8125rem; overflow-wrap:anywhere; vertical-align:middle; }
.patient-table tr:last-child td { border-bottom:0; }
.patient-table tbody tr:hover { background:#fcfafe; }
.table-person { display:flex; align-items:center; gap:11px; }
.table-person strong { display:block; font-size:0.875rem; font-weight:600; line-height:1.45; }
.table-person small { display:block; color:#7d6f86; font-size:0.6875rem; margin-top:4px; }
.table-person:hover strong { color:var(--purple); text-decoration:underline; }
.contact-cell span { display:block; color:#6f6279; font-size:0.75rem; line-height:1.8; }
.row-actions { display:flex; flex-wrap:wrap; align-items:center; justify-content:flex-end; gap:7px; }
.row-actions .button { font-size:0.75rem; padding:8px 11px; min-height:37px; }
.danger-link,.laudo [data-excluir-arquivo] { color:#a83f4b; }
.doctor-list { display:grid; gap:15px; }
.doctor-card { position:relative; background:#fff; border:1px solid var(--line); border-radius:9px; padding:23px; }
.doctor-card-heading { display:flex; align-items:center; justify-content:space-between; gap:20px; }
.doctor-card .muted { font-size:0.8125rem; }
.badge { display:inline-flex; align-items:center; gap:7px; flex-shrink:0; background:#f0e7fa; color:#70439b; border-radius:20px; font-size:0.75rem; padding:6px 11px; }
.badge > span { font-size:0.375rem; }
.badge.restricted { background:#fbf0dd; color:#8b6129; }
.card-actions { display:flex; align-items:center; gap:16px; margin-top:21px; }
.card-actions > .danger { margin-left:auto; }
.notice { display:flex; align-items:center; gap:13px; border:1px solid #e2d8ed; border-radius:7px; padding:14px 18px; background:#f0eaf7; color:#6c4c8a; margin-bottom:23px; font-size:0.875rem; }
.notice.success { background:#edf6ef; border-color:#dcecdf; color:#356845; }
.notice.error { background:#fbeded; border-color:#eed6d6; color:#9f3640; }
.notice.warning { background:#fbf2df; border-color:#f0e2c5; color:#806020; }
.notice-icon { font-size:1.25rem; }
.heading-symbol { display:grid; place-items:center; width:52px; height:52px; color:#936ab7; background:#eee6f5; border-radius:13px; }
.heading-symbol .icon { width:27px; height:27px; }
.restriction-card { background:#fff; border:1px solid var(--line); border-radius:8px; padding:20px; }
.restriction-card label,.choice-row label { display:flex; align-items:center; gap:12px; cursor:pointer; }
input[type='checkbox'],input[type='radio'] { width:18px; height:18px; accent-color:var(--purple); flex-shrink:0; cursor:pointer; margin:0; }
.access-options { border:0; padding:0; margin:0 0 20px; min-width:0; }
.access-options legend { font-size:0.9375rem; font-weight:600; margin-bottom:13px; }
.access-option-grid { display:grid; grid-template-columns:1fr 1fr; gap:15px; }
.access-option { display:flex; align-items:flex-start; gap:13px; padding:21px; border:1px solid #ded4e7; background:#fff; border-radius:9px; cursor:pointer; }
.access-option input { margin-top:3px; }
.access-option strong { display:block; font-size:0.875rem; color:#403149; }
.access-option small { display:block; font-size:0.8125rem; color:var(--muted); margin-top:5px; }
.access-option:has(input:checked) { border-color:#a57bce; background:#f3ecfb; box-shadow:0 0 0 1px #c8ade4; }
.access-summary { background:#fff; color:#5c4d69; padding:21px; border:1px solid var(--line); border-radius:8px; font-size:0.875rem; }
.patient-choices { border:0; padding:0; margin:27px 0 0; min-width:0; }
.patient-choices legend { font-size:0.9375rem; font-weight:600; margin-bottom:7px; }
.patient-choices > .muted { font-size:0.8125rem; margin-bottom:18px; max-width:850px; }
.selection-toolbar { display:flex; gap:20px; align-items:flex-end; }
.selection-count { color:#6f458f; background:#eee5f8; border-radius:6px; padding:11px 13px; font-size:0.75rem; white-space:nowrap; }
.selection-actions { display:flex; gap:18px; padding:13px 0 4px; }
.text-button { border:0; padding:4px 0; background:none; color:#743bb9; font-size:0.75rem; font-weight:600; cursor:pointer; }
.text-button:hover { text-decoration:underline; }
.choice-row { margin:10px 0; border:1px solid var(--line); background:#fff; border-radius:7px; }
.choice-row label { padding:17px 19px; font-size:0.875rem; }
.choice-row:has(input:checked) { background:#f6f0fc; border-color:#c6abde; }
.form-footer { display:flex; align-items:center; justify-content:flex-end; gap:24px; border-top:1px solid #ded1e9; margin-top:28px; padding-top:23px; }
.errorlist { color:#a14242; font-size:0.8125rem; }
.empty-state,.search-empty { text-align:center; padding:42px 20px; border:1px dashed #d9cce3; border-radius:9px; color:#776782; font-size:0.875rem; }
.empty-state .icon { width:35px; height:35px; color:#9674b6; }
.empty-state h3 { margin-top:13px; color:#594366; }
.search-empty { border:0; }
.patient-subtitle { display:flex; flex-wrap:wrap; gap:8px 22px; font-size:0.8125rem; color:#6f6179; margin-bottom:0; }
.filter-form { display:flex; align-items:flex-end; gap:13px; margin:0 0 21px; background:#fff; border:1px solid var(--line); border-radius:9px; padding:18px; }
.filter-form > div { display:grid; gap:7px; }
.filter-form .search-field { flex:1; }
.filter-form label { font-size:0.75rem; font-weight:600; }
.filter-form input { height:42px; }
.filter-form > .text-link { align-self:center; margin-top:23px; white-space:nowrap; font-size:0.75rem; }
.painel-paciente [data-feedback-status]:empty { display:none; }
.painel-paciente [data-feedback-status]:not(:empty) { background:#f8eddb; color:#7e5e2e; border-radius:7px; padding:14px; }
.laudo { display:flex; flex-wrap:wrap; gap:0 12px; margin:14px 0; padding:22px; border:1px solid var(--line); border-radius:9px; background:#fff; }
.report-heading { display:flex; justify-content:space-between; gap:18px; width:100%; align-items:flex-start; }
.report-identity { display:flex; align-items:flex-start; gap:13px; min-width:0; }
.file-icon { display:grid; place-items:center; width:39px; height:45px; border:1px solid #e4d8f0; border-radius:7px; background:#f7f2fb; color:#8955b8; font-size:1.5rem; flex-shrink:0; }
.file-icon .icon { width:24px; height:24px; stroke-width:1.55; }
.report-identity h3 { font-size:1rem; margin:0 0 5px; line-height:1.5; }
.original-filename { color:#75677e; font-size:0.75rem; margin:0; overflow-wrap:anywhere; word-break:break-word; }
.report-state { display:flex; align-items:center; gap:9px; flex-shrink:0; }
.file-type { font-size:0.625rem; font-weight:650; letter-spacing:.4px; color:#80728b; }
.report-status { display:inline-flex; align-items:center; gap:6px; border-radius:20px; padding:5px 10px; color:#8d6128; background:#fbf0dd; font-size:0.6875rem; white-space:nowrap; }
.report-status:before { content:''; width:5px; height:5px; background:currentColor; border-radius:50%; }
.report-status[data-state='ready'],.laudo[data-pronto='true'][data-status='concluido'] .report-status { color:#38724c; background:#eaf5ed; }
.report-status[data-state='processing'] { color:#7650a1; background:#f0e9fa; }
.laudo > .upload-meta { flex-basis:100%; color:#776a80; font-size:0.75rem; margin:16px 0; padding-bottom:14px; border-bottom:1px solid #eee8f2; }
.laudo > [data-feedback-documento] { flex-basis:100%; color:#75617f; font-size:0.8125rem; background:#faf5ec; border-radius:6px; padding:12px 15px; margin-bottom:16px; }
.laudo [data-feedback-documento] p { margin-bottom:7px; }
.laudo [data-feedback-documento] p:last-child { margin-bottom:0; }
.laudo > p { margin:0; }
.laudo [data-pdf-pronto] { order:2; }
.laudo [data-documento-original] { order:3; }
.laudo [data-pdf-pronto] a,.laudo [data-documento-original] a,.laudo button { display:inline-flex; align-items:center; justify-content:center; padding:10px 15px; border-radius:6px; border:1px solid #dbcee8; font-size:0.8125rem; font-weight:550; color:#7138b7; background:#fff; cursor:pointer; }
.laudo [data-pdf-pronto] a { background:var(--purple); color:#fff; border-color:var(--purple); }
.laudo [data-pdf-pronto] a:hover { background:var(--purple-dark); }
.laudo [data-documento-original] a:hover,.laudo button:hover { background:#f4edf9; }
.laudo > p:has([data-excluir-arquivo]) { order:5; flex-basis:100%; margin-top:13px; font-size:0.75rem; }
.laudo [data-excluir-arquivo]:hover { text-decoration:underline; }
.laudo [data-tentar-novamente],.laudo [data-correcao] { order:4; flex-basis:100%; margin-top:12px; }
.laudo [data-correcao] input { padding:10px; border:1px solid #d8c9e4; border-radius:5px; }
[data-grupo-documentos] > summary { cursor:pointer; padding:15px; background:#f0eaf5; border:1px solid #e2d6ed; border-radius:7px; font-size:0.875rem; }
details[data-grupo-documentos] { margin:12px 0; }
[data-paginacao] { display:flex; gap:18px; justify-content:center; padding:15px; font-size:0.8125rem; color:#7345ae; }
[data-sem-laudos] { border:1px dashed #d9cfe0; border-radius:8px; padding:36px 20px; color:#75617f; text-align:center; font-size:0.875rem; }
@media (max-width:1190px) {
    .workspace { padding:0 22px; }
    .content-panel { padding:25px 22px; }
    .patient-table th,.patient-table td { padding-left:10px; padding-right:10px; }
    .patient-table th:first-child { width:26%; }
    .patient-table th:nth-child(4) { width:22%; }
    .patient-table th:last-child { width:22%; }
    .table-person { gap:8px; }
    .table-person .patient-avatar { width:30px; height:34px; font-size:0.8125rem; }
    .report-heading { flex-direction:column; gap:13px; }
    .report-state { align-self:flex-end; }
}
@media (min-width:1500px) { .workspace { padding:0 40px; } .content-panel { padding:35px; } }

.doctor-card,.laudo { animation:item-appear .28s ease-out both; }
.doctor-card:nth-child(2),.laudo:nth-child(2) { animation-delay:35ms; }
.doctor-card:nth-child(3),.laudo:nth-child(3) { animation-delay:70ms; }
@keyframes panel-appear {
    from { opacity:0; transform:translateY(7px); }
    to { opacity:1; transform:translateY(0); }
}
@keyframes item-appear {
    from { opacity:0; transform:translateY(4px); }
    to { opacity:1; transform:translateY(0); }
}
@media (prefers-reduced-motion:reduce) { *,*::before,*::after { transition:none !important; animation:none !important; scroll-behavior:auto !important; } }


/* Tipografia preservada da revisão com Inter. */
.context-label { font-size:0.6875rem; }
.workspace-context > strong { font-size:0.8125rem; font-weight:600; }
.topbar-person strong { font-size:0.75rem; font-weight:600; }
.topbar-person span { font-size:0.625rem; }
.breadcrumbs { font-size:0.75rem; }
.workspace-footer { font-size:0.625rem; }
h1 { font-size:1.75rem; line-height:1.25; font-weight:650; letter-spacing:-.95px; }
h2 { font-size:1rem; font-weight:650; letter-spacing:-.25px; }
h3 { font-size:0.9375rem; font-weight:600; line-height:1.45; letter-spacing:-.2px; }
.muted { font-size:0.8125rem; line-height:1.6; }
.button { font-size:0.8125rem; font-weight:600; line-height:1.4; }
.danger { font-size:0.6875rem; font-weight:500; }
.text-link,.text-button { font-size:0.75rem; font-weight:550; }
.back-link { font-size:0.8125rem; }
.counter { font-size:0.6875rem; }
.count-pill { font-size:0.625rem; font-variant-numeric:tabular-nums; }
.directory-toolbar label,.directory-search label,.filter-form label { font-size:0.75rem; font-weight:550; }
input[type='search'],input[type='date'],select { font-size:0.75rem; }
.patient-table th { font-size:0.75rem; font-weight:500; }
.patient-table td { font-size:0.875rem; }
.table-person strong { font-size:0.875rem; font-weight:600; line-height:1.4; letter-spacing:-.2px; }
.table-person small { font-size:0.75rem; }
.patient-avatar,.doctor-avatar { font-size:0.875rem; font-weight:550; }
.numeric { font-variant-numeric:tabular-nums; letter-spacing:-.15px; }
.contact-cell span { font-size:0.75rem; line-height:1.85; }
.missing-value,.contact-cell .missing-value:first-child { font-size:0.75rem; }
.row-actions .button { font-size:0.75rem; }
.doctor-table-header { font-size:0.75rem; }
.doctor-card h3 { font-size:0.9375rem; }
.doctor-card .muted { font-size:0.75rem; }
.badge { font-size:0.6875rem; }
.badge > span { font-size:0.3125rem; }
.access-link { font-size:0.75rem; }
.patient-profile-avatar { font-size:1.4375rem; font-weight:450; }
.patient-subtitle { font-size:0.75rem; }
.filter-form > .text-link { font-size:0.6875rem; }
.report-day-heading { font-size:0.75rem; font-weight:500; }
.report-identity h3 { font-size:0.9375rem; }
.original-filename { font-size:0.75rem; }
.file-type { font-size:0.5625rem; font-weight:550; }
.report-status { font-size:0.6875rem; }
.upload-meta { font-size:0.75rem; font-variant-numeric:tabular-nums; }
.report-open { font-size:0.75rem; }
.laudo [data-feedback-documento] { font-size:0.75rem; }
[data-grupo-documentos] > summary { font-size:0.75rem; }
[data-paginacao] { font-size:0.75rem; }
[data-sem-laudos] { font-size:0.75rem; }
.painel-paciente [data-feedback-status]:not(:empty) { font-size:0.75rem; }
.access-options legend { font-size:0.875rem; font-weight:600; }
.access-option strong { font-size:0.875rem; font-weight:600; }
.access-option small { font-size:0.8125rem; line-height:1.65; }
.access-summary { font-size:0.8125rem; }
.patient-choices legend { font-size:0.875rem; font-weight:600; }
.patient-choices > .muted { font-size:0.8125rem; }
.selection-count { font-size:0.6875rem; }
.choice-row label { font-size:0.875rem; }
.notice { font-size:0.75rem; }
.notice-icon { font-size:1.125rem; }
.errorlist { font-size:0.75rem; }
.empty-state,.search-empty { font-size:0.75rem; }
.empty-state h3,.search-empty h3 { font-size:0.9375rem; }
.sidebar :focus-visible { outline-color:#e5caff; outline-offset:2px; }

/* Confirmações de exclusão de médicos e pacientes. */
.content-panel.deletion-panel { width:100%; max-width:820px; margin:9px auto 36px; padding:0; min-height:0; border:0; border-radius:0; background:transparent; }
.deletion-panel > .back-link { margin-bottom:20px; font-size:0.8125rem; }
.deletion-card { border:1px solid #e1d7e9; border-radius:13px; background:#fff; box-shadow:0 4px 18px #42244e06; overflow:hidden; }
.deletion-header { display:flex; align-items:center; gap:16px; padding:27px 28px 25px; border-bottom:1px solid #eee7f3; background:#fcfafd; }
.deletion-header > div { min-width:0; }
.deletion-header h1 { margin-bottom:7px; font-size:1.5625rem; letter-spacing:-.7px; }
.deletion-header .muted { font-size:0.75rem; }
.deletion-symbol { display:grid; place-items:center; width:48px; height:48px; flex-shrink:0; border:1px solid #efdce2; border-radius:12px; background:#fcf1f4; color:#ad5268; }
.deletion-symbol .icon { width:23px; height:23px; stroke-width:1.6; }
.deletion-body { padding:25px 28px 26px; }
.deletion-body .notice { margin-bottom:20px; }
.deletion-target { display:flex; align-items:center; gap:13px; margin-bottom:22px; padding:17px 18px; border:1px solid #e8e0f0; border-radius:9px; background:#faf8fd; }
.deletion-target .patient-avatar,.deletion-target .doctor-avatar { width:43px; height:43px; border:1px solid #e9def4; border-radius:10px; background:#efe6f9; color:#9063b5; font-size:1.0625rem; }
.deletion-target > div { min-width:0; }
.deletion-target-label { display:block; margin-bottom:4px; color:#897494; font-size:0.625rem; }
.deletion-target h2 { margin:0; color:#4b3b59; font-size:1rem; line-height:1.5; font-weight:600; overflow-wrap:anywhere; }
.deletion-target p { margin:3px 0 0; color:#92809e; font-size:0.6875rem; font-variant-numeric:tabular-nums; }
.deletion-warning { display:flex; align-items:flex-start; gap:11px; margin-bottom:24px; padding:15px 16px; border:1px solid #efdce2; border-radius:8px; background:#fff8fa; color:#9f4b60; }
.deletion-warning > .icon { width:19px; height:19px; margin-top:1px; flex-shrink:0; }
.deletion-warning strong { display:block; font-size:0.8125rem; font-weight:600; }
.deletion-warning p { margin:3px 0 0; color:#966374; font-size:0.75rem; }
.deletion-impact > h2 { margin-bottom:15px; color:#5a4669; font-size:0.875rem; font-weight:600; }
.deletion-impact-grid { display:grid; grid-template-columns:1fr 1fr; gap:12px; margin:0 0 17px; }
.deletion-impact-grid > div { display:grid; grid-template-columns:23px 1fr; align-items:center; gap:7px 9px; padding:16px; border:1px solid #e9e1ef; border-radius:8px; background:#fdfcfe; }
.deletion-impact-grid .icon { width:19px; height:19px; color:#a086b2; }
.deletion-impact-grid strong { color:#6d5083; font-size:1.375rem; font-weight:600; line-height:1.2; font-variant-numeric:tabular-nums; }
.deletion-impact-grid span { grid-column:1/-1; color:#7e6d89; font-size:0.75rem; }
.deletion-list { display:grid; gap:11px; margin:0; padding:0; list-style:none; }
.deletion-list li { position:relative; padding-left:16px; color:#6f5f79; font-size:0.8125rem; line-height:1.8; }
.deletion-list li::before { content:''; position:absolute; left:1px; top:9px; width:5px; height:5px; border-radius:50%; background:#bea7d0; }
.deletion-description { margin:15px 0 0; color:#85718e; font-size:0.75rem; }
.deletion-preserved { display:flex; align-items:flex-start; gap:11px; padding:15px 16px; margin-top:22px; border:1px solid #e5dbef; border-radius:8px; background:#f8f4fc; color:#9270aa; }
.deletion-preserved .icon { width:19px; height:19px; margin-top:1px; }
.deletion-preserved p { margin:0; color:#7d658e; font-size:0.8125rem; line-height:1.75; }
.deletion-note { margin:14px 0 0; color:#897493; font-size:0.75rem; line-height:1.8; }
.deletion-footer { padding:20px 28px; border-top:1px solid #eee7f3; background:#fcfafd; }
.deletion-actions { display:flex; flex-wrap:wrap; align-items:center; justify-content:flex-end; gap:11px; margin:0; }
.deletion-actions .button { min-height:42px; padding:11px 16px; font-size:0.75rem; font-weight:600; }
.deletion-actions .icon { width:15px; height:15px; }
.danger-solid { color:#fff; background:#ad455f; border-color:#ad455f; }
.danger-solid:hover { color:#fff; background:#96364f; border-color:#96364f; box-shadow:0 3px 9px #ac455f20; }
.danger-solid:disabled { color:#a48e97; background:#f0e8eb; border-color:#e8dce1; box-shadow:none; cursor:not-allowed; transform:none; }
.deletion-processing { display:flex; align-items:flex-start; gap:11px; margin-top:22px; padding:16px; border:1px solid #efe1c4; border-radius:8px; background:#fffaf0; color:#9b7b3e; }
.deletion-processing .icon { width:19px; height:19px; margin-top:1px; }
.deletion-processing strong { display:block; color:#937039; font-size:0.75rem; font-weight:600; }
.deletion-processing p { margin:4px 0 0; color:#8a734d; font-size:0.8125rem; line-height:1.75; }
@media (max-width:1190px) { .deletion-header { padding:24px; } .deletion-body { padding:23px 24px; } .deletion-footer { padding:19px 24px; } }

/* Confirmação sobre a tela de origem, com rolagem apenas no conteúdo. */
html.deletion-modal-open { overflow:hidden; }
html.deletion-modal-open.deletion-modal-scrollbar { scrollbar-gutter:stable; }
.deletion-dialog { width:min(780px, calc(100vw - 80px)); max-width:none; max-height:calc(100dvh - 64px); margin:auto; padding:0; border:0; border-radius:14px; background:#fff; color:var(--ink); box-shadow:0 24px 80px #2e164a33, 0 4px 18px #2e164a14; overflow:hidden; }
.deletion-dialog::backdrop { background:#2c1d426b; backdrop-filter:blur(3px); }
.deletion-dialog[open] { animation:deletion-dialog-appear .2s ease-out; }
.deletion-dialog[open]::backdrop { animation:deletion-backdrop-appear .18s ease-out; }
.deletion-dialog [data-deletion-content] { min-height:0; }
.deletion-dialog .deletion-card { display:flex; flex-direction:column; max-height:calc(100dvh - 64px); border:1px solid #e1d7e9; border-radius:14px; box-shadow:none; }
.deletion-dialog .deletion-header { flex-shrink:0; padding-right:68px; }
.deletion-dialog .deletion-header h1 { font-size:1.4375rem; }
.deletion-dialog .deletion-header h1:focus { outline:none; }
.deletion-dialog .deletion-body { min-height:0; overflow-y:auto; overscroll-behavior:contain; scrollbar-width:thin; scrollbar-color:#ccb8df transparent; }
.deletion-dialog .deletion-footer { flex-shrink:0; }
.deletion-dialog-close { position:absolute; z-index:1; top:17px; right:17px; display:grid; place-items:center; width:32px; height:32px; padding:0; border:1px solid transparent; border-radius:8px; background:transparent; color:#897494; cursor:pointer; transition:background .15s, color .15s, border-color .15s; }
.deletion-dialog-close .icon { width:18px; height:18px; }
.deletion-dialog-close:hover { background:#f0e9f7; color:#63417e; border-color:#e4d8ee; }
.deletion-dialog-close:disabled { opacity:.45; cursor:wait; }
.deletion-dialog [aria-disabled='true'] { opacity:.5; cursor:wait; }
.deletion-dialog-state { display:flex; flex-direction:column; align-items:center; justify-content:center; gap:14px; min-height:240px; padding:48px; text-align:center; }
.deletion-dialog-state h2 { margin:0; color:#53415f; font-size:1.125rem; }
.deletion-dialog-state p { margin:0; color:#82718e; font-size:0.8125rem; line-height:1.75; }
.deletion-loading { width:26px; height:26px; border:2px solid #ede4f5; border-top-color:#9663c6; border-radius:50%; animation:deletion-loading .7s linear infinite; }
@keyframes deletion-dialog-appear { from { opacity:0; transform:translateY(10px) scale(.99); } to { opacity:1; transform:translateY(0) scale(1); } }
@keyframes deletion-backdrop-appear { from { opacity:0; } to { opacity:1; } }
@keyframes deletion-loading { to { transform:rotate(360deg); } }

/* Em telas pequenas a navegação recolhe sem comprimir o formulário. */
@media (max-width:1000px) {
    .workspace { padding-left:20px; padding-right:20px; }
    .topbar { gap:16px; }
    .topbar > p { font-size:1.25rem; }
}
@media (max-width:760px) {
    .app-shell,.app-shell.sidebar-collapsed { --sidebar-width:64px; grid-template-columns:64px minmax(0,1fr); }
    .app-shell:not(.sidebar-collapsed) .sidebar { position:fixed; inset:0 auto 0 0; width:240px; box-shadow:8px 0 30px #32203f25; }
    .sidebar-collapsed .sidebar { padding:25px 8px 16px; }
    .sidebar-collapsed .brand { padding-left:5px; }
    .sidebar-collapsed .nav-link { padding:13px; }
    .workspace { grid-column:2; padding:0 16px; }
    .topbar { min-height:82px; gap:12px; }
    .topbar > p { font-size:1.125rem; letter-spacing:-.4px; }
    .clinic { max-width:130px; }
    .clinic strong { font-size:0.6875rem; }
    .breadcrumbs { gap:7px; margin-bottom:14px; font-size:0.625rem; }
    .content-panel { min-height:calc(100dvh - 155px); padding:22px 18px; }
    .page-heading { flex-wrap:wrap; gap:16px; }
    .page-heading h1 { font-size:1.5625rem; }
    .deletion-dialog { width:calc(100vw - 24px); max-height:calc(100dvh - 24px); }
    .deletion-dialog .deletion-card { max-height:calc(100dvh - 24px); }
    .deletion-impact-grid { grid-template-columns:minmax(0,1fr); }
}
@media (max-width:480px) {
    .workspace { padding:0 10px; }
    .topbar { flex-wrap:wrap; justify-content:flex-start; align-content:center; gap:5px; padding:12px 0; }
    .topbar > p { flex-basis:100%; font-size:1rem; }
    .clinic { display:flex; align-items:baseline; gap:7px; max-width:none; padding:0; border:0; }
    .clinic > span { font-size:0.5rem; }
    .clinic strong { font-size:0.625rem; }
    .content-panel { padding:20px 14px; }
}

/* Acoes do documento: abrir a esquerda e menu discreto a direita. */
.report-actions { display:flex; align-items:center; justify-content:space-between; gap:16px; flex-basis:100%; }
.report-actions .acoes-cartao { display:flex; align-items:center; gap:12px; margin-left:auto; }
.report-actions [data-marcar-laudo] { display:inline-flex; align-items:center; gap:7px; font-size:0.75rem; color:var(--muted); }
.report-actions [data-menu-laudo] { position:relative; }
.report-actions [data-menu-laudo] > summary { display:flex; align-items:center; justify-content:center; width:40px; height:40px; padding:10px; border-radius:7px; color:var(--muted); list-style:none; cursor:pointer; }
.report-actions [data-menu-laudo] > summary::marker { content:''; }
.report-actions [data-menu-laudo] > summary::-webkit-details-marker { display:none; }
.report-actions [data-menu-laudo] > summary:hover,.report-actions [data-menu-laudo][open] > summary { color:var(--purple); background:#f5effb; }
.report-actions .menu-laudo { position:absolute; right:0; bottom:calc(100% + 8px); min-width:150px; padding:6px; border:1px solid var(--line); border-radius:8px; background:var(--card); box-shadow:0 6px 18px #42244e12; z-index:5; }
.report-actions .menu-laudo form { margin:0; }
.laudo .menu-laudo button { display:flex; width:100%; margin:0; padding:9px 12px; border:0; border-radius:5px; text-align:left; justify-content:flex-start; font-size:0.75rem; color:var(--ink); }
.laudo .menu-laudo button:hover { background:#f5effb; color:var(--purple-dark); }
.laudo .menu-laudo [data-excluir-cartao] { color:#a13c4c; }
.laudo .menu-laudo button:disabled { opacity:.5; cursor:default; }

.laudo .menu-laudo a { display:block; width:100%; padding:9px 12px; border-radius:5px; font-size:0.75rem; color:#a13c4c; }
.laudo .menu-laudo a:hover { background:#fcf0f2; color:#892d3d; }

/* Pastas e selecao de documentos acompanham os mesmos cartoes e controles. */
.caminho-pastas { display:flex; flex-wrap:wrap; align-items:center; gap:8px; margin:0 0 16px; font-size:0.75rem; color:var(--muted); }
.caminho-pastas a { padding:4px 0; overflow-wrap:anywhere; }
.caminho-pastas a:hover { color:var(--purple); }
.caminho-pastas [aria-current="page"] { color:var(--ink); font-weight:600; }
.nova-pasta { margin:0 0 20px; }
.nova-pasta > summary { display:inline-flex; align-items:center; gap:9px; padding:9px 14px; border:1px solid #dbcee9; border-radius:7px; background:var(--card); color:#7138bf; font-size:0.75rem; font-weight:550; list-style:none; cursor:pointer; }
.nova-pasta > summary::before { content:'+'; font-size:1rem; }
.nova-pasta > summary::-webkit-details-marker { display:none; }
.nova-pasta form { display:flex; flex-wrap:wrap; align-items:center; gap:12px; margin-top:12px; padding:18px; border:1px solid var(--line); border-radius:9px; background:var(--card); font-size:0.75rem; }
.nova-pasta input { min-width:0; max-width:100%; height:43px; padding:0 12px; border:1px solid #d9cee3; border-radius:6px; color:var(--ink); font:inherit; }
.nova-pasta button,.barra-selecao button { min-height:38px; padding:8px 12px; border:1px solid #dbcee9; border-radius:7px; background:var(--card); color:#7138bf; font:inherit; font-size:0.75rem; font-weight:550; cursor:pointer; }
.nova-pasta button:hover,.barra-selecao button:hover { background:#f5effb; border-color:#b99bdc; }
.barra-selecao { display:flex; flex-wrap:wrap; align-items:center; gap:12px; position:sticky; top:12px; margin-bottom:20px; padding:18px; border:1px solid #d9c7eb; border-radius:9px; background:#f3ecfb; font-size:0.75rem; z-index:6; }
.barra-selecao select { width:auto; max-width:100%; }
.barra-selecao button:disabled { opacity:.5; cursor:default; }
.grade-pastas { display:grid; grid-template-columns:repeat(auto-fill,minmax(min(100%,220px),1fr)); gap:16px; margin-bottom:20px; }
.item-pasta { min-width:0; }
.cartao-pasta { display:flex; align-items:center; gap:12px; min-width:0; padding:20px; border:1px solid var(--line); border-radius:9px; background:var(--card); font-size:0.8125rem; overflow-wrap:anywhere; }
.cartao-pasta svg { flex-shrink:0; color:var(--purple); }
.cartao-pasta:hover { border-color:#b99bdc; background:#f5effb; }
.excluir-pasta { display:inline-block; margin-top:7px; color:#a13c4c; font-size:0.6875rem; }
.excluir-pasta:hover { text-decoration:underline; }
.pasta-destacada,.laudo-selecionado { outline:2px solid var(--purple); background:#f3ecfb; }
.arrastando { opacity:.5; }

/* Transições de interação mantêm o conteúdo estável durante a navegação. */
.laudo,.doctor-card,.item-pasta,.cartao-pasta,.access-option { transition:background-color .2s ease,border-color .2s ease,box-shadow .2s ease; }
.laudo[draggable='true'] { cursor:grab; }
.laudo[draggable='true']:hover { background:#f0f0f3; border-color:#cecad5; }
.laudo[draggable='true']:active,.laudo.arrastando,.laudo.arrastando * { cursor:grabbing; }
.laudo :is(a,button,summary,label,input[type='checkbox']) { cursor:pointer; }
.laudo.arrastando :is(a,button,summary,label,input) { cursor:grabbing; }
.nova-pasta-conteudo { display:flow-root; }
.nova-pasta > summary { transition:background-color .18s ease,border-color .18s ease,box-shadow .18s ease; }
.nova-pasta > summary::before { transition:transform .2s ease; }
.nova-pasta[open] > summary::before { transform:rotate(45deg); }
.nova-pasta > summary:hover { background:#f3edf9; border-color:#b291d3; }
.nova-pasta input { transition:border-color .18s ease,box-shadow .18s ease; }
.nova-pasta input:hover { border-color:#b99bdc; }
.nova-pasta input:focus { border-color:#a27bdd; }
details[open] > .menu-pasta,details[open] > .menu-laudo { animation:item-appear .16s ease-out both; }
.modo-selecao .laudo { user-select:none; -webkit-user-select:none; }
.retangulo-selecao { position:fixed; pointer-events:none; border:1px solid var(--purple); background:#7940d822; z-index:20; }
/* Confirmacao de saida: cancelar preserva a sessao. */
.content-panel.session-panel { width:100%; max-width:560px; min-height:0; margin:12px auto 36px; padding:0; border:0; background:transparent; }
.session-card { min-width:0; border:1px solid var(--line); border-radius:12px; background:var(--card); overflow:hidden; }
.session-card-body { padding:28px; }
.session-symbol { display:grid; place-items:center; width:44px; height:44px; margin-bottom:20px; border-radius:10px; color:var(--purple); background:#f0eaf7; }
.session-card h2 { margin:0 0 10px; }
.session-card p { margin-bottom:0; }
.session-actions { display:flex; align-items:center; justify-content:flex-end; flex-wrap:wrap; gap:12px; margin:0; padding:20px 28px; border-top:1px solid var(--line); background:#fcfafd; }
.session-dialog { width:min(480px,calc(100vw - 32px)); max-height:calc(100dvh - 32px); padding:0; border:0; border-radius:12px; color:var(--ink); background:var(--card); box-shadow:0 20px 70px #33213c33; }
.session-dialog::backdrop { background:#33223f77; backdrop-filter:blur(3px); }
@media (max-width:480px) { .session-card-body { padding:22px; } .session-actions { padding:18px 22px; } .nova-pasta input { width:100%; } }

/* Menu das pastas, com o mesmo controle de tres pontos dos documentos. */
.item-pasta { display:flex; flex-direction:row; align-items:center; gap:8px; padding:12px 14px; border:1px solid var(--line); border-radius:9px; background:var(--card); }
.item-pasta .cartao-pasta { flex:1; min-width:0; min-height:40px; padding:0; border:0; background:transparent; }
.item-pasta .cartao-pasta > span { display:block; min-width:0; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.item-pasta .cartao-pasta:hover { color:var(--purple); }
.folder-actions { display:flex; justify-content:flex-end; flex-shrink:0; margin:0; }
.folder-actions [data-menu-pasta] { position:relative; }
.folder-actions summary { display:flex; align-items:center; justify-content:center; width:40px; height:40px; padding:10px; border-radius:7px; color:var(--muted); list-style:none; cursor:pointer; }
.folder-actions summary::marker { content:''; }
.folder-actions summary::-webkit-details-marker { display:none; }
.folder-actions summary:hover,.folder-actions [open] > summary { color:var(--purple); background:#f5effb; }
.folder-menu { position:absolute; right:0; top:calc(100% + 6px); bottom:auto; min-width:150px; padding:6px; border:1px solid var(--line); border-radius:8px; background:var(--card); box-shadow:0 6px 18px #42244e12; z-index:5; }
.folder-menu a { display:block; padding:9px 12px; border-radius:5px; color:var(--ink); font-size:0.75rem; }
.folder-menu a:hover { background:#f5effb; color:var(--purple-dark); }
.folder-menu .folder-delete { color:#a13c4c; }
.folder-menu .folder-delete:hover { color:#892d3d; background:#fcf0f2; }
.folder-current-actions { display:flex; align-items:center; justify-content:space-between; gap:12px; margin:0 0 16px; }
.folder-current-actions > .muted { font-size:0.75rem; }
.folder-current-actions .folder-actions { margin:0; }

.folder-move-name { max-width:260px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-weight:550; }

/* Menus abertos ficam acima da barra fixa e dos cartoes vizinhos. */
.item-pasta:has([data-menu-pasta][open]),.folder-current-actions:has([data-menu-pasta][open]),.laudo:has([data-menu-laudo][open]) { position:relative; z-index:7; }

/* Pastas: navegação e destinos de arraste. */
.folder-page-label { display:block; margin-bottom:8px; color:#8055a5; font-size:0.625rem; font-weight:600; letter-spacing:1.4px; }
.item-pasta { position:relative; min-height:82px; transition:transform .2s ease,background-color .2s ease,border-color .2s ease,box-shadow .2s ease; }
.item-pasta:hover { transform:translateY(-3px); border-color:#c1a3dc; background:#fbf8fe; box-shadow:0 7px 18px #43266b0c; }
.item-pasta .cartao-pasta > svg { width:44px; height:44px; padding:10px; border-radius:10px; background:#f0e7fa; transition:background-color .2s ease,transform .2s ease; }
.item-pasta:hover .cartao-pasta > svg { background:#e9d9f8; transform:rotate(-4deg); }
.pasta-identity strong { display:block; overflow:hidden; text-overflow:ellipsis; font-size:0.8125rem; font-weight:600; }
.pasta-identity small { display:block; margin-top:4px; color:#8a7898; font-size:0.6875rem; }
.item-pasta.pasta-destacada,.item-pasta:has(.pasta-destacada) { outline:2px solid #9564c7; outline-offset:2px; border-color:#a57bce; background:#eee1fb; transform:translateY(-3px); box-shadow:0 8px 22px #7940d81c; }
.item-pasta.pasta-destacada .pasta-identity small,.item-pasta:has(.pasta-destacada) .pasta-identity small { visibility:hidden; }
.item-pasta.pasta-destacada::after,.item-pasta:has(.pasta-destacada)::after { content:'Solte aqui para mover'; position:absolute; left:70px; bottom:17px; color:#7138a9; font-size:0.6875rem; pointer-events:none; }
.remove-dropzone { position:fixed; z-index:35; left:50%; bottom:24px; margin-left:120px; display:flex; align-items:center; gap:14px; width:min(460px,calc(100vw - 320px)); min-height:78px; padding:17px 22px; border:2px dashed #b293cf; border-radius:12px; background:#faf6ff; color:#693b91; box-shadow:0 10px 35px #30203e24; opacity:0; visibility:hidden; pointer-events:none; transform:translateX(-50%) translateY(12px); transition:opacity .18s ease,transform .18s ease,visibility .18s; }
.remove-dropzone.is-visible { opacity:1; visibility:visible; pointer-events:auto; transform:translateX(-50%) translateY(0); }
.remove-dropzone > .icon { width:27px; height:27px; }
.remove-dropzone strong { display:block; font-size:0.875rem; }
.remove-dropzone small { display:block; margin-top:3px; color:#826595; font-size:0.75rem; }
.remove-dropzone.pasta-destacada { border-style:solid; border-color:#7940d8; outline:3px solid #d8c1f0; outline-offset:3px; background:#ecddfa; box-shadow:0 10px 35px #7940d82b; }
.drag-toast { position:fixed; z-index:36; bottom:122px; left:50%; margin:0 0 0 120px; transform:translateX(-50%); width:max-content; max-width:min(500px,calc(100vw - 320px)); padding:10px 16px; border:1px solid #dfd1eb; border-radius:8px; background:#fff; color:#674c7c; box-shadow:0 3px 15px #43266b0e; font-size:0.75rem; text-align:center; pointer-events:none; animation:drag-toast-appear .18s ease-out; }
@media(max-width:760px) { .remove-dropzone,.drag-toast { margin-left:0; width:calc(100vw - 32px); max-width:calc(100vw - 32px); } }

@keyframes drag-toast-appear { from { opacity:0; } to { opacity:1; } }

/* A identificação permanece separada da área de trabalho dos documentos. */
.patient-context { padding:24px; margin-bottom:30px; border:1px solid #e1d4ed; border-left:3px solid #b391d3; border-radius:10px; background:#f3eef8; }
.context-identity { display:flex; align-items:flex-start; gap:17px; min-width:0; }
.context-symbol { display:grid; place-items:center; width:48px; height:48px; margin-top:2px; flex-shrink:0; border:1px solid #e3d6ef; border-radius:11px; background:#fff; color:#8b60af; }
.context-symbol .icon { width:24px; height:24px; stroke-width:1.5; }
.patient-context .dados-paciente { min-width:0; }
.context-label,.patient-context .folder-page-label { display:block; margin-bottom:8px; color:#705783; font-size:0.5625rem; font-weight:600; letter-spacing:1.35px; line-height:1.5; }
.patient-context h1 { margin-bottom:12px; font-size:1.625rem; letter-spacing:-.7px; }
.patient-context .patient-subtitle { display:flex; gap:14px 32px; margin:0; color:#56445f; font-size:0.75rem; }
.patient-context .patient-subtitle > span { display:grid; gap:3px; min-width:90px; }
.context-field-label { color:#755f86; font-size:0.625rem; font-weight:500; }
.patient-context .muted { max-width:650px; font-size:0.75rem; color:#7c678c; }
.patient-context > .button { align-self:center; }
.document-workspace > .section-heading { margin-top:0; margin-bottom:18px; }
.document-section-title { display:flex; align-items:center; gap:9px; }
.document-section-title > .icon { width:19px; height:19px; color:#8c6ca8; }
@media (max-width:1190px) { .patient-context { padding:21px; } .context-identity { gap:13px; } .patient-context .patient-subtitle { gap:12px 20px; } }
@media (max-width:760px) { .patient-context { padding:19px; } .context-symbol { width:40px; height:40px; } .patient-context h1 { font-size:1.4375rem; } }

/* As ações principais acompanham a rolagem, fora dos cartões de conteúdo. */
.page-actions { position:sticky; top:0; z-index:20; display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:12px 20px; min-height:66px; margin:0 0 20px; padding:11px 16px; border:1px solid #dfd2eb; border-top:3px solid #b896d8; border-radius:9px; background:#fbf9fd; box-shadow:0 4px 16px #43266b0c; }
.page-actions:empty { display:none; }
.page-actions .back-link { margin:0; min-height:43px; }
.page-actions > .primary { margin-left:auto; min-height:43px; }
.workspace:has(> .page-actions:not(:empty)) .barra-selecao { top:86px; }
.workspace:has(> .page-actions:not(:empty)) [id] { scroll-margin-top:90px; }
@media (max-width:760px) { .page-actions { padding:10px; gap:10px; } .page-actions .back-link,.page-actions > .primary { font-size:0.75rem; padding:9px 11px; } }

/* Clínica, localização e ações pertencem ao mesmo cabeçalho fixo. */
.workspace { --workspace-gutter:30px; --workspace-header-height:166px; padding:0 var(--workspace-gutter); background:var(--paper); }
.sidebar { z-index:25; }
.workspace-header { position:sticky; top:0; z-index:20; margin:0 calc(-1 * var(--workspace-gutter)); padding:0 var(--workspace-gutter); border-bottom:1px solid #e1d8e9; background:var(--paper); box-shadow:0 3px 12px #43266b08; }
.header-context { display:flow-root; margin:0 calc(-1 * var(--workspace-gutter)); padding:0 var(--workspace-gutter); background:var(--lavender); }
.workspace-header .topbar { min-height:92px; }
.workspace-header .topbar > p { font-size:1.3125rem; }
.workspace-header .breadcrumbs { min-height:36px; margin:0 2px 22px; padding:0 0 12px; border-bottom:1px solid #d9cde5; }
.workspace-header .breadcrumbs [aria-current='page']::after { bottom:-13px; }
.workspace-header .page-actions { position:static; min-height:65px; margin:0; padding:10px 0 12px; border:0; border-radius:0; background:transparent; box-shadow:none; }
.workspace > .content-panel { margin-top:0; padding:24px 0 30px; border:0; border-radius:0; background:transparent; }
.workspace .barra-selecao { top:calc(var(--workspace-header-height) + 12px); }
.workspace [id] { scroll-margin-top:calc(var(--workspace-header-height) + 18px); }
@media(max-width:1190px) { .workspace { --workspace-gutter:22px; } }
@media(min-width:1500px) { .workspace { --workspace-gutter:40px; } }
@media(max-width:760px) { .workspace { --workspace-gutter:16px; } .workspace-header .breadcrumbs { gap:7px; margin-bottom:14px; font-size:0.625rem; } .workspace-header .page-actions { padding:10px 0 12px; } }

/* Edição do cadastro e opções da pasta alinhadas às ações. */
.folder-current-actions { justify-content:flex-end; gap:8px; margin:0 0 18px; }
.folder-current-actions > .muted { color:#826c92; }
.patient-context { position:relative; }
.patient-context:has(.patient-edit) { padding-right:68px; }
.patient-edit { display:inline-grid; place-items:center; width:30px; height:30px; padding:6px; border:1px solid transparent; border-radius:7px; color:#9677af; background:transparent; }
.patient-edit .icon { width:17px; height:17px; }
.patient-edit:hover { color:#6e3f9e; background:#f0e6fa; border-color:#d8c4e9; }
.patient-context > .patient-edit { position:absolute; top:15px; right:15px; background:#ffffffa6; }
.patient-table td.patient-actions-cell { position:relative; padding-top:42px; }
.patient-actions-cell > .patient-edit { position:absolute; top:7px; right:12px; }

/* Cabeçalho com acabamento arredondado e versão compacta nas telas internas. */
.workspace-header { border:1px solid #e1d8e9; border-radius:14px; overflow:hidden; }
.workspace-header--compact .topbar { min-height:64px; justify-content:flex-end; }
.workspace-header--compact .breadcrumbs { margin-bottom:12px; }
.patient-table td.patient-actions-cell { padding-top:20px; }
.patient-actions-cell > .patient-edit { top:50%; transform:translateY(-50%); }
.patient-actions-cell .row-actions { padding-right:34px; }
.patient-table th:first-child { width:25%; }
.patient-table th:last-child { width:22%; }
.report-title-link { border-radius:3px; text-decoration:none; text-underline-offset:4px; text-decoration-thickness:1px; }
.report-title-link:hover { color:#7138aa; text-decoration:underline; }
.folder-toolbar { display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:start; column-gap:20px; margin-bottom:20px; }
.folder-toolbar > .nova-pasta { grid-column:1/-1; grid-row:1; margin:0; }
.folder-toolbar > .nova-pasta > summary { min-height:43px; }
.folder-toolbar > .folder-current-actions { grid-column:2; grid-row:1; justify-self:end; z-index:2; height:43px; margin:0; }

/* Identificação da clínica e botões de opções com destaque mais nítido. */
.topbar-account .clinic { border-left:1px solid #cebedc; margin-left:0; padding-left:18px; }
.report-actions [data-menu-laudo] > summary,.folder-actions [data-menu-pasta] > summary { width:42px; height:42px; border:1px solid transparent; border-radius:8px; transition:background-color .18s ease,border-color .18s ease,color .18s ease,box-shadow .18s ease,transform .18s ease; }
.report-actions [data-menu-laudo] > summary:is(:hover,:focus-visible),.report-actions [data-menu-laudo][open] > summary,.folder-actions [data-menu-pasta] > summary:is(:hover,:focus-visible),.folder-actions [data-menu-pasta][open] > summary { color:#6b329f; background:#e8d8f8; border-color:#bd99de; box-shadow:0 3px 10px #6c379b1c; transform:translateY(-1px); }

/* Posição original da edição: canto superior direito de cada paciente. */
.patient-table td.patient-actions-cell { padding-top:42px; }
.patient-actions-cell > .patient-edit { top:7px; right:12px; transform:none; }
.patient-actions-cell .row-actions { padding-right:0; }
.patient-table th:first-child { width:28%; }
.patient-table th:last-child { width:19%; }

/* Menu compartilhado da conta: abre acima do bloco, inclusive com a barra recolhida. */
.sidebar-account { position:relative; display:block; flex-shrink:0; }
.account-trigger { display:flex; align-items:center; gap:9px; padding:7px 4px; border-radius:7px; cursor:pointer; list-style:none; }
.account-trigger::-webkit-details-marker { display:none; }
.account-trigger:hover,.sidebar-account[open] .account-trigger { background:#ffffff14; }
.account-chevron { width:14px; height:14px; margin-left:auto; transform:rotate(-90deg); color:#d0b6e8; }
.sidebar-account[open] .account-chevron { transform:rotate(90deg); }
.account-popover { position:absolute; bottom:calc(100% + 8px); left:0; width:100%; min-width:195px; padding:6px; border:1px solid var(--line); border-radius:9px; background:var(--card); box-shadow:0 8px 28px #32203f24; z-index:5; }
.account-popover a { display:flex; align-items:center; gap:10px; padding:12px; border-radius:5px; color:#a13c4c; font-size:0.8125rem; font-weight:550; }
.account-popover a:hover { background:#fcf0f2; }
.sidebar-collapsed .account-trigger { justify-content:center; padding:7px 0; }
.sidebar-collapsed .account-chevron { display:none; }

/* Ações de pacientes e pastas compartilham o mesmo menu e destaque deslizante. */
.patient-table td.patient-actions-cell { padding-top:20px; padding-bottom:20px; }
.patient-table th:nth-child(4) { width:auto; }
.patient-table th:last-child { width:190px; }
.patient-actions-cell .row-actions { flex-wrap:nowrap; gap:8px; }
.patient-actions-cell .row-actions > .button { min-height:42px; }
.patient-actions-cell:has([data-action-menu][open]) { z-index:8; }
.action-menu { position:relative; flex-shrink:0; }
.action-menu > .action-menu-trigger { display:flex; align-items:center; justify-content:center; width:42px; height:42px; padding:10px; border:1px solid transparent; border-radius:8px; background:transparent; color:var(--muted); list-style:none; cursor:pointer; transition:background-color .18s ease,border-color .18s ease,color .18s ease,box-shadow .18s ease,transform .18s ease; }
.action-menu > .action-menu-trigger::marker { content:''; }
.action-menu > .action-menu-trigger::-webkit-details-marker { display:none; }
.action-menu > .action-menu-trigger:is(:hover,:focus-visible),.action-menu[open] > .action-menu-trigger { color:#6b329f; background:#e8d8f8; border-color:#bd99de; box-shadow:0 3px 10px #6c379b1c; transform:translateY(-1px); }
.action-menu > .action-menu-panel { --menu-highlight-background:color-mix(in srgb,var(--purple) 9%,var(--card)); position:absolute; top:calc(100% + 7px); right:0; bottom:auto; min-width:174px; padding:6px; border:1px solid var(--line); border-radius:10px; background:var(--card); box-shadow:0 10px 30px #43266b1a,0 2px 6px #43266b08; z-index:9; transform-origin:top right; isolation:isolate; }
.action-menu[open] > .action-menu-panel { animation:action-menu-appear .2s cubic-bezier(.2,.75,.25,1) both; }
.action-menu.action-menu--above > .action-menu-panel { top:auto; bottom:calc(100% + 7px); transform-origin:bottom right; --menu-appear-offset:6px; }
.action-menu .action-menu-panel > .action-menu-item { justify-content:flex-start; text-align:left; position:relative; z-index:1; display:flex; align-items:center; gap:10px; width:100%; min-height:40px; padding:10px 12px; border:0; border-radius:6px; background:transparent; color:var(--ink); font-size:.8125rem; line-height:1.5; font-weight:500; white-space:nowrap; transition:color .18s ease; }
.action-menu .action-menu-item > .icon { width:16px; height:16px; stroke-width:1.65; }
.action-menu .action-menu-panel > .action-menu-item:is(:hover,:focus-visible) { color:var(--purple-dark); background:var(--lavender); }
.action-menu .action-menu-panel > .action-menu-item.is-danger { color:#a13c4c; }
.action-menu .action-menu-panel > .action-menu-item.is-danger:is(:hover,:focus-visible) { color:#892d3d; background:#fcf0f2; }
.action-menu .action-menu-panel[data-menu-enhanced] > .action-menu-item:is(:hover,:focus-visible) { background:transparent; }
.action-menu-panel[data-highlight-tone=danger] { --menu-highlight-background:color-mix(in srgb,#a13c4c 9%,var(--card)); }
.action-menu-panel[data-menu-enhanced]::before { content:''; position:absolute; z-index:0; left:0; top:0; width:var(--menu-highlight-width,0px); height:var(--menu-highlight-height,0px); border-radius:6px; background:var(--menu-highlight-background); opacity:var(--menu-highlight-opacity,0); transform:translate3d(var(--menu-highlight-x,0px),var(--menu-highlight-y,0px),0); pointer-events:none; }
.action-menu-panel[data-highlight-ready]::before { transition:transform .23s cubic-bezier(.2,.75,.25,1),width .23s ease,height .23s ease,background-color .18s ease,opacity .15s ease; }
html[data-color-mode]:not([data-color-mode=default]) .action-menu > .action-menu-trigger:is(:hover,:focus-visible),html[data-color-mode]:not([data-color-mode=default]) .action-menu[open] > .action-menu-trigger { color:var(--purple-dark); background:var(--lavender); border-color:var(--purple); }
html[data-color-mode]:not([data-color-mode=default]) .action-menu .action-menu-item.is-danger { color:var(--purple-dark); }
html[data-color-mode]:not([data-color-mode=default]) .action-menu-panel[data-highlight-tone=danger] { --menu-highlight-background:color-mix(in srgb,var(--purple) 12%,var(--card)); }
html[data-increase-contrast=true] .action-menu-panel[data-menu-enhanced]::before { outline:1px solid var(--muted); outline-offset:-1px; }
@keyframes action-menu-appear { from { opacity:0; transform:translateY(var(--menu-appear-offset,-6px)) scale(.97); } to { opacity:1; transform:translateY(0) scale(1); } }
/* A camada do navegador mantém os menus acima das tabelas com rolagem. */
.action-menu > .action-menu-panel[popover] { position:fixed; inset:auto; top:var(--menu-floating-top,8px); left:var(--menu-floating-left,8px); margin:0; max-width:calc(100vw - 16px); max-height:calc(100dvh - 16px); overflow-y:auto; }
.action-menu.filter-select-menu > .action-menu-panel[popover] { min-width:var(--menu-anchor-width,174px); }
.table-container:has(.action-menu[open] .action-menu-panel:not([popover])) { overflow:visible; }
@media(prefers-reduced-motion:reduce) { .action-menu[open] > .action-menu-panel,.action-menu-panel[data-menu-enhanced]::before { animation:none !important; transition:none !important; } }

/* Os filtros usam as mesmas animações, mantendo a aparência dos campos do formulário. */
.directory-sort,.directory-sex { position:relative; min-width:0; }
.filter-select-menu { width:100%; }
.action-menu.filter-select-menu > .action-menu-trigger { justify-content:space-between; gap:10px; width:100%; min-height:43px; height:auto; padding:11px 12px; border:1px solid #d9cee3; border-radius:6px; background:var(--card); color:var(--ink); font-size:.75rem; font-weight:400; line-height:1.55; transform:none; box-shadow:none; }
.action-menu.filter-select-menu > .action-menu-trigger:hover { border-color:#b89acc; }
.action-menu.filter-select-menu[open] > .action-menu-trigger { border-color:#b99bdc; box-shadow:0 0 0 3px #7940d80c; }
.filter-select-chevron { width:15px; height:15px; transition:transform .2s ease; }
.filter-select-menu[open] .filter-select-chevron { transform:rotate(180deg); }
.filter-select-menu > .action-menu-panel { width:max-content; min-width:100%; }
.filter-select-menu .action-menu-panel > .action-menu-item { justify-content:space-between; gap:12px; font-size:.75rem; }
.filter-select-menu .action-menu-item[aria-selected=true] { color:var(--purple-dark); font-weight:600; }
.menu-choice-check { width:15px; height:15px; margin-left:auto; color:var(--purple); opacity:0; }
[aria-selected=true] > .menu-choice-check { opacity:1; }
.action-menu .action-menu-item:disabled { opacity:.45; cursor:not-allowed; }
html[data-increase-contrast=true] .action-menu.filter-select-menu > .action-menu-trigger { border-color:var(--ink); }

/* Um link real cobre o cartão; o menu mantém sua interação independente. */
.patient-table tbody tr { position:relative; }
.patient-table .patient-card-link::after { content:""; position:absolute; inset:0; z-index:1; cursor:pointer; }
.patient-table tr:has(.patient-card-link:focus-visible) { outline:2px solid var(--purple); outline-offset:-2px; }
.patient-table .patient-actions-cell .row-actions { position:relative; z-index:2; width:fit-content; margin-left:auto; }
