:root {
  color-scheme: dark;
  --bg: #0a1420;
  --bg-grid: rgba(255, 255, 255, 0.035);
  --surface: #101f30;
  --surface-2: #16283c;
  --surface-3: #1b3049;
  --surface-hover: #1c3350;
  --surface-sunken: #0b1826;
  --border: #223850;
  --border-strong: #365d85;
  --text: #f3f7fc;
  --muted: #93a9c2;
  --muted-2: #6f889f;
  --primary: #4f8fd6;
  --primary-hover: #6aa3e0;
  --primary-active: #3c73ac;
  --primary-light: rgba(79, 143, 214, 0.15);
  --gold: #e3bd6a;
  --gold-light: rgba(227, 189, 106, 0.15);
  --success: #4fbf8b;
  --success-light: rgba(79, 191, 139, 0.14);
  --danger: #f2697a;
  --danger-light: rgba(242, 105, 122, 0.14);
  --warning: #eab654;
  --warning-light: rgba(234, 182, 84, 0.14);
  --attention: #f08f72;
  --attention-light: rgba(240, 143, 114, 0.13);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-pill: 999px;
  --shadow-sm: 0 2px 8px rgba(2, 8, 16, 0.24);
  --shadow-md: 0 12px 28px rgba(2, 8, 16, 0.32);
  --shadow-lg: 0 24px 64px rgba(2, 8, 16, 0.4);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  /* Quadriculado quase imperceptivel, igual ao do formulario. */
  background:
    radial-gradient(circle at top left, rgba(91, 141, 194, 0.15), transparent 34rem),
    linear-gradient(90deg, var(--bg-grid) 1px, transparent 1px) 0 0 / 42px 42px,
    linear-gradient(180deg, var(--bg-grid) 1px, transparent 1px) 0 0 / 42px 42px,
    linear-gradient(135deg, var(--bg), #081522 68%, var(--bg));
  background-attachment: fixed;
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  transition: background-color 0.15s var(--ease), border-color 0.15s var(--ease), color 0.15s var(--ease), transform 0.1s var(--ease), box-shadow 0.15s var(--ease);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

button:active:not(:disabled) {
  transform: translateY(1px);
}

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: 4px;
}

::selection {
  background: var(--primary-light);
  color: var(--text);
}

/* Custom scrollbars */
.registration-list::-webkit-scrollbar,
.approved-modal-main::-webkit-scrollbar,
.approved-table-wrap::-webkit-scrollbar,
.payload-grid::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.registration-list::-webkit-scrollbar-track,
.approved-modal-main::-webkit-scrollbar-track,
.approved-table-wrap::-webkit-scrollbar-track,
.payload-grid::-webkit-scrollbar-track {
  background: transparent;
}

.registration-list::-webkit-scrollbar-thumb,
.approved-modal-main::-webkit-scrollbar-thumb,
.approved-table-wrap::-webkit-scrollbar-thumb,
.payload-grid::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: var(--radius-pill);
}

/* Icons */
.icon {
  display: inline-flex;
  flex: none;
  width: 16px;
  height: 16px;
}

.icon svg {
  width: 100%;
  height: 100%;
}

.icon.is-spinning svg {
  animation: spin 0.9s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Layout shell */
.app-shell {
  width: min(1440px, calc(100% - 48px));
  margin: 0 auto;
  padding: 26px 0 48px;
}

.center-panel {
  display: grid;
  gap: 4px;
  justify-items: start;
  width: min(520px, calc(100vw - 32px));
  margin: 10vh auto 0;
  padding: 32px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
}

.brand-mark-lg {
  margin-bottom: 14px;
}

.kicker {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

h1,
h2,
h3,
h4,
p {
  margin-top: 0;
}

h1,
h2,
h3 {
  letter-spacing: -0.01em;
  font-weight: 700;
}

p {
  color: var(--muted);
  line-height: 1.6;
}

code {
  padding: 1px 6px;
  border-radius: 5px;
  background: var(--surface-2);
  color: var(--text);
  font-size: 0.9em;
}

.notice,
.empty-box {
  display: grid;
  gap: 6px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-2);
  color: var(--muted);
}

.notice strong {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
}

.compact-notice {
  padding: 12px;
}

.notice.is-attention {
  border-color: color-mix(in srgb, var(--attention) 54%, var(--border));
  background: var(--attention-light);
}

.notice.is-attention strong {
  color: var(--attention);
}

.notice.is-danger {
  border-color: color-mix(in srgb, var(--danger) 54%, var(--border));
  background: var(--danger-light);
}

.notice.is-danger strong {
  color: var(--danger);
}

.login-form,
.toolbar {
  display: grid;
  gap: 14px;
}

.login-form {
  width: 100%;
  margin-top: 18px;
}

/* QR code do MFA: fundo branco fixo para o app autenticador conseguir ler no tema escuro. */
.mfa-qr {
  display: block;
  margin: 16px auto 8px;
  padding: 10px;
  border-radius: 12px;
  background: #ffffff;
}

.demo-user-grid {
  display: grid;
  gap: 10px;
  width: 100%;
  margin: 20px 0 16px;
}

.demo-user-button {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 13px 14px;
  background: var(--surface-2);
  color: var(--text);
  text-align: left;
}

.demo-user-button > span:nth-child(2) {
  display: grid;
  gap: 3px;
  flex: 1;
}

.demo-user-button .icon {
  color: var(--muted-2);
  transition: transform 0.15s var(--ease), color 0.15s var(--ease);
}

.demo-user-button:hover {
  border-color: var(--primary);
  background: var(--surface-hover);
  box-shadow: var(--shadow-sm);
}

.demo-user-button:hover .icon {
  color: var(--primary);
  transform: translateX(3px);
}

.demo-user-button span span {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.86rem;
}

.demo-back-button {
  margin-bottom: 14px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--text);
  font-weight: 600;
  font-size: 0.88rem;
}

input,
select,
textarea {
  min-height: 44px;
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  background: var(--surface-sunken);
  color: var(--text);
  font-weight: 400;
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}

input::placeholder,
textarea::placeholder {
  color: var(--muted-2);
}

input:hover,
select:hover,
textarea:hover {
  border-color: var(--border-strong);
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

textarea {
  resize: vertical;
}

select {
  appearance: none;
  padding-right: 34px;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2393a9c2' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 16px;
}

.search-field .input-affix {
  position: relative;
  display: flex;
  align-items: center;
}

.search-field .input-affix .icon {
  position: absolute;
  left: 12px;
  color: var(--muted-2);
  pointer-events: none;
}

.search-field input {
  padding-left: 36px;
}

.primary-button,
.secondary-button,
.ghost-button,
.icon-button,
.status-action-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  border-radius: var(--radius-sm);
  padding: 9px 16px;
  font-weight: 700;
  font-size: 0.9rem;
  white-space: nowrap;
}

.primary-button {
  border: 1px solid var(--primary-active);
  background: var(--primary);
  color: #ffffff;
  box-shadow: var(--shadow-sm);
}

.primary-button:hover:not(:disabled) {
  background: var(--primary-hover);
  box-shadow: var(--shadow-md);
}

.secondary-button {
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
}

.secondary-button:hover:not(:disabled) {
  border-color: var(--border-strong);
  background: var(--surface-hover);
}

