/* Tokens e base */
:root {
  --blue:#153f4f;
  --navy:#102f4d;
  --action:#075967;
  --action-hover:#064450;
  --blue-mid:#21576a;
  --green:#176b4d;
  --green-hover:#105238;
  --ink:#173949;
  --muted:#49616a;
  --white:#fff;
  --soft:#edf2f6;
  --line:#cbd6df;
  --input-line:#718b9e;
  --danger:#a02a2a;
  --success-bg:#eaf6ee;
  --success-ink:#155135;
  --warning-bg:#fff4dc;
  --warning-ink:#73500d;
  --radius:10px;
  --radius-sm:6px;
  --shadow:0 3px 12px rgba(16,54,83,.06);
  --space-1:4px;
  --space-2:8px;
  --space-3:12px;
  --space-4:16px;
  --space-5:24px;
  --space-6:32px;
  --header-blue:#153f4f;
  --header-height:96px;
  --secondary:#e3edf3;
  --selected:#cce6d7;
  --font:'Segoe UI','Trebuchet MS',Arial,sans-serif
}
* {
  box-sizing:border-box
}
[hidden] {
  display:none!important
}
html {
  color-scheme:light;
  scroll-behavior:auto;
  scroll-padding-top:calc(var(--header-height) + 16px)
}
body {
  margin:0;
  min-height:100vh;
  display:flex;
  flex-direction:column;
  background:var(--soft);
  color:var(--ink);
  font:16px/1.6 var(--font)
}
a {
  color:var(--blue-mid);
  text-underline-offset:3px;
  overflow-wrap:anywhere
}
a:hover {
  color:var(--green-hover)
}
button,input,select,textarea {
  font:inherit
}
button,a {
  touch-action:manipulation;
  -webkit-tap-highlight-color:rgba(21,112,74,.18)
}
button {
  cursor:pointer
}
:focus-visible {
  outline:3px solid #176da3;
  outline-offset:3px
}
img {
  display:block;
  max-width:100%;
  height:auto
}
h1,h2,h3,p {
  margin-top:0
}
h1,h2,h3 {
  color:var(--blue);
  line-height:1.25;
  overflow-wrap:anywhere
}
h1 {
  font-size:clamp(1.65rem,2.3vw,2.1rem);
  font-weight:680;
  letter-spacing:-.025em;
  margin-bottom:10px;
  text-wrap:pretty
}
h2 {
  font-size:1.15rem;
  font-weight:650;
  margin-bottom:18px
}
h3 {
  font-size:1rem;
  font-weight:650
}
p {
  margin-bottom:16px;
  overflow-wrap:anywhere
}
.icon {
  width:20px;
  height:20px;
  flex:0 0 20px;
  display:inline-block;
  vertical-align:middle
}
.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
}
.skip-link {
  position:fixed;
  z-index:200;
  top:-100px;
  left:16px;
  background:white;
  color:var(--blue);
  padding:12px 18px;
  border:2px solid var(--blue);
  border-radius:5px
}
.skip-link:focus {
  top:12px
}
/* Cabeçalho horizontal da equipe */
.app-header {
  --header-height: 96px;
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr) minmax(240px, 340px);
  align-items: center;
  gap: 16px;
  min-height: var(--header-height);
  padding: 6px 24px;
  background: var(--header-blue);
  color: white;
  border-bottom: 4px solid var(--green);
  position: sticky;
  top: 0;
  z-index: 50;
}
.app-brand {
  display: block;
  width: 104px;
  padding: 2px 4px;
  background: white;
  border-radius: 5px;
}
.app-brand img {
  width: 96px;
  height: auto;
}
.app-navigation {
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: 5px;
  min-width: 0;
}
.app-navigation a { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 46px; color: white; font-weight: 550; white-space: nowrap; text-decoration: none; border: 1px solid transparent; border-bottom: 3px solid transparent; border-radius: 5px; }

.app-navigation a .icon {
  width: 18px;
  height: 18px;
  flex-basis: 18px;
}
.app-navigation a:hover {
  background: #255969;
  color: white;
}
.app-navigation a[aria-current='page'] { font-weight: 700; }