.ghost-button {
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  padding: 9px 12px;
}

.ghost-button:hover:not(:disabled) {
  background: var(--surface-2);
  color: var(--text);
}

.icon-button {
  min-height: 40px;
  min-width: 40px;
  padding: 0;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--muted);
}

.icon-button:hover:not(:disabled) {
  border-color: var(--border-strong);
  background: var(--surface-hover);
  color: var(--text);
}

.feedback {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 20px;
  margin: 10px 0 0;
  color: var(--muted);
  font-weight: 700;
  font-size: 0.86rem;
}

.feedback .icon {
  width: 15px;
  height: 15px;
}

.feedback.is-info {
  width: fit-content;
  max-width: 100%;
  padding: 8px 10px;
  border: 1px solid color-mix(in srgb, var(--success) 28%, var(--border));
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--success-light) 45%, transparent);
  color: var(--success);
  margin-bottom: 8px;
}

.feedback.is-danger {
  padding: 12px 14px;
  border: 1px solid color-mix(in srgb, var(--danger) 40%, var(--border));
  border-radius: var(--radius-md);
  background: var(--danger-light);
  color: var(--danger);
}

.is-hidden {
  display: none !important;
}

/* Topbar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 0 0 20px;
  padding: 14px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-sm);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  display: block;
  flex: none;
  width: 82px;
  height: 48px;
  background: url("./assets/logo-dourado.svg") center / contain no-repeat;
}

.brand-mark-lg {
  width: 120px;
  height: 70px;
}

/* O SVG da logo tem folga interna (mais em cima que embaixo): as margens
   negativas tiram essa folga e o deslocamento alinha título e botões com "bio meds". */
.brand .brand-mark {
  margin: -12px 0 -8px;
  width: 160px;
  height: 87px;
}

.brand > div {
  padding-left: 14px;
  border-left: 1px solid var(--border-strong);
}

.brand > div,
.topbar .user-box {
  transform: translateY(8px);
}

.topbar .kicker {
  margin-bottom: 2px;
}

.topbar h1 {
  margin-bottom: 0;
  font-size: clamp(1.25rem, 2.4vw, 1.6rem);
}

.user-box {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  color: var(--muted);
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 5px 12px 5px 5px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--surface-2);
}

.user-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary-hover);
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: 0.02em;
}

.user-name {
  color: var(--text);
  font-weight: 700;
  font-size: 0.88rem;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mode-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  border: 1px solid color-mix(in srgb, var(--gold) 55%, var(--border));
  border-radius: var(--radius-pill);
  padding: 4px 12px 4px 10px;
  background: var(--gold-light);
  color: var(--gold);
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

/* Metrics */
.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.metric-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s var(--ease), box-shadow 0.15s var(--ease), border-color 0.15s var(--ease);
}

.metric-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  background: var(--primary-light);
  color: var(--primary-hover);
}

.metric-icon .icon {
  width: 19px;
  height: 19px;
}

.metric-card.is-warning .metric-icon {
  background: var(--warning-light);
  color: var(--warning);
}

.metric-card.is-danger .metric-icon {
  background: var(--danger-light);
  color: var(--danger);
}

.metric-card.is-success .metric-icon {
  background: var(--success-light);
  color: var(--success);
}

.metric-body {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.metric-body span:first-child {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.metric-card strong {
  color: var(--text);
  font-size: 1.3rem;
  font-weight: 700;
  line-height: 1.1;
}

.metric-card small {
  color: var(--muted-2);
  font-size: 0.74rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Main tabs */
.main-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--border);
}

.main-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  padding: 9px 13px;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
}

.main-tab:hover {
  background: var(--surface-2);
  color: var(--text);
}

/* Aba selecionada: fundo um pouco mais claro, de leve. */
.main-tab.is-active {
  border-bottom-color: var(--primary);
  background: transparent;
  color: var(--text);
}

.main-tab em {
  min-width: 20px;
  border-radius: var(--radius-pill);
  padding: 2px 6px;
  background: var(--surface-2);
  color: var(--muted);
  font-style: normal;
  font-size: 0.72rem;
}

.main-tab.is-active em {
  background: var(--primary-light);
  color: var(--primary-hover);
}

/* Queue tabs */
.queue-tabs {
  display: flex;
  flex: none;
  flex-wrap: wrap;
  min-width: 0;
  gap: 6px;
  padding: 12px 12px 4px;
}

.queue-tab {
  display: flex;
  align-items: center;
  flex: none;
  min-width: 0;
  gap: 5px;
  min-height: 32px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 5px 7px;
  background: var(--surface-sunken);
  color: var(--text);
  text-align: left;
}

.queue-tab-icon {
  flex: none;
  width: 18px;
  height: 18px;
  align-items: center;
  justify-content: center;
  display: inline-flex;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--muted);
}

.queue-tab-icon .icon {
  display: inline-flex;
  width: 11px;
  height: 11px;
}

.queue-tab-body {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  flex: 1;
}

.queue-tab-body strong {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  font-size: 0.71rem;
}

.queue-tab-label {
  overflow: hidden;
  min-width: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.queue-tab-count {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: var(--radius-pill);
  background: var(--surface-2);
  color: var(--muted);
  font-style: normal;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  font-size: 0.66rem;
  font-weight: 700;
}


.queue-tab-body > span {
  display: none;
}

.queue-tab:hover {
  border-color: var(--border-strong);
  background: var(--surface-hover);
}

.queue-tab.is-active,
.queue-tab.is-all.is-active {
  border-color: var(--primary);
  background: var(--primary-light);
  box-shadow: var(--shadow-sm);
}

.queue-tab.is-active .queue-tab-icon,
.queue-tab.is-all.is-active .queue-tab-icon {
  background: var(--primary);
  color: #ffffff;
}

.queue-tab.is-active .queue-tab-count,
.queue-tab.is-all.is-active .queue-tab-count {
  background: var(--primary);
  color: #ffffff;
}

/* Toolbar */
.toolbar {
  grid-template-columns: minmax(260px, 1fr) minmax(180px, 240px) minmax(150px, 180px) minmax(170px, 220px);
  align-items: end;
  margin-bottom: 18px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
}

.approved-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 14px;
  margin-bottom: 14px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
}

/* Largura fixa por campo (nao proporcional/auto-fit) -- com grid, aparecer ou sumir o botao
   "Limpar filtros" mudava quantas colunas cabiam por linha e reajustava a largura de todos os
   outros campos junto. Com flex-basis fixo, cada campo mantem o mesmo tamanho independente de
   quantos botoes estao visiveis ao lado. */
.approved-filters label {
  flex: 0 0 190px;
}

.approved-filters button {
  flex: none;
  height: 44px;
}

.approved-limit-note {
  margin: -6px 0 14px;
}

/* Workspace */
.workspace {
  display: grid;
  grid-template-columns: minmax(340px, 540px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.list-panel,
.detail-panel {
  min-width: 0;
  min-height: 560px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.list-panel {
  position: sticky;
  top: 112px;
  max-height: calc(100vh - 132px);
  display: flex;
  flex-direction: column;
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 16px;
  border-bottom: 1px solid var(--border);
  flex: none;
}

.panel-heading h2,
.panel-heading h3 {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  font-size: 1rem;
}

.panel-heading h3 .icon {
  color: var(--muted);
}

.panel-heading span {
  color: var(--muted);
  font-weight: 700;
  font-size: 0.84rem;
  white-space: nowrap;
}

.registration-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
  align-items: stretch;
  justify-content: flex-start;
  overflow: auto;
  padding: 12px;
  flex: 1;
}

.registration-item {
  position: relative;
  display: flex;
  flex: 0 0 auto;
  align-items: flex-start;
  gap: 11px;
  width: 100%;
  border: 1px solid var(--border);
  border-left: 3px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 13px;
  background: var(--surface-sunken);
  color: var(--text);
  text-align: left;
}

.approved-panel {
  margin-top: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.approved-heading {
  border-bottom-color: color-mix(in srgb, var(--success) 28%, var(--border));
}

.approved-heading > div {
  display: grid;
  gap: 3px;
}

.approved-table-wrap {
  overflow: auto;
}

.approved-table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
  table-layout: fixed;
}

/* Largura fixa por coluna (baseada no cabecalho, table-layout: fixed) -- por padrao (table-layout
   auto) cada coluna se ajustava ao conteudo mais largo das linhas visiveis, entao filtrar pra
   menos linhas ou linhas com texto mais curto/longo reajustava a largura de todas as colunas. */
.approved-table th:nth-child(1) { width: 15%; }
.approved-table th:nth-child(2) { width: 7%; }
.approved-table th:nth-child(3) { width: 20%; }
.approved-table th:nth-child(4) { width: 13%; }
.approved-table th:nth-child(5) { width: 17%; }
.approved-table th:nth-child(6) { width: 10%; }
.approved-table th:nth-child(7) { width: 11%; }
.approved-table th:nth-child(8) { width: 7%; }

.approved-table th,
.approved-table td {
  padding: 11px 13px;
  border-bottom: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.84rem;
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.approved-table th {
  background: var(--surface-sunken);
  color: var(--muted-2);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.approved-table tr:hover td {
  background: var(--surface-hover);
}

.approved-table td strong {
  color: var(--text);
}

.approved-open-button {
  min-height: 34px;
  padding: 6px 11px;
  font-size: 0.8rem;
}

.registration-item.is-approved {
  --status-accent: var(--success);
}

.registration-item.is-rejected {
  --status-accent: var(--danger);
}

.registration-item.is-review {
  --status-accent: var(--primary);
}

.registration-item.is-pending {
  --status-accent: var(--warning);
}

.registration-item.is-assignment-free {
  border-left-color: var(--primary);
}

.registration-item.is-assignment-mine {
  border-left-color: var(--success);
}

.registration-item.is-assignment-other {
  border-left-color: var(--attention);
}

.registration-item.is-assignment-mine .registration-avatar {
  background: var(--success-light);
  color: var(--success);
}

.registration-item.is-assignment-other .registration-avatar {
  background: var(--attention-light);
  color: var(--attention);
}

.registration-item:hover {
  border-color: var(--border-strong);
  background: var(--surface-hover);
}

.registration-item.is-active {
  border-color: var(--primary);
  background: var(--primary-light);
  box-shadow: var(--shadow-sm);
}

.registration-avatar {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--muted);
  font-weight: 700;
  font-size: 0.72rem;
}

.registration-item.is-active .registration-avatar {
  background: var(--primary);
  color: #ffffff;
}

.registration-body {
  display: grid;
  gap: 6px;
  min-width: 0;
  flex: 1;
}

.registration-name {
  color: var(--text);
  font-weight: 700;
  font-size: 0.92rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.item-row strong {
  font-size: 0.86rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-weight: 700;
  letter-spacing: 0.01em;
}

.item-muted,
.muted-text {
  color: var(--muted-2);
  font-size: 0.8rem;
}

.assignment-line {
  min-height: 22px;
}

/* Cadastro sem envelope da DocuSign: linha propria, com o que fazer (ADR-031). */
.envelope-alert {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--danger);
  font-size: 0.78rem;
  font-weight: 700;
}

.envelope-alert .icon,
.envelope-alert svg {
  width: 14px;
  height: 14px;
  flex: none;
}

/* Prazo da desistência automática no cartão da lista (ADR-041). */
.withdrawal-line {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--warning);
  font-size: 0.78rem;
  font-weight: 700;
}

.withdrawal-line.is-danger {
  color: var(--danger);
}

.withdrawal-line .icon,
.withdrawal-line svg {
  width: 14px;
  height: 14px;
  flex: none;
}

/* Skeleton loading */
.skeleton-item {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 12px 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-sunken);
}

.skeleton-avatar,
.skeleton-line {
  border-radius: var(--radius-sm);
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 37%, var(--surface-2) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
}

.skeleton-avatar {
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
}

.skeleton-lines {
  display: grid;
  gap: 8px;
  flex: 1;
  padding-top: 3px;
}

.skeleton-line {
  height: 10px;
}

@keyframes shimmer {
  0% {
    background-position: 100% 0;
  }
  100% {
    background-position: -100% 0;
  }
}

/* Status + assignment pills */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  width: fit-content;
  min-height: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 3px 10px;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 700;
  white-space: nowrap;
  flex: none;
}

.status-pill::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.assignment-pill {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 3px 10px;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 700;
}

.assignment-pill.is-free {
  border-color: color-mix(in srgb, var(--primary) 55%, var(--border));
  background: var(--primary-light);
  color: var(--primary-hover);
}

.assignment-pill.is-mine {
  border-color: color-mix(in srgb, var(--success) 55%, var(--border));
  background: var(--success-light);
  color: var(--success);
}

.assignment-pill.is-other {
  border-color: color-mix(in srgb, var(--attention) 55%, var(--border));
  background: var(--attention-light);
  color: var(--attention);
}

.status-pill.is-approved {
  border-color: color-mix(in srgb, var(--success) 50%, var(--border));
  background: var(--success-light);
  color: var(--success);
}

.status-pill.is-rejected {
  border-color: color-mix(in srgb, var(--danger) 50%, var(--border));
  background: var(--danger-light);
  color: var(--danger);
}

.status-pill.is-review {
  border-color: color-mix(in srgb, var(--primary) 50%, var(--border));
  background: var(--primary-light);
  color: var(--primary-hover);
}

.status-pill.is-pending {
  border-color: color-mix(in srgb, var(--warning) 50%, var(--border));
  background: var(--warning-light);
  color: var(--warning);
}

/* Detail panel */
.detail-panel {
  padding: 20px;
}

.detail-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 20px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
}

.detail-heading-main {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.detail-avatar {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  background: var(--primary-light);
  color: var(--primary-hover);
  font-weight: 700;
  font-size: 1rem;
}

.detail-header h2 {
  margin-bottom: 2px;
  font-size: 1.3rem;
  color: var(--text);
  overflow-wrap: anywhere;
}

.detail-badges {
  display: flex;
  flex: none;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}

.readonly-notice {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 18px;
  padding: 14px 15px;
  border: 1px solid color-mix(in srgb, var(--attention) 52%, var(--border));
  border-left: 3px solid var(--attention);
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--attention-light) 72%, var(--surface-sunken));
}