.app-header :focus-visible {
  outline-color: white;
  outline-offset: 3px;
}
.app-brand:focus-visible,
.app-navigation a[aria-current='page']:focus-visible {
  outline-color: #fff;
  box-shadow: 0 0 0 2px var(--header-blue);
}
.icon-button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 44px;
  height: 44px;
  padding: 10px;
  background: white;
  border: 1px solid var(--input-line);
  color: var(--blue);
  border-radius: 6px;
}
.icon-button:hover {
  background: var(--secondary);
  border-color: var(--green);
}
.nav-toggle {
  display: none;
}
.user-menu {
  position: relative;
  min-width: 0;
  justify-self: end;
  max-width: 100%;
}
.user-menu summary {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 48px;
  padding: 7px;
  border: 1px solid transparent;
  border-radius: 6px;
  cursor: pointer;
  list-style: none;
}
.user-menu summary::-webkit-details-marker {
  display: none;
}
.user-menu summary:hover,
.user-menu[open] summary {
  background: #255969;
  border-color: #6f969d;
}
.user-avatar {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  border-radius: 50%;
  background: var(--selected);
  color: var(--green);
  font-weight: 700;
}
.user-identification {
  display: block;
  min-width: 0;
}
.user-identification strong {
  display: block;
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.3;
  font-size: .9375rem;
  color: white;
  font-weight: 600;
}
.user-identification > span {
  display: block;
  font-size:.875rem;
  color: #d8e9e4;
}
.user-menu summary > .icon {
  width: 15px;
  flex-basis: 15px;
  color: #d8e9e4;
}
.user-menu-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  min-width: 250px;
  max-width: calc(100vw - 32px);
  padding: 8px;
  background: white;
  color: var(--ink);
  border: 1px solid var(--line);
  border-top: 4px solid var(--green);
  border-radius: 7px;
  box-shadow: 0 8px 30px rgba(21, 63, 79, .18);
  z-index: 5;
}
.menu-role {
  display: block;
  color: var(--muted);
  padding: 9px 12px 13px;
  font-size:.875rem;
  border-bottom: 1px solid var(--line);
  margin-bottom: 4px;
}
.menu-role strong,
.menu-role span {
  display: block;
  overflow-wrap: anywhere;
}
.menu-role strong {
  color: var(--blue);
  margin-bottom: 3px;
}
.user-menu-panel a,
.user-menu-panel button {
  display: flex;
  align-items: center;
  width: 100%;
  gap: 10px;
  min-height: 44px;
  padding: 9px 12px;
  border: 0;
  background: white;
  text-align: left;
  color: var(--blue);
  text-decoration: none;
  border-radius: 4px;
  font-size: .88rem;
}
.user-menu-panel a:hover,
.user-menu-panel button:hover {
  background: var(--secondary);
  color: var(--blue);
}
.user-menu-panel :focus-visible {
  outline-color: var(--blue);
}
.user-menu-panel form {
  margin: 0;
}
@media (max-width: 1100px) {
  html { scroll-padding-top: 16px; }
  .app-header {
    position: relative;
    grid-template-columns: 128px minmax(0, 1fr) auto;
    gap: 12px;
    padding: 6px 24px;
  }
  .app-brand {
    grid-column: 1;
    grid-row: 1;
  }
  .nav-toggle {
    min-width: 0;
    max-width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    justify-self: start;
    gap: 8px;
    min-height: 44px;
    padding: 8px 12px;
    color: white;
    border: 1px solid #8aacae;
    background: transparent;
    border-radius: 5px;
    font-size:.875rem;
  }
  .nav-toggle span {
    min-width: 0;
    max-width: 7ch;
    line-height: 1.2;
  }
  .nav-toggle:hover,
  .nav-toggle[aria-expanded='true'] {
    background: #255969;
  }
  .app-navigation {
    grid-column: 1 / -1;
    grid-row: 2;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    padding: 10px 0 8px;
    border-top: 1px solid #5d8590;
  }
.app-navigation a { justify-content: flex-start; white-space: normal; }

  .user-menu {
    grid-column: 3;
    grid-row: 1;
    max-width: 270px;
  }
}
@media (max-width: 600px) {
  .app-header {
    --header-height: 96px;
    grid-template-columns: 108px minmax(0, 1fr) auto;
    gap: 10px;
    padding: 6px 16px;
  }
  .app-brand {
    width: 104px;
    padding: 4px 6px;
  }
  .app-brand img {
    width: 92px;
  }
  .nav-toggle {
    gap: 6px;
    padding: 8px 9px;
  }
  .user-menu summary {
    gap: 4px;
    padding: 5px;
  }
  .user-avatar {
    width: 32px;
    height: 32px;
    flex-basis: 32px;
    font-size:.875rem;
  }
  .user-identification {
    display: none;
  }
  .user-menu summary > .icon {
    width: 12px;
    flex-basis: 12px;
  }
  .app-navigation {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Cabecalho do paciente e entradas */
.site-header {
  background:white;
  border-bottom:1px solid var(--line)
}
.header-inner {
  max-width:1180px;
  width:calc(100% - 64px);
  margin:auto;
  min-height:112px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:var(--space-5);
  padding:8px 0
}
.brand {
  display:block;
  flex:0 0 122px
}
.brand img {
  width:122px
}
.header-caption {
  color:var(--muted);
  font-size:.88rem
}
.main-nav {
  display:flex;
  align-items:center;
  flex-wrap:wrap;
  gap:18px
}
.main-nav a,.nav-button {
  min-height:44px;
  display:inline-flex;
  align-items:center;
  background:none;
  border:0;
  border-bottom:2px solid transparent;
  padding:0 2px;
  color:var(--blue);
  text-decoration:none;
  font-size:.88rem;
  font-weight:600
}
.main-nav a:hover,.nav-button:hover {
  color:var(--green)
}
.main-nav a[aria-current='page'] {
  color:var(--green);
  border-bottom-color:var(--green)
}
.inline-form {
  margin:0;
  display:inline-flex
}
/* Conteudo e acoes */
.page-shell {
  width:100%;
  max-width:1280px;
  margin:0 auto;
  padding:var(--space-6);
  flex:1;
  min-width:0
}
.public-app .page-shell,.patient-app .page-shell {
  max-width:1180px;
  padding-top:40px
}
.page-heading {
  margin-bottom:26px
}
.page-heading>p,.page-heading>div>p {
  max-width:72ch;
  color:var(--muted);
  margin-bottom:0
}
.page-heading .section-label {
  color:var(--blue-mid);
  margin-bottom:6px
}
.section-label {
  display:block;
  font-size:.875rem;
  font-weight:600;
  color:var(--muted);
  margin-bottom:6px
}
.heading-with-action {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:var(--space-5)
}
.heading-with-action>div {
  min-width:0
}
.heading-with-action>.button {
  flex-shrink:0
}
.action-group {
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap
}
.heading-with-action>.action-group {
  flex-shrink:0;
  max-width:45%
}
.button {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  min-height:44px;
  max-width:100%;
  padding:10px 18px;
  border:1px solid var(--action);
  border-radius:var(--radius-sm);
  background:var(--action);
  color:white;
  font-weight:600;
  font-size:.88rem;
  line-height:1.4;
  text-align:center;
  text-decoration:none;
  transition:background-color .15s,border-color .15s,box-shadow .15s
}
.button:hover {
  background:var(--action-hover);
  border-color:var(--action-hover);
  color:white
}
.button:active {
  box-shadow:inset 0 2px 4px rgba(0,0,0,.14)
}
.button:disabled {
  opacity:.72;
  cursor:wait
}
.button-secondary {
  background:white;
  color:var(--blue);
  border-color:#9aafbd
}
.button-secondary:hover {
  background:#e9f1f6;
  color:var(--blue);
  border-color:var(--blue-mid)
}
.button-danger {
  background:var(--danger);
  border-color:var(--danger)
}
.button-danger:hover {
  background:#7c2020;
  border-color:#7c2020
}
.button-full {
  width:100%
}
.button .icon {
  width:18px;
  height:18px;
  flex-basis:18px
}
.button[aria-busy='true']::before {
  content:'';
  width:15px;
  height:15px;
  border:2px solid currentColor;
  border-right-color:transparent;
  border-radius:50%;
  animation:button-progress .7s linear infinite
}
@keyframes button-progress {
  to {
    transform:rotate(360deg)
  }
}
.panel {
  background:white;
  border:1px solid var(--line);
  border-radius:var(--radius);
  padding:26px;
  box-shadow:var(--shadow)
}
.panel>:last-child {
  margin-bottom:0
}
.muted {
  color:var(--muted)
}
.narrow-content {
  max-width:680px;
  margin:0 auto
}
.wide-form {
  max-width:920px
}
.back-link {
  display:inline-flex;
  align-items:center;
  gap:7px;
  min-height:36px;
  margin:-8px 0 20px;
  color:var(--muted);
  font-size:.875rem;
  text-decoration:none
}
.back-link::before {
  content:'‹';
  font-size:1.4rem;
  line-height:1;
  color:var(--blue-mid)
}
.back-link:hover {
  color:var(--blue);
  text-decoration:underline
}
.site-footer {
  width:calc(100% - 64px);
  max-width:1216px;
  margin:auto;
  border-top:1px solid var(--line);
  padding:18px 0 22px;
  color:var(--muted);
  font-size:.875rem;
  display:flex;
  justify-content:space-between;
  gap:var(--space-3)
}
.site-footer>span:first-child {
  color:var(--blue);
  font-weight:600
}
/* Formularios */
.form-field {
  margin-bottom:20px;
  min-width:0
}
.form-field>label {
  display:block;
  color:var(--ink);
  font-size:.875rem;
  font-weight:600;
  margin-bottom:6px
}
input:not([type='checkbox']):not([type='radio']):not([type='hidden']),select,textarea {
  display:block;
  width:100%;
  min-width:0;
  min-height:44px;
  padding:9px 11px;
  background:white;
  color:var(--ink);
  border:1px solid var(--input-line);
  border-radius:5px;
  font-size:.93rem
}
input::placeholder,textarea::placeholder {
  color:var(--muted);
  opacity:1
}
input:hover,select:hover,textarea:hover {
  border-color:var(--blue-mid)
}
input[type='checkbox'],input[type='radio'] {
  width:19px;
  height:19px;
  flex:0 0 19px;
  margin:4px 0;
  accent-color:var(--green)
}
textarea {
  min-height:100px;
  resize:vertical
}
input[type='file'] {
  padding:7px!important;
  font-size:.875rem!important
}
input[type='file']::file-selector-button {
  padding:7px 10px;
  margin-right:10px;
  background:#e8eff4;
  color:var(--blue);
  border:0;
  border-radius:3px;
  cursor:pointer
}
.checkbox-line {
  display:flex;
  align-items:flex-start;
  gap:11px;
  min-height:44px;
  padding:7px 0
}
.checkbox-line label {
  cursor:pointer;
  font-size:.9rem
}
.password-field {
  position:relative
}
.password-field input {
  padding-right:90px!important
}
.password-toggle {
  position:absolute;
  top:3px;
  right:3px;
  min-height:38px;
  padding:6px 11px;
  background:var(--secondary);
  color:var(--blue);
  border:0;
  border-radius:3px;
  font-size:.875rem;
  font-weight:600
}
.password-toggle:hover {
  background:#dbe9f2
}
.required-mark {
  color:var(--muted)
}
.required-note {
  color:var(--muted);
  font-size:.875rem;
  margin-bottom:22px
}
.field-help {
  margin-top:6px;
  font-size:.875rem;
  color:var(--muted);
  line-height:1.5
}
.field-help ul {
  padding-left:18px;
  margin:6px 0 0
}
.field-errors {
  list-style:none;
  padding:0;
  margin:7px 0 0;
  color:var(--danger);
  font-size:.875rem
}
.has-error input,.has-error textarea,.has-error select {
  border-color:var(--danger)
}
.form-errors {
  padding:16px 18px;
  margin-bottom:24px;
  color:#852222;
  background:#fff1f0;
  border:1px solid #e0b9b5;
  border-left:4px solid var(--danger);
  border-radius:5px
}
.form-errors p {
  margin:0 0 5px
}
.form-errors p:last-child {
  margin:0
}
.form-section {
  min-width:0;
  border:0;
  padding:0;
  margin:0
}
.form-section+.form-section {
  margin-top:10px;
  border-top:1px solid var(--line);
  padding-top:26px
}
.form-section legend {
  padding:0 0 18px;
  font-size:1.12rem;
  font-weight:650;
  color:var(--blue)
}
.group-help {
  color:var(--muted);
  font-size:.875rem;
  margin:-8px 0 20px
}
.section-fields {
  display:grid;
  grid-template-columns:repeat(12,minmax(0,1fr));
  column-gap:18px
}
.section-fields .form-field {
  grid-column:span 6
}
.section-fields .field-full_name {
  grid-column:span 8
}
.section-fields .field-social_name {
  grid-column:span 4
}
.section-fields .field-birth_date {
  grid-column:span 4
}
.section-fields .field-cpf {
  grid-column:span 8
}
.section-fields .field-rg {
  grid-column:span 5
}
.section-fields .field-rg_issuer {
  grid-column:span 4
}
.section-fields .field-rg_state {
  grid-column:span 3
}
.section-fields .field-email,.section-fields .field-phone_is_whatsapp {
  grid-column:1/-1
}
.section-fields .field-postal_code {
  grid-column:span 3
}
.section-fields .field-street {
  grid-column:span 9
}
.section-fields .field-number {
  grid-column:span 3
}
.section-fields .field-complement {
  grid-column:span 4
}
.section-fields .field-neighborhood {
  grid-column:span 5
}
.section-fields .field-city {
  grid-column:span 9
}
.section-fields .field-state {
  grid-column:span 3
}
.legacy-address {
  border:1px dashed #b4c5d0;
  border-radius:5px;
  padding:13px 16px;
  margin:0 0 18px
}
.legacy-address summary {
  color:var(--muted);
  font-size:.875rem;
  cursor:pointer;
  min-height:28px
}
.legacy-address[open]>.form-field {
  margin:16px 0 0
}
.form-actions {
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  gap:var(--space-3) 22px;
  margin-top:26px;
  padding-top:20px;
  border-top:1px solid var(--line)
}
.form-actions>a:not(.button) {
  display:inline-flex;
  align-items:center;
  min-height:44px;
  font-size:.875rem
}
.messages {
  margin-bottom:24px
}
.message {
  padding:15px 18px;
  background:var(--success-bg);
  color:var(--success-ink);
  border:1px solid #b2d2be;
  border-left:4px solid var(--green);
  border-radius:6px;
  margin-bottom:16px;
  font-size:.92rem
}
.message p {
  margin:5px 0 0
}
.message.warning {
  background:var(--warning-bg);
  color:var(--warning-ink);
  border-color:#dec792;
  border-left-color:#976708
}
.message.error {
  color:#852222;
  background:#fff1f0;
  border-color:#e0b9b5;
  border-left-color:var(--danger)
}
.callout {
  background:#edf3f8;
  border-left:3px solid var(--blue-mid);
  border-radius:3px;
  padding:14px 17px;
  color:var(--muted);
  font-size:.875rem;
  margin-bottom:24px
}
/* Busca e indicadores */
.search-form {
  display:flex;
  align-items:flex-end;
  gap:var(--space-3)
}
.search-form .form-field {
  flex:1;
  margin:0
}
.search-form .button {
  min-height:44px;
  flex-shrink:0
}
.search-panel {
  background:white;
  border-left:4px solid var(--blue-mid)
}
.search-panel h2 {
  margin-bottom:16px
}
.list-search,.filter-form {
  margin-bottom:24px;
  padding:20px;
  border:1px solid var(--line);
  border-radius:8px;
  background:white
}
.clear-search {
  min-height:44px;
  display:flex;
  align-items:center;
  font-size:.875rem
}
.filter-form {
  flex-wrap:wrap
}
.filter-form .search-field {
  flex:2;
  min-width:200px
}
.filter-form .filter-field {
  flex:1;
  max-width:320px;
  min-width:180px
}
.result-count {
  margin:20px 0 12px;
  font-size:.875rem;
  color:var(--muted);
  font-weight:600
}
.section-block {
  margin-top:30px
}
.section-heading {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:20px;
  margin-bottom:18px
}
.section-heading h2 {
  margin:0
}
.section-heading>a:not(.button) {
  font-size:.875rem;
  font-weight:600;
  min-height:36px;
  display:flex;
  align-items:center
}
.stats-grid {
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:18px;
  margin-bottom:24px
}
.stats-grid:has(>:only-child) {
  grid-template-columns:1fr;
  max-width:360px
}
.stat {
  position:relative;
  padding:20px 24px;
  border:1px solid var(--line);
  border-radius:8px;
  background:white
}
.stat>span {
  display:block;
  color:var(--muted);
  font-size:.875rem
}
.stat>strong {
  display:block;
  color:var(--blue);
  font-size:2.1rem;
  font-weight:650;
  line-height:1.4;
  font-variant-numeric:tabular-nums
}
.stat>.icon {
  position:absolute;
  right:22px;
  top:23px;
  color:var(--blue-mid);
  background:#e7eff5;
  padding:9px;
  width:38px;
  height:38px;
  border-radius:8px
}
.stat:nth-child(2)>.icon {
  color:var(--green);
  background:#e8f4ed
}
.quick-actions {
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(190px,1fr));
  gap:var(--space-4);
  margin:24px 0
}
.quick-actions:not(:has(a)) {
  display:none
}
.quick-action {
  display:block;
  padding:19px 20px;
  background:#e3ecf3;
  border-radius:6px;
  color:var(--blue);
  text-decoration:none
}
.quick-action:hover {
  background:#d5e4ee;
  color:var(--blue)
}
.quick-action strong {
  display:block;
  font-size:.92rem;
  margin-bottom:5px
}
.quick-action span {
  color:var(--muted);
  font-size:.875rem;
  display:block
}
/* Listas e estados */
.table-frame {
  background:white;
  border:1px solid var(--line);
  border-radius:8px;
  overflow:hidden
}
table {
  width:100%;
  border-collapse:collapse;
  table-layout:fixed
}
th {
  padding:13px 16px;
  background:var(--secondary);
  color:var(--blue);
  font-size:.875rem;
  font-weight:650;
  text-align:left
}
td {
  padding:16px;
  font-size:.9375rem;
  border-top:1px solid var(--line);
  overflow-wrap:anywhere;
  vertical-align:middle
}
tbody tr:hover {
  background:#f7fafc
}
td strong {
  color:var(--ink);
  font-weight:600
}
.cell-secondary {
  display:block;
  font-size:.875rem;
  color:var(--muted);
  margin-top:5px
}
.table-action {
  text-align:right;
  overflow-wrap:normal
}
.table-action a {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:40px;
  padding:7px 12px;
  white-space:nowrap;
  background:var(--secondary);
  border:1px solid #afc2d0;
  border-radius:4px;
  color:var(--blue);
  text-decoration:none;
  font-size:.875rem;
  font-weight:600
}
.table-action a:hover {
  background:var(--selected);
  border-color:var(--blue-mid)
}




.audit-table th:first-child {
  width:26%
}
.staff-table th:first-child {
  width:22%
}
.staff-table th:last-child {
  width:160px
}
.status {
  white-space:nowrap;
  display:inline-flex;
  align-items:center;
  gap:6px;
  border:1px solid #bdcddb;
  border-radius:5px;
  padding:4px 9px;
  color:var(--blue);
  background:var(--secondary);
  font-size:.875rem;
  line-height:1.4;
  font-weight:600
}
.status::before {
  content:'';
  display:block;
  width:6px;
  height:6px;
  border-radius:50%;
  background:currentColor;
  flex-shrink:0
}
.status-published {
  color:var(--success-ink);
  background:var(--success-bg);
  border-color:#a9cfb9
}
.status-draft {
  color:var(--warning-ink);
  background:var(--warning-bg);
  border-color:#dcc48f
}
.status-withdrawn {
  color:#4d5a66;
  background:#edf0f3;
  border-color:#c9d1d9
}
.role-tag {
  display:inline-block;
  padding:4px 9px;
  border-radius:5px;
  background:var(--secondary);
  color:var(--blue);
  font-size:.875rem;
  line-height:1.4;
  font-weight:600
}
.pagination {
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  justify-content:flex-end;
  gap:14px;
  margin-top:22px
}
.pagination>span {
  color:var(--muted);
  font-size:.875rem
}
.pagination .button {
  font-size:.875rem;
  min-height:38px;
  padding:8px 14px
}
.empty-state {
  background:white;
  border:1px dashed #afc3d1;
  border-radius:8px;
  padding:44px 26px;
  text-align:center
}
.empty-state h2,.empty-state h3 {
  margin-bottom:10px
}
.empty-state p {
  color:var(--muted);
  max-width:55ch;
  margin:0 auto;
  font-size:.9rem
}
.empty-state.compact {
  padding:30px 24px
}
.empty-action {
  margin-top:20px
}
.patient-identity { border:1px solid #b0cfc0; border-radius:6px; }


.patient-identity>strong {
  display:block;
  color:var(--blue);
  font-size:1.12rem;
  line-height:1.4;
  overflow-wrap:anywhere
}
.identity-details {
  display:flex;
  flex-wrap:wrap;
  gap:4px 24px;
  margin-top:8px;
  font-size:.875rem
}
.detail-grid {
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:22px;
  margin:22px 0 0
}
.detail-grid>div {
  min-width:0
}
.detail-grid dt {
  color:var(--muted);
  font-size:.875rem;
  margin-bottom:5px
}
.detail-grid dd {
  margin:0;
  overflow-wrap:anywhere;
  font-size:.88rem
}
.detail-full {
  grid-column:1/-1
}
.detail-span-two {
  grid-column:span 2
}
.internal-id {
  font-size:.875rem!important;
  color:var(--muted);
  overflow-wrap:anywhere
}
.access-code {
  font-weight:600;
  letter-spacing:.025em;
  overflow-wrap:anywhere
}
.patient-details-grid {
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:20px
}
.patient-identification {
  grid-column:1/-1;
  border-top:3px solid var(--blue-mid)
}
.patient-identification h2 {
  margin-bottom:12px
}
.record-contact {
  grid-template-columns:repeat(2,minmax(0,1fr))
}
.record-address {
  grid-template-columns:1fr
}
.access-panel {
  background:var(--secondary);
  border-color:#c1d3e0;
  box-shadow:none
}
.publication-note {
  border-top:1px solid var(--line);
  margin-top:24px;
  padding-top:19px
}
.publication-note strong {
  color:var(--blue);
  font-size:.92rem
}
.publication-note p {
  font-size:.875rem;
  color:var(--muted);
  margin:6px 0 0;
  max-width:72ch
}
.document-withdrawn-note {
  background:#edf0f3;
  border-left:4px solid #657789;
  padding:16px 18px;
  border-radius:4px
}
.danger-zone {
  border-top:1px solid var(--line);
  padding-top:20px;
  margin-top:32px;
  color:var(--muted);
  font-size:.875rem
}
.danger-zone p {
  margin-bottom:3px;
  max-width:75ch
}
.text-danger {
  display:inline-flex;
  align-items:center;
  min-height:44px;
  color:var(--danger);
  font-weight:600;
  font-size:.875rem
}
.audit-list {
  list-style:none;
  margin:20px 0 0;
  padding:0 0 0 20px;
  border-left:2px solid #bfcfd9
}
.audit-list li {
  position:relative;
  padding-bottom:22px
}
.audit-list li::before {
  content:'';
  position:absolute;
  width:8px;
  height:8px;
  background:#7297ad;
  border:2px solid var(--soft);
  border-radius:50%;
  left:-25px;
  top:6px
}
.audit-list li strong {
  display:block;
  color:var(--blue);
  font-size:.875rem
}
.audit-list li span {
  color:var(--muted);
  font-size:.875rem;
  display:block
}
.audit-list p {
  font-size:.875rem;
  margin:6px 0 0
}
.document-summary {
  margin-bottom:24px;
  padding:20px 24px;
  background:white;
  border:1px solid var(--line);
  border-radius:6px
}
.document-summary>strong {
  display:block;
  color:var(--blue);
  font-size:1.05rem;
  overflow-wrap:anywhere
}
.document-summary p {
  margin:8px 0;
  color:var(--muted);
  font-size:.875rem
}
.document-summary a {
  font-size:.875rem
}
.state-legend {
  display:flex;
  flex-wrap:wrap;
  gap:6px 22px;
  margin:18px 0 24px;
  padding:15px 18px;
  color:var(--muted);
  background:#e2ecf3;
  border-radius:5px;
  font-size:.875rem
}
.state-legend strong {
  color:var(--blue)
}
.role-guide {
  padding:14px 18px;
  background:var(--soft);
  border:1px solid var(--line);
  border-radius:5px;
  margin-top:18px
}
.role-guide summary {
  cursor:pointer;
  min-height:28px;
  color:var(--blue);
  font-size:.875rem;
  font-weight:600
}
.role-guide dl {
  margin:18px 0 0
}
.role-guide dl>div+div {
  border-top:1px solid var(--line);
  padding-top:12px;
  margin-top:12px
}
.role-guide dt {
  font-size:.875rem;
  font-weight:650;
  color:var(--blue)
}
.role-guide dd {
  margin:4px 0 0;
  color:var(--muted);
  font-size:.875rem
}
.credential-instructions {
  padding:20px;
  border:1px dashed #9aafbd;
  border-radius:5px;
  overflow-wrap:anywhere
}
.credential-instructions p {
  font-size:.88rem
}
.credential-instructions p:last-child {
  margin-bottom:0
}
.initial-password {
  font-size:1.05rem;
  overflow-wrap:anywhere
}
.copy-feedback {
  color:var(--green);
  font-size:.875rem;
  margin-top:16px
}
/* Entradas e resultados */
.auth-layout {
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:32px;
  align-items:start;
  max-width:1030px;
  margin:8px auto 28px
}
.auth-intro {
  background:var(--blue);
  padding:36px;
  border-radius:12px;
  min-height:475px
}
.auth-intro .section-label {
  color:#b7d5e4;
  margin-bottom:14px
}
.auth-intro h1 {
  color:white;
  font-size:clamp(1.8rem,3vw,2.5rem);
  margin-bottom:22px
}
.auth-intro>p {
  color:#dae8f1;
  font-size:.98rem
}
.support-note {
  border-left:3px solid #65c894;
  padding-left:18px;
  margin-top:36px;
  font-size:.875rem
}
.support-note strong {
  color:white
}
.support-note p {
  color:#c7dce9;
  margin:8px 0 0
}
.auth-panel {
  padding:30px;
  border-top:3px solid var(--green)
}
.auth-panel h2 {
  font-size:1.4rem
}
.auth-panel>.muted {
  font-size:.9rem;
  margin-bottom:24px
}
.auth-panel .back-link {
  margin:18px 0 0
}
.support-note-mobile {
  display:none
}
.alternate-login {
  border-top:1px solid var(--line);
  padding-top:18px;
  margin:22px 0 0;
  font-size:.875rem;
  color:var(--muted)
}
.patient-greeting {
  font-size:1.15rem;
  font-weight:600;
  color:var(--blue)!important;
  margin-bottom:8px!important
}
.patient-app .page-heading {
  padding-left:20px;
  border-left:4px solid var(--green)
}
.result-list { display:grid; gap:var(--space-4); }

.result-item { background:white; box-shadow:var(--shadow); }

.pdf-badge { flex:0 0 48px; width:48px; height:60px; display:flex; align-items:center; justify-content:center; border:1px solid #b5cddd; border-radius:4px 12px 4px 4px; font-size:.875rem; font-weight:700; letter-spacing:.04em; }


.result-info {
  flex:1;
  min-width:0
}


.result-info p {
  margin:0;
  font-size:.875rem;
  color:var(--muted)
}
.result-actions { flex-shrink:0; }


.empty-state .pdf-badge {
  margin:0 auto 24px
}
.page-note {
  font-size:.875rem;
  color:var(--muted);
  margin:24px 0 0
}
.error-page {
  max-width:600px;
  text-align:center;
  margin:45px auto
}
.error-page p {
  color:var(--muted);
  margin:18px auto 28px
}
/* Entrada fotografica e impressao */
.home-page {
  background:white;
  padding:0
}
.home-stage {
  position:relative;
  min-height:100vh;
  min-height:100svh;
  overflow:hidden;
  isolation:isolate
}
.home-photo {
  position:absolute;
  inset:0;
  z-index:-1;
  width:100%;
  height:100%;
  object-fit:cover;
  object-position:50% 44%
}
.home-panel {
  position:absolute;
  left:40px;
  top:40px;
  width:288px;
  padding:28px;
  border-radius:10px;
  background:white;
  box-shadow:0 8px 32px rgba(16,54,83,.16)
}
.home-logo {
  width:232px
}
.home-access {
  border-top:1px solid var(--line);
  padding-top:20px;
  margin-top:24px
}
.home-access h1 {
  font-weight:600;
  letter-spacing:0;
  color:var(--muted);
  font-size:.875rem;
  margin:0 0 12px
}
.home-bottom {
  position:absolute;
  left:40px;
  right:40px;
  bottom:max(28px,env(safe-area-inset-bottom));
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:18px;
  font-size:.875rem
}
.home-bottom>a,.home-bottom>span {
  background:white;
  border-radius:4px;
  padding:7px 12px
}
.home-bottom>a {
  min-height:38px;
  display:inline-flex;
  align-items:center
}
.print-page { padding:0; }

.print-controls { justify-content:space-between; margin-bottom:26px; }


.print-controls .back-link {
  margin:0
}
.print-brand { padding-bottom:24px; }

.print-brand img { flex:0 0 145px; }

.print-brand h1 { margin:0 0 8px; }


.print-brand p {
  color:var(--muted);
  margin:0
}
/* Adaptacao por largura */
@media(max-width:1200px) {
  .heading-with-action {
    align-items:flex-start
  }
  .heading-with-action>.action-group {
    max-width:40%
  }
.result-item { flex-wrap:wrap; }


  .result-info {
    flex-basis:calc(100% - 70px)
  }
.result-actions { margin-left:68px; }


}
@media(max-width:1023px) {
  .page-shell {
    padding:28px 24px
  }
  .site-footer {
    width:calc(100% - 48px)
  }
  .responsive-table {
    display:block
  }
  .table-frame:has(.responsive-table) {
    border:0;
    background:none;
    overflow:visible
  }
  .responsive-table thead {
    position:absolute;
    width:1px;
    height:1px;
    margin:-1px;
    overflow:hidden;
    clip:rect(0,0,0,0);
    white-space:nowrap
  }
  .responsive-table tbody {
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:var(--space-4)
  }
  .responsive-table tr {
    display:block;
    min-width:0;
    border:1px solid var(--line);
    border-radius:8px;
    padding:16px 20px;
    background:white
  }
  .responsive-table td {
    display:block;
    width:100%;
    padding:6px 0;
    border:0
  }
  .responsive-table td[data-label]::before {
    content:attr(data-label);
    display:block;
    color:var(--muted);
    font-size:.875rem;
    margin-bottom:3px
  }
  .responsive-table td.table-action {
    text-align:left;
    padding-top:10px
  }
}
@media(max-width:767px) {
  .header-inner {
    width:calc(100% - 40px);
    gap:18px
  }
  .brand {
    flex-basis:112px
  }
  .brand img {
    width:112px
  }
  .main-nav {
    gap:10px
  }
  .main-nav a,.nav-button {
    font-size:.875rem
  }
  .page-shell,.public-app .page-shell,.patient-app .page-shell {
    padding:26px 20px 40px
  }
  .site-footer {
    width:calc(100% - 40px)
  }
  .heading-with-action {
    flex-direction:column;
    gap:var(--space-4)
  }
  .heading-with-action>.action-group {
    max-width:100%
  }
  .panel {
    padding:22px
  }
  .detail-grid {
    grid-template-columns:repeat(2,minmax(0,1fr))
  }
  .patient-details-grid {
    grid-template-columns:1fr
  }
  .patient-identification {
    grid-column:auto
  }
  .form-section legend {
    font-size:1.05rem
  }
  .section-fields {
    grid-template-columns:minmax(0,1fr);
  }
  .section-fields .form-field {
    grid-column:auto;
  }
  .search-form {
    flex-wrap:wrap
  }
  .search-form .form-field,.filter-form .search-field,.filter-form .filter-field {
    flex-basis:100%;
    max-width:none;
    min-width:0
  }
  .stats-grid {
    gap:var(--space-3)
  }
  .stat {
    padding:18px
  }
  .stat>.icon {
    position:static;
    margin-bottom:10px
  }
  .stat strong {
    font-size:1.8rem
  }
  .section-heading {
    flex-wrap:wrap;
    gap:14px
  }
  .table-frame {
    border:0;
    background:none;
    overflow:visible
  }
  .responsive-table {
    display:block
  }
  .responsive-table thead {
    position:absolute;
    width:1px;
    height:1px;
    margin:-1px;
    overflow:hidden;
    clip:rect(0,0,0,0);
    white-space:nowrap
  }
  .responsive-table tbody {
    display:grid;
    gap:14px
  }
  .responsive-table tr {
    display:block;
    min-width:0;
    background:white;
    border:1px solid var(--line);
    border-radius:8px;
    padding:16px 18px
  }
  .responsive-table td {
    display:block;
    width:100%;
    padding:6px 0;
    border:0
  }
  .responsive-table td[data-label]::before {
    content:attr(data-label);
    display:block;
    color:var(--muted);
    font-size:.875rem;
    margin-bottom:3px
  }
  .responsive-table td.table-action {
    text-align:left;
    padding-top:10px
  }
.staff-table th:first-child { width:auto; }
.staff-table th:last-child { width:auto; }
.audit-table th:first-child { width:auto; }

  .auth-layout {
    grid-template-columns:1fr;
    max-width:520px;
    gap:var(--space-5);
    margin-top:0
  }
  .auth-intro {
    min-height:auto;
    background:none;
    padding:0;
    border-radius:0
  }
  .auth-intro h1 {
    color:var(--blue);
    font-size:1.85rem;
    margin-bottom:12px
  }
  .auth-intro h1 br {
    display:none
  }
  .auth-intro>p {
    color:var(--muted);
    margin-bottom:0;
    font-size:.94rem
  }
  .auth-intro .section-label {
    color:var(--blue-mid);
    margin-bottom:8px
  }
  .auth-intro .support-note {
    display:none
  }
  .auth-panel .support-note-mobile {
    display:block;
    margin-top:24px
  }
  .support-note-mobile strong {
    color:var(--blue)
  }
  .support-note-mobile p {
    color:var(--muted)
  }
  .auth-panel {
    padding:var(--space-5)
  }
  .home-panel {
    left:20px;
    top:20px;
    right:20px;
    width:auto;
    padding:16px 20px;
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:20px
  }
  .home-logo {
    width:155px;
    max-width:52%
  }
  .home-access {
    border-top:0;
    border-left:1px solid var(--line);
    margin:0;
    padding:0 0 0 18px
  }
  .home-access p {
    font-size:.875rem
  }
  .home-bottom {
    left:20px;
    right:20px;
    bottom:max(18px,env(safe-area-inset-bottom))
  }
  .home-bottom>span {
    display:none
  }
  .home-bottom>a {
    margin-left:auto
  }
  .home-photo {
    object-position:50% 50%
  }


}
@media(max-width:600px) {
  .header-inner {
    flex-wrap:wrap;
    justify-content:space-between
  }
  .patient-app .header-inner {
    justify-content:center;
    gap:4px;
    padding-bottom:0
  }
  .patient-app .main-nav {
    width:100%;
    justify-content:space-between
  }
  .site-footer {
    flex-direction:column;
    gap:2px
  }
  .responsive-table tbody {
    grid-template-columns:minmax(0,1fr)
  }
  .section-fields {
    grid-template-columns:minmax(0,1fr)
  }
  .section-fields .form-field {
    grid-column:auto
  }
  .detail-grid,.record-contact {
    grid-template-columns:1fr;
    gap:18px
  }
  .detail-span-two {
    grid-column:auto
  }
  .action-group {
    width:100%
  }
  .action-group .button {
    flex:1;
    font-size:.875rem;
    padding:9px 12px
  }
  .form-actions .button {
    width:100%
  }
  .stats-grid {
    gap:8px
  }
  .stat {
    padding:15px 12px
  }
  .stat>span {
    font-size:.875rem
  }
  .stat>strong {
    font-size:1.65rem
  }
  .stat>.icon {
    width:32px;
    height:32px;
    padding:7px
  }
  .quick-actions {
    grid-template-columns:1fr;
    gap:var(--space-3)
  }



  .identity-details {
    flex-direction:column;
    gap:4px
  }


  .result-item>.pdf-badge {
    flex-basis:38px;
    width:38px;
    height:50px;
    font-size:.875rem
  }
  .result-info {
    flex-basis:calc(100% - 55px)
  }
.result-actions { width:100%; }

.result-actions .button { flex:1; }


  .file-size {
    display:block
  }
.print-brand { flex-direction:column; }

.print-brand img { flex-basis:auto; }


}
@media(max-width:375px) {
  .page-shell,.public-app .page-shell,.patient-app .page-shell {
    padding-left:16px;
    padding-right:16px
  }
  .panel {
    padding:20px 18px
  }
  .home-panel {
    left:16px;
    right:16px;
    top:16px;
    padding:14px;
    gap:var(--space-3)
  }
  .home-logo {
    width:138px
  }
  .home-access {
    padding-left:12px
  }
  .home-access .button {
    font-size:.875rem;
    padding:10px 12px
  }
  .home-bottom {
    left:16px;
    right:16px
  }
  .header-caption {
    max-width:130px;
    text-align:right;
    font-size:.875rem
  }
}
@media(prefers-reduced-motion:reduce) {
  html {
    scroll-behavior:auto
  }
  *,*::before,*::after {
    transition-duration:.01ms!important;
    animation-duration:.01ms!important
  }
  .button[aria-busy='true']::before {
    animation:none
  }
}
@media print {
  .app-header { display: none !important; }
  @page {
    size:A4;
    margin:14mm
  }
body { display:block; min-height:auto; padding:0; background:white; color:#203544; }
.print-page { display:block; min-height:auto; padding:0; }


.site-header { display:none!important; }
.site-footer { display:none!important; }
.skip-link { display:none!important; }
.back-link { display:none!important; }
.form-actions { display:none!important; }

.page-shell { width:100%; max-width:none; margin:0; padding:0; }
.print-page .page-shell { margin:0; }

.print-brand { padding-bottom:12px; flex-direction:row; }

.print-brand img { flex-basis:105px; }

.print-page .patient-details-grid { gap:var(--space-3); grid-template-columns:repeat(2,minmax(0,1fr)); }


  .print-page .patient-identification {
    grid-column:1/-1
  }
.print-page .panel { break-inside:avoid; border-radius:0; }


  .print-page h2 {
    font-size:12pt;
    margin-bottom:12px
  }
.print-page .detail-grid { gap:var(--space-3) 18px; margin-top:12px; grid-template-columns:repeat(3,minmax(0,1fr)); }


  .print-page .record-contact,.print-page .record-address {
    grid-template-columns:1fr
  }




}
.legacy-address {
  grid-column:1/-1
}

@media (max-width: 767px) {
  input:not([type='checkbox']):not([type='radio']):not([type='hidden']), select, textarea {
    font-size: 16px;
  }
}

/* Espaco proporcional para perfil e situacao da equipe em desktop. */
.staff-table th:nth-child(3) {
  width:19%;
}
.staff-table th:nth-child(4) {
  width:12%;
}
.staff-table th:nth-child(5) {
  width:16%;
}

/* Integrated B: one real master/detail workspace using the shared components. */
.page-shell:has(.desk-layout) {
  max-width: none;
  padding: 0;
}
.page-shell:has(.desk-layout) > .messages {
  margin: 0;
  padding: 20px 28px 0;
}
.desk-layout { display: grid; grid-template-columns: 300px minmax(0, 1fr); min-height: calc(100vh - var(--header-height)); align-items: start; }

.patient-desk { min-width: 0; border-right: 1px solid var(--line); }

.patient-desk-disclosure > summary { display: none; }


.desk-list-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 20px;
}
.desk-list-heading h2 {
  margin: 0;
  font-size: 1.08rem;
}
.desk-create {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  min-height: 36px;
  font-size:.875rem;
  font-weight: 600;
}
.desk-create .icon {
  width: 15px;
  height: 15px;
  flex-basis: 15px;
}
.desk-search label {
  display: block;
  font-size:.875rem;
  color: var(--blue);
  font-weight: 600;
  margin-bottom: 7px;
}
.desk-search-row {
  display: flex;
  align-items: center;
  gap: 7px;
}
.desk-search-row input {
  flex: 1;
  font-size:.875rem !important;
  min-width: 0;
  padding: 9px 10px !important;
}
.desk-search-row .icon-button {
  flex: 0 0 42px;
  width: 42px;
}
.desk-clear {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  margin-top: 4px;
  font-size:.875rem;
}
.desk-selection-help {
  margin: 12px 0 18px;
  color: var(--muted);
  font-size:.875rem;
}
.desk-count {
  margin: 0 0 8px;
  font-size:.875rem;
  color: var(--muted);
}
.desk-patient { align-items: flex-start; border-top: 1px solid var(--line); border-left: 3px solid transparent; }

.desk-patient:hover { color: var(--blue); }

.desk-patient.is-selected { border-left-color: var(--green); }


.desk-person-mark {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  border-radius: 4px;
  background: #e0eee6;
  color: var(--green);
  font-size:.875rem;
  font-weight: 650;
}
.desk-person-copy {
  display: block;
  min-width: 0;
}
.desk-person-copy strong { display: block; line-height: 1.45; margin-bottom: 7px; overflow-wrap: anywhere; }

.desk-person-copy > span { display: block; font-size:.875rem; line-height: 1.5; margin-top: 3px; overflow-wrap: anywhere; }

.desk-person-copy > .selected-label { font-weight: 650; }


.desk-pagination {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  border-top: 1px solid var(--line);
  margin-top: 12px;
  padding-top: 12px;
  font-size:.875rem;
}
.desk-pagination a {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
}
.desk-pagination span {
  color: var(--muted);
}
.desk-empty {
  padding: 20px 0;
}
.desk-empty strong {
  font-size: .88rem;
  color: var(--blue);
}
.desk-empty p {
  color: var(--muted);
  font-size:.875rem;
  margin: 8px 0 0;
}
.desk-filter-notice {
  border-left: 3px solid #a67513;
  padding: 12px 13px;
  background: #fff4dc;
  color: #73500d;
  margin-bottom: 18px;
  font-size:.875rem;
}
.desk-filter-notice strong,
.desk-filter-notice span {
  display: block;
}
.desk-filter-notice span {
  margin-top: 5px;
}
.desk-mobile-outside {
  display: none;
}
.desk-detail { min-width: 0; background: var(--soft); }

.desk-detail .back-link {
  margin-bottom: 18px;
}
.desk-welcome {
  max-width: 760px;
  padding: 0;
}
.desk-welcome h1 {
  font-size: clamp(1.6rem, 2.3vw, 2rem);
}
.desk-welcome p:last-child {
  max-width: 64ch;
  color: var(--muted);
  font-size: .9rem;
  margin-bottom: 0;
}
.desk-shortcuts {
  display: grid;
  gap: 0;
  max-width: 720px;
  margin: 24px 0 0;
  border-top: 1px solid var(--line);
}
.desk-shortcuts > a {
  display: flex;
  gap: 15px;
  align-items: flex-start;
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
}
.desk-shortcuts .icon {
  margin-top: 3px;
}
.desk-shortcuts strong,
.desk-shortcuts span > span {
  display: block;
}
.desk-shortcuts strong {
  color: var(--blue);
  font-size: .9rem;
}
.desk-shortcuts span > span {
  margin-top: 4px;
  color: var(--muted);
  font-size:.875rem;
}
.patient-summary-heading { display: flex; justify-content: space-between; }

.patient-summary-heading > div {
  min-width: 0;
}


.patient-summary-heading > .status { flex-shrink: 0; }

.patient-summary-identity { display: flex; flex-wrap: wrap; }

.patient-summary-contact { display: flex; flex-wrap: wrap; gap: 5px 18px; }

.patient-summary-identity strong { font-weight: 600; }



.patient-access-summary { display: flex; flex-wrap: wrap; align-items: center; }




.record-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px 18px;
  padding: 22px 0 24px;
}
.record-actions .button {
  font-size:.875rem;
  padding: 9px 13px;
}
.record-text-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  font-size:.875rem;
  font-weight: 600;
}
.record-text-action .icon {
  width: 16px;
  height: 16px;
  flex-basis: 16px;
}
.record-documents { margin-top: 26px; }



.record-documents .result-count {
  margin: 0;
}
.section-description {
  color: var(--muted);
  font-size:.875rem;
  max-width: 72ch;
  margin-bottom: 20px;
}
.document-filters {
  padding: 19px 20px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 6px;
  margin-bottom: 24px;
}
.filter-date-help {
  font-size:.875rem;
  color: var(--muted);
  margin-bottom: 17px;
}
.document-filter-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 15px;
}
.document-filter-fields .form-errors,
.document-filter-fields .field-doc_q {
  grid-column: 1 / -1;
}
.document-filter-fields .form-field {
  margin-bottom: 15px;
}
.document-filter-fields input,
.document-filter-fields select {
  font-size:.875rem;
}
.filter-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 18px;
}
.filter-actions .button,
.filter-actions a {
  font-size:.875rem;
}
.filter-actions a {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
}
.record-document-row { display: flex; gap: 15px; align-items: center; }