.readonly-icon {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  background: var(--surface-sunken);
  color: var(--attention);
}

.readonly-icon .icon {
  width: 17px;
  height: 17px;
}

.readonly-notice > span:last-child {
  display: grid;
  gap: 3px;
}

.readonly-notice strong {
  color: var(--text);
}

.readonly-notice span span {
  color: var(--muted);
  font-size: 0.88rem;
}

.info-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-2);
}

.info-icon {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  background: var(--surface-3);
  color: var(--muted);
}

.info-card.is-danger {
  border-color: color-mix(in srgb, var(--danger) 40%, var(--border));
}

.info-card.is-danger .info-icon {
  background: var(--danger-light);
  color: var(--danger);
}

.info-card.is-warn {
  border-color: color-mix(in srgb, var(--warning) 40%, var(--border));
}

.info-card.is-warn .info-icon {
  background: var(--warning-light);
  color: var(--warning);
}

.info-card.is-success {
  border-color: color-mix(in srgb, var(--success) 40%, var(--border));
}

.info-card.is-success .info-icon {
  background: var(--success-light);
  color: var(--success);
}

.signature-card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-2);
  margin-top: 20px;
}

.signature-card-status {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.signature-card .secondary-button {
  flex: none;
}

.signature-card.is-danger {
  border-color: color-mix(in srgb, var(--danger) 40%, var(--border));
}

.signature-card.is-danger .info-icon {
  background: var(--danger-light);
  color: var(--danger);
}

.signature-card.is-warn {
  border-color: color-mix(in srgb, var(--warning) 40%, var(--border));
}

.signature-card.is-warn .info-icon {
  background: var(--warning-light);
  color: var(--warning);
}

.signature-card.is-success {
  border-color: color-mix(in srgb, var(--success) 40%, var(--border));
}

.signature-card.is-success .info-icon {
  background: var(--success-light);
  color: var(--success);
}

/* Link de correção (ADR-021) */
.correction-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.correction-card-actions .secondary-button {
  flex: none;
}

.correction-details {
  display: grid;
  gap: 8px;
  flex-basis: 100%;
  margin: 2px 0 0;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.correction-details div {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 10px;
}

.correction-details dt {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.correction-details dd {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  font-size: 0.87rem;
  white-space: pre-line;
}

.correction-chip {
  padding: 2px 9px;
  border: 1px solid color-mix(in srgb, var(--warning) 45%, var(--border));
  border-radius: var(--radius-pill);
  background: var(--warning-light);
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 700;
}

.correction-modal {
  width: min(720px, 100%);
  max-height: calc(100vh - 48px);
  overflow-y: auto;
}

.correction-group {
  margin: 0;
  padding: 0;
  border: 0;
}

.correction-group legend {
  padding: 0;
  font-weight: 700;
  font-size: 0.9rem;
}

.correction-option span {
  display: grid;
  gap: 2px;
}

.correction-option small {
  color: var(--muted);
  font-weight: 500;
  font-size: 0.76rem;
}

.check-row.correction-option:has(input:checked) {
  border-color: color-mix(in srgb, var(--warning) 55%, var(--border));
  background: var(--warning-light);
}

.check-row.correction-option input {
  accent-color: var(--warning);
}

/* Pedido de correção: quem é o cliente, para conferir antes de cancelar o contrato. */
.correction-identity {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 12px 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--surface-2);
}

.correction-identity div {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 10px;
}

.correction-identity dt {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.correction-identity dd {
  margin: 0;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.check-row.correction-confirm {
  border-color: color-mix(in srgb, var(--danger) 45%, var(--border));
}

.check-row.correction-confirm:has(input:checked) {
  background: var(--danger-light);
}

.check-row.correction-confirm input {
  accent-color: var(--danger);
}

.correction-history {
  display: grid;
  gap: 6px;
  margin-top: 12px;
}

.correction-history-row {
  display: grid;
  grid-template-columns: minmax(140px, 1.2fr) minmax(0, 1fr) auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-sunken);
  font-size: 0.84rem;
}

.correction-history-field {
  font-weight: 700;
}

.correction-history-old {
  color: var(--muted);
  text-decoration: line-through;
  overflow-wrap: anywhere;
}

.correction-history-new {
  overflow-wrap: anywhere;
}

.correction-history-date {
  color: var(--muted);
  font-size: 0.75rem;
}

/* Cor suave por fila quando selecionada (Fila geral fica no azul padrao; Aguardando correcao, logo abaixo). */
.queue-tab.is-mine { --queue-accent: #8fd1a8; }
.queue-tab.is-others { --queue-accent: #f0ab97; }
.queue-tab.is-client { --queue-accent: #c3a8e6; }
.queue-tab.is-finalSignature { --queue-accent: #8fd3dd; }

.queue-tab:is(.is-mine, .is-others, .is-client, .is-finalSignature).is-active {
  border-color: color-mix(in srgb, var(--queue-accent) 55%, var(--border));
  background: color-mix(in srgb, var(--queue-accent) 13%, transparent);
}

.queue-tab:is(.is-mine, .is-others, .is-client, .is-finalSignature).is-active .queue-tab-icon,
.queue-tab:is(.is-mine, .is-others, .is-client, .is-finalSignature).is-active .queue-tab-count {
  background: var(--queue-accent);
  color: var(--surface);
}

.queue-tab.is-correction.is-active {
  border-color: color-mix(in srgb, var(--warning) 60%, var(--border));
  background: var(--warning-light);
}

/* Depois das regras de aba ativa: o vermelho vale tambem com a aba selecionada. */
.queue-tab .queue-tab-count.has-alert,
.queue-tab.is-active .queue-tab-count.has-alert {
  background: var(--danger);
  color: #fff;
}

.queue-tab.is-correction.is-active .queue-tab-icon,
.queue-tab.is-correction.is-active .queue-tab-count {
  background: var(--warning);
}

@media (max-width: 720px) {
  .correction-details div,
  .correction-identity div,
  .correction-history-row {
    grid-template-columns: 1fr;
  }

  .correction-history-arrow {
    display: none;
  }
}

.info-icon .icon {
  width: 15px;
  height: 15px;
}

.info-card > span:last-child {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.info-label {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.info-card strong {
  overflow-wrap: anywhere;
  font-size: 0.9rem;
}

.detail-section {
  margin-top: 22px;
}

.assignment-card {
  display: grid;
  gap: 14px;
  margin-top: 12px;
  padding: 15px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-sunken);
}

.assignment-card > div:first-child {
  display: grid;
  gap: 4px;
}

.assignment-card strong {
  color: var(--text);
}

.assignment-card span {
  color: var(--muted);
}

.assignment-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.assignment-actions button {
  font-size: 0.85rem;
}

.assignment-history {
  display: grid;
  gap: 9px;
  margin-top: 12px;
}

.assignment-history h4 {
  margin-bottom: 2px;
  color: var(--muted);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.assignment-history article {
  display: grid;
  gap: 5px;
  padding: 12px 13px;
  border: 1px solid var(--border);
  border-left: 2px solid var(--primary);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}

.assignment-history span,
.assignment-history small {
  color: var(--muted);
}

.assignment-history p {
  margin-bottom: 0;
  color: var(--text);
  font-weight: 600;
}

.assignment-history-details {
  margin-top: 4px;
  border: 0;
  background: transparent;
  overflow: visible;
}

.assignment-history-details summary {
  display: inline-flex;
  width: fit-content;
  min-height: 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 7px 12px;
  background: var(--surface-sunken);
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 700;
}

.assignment-history-details summary:hover {
  border-color: var(--border-strong);
  background: var(--surface-2);
}

.assignment-history-full {
  display: grid;
  gap: 9px;
  margin-top: 10px;
}

.assignment-history-empty {
  margin-top: 12px;
}

.transfer-user-fieldset {
  display: grid;
  gap: 10px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.transfer-user-fieldset legend {
  margin-bottom: 8px;
  color: var(--text);
  font-weight: 700;
}

.transfer-user-list {
  display: grid;
  gap: 8px;
  max-height: 320px;
  overflow: auto;
  padding-right: 4px;
}

.transfer-user-option {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 58px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-sunken);
  cursor: pointer;
}

.transfer-user-option:hover {
  border-color: var(--border-strong);
  background: var(--surface-2);
}

.transfer-user-option:has(input:checked) {
  border-color: var(--primary);
  background: var(--primary-light);
}

.transfer-user-option input {
  width: 17px;
  min-height: 17px;
  accent-color: var(--primary);
}

.transfer-user-main {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.transfer-user-main strong,
.transfer-user-main span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.transfer-user-main span {
  color: var(--muted);
  font-size: 0.82rem;
}

.presence-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 26px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 4px 9px;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
}

.presence-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

.presence-pill.is-online {
  border-color: color-mix(in srgb, var(--success) 70%, var(--border));
  color: var(--success);
}

.presence-pill.is-away {
  border-color: color-mix(in srgb, var(--warning) 70%, var(--border));
  color: var(--warning);
}

.presence-pill.is-offline {
  color: var(--muted-2);
}

.attachment-list {
  display: grid;
  gap: 9px;
  margin-top: 12px;
}

.audit-checklist {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 48px;
  padding: 11px 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-sunken);
  color: var(--muted);
  font-weight: 700;
  font-size: 0.87rem;
}

.check-row:hover {
  border-color: var(--border-strong);
  cursor: pointer;
}

.check-row:has(input:checked) {
  border-color: color-mix(in srgb, var(--success) 55%, var(--border));
  background: var(--success-light);
  color: var(--text);
}

.check-row input {
  flex: none;
  width: 18px;
  min-height: 18px;
  accent-color: var(--success);
}

.check-row input:hover {
  cursor: pointer;
}

.consulta-list {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.consulta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 11px;
  padding: 11px 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-sunken);
}

.consulta-icon {
  flex: none;
  color: var(--muted);
}

.consulta-row .review-attachment-info {
  flex: 1 1 220px;
  min-width: 0;
}

.consulta-upload {
  cursor: pointer;
}

.consulta-upload.is-disabled {
  opacity: 0.6;
  pointer-events: none;
}

.internal-notes {
  margin-top: 12px;
}

.attachment-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-sunken);
}

.attachment-icon {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: var(--surface-3);
  color: var(--muted);
}

.attachment-info {
  display: grid;
  gap: 3px;
  flex: 1;
  min-width: 0;
}

.attachment-info strong {
  font-size: 0.88rem;
}

.attachment-info span {
  color: var(--muted);
  font-size: 0.78rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachment-download {
  flex: none;
  min-height: 36px;
  padding: 7px 13px;
  font-size: 0.82rem;
}

.empty-box {
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 34px 20px;
  text-align: center;
}

.empty-box.empty-box-inline {
  display: flex;
  justify-items: unset;
  justify-content: center;
  align-items: center;
  flex-direction: row;
  gap: 8px;
  padding: 16px;
  text-align: left;
}

.empty-icon {
  width: 34px;
  height: 34px;
  margin-bottom: 4px;
  color: var(--muted-2);
}

.empty-box strong {
  color: var(--text);
  font-size: 0.94rem;
}

.empty-box span {
  color: var(--muted-2);
  font-size: 0.84rem;
  max-width: 280px;
}

.action-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.status-action-button {
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-size: 0.85rem;
}

.status-action-button:hover:not(:disabled) {
  border-color: var(--border-strong);
  background: var(--surface-hover);
}

.status-action-button.is-approve {
  border-color: color-mix(in srgb, var(--success) 40%, var(--border));
  color: var(--success);
}

.status-action-button.is-approve:hover:not(:disabled) {
  background: var(--success-light);
}

.status-action-button.is-reject {
  border-color: color-mix(in srgb, var(--danger) 40%, var(--border));
  color: var(--danger);
}

.status-action-button.is-reject:hover:not(:disabled) {
  background: var(--danger-light);
}

.status-action-button.is-warn {
  border-color: color-mix(in srgb, var(--warning) 40%, var(--border));
  color: var(--warning);
}

.status-action-button.is-warn:hover:not(:disabled) {
  background: var(--warning-light);
}

.status-action-button.is-current {
  border-color: var(--border-strong);
  background: var(--surface-3);
  color: var(--muted);
  opacity: 1;
}

details {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-sunken);
  overflow: hidden;
}

summary {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 14px 16px;
  color: var(--text);
  font-weight: 700;
  font-size: 0.92rem;
  cursor: pointer;
  list-style: none;
}

summary::-webkit-details-marker {
  display: none;
}

.payload-grid {
  display: grid;
  gap: 12px;
  padding: 4px 16px 16px;
  max-height: 460px;
  overflow: auto;
}

.payload-section {
  display: grid;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.payload-section:first-child {
  padding-top: 0;
  border-top: none;
}

.payload-section h4 {
  margin: 0;
  color: var(--text);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.object-table {
  display: grid;
  gap: 8px;
}

.object-table > div {
  display: grid;
  grid-template-columns: minmax(160px, 0.35fr) minmax(0, 1fr);
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid color-mix(in srgb, var(--border) 60%, transparent);
}

.object-table > div:last-child {
  border-bottom: none;
}

.object-table span {
  color: var(--muted);
  font-size: 0.85rem;
}

.object-table strong {
  overflow-wrap: anywhere;
  font-size: 0.88rem;
  font-weight: 600;
}

.object-value {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 0.88rem;
}

.object-value > strong {
  font-weight: 600;
}

.object-value .object-table,
.object-value .array-list {
  margin-top: 4px;
}

.array-list {
  display: grid;
  gap: 12px;
}

/* Modals */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(2, 11, 20, 0.78);
  animation: fade-in 0.15s var(--ease);
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
}

.action-modal {
  position: relative;
  display: grid;
  gap: 14px;
  width: min(560px, 100%);
  padding: 28px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  animation: pop-in 0.18s var(--ease);
}

/* Modal salvando: a tela é redesenhada, mas o modal não repete a animação de entrada. */
.modal-backdrop.is-busy,
.modal-backdrop.is-busy .action-modal,
.modal-backdrop.is-settled,
.modal-backdrop.is-settled .approved-modal {
  animation: none;
}

.approved-modal {
  position: relative;
  display: grid;
  gap: 16px;
  width: min(1180px, 100%);
  height: min(860px, calc(100vh - 48px));
  overflow: hidden;
  padding: 28px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  animation: pop-in 0.18s var(--ease);
}

.approved-modal-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 20px;
  align-items: start;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.approved-modal-main {
  display: grid;
  gap: 16px;
  min-width: 0;
  max-height: 100%;
  overflow: auto;
  padding-right: 6px;
  overscroll-behavior: contain;
}

.approved-modal-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-right: 48px;
}

.approved-modal-header h3 {
  margin-bottom: 2px;
  font-size: 1.25rem;
}

.approved-modal-header p:last-child {
  margin-bottom: 0;
  color: var(--muted);
}

.approved-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.approved-details {
  margin-top: 2px;
}

.approved-details .payload-grid {
  max-height: none;
  overflow: visible;
}

.approved-documents {
  display: grid;
  gap: 12px;
}

.is-approved-list {
  margin-top: 0;
}

.attachment-group {
  display: grid;
  gap: 10px;
  padding: 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-sunken);
}

.attachment-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.attachment-group-header strong {
  color: var(--text);
  font-size: 0.9rem;
}

.attachment-group-header span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.expected-attachment-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.expected-attachment-list span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 26px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 4px 8px;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.73rem;
  font-weight: 700;
}

.expected-attachment-list .icon {
  width: 13px;
  height: 13px;
}

.expected-attachment-list .is-present {
  border-color: color-mix(in srgb, var(--success) 45%, var(--border));
  color: var(--success);
}

.expected-attachment-list .is-missing {
  border-color: color-mix(in srgb, var(--attention) 55%, var(--border));
  color: var(--attention);
}

.attachment-group-list {
  display: grid;
  gap: 8px;
}

.attachment-group .attachment-item {
  background: var(--surface);
}

.approved-side-actions {
  position: sticky;
  top: 0;
  display: grid;
  gap: 12px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-sunken);
}

.approved-side-actions h4 {
  margin: 0 0 2px;
  color: var(--muted);
  font-size: 0.86rem;
  text-transform: uppercase;
}

.side-action-button {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 40px;
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px 11px;
  background: var(--surface-2);
  color: var(--text);
  font-weight: 700;
  text-align: left;
}

.side-action-button:hover {
  border-color: var(--primary-hover);
  background: var(--surface-hover);
}

.side-action-button.is-danger {
  border-color: color-mix(in srgb, var(--danger) 42%, var(--border));
  color: var(--danger);
}

.side-action-button.is-danger:hover {
  background: var(--danger-light);
}

.generated-link-box {
  display: grid;
  gap: 6px;
  padding: 11px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.generated-link-box span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.generated-link-box code {
  display: block;
  overflow-wrap: anywhere;
  font-size: 0.76rem;
}

.approved-note-field {
  display: grid;
  gap: 7px;
  color: var(--text);
  font-weight: 700;
}

.approved-note-field textarea {
  min-height: 128px;
  resize: vertical;
}

.danger-button {
  background: var(--danger);
  color: #fff;
}

.danger-button:hover {
  background: color-mix(in srgb, var(--danger) 82%, #000);
}

@keyframes pop-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
}

.modal-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  background: var(--primary-light);
  color: var(--primary-hover);
  margin-bottom: -4px;
}

.modal-icon .icon {
  width: 20px;
  height: 20px;
}

.modal-icon.is-approve {
  background: var(--success-light);
  color: var(--success);
}

.modal-icon.is-reject {
  background: var(--danger-light);
  color: var(--danger);
}

.modal-icon.is-warn {
  background: var(--warning-light);
  color: var(--warning);
}

.action-modal h3 {
  margin-bottom: 0;
  font-size: 1.15rem;
}

.modal-close-button {
  position: absolute;
  top: 14px;
  right: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--muted);
  z-index: 1;
}

.modal-close-button:hover {
  border-color: var(--border-strong);
  color: var(--text);
}

.modal-close-button .icon {
  width: 16px;
  height: 16px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

@media (max-width: 1180px) {
  .metric-grid,
  .approved-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .transfer-user-option {
    grid-template-columns: auto auto minmax(0, 1fr);
  }

  .presence-pill {
    grid-column: 3;
    justify-self: start;
  }
}

@media (max-width: 980px) {
  .app-shell {
    width: min(100% - 24px, 760px);
  }

  .topbar,
  .detail-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .brand .brand-mark {
    margin: -6px 0 -4px;
    width: 76px;
    height: 44px;
  }

  .brand > div {
    padding-left: 10px;
  }

  .brand > div,
  .topbar .user-box {
    transform: none;
  }

  .user-box {
    justify-content: flex-start;
    width: 100%;
  }

  .toolbar,
  .workspace,
  .audit-checklist {
    grid-template-columns: 1fr;
  }

  .list-panel {
    position: static;
    max-height: none;
  }

  .registration-list {
    max-height: 60vh;
  }

  .object-table > div {
    grid-template-columns: 1fr;
  }

  .approved-modal-layout {
    grid-template-columns: 1fr;
  }

  .approved-side-actions {
    position: static;
  }
}

@media (max-width: 640px) {
  .approved-summary-grid {
    grid-template-columns: 1fr;
  }

  .metric-grid {
    gap: 8px;
  }

  .metric-card small,
  .metric-icon {
    display: none;
  }
}

/* Recusados: motivo da recusa na tabela */
.rejected-row {
  cursor: pointer;
}

.rejected-row:hover td {
  background: var(--surface-hover);
}

/* Na lista o motivo fica numa linha só; o texto inteiro aparece no modal. */
.rejected-reason {
  max-width: 280px;
}

.rejected-reason strong,
.rejected-reason small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rejected-reason small {
  margin-top: 2px;
  color: var(--muted);
}

.rejected-modal {
  width: min(640px, 100%);
  max-height: calc(100vh - 48px);
  overflow-y: auto;
}

.rejected-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 16px;
}

.rejected-field,
.rejected-note {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.rejected-field span,
.rejected-note span {
  color: var(--muted);
  font-size: 0.75rem;
}

.rejected-field strong {
  overflow-wrap: anywhere;
}

.rejected-note p {
  margin: 0;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md, 8px);
  background: var(--surface-sunken);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

@media (max-width: 640px) {
  .rejected-fields {
    grid-template-columns: 1fr;
  }
}

/* ---- Painel de gestão (ADR-020) ---- */
.management {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.management-heading {
  border-bottom-color: var(--border);
}

.management-heading .kicker {
  margin-bottom: 4px;
}

.management-heading h2 .icon {
  color: var(--muted);
}

.management-section-title {
  margin: 0;
  padding: 18px 18px 10px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.management-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 460px), 1fr));
  gap: 14px;
  padding: 0 18px 18px;
}

.action-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  background: var(--surface-sunken);
}

.action-card-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.action-card-icon {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: var(--primary-light);
  color: var(--primary-hover);
  flex: none;
}

.action-card-title {
  flex: 1;
  min-width: 0;
}

.action-card-title h4 {
  margin: 0 0 2px;
  font-size: 1rem;
}

.action-card-title p,
.action-card-help {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.action-card-count {
  min-width: 44px;
  border-radius: var(--radius-pill);
  padding: 4px 12px;
  background: var(--surface-3);
  font-size: 1.25rem;
  font-weight: 700;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.action-card-alert {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  border: 1px solid color-mix(in srgb, var(--warning) 40%, transparent);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  background: var(--warning-light);
  color: var(--warning);
  font-size: 0.88rem;
  font-weight: 700;
}

.signature-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.signature-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 14px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  background: var(--surface);
}

.signature-row.is-stale {
  border-left-color: var(--warning);
}

.signature-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.signature-main strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.signature-main span {
  color: var(--muted);
  font-size: 0.82rem;
}

.signature-age {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
  white-space: nowrap;
}

.signature-row.is-stale .signature-age {
  color: var(--warning);
}

.signature-button {
  min-height: 38px;
  padding: 7px 14px;
}

.action-card-empty {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
  color: var(--muted);
}

.action-card-empty .icon {
  color: var(--success);
}

@media (max-width: 640px) {
  .management-section-title {
    padding: 16px 16px 8px;
  }

  .management-actions {
    padding: 0 12px 12px;
  }

  .signature-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .signature-button {
    grid-column: 1 / -1;
    width: 100%;
  }
}

/* Gestão: sub-abas e pedidos de exclusão */
.management-tabs {
  margin: 0 18px 16px;
  padding-top: 10px;
}

.management-actions {
  padding-top: 4px;
}

.action-card-icon.is-danger {
  background: var(--danger-light);
  color: var(--danger);
}

.exclusion-row {
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: start;
}

.exclusion-reason {
  margin: 6px 0 0;
  color: var(--text);
  font-size: 0.88rem;
  overflow-wrap: anywhere;
}

.exclusion-buttons {
  display: flex;
  gap: 8px;
}

.exclusion-buttons button {
  min-height: 38px;
  padding: 7px 14px;
}

.exclusion-own {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  max-width: 180px;
}

.exclusion-history {
  border-top: 1px solid var(--border);
  padding-top: 10px;
  color: var(--muted);
  font-size: 0.86rem;
}

.exclusion-history summary {
  cursor: pointer;
  font-weight: 700;
}

.exclusion-history ul {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}

.exclusion-history li {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.exclusion-badge {
  flex: none;
  border-radius: var(--radius-pill);
  padding: 1px 9px;
  font-size: 0.76rem;
  font-weight: 700;
}

.exclusion-badge.is-done {
  background: var(--danger-light);
  color: var(--danger);
}

.exclusion-badge.is-denied {
  background: var(--surface-3);
  color: var(--muted);
}

.exclusion-pending {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0;
  border: 1px solid color-mix(in srgb, var(--warning) 40%, transparent);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  background: var(--warning-light);
  color: var(--warning);
  font-size: 0.86rem;
  font-weight: 700;
}

.exclusion-pending.is-denied,
.exclusion-pending.is-danger {
  border-color: color-mix(in srgb, var(--danger) 40%, transparent);
  background: var(--danger-light);
  color: var(--danger);
}

.exclusion-pending .icon {
  flex: none;
}

.rejected-delete {
  margin-top: 14px;
}

.check-line {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
}

.check-line input {
  width: 18px;
  height: 18px;
  accent-color: var(--danger);
}

@media (max-width: 640px) {
  .management-tabs {
    margin: 0 12px 12px;
  }

  .exclusion-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .exclusion-buttons,
  .exclusion-own {
    grid-column: 1 / -1;
    max-width: none;
  }

  .exclusion-buttons button {
    flex: 1;
  }
}

/* Com a aba Gestão, as abas principais rolam de lado no celular em vez de alargar a página. */
@media (max-width: 640px) {
  .main-tabs {
    overflow-x: auto;
    scrollbar-width: none;
  }

  .main-tab {
    flex: none;
    white-space: nowrap;
  }
}
/* ---- Conferência do cadastro (dados, documento e anexos) ---- */
.review-tabs {
  margin: 0 16px;
  padding-top: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}

.review-tabs .main-tab {
  flex: none;
  white-space: nowrap;
}

.review-body {
  padding: 16px;
}

.review-data {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.review-section {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  background: var(--surface-sunken);
}

.review-section h4 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.review-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr));
  gap: 12px 20px;
  margin: 0;
}