.record-document-copy { min-width: 0; flex: 1; }



.record-document-copy > p { font-size:.875rem; color: var(--muted); }

.document-state-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px 12px;
}
.document-state-line > span:last-child {
  font-size:.875rem;
  color: var(--muted);
}
.record-document-row > .button { flex-shrink: 0; }

.record-data-details {
  margin-top: 32px;
  padding: 20px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.record-data-details > summary {
  color: var(--blue);
  font-size: .92rem;
  font-weight: 600;
  min-height: 32px;
  cursor: pointer;
}
.record-data-details .patient-details-grid {
  margin-top: 22px;
  gap: 16px;
}
.record-data-details .panel {
  padding: 20px;
  box-shadow: none;
}
.registration-only-note {
  border-left: 3px solid var(--blue);
  padding: 15px 20px;
  background: var(--secondary);
  margin-top: 24px;
}
.registration-only-note h2 {
  font-size: 1.05rem;
  margin-bottom: 8px;
}
.registration-only-note p {
  color: var(--muted);
  font-size:.875rem;
  margin: 0;
}
.access-grant {
  border: 1px solid #aacdbb;
  border-left: 4px solid var(--green);
  padding: 18px 20px;
  margin: 15px 0 0;
  border-radius: 5px;
  background: #edf7f1;
}
.access-grant legend {
  color: var(--green);
  font-size: 1rem;
  font-weight: 650;
  padding: 0 7px;
}
.access-grant .form-field {
  margin: 0;
}
.access-grant > p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size:.875rem;
}
.credential-panel {
  margin: 24px 0;
  border-top: 3px solid var(--green);
}
.credential-heading {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 22px;
}
.credential-heading > .icon {
  width: 34px;
  height: 34px;
  padding: 6px;
  flex-basis: 34px;
  background: #e4f2e9;
  border-radius: 50%;
  color: var(--green);
}
.credential-heading h2 {
  margin-bottom: 0;
  font-size: 1.2rem;
}
.copy-fallback {
  display: block;
  min-height: 160px;
  margin-top: 16px;
  white-space: pre-wrap;
}
.file-selection {
  padding: 16px 18px;
  margin-top: 14px;
  background: var(--secondary);
  border: 1px solid #b7ccda;
  border-radius: 6px;
}
.file-selection strong {
  color: var(--blue);
  display: block;
  font-size: .9rem;
  overflow-wrap: anywhere;
}
.file-selection [data-file-size] {
  display: block;
  color: var(--muted);
  font-size:.875rem;
  margin: 5px 0 12px;
}
.file-selection-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 18px;
}
.file-selection-actions button {
  min-height: 36px;
  font-size:.875rem;
}
.file-remove {
  display: inline-flex;
  align-items: center;
  padding: 4px 0;
  border: 0;
  background: none;
  color: var(--blue);
  text-decoration: underline;
}
@media (max-width: 1200px) {
.desk-layout { grid-template-columns: 268px minmax(0, 1fr); }







.record-document-row { flex-wrap: wrap; }

.record-document-copy { flex-basis: calc(100% - 70px); }

.record-document-row > .button { margin-left: 63px; }

}
@media (max-width: 900px) {
.desk-layout { grid-template-columns: minmax(0, 1fr); }

.patient-desk { overflow: visible; border-right: 0; border-bottom: 1px solid var(--line); }

.patient-desk-disclosure > summary { display: list-item; min-height: 44px; padding: 9px 0; font-size: .92rem; font-weight: 600; cursor: pointer; }


  .patient-desk-disclosure[open] > summary {
    margin-bottom: 18px;
  }
.desk-patient-list { margin-left: -24px; margin-right: -24px; }

.desk-patient { padding-left: 24px; padding-right: 24px; }



  .desk-mobile-outside {
    display: block;
  }
  .desk-search-row input {
    font-size: 16px !important;
  }
}
@media (max-width: 600px) {
.desk-patient-list { margin-left: -20px; margin-right: -20px; }

.desk-patient { padding-left: 20px; padding-right: 20px; }



.patient-summary-identity { flex-direction: column; }

.patient-summary-contact { flex-direction: column; gap: 6px; }



  .record-actions {
    gap: 8px 16px;
  }
  .record-actions > .button {
    flex: 0 1 auto;
    min-width: 156px;
    max-width: 100%;
    padding: 10px 12px;
    overflow-wrap: normal;
    word-break: normal;
  }
  .document-filter-fields {
    grid-template-columns: minmax(0, 1fr);
  }
  .document-filter-fields .form-field {
    grid-column: auto;
  }
  .document-filters {
    padding: 18px;
  }
  .record-document-row .pdf-badge {
    flex-basis: 38px;
    width: 38px;
    height: 50px;
    font-size:.875rem;
  }
.record-document-copy { flex-basis: calc(100% - 55px); }

.record-document-row > .button { margin-left: 53px; }

  .credential-panel {
    padding: 20px 18px;
  }
}
@media (max-width: 375px) {
.patient-desk { padding-left: 16px; padding-right: 16px; }

.desk-patient-list { margin-left: -16px; margin-right: -16px; }

.desk-patient { padding-left: 16px; padding-right: 16px; }

.desk-detail { padding-left: 16px; padding-right: 16px; }

}
@media print {
.patient-desk { display: none !important; }

.record-actions { display: none !important; }
.document-filters { display: none !important; }
.credential-panel { display: none !important; }
.desk-layout { display: block; }

.desk-detail { background: white; }

}