.review-row {
  min-width: 0;
}

.review-row.is-wide {
  grid-column: 1 / -1;
}

.review-row dt {
  margin-bottom: 2px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.review-row dd {
  margin: 0;
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.review-row dd small {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  color: var(--warning);
  font-size: 0.8rem;
}

.review-row.is-flagged dd {
  color: var(--warning);
}

.review-empty {
  color: var(--muted-2);
  font-weight: 400;
  font-style: normal;
}

.review-person {
  margin-top: 12px;
  border-top: 1px solid var(--border);
  padding-top: 12px;
}

.review-person:first-of-type {
  margin-top: 0;
  border-top: 0;
  padding-top: 0;
}

.review-section > .review-list + .review-person {
  margin-top: 14px;
  border-top: 1px solid var(--border);
  padding-top: 12px;
}

.review-person header {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.review-tag {
  border-radius: var(--radius-pill);
  padding: 1px 9px;
  background: var(--primary-light);
  color: var(--primary-hover);
  font-size: 0.74rem;
  font-weight: 700;
}

.review-others summary {
  cursor: pointer;
  color: var(--muted);
  font-weight: 700;
}

.review-others[open] summary {
  margin-bottom: 12px;
}

.review-doc-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 12px;
}

.review-doc-bar strong,
.review-doc-bar span {
  display: block;
}

.review-doc-bar span {
  color: var(--muted);
  font-size: 0.85rem;
}

.review-doc-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.review-doc-actions .secondary-button {
  min-height: 38px;
  padding: 7px 14px;
  text-decoration: none;
}

.review-pdf {
  display: block;
  width: 100%;
  height: 75vh;
  min-height: 480px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: #ffffff;
}

.review-attachments {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr));
  gap: 12px;
  margin-bottom: 10px;
}

.review-attachment {
  display: flex;
  flex-direction: column;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px;
  background: var(--surface-sunken);
}

.review-thumb {
  display: grid;
  place-items: center;
  height: 140px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  overflow: hidden;
}

.review-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.review-thumb.is-placeholder {
  color: var(--muted);
}

.review-thumb.is-placeholder .icon svg {
  width: 32px;
  height: 32px;
}

.review-attachment-info strong,
.review-attachment-info span {
  display: block;
}

.review-attachment-info span {
  color: var(--muted);
  font-size: 0.8rem;
}

.review-attachment .attachment-download {
  min-height: 36px;
  padding: 6px 12px;
  /* Nome do documento em 1 ou 2 linhas: o botao fica sempre no rodape do cartao, alinhado aos vizinhos. */
  margin-top: auto;
}

@media (max-width: 640px) {
  .review-tabs {
    margin: 0 12px;
  }

  .review-body {
    padding: 12px;
  }

  .review-pdf {
    height: 65vh;
    min-height: 360px;
  }
}

/* ---- Indicadores (ADR-020) ---- */
.indicators-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}

.indicators-periods {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.indicators-period {
  padding: 7px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--muted);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
}

.indicators-period:hover {
  background: var(--surface-hover);
  color: var(--text);
}

.indicators-period.is-active {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--text);
}