.desk-current-selection {
  padding: 14px 16px;
  margin: 18px 0;
  background: var(--secondary);
  border-left: 3px solid var(--green);
  color: var(--muted);
  font-size:.875rem;
}
.desk-current-selection strong {
  display: block;
  color: var(--blue);
  margin-bottom: 4px;
}
.desk-welcome .button { margin-top: 8px; }
.desk-unselected .desk-welcome,
.desk-unselected .desk-shortcuts { max-width: 760px; }
@media (min-width: 1600px) {
.desk-layout { grid-template-columns: 332px minmax(0, 1fr); }

}



/* Evolução operacional: identidade, leitura e ações com hierarquia comum. */
:root { --content-gap: 24px; --surface-raised: #ffffff; --surface-guidance: #e3edf3; }
.user-avatar { overflow: hidden; }
.user-avatar img { display: block; width: 100%; height: 100%; object-fit: cover; }
.heading-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.clinic-footer { margin-top: auto; background: var(--header-blue); color: #fff; border-top: 5px solid var(--green); }
.clinic-footer-inner, .clinic-footer-bottom { max-width: 1440px; margin: auto; padding: 30px 36px; }
.clinic-footer-inner { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(240px, 1fr); gap: 48px; }
.clinic-footer .section-label { color: #cce6d7; }
.clinic-footer h2 { color: #fff; font-size: 1.1rem; max-width: 42ch; margin: 5px 0 10px; }
.clinic-footer p { color: #e4ece8; font-size: .875rem; margin: 0; max-width: 65ch; }
.clinic-footer a { color: #fff; text-underline-offset: 4px; overflow-wrap: anywhere; }
.clinic-footer :focus-visible { outline-color: #fff; }
.clinic-contact { display: flex; flex-direction: column; gap: 10px; justify-content: center; }
.clinic-footer-bottom { display: flex; justify-content: space-between; gap: 16px; padding-top: 16px; padding-bottom: 16px; border-top: 1px solid #69838d; color: #e4ece8; font-size: .8125rem; }
.patient-app .page-shell { width: 100%; max-width: 1200px; }
.results-intro { grid-template-columns: minmax(0, 1.25fr) minmax(260px, 1fr); border-left: 5px solid var(--green); border-radius: var(--radius); }

.results-intro h1 { margin: 4px 0 10px; }


.results-intro p { color: var(--muted); margin: 0; max-width: 48ch; }
.results-owner { display: flex; flex-direction: column; padding-left: 28px; gap: 4px; min-width: 0; }

.results-owner strong { overflow-wrap: anywhere; }

.results-owner > span:last-child { font-size: .875rem; }


.results-heading { margin-bottom: 16px; }
.result-list { gap: 20px; }

.result-item { flex-direction: column; flex-wrap: nowrap; min-width: 0; border-top: 4px solid var(--green); box-shadow: 0 3px 12px #17394908; }

.result-card-heading { align-items: center; gap: 12px; flex-wrap: wrap; }

.result-card-heading .pdf-badge { font-size: .75rem; }

.result-card-heading .section-label { flex: 1; overflow-wrap: anywhere; min-width: 80px; }

.result-card-heading .status { font-size: .75rem; }

.result-info h2 { line-height: 1.45; overflow-wrap: anywhere; }

.result-metadata { display: flex; flex-wrap: wrap; margin: 0; }


.result-metadata dt { font-size: .8125rem; color: var(--muted); }
.result-metadata dd { font-size: .9375rem; font-weight: 600; margin: 2px 0 0; }
.result-info { flex: 1 1 auto; width: 100%; }
.result-actions { margin-top: auto; margin-left: 0; min-width: 0; padding-top: 18px; border-top: 1px solid var(--line); }

.result-actions .button { flex: 1; justify-content: center; }

.results-guidance { display: flex; align-items: baseline; margin-top: 10px; }


.results-guidance strong { flex-shrink: 0; font-size: .875rem; }
.results-guidance p { margin: 0; font-size: .875rem; color: var(--muted); max-width: 85ch; }
.results-empty { border: 1px solid var(--line); background: white; }


.patient-context { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; border-radius: var(--radius-sm); font-size: .875rem; }


.patient-context strong { overflow-wrap: anywhere; color: var(--blue); }
.patient-context > span:last-child { color: var(--muted); }







.record-document-copy h2 { font-size: 1rem; }
.batch-policy { border-radius: var(--radius-sm); }

.batch-policy p { color: var(--muted); }

.batch-document { background: white; border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 20px; }

.batch-item-heading { display: flex; justify-content: space-between; align-items: center; gap: 15px; padding-bottom: 16px; margin-bottom: 20px; }

.batch-item-heading h2 { margin: 0; }

.batch-item-heading button { min-height: 44px; font: inherit; font-size: .875rem; cursor: pointer; }

.batch-fields { display: grid; }


.batch-fields .field-title, .batch-fields .field-file { grid-column: 1 / -1; }


.js .batch-delete { display: none; }
.batch-add-row { display: flex; flex-wrap: wrap; align-items: center; gap: 15px; }
.batch-add-row p { font-size: .875rem; color: var(--muted); margin: 0; }
.batch-submit { border-top: 1px solid var(--line); padding-top: 24px; }


.batch-document [type="file"] { background: var(--soft); }
.audit-filters { margin: 24px 0 30px; background: var(--secondary); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.dashboard-overview { border-radius: var(--radius); }


.audit-filter-fields { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0 18px; }
.audit-filter-fields .field-q { grid-column: span 2; }
.audit-filter-fields > .message, .audit-filter-fields > [data-form-error] { grid-column: 1 / -1; }
.metric-period { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 16px; margin-bottom: 22px; }
.metric-period-fields { display: flex; gap: 16px; flex-wrap: wrap; }
.metric-period .form-field { margin-bottom: 0; }
.metric-period .filter-actions { margin: 0; padding-bottom: 2px; }
.metric-card { flex-direction: column; }


.metric-card > span { color: var(--muted); font-size: .875rem; }
.metric-card > strong { font-variant-numeric: tabular-nums; }


.metric-card p { font-size: .8125rem; color: var(--muted); margin: 6px 0 12px; }
.metric-card a { margin-top: auto; font-size: .875rem; }
.profile-summary { display: flex; align-items: center; gap: 24px; padding: 24px; background: var(--secondary); border-radius: var(--radius); margin-bottom: 24px; }
.profile-summary > div { min-width: 0; }
.profile-summary h2 { overflow-wrap: anywhere; }
.profile-summary p { color: var(--muted); margin: 4px 0 12px; }
.profile-avatar { width: 88px; height: 88px; flex: 0 0 88px; display: grid; place-items: center; border-radius: 50%; overflow: hidden; background: var(--blue); color: white; font-size: 2rem; }
.profile-avatar img { width: 100%; height: 100%; object-fit: cover; }
.profile-readonly { display: flex; gap: 12px 30px; flex-wrap: wrap; margin: 0; }
.profile-readonly dt { font-size: .8125rem; color: var(--muted); }
.profile-readonly dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.permission-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.permission-card { padding: 24px; background: white; border: 1px solid var(--line); border-top: 4px solid var(--green); border-radius: var(--radius); }
.permission-card > p { color: var(--muted); font-size: .9375rem; }
.permission-list { list-style: none; margin: 20px 0; padding: 0; }
.permission-list li { display: flex; justify-content: space-between; gap: 18px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: .875rem; }
.permission-list strong { flex-shrink: 0; font-size: .8125rem; }
.permission-allowed strong { color: var(--green); }
.permission-denied strong { color: var(--muted); }
.permission-options { margin: 0; padding: 0; border: 0; min-width: 0; }
.permission-options legend { font-weight: 700; font-size: 1.05rem; margin-bottom: 14px; }
.permission-option { display: flex; align-items: flex-start; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.permission-option input { flex: 0 0 20px; width: 20px; height: 20px; margin-top: 3px; accent-color: var(--green); }
.permission-option label { cursor: pointer; }
.permission-reserved { background: var(--secondary); padding: 20px; margin-top: 24px; border-radius: var(--radius-sm); }
.permission-reserved ul { margin-bottom: 0; }
@media (min-width: 1101px) {
.patient-context { position: sticky; top: calc(var(--header-height) + 8px); z-index: 4; box-shadow: 0 3px 8px #1739490d; }


  .desk-detail :is(input, select, textarea, button, a) { scroll-margin-top: calc(var(--header-height) + 110px); }
}
@media (max-width: 900px) {
  .patient-app .page-shell { width: 100%; }
.results-intro { grid-template-columns: 1fr; }

.results-owner { border-top: 1px solid #afc8b8; }




  .audit-filter-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .permission-grid { grid-template-columns: minmax(0, 1fr); }
  .clinic-footer-inner { grid-template-columns: minmax(0, 1fr); gap: 22px; }
}
@media (max-width: 600px) {
  .clinic-footer-inner, .clinic-footer-bottom { padding-left: 22px; padding-right: 22px; }
  .clinic-footer-bottom { flex-direction: column; gap: 5px; }
.result-actions { grid-template-columns: 1fr; width: 100%; }

.result-card-heading { gap: 10px; }

.results-guidance { display: block; }


  .results-guidance p { margin-top: 7px; }
.audit-filters { padding: 18px; }
.permission-card { padding: 18px; }

.audit-filter-fields { grid-template-columns: minmax(0, 1fr); }

  .batch-fields .field-title, .batch-fields .field-file, .audit-filter-fields .field-q { grid-column: auto; }
.batch-item-heading { align-items: flex-start; }

.batch-item-heading h2 { padding-top: 8px; }

.batch-item-heading button { max-width: 130px; text-align: right; }


  .batch-add-row > button { width: 100%; }
  .profile-summary { align-items: flex-start; padding: 20px; gap: 16px; flex-wrap: wrap; }
  .profile-avatar { width: 64px; height: 64px; flex-basis: 64px; font-size: 1.5rem; }
  .metric-period, .metric-period-fields { display: grid; grid-template-columns: minmax(0, 1fr); width: 100%; }




  .permission-list li { flex-wrap: wrap; gap: 2px 12px; }
.patient-context { gap: 3px 8px; }


  .patient-context strong { flex-basis: 100%; }
}
@media print {
.clinic-footer { display: none !important; }
.patient-context { display: none !important; }

.batch-add-row { display: none !important; }
[data-batch-remove] { display: none !important; }



}.document-list-filters { display: grid; grid-template-columns: minmax(200px, 2fr) minmax(160px, 1fr); gap: 0 20px; padding: 22px; margin-bottom: 24px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--secondary); }
.document-period-fields { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(2, minmax(0, 240px)); gap: 0 20px; }
.document-period-fields > .filter-date-help, .document-period-fields > .form-errors { grid-column: 1 / -1; }
.document-list-filters > .filter-actions { grid-column: 1 / -1; margin: 0; }
@media (max-width: 600px) { .document-list-filters, .document-period-fields { grid-template-columns: minmax(0, 1fr); } .document-list-filters { padding: 18px; } }
.batch-final-recipient { margin-top: 24px; border: 1px solid #b3d2bf; border-left: 4px solid var(--green); border-radius: var(--radius-sm); }


.batch-final-recipient strong { display: block; margin: 5px 0; font-size: 1.05rem; overflow-wrap: anywhere; }
.batch-final-recipient p { color: var(--muted); font-size: .875rem; }

.batch-submit { border-top: 0; padding-top: 18px; margin-top: 0; }


@media (min-width: 1200px) {
.record-documents .document-filters { grid-template-columns: minmax(180px, 1.4fr) repeat(2, minmax(150px, 1fr)); }




  .record-documents .document-filters > .filter-date-help, .record-documents .document-filter-fields > .form-errors { grid-column: 1 / -1; }
  .record-documents .document-filter-fields .field-doc_q { grid-column: auto; }
  .record-documents .document-filters > .filter-actions { align-self: end; margin-bottom: 15px; gap: 4px 14px; }
}
/* Filtros, recibos e continuidade da conferência. */












.metric-caption { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 8px 20px; margin-top: 10px; }
.metric-caption > p, .filter-scope { color: var(--muted); font-size: .875rem; margin: 0; }
.compact-filters { min-width: 0; }
.compact-filters > summary { cursor: pointer; color: var(--blue); font-weight: 600; min-height: 44px; padding: 10px 0; }
.compact-filters[open] > summary { margin-bottom: 10px; }
.queue-count { min-width: 28px; vertical-align: middle; }






.dashboard-pending-item time { display: inline-block; }
.queue-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin-top: 10px; font-size: .875rem; color: var(--muted); }
.queue-footer a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; }
.document-state-tabs a span { font-variant-numeric: tabular-nums; }






.filter-scope { margin-bottom: 16px; }
.review-filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 18px; padding: 18px; background: #fff; }
.review-filters .search-field { flex: 1 1 300px; }
.review-filters .form-field, .review-filters .filter-actions { margin: 0; }
.review-filters .filter-extra { flex-basis: 100%; }
.patient-review-filters { display: block; background: #fff; }
.patient-review-filters > .form-field { max-width: 640px; }
.patient-review-filters .document-filter-fields { grid-template-columns: repeat(3,minmax(0,1fr)); }
.receipt-next { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 18px 20px; margin: 20px 0; background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--green); border-radius: 6px; }
.receipt-next > div { min-width: 0; }
.receipt-next h2 { font-size: 1.125rem; margin-bottom: 6px; }
.receipt-next p { color: var(--muted); margin: 0; max-width: 64ch; }
.receipt-next > .button { flex-shrink: 0; }
.upload-receipt .record-document-row { background: #fff; padding: 18px; }
.upload-receipt .record-document-copy h2 { font-size: 1rem; margin: 0 0 6px; overflow-wrap: anywhere; }
.review-continuation { display: flex; align-items: center; gap: 12px 24px; flex-wrap: wrap; padding: 18px 0; border-bottom: 1px solid var(--line); }
.review-continuation > a { min-height: 44px; display: inline-flex; align-items: center; }

@media (max-width: 600px) {
.document-state-tabs { grid-template-columns: repeat(2,minmax(0,1fr)); }




 .review-filters { padding: 14px; }
 .review-filters .form-field { flex-basis: 100%; min-width: 0; }
 .patient-review-filters .document-filter-fields { grid-template-columns: minmax(0,1fr); }
 .receipt-next { flex-direction: column; align-items: stretch; padding: 15px; }
 .receipt-next > .button { white-space: normal; }
 .review-continuation { align-items: stretch; flex-direction: column; gap: 8px; }
}

.staff-app label { font-size: .9375rem; }
.staff-app .button { font-size: 1rem; }
.record-document-copy .document-state-line { grid-column: 2; grid-row: 1 / 3; align-items: start; flex-direction: column; gap: 5px; }
.record-document-copy { display: grid; grid-template-columns: minmax(0,1.5fr) minmax(160px,1fr); column-gap: 20px; align-items: center; }
.batch-content .batch-fields .form-field { margin-bottom: 18px; }
.batch-content .file-selection-actions { grid-column: 2; grid-row: 1 / 3; margin: 0; align-items: center; }
.batch-content .file-selection [data-file-size] { grid-column: 1; margin: 4px 0 0; }
.batch-content .file-selection > strong { margin: 0; font-size: 1rem; }
.batch-content .file-selection { display: grid; grid-template-columns: minmax(0,1fr) auto; column-gap: 18px; padding: 14px 18px; }
.batch-content > .back-link { margin-bottom: 12px; }
.record-documents .document-filters > details[open] { flex-basis: 100%; order: 3; }
.patient-form-page > .back-link { margin-bottom: 12px; }
.patient-form-page .page-heading { margin-bottom: 20px; }
.registration-summary.panel { padding: 0 22px 22px; }
.patient-form-page .section-fields .field-phone_is_whatsapp { grid-column: 1 / -1; }
.patient-form-page .section-fields .field-phone_secondary { grid-column: span 3; }
.patient-form-page .group-help { margin: 0 0 14px; }
.patient-form-page .form-section + .form-section { padding-top: 16px; margin-top: 0; }
.team-content .staff-table th:nth-child(2) { min-width: 140px; }
.document-table .table-action .button { min-width: 0; width: 100%; padding: 10px 12px; }
.document-table th:nth-child(4) { width: 16%; }
.document-table th:nth-child(3) { width: 16%; }
.document-table th:nth-child(2) { width: 25%; }
.document-table th:first-child { width: 28%; }
.document-table { table-layout: fixed; }
.patient-identity > strong { font-size: 1.65rem; }
.batch-submit > .button { min-height: 52px; font-size: 1.1rem; padding: 12px 24px; }
.batch-final-recipient p { margin: 4px 0; }
.batch-policy p { margin: 4px 0 0; font-size: .9375rem; }
.batch-item-heading h2 { font-size: 1.4rem; }
.batch-fields { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 0 22px; }
.batch-selector nav button strong { font-size: 1.05rem; line-height: 1.35; overflow-wrap: anywhere; max-width: 100%; }
.patient-form-page .section-fields .field-phone, .patient-form-page .section-fields .field-additional_phone { grid-column: span 3; }
.patient-form-page .section-fields .field-email { grid-column: span 6; }
.patient-form-page .section-fields .field-rg_state { grid-column: span 2; }
.patient-form-page .section-fields .field-rg_issuer { grid-column: span 4; }
.patient-form-page .section-fields .field-rg { grid-column: span 6; }
.patient-form-page .section-fields .field-birth_date, .patient-form-page .section-fields .field-cpf { grid-column: span 3; }
.patient-form-page .section-fields .field-social_name { grid-column: span 5; }
.patient-form-page .section-fields .field-full_name { grid-column: span 7; }
.patient-form-page .section-fields .form-field { margin-bottom: 16px; }
.patient-form-page .form-section { margin-bottom: 16px; padding-bottom: 4px; }
.event-patient_updated .timeline-mark, .event-staff_updated .timeline-mark, .event-replaced .timeline-mark { background: #fff0cd; color: #805000; }
.event-withdrawn h3 { background: #e1e7ec; color: #3b5260; }
.team-content .search-form .form-field { max-width: 480px; }
.staff-role { display: inline-block; background: var(--navy); color: #fff; padding: 4px 10px; border-radius: 6px; font-weight: 600; font-size: .875rem; overflow-wrap: normal; word-break: normal; }
.staff-person strong { font-size: 1.15rem; line-height: 1.35; }
.document-table th:last-child { width: 15%; }
.document-table td:nth-child(2) a { font-size: 1rem; font-weight: 650; }
.document-table td strong { font-size: 1.1rem; line-height: 1.35; }
.collection-content .result-count { margin: 10px 0 14px; }
.collection-content .search-field { max-width: 450px; }
.collection-status { padding: 24px 18px; background: #f9fcfd; }
.staff-app .page-shell:has(> .team-layout) { max-width: 1680px; }
.staff-app .page-shell:has(> .history-layout) { max-width: 1560px; }
.staff-app .page-shell:has(> .collection-layout) { max-width: 1680px; }
.staff-app .page-heading { margin-bottom: 22px; }
.staff-app .page-heading h1 { font-size: clamp(1.9rem,2.6vw,2.65rem); line-height: 1.2; margin-bottom: 10px; }
.app-navigation .icon { width: 20px; height: 20px; }
.app-navigation a { font-size: 1rem; padding: 11px 13px; }
.dashboard-search .button { font-size: .9375rem; padding: 11px 17px; }
.patient-summary .record-actions .button { font-size: 1rem; padding: 11px 18px; min-height: 46px; }
.metric-card.metric-pending { background: #fff1d4; border-color: #e4be71; }
.document-state-tabs a:last-child { border-radius: 0 7px 7px 0; }
.document-state-tabs a:first-child { border-radius: 7px 0 0 7px; }
.record-document-row:has(.status-draft) > .button { background: var(--action); color: #fff; border-color: var(--action); }
.record-document-row > .button { min-width: 154px; max-width: 100%; font-size: 1rem; padding: 11px 20px; white-space: normal; text-align: center; line-height: 1.3; }
.record-document-copy > p { margin-bottom: 0; grid-column: 1; }
.record-document-copy h3 { font-size: 1.2rem; line-height: 1.35; margin-bottom: 4px; grid-column: 1; }
.record-documents .section-description { margin-bottom: 12px; max-width: none; }
.record-documents .section-heading { margin-bottom: 8px; }
.record-documents h2 { font-size: 1.5rem; margin-bottom: 0; }
.desk-person-copy strong { font-size: 1.05rem; }
.patient-code-help { font-size: .875rem; margin: 4px 0 0; }
.patient-summary-contact { font-size: 1rem; margin-top: 8px; }
.patient-summary-identity { font-size: 1rem; gap: 6px 20px; margin-top: 12px; }
.patient-summary-heading > .status { margin-top: 8px; }
.patient-summary-heading h1 { font-size: clamp(1.7rem,2.6vw,2.65rem); line-height: 1.2; margin: 4px 0 6px; }
.patient-summary-heading { flex-direction: row; gap: 8px; align-items: start; flex-wrap: wrap; }
.patient-summary-main { min-width: 0; }
.desk-detail { padding: 22px 24px 36px; }
.desk-detail > * { max-width: none; }
.desk-layout { max-width: 1920px; margin: 0 auto; }
.upload-chart { border-top: 5px solid var(--navy); padding: 22px; }
.queue-table td strong { font-size: 1rem; font-weight: 700; }
.dashboard-work .section-heading .button { color: #102f4d; background: #ffc04d; border-color: #ffc04d; }
.metric-neutral .metric-icon { background: #e2e7ec; color: #49616a; }
.metric-positive .metric-icon { background: #d2ecdc; color: #176b4d; }
.metric-pending { background: #fff1d4; border-color: #e4be71; }
.dashboard-heading h1 { font-size: clamp(1.9rem,2.6vw,2.65rem); margin-bottom: 8px; }
.dashboard-heading .page-heading { margin: 0; flex: 1 1 350px; }
.dashboard-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 24px; flex-wrap: wrap; }
/* Direção aprovada: estrutura petróleo/marinho, leitura branca e estados semânticos. */
.operational-dashboard { max-width: 1680px; margin: auto; }
.dashboard-search-area { margin-bottom: 0; flex: 0 1 790px; }
.dashboard-search { display: flex; align-items: end; flex-wrap: wrap; gap: 12px; }
.dashboard-search .form-field { flex: 1 1 250px; margin: 0; max-width: 390px; }
.dashboard-overview { padding: 0; border: 0; background: transparent; margin: 0 0 24px; }
.metric-grid { display: grid; grid-template-columns: repeat(6,minmax(0,1fr)); gap: 14px; }
.metric-card { display: grid; grid-template-columns: 54px minmax(0,1fr); column-gap: 14px; align-content: center; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 20px 16px; box-shadow: var(--shadow); }
.metric-icon { grid-row: span 2; width: 54px; height: 62px; display: grid; place-items: center; border-radius: 9px; background: #dceaf1; color: var(--navy); }
.metric-icon .icon { width: 32px; height: 32px; }
.metric-card > strong { color: #102f4d; font-size: 2.6rem; line-height: 1.15; font-weight: 750; }
.metric-card > a, .metric-card > span:not(.metric-icon) { font-size: .9375rem; line-height: 1.4; margin-top: 5px; }
.metric-card > a { text-decoration: none; font-weight: 600; }
.metric-card > a:hover { text-decoration: underline; }
.metric-pending .metric-icon { background: #ffdc91; color: #774600; }
.dashboard-layout { display: grid; grid-template-columns: minmax(0,1.75fr) minmax(340px,1fr); gap: 20px; align-items: start; }
.dashboard-work { min-width: 0; padding: 22px; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); }
.dashboard-work h2 { font-size: 1.55rem; color: #fff; line-height: 1.3; }
.dashboard-work .section-heading { gap: 16px; flex-wrap: wrap; margin: -22px -22px 18px; padding: 22px; background: var(--navy); color: #fff; border-radius: 11px 11px 0 0; }
.dashboard-work .section-heading p { font-size: .9375rem; margin: 8px 0 0; color: #e1ecf5; }
.dashboard-work .table-frame { border: 0; }
.queue-table { table-layout: auto; font-size: .9375rem; }
.queue-table th, .queue-table td { padding: 14px 10px; }
.queue-table th:nth-child(1) { width: 24%; }
.queue-table th:nth-child(2) { width: 24%; }
.queue-table th:nth-child(3) { width: 18%; }
.queue-table th:nth-child(4) { width: 20%; }
.queue-table th:nth-child(5) { width: 14%; }
.queue-table .button { padding: 10px 18px; min-width: 100px; }
.queue-table tbody tr { background: #fffbf1; }
.queue-count { background: #ffe4a5; color: #6d4100; border-radius: 20px; padding: 4px 10px; font-size: .875rem; display: inline-block; }
.dashboard-side { display: grid; gap: 20px; min-width: 0; }
.upload-chart h2 { font-size: 1.4rem; line-height: 1.4; color: var(--navy); }
.upload-chart > p { color: var(--muted); font-size: .875rem; }
.chart-bars { display: flex; gap: 10px; height: 220px; margin: 25px 0 18px; padding: 0 4px; }
.chart-column { flex: 1; display: flex; flex-direction: column; align-items: center; min-width: 0; font-size: .8125rem; gap: 5px; font-variant-numeric: tabular-nums; }
.chart-column strong { font-size: 1.1rem; }
.chart-track { flex: 1; min-height: 0; width: 100%; display: flex; align-items: end; border-bottom: 1px solid #839eaf; }
.chart-track > span { display: block; width: 100%; background: #126c80; border-radius: 3px 3px 0 0; }
.dashboard-links { display: flex; flex-wrap: wrap; gap: 10px; padding: 18px; border: 0; background: #dce8ee; border-radius: 10px; }
.dashboard-links h2 { flex-basis: 100%; margin: 0; font-size: 1.1rem; }
.dashboard-links > a { padding: 10px 14px; }
.dashboard-empty { padding: 20px 0; }
.dashboard-empty h3 { font-size: 1.1rem; }
.patient-desk { background: #153f4f; color: #fff; border: 0; padding: 24px 18px; position: sticky; top: var(--header-height); max-height: calc(100dvh - var(--header-height)); overflow-y: auto; }
.patient-desk h2, .patient-desk a, .patient-desk label, .patient-desk .desk-count, .patient-desk .desk-selection-help, .patient-desk .desk-pagination span, .patient-desk .desk-empty strong, .patient-desk .desk-empty p { color: #fff; }
.patient-desk :focus-visible { outline-color: #ffcc66; }
.desk-patient-list { display: grid; gap: 10px; margin: 16px 0; }
.desk-patient { display: flex; gap: 10px; padding: 14px 12px; border: 1px solid #7897a2; border-radius: 8px; text-decoration: none; }
.desk-patient:hover { background: #21586a; }
.desk-patient.is-selected { background: #21636a; border: 2px solid #fff; padding: 13px 11px; box-shadow: inset 4px 0 #94ddc4; }
.desk-person-copy strong, .desk-person-copy > span, .desk-person-copy > .selected-label { color: #fff; }
.desk-person-copy > .selected-label { display: inline-block; padding: 2px 6px; background: #102f4d; border-radius: 4px; }
.patient-summary { background: linear-gradient(110deg,#102f4d,#123951); color: #fff; border: 1px solid #102f4d; border-left: 5px solid #65cbb1; border-radius: 12px; padding: 20px 24px; margin-bottom: 14px; display: grid; grid-template-columns: minmax(0,1fr) 220px; gap: 20px; }
.patient-summary h1 { font-size: clamp(1.7rem,2.6vw,2.65rem); color: #fff; line-height: 1.2; }
.patient-summary .section-label, .patient-summary-identity, .patient-summary-contact, .patient-code-help, .patient-access-summary, .patient-summary-identity strong { color: #e4eef7; font-size: inherit; }
.patient-summary .record-actions { border-color: #6d879e; margin-top: 20px; padding-top: 18px; padding-bottom: 0; display: flex; flex-direction: column; align-items: stretch; justify-content: center; gap: 8px; margin: 0; padding: 0; border: 0; }
.patient-summary .button-secondary { background: transparent; border-color: #becfdb; color: #fff; }
.patient-summary .button-secondary:hover { background: #254c69; }
.patient-summary .button:not(.button-secondary) { background: #ffc04d; border-color: #ffc04d; color: #102f4d; }
.patient-summary :focus-visible { outline-color: #ffcc66; }
.patient-access-summary { gap: 12px; margin-top: 10px; }
.patient-context { background: #e3edf3; border: 1px solid #b5c8d5; border-left: 4px solid var(--blue); margin-bottom: 12px; padding: 10px 16px; }
.record-documents { background: #fff; padding: 22px; border: 1px solid var(--line); border-radius: 12px; }
.record-document-row { background: #fff; padding: 16px 4px; border-bottom: 1px solid var(--line); border-top: 0; }
.record-document-row:last-child { border-bottom: 0; }
.pdf-badge { background: #b62937; border-color: #b62937; color: #fff; }
.document-state-tabs { display: flex; flex-wrap: wrap; gap: 0; margin: 14px 0 8px; }
.document-state-tabs a { flex: 1 1 auto; justify-content: center; gap: 10px; display: inline-flex; align-items: center; min-height: 50px; padding: 10px 14px; border: 1px solid #9bb0be; border-radius: 0; background: #fff; color: var(--blue); text-decoration: none; font-size: 1rem; font-weight: 650; }
.document-state-tabs a[aria-current] { background: var(--action); color: #fff; border-color: var(--action); box-shadow: none; }
.document-state-tabs a:hover { background: #e3edf3; color: #153f4f; }
.document-state-tabs a span { padding: 1px 6px; border-radius: 4px; background: #e6eef3; color: #153f4f; }
.record-documents .document-filters { display: flex; flex-wrap: wrap; align-items: end; gap: 16px; padding: 16px 0; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; }
.record-documents .document-filters > .form-field { flex: 1 1 240px; margin: 0; max-width: 480px; }
.record-documents .document-filter-fields { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 14px; }
.record-documents .filter-actions { margin: 0; order: 2; }
.patient-identity { background: var(--navy); color: #fff; border-color: var(--navy); border-left: 4px solid #65cbb1; padding: 18px 24px; margin-bottom: 20px; }
.patient-identity strong, .patient-identity .section-label, .patient-identity .identity-details { color: #fff; }
@media (min-width: 768px) and (max-width: 1399px) {
 .metric-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
 .metric-card { grid-template-columns: 44px minmax(0,1fr); padding: 14px; }
 .metric-icon { width: 44px; height: 48px; }
 .metric-card > strong { font-size: 2.2rem; }
}
@media (max-width: 1500px) {
 .dashboard-layout { grid-template-columns: minmax(0, 1.8fr) minmax(260px,1fr); }
 .queue-table { table-layout: auto; }
 .queue-table th, .queue-table td { padding: 12px 8px; }
 .queue-table .status { white-space: normal; }
}
@media (max-width: 1100px) {
 .dashboard-layout { grid-template-columns: minmax(0,1fr); }
 .dashboard-side { grid-template-columns: minmax(0,1fr) minmax(0,1fr); }
}
@media (max-width: 900px) {
 .patient-desk { position: static; max-height: none; }
 .patient-desk-disclosure > summary { color: #fff; }
}
@media (max-width: 767px) {
 .metric-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
 .metric-card { padding: 14px; grid-template-columns: 32px minmax(0,1fr); gap: 7px; }
 .metric-icon { width: 32px; height: 40px; }
 .metric-icon .icon { width: 22px; height: 22px; }
 .metric-card > strong { font-size: 1.6rem; }
 .dashboard-work, .record-documents { padding: 16px; }
 .dashboard-side { grid-template-columns: minmax(0,1fr); }
 .patient-summary { padding: 18px; }
 .patient-summary .record-actions .button { flex: 1 1 180px; font-size: 1rem; padding: 10px 16px; min-height: 46px; }
 .document-state-tabs a { flex-basis: calc(50% - 8px); padding: 8px; font-size: .875rem; }
 .record-documents .document-filter-fields { grid-template-columns: minmax(0,1fr); }
 .record-documents .document-filters > * { flex-basis: 100%; }
 .queue-table tbody tr { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; padding: 14px; }
 .queue-table td { width: auto; padding: 0; min-width: 0; }
 .queue-table td:nth-child(-n+2), .queue-table td.table-action { grid-column: 1 / -1; }
 .queue-table td.table-action { padding-top: 2px; }
 .dashboard-search .button { flex: 1 1 auto; font-size: .9375rem; padding: 11px 17px; }
 .queue-table td::before { white-space: normal; }
}
.chart-track svg { width: 100%; height: 100%; fill: #126c80; }
.queue-table .table-action .button { background: var(--action); border-color: var(--action); color: #fff; padding: 10px 18px; min-width: 100px; line-height: 1.3; font-size: .9375rem; text-align: center; }
.patient-access-summary strong { color: #fff; }
/* Coleções: situação e filtros pertencem ao conteúdo, nunca à navegação global. */
.staff-app .page-shell:not(:has(.desk-layout)) { max-width: 1800px; width: calc(100% - 64px); }
.collection-layout { display: grid; grid-template-columns: 250px minmax(0,1fr); gap: 20px; align-items: start; }
.collection-status h2 { font-size: 1.1rem; }
.collection-status .document-state-tabs { flex-direction: column; gap: 8px; }
.collection-status .document-state-tabs a { justify-content: space-between; border-radius: 7px; padding: 12px; }
.collection-content { min-width: 0; padding: 22px; }
.collection-content .review-filters { padding: 0 0 12px; margin: 0; border: 0; gap: 12px 18px; }
.collection-content .table-frame { border: 0; }
.pending-banner { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 16px 24px; background: linear-gradient(105deg,#102f4d,#123f53); color: #fff; border-radius: 10px; margin-bottom: 20px; font-size: 1.25rem; }
.pending-banner > span { display: flex; align-items: center; gap: 14px; }
.pending-banner .icon { color: #ffc04d; flex-shrink: 0; width: 28px; height: 28px; }
.button-attention { background: #ffc04d; color: #102f4d; border-color: #ffc04d; }
.button-attention:hover { background: #ffcf78; color: #102f4d; border-color: #ffcf78; }
.document-row-draft { background: #fff8e9; }
.table-action .button { display: inline-flex; min-height: 44px; padding: 10px 18px; text-decoration: none; border-radius: 6px; background: #fff; color: var(--blue); border: 1px solid #8aa5b5; min-width: 145px; font-size: .9375rem; line-height: 1.3; white-space: normal; }
.table-action .button:hover { background: #e3edf3; }
.document-row-draft .table-action .button { background: var(--action); color: #fff; border-color: var(--action); }
.team-layout { display: grid; grid-template-columns: minmax(0,1fr) 310px; gap: 20px; align-items: start; }
.team-content { min-width: 0; }
.team-content .search-form { padding: 0; background: #fff; border: 0; }
.administration { display: flex; flex-direction: column; gap: 16px; padding: 24px; }
.administration h2 { font-size: 1.7rem; margin: 0; color: var(--navy); }
.administration .callout { margin: 12px 0 0; font-size: .875rem; }
.staff-person { display: flex; align-items: center; gap: 12px; }
.staff-person > span:last-child { min-width: 0; }
.staff-avatar { background: #dfeaf4; color: #102f4d; width: 52px; height: 52px; flex: 0 0 52px; border-radius: 50%; display: grid; place-items: center; overflow: hidden; font-weight: 700; font-size: 1.25rem; }
.staff-avatar img { width: 52px; height: 52px; object-fit: cover; }
.history-layout { display: grid; grid-template-columns: 280px minmax(0,1fr); gap: 20px; align-items: start; }
.history-layout .audit-filters { margin: 0; padding: 0; border: 0; background: #fff; }
.history-layout .audit-filter-fields { display: block; }
.history-layout .filter-actions { display: grid; }
.timeline-panel { min-width: 0; }
.timeline-day { display: flex; gap: 12px; align-items: center; background: #d1e4f1; color: var(--navy); padding: 10px 16px; font-size: 1.25rem; border-radius: 6px; margin: 12px 0 0; font-weight: 700; }
.timeline-event { display: grid; grid-template-columns: 40px minmax(0,1fr) minmax(210px,.9fr); gap: 14px; align-items: start; padding: 18px 0; margin-left: 20px; border-left: 2px solid #b7cbd7; border-bottom: 1px solid var(--line); }
.timeline-event h3 { font-size: 1.05rem; margin: 0 0 5px; display: inline-block; background: #e4edf4; color: var(--navy); padding: 2px 8px; border-radius: 5px; }
.timeline-event p { margin: 0; font-size: .9375rem; color: var(--muted); }
.timeline-event .timeline-note { margin-top: 10px; color: var(--ink); }
.timeline-mark { width: 40px; height: 40px; border-radius: 50%; background: var(--action); color: #fff; display: grid; place-items: center; transform: translateX(-21px); }
.timeline-reference { display: flex; align-items: start; justify-content: space-between; gap: 10px; border-left: 1px solid var(--line); padding-left: 16px; overflow-wrap: anywhere; flex-wrap: wrap; font-weight: 600; }
.timeline-reference .button { flex-shrink: 0; font-weight: 600; padding: 8px 16px; min-width: 145px; }
/* Resultados: uma linha por PDF, identidade antes da leitura. */
.results-intro { display: flex; flex-direction: column-reverse; align-items: stretch; gap: 24px; padding: 0; background: transparent; border: 0; margin-bottom: 24px; }
.results-owner { background: linear-gradient(105deg,#102f4d,#123951); color: #fff; border-radius: 12px; padding: 22px 28px; border-left: 5px solid #65cbb1; }
.results-owner strong { font-size: 1.85rem; line-height: 1.3; }
.results-owner .section-label, .results-owner > span:last-child { color: #e5eff6; }
.results-intro h1 { font-size: clamp(1.8rem,3vw,2.8rem); }
.result-list { grid-template-columns: minmax(0,1fr); }
.result-item { display: grid; grid-template-columns: 75px minmax(0,1fr) auto; gap: 24px; align-items: center; border: 1px solid var(--line); padding: 24px; border-radius: 12px; }
.result-card-heading { display: flex; justify-content: center; padding-right: 20px; border-right: 1px solid var(--line); }
.result-card-heading .section-label, .result-card-heading .status { display: none; }
.result-card-heading .pdf-badge { width: 48px; height: 62px; flex-basis: 48px; }
.result-info h2 { margin: 0 0 12px; font-size: 1.5rem; margin-bottom: 10px; }
.result-metadata { gap: 10px 24px; }
.result-actions { padding: 0; margin: 0; border: 0; display: flex; flex-wrap: wrap; gap: 12px; }
.result-actions .button { font-size: 1.125rem; min-height: 56px; white-space: nowrap; padding: 12px 22px; }
.results-guidance { background: #ddeee9; border-radius: 8px; padding: 18px 24px; font-size: 1rem; }
/* Cadastro: formulário sem etapas artificiais e resumo de intenção. */
.patient-form-page { max-width: 1480px; margin: auto; }
.patient-form-layout { display: grid; grid-template-columns: minmax(0,1fr) 310px; gap: 22px; align-items: start; }
.patient-form-layout > section.panel { min-width: 0; padding: 24px; }
.registration-summary { position: sticky; top: calc(var(--header-height) + 20px); padding: 0 22px 22px; overflow: hidden; }
.registration-summary h2 { background: var(--navy); color: #fff; margin: 0 -22px; padding: 17px 22px; font-size: 1.6rem; }
.registration-summary dl { margin: 10px 0 20px; }
.registration-summary dl > div { padding: 15px 0; border-bottom: 1px solid var(--line); }
.registration-summary dt { color: var(--muted); font-size: .875rem; }
.registration-summary dd { margin: 5px 0 0; font-weight: 700; overflow-wrap: anywhere; font-size: 1.1rem; }
.registration-summary .button { width: 100%; }
.registration-summary p { color: var(--muted); font-size: .875rem; }
.patient-form-page .form-section legend { color: var(--navy); border-left: 4px solid #178b72; padding-left: 12px; font-size: 1.5rem; margin-bottom: 14px; padding: 0 0 0 12px; line-height: 1.35; }
/* Envio: lista e editor usam os mesmos campos e o mesmo formset. */
.batch-content { max-width: 1560px; }
.batch-workspace { display: grid; grid-template-columns: 310px minmax(0,1fr); gap: 22px; align-items: start; }
.batch-workspace > [data-batch-items] { min-width: 0; }
.no-js .batch-workspace { display: block; }
.batch-selector { position: sticky; top: calc(var(--header-height) + 20px); }
.batch-selector h2 { font-size: 1.4rem; }
.batch-selector > p { font-size: .875rem; color: var(--muted); }
.batch-selector nav { display: grid; gap: 10px; margin: 18px 0; }
.batch-selector nav button { display: flex; flex-direction: column; align-items: start; gap: 5px; min-height: 88px; padding: 14px 16px; text-align: left; width: 100%; border: 1px solid #abc0ce; border-radius: 7px; color: var(--navy); background: #edf2f6; overflow-wrap: anywhere; }
.batch-selector nav button[aria-current='true'] { background: var(--action); color: #fff; border-color: var(--action); }
.batch-selector nav button[data-has-errors='true'] { border-left: 5px solid #b12d35; }
.batch-selector nav button span { font-size: .875rem; line-height: 1.4; }
.batch-selector .batch-add-row { display: grid; }
.js .batch-document.is-inactive { display: none; }
.batch-document { margin: 0; padding: 24px; }
.batch-item-heading { border-bottom: 1px solid var(--line); }
.batch-item-heading button { text-decoration: none; border: 1px solid #9aafbd; padding: 9px 12px; background: #fff; }
.batch-policy { background: #fff5df; border: 1px solid #efd4a1; padding: 12px 18px; margin: 0 0 20px; }
.batch-final-recipient { background: #e3edf3; border-left-color: var(--blue); padding: 14px 20px; margin: 18px 0 12px; }
.batch-submit { justify-content: flex-end; background: #fff; padding: 16px 20px; border: 1px solid var(--line); border-radius: 8px; gap: 20px; }
/* Login: fundo marinho, formulário branco e chamada editorial. */
.login-page { background: linear-gradient(135deg,transparent 70%,#07596755 70%), linear-gradient(35deg,#07596766 15%,transparent 15%), #102f4d; color: #fff; }
.login-page .site-header { background: transparent; border-bottom: 1px solid #496984; }
.login-page .brand { background: #fff; border-radius: 5px; padding: 5px; }
.login-page .header-caption { color: #fff; }
.login-page .page-shell { width: calc(100% - 48px); max-width: 1200px; padding: 40px 0; }
.login-page .auth-layout { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1.05fr); align-items: center; gap: 54px; }
.login-page .auth-intro { padding: 0; }
.login-page .auth-intro h1 { color: #fff; font-size: clamp(2.3rem,4.2vw,4rem); line-height: 1.1; }
.login-page .auth-intro p, .login-page .auth-intro .section-label, .login-page .auth-intro .support-note { color: #dfebf4; }
.login-page .auth-intro .support-note { background: transparent; border-color: #6e8da2; padding-left: 0; }
.login-benefits { list-style: none; display: grid; gap: 20px; padding: 0; margin: 32px 0; }
.login-benefits li { display: flex; align-items: center; gap: 18px; font-size: 1.1rem; font-weight: 600; }
.login-benefits .icon { width: 32px; height: 32px; color: #8cdec5; }
.login-page .auth-panel { color: var(--ink); padding: 34px; background: #fff; border-radius: 16px; border: 0; box-shadow: 0 20px 50px #00162b33; }
.login-page .auth-panel h2 { color: var(--navy); font-size: 2rem; margin-bottom: 20px; }
.login-page .auth-panel .button-full { min-height: 56px; font-size: 1.25rem; }
.login-page .alternate-login { display: flex; flex-direction: column; gap: 10px; align-items: stretch; text-align: center; }
/* Impressão editorial: dimensões físicas, conteúdo completo e sem credenciais. */
.print-page { background: #fff; color: #172b3c; font-family: Georgia,'Times New Roman',serif; }
.print-page .page-shell { width: 100%; max-width: 210mm !important; padding: 12mm; }
.print-brand { display: flex; align-items: center; gap: 20px; border-bottom: 2px solid #153f4f; margin-bottom: 12px; }
.print-brand img { width: 29mm; }
.print-brand h1 { font-family: inherit; font-size: 26px; color: #102f4d; }
.print-issued { text-align: right; font-size: 12px; }
.print-patient { border-left: 4px solid #153f4f; padding: 8px 16px; margin: 20px 0; }
.print-patient h2 { font-size: 24px; margin: 3px 0; overflow-wrap: anywhere; }
.print-patient p { margin: 0; }
.print-page .patient-details-grid { display: block; }
.print-page .panel { padding: 0; margin-bottom: 20px; border: 0; box-shadow: none; background: #fff; }
.print-page .panel h2 { font-size: 20px; padding-bottom: 8px; border-bottom: 1px solid #153f4f; margin-bottom: 0; }
.print-page .detail-grid { display: block; margin: 0; }
.print-page .detail-grid > div { display: grid; grid-template-columns: 37% minmax(0,1fr); gap: 12px; padding: 6px; border-bottom: 1px solid #a6afb6; break-inside: avoid; }
.print-page dt, .print-page dd { margin: 0; color: #172b3c; font-size: 14px; line-height: 1.45; overflow-wrap: anywhere; }
.print-page dt { font-weight: 700; }
.print-data-note { border-top: 1px solid #153f4f; padding-top: 12px; break-inside: avoid; }
.print-data-note h2 { font-size: 16px; margin-bottom: 6px; }
.print-data-note p { font-size: 12px; line-height: 1.5; }
@media (max-width: 1100px) {
 .team-layout, .patient-form-layout { grid-template-columns: minmax(0,1fr); }
 .administration { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); }
 .administration h2, .administration .callout { grid-column: 1/-1; }
 .registration-summary { position: static; }
 .registration-summary dl { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 16px; }
 .result-item { grid-template-columns: 60px minmax(0,1fr); }
 .result-actions { grid-column: 2; }
 .batch-workspace { grid-template-columns: 245px minmax(0,1fr); }
}
@media (max-width: 767px) {
 .staff-app .page-shell:not(:has(.desk-layout)) { width: 100%; }
 .collection-layout, .history-layout, .batch-workspace { grid-template-columns: minmax(0,1fr); }
 .collection-status { padding: 16px; }
 .collection-status .document-state-tabs { flex-direction: row; }
 .collection-status .filter-scope { margin-bottom: 0; }
 .pending-banner { align-items: stretch; flex-direction: column; padding: 18px; gap: 12px; }
 .team-content { padding: 16px; }
 .administration { display: flex; }
 .timeline-event { grid-template-columns: 25px minmax(0,1fr); gap: 10px; margin-left: 10px; }
 .timeline-mark { width: 28px; height: 28px; transform: translateX(-15px); }
 .timeline-reference { grid-column: 2; border: 0; padding: 0; }
 .timeline-panel { padding: 16px; }
 .batch-selector { position: static; padding: 16px; }
 .batch-selector nav { grid-template-columns: repeat(2,minmax(0,1fr)); }
 .batch-selector nav button { min-width: 0; }
 .batch-selector nav button strong { overflow-wrap: anywhere; max-width: 100%; }
 .batch-document { padding: 18px; }
 .batch-fields { grid-template-columns: minmax(0,1fr); }
 .batch-fields .field-exam_date { max-width: none; }
 .registration-summary dl { display: block; }
 .patient-form-layout > section.panel { padding: 18px; }
 .results-owner { padding: 18px; }
 .result-item { padding: 18px; gap: 14px; grid-template-columns: 45px minmax(0,1fr); }
 .result-card-heading { padding-right: 10px; }
 .result-card-heading .pdf-badge { width: 35px; height: 46px; }
 .result-actions { grid-column: 1/-1; }
 .result-actions .button { min-width: 0; white-space: normal; }
 .results-guidance { flex-direction: column; gap: 8px; }
 .login-page .page-shell { width: 100%; padding: 24px 16px; }
 .login-page .auth-layout { display: flex; flex-direction: column; gap: 22px; }
 .login-page .auth-intro { width: 100%; }
 .login-page .auth-intro h1 { font-size: 1.85rem; margin: 0; }
 .login-page .auth-intro p, .login-page .auth-intro .section-label, .login-benefits, .login-page .auth-intro .support-note { display: none; }
 .login-page .auth-panel { width: 100%; padding: 22px 18px; }
 .print-page .page-shell { padding: 16px; }
 .print-brand { gap: 12px; }
 .print-brand h1 { font-size: 20px; }
 .print-brand img { width: 70px; }
}
@media print {
 @page { size: A4 portrait; margin: 12mm; }
 .print-page .page-shell { padding: 0; max-width: none !important; }
 .print-controls { display: none !important; }
 .print-page .patient-details-grid .panel { break-inside: auto; }
 .print-page .panel h2 { break-after: avoid; }
 .print-page .print-brand img { width: 29mm; }
 .print-page .print-brand h1 { font-size: 26px; }
 .print-page .detail-grid > div { grid-template-columns: 37% minmax(0,1fr); }
}
.login-page .auth-intro { background: transparent; border: 0; }
.login-page .login-benefits .icon { width: 30px; height: 30px; flex-basis: 30px; }
.result-category { display: inline-block; max-width: 100%; overflow-wrap: anywhere; white-space: normal; background: #e0f2e9; color: #155135; padding: 2px 10px; border-radius: 6px; font-weight: 600; font-size: .875rem; margin-bottom: 8px; }
.event-published .timeline-mark { background: #176b4d; }
.event-uploaded .timeline-mark { background: #fff0cd; color: #825000; }
.event-withdrawn .timeline-mark { background: #e1e7ec; color: #3b5260; }
.event-published h3 { color: #155135; background: #d2efdc; }
.event-uploaded h3 { color: #805000; background: #fff0cd; }
@media (min-width: 1600px) { .staff-app .page-shell:not(:has(.desk-layout)) { padding-left: 0; padding-right: 0; } }
.app-navigation a[aria-current='page'] { background: #246477; color: #fff; border-bottom-color: #82d6bb; }
.patient-app .site-header { background: var(--header-blue); }
.patient-app .brand { background: #fff; border-radius: 5px; padding: 5px; }
.patient-app .main-nav > a, .patient-app .nav-button { color: #fff; }
.patient-app .main-nav > a[aria-current] { background: #246477; color: #fff; }
.patient-app .main-nav :focus-visible { outline-color: #ffcc66; }
.print-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 20px; }

/* Ajustes de leitura verificados nas capturas reais. */
.team-content .staff-table { table-layout: auto; }
.team-content .staff-table th, .team-content .staff-table td { width: auto; }
.team-content .staff-table th:first-child { width: 30%; }
.team-content .staff-table td:nth-child(4) { white-space: nowrap; }
.team-content .staff-table td:first-child { overflow-wrap: anywhere; }
.results-guidance { gap: 16px; }
@media (max-width: 767px) {
 .team-content .staff-table td:nth-child(4) { white-space: normal; }
}

@media (max-width: 1199px) {
 .patient-summary { grid-template-columns: minmax(0,1fr); gap: 16px; }
 .patient-summary .record-actions { flex-direction: row; flex-wrap: wrap; justify-content: start; }
 .patient-summary .record-actions .button { flex: 1 1 180px; }
}
@media (max-width: 767px) {
 .dashboard-heading { gap: 18px; margin-bottom: 18px; }
 .dashboard-heading .page-heading, .dashboard-search-area { flex-basis: 100%; min-width: 0; }
 .dashboard-search .form-field { max-width: none; flex-basis: 100%; }
 .metric-card { padding: 14px 10px; grid-template-columns: 32px minmax(0,1fr); gap: 8px; }
 .metric-card > strong { font-size: 2rem; }
 .metric-card > a, .metric-card > span:not(.metric-icon) { font-size: .875rem; }
 .dashboard-work .section-heading { margin: -16px -16px 16px; padding: 18px 16px; }
 .dashboard-work h2 { font-size: 1.3rem; }
 .patient-summary { padding: 18px; }
 .patient-summary-heading h1 { font-size: 1.75rem; }
 .record-document-row > .button { min-width: 0; width: calc(100% - 53px); }
 .document-state-tabs { gap: 6px; }
 .document-state-tabs a { border-radius: 6px; }
}

@media (max-width: 1100px) {
 .app-navigation a { font-size: 1rem; }
}
@media (max-width: 767px) {
 .patient-form-page .section-fields .form-field { grid-column: 1 / -1; }
 .collection-status, .collection-content, .administration { padding: 18px; }
 .pending-banner { font-size: 1.1rem; }
 .patient-summary h1 { font-size: 1.75rem; }
 .patient-identity { padding: 18px; }
 .results-owner strong { font-size: 1.4rem; }
 .result-info h2 { font-size: 1.25rem; }
 .result-actions .button { font-size: 1rem; padding: 11px 16px; }
 .table-action .button { min-width: 0; }
 .batch-fields { grid-template-columns: minmax(0,1fr); }
 .batch-submit > .button { width: 100%; padding: 12px 16px; }
 .login-page .auth-panel { padding: 22px 18px; }
 .login-page .auth-intro h1 { font-size: 1.85rem; }
}

@media (min-width: 1400px) {
 .patient-form-page .section-fields:has(.field-full_name) { grid-template-columns: repeat(20,minmax(0,1fr)); }
 .patient-form-page .section-fields .field-full_name { grid-column: span 12; }
 .patient-form-page .section-fields .field-social_name { grid-column: span 8; }
 .patient-form-page .section-fields .field-birth_date, .patient-form-page .section-fields .field-cpf, .patient-form-page .section-fields .field-rg_issuer { grid-column: span 4; }
 .patient-form-page .section-fields .field-rg { grid-column: span 5; }
 .patient-form-page .section-fields .field-rg_state { grid-column: span 3; }
}
@media (max-width: 767px) {
 .patient-form-page .section-fields .form-field { grid-column: 1 / -1; }
 .document-table th, .document-table th:first-child, .document-table th:last-child { width: auto; }
 .document-table .table-action .button { width: auto; min-width: 145px; }
}

@media (max-width: 900px) {
 .batch-content .file-selection { display: block; }
 .batch-content .file-selection-actions { margin-top: 12px; }
}

@media (max-width: 1199px) {
 .record-document-copy { display: block; }
 .record-document-copy > p { margin-bottom: 8px; }
 .record-document-copy .document-state-line { flex-direction: row; align-items: center; }
}
@media (max-width: 767px) {
 .patient-summary { padding: 18px; }
 .patient-summary-heading { flex-direction: column; gap: 6px; }
 .patient-summary-heading > .status { margin-top: 0; }
}

@media (min-width: 768px) and (max-width: 1100px) {
 .patient-form-page .section-fields > .form-field { grid-column: span 6; }
 .patient-form-page .section-fields > .field-full_name,
 .patient-form-page .section-fields > .field-social_name,
 .patient-form-page .section-fields > .field-phone_is_whatsapp { grid-column: 1 / -1; }
}

@media (max-width: 375px) {
 .metric-icon { grid-row: 1; }
 .metric-card > strong { grid-column: 2; grid-row: 1; }
 .metric-card > a, .metric-card > span:not(.metric-icon) { grid-column: 1 / -1; overflow-wrap: normal; }
 .chart-bars { gap: 4px; padding: 0; }
 .chart-column { font-size: .75rem; }
}