.indicators-loading {
  margin: 0;
  padding: 10px 18px 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.indicators-body {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding: 18px;
}

.indicators-tiles {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
}

.indicators-tile {
  display: grid;
  gap: 4px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-2);
}

.indicators-tile span {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
}

.indicators-tile strong {
  font-size: 1.6rem;
  line-height: 1.1;
}

.indicators-tile small {
  color: var(--muted-2);
  font-size: 0.75rem;
}

.indicators-tile.is-warning {
  border-color: color-mix(in srgb, var(--warning) 45%, var(--border));
  background: var(--warning-light);
}

.indicators-card {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-2);
}

.indicators-card.is-wide {
  grid-column: 1 / -1;
}

.indicators-card h3 {
  margin: 0 0 10px;
  font-size: 0.95rem;
}

.indicators-note,
.indicators-empty {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 0.8rem;
}

.indicators-empty {
  margin: 8px 0 0;
}

.volume-chart {
  position: relative;
  padding-left: 28px;
}

.volume-max {
  position: absolute;
  top: 0;
  left: 0;
  color: var(--muted-2);
  font-size: 0.72rem;
}

.volume-bars {
  display: flex;
  align-items: stretch;
  gap: 2px;
  height: 180px;
  border-bottom: 1px solid var(--border-strong);
  background: linear-gradient(var(--border) 1px, transparent 1px) top / 100% 50%;
}

.volume-col {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-width: 0;
}

.volume-bar {
  display: block;
  border-radius: 4px 4px 0 0;
  background: var(--primary);
}

.volume-col:hover .volume-bar {
  background: var(--primary-hover);
}

.volume-col small {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  color: var(--muted-2);
  font-size: 0.68rem;
  white-space: nowrap;
}

.volume-tip {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  z-index: 2;
  display: none;
  padding: 6px 8px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-3);
  color: var(--muted);
  font-size: 0.75rem;
  white-space: nowrap;
  transform: translateX(-50%);
  pointer-events: none;
}

.volume-tip b {
  margin-left: 6px;
  color: var(--text);
}

.volume-col:hover .volume-tip {
  display: block;
}

.volume-chart {
  margin-bottom: 22px;
}

.bar-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.bar-list li {
  display: grid;
  grid-template-columns: minmax(0, 11rem) minmax(0, 1fr) 2.5rem;
  align-items: center;
  gap: 10px;
}

.bar-list-label {
  display: grid;
  font-size: 0.85rem;
}

.bar-list-label small {
  color: var(--muted-2);
  font-size: 0.72rem;
}

.bar-list-track {
  height: 10px;
  border-radius: 0 4px 4px 0;
  background: var(--surface-sunken);
}

.bar-list-fill {
  display: block;
  height: 100%;
  border-radius: 0 4px 4px 0;
  background: var(--primary);
}

.bar-list li:hover .bar-list-fill {
  background: var(--primary-hover);
}

.bar-list strong {
  text-align: right;
}

.indicators-table-wrap {
  overflow-x: auto;
}

.indicators-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.indicators-table th,
.indicators-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  white-space: nowrap;
}

.indicators-table th {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
}

.indicators-table tbody tr:hover {
  background: var(--surface-hover);
}

@media (max-width: 760px) {
  .indicators-body {
    grid-template-columns: minmax(0, 1fr);
    padding: 12px;
  }

  .bar-list li {
    grid-template-columns: minmax(0, 8rem) minmax(0, 1fr) 2rem;
  }
}

.review-note {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.8rem;
}

/* Assinatura final feita, esperando a DocuSign confirmar (vai para Aprovados sozinho). */
.signature-button.is-signed,
.signature-button.is-signed:disabled {
  border-color: var(--success);
  background: var(--success);
  color: #06281a;
  opacity: 1;
  cursor: default;
}

.signature-age.is-validating {
  color: var(--success);
}

.loading-dots {
  display: inline-block;
  width: 1.2em;
  text-align: left;
}

.loading-dots::after {
  content: ".";
  animation: loading-dots 1.2s steps(1, end) infinite;
}

@keyframes loading-dots {
  0% { content: "."; }
  33% { content: ".."; }
  66% { content: "..."; }
}

@media (prefers-reduced-motion: reduce) {
  .loading-dots::after {
    content: "...";
    animation: none;
  }
}

/* Contratos com a guarda de 5 anos vencida (ADR-030). */
.expired-contracts {
  display: grid;
  gap: 10px;
  margin: 0 18px 14px;
  padding: 14px;
  border: 1px solid color-mix(in srgb, var(--warning) 45%, var(--border));
  border-radius: var(--radius-md);
  background: var(--warning-light);
}

.expired-contracts p {
  display: flex;
  gap: 8px;
  margin: 0;
  font-size: 0.88rem;
}

.expired-contracts p .icon {
  flex: none;
  color: var(--warning);
}

.expired-contracts ul {
  margin: 0;
  padding-left: 26px;
  color: var(--muted);
  font-size: 0.82rem;
}

.expired-contracts .danger-button {
  justify-self: start;
}

.expired-contracts small {
  color: var(--muted);
}

/* Subtítulos da conferência (Cadastro, Médico, Contato...) em dourado. */
.review-section h4 {
  color: var(--gold);
}

/* Paginação da aba Aprovados (50 por página). */
.approved-pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 14px 16px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.88rem;
}

.pager-button {
  min-height: 34px;
  padding: 6px 10px;
}

.pager-select {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 8px;
  color: var(--muted);
  font-weight: 400;
}

.pager-select select {
  width: auto;
  min-width: 76px;
  min-height: 34px;
  padding: 4px 30px 4px 10px;
}

/* Consultores (ADR-044) */
.status-stack {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
  min-width: 0;
}

.consultant-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 160px;
  overflow: hidden;
  color: var(--muted-2);
  font-size: 0.72rem;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.consultant-tag svg {
  flex: none;
  width: 11px;
  height: 11px;
}

.consultants-help {
  margin: 0;
  padding: 12px 16px;
}

.consultants-table {
  min-width: 860px;
}

.consultants-table th:nth-child(1) { width: 20%; }
.consultants-table th:nth-child(2) { width: 36%; }
.consultants-table th:nth-child(3) { width: 24%; }
.consultants-table th:nth-child(4) { width: 20%; }

.consultants-table td:first-child {
  white-space: normal;
}

.consultants-table tr.is-inactive td {
  opacity: 0.7;
}

.consultant-inactive {
  display: block;
  margin-top: 2px;
  color: var(--muted-2);
  font-size: 0.74rem;
}

.consultant-link {
  font-size: 0.8rem;
  user-select: all;
}

.approved-table td.consultant-actions {
  white-space: normal;
}

.consultant-actions button {
  min-height: 34px;
  margin: 2px 6px 2px 0;
  padding: 6px 11px;
  font-size: 0.8rem;
}

.consultants-manage {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr));
  gap: 14px;
  margin: 16px;
}

.consultants-card {
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
}

.consultants-card h3 {
  margin: 0;
  font-size: 0.95rem;
}

.consultants-card label {
  display: grid;
  gap: 6px;
}

.consultants-card textarea {
  resize: vertical;
}

.consultants-card .primary-button {
  justify-self: start;
}

.indicators-table tr.is-top td {
  color: var(--text);
  font-weight: 700;
  background: var(--primary-light);
}
