:root {
  --marinho:#15263d;
  --marinho-deep:#0c1828;
  --marinho-mid:#21436b;
  --grafite:#2a313a;
  --grafite-light:#4a5568;
  --bronze:#a6763f;
  --bronze-light:#c89b66;
  --bronze-subtle:rgba(166,118,63,0.10);
  --bg:#f6f4ef;
  --card:#ffffff;
  --border:#e2ddd2;
  --border-dark:#cfc9bc;
  --sel-bg:rgba(33,67,107,0.10);
  --sel-border:rgba(33,67,107,0.34);
  --sel-bar:var(--bronze);
  --hover-bg:rgba(33,67,107,0.05);
  --text:#171b20;
  --text-secondary:#3d444c;
  --text-muted:#626c77;
  --success:#1a7a54;
  --success-light:#d9f0e5;
  --warning:#a67c00;
  --warning-light:#fbf3df;
  --danger:#a12a33;
  --danger-light:#fbe6e7;
  --info:#2563eb;
  --focus-ring:rgba(166,118,63,0.22);
  --sidebar-w:272px;
  --serif:'Source Serif 4',Georgia,serif;
  --sans:'Inter',-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif;
  --radius-input:6px;
  --radius-card:10px;
  --radius-btn:6px;
  --radius-badge:3px;
  --radius-pill:999px;
  --shadow-card:0 1px 3px rgba(0,0,0,0.06), 0 4px 14px rgba(21,38,61,0.05);
  --shadow-soft:0 1px 2px rgba(21,38,61,0.05);
  /* Aliases de compatibilidade: tokens legados referenciados em telas (Nova Entrada/Sobre/Admin),
     mapeados aos canônicos para não resolverem vazio. */
  --surface:var(--card);
  --surface-soft:#fbfaf7;
  --muted:var(--text-muted);
  --ink:var(--marinho);
  --ouro-light:var(--bronze-light);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 14px;
  color: var(--text);
  background:
    radial-gradient(circle at top right, var(--bronze-subtle), transparent 28%),
    linear-gradient(180deg,#f8f6f1,#f1eee7);
}

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

[hidden] {
  display: none !important;
}

button {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: var(--radius-btn);
  padding: 9px 15px;
  color: white;
  background: var(--marinho);
  box-shadow: none;
  cursor: pointer;
  font-weight: 600;
  transition: background .15s ease, border-color .15s ease, box-shadow .15s ease, color .15s ease;
}

button:hover { background: var(--marinho-mid); box-shadow: var(--shadow-card); }
button:disabled { opacity: .5; cursor: not-allowed; box-shadow: none; }
button.ghost { background: transparent; color: var(--text); border-color: var(--border-dark); box-shadow: none; }
button.ghost:hover { background: #faf8f4; border-color: var(--text-muted); box-shadow: none; }
button.btn-outline { background:#fff; color: var(--text-secondary); border-color: var(--border-dark); box-shadow: none; }
button.btn-outline:hover { background:#faf8f4; border-color: var(--text-muted); }
button.btn-accent { background: var(--bronze); }
button.btn-accent:hover { background:#946838; box-shadow: var(--shadow-card); }
button.btn-danger { background: var(--danger); }
button.btn-danger:hover { background:#8c2530; box-shadow: var(--shadow-card); }
button.btn-sm { min-height: 30px; padding: 5px 11px; font-size: 12px; }
button svg { width: 18px; height: 18px; flex: 0 0 auto; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: var(--sidebar-w) 1fr; }

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  color: #f7f4ee;
  background:
    radial-gradient(circle at 18% 8%, rgba(200,155,102,.12), transparent 24%),
    linear-gradient(165deg, rgba(166,118,63,.08), transparent 30%),
    linear-gradient(180deg, var(--marinho), var(--marinho-deep));
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: 8px 0 28px rgba(12,24,40,.10);
}

.brand {
  display: grid;
  gap: 13px;
  padding: 0 0 15px;
  border-bottom: 1px solid rgba(255,255,255,.14);
}

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

.brand-icon {
  width: 39px;
  height: 39px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(200,155,102,.34);
  border-radius: 10px;
  color: #f8e3bf;
  background:
    linear-gradient(135deg, rgba(200,155,102,.12), rgba(255,255,255,.03)),
    rgba(4,12,22,.24);
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 800;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.03), 0 6px 16px rgba(0,0,0,.13);
}

.brand strong {
  display: block;
  font-family: var(--serif);
  font-size: 29px;
  line-height: .85;
  letter-spacing: .08em;
}

.brand em {
  display: block;
  margin-top: 3px;
  color: rgba(248,244,234,.48);
  font-size: 9px;
  font-style: normal;
  font-weight: 800;
  letter-spacing: .18em;
  text-transform: uppercase;
}

.tenant-card {
  display: grid;
  gap: 5px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 10px;
  padding: 11px 12px;
  background: rgba(255,255,255,.032);
}

.tenant-card span {
  color: rgba(200,155,102,.84);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.tenant-card strong {
  color: #fff;
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.tenant-card small {
  color: rgba(247,244,238,.72);
  font-size: 11px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

nav {
  min-height: 0;
  display: grid;
  gap: 7px;
  overflow-y: auto;
  scrollbar-width: none;
}

nav::-webkit-scrollbar {
  display: none;
}

.nav-section {
  margin: 8px 8px 3px;
  color: rgba(255,255,255,.45);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

.nav-section-admin {
  margin-top: 16px;
}

nav button {
  position: relative;
  width: 100%;
  justify-content: flex-start;
  align-items: center;
  gap: 11px;
  text-align: left;
  border: 1px solid transparent;
  border-radius: 10px;
  color: rgba(247,244,238,.82);
  background: transparent;
  box-shadow: none;
  padding: 10px 11px;
}

nav button svg {
  width: 20px;
  height: 20px;
  padding: 2px;
  color: rgba(248,244,234,.72);
}

nav button > span {
  min-width: 0;
  display: grid;
  gap: 2px;
}

nav button strong {
  color: inherit;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.15;
}

nav button small {
  color: rgba(247,244,238,.47);
  font-size: 10.5px;
  font-weight: 650;
  line-height: 1.2;
}

nav button.active,
nav button:hover {
  color: #fff;
  border-color: rgba(200,155,102,.48);
  background:
    linear-gradient(135deg, rgba(200,155,102,.10), rgba(255,255,255,.028)),
    rgba(255,255,255,.032);
  transform: translateY(-1px);
  box-shadow: var(--shadow-card);
}

nav button.active::before {
  content: "";
  position: absolute;
  left: -1px;
  top: 12px;
  bottom: 12px;
  width: 2px;
  border-radius: 999px;
  background: rgba(200,155,102,.82);
}

nav button.active svg,
nav button:hover svg {
  color: #f8e3bf;
}

nav button.active small,
nav button:hover small {
  color: rgba(248,244,234,.66);
}

.sidebar-footer-card {
  display: grid;
  gap: 5px;
  margin-top: auto;
  border: 1px solid rgba(200,155,102,.14);
  border-radius: 10px;
  padding: 12px;
  background:
    linear-gradient(135deg, rgba(200,155,102,.07), transparent),
    rgba(3,8,14,.16);
}

.sidebar-footer-card span {
  color: rgba(200,155,102,.86);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.sidebar-footer-card strong {
  color: #fff;
  font-size: 12px;
  line-height: 1.25;
}

.sidebar-footer-card small {
  color: rgba(247,244,238,.58);
  font-size: 10.5px;
  line-height: 1.35;
}

.sidebar button.ghost {
  margin-top: 0;
  color: #f7f4ee;
  border-color: rgba(255,255,255,.24);
  flex: 0 0 auto;
}

.sidebar-about-button {
  min-height: 34px;
  width: 100%;
  justify-content: center;
  border-color: rgba(200,155,102,.22);
  background: rgba(255,255,255,.035);
  color: rgba(247,244,238,.82);
  box-shadow: none;
}

.sidebar-about-button:hover {
  color: #fff;
  border-color: rgba(200,155,102,.48);
  background: rgba(200,155,102,.10);
  transform: translateY(-1px);
}

.sidebar-about-button.active {
  color: #fff;
  border-color: rgba(200,155,102,.48);
  background: rgba(200,155,102,.10);
  box-shadow: inset 2px 0 0 rgba(200,155,102,.82);
}

#logoutBtn {
  min-height: 36px;
  border-radius: 10px;
}

.workspace { width: 100%; min-width: 0; padding: 26px; }

.exec-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin: -26px -26px 22px;
  padding: 18px 26px;
  border-bottom: 1px solid rgba(226,221,210,.82);
  background: rgba(246,244,239,.78);
  backdrop-filter: blur(12px);
}

.breadcrumb {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.3px;
  text-transform: uppercase;
}

.page-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.exec-header h1 {
  margin: 3px 0 0;
  font-family: var(--serif);
  font-size: 34px;
  line-height: 1;
  color: var(--marinho);
}

.page-help-button {
  width: 28px;
  height: 28px;
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 4px;
  border: 1px solid rgba(166,118,63,.26);
  border-radius: 50%;
  padding: 0;
  color: var(--text-secondary);
  background: rgba(255,255,255,.66);
  box-shadow: none;
  font-size: 13px;
  font-weight: 700;
}

.page-help-button:hover,
.page-help-button:focus-visible {
  color: var(--marinho);
  border-color: rgba(166,118,63,.48);
  background: #fffaf0;
}

.exec-context { display: flex; flex-wrap: wrap; justify-content: end; gap: 8px; }
.ente-chip, .profile-chip, .context-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 32px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 7px 11px;
  background: rgba(255,255,255,.78);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  box-shadow: var(--shadow-soft);
}
.profile-chip { color: var(--marinho); background: var(--bronze-subtle); border-color: rgba(166,118,63,.28); }

.context-help-overlay[hidden] {
  display: none;
}

.context-help-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  justify-content: flex-end;
  align-items: stretch;
  background: rgba(9, 22, 36, .18);
}

.context-help-panel {
  position: relative;
  width: min(390px, calc(100vw - 28px));
  height: calc(100vh - 28px);
  margin: 14px;
  display: grid;
  align-content: start;
  gap: 12px;
  border: 1px solid rgba(166,118,63,.28);
  border-radius: 10px;
  padding: 20px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.98), rgba(250,248,243,.96)),
    #fff;
  box-shadow: var(--shadow-card);
  overflow: auto;
  outline: none;
}

.context-help-panel h2 {
  margin: 0 34px 0 0;
  color: var(--marinho);
  font-family: var(--serif);
  font-size: 25px;
  line-height: 1.08;
}

.context-help-close {
  position: absolute;
  top: 13px;
  right: 13px;
  width: 30px;
  height: 30px;
  min-height: 30px;
  border-radius: 50%;
  padding: 0;
  color: var(--text-secondary);
  background: #fff;
  box-shadow: none;
}

.context-help-body {
  display: grid;
  gap: 9px;
}

.context-help-block {
  display: grid;
  gap: 5px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 11px;
  background: #fbfaf7;
}

.context-help-block span {
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.context-help-block p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.42;
}

.context-help-ok {
  width: 100%;
  margin-top: 2px;
}

.view { display: none; }
.view.active { display: block; animation: sancia-view-in .18s ease both; }
@keyframes sancia-view-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

section > header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

/* Título semântico da seção: oculto visualmente (o cabeçalho executivo mostra o rótulo),
   mas preservado para leitores de tela e navegação por landmarks (WCAG). */
section > header h1 {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
h1, h2, h3 { color: var(--marinho); }
h2 { font-size: 17px; margin: 0 0 14px; font-weight: 700; font-family: var(--serif); letter-spacing: -0.2px; }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(175px, 1fr)); gap: 14px; margin-bottom: 14px; }
.card, .panel, .detail, .table {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 18px;
  box-shadow: var(--shadow-card);
}
.card { min-height: 122px; transition: transform .22s ease, box-shadow .22s ease; }
.card:hover { box-shadow: var(--shadow-card); border-color: var(--border-dark); }
.card strong { display: block; font-family: var(--serif); font-size: 38px; line-height: 1; color: var(--marinho); }
.card span { display: block; margin-top: 10px; color: var(--text-muted); font-size: 10px; font-weight: 800; letter-spacing: 1.1px; text-transform: uppercase; }

.dashboard-grid, .fiscal-grid, .split { min-width: 0; display: grid; gap: 14px; }
.dashboard-grid > *,
.fiscal-grid > *,
.split > *,
.flow-steps > * { min-width: 0; }
.dashboard-grid { grid-template-columns: minmax(320px, 1fr) minmax(280px, .75fr); }
.clean-dashboard { grid-template-columns: minmax(360px, 1fr) minmax(240px, .48fr); align-items: start; }
.flow-steps {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 14px;
}
.flow-step {
  min-width: 0;
  min-height: 126px;
  display: grid;
  align-content: start;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  background: #fff;
  box-shadow: var(--shadow-soft);
}
.flow-step > span {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  color: #fff;
  background: var(--marinho);
  font-size: 12px;
  font-weight: 700;
}
.flow-step strong { color: var(--marinho); font-size: 15px; }
.flow-step p { margin: 0; color: var(--text-secondary); line-height: 1.45; }
.flow-step small { color: var(--text-muted); font-weight: 800; }
.compact-kpis { display: grid; gap: 0; }
.kpi-row {
  min-height: 44px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
}
.kpi-row:last-child { border-bottom: 0; }
.kpi-row span { font-weight: 800; }
.kpi-row strong { color: var(--marinho); font-family: var(--serif); font-size: 26px; line-height: 1; }

.home-workbench,
.processes-workbench,
.ia-audit-console {
  display: grid;
  gap: 14px;
}

.home-ops-bar {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(230px, 320px) auto;
  gap: 14px;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  background: #fff;
  box-shadow: var(--shadow-card);
}

.home-ops-bar h2 {
  margin: 3px 0 4px;
  color: var(--marinho);
  font-family: var(--serif);
  font-size: 23px;
  line-height: 1.08;
}

.home-ops-bar p {
  margin: 0;
  color: var(--text-secondary);
  line-height: 1.42;
}

.home-ops-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.home-ops-stats div {
  display: grid;
  gap: 4px;
  min-height: 58px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  background: #fbfaf7;
}

.home-ops-stats strong {
  color: var(--marinho);
  font-family: var(--serif);
  font-size: 24px;
  line-height: 1;
}

.home-ops-stats span {
  color: var(--text-muted);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.home-ops-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.home-main-column {
  display: grid;
  gap: 12px;
}

.home-side-panel {
  display: grid;
  gap: 12px;
}

.home-search-panel,
.ops-status-card,
.ops-shortcuts-card {
  display: grid;
  gap: 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  background: #fff;
  box-shadow: var(--shadow-soft);
}

.setup-alert-card {
  border-color: rgba(166,118,63,.35);
  background: #fffaf0;
}

.simple-filter-bar,
.processes-filter-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(150px, .34fr) auto;
  gap: 9px;
  align-items: end;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  background: #f8f5ee;
}

.simple-filter-bar label,
.processes-filter-toolbar label {
  min-width: 0;
}

.processes-filter-toolbar {
  grid-template-columns: minmax(220px, 1fr) minmax(140px, .28fr) minmax(140px, .28fr) auto;
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  background: #f8f5ee;
}

.filter-bar .filter-search {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1 1 240px;
  min-width: 190px;
}

.filter-bar .filter-reference {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1.35 1 320px;
  min-width: 260px;
}

.filter-bar .filter-reference select {
  width: 100%;
}

.filter-bar .filter-select {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 0 1 180px;
  min-width: 150px;
}

.filter-bar .filter-select select {
  width: 100%;
}

.filter-chip-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.filter-chip-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-muted);
  margin-right: 2px;
}

/* Rótulo "Filtrar por:" antes dos chips — deixa claro que são filtros selecionáveis */
.filter-chip-row:first-of-type::before {
  content: "Filtrar por:";
  flex-basis: 100%;
  margin-bottom: 1px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
}

button.filter-chip {
  min-height: 30px;
  padding: 5px 12px;
  border: 1px solid var(--border-dark);
  border-radius: 999px;
  background: #fff;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: none;
  transform: none;
}

button.filter-chip:hover {
  background: var(--hover-bg);
  color: var(--marinho);
  border-color: var(--border-dark);
  box-shadow: none;
  transform: none;
}

button.filter-chip.active {
  background: var(--marinho);
  border-color: var(--marinho);
  color: #fff;
  font-weight: 700;
}
.filter-chip .chip-count {
  margin-left: 6px;
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  background: var(--surface-soft, #f2f0ea);
  border-radius: 999px;
  padding: 0 5px;
}
.filter-chip.active .chip-count { color: #fff; background: rgba(255,255,255,.22); }
.filter-chip.chip-empty { opacity: .48; }
.filter-chip.active.chip-empty { opacity: 1; }

button.filter-chip:disabled {
  cursor: not-allowed;
  opacity: .45;
}

button.filter-chip:disabled:hover {
  background: #fff;
  color: var(--text-secondary);
}

.filter-bar .filter-clear {
  margin-left: auto;
}

.search-result-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  background: #fff;
}

.search-result-item strong {
  display: block;
  color: var(--marinho);
  font-weight: 700;
}

.search-result-item span {
  display: block;
  margin-top: 3px;
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.35;
}

.search-result-item button {
  min-height: 32px;
  padding: 7px 10px;
}

.ops-card-head {
  display: grid;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 10px;
}

.ops-card-head strong {
  color: var(--marinho);
  font-size: 14px;
}

.ops-status-list,
.ops-shortcuts-list {
  display: grid;
  gap: 8px;
}

.ops-status-line {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 9px;
  background: #fbfaf7;
}

.ops-status-line.pending {
  border-color: rgba(166,118,63,.28);
  background: #fff9ef;
}

.ops-status-line > span {
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.ops-status-line strong {
  min-width: 0;
  color: var(--marinho);
  font-size: 12px;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ops-status-line .mini-button {
  grid-column: 1 / -1;
  min-height: 30px;
  padding: 7px 9px;
}

.ops-shortcut {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2px 10px;
  align-items: center;
  min-height: 58px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  color: var(--text-secondary);
  background: #fbfaf7;
  text-align: left;
  box-shadow: none;
}

.ops-shortcut:hover {
  border-color: rgba(166,118,63,.42);
  background: #fffdf8;
}

.ops-shortcut span {
  color: var(--marinho);
  font-weight: 700;
}

.ops-shortcut strong {
  grid-row: 1 / span 2;
  grid-column: 2;
  color: var(--marinho);
  font-family: var(--serif);
  font-size: 24px;
}

.ops-shortcut small {
  color: var(--text-muted);
  font-size: 11px;
}

.setup-panel {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(420px, 1.05fr) auto;
  gap: 14px;
  align-items: stretch;
  border: 1px solid rgba(166,118,63,.24);
  border-radius: 10px;
  padding: 16px;
  background:
    linear-gradient(135deg, rgba(166,118,63,.08), transparent 42%),
    rgba(255,255,255,.96);
  box-shadow: var(--shadow-soft);
}

.setup-strip {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin-bottom: 10px;
  border: 1px solid rgba(26,122,84,.18);
  border-radius: 10px;
  padding: 10px 12px;
  background: linear-gradient(135deg, rgba(34,120,91,.07), rgba(255,255,255,.86));
}

.setup-strip > div {
  display: grid;
  gap: 3px;
}

.setup-strip strong {
  color: var(--marinho);
  font-size: 13px;
}

.setup-strip small {
  color: var(--text-secondary);
  font-size: 11px;
}

.setup-strip button {
  min-height: 34px;
  padding: 8px 12px;
}

.setup-copy {
  display: grid;
  align-content: center;
  gap: 6px;
}

.setup-copy h2 {
  margin: 0;
  color: var(--marinho);
  font-family: var(--serif);
  font-size: 23px;
  line-height: 1.05;
}

.setup-copy p {
  margin: 0;
  color: var(--text-secondary);
  line-height: 1.48;
}

.setup-checklist {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}

.setup-item {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 7px;
  border: 1px solid var(--border);
  border-radius: 13px;
  padding: 12px;
  background: #fff;
}

.setup-item.pending {
  border-color: rgba(166,118,63,.34);
  background: linear-gradient(180deg, #fff, rgba(251,243,223,.54));
}

.setup-item.done {
  border-color: rgba(26,122,84,.22);
}

.setup-item strong {
  color: var(--marinho);
  font-size: 12px;
  line-height: 1.2;
}

.setup-item span {
  color: var(--text-secondary);
  font-size: 11px;
  line-height: 1.35;
}

.setup-actions {
  display: grid;
  align-content: center;
  gap: 8px;
  min-width: 190px;
}

.setup-actions button {
  width: 100%;
}

.home-command-panel,
.processes-command-panel,
.ia-audit-head {
  display: grid;
  grid-template-columns: minmax(360px, 1fr) minmax(340px, .8fr);
  gap: 18px;
  align-items: stretch;
  border: 1px solid rgba(166,118,63,.26);
  border-radius: 10px;
  padding: 18px;
  color: #f8f4ea;
  background:
    linear-gradient(135deg, rgba(166,118,63,.13), transparent 42%),
    linear-gradient(180deg, #142235, #0b1624);
  box-shadow: var(--shadow-card);
}

.home-command-panel .eyebrow,
.processes-command-panel .eyebrow,
.ia-audit-head .eyebrow {
  color: rgba(232,195,143,.86);
}

.home-command-panel h2,
.processes-command-panel h2,
.ia-audit-head h2 {
  max-width: 780px;
  margin: 6px 0 8px;
  color: #fff;
  font-family: var(--serif);
  font-size: 27px;
  line-height: 1.05;
}

.home-command-panel p,
.processes-command-panel p,
.ia-audit-head p {
  max-width: 820px;
  margin: 0;
  color: rgba(248,244,234,.76);
  line-height: 1.55;
}

.home-stats,
.processes-stats,
.ia-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.ia-stats {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.home-stats div,
.processes-stats div,
.ia-stats div {
  display: grid;
  align-content: center;
  gap: 6px;
  min-height: 82px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 10px;
  padding: 11px;
  background: rgba(255,255,255,.055);
}

.home-stats strong,
.processes-stats strong,
.ia-stats strong {
  color: #fff;
  font-family: var(--serif);
  font-size: 28px;
  line-height: 1;
}

.home-stats span,
.processes-stats span,
.ia-stats span {
  color: rgba(248,244,234,.66);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
}

.home-pipeline-panel,
.home-priority-panel,
.processes-queue-panel,
.ia-table-panel {
  display: grid;
  gap: 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.97), rgba(250,248,243,.94)),
    #fff;
  box-shadow: var(--shadow-card);
}

.home-pipeline-panel > div:first-child,
.home-panel-head,
.processes-queue-head,
.ia-table-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  border-bottom: 1px solid var(--border);
  padding: 2px 2px 13px;
}

.home-panel-head.compact {
  padding-bottom: 10px;
}

.home-pipeline-panel h2,
.home-panel-head h2,
.processes-queue-head h2,
.ia-table-head h2 {
  margin: 3px 0 4px;
  font-family: var(--serif);
  font-size: 23px;
  line-height: 1.08;
}

.home-panel-head p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.35;
}

.home-pipeline-panel .flow-steps {
  margin: 0;
}

.home-priority-panel .compact-list {
  gap: 10px;
}

.process-object-layout {
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
}

.process-empty-state {
  display: grid;
  gap: 10px;
  border: 1px dashed rgba(166,118,63,.42);
  border-radius: 10px;
  padding: 18px;
  background:
    linear-gradient(135deg, rgba(166,118,63,.08), transparent 44%),
    #fffdf8;
}

.process-empty-state strong {
  color: var(--marinho);
  font-family: var(--serif);
  font-size: 22px;
  line-height: 1.12;
}

.process-empty-state p {
  max-width: 720px;
  margin: 0;
  color: var(--text-secondary);
  line-height: 1.5;
}

.process-list-placeholder {
  display: grid;
  gap: 6px;
  border: 1px dashed var(--border-dark);
  border-radius: 10px;
  padding: 14px;
  background: rgba(255,255,255,.64);
}

.process-list-placeholder span {
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
}

.process-list-placeholder strong {
  color: var(--marinho);
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.12;
}

.process-list-placeholder small {
  color: var(--text-secondary);
  line-height: 1.4;
}

.contract-consult-list .process-list-placeholder,
.worklist-column .process-list-placeholder,
.detail .process-list-placeholder,
.object-detail .process-list-placeholder {
  min-height: 120px;
  align-content: center;
  background: #fff;
}

.ia-table-panel .table {
  margin-top: 0;
}

.fiscal-grid { grid-template-columns: minmax(320px, .85fr) minmax(320px, 1.15fr); align-items: start; }
.split { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); margin-bottom: 14px; }
.ai-intake-panel {
  display: grid;
  grid-template-columns: minmax(280px, .72fr) minmax(320px, 1fr);
  gap: 16px;
  align-items: stretch;
  margin-bottom: 14px;
  border: 1px solid rgba(166,118,63,.28);
  border-radius: var(--radius-card);
  padding: 18px;
  background:
    linear-gradient(135deg, rgba(21,38,61,.96), rgba(33,67,107,.94)),
    #15263d;
  box-shadow: var(--shadow-card);
}

.contract-workbench {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  align-items: start;
  margin-bottom: 12px;
}

.contract-command-bar,
.contract-pipeline-card {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(166,118,63,.26);
  border-radius: 10px;
  padding: 12px;
  align-self: start;
  color: #f8f4ea;
  background:
    linear-gradient(135deg, rgba(166,118,63,.13), transparent 44%),
    linear-gradient(180deg, #142235, #0b1624);
  box-shadow: var(--shadow-card);
}

.contract-command-bar::before,
.contract-pipeline-card::before {
  content: "";
  position: absolute;
  inset: 8px;
  pointer-events: none;
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 10px;
}

.contract-command-bar {
  display: grid;
  grid-template-columns: minmax(220px, .32fr) minmax(420px, 1fr);
  gap: 14px;
  align-items: start;
}

.command-copy {
  display: grid;
  align-content: start;
  gap: 6px;
  min-width: 0;
  padding: 2px 0;
}

.command-copy .eyebrow,
.contract-pipeline-card .eyebrow {
  color: rgba(232,195,143,.86);
}

.command-copy h2 {
  margin: 0;
  max-width: 520px;
  color: #fff;
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1.1;
}

.command-copy p {
  margin: 0;
  max-width: 560px;
  color: rgba(248,244,234,.76);
  font-size: 13px;
  line-height: 1.45;
}

.artifact-inline-form {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(190px, 240px);
  gap: 8px 10px;
  align-content: start;
  align-items: stretch;
  min-width: 0;
  padding: 0;
}

.artifact-inline-form button {
  grid-column: 2;
  grid-row: 1;
  width: 100%;
  min-height: 50px;
  border-color: rgba(232,195,143,.34);
  background: linear-gradient(135deg, #c89b66, #8a5d30);
  color: #0d1623;
  box-shadow: var(--shadow-card);
  white-space: normal;
}

.compact-file {
  grid-column: 1;
  grid-row: 1;
  min-width: 0;
  display: grid;
  gap: 6px;
  border: 1px dashed rgba(232,195,143,.42);
  border-radius: 10px;
  padding: 9px 10px;
  background:
    linear-gradient(135deg, rgba(255,255,255,.07), transparent),
    rgba(255,255,255,.035);
  color: rgba(248,244,234,.82);
}

.compact-file input {
  min-height: 34px;
  border-color: rgba(255,255,255,.12);
  background: rgba(3,8,14,.34);
  color: #fff;
}

.compact-file input::file-selector-button {
  min-height: 28px;
  margin-right: 10px;
  border: 1px solid rgba(232,195,143,.32);
  border-radius: 8px;
  padding: 5px 9px;
  background: rgba(232,195,143,.16);
  color: #fff;
  font-weight: 800;
  cursor: pointer;
}

.compact-file span {
  color: rgba(248,244,234,.62);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
}

.import-options {
  grid-column: 1 / -1;
  grid-row: 2;
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 10px;
  padding: 7px 10px;
  background: rgba(3,8,14,.20);
}

.import-options summary {
  color: rgba(248,244,234,.78);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  cursor: pointer;
}

.import-options label {
  margin-top: 10px;
  color: rgba(248,244,234,.70);
}

.import-options select {
  border-color: rgba(255,255,255,.12);
  background: #101b2b;
  color: #fff;
}

.import-options option {
  color: #111;
}

.contract-pipeline-card {
  display: grid;
  align-content: start;
  gap: 8px;
}

.contract-pipeline-card h2 {
  margin: 0;
  color: #fff;
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.1;
}

.contract-pipeline-card p {
  margin: 0;
  color: rgba(248,244,234,.68);
  font-size: 12px;
  line-height: 1.4;
}

.journey-mini {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
}

.journey-mini span {
  position: relative;
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 999px;
  padding: 6px 9px;
  background: rgba(255,255,255,.045);
  color: rgba(248,244,234,.84);
  font-size: 10px;
  font-weight: 700;
}

.journey-mini span::before {
  content: "";
  width: 5px;
  height: 5px;
  margin-right: 7px;
  border-radius: 999px;
  background: var(--bronze-light);
  box-shadow: 0 0 0 3px rgba(200,155,102,.12);
}

.contract-consult {
  display: grid;
  gap: 10px;
  margin: 0 0 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.96), rgba(250,248,243,.94)),
    #fff;
  box-shadow: var(--shadow-card);
}

.consult-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  border: 0;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  padding: 2px 2px 10px;
  background: transparent;
  box-shadow: none;
}

.consult-head h2 {
  margin: 3px 0 4px;
  font-family: var(--serif);
  font-size: 23px;
  line-height: 1.08;
}

.consult-head p {
  margin: 0;
  color: var(--text-secondary);
  line-height: 1.45;
}

.consult-kpis {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.consult-metric {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 0;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 9px;
  background: #fbfaf7;
}

.consult-metric strong {
  color: var(--marinho);
  font-family: var(--sans);
  font-size: 12px;
  line-height: 1;
}

.consult-metric span {
  color: var(--text-muted);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.consult-toolbar {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) 150px 150px 170px auto;
  gap: 10px;
  align-items: end;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  background: #f8f5ee;
  box-shadow: none;
}

.consult-toolbar label {
  min-width: 0;
}

.contract-consult-list {
  display: grid;
  gap: 9px;
}

.consult-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(190px, 230px);
  gap: 10px 14px;
  align-items: stretch;
  border: 1px solid var(--border);
  border-left: 4px solid rgba(166,118,63,.66);
  border-radius: 10px;
  padding: 13px 14px;
  background:
    linear-gradient(90deg, rgba(166,118,63,.055), transparent 42%),
    #fff;
  box-shadow: var(--shadow-soft);
  cursor: pointer;
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.consult-row:hover {
  border-color: rgba(166,118,63,.45);
  box-shadow: var(--shadow-card);
  transform: translateY(-1px);
}

.consult-row-main,
.consult-row-action {
  min-width: 0;
  display: grid;
  gap: 8px;
}

.consult-row-title {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 12px;
}

.consult-row-title strong {
  color: var(--marinho);
  font-size: 15px;
}

.consult-row-title span {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
}

.consult-row p {
  margin: 0;
  color: var(--text-secondary);
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.consult-row-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.consult-chip {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 8px;
  background: #fbfaf7;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.consult-chip.ai {
  border-color: rgba(37,99,235,.24);
  background: rgba(37,99,235,.08);
  color: var(--info);
}

.consult-row-progress {
  grid-column: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-content: start;
}

.consult-row-progress span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 5px 8px;
  background: #faf7f1;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 750;
  line-height: 1.25;
}

.consult-row-progress strong {
  color: var(--marinho);
  font-size: 12px;
  line-height: 1;
}

.consult-row-action {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-content: center;
  border-left: 1px solid var(--border);
  padding-left: 14px;
  background: linear-gradient(90deg, transparent, rgba(250,247,241,.78));
}

.consult-row-action small {
  color: var(--bronze);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.consult-row-action span {
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.35;
}

.consult-row-action button {
  width: auto;
  min-width: 132px;
  min-height: 36px;
  border-radius: 10px;
  justify-self: start;
}
.ai-intake-copy {
  display: grid;
  align-content: start;
  gap: 14px;
  color: #fff;
}
.ai-intake-copy .eyebrow { color: rgba(255,255,255,.68); }
.ai-intake-copy h2 {
  max-width: 720px;
  margin: 0;
  color: #fff;
  font-family: var(--serif);
  font-size: 25px;
  line-height: 1.12;
}
.ai-intake-copy p {
  max-width: 760px;
  margin: 0;
  color: rgba(255,255,255,.78);
  line-height: 1.55;
}
.ai-pipeline {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin-top: 4px;
}
.ai-pipeline div {
  min-height: 88px;
  display: grid;
  align-content: start;
  gap: 7px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 10px;
  padding: 10px;
  background: rgba(255,255,255,.08);
}
.ai-pipeline strong {
  width: 25px;
  height: 25px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  color: var(--marinho);
  background: #f2d3a9;
}
.ai-pipeline span {
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.3;
}
.ai-upload-form {
  display: grid;
  gap: 12px;
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 10px;
  padding: 16px;
  background: #fff;
  box-shadow: var(--shadow-card);
}
.ai-upload-form h2 {
  margin-bottom: 0;
  font-size: 18px;
}
.file-drop {
  border: 1.5px dashed var(--border-dark);
  border-radius: 10px;
  padding: 12px;
  background: #fbfaf7;
}
.file-drop input {
  border: 0;
  padding: 8px 0 4px;
  background: transparent;
}
.file-drop span {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
}
.import-options {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  background: #fbfaf7;
}
.import-options summary {
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
}
.import-options label {
  margin-top: 10px;
}

.contract-command-bar .import-options {
  border-color: rgba(255,255,255,.12);
  border-radius: 10px;
  padding: 7px 10px;
  background: rgba(3,8,14,.24);
}

.contract-command-bar .import-options summary {
  color: rgba(248,244,234,.78);
  font-size: 10px;
  letter-spacing: .08em;
}

.contract-command-bar .import-options label {
  color: rgba(248,244,234,.70);
}

.contract-command-bar .import-options select {
  border-color: rgba(255,255,255,.12);
  background: #101b2b;
  color: #fff;
}

.contract-command-bar .import-options option {
  color: #111;
}

.manual-entry {
  margin: 0 0 12px;
}
.manual-entry summary {
  cursor: pointer;
  color: var(--text-secondary);
  font-weight: 800;
}
.secondary-entry summary {
  width: max-content;
  font-size: 12px;
}
.manual-entry .panel {
  margin-top: 10px;
}
.ia-chip {
  width: max-content;
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(37,99,235,.18);
  border-radius: 999px;
  padding: 5px 8px;
  color: #1d4ed8;
  background: rgba(37,99,235,.06);
  font-size: 11px;
  font-weight: 700;
}
.action-cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}
.action-card {
  position: relative;
  min-height: 112px;
  justify-content: start;
  align-items: end;
  padding: 16px;
  border-color: var(--border);
  color: var(--marinho);
  background: white;
  box-shadow: var(--shadow-card);
}
.action-card svg {
  position: absolute;
  width: 26px;
  height: 26px;
  margin-bottom: 45px;
  color: var(--bronze);
}
.action-card span {
  display: block;
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.05;
  text-align: left;
}
.quick-panel { min-height: 100%; }
.inline-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }

form { display: grid; gap: 12px; }
.inline-form {
  display: flex;
  align-items: end;
  gap: 10px;
  margin-bottom: 14px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.1px;
  text-transform: uppercase;
}

input, textarea, select {
  width: 100%;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-input);
  padding: 10px 12px;
  background: #fbfaf7;
  color: var(--text);
  outline: none;
  text-transform: none;
  letter-spacing: 0;
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}
textarea { min-height: 92px; resize: vertical; line-height: 1.55; }
input:focus, textarea:focus, select:focus {
  border-color: var(--bronze);
  box-shadow: 0 0 0 3px var(--focus-ring);
  background: white;
}

.table { overflow-x: auto; margin-top: 12px; }
table { width: 100%; border-collapse: collapse; font-size: 12px; }
th, td { text-align: left; padding: 11px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
tbody tr:nth-child(even) { background: rgba(21,38,61,.018); }
tbody tr:hover { background: var(--bronze-subtle); }
th { color: var(--text-muted); font-size: 10px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; }

.row-actions { display: flex; flex-wrap: wrap; gap: 7px; }
.row-actions button { padding: 7px 10px; min-height: 32px; font-size: 11px; }
.detail { margin-top: 14px; display: grid; gap: 12px; background: transparent; border: 0; box-shadow: none; padding: 0; }
.muted { color: var(--text-muted); }
.warning { color: var(--danger); font-weight: 800; }

.compact-list { display: grid; gap: 9px; }
.compact-item {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  background: #fbfaf7;
  display: grid;
  gap: 6px;
}
.compact-item strong { color: var(--marinho); }
.compact-item span { color: var(--text-muted); font-size: 12px; line-height: 1.45; }

.worklist-grid,
.worklist-column {
  display: grid;
  gap: 12px;
}

.object-layout {
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.object-detail {
  margin-top: 0;
}

.work-item,
.object-card,
.occurrence-card {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  background: #fff;
  box-shadow: var(--shadow-soft);
}

.object-card {
  align-items: stretch;
  padding: 12px 14px;
}

.object-card-main,
.object-card-side,
.work-item > div,
.occurrence-card > div:first-child {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.object-card-side {
  min-width: 190px;
  align-content: center;
}

.object-card p,
.occurrence-card p {
  margin: 0;
  color: var(--text-secondary);
  line-height: 1.5;
}

.work-item strong,
.object-card strong,
.occurrence-card strong {
  color: var(--marinho);
}

.work-item span,
.work-item small,
.object-card span,
.object-card small,
.occurrence-card span {
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.4;
}

.work-item button,
.list-card {
  flex: 0 0 auto;
}

.generated-documents-panel {
  position: relative;
  overflow: hidden;
  display: grid;
  gap: 12px;
  border: 1px solid rgba(166,118,63,.36);
  border-radius: 10px;
  padding: 15px;
  background:
    linear-gradient(135deg, rgba(255,248,237,.96), rgba(255,255,255,.95) 48%, rgba(250,248,243,.92)),
    #fff;
  box-shadow: var(--shadow-card);
}

.compact-documents-panel {
  padding: 0;
  gap: 0;
}

.generated-documents-panel::before {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: linear-gradient(180deg, var(--bronze), rgba(166,118,63,.28));
}

.generated-documents-head {
  position: relative;
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
  border-bottom: 1px solid var(--border);
  padding: 14px 15px;
  cursor: pointer;
  list-style: none;
}

.generated-documents-head::-webkit-details-marker {
  display: none;
}

.generated-documents-head::after {
  content: "abrir";
  align-self: center;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 5px 8px;
  color: var(--text-muted);
  background: #fff;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.generated-documents-panel[open] .generated-documents-head::after {
  content: "fechar";
}

.generated-documents-head h3 {
  margin: 3px 0 4px;
  color: var(--marinho);
  font-family: var(--serif);
  font-size: 22px;
  line-height: 1.05;
}

.generated-documents-head p {
  margin: 0;
  color: var(--text-secondary);
  line-height: 1.45;
}

.document-summary {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 260px;
}

.document-storage-hint {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  border: 1px solid rgba(34,120,91,.18);
  border-radius: 10px;
  padding: 9px 11px;
  background: rgba(34,120,91,.06);
}

.document-storage-hint strong {
  color: var(--success);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.document-storage-hint span {
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.35;
}

.compact-documents-panel > .document-storage-hint,
.compact-documents-panel > .generated-documents-list,
.compact-documents-panel > .empty-state {
  margin: 12px 15px;
}

.generated-documents-list {
  display: grid;
  gap: 8px;
}

.generated-documents-list.compact {
  margin-top: 10px;
}

.generated-document-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 11px 12px;
  background: #fff;
}

.generated-document-row strong {
  display: block;
  color: var(--marinho);
  font-weight: 700;
}

.generated-document-row span {
  display: block;
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.4;
}

.document-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
}

.document-download-link {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-dark);
  border-radius: var(--radius-btn);
  padding: 9px 15px;
  background: transparent;
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
}

.document-download-link:hover {
  border-color: var(--text-muted);
  background: #faf8f4;
}

.document-version-group {
  display: grid;
  gap: 6px;
}

.document-previous-versions {
  border: 1px dashed var(--border-dark);
  border-radius: 10px;
  padding: 8px 10px;
  background: #fbfaf7;
}

.document-previous-versions summary {
  cursor: pointer;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
}

.document-previous-versions .generated-document-row {
  padding: 9px 10px;
  box-shadow: none;
}

.process-stage-track {
  display: grid;
  gap: 8px;
}

.occurrence-documents {
  margin-top: 10px;
  border: 1px solid rgba(166,118,63,.22);
  border-radius: 10px;
  background: #fbfaf7;
}

.occurrence-documents summary {
  cursor: pointer;
  padding: 9px 11px;
  color: var(--marinho);
  font-size: 12px;
  font-weight: 700;
}

.occurrence-document-list {
  display: grid;
  gap: 8px;
  border-top: 1px solid var(--border);
  padding: 10px;
}

.occurrence-document-list > div {
  display: grid;
  gap: 4px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  background: #fff;
}

.occurrence-document-list strong {
  color: var(--marinho);
}

.occurrence-document-list span,
.occurrence-document-list small {
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.4;
}

.saved-docs-panel {
  display: grid;
  gap: 10px;
  border: 1px solid rgba(166,118,63,.22);
  border-radius: 10px;
  padding: 12px;
  background: #fffdf8;
}

.compact-saved-docs {
  padding: 0;
}

.compact-saved-docs .saved-docs-grid {
  padding: 0 12px 12px;
}

.saved-docs-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: baseline;
  padding: 12px;
  cursor: pointer;
  list-style: none;
}

.saved-docs-head::-webkit-details-marker {
  display: none;
}

.saved-docs-head > span {
  display: grid;
  gap: 3px;
}

.saved-docs-head strong {
  color: var(--marinho);
  font-size: 14px;
}

.saved-docs-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.saved-docs-grid div {
  min-width: 0;
  display: grid;
  gap: 5px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  background: #fff;
}

.saved-docs-grid span {
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.saved-docs-grid strong {
  color: var(--marinho);
  font-family: var(--serif);
  font-size: 22px;
  line-height: 1;
}

.saved-docs-grid small,
.saved-docs-grid em {
  color: var(--text-secondary);
  font-size: 12px;
  font-style: normal;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.saved-docs-grid em {
  color: var(--text-muted);
  font-size: 11px;
}

.list-card {
  width: 100%;
  display: grid;
  gap: 5px;
  justify-items: start;
  text-align: left;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow-soft);
  padding: 14px;
}

.list-card:hover {
  border-color: var(--border-dark);
  background: var(--hover-bg);
}

.list-card.active {
  border-color: var(--sel-border);
  background: var(--sel-bg);
  box-shadow: inset 3px 0 0 var(--sel-bar), var(--shadow-soft);
}

.list-card strong { color: var(--marinho); }
.list-card span,
.list-card small { color: var(--text-muted); }
.list-card em {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(166,118,63,.12);
  color: var(--marinho);
  font-size: 10px;
  font-style: normal;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.empty-state {
  display: grid;
  gap: 5px;
  border: 1px dashed var(--border-dark);
  border-radius: 10px;
  padding: 16px;
  background: rgba(255,255,255,.58);
}

.empty-state strong { color: var(--marinho); }
.empty-state span { color: var(--text-muted); line-height: 1.45; }

.thread-shell,
.process-shell {
  display: grid;
  gap: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 18px;
  background: #fff;
  box-shadow: var(--shadow-card);
}

.thread-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
}

.thread-header h2 {
  margin: 2px 0 6px;
  font-family: var(--serif);
  font-size: 26px;
}

.thread-header p {
  margin: 0;
  color: var(--text-secondary);
  line-height: 1.5;
}

.process-focus-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(166,118,63,.16);
}

.process-focus-head h2 {
  margin: 2px 0 6px;
  color: var(--marinho);
  font-family: var(--serif);
  font-size: 24px;
  line-height: 1.1;
}

.process-focus-head p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.45;
}

.process-focus-pills {
  justify-content: flex-end;
  align-items: flex-start;
  margin-top: 0;
}

.occurrence-list-card {
  padding: 12px;
  gap: 4px;
  border-radius: 10px;
  box-shadow: none;
}

.occurrence-list-card strong {
  font-size: 13px;
  line-height: 1.25;
}

.occurrence-list-card span,
.occurrence-list-card small {
  font-size: 11px;
  line-height: 1.3;
}

.occurrence-detail {
  gap: 12px;
  padding: 16px;
  box-shadow: var(--shadow-card);
}

.occurrence-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(166,118,63,.18);
}

.occurrence-hero h2 {
  margin: 2px 0 6px;
  color: var(--marinho);
  font-family: var(--serif);
  font-size: 25px;
  line-height: 1.1;
}

.occurrence-hero p {
  max-width: 920px;
  margin: 0;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.45;
}

.occurrence-status-stack {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
  min-width: 190px;
}

.occurrence-context-line {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--text-secondary);
  font-size: 12px;
}

.occurrence-context-line span {
  display: inline-flex;
  gap: 4px;
  border: 1px solid rgba(166,118,63,.20);
  border-radius: 999px;
  padding: 6px 10px;
  background: #fbfaf7;
}

.occurrence-context-line strong {
  color: var(--marinho);
}

.occurrence-decision-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  border: 1px solid rgba(17,52,86,.18);
  border-left: 4px solid var(--marinho);
  border-radius: 10px;
  padding: 14px 16px;
  background: linear-gradient(135deg, rgba(255,255,255,.96), rgba(251,250,247,.96));
}

.occurrence-decision-card.has-blocker {
  border-color: rgba(161,42,51,.22);
  border-left-color: var(--danger);
  background: linear-gradient(135deg, rgba(255,250,250,.96), rgba(255,255,255,.96));
}

.occurrence-decision-card strong {
  display: block;
  margin: 2px 0 4px;
  color: var(--marinho);
  font-family: var(--serif);
  font-size: 22px;
  line-height: 1.1;
}

.occurrence-decision-card p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.4;
}

.occurrence-decision-actions {
  display: grid;
  justify-items: end;
  gap: 8px;
}

.occurrence-decision-actions .chip-row {
  justify-content: flex-end;
  margin-top: 0;
}

.occurrence-work-grid {
  display: grid;
  grid-template-columns: 1fr 1.1fr 1fr;
  gap: 10px;
}

.occurrence-work-grid article {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 8px;
  border: 1px solid rgba(166,118,63,.20);
  border-radius: 10px;
  padding: 12px;
  background: #fff;
}

.occurrence-work-grid article > span {
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.occurrence-work-grid article > strong {
  color: var(--marinho);
  font-size: 13px;
}

.occurrence-work-grid article p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.4;
}

.occurrence-evidence-compact {
  display: grid;
  gap: 8px;
}

.occurrence-evidence-compact > div {
  display: grid;
  gap: 3px;
  border-left: 3px solid rgba(166,118,63,.42);
  padding-left: 9px;
}

.occurrence-evidence-compact strong {
  color: var(--marinho);
  font-size: 13px;
}

.occurrence-evidence-compact span,
.occurrence-evidence-compact small {
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.35;
}

.empty-evidence {
  border-left-color: rgba(161,42,51,.55) !important;
}

.occurrence-more {
  margin: 0;
  border: 1px solid rgba(166,118,63,.18);
  border-radius: 10px;
  padding: 10px 12px;
  background: #fbfaf7;
}

.occurrence-more summary {
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 700;
}

.occurrence-more div {
  display: grid;
  gap: 5px;
  margin-top: 10px;
}

.occurrence-more p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.4;
}

.occurrence-guide-detail {
  gap: 10px;
  padding: 14px;
}

.occurrence-guide-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 150px;
  gap: 16px;
  align-items: start;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(166,118,63,.16);
}

.occurrence-guide-top h2 {
  max-width: 860px;
  margin: 2px 0 6px;
  color: var(--marinho);
  font-family: var(--serif);
  font-size: 25px;
  line-height: 1.12;
}

.occurrence-guide-top p {
  max-width: 980px;
  margin: 0;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.45;
}

.occurrence-guide-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.occurrence-guide-meta span {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border: 1px solid rgba(166,118,63,.20);
  border-radius: 999px;
  padding: 4px 9px;
  color: var(--text-secondary);
  background: #fbfaf7;
  font-size: 11px;
  font-weight: 700;
}

.occurrence-guide-state {
  display: grid;
  justify-items: end;
  gap: 3px;
  padding-top: 4px;
}

.occurrence-guide-state span {
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.occurrence-guide-state strong {
  color: var(--marinho);
  font-size: 13px;
  font-weight: 700;
  text-align: right;
}

.occurrence-guide-state small {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
}

.occurrence-next-action {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  border: 1px solid rgba(17,52,86,.18);
  border-left: 4px solid var(--marinho);
  border-radius: 10px;
  padding: 13px 14px;
  background: #fff;
}

.occurrence-next-action.has-blocker {
  border-color: rgba(161,42,51,.22);
  border-left-color: var(--danger);
  background: rgba(255,250,250,.72);
}

.occurrence-next-action strong {
  display: block;
  margin: 2px 0 3px;
  color: var(--marinho);
  font-family: var(--serif);
  font-size: 21px;
  line-height: 1.12;
}

.occurrence-next-action p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.4;
}

.occurrence-next-action .row-actions {
  justify-content: flex-end;
}

.occurrence-secondary-actions,
.occurrence-details-compact {
  margin: 0;
  border: 1px solid rgba(166,118,63,.18);
  border-radius: 10px;
  padding: 9px 11px;
  background: #fbfaf7;
}

.occurrence-secondary-actions summary,
.occurrence-details-compact summary {
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 700;
}

.occurrence-secondary-actions .row-actions {
  margin-top: 10px;
}

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

.occurrence-details-list > div {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 5px;
  border: 1px solid rgba(166,118,63,.16);
  border-radius: 10px;
  padding: 10px;
  background: #fff;
}

.occurrence-details-list span {
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.occurrence-details-list strong {
  color: var(--marinho);
  font-size: 13px;
}

.occurrence-details-list p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.4;
}

@media (max-width: 980px) {
  .occurrence-hero,
  .occurrence-decision-card,
  .occurrence-guide-top,
  .occurrence-next-action {
    grid-template-columns: 1fr;
  }
  .occurrence-status-stack,
  .occurrence-decision-actions,
  .occurrence-decision-actions .chip-row {
    justify-content: flex-start;
    justify-items: start;
  }
  .occurrence-work-grid {
    grid-template-columns: 1fr;
  }
  .occurrence-guide-state {
    justify-items: start;
  }
  .occurrence-next-action .row-actions {
    justify-content: flex-start;
  }
  .occurrence-details-list {
    grid-template-columns: 1fr;
  }
}

.eyebrow {
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.2px;
  text-transform: uppercase;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 10px;
}

.conductor-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  border: 1px solid rgba(166,118,63,.28);
  border-radius: 10px;
  padding: 18px;
  background:
    linear-gradient(135deg, rgba(255,248,237,.96), rgba(255,255,255,.94)),
    #fffaf1;
  box-shadow: var(--shadow-card);
}

.conductor-panel.has-blocker {
  border-color: var(--border);
  border-left: 4px solid var(--danger);
  background: var(--card);
}

.conductor-panel strong {
  display: block;
  margin: 4px 0 6px;
  color: var(--marinho);
  font-family: var(--serif);
  font-size: 22px;
  line-height: 1.15;
}

.conductor-panel p {
  margin: 0;
  color: var(--text-secondary);
  line-height: 1.45;
}

.conductor-actions {
  display: grid;
  gap: 8px;
  min-width: 230px;
}

.conductor-action-item {
  display: grid;
  gap: 5px;
}

.conductor-action-item button {
  width: 100%;
}

.conductor-action-item small {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.3;
}

.anti-nullity-note {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin-top: 10px;
  border: 1px solid rgba(34,120,91,.20);
  border-radius: 10px;
  padding: 10px 12px;
  background: rgba(34,120,91,.07);
  color: var(--text-secondary);
  line-height: 1.4;
}

.anti-nullity-note strong {
  flex: 0 0 auto;
  margin: 0;
  color: var(--success);
  font-family: var(--sans);
  font-size: 12px;
  line-height: 1.4;
}

.anti-nullity-note span {
  display: block;
}

.next-action {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  border: 1px solid rgba(166,118,63,.28);
  border-radius: 10px;
  padding: 12px 14px;
  background: #fff9ef;
}

.next-action.danger {
  border-color: rgba(161,42,51,.3);
  background: var(--danger-light);
}

.next-action strong {
  color: var(--marinho);
}

.next-action span {
  color: var(--text-secondary);
  line-height: 1.45;
}

.pas-checklist-summary {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  border: 1px solid rgba(34,120,91,.22);
  border-radius: 10px;
  padding: 13px 14px;
  background: linear-gradient(135deg, rgba(34,120,91,.08), rgba(255,255,255,.92));
}

.pas-checklist-summary.has-blockers {
  border-color: rgba(161,42,51,.30);
  background: linear-gradient(135deg, rgba(161,42,51,.08), rgba(255,255,255,.94));
}

.pas-checklist-summary strong {
  display: block;
  margin: 3px 0;
  color: var(--marinho);
  font-size: 15px;
}

.pas-checklist-summary p {
  margin: 0;
  color: var(--text-secondary);
}

.pas-checklist-pills {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
}

.prescription-timeline {
  display: grid;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  background: #fbfaf7;
}

.prescription-timeline > div {
  display: grid;
  gap: 3px;
  border-left: 3px solid rgba(166,118,63,.52);
  padding-left: 10px;
}

.prescription-timeline strong {
  color: var(--marinho);
}

.prescription-timeline span,
.prescription-timeline small {
  color: var(--text-secondary);
  line-height: 1.4;
}

.compact-deadline-form {
  grid-template-columns: minmax(220px, .45fr) auto;
  align-items: end;
}

.compact-deadline-form button {
  width: auto;
  min-width: 210px;
}

.thread-tabs,
.process-tabs {
  margin-bottom: 0;
  border-radius: 10px;
}

/* Stepper como trilho horizontal compacto (chips), não grade de cartões */
.process-stepper-rail {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.process-rail-cell { display: flex; align-items: center; min-width: 0; }

.process-step {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 5px 12px 5px 5px;
  color: var(--text-secondary);
  text-align: left;
  background: #fff;
  box-shadow: none;
}
.process-step:hover { box-shadow: none; }

.process-step-dot {
  width: 21px;
  height: 21px;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  color: var(--marinho);
  background: #eef1f4;
  font-size: 11px;
  font-weight: 700;
}

.process-step strong {
  color: var(--marinho);
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
}

.process-step.done {
  border-color: rgba(26,122,84,.24);
  background: #f5fbf8;
}
.process-step.done .process-step-dot {
  color: #fff;
  background: var(--success);
}

.process-step.current {
  border-color: var(--marinho);
  background: linear-gradient(135deg, var(--marinho), var(--marinho-mid));
}
.process-step.current strong { color: #fff; }
.process-step.current .process-step-dot {
  color: var(--marinho);
  background: #f2d3a9;
}

.process-step.active:not(.current) {
  border-color: rgba(166,118,63,.62);
  box-shadow: inset 0 0 0 1px rgba(166,118,63,.18);
}
.process-step.active:not(.current) .process-step-dot {
  color: var(--marinho);
  background: #f2d3a9;
}
.process-step.done.active:not(.current) .process-step-dot {
  color: #fff;
  background: var(--success);
}

.process-step.locked {
  opacity: .52;
  cursor: not-allowed;
}

.step-tag {
  font-style: normal;
  font-weight: 700;
  font-size: 8.5px;
  letter-spacing: .4px;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: var(--radius-badge);
  line-height: 1.4;
}

.step-tag-current {
  background: #f2d3a9;
  color: var(--marinho);
}

.step-tag-done {
  background: rgba(26,122,84,.16);
  color: var(--success);
}

.step-tag-preview {
  background: rgba(166,118,63,.14);
  color: var(--bronze);
}

.stage-preview-banner {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 14px;
  padding: 11px 14px;
  border: 1px solid rgba(166,118,63,.30);
  border-left: 4px solid #a6763f;
  border-radius: var(--radius-card);
  background: #fbf6ef;
}

.stage-preview-banner strong {
  font-size: 13px;
  color: var(--marinho);
}

.stage-preview-banner span {
  font-size: 12.5px;
  color: #55607a;
}

.stage-status-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: #fbfcfd;
}

.stage-status-strip.has-blocker {
  border-color: rgba(176,42,55,.28);
  background: #fdf7f7;
}

.stage-status-label {
  font-weight: 700;
  font-size: 12.5px;
  color: var(--marinho);
}

.stage-status-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* Cockpit do PAS: badges de status dentro do condutor + cadeia de atos da etapa */
.conductor-status-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.thread-pane {
  display: none;
}

.thread-pane.active {
  display: grid;
  gap: 12px;
}

.stage-heading {
  display: grid;
  gap: 5px;
  border: 1px solid rgba(166,118,63,.24);
  border-radius: 10px;
  padding: 12px 14px;
  background: #fffdf8;
}

.focused-contract {
  gap: 12px;
}

.focused-contract .thread-header {
  padding-bottom: 2px;
}

.contract-context-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
}

.contract-context-actions button {
  min-height: 34px;
  padding: 8px 12px;
}

.matrix-summary-line {
  margin: -4px 2px 2px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 800;
}

.compact-stage {
  border-color: var(--border);
  background: #fbfaf7;
}

.stage-heading strong {
  color: var(--marinho);
  font-size: 16px;
}

.stage-heading span {
  color: var(--text-secondary);
  line-height: 1.45;
}

.stage-list {
  display: grid;
  gap: 10px;
}

.stage-warning {
  border: 1px solid rgba(166,124,0,.28);
  border-radius: 10px;
  padding: 10px 12px;
  color: #684d00;
  background: var(--warning-light);
  font-weight: 700;
}

.stage-note {
  border: 1px solid rgba(37,99,235,.16);
  border-radius: 10px;
  padding: 10px 12px;
  color: #1d4ed8;
  background: rgba(37,99,235,.06);
  font-weight: 700;
}

.stage-note.danger {
  border-color: rgba(161,42,51,.20);
  color: var(--danger);
  background: rgba(161,42,51,.06);
}

.source-strip,
.origin-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.source-strip div,
.origin-strip div {
  display: grid;
  gap: 4px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  background: #fff;
}

.source-strip span,
.origin-strip span {
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.source-strip strong,
.origin-strip strong {
  color: var(--marinho);
  font-family: var(--serif);
  font-size: 20px;
  line-height: 1.15;
}

#ocorrencias .occurrence-origin-strip strong,
#processos .origin-strip strong {
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.35;
}

.fiscal-workbench {
  display: grid;
  gap: 14px;
}

.fiscal-command-panel {
  display: grid;
  grid-template-columns: minmax(360px, 1fr) minmax(360px, .88fr);
  gap: 18px;
  align-items: stretch;
  border: 1px solid rgba(166,118,63,.26);
  border-radius: 10px;
  padding: 18px;
  color: #f8f4ea;
  background:
    linear-gradient(135deg, rgba(166,118,63,.13), transparent 42%),
    linear-gradient(180deg, #142235, #0b1624);
  box-shadow: var(--shadow-card);
}

.fiscal-command-panel .eyebrow {
  color: rgba(232,195,143,.86);
}

.fiscal-command-panel h2 {
  max-width: 760px;
  margin: 6px 0 8px;
  color: #fff;
  font-family: var(--serif);
  font-size: 27px;
  line-height: 1.05;
}

.fiscal-command-panel p {
  max-width: 780px;
  margin: 0;
  color: rgba(248,244,234,.76);
  line-height: 1.55;
}

.fiscal-stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  align-content: stretch;
}

.fiscal-stats div {
  display: grid;
  align-content: center;
  gap: 6px;
  min-height: 82px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 10px;
  padding: 11px;
  background: rgba(255,255,255,.055);
}

.fiscal-stats strong {
  color: #fff;
  font-family: var(--serif);
  font-size: 28px;
  line-height: 1;
}

.fiscal-stats span {
  color: rgba(248,244,234,.66);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
}

.fiscal-queue-panel {
  display: grid;
  gap: 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.97), rgba(250,248,243,.94)),
    #fff;
  box-shadow: var(--shadow-card);
}

.fiscal-queue-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  border-bottom: 1px solid var(--border);
  padding: 2px 2px 13px;
}

.fiscal-queue-head h2 {
  margin: 3px 0 4px;
  font-family: var(--serif);
  font-size: 23px;
  line-height: 1.08;
}

.fiscal-queue-head p {
  margin: 0;
  color: var(--text-secondary);
  line-height: 1.45;
}

.fiscal-queue-tools {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(200px, .7fr) minmax(140px, .45fr) auto;
  align-items: end;
  gap: 9px;
  min-width: min(760px, 58vw);
  margin-left: auto;
}

.fiscal-queue-tools label {
  display: grid;
  gap: 6px;
  min-width: 0;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.fiscal-queue-tools select,
.fiscal-queue-tools input {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0 12px;
  background: #fff;
  color: var(--marinho);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: none;
}

.fiscal-obligation-list {
  display: grid;
  gap: 10px;
}

.fiscal-obligation-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, auto);
  gap: 14px;
  align-items: stretch;
  border: 1px solid var(--border);
  border-left: 4px solid rgba(166,118,63,.66);
  border-radius: 10px;
  padding: 14px;
  background:
    linear-gradient(90deg, rgba(166,118,63,.055), transparent 42%),
    #fff;
  box-shadow: var(--shadow-soft);
}

/* Urgência de prazo na worklist da Fiscalização (faixa lateral por classe; reaproveita fiscalPrazoOk).
   Escopado em #fiscal para vencer a especificidade de "#fiscal .fiscal-obligation-card". */
#fiscal .fiscal-obligation-card.prazo-vencido { border-left: 3px solid var(--danger); background: linear-gradient(90deg, var(--danger-light), transparent 46%), #fff; }
#fiscal .fiscal-obligation-card.prazo-hoje { border-left: 3px solid var(--warning); background: linear-gradient(90deg, var(--warning-light), transparent 46%), #fff; }
#fiscal .fiscal-obligation-card.prazo-7dias { border-left-color: var(--warning); }

.fiscal-obligation-main {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.fiscal-obligation-main strong {
  color: var(--marinho);
  font-size: 15px;
}

.fiscal-obligation-main span {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.4;
}

.fiscal-obligation-main p {
  max-width: 920px;
  margin: 0;
  color: var(--text-secondary);
  line-height: 1.5;
}

.fiscal-obligation-card > .row-actions {
  display: grid;
  align-content: center;
  min-width: 210px;
  border-left: 1px solid var(--border);
  padding-left: 14px;
}

.contract-fulfillment-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(210px, auto);
  align-items: stretch;
}

.contract-fulfillment-card > .row-actions {
  display: grid;
  align-content: center;
  border-left: 1px solid var(--border);
  padding-left: 14px;
}

.fiscal-empty-state {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  border: 1px dashed rgba(166,118,63,.42);
  border-radius: 10px;
  padding: 18px;
  background:
    linear-gradient(135deg, rgba(166,118,63,.08), transparent 44%),
    #fffdf8;
}

.fiscal-empty-state strong {
  display: block;
  margin: 4px 0 6px;
  color: var(--marinho);
  font-family: var(--serif);
  font-size: 22px;
  line-height: 1.12;
}

.fiscal-empty-state p {
  max-width: 780px;
  margin: 0;
  color: var(--text-secondary);
  line-height: 1.5;
}

.fiscal-empty-state button {
  min-width: 220px;
}

.fiscal-failure-form,
.fiscal-completion-form {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  border-top: 1px solid var(--border);
  padding-top: 12px;
}

.fiscal-failure-form[hidden],
.fiscal-completion-form[hidden] {
  display: none;
}

.fiscal-failure-form label:has(textarea),
.fiscal-completion-form label:has(textarea),
.fiscal-failure-form .wide,
.fiscal-completion-form .wide,
.fiscal-failure-form .row-actions,
.fiscal-completion-form .row-actions {
  grid-column: 1 / -1;
}

.obligation-row {
  align-items: start;
}

.obligation-row small {
  color: var(--text-muted);
}

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

.obligation-review-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, auto);
  gap: 14px;
  align-items: stretch;
  border: 1px solid var(--border);
  border-left: 4px solid rgba(121,130,141,.28);
  border-radius: 10px;
  padding: 14px;
  background: #fff;
  box-shadow: var(--shadow-soft);
}

.obligation-review-card.needs-review {
  border-left-color: rgba(166,118,63,.74);
  background:
    linear-gradient(90deg, rgba(166,118,63,.055), transparent 38%),
    #fff;
}

.obligation-review-card.is-validated {
  border-left-color: rgba(26,122,84,.54);
}

.obligation-review-main {
  min-width: 0;
  display: grid;
  gap: 10px;
}

.obligation-review-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.obligation-review-head strong {
  display: block;
  margin-top: 3px;
  color: var(--marinho);
  font-size: 16px;
}

.obligation-review-card p {
  max-width: 980px;
  margin: 0;
  color: var(--text-secondary);
  line-height: 1.5;
}

.obligation-review-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.obligation-review-grid div {
  min-width: 0;
  display: grid;
  gap: 5px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  background: #fbfaf7;
}

.obligation-review-grid span {
  color: var(--text-muted);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.obligation-review-grid strong {
  color: var(--text-secondary);
  font-size: 11.5px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.obligation-details {
  display: grid;
  gap: 8px;
}

.obligation-details summary,
.contract-related-processes summary {
  width: fit-content;
  cursor: pointer;
  color: var(--marinho);
  font-size: 12px;
  font-weight: 700;
}

.obligation-details .obligation-review-grid {
  margin-top: 8px;
}

.contract-related-processes {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  background: #fbfaf7;
}

.contract-related-processes[open] > summary {
  margin-bottom: 10px;
}

.obligation-review-actions {
  display: grid;
  align-content: center;
  gap: 8px;
  min-width: 170px;
  border-left: 1px solid var(--border);
  padding-left: 14px;
}

.obligation-review-actions button {
  width: 100%;
}

.obligation-edit-form {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(4, minmax(130px, 1fr));
  gap: 12px;
  border-top: 1px solid var(--border);
  padding-top: 14px;
}

.obligation-edit-form[hidden] {
  display: none;
}

.obligation-edit-form .wide {
  grid-column: span 2;
}

.obligation-edit-form textarea {
  min-height: 78px;
}

.danger-action {
  color: var(--danger) !important;
  border-color: rgba(161,42,51,.34) !important;
  background: #fff !important;
}

.decision-actions {
  display: grid;
  gap: 8px;
  min-width: min(100%, 280px);
}

.decision-actions > span {
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
}

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

.info-grid div {
  display: grid;
  gap: 5px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  background: #fbfaf7;
}

.info-grid span {
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.info-grid strong {
  color: var(--marinho);
}

.inline-card-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  background: #fbfaf7;
}

.inline-card-form label:has(textarea),
.inline-card-form button {
  grid-column: 1 / -1;
}

.inline-card-form .wide {
  grid-column: 1 / -1;
}

.process-operational-form {
  background:
    linear-gradient(180deg, rgba(255,255,255,.82), rgba(250,248,243,.96)),
    #fbfaf7;
}

.ai-draft-status {
  grid-column: 1 / -1;
  border: 1px dashed rgba(166,118,63,.42);
  border-radius: 10px;
  padding: 10px 12px;
  background: rgba(255,248,237,.72);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.4;
}

.checkbox-line {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 9px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  background: #fff;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: none;
}

.checkbox-line input {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
}

.checkbox-line:has(input:checked) {
  border-color: var(--sel-border);
  background: var(--sel-bg);
  color: var(--marinho);
}

.check-grid {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px 12px;
  background: #fffaf2;
}

.check-grid legend {
  padding: 0 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-secondary);
}

.check-grid small {
  grid-column: 1 / -1;
  color: var(--muted);
  font-weight: 700;
}

.danger-item {
  border-color: rgba(161,42,51,.30);
  background: var(--danger-light);
}

.process-grid {
  display: grid;
  grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
  gap: 16px;
}

.timeline {
  display: grid;
  gap: 0;
}

.timeline-item {
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 9px;
  min-height: 48px;
  color: var(--text-muted);
}

.timeline-item > span {
  width: 14px;
  height: 14px;
  margin-top: 3px;
  border: 2px solid var(--border-dark);
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 0 0 5px #fff;
}

.timeline-item.done > span,
.timeline-item.current > span {
  border-color: var(--bronze);
  background: var(--bronze);
}

.timeline-item.current {
  color: var(--marinho);
}

.timeline-item strong {
  color: inherit;
  text-transform: capitalize;
}

.timeline-item small {
  display: block;
  margin-top: 3px;
}

.process-panels,
.encaminhamento-grid {
  display: grid;
  gap: 14px;
}

.encaminhamento-grid {
  grid-template-columns: minmax(260px, .8fr) minmax(320px, 1.2fr);
  align-items: start;
}

.guided-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.guided-step {
  min-height: 44px;
  justify-content: flex-start;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  background: #fff;
  box-shadow: none;
}

.guided-step span {
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #eef1f4;
  color: var(--marinho);
  font-size: 11px;
  font-weight: 700;
}

.guided-step.active {
  color: #fff;
  border-color: var(--marinho);
  background: linear-gradient(135deg, var(--marinho), var(--marinho-mid));
}

.guided-step.active span {
  color: var(--marinho);
  background: #f2d3a9;
}

.guided-pane { display: none; }
.guided-pane.active { display: block; }
.guided-form { max-width: 860px; }

.matrix-row {
  display: grid;
  grid-template-columns: minmax(120px, .6fr) minmax(220px, 1.4fr);
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fbfaf7;
}

.matrix-row label:nth-child(n+3) {
  grid-column: span 1;
}

.ia-term {
  border: 1px solid rgba(37,99,235,.18);
  border-radius: 10px;
  padding: 11px 12px;
  background: rgba(37,99,235,.06);
  color: var(--text-secondary);
  line-height: 1.5;
}

.minuta-box {
  display: grid;
  gap: 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  background: #fbfaf7;
  color: var(--text-secondary);
  line-height: 1.6;
}

body.pas-gate-open {
  overflow: hidden;
}

.pas-gate-overlay[hidden] {
  display: none !important;
}

.pas-gate-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(9, 22, 36, .58);
}

.pas-gate-dialog {
  width: min(980px, 100%);
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid rgba(166,118,63,.42);
  border-radius: 12px;
  background: #fffdf8;
  box-shadow: 0 22px 70px rgba(9,22,36,.32);
  outline: none;
}

.pas-gate-modal-toolbar {
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--border);
  padding: 8px 12px 8px 16px;
  background: var(--marinho);
  color: #fff;
  font-weight: 700;
}

.pas-gate-modal-toolbar .pas-gate-close {
  min-height: 36px;
  color: #fff;
  border-color: rgba(255,255,255,.34);
}

.pas-gate-modal-toolbar .pas-gate-close:hover {
  border-color: rgba(255,255,255,.62);
  background: rgba(255,255,255,.10);
}

.pas-gate-content {
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
}

.pas-gate-dialog .gate-panel {
  margin: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.gate-panel { display: grid; gap: 12px; border-color: rgba(166,118,63,.42); background: #fffdf8; }
.gate-panel h2 { margin-bottom: 0; font-family: var(--serif); font-size: 24px; line-height: 1.08; }
.gate-panel p { margin: 0; }
.gate-panel-head { display: grid; gap: 6px; }
.gate-progress {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 2px 0 0;
  padding: 0;
  list-style: none;
}
.gate-progress li {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(166,118,63,.22);
  border-radius: 10px;
  padding: 9px 11px;
  background: rgba(255,255,255,.72);
  color: var(--text-secondary);
  font-size: 11px;
}
.gate-progress li span,
.gate-step-heading > span {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  border-radius: 999px;
  background: var(--marinho);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
}
.gate-progress li strong { color: var(--marinho); }
.gate-origin-card {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.gate-origin-card > div,
.gate-evidence-list > div {
  display: grid;
  gap: 5px;
  border: 1px solid rgba(166,118,63,.22);
  border-radius: 10px;
  padding: 12px;
  background: white;
  box-shadow: var(--shadow-soft);
}
.gate-origin-card span,
.gate-evidence-list span {
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.gate-origin-card strong,
.gate-evidence-list strong { color: var(--marinho); }
.gate-origin-card small,
.gate-evidence-list small { color: var(--text-secondary); line-height: 1.45; }
.gate-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; margin: 12px 0; }
.gate-metric { border: 1px solid rgba(166,118,63,.28); border-radius: 10px; padding: 12px; background: white; box-shadow: var(--shadow-soft); }
.gate-metric strong { display: block; color: var(--marinho); font-family: var(--serif); font-size: 24px; line-height: 1; }
.gate-metric span { display: block; color: var(--text-muted); font-size: 10px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; margin-top: 7px; }
.gate-evidence-list { display: grid; gap: 8px; margin-top: 8px; }
.gate-list { margin: 10px 0 4px; padding-left: 18px; color: var(--text-secondary); line-height: 1.6; }
#pasGateForm {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  border-top: 1px solid rgba(166,118,63,.22);
  padding-top: 12px;
}
#pasGateForm label:has(textarea),
#pasGateForm .row-actions { grid-column: 1 / -1; }
.gate-step {
  grid-column: 1 / -1;
  display: grid;
  gap: 12px;
  border: 1px solid rgba(166,118,63,.22);
  border-radius: 12px;
  padding: 14px;
  background: #fff;
}
.gate-step-heading {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.gate-step-heading > div { display: grid; gap: 3px; }
.gate-step-heading strong { color: var(--marinho); font-size: 15px; }
.gate-step-heading small { color: var(--text-muted); line-height: 1.45; }
.gate-evidence-panel {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0 11px 11px;
  background: #fbfaf7;
}
.gate-evidence-panel > summary {
  min-height: 40px;
  display: flex;
  align-items: center;
  color: var(--marinho);
  font-weight: 750;
  cursor: pointer;
}
.gate-ready {
  border-left: 3px solid var(--success);
  border-radius: 8px;
  padding: 9px 11px;
  background: rgba(31,122,90,.07);
  color: var(--success);
  font-size: 12px;
  font-weight: 700;
}
.gate-sanctions { margin: 0; }
.gate-fields-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.gate-fields-grid .wide { grid-column: 1 / -1; }
.gate-fields-grid label small {
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 500;
  line-height: 1.4;
  text-transform: none;
  letter-spacing: 0;
}
.gate-review-step { background: #fffdf8; }
.gate-review-meta { display: grid; gap: 5px; }
.gate-confirmation-note {
  display: grid;
  gap: 3px;
  border: 1px solid rgba(166,118,63,.28);
  border-left: 3px solid var(--bronze);
  border-radius: 10px;
  padding: 11px 12px;
  background: #fff;
}
.gate-confirmation-note strong { color: var(--marinho); }
.gate-confirmation-note span { color: var(--text-secondary); font-size: 12px; line-height: 1.5; }
.gate-final-actions {
  position: sticky;
  bottom: 0;
  z-index: 2;
  justify-content: flex-start;
  border-top: 1px solid var(--border);
  padding: 10px 0;
  background: #fffdf8;
}

.decision-result-block {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  border: 1px solid rgba(166,118,63,.34);
  border-left: 3px solid var(--bronze);
  border-radius: 10px;
  padding: 14px;
  background: #fffdf8;
}

.decision-result-head,
.decision-result-confirm {
  grid-column: 1 / -1;
}

.decision-result-head {
  display: grid;
  gap: 4px;
}

.decision-result-head strong {
  color: var(--marinho);
  font-size: 15px;
}

.decision-result-head p,
.decision-sanctions small {
  margin: 0;
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.5;
}

.decision-result-options,
.decision-sanctions {
  min-width: 0;
  margin: 0;
}

.decision-result-confirm {
  border-top: 1px solid var(--border);
  padding-top: 11px;
  color: var(--marinho);
  font-weight: 700;
}

.password-panel { max-width: 560px; }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin: 0 0 18px;
}

.stat-card {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 112px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px;
  background: #fff;
  box-shadow: var(--shadow-soft);
}

.stat-icon {
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  border-radius: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--bronze);
  background: linear-gradient(135deg, rgba(166,118,63,.16), rgba(166,118,63,.04));
  border: 1px solid rgba(166,118,63,.24);
}

.stat-icon svg {
  width: 22px;
  height: 22px;
}

.stat-info {
  display: grid;
  gap: 4px;
}

.stat-info span {
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.1px;
  text-transform: uppercase;
}

.stat-info strong {
  color: var(--marinho);
  font-family: var(--serif);
  font-size: 30px;
  line-height: 1;
}

.stat-info small {
  color: var(--text-secondary);
  font-size: 11px;
}

.tabs {
  display: flex;
  gap: 0;
  margin: 0 0 16px;
  border: 1px solid var(--border);
  border-radius: 10px 14px 0 0;
  background: #fff;
  overflow-x: auto;
  box-shadow: var(--shadow-soft);
}

.tab {
  min-height: 48px;
  border: 0;
  border-radius: 0;
  border-bottom: 3px solid transparent;
  padding: 13px 18px;
  color: var(--text-muted);
  background: transparent;
  box-shadow: none;
  font-size: 12px;
  font-weight: 800;
  text-transform: none;
  white-space: nowrap;
}

.tab:hover {
  color: var(--marinho);
  background: var(--hover-bg);
  transform: none;
  box-shadow: none;
}

.tab.active {
  color: var(--marinho);
  border-bottom-color: var(--bronze);
  background: var(--sel-bg);
  transform: none;
  box-shadow: none;
}

.admin-console {
  display: grid;
  gap: 14px;
}

.admin-console-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px 20px;
  background:
    linear-gradient(135deg, rgba(166,118,63,.10), transparent 48%),
    #fff;
  box-shadow: var(--shadow-soft);
}

.admin-console-head h2 {
  margin: 4px 0 5px;
  font-family: var(--serif);
  font-size: 23px;
  line-height: 1.05;
  letter-spacing: 0;
}

.admin-console-head p {
  max-width: 680px;
  margin: 0;
  color: var(--text-secondary);
  line-height: 1.45;
}

.admin-stats {
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  margin-bottom: 0;
}

.admin-stats .stat-card {
  min-height: 88px;
  padding: 14px 16px;
  border-radius: 10px;
}

.admin-stats .stat-icon {
  width: 34px;
  height: 34px;
  border-radius: 9px;
}

.admin-stats .stat-info strong {
  font-size: 26px;
}

.admin-scope-panel {
  display: grid;
  grid-template-columns: 1.1fr 1fr 1fr;
  gap: 12px;
}

.scope-card {
  position: relative;
  min-height: 122px;
  display: grid;
  align-content: start;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  background:
    linear-gradient(135deg, rgba(255,255,255,.92), rgba(251,250,247,.82)),
    #fff;
  box-shadow: var(--shadow-soft);
}

.scope-card.platform {
  color: #fff8ea;
  border-color: rgba(234,217,167,.22);
  background:
    linear-gradient(135deg, rgba(166,118,63,.22), transparent 46%),
    linear-gradient(135deg, #091722, #173250);
}

.scope-card.active {
  border-color: var(--sel-border);
  box-shadow: inset 3px 0 0 var(--sel-bar), var(--shadow-card);
}

.scope-card.active:not(.platform) {
  background: var(--sel-bg);
}

.scope-card.platform.active {
  box-shadow: inset 3px 0 0 var(--sel-bar), var(--shadow-card);
}

.scope-card .scope-kicker {
  color: var(--bronze);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.scope-card.platform .scope-kicker {
  color: var(--ouro-light);
}

.scope-card strong {
  color: var(--marinho);
  font-size: 15px;
}

.scope-card.platform strong {
  color: #fff;
}

.scope-card p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 12.5px;
  line-height: 1.48;
}

.scope-card.platform p {
  color: rgba(255,248,234,.72);
}

.scope-card code {
  align-self: end;
  width: fit-content;
  border-radius: 999px;
  padding: 5px 8px;
  color: var(--marinho);
  background: rgba(166,118,63,.12);
  font-size: 10px;
  font-weight: 700;
}

.scope-card.platform code {
  color: #fff8ea;
  background: rgba(255,255,255,.10);
}

.admin-form-hint {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 10px;
  align-items: start;
  margin-bottom: 12px;
  border: 1px solid rgba(166,118,63,.22);
  border-radius: 10px;
  padding: 12px 14px;
  color: var(--text-secondary);
  background: var(--bronze-subtle);
  font-size: 12px;
  line-height: 1.5;
}

.admin-form-hint::before {
  content: "";
  width: 9px;
  height: 9px;
  margin-top: 4px;
  border-radius: 50%;
  background: var(--bronze);
  box-shadow: 0 0 0 5px rgba(166,118,63,.12);
}

.admin-side-tabs .tab[hidden] {
  display: none;
}

.admin-layout {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.admin-side-tabs {
  position: sticky;
  top: 92px;
  display: grid;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  background: #fff;
  box-shadow: var(--shadow-soft);
}

.admin-side-tabs .tab {
  width: 100%;
  min-height: 58px;
  display: grid;
  justify-items: start;
  align-content: center;
  gap: 3px;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 10px 12px;
  color: var(--text-secondary);
  text-align: left;
  white-space: normal;
}

.admin-side-tabs .tab span {
  color: inherit;
  font-size: 12px;
  font-weight: 700;
}

.admin-side-tabs .tab small {
  color: var(--text-muted);
  font-size: 10.5px;
  font-weight: 650;
  text-transform: none;
  letter-spacing: 0;
}

.admin-side-tabs .tab:hover {
  border-color: var(--border-dark);
  background: var(--hover-bg);
  color: var(--marinho);
}

.admin-side-tabs .tab.active {
  border-color: var(--sel-border);
  background: var(--sel-bg);
  color: var(--marinho);
  box-shadow: inset 3px 0 0 var(--sel-bar);
}

.admin-workbench {
  display: grid;
  gap: 14px;
}

.admin-pane {
  display: none;
  gap: 14px;
}

.admin-pane.active {
  display: grid;
}

.card-shell {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 18px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, #fff, #fbfaf7);
}

.card-header h2 {
  margin: 0;
  font-size: 14px;
}

.card-header span {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
}

.card-body {
  padding: 14px 16px 16px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr));
  gap: 12px;
  align-items: end;
}

.compact-form label {
  min-width: 0;
}

.form-actions {
  display: flex;
  align-items: end;
  justify-content: flex-end;
}

.form-actions button {
  width: 100%;
}

.admin-table {
  margin-top: 0;
  padding: 0;
  overflow: hidden;
  border-radius: 10px;
}

.admin-table table {
  margin: 0;
}

.regulation-tools {
  display: grid;
  gap: 12px;
  margin-bottom: 14px;
}

.regulation-tools form {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  background: rgba(255, 255, 255, .62);
}

/* Modo operacional enxuto: textos explicativos ficam no botão ? e no Sobre. */
#dashboard .home-ops-bar p,
#dashboard .home-panel-head p,
#contratos .command-copy p,
#contratos .consult-head p,
#licitacoes .consult-head p,
#fiscal .fiscal-command-panel p,
#fiscal .fiscal-queue-head p,
#ocorrencias .processes-queue-head p,
#processos .processes-command-panel p,
#processos .processes-queue-head p {
  display: none;
}

#contratosResumo,
#fiscalStats,
#processosStats {
  display: none;
}

#dashboard .home-ops-bar,
#contratos .contract-command-bar,
#licitacoes .contract-consult:first-of-type,
#fiscal .fiscal-command-panel,
#processos .processes-command-panel {
  padding: 18px;
}

#dashboard .home-ops-grid {
  grid-template-columns: minmax(0, 1fr);
}

#dashboard .home-search-panel {
  margin-top: 10px;
}

#dashboard .home-search-panel:not(:focus-within) #homeSearchResults .empty-state {
  display: none;
}

.pas-context-drawer,
.contract-related-processes,
.saved-docs-panel,
.generated-documents-panel,
.obligation-details {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
}

.pas-context-drawer {
  padding: 0;
}

.pas-context-drawer > summary,
.contract-related-processes > summary,
.saved-docs-panel > summary,
.generated-documents-panel > summary,
.obligation-details > summary {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 14px;
  color: var(--marinho);
  font-weight: 800;
  cursor: pointer;
}

.pas-context-drawer > *:not(summary) {
  margin: 12px;
}

.pas-context-drawer .process-stepper {
  grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
}

.pas-context-drawer .process-step {
  min-height: 74px;
  padding: 10px;
}

.pas-context-drawer .pas-checklist-summary,
.pas-context-drawer .generated-documents-panel,
.pas-context-drawer .origin-strip,
.pas-context-drawer .thread-header {
  box-shadow: none;
}

.process-consult-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}
.process-consult-summary > div {
  display: grid;
  gap: 4px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 11px;
  background: #fbfaf7;
}
.process-consult-summary span {
  color: var(--text-muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.process-consult-summary strong { color: var(--marinho); font-size: 13px; line-height: 1.35; }
.pas-consult-section {
  display: grid;
  gap: 9px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  background: #fff;
}
.pas-consult-section p { margin: 0; color: var(--text-secondary); line-height: 1.55; }
.pas-consult-section > small { color: var(--text-muted); line-height: 1.45; }
.pas-consult-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.pas-consult-heading > div:first-child { display: grid; gap: 3px; }
.pas-consult-heading strong { color: var(--marinho); }
.pas-history { display: grid; gap: 0; }
.pas-history-item {
  position: relative;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 10px;
  min-height: 52px;
  padding-bottom: 10px;
}
.pas-history-item:not(:last-child)::before {
  content: '';
  position: absolute;
  left: 13px;
  top: 27px;
  bottom: -1px;
  width: 1px;
  background: var(--border);
}
.pas-history-marker {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid var(--border-dark);
  border-radius: 999px;
  background: #fff;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 800;
}
.pas-history-item.done .pas-history-marker { border-color: var(--success); background: rgba(31,122,90,.1); color: var(--success); }
.pas-history-item.current .pas-history-marker { border-color: var(--bronze); background: var(--bronze); color: #fff; }
.pas-history-item > div { display: grid; align-content: start; gap: 3px; padding-top: 2px; }
.pas-history-item strong { color: var(--marinho); font-size: 12px; }
.pas-history-item span:not(.pas-history-marker) { color: var(--text-muted); font-size: 11px; line-height: 1.4; }
.pas-history-item.upcoming { opacity: .65; }

.conductor-panel {
  margin-bottom: 8px;
}

.process-panels {
  margin-top: 0;
}

.stage-heading span,
.anti-nullity-note {
  font-size: 12px;
}

.stage-heading {
  padding: 12px;
}

.check-line {
  align-self: center;
  grid-template-columns: 18px 1fr;
  align-items: center;
  gap: 9px;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-input);
  background: #fbfaf7;
  color: var(--text-secondary);
  font-size: 11px;
  letter-spacing: 0;
  text-transform: none;
}

.check-line input {
  width: 16px;
  height: 16px;
  padding: 0;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  border-radius: 999px;
  padding: 4px 8px;
  background: rgba(121,130,141,.12);
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.status-badge.ok {
  background: var(--success-light);
  color: var(--success);
}

.status-badge.warning {
  background: var(--warning-light);
  color: var(--warning);
}

pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  background: #fbfaf7;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
}

.about-console {
  display: grid;
  gap: 14px;
}

.about-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, .42fr);
  gap: 18px;
  align-items: stretch;
  border: 1px solid rgba(166,118,63,.24);
  border-radius: 10px;
  padding: 24px;
  background:
    linear-gradient(135deg, rgba(21,38,61,.96), rgba(12,24,40,.92)),
    var(--marinho);
  color: #f7f4ee;
  box-shadow: var(--shadow-card);
}

.about-hero h2 {
  max-width: 780px;
  margin: 6px 0 10px;
  color: #fff;
  font-family: var(--serif);
  font-size: clamp(28px, 3.4vw, 46px);
  line-height: 1.02;
}

.about-hero p {
  max-width: 820px;
  margin: 0;
  color: rgba(247,244,238,.76);
  font-size: 15px;
  line-height: 1.62;
}

.about-seal {
  display: grid;
  align-content: center;
  gap: 10px;
  border: 1px solid rgba(200,155,102,.26);
  border-radius: 10px;
  padding: 18px;
  background:
    linear-gradient(135deg, rgba(200,155,102,.12), rgba(255,255,255,.02)),
    rgba(255,255,255,.035);
}

.about-seal strong {
  color: #f8e3bf;
  font-family: var(--serif);
  font-size: 24px;
  line-height: 1;
}

.about-seal span {
  color: rgba(247,244,238,.72);
  line-height: 1.5;
}

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

.about-grid article,
.about-stage-panel,
.about-io-card,
.about-storage-panel,
.about-flow-panel,
.about-roles-panel {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255,255,255,.94);
  box-shadow: var(--shadow-soft);
}

.about-grid article {
  display: grid;
  align-content: start;
  gap: 9px;
  min-height: 184px;
  padding: 17px;
}

.about-grid article > span {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(166,118,63,.28);
  border-radius: 10px;
  color: var(--bronze);
  background: var(--bronze-subtle);
  font-size: 12px;
  font-weight: 700;
}

.about-grid h3 {
  margin: 0;
  color: var(--marinho);
  font-size: 15px;
}

.about-grid p {
  margin: 0;
  color: var(--text-secondary);
  line-height: 1.55;
}

.about-stage-panel {
  display: grid;
  gap: 16px;
  padding: 20px;
}

.about-stage-panel h2,
.about-io-card h2 {
  margin: 3px 0 6px;
  font-family: var(--serif);
  font-size: 25px;
  line-height: 1.08;
}

.about-stage-panel > div:first-child p {
  max-width: 820px;
  margin: 0;
  color: var(--text-secondary);
  line-height: 1.55;
}

.about-stages {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.about-stages article {
  position: relative;
  display: grid;
  align-content: start;
  gap: 9px;
  min-height: 184px;
  border: 1px solid rgba(21,38,61,.12);
  border-radius: 10px;
  padding: 14px;
  background:
    linear-gradient(180deg, rgba(21,38,61,.045), rgba(255,255,255,.2)),
    #fbfaf7;
}

.about-stages article::after {
  content: "";
  position: absolute;
  top: 31px;
  right: -11px;
  width: 11px;
  border-top: 1px solid rgba(166,118,63,.34);
}

.about-stages article:last-child::after {
  display: none;
}

.about-stages span {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(166,118,63,.32);
  border-radius: 50%;
  color: var(--marinho);
  background: var(--bronze-subtle);
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 700;
}

.about-stages strong {
  color: var(--marinho);
  font-weight: 700;
  line-height: 1.18;
}

.about-stages p {
  margin: 0;
  color: var(--text-secondary);
  line-height: 1.48;
}

.about-io {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.about-doc-map {
  display: grid;
  gap: 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
  background: rgba(255,255,255,.94);
  box-shadow: var(--shadow-soft);
}

.about-doc-map h2 {
  margin: 3px 0 6px;
  font-family: var(--serif);
  font-size: 25px;
  line-height: 1.08;
}

.about-doc-map p {
  max-width: 900px;
  margin: 0;
  color: var(--text-secondary);
  line-height: 1.5;
}

.about-doc-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.about-doc-grid article {
  display: grid;
  align-content: start;
  gap: 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  background: #fbfaf7;
}

.about-doc-grid article > strong {
  color: var(--marinho);
  font-weight: 700;
  line-height: 1.2;
}

.about-doc-grid dl {
  display: grid;
  gap: 7px;
  margin: 0;
}

.about-doc-grid dt {
  margin-top: 3px;
  color: var(--text-muted);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.about-doc-grid dd {
  margin: 0;
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.42;
}

.about-storage-panel {
  display: grid;
  gap: 14px;
  padding: 20px;
}

.about-storage-panel h2 {
  margin: 3px 0 6px;
  font-family: var(--serif);
  font-size: 25px;
  line-height: 1.08;
}

.about-storage-panel p {
  max-width: 880px;
  margin: 0;
  color: var(--text-secondary);
  line-height: 1.5;
}

.about-storage-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
}

.about-storage-grid article {
  display: grid;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  background: #fbfaf7;
}

.about-storage-grid strong {
  color: var(--marinho);
  font-weight: 700;
}

.about-storage-grid span,
.about-storage-grid small {
  color: var(--text-secondary);
  line-height: 1.42;
}

.about-storage-grid small {
  color: var(--text-muted);
}

.about-io-card {
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 20px;
}

.about-io-card ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.about-io-card li {
  position: relative;
  padding-left: 18px;
  color: var(--text-secondary);
  line-height: 1.45;
}

.about-io-card li::before {
  content: "";
  position: absolute;
  left: 0;
  top: .62em;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--bronze);
  box-shadow: 0 0 0 3px rgba(166,118,63,.13);
}

.about-flow-panel,
.about-roles-panel {
  display: grid;
  gap: 14px;
  padding: 20px;
}

.about-flow-panel h2,
.about-roles-panel h2 {
  margin: 3px 0 0;
  font-family: var(--serif);
  font-size: 25px;
}

.about-roles-panel > div:first-child p {
  max-width: 840px;
  margin: 6px 0 0;
  color: var(--text-secondary);
  line-height: 1.5;
}

.about-flow,
.about-roles {
  display: grid;
  gap: 10px;
}

.about-flow {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.about-flow div,
.about-roles div {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  background: #fbfaf7;
}

.about-flow strong,
.about-roles strong {
  display: block;
  color: var(--marinho);
  font-weight: 700;
}

.about-flow span,
.about-roles span {
  display: block;
  margin-top: 5px;
  color: var(--text-secondary);
  line-height: 1.45;
}

.about-roles {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

#toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 40;
  display: none;
  max-width: 440px;
  min-height: 20px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  background: white;
  color: var(--danger);
  box-shadow: var(--shadow-card);
  font-weight: 800;
}

@media (max-width: 920px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar {
    position: sticky;
    top: 0;
    z-index: 30;
    height: auto;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    padding: 12px;
    gap: 10px;
    box-shadow: var(--shadow-card);
  }
  .brand {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 0;
    border-bottom: 0;
  }
  .brand-mark { gap: 8px; }
  .brand-icon {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    font-size: 20px;
  }
  .brand strong { font-size: 23px; }
  .brand em { display: none; }
  .tenant-card {
    max-width: 42vw;
    padding: 8px 9px;
  }
  .tenant-card span,
  .tenant-card small { display: none; }
  .tenant-card strong {
    font-size: 11px;
    text-align: right;
  }
  .sidebar-footer-card { display: none; }
  .sidebar-about-button { display: none; }
  nav {
    min-width: 0;
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
  }
  nav::-webkit-scrollbar { display: none; }
  .nav-section { display: none; }
  nav button {
    width: auto;
    flex: 0 0 auto;
    min-height: 36px;
    padding: 8px 10px;
    white-space: nowrap;
  }
  nav button svg { width: 16px; height: 16px; }
  nav button small { display: none; }
  nav button.active,
  nav button:hover { border-color: var(--bronze-light); }
  .sidebar button.ghost {
    min-height: 34px;
    margin-top: 0;
    padding: 7px 10px;
    white-space: nowrap;
  }
  .workspace { padding: 16px; }
  .exec-header { margin: -16px -16px 18px; padding: 16px; align-items: start; flex-direction: column; }
  .page-title-row { align-items: flex-start; }
  .page-help-button { flex: 0 0 auto; margin-top: 2px; }
  .context-help-overlay {
    align-items: flex-end;
    justify-content: center;
  }
  .context-help-panel {
    width: 100%;
    max-height: 78vh;
    height: auto;
    margin: 10px;
    border-radius: 10px 18px 14px 14px;
  }
  .dashboard-grid, .clean-dashboard, .fiscal-grid, .home-command-panel, .home-ops-bar, .home-ops-grid, .simple-filter-bar, .processes-filter-toolbar, .processes-command-panel, .ia-audit-head, .fiscal-command-panel, .ai-intake-panel, .contract-workbench, .contract-command-bar, .artifact-inline-form, .setup-panel { grid-template-columns: 1fr; }
  .compact-file,
  .artifact-inline-form button,
  .artifact-inline-form .import-options {
    grid-column: 1;
    grid-row: auto;
  }
  .artifact-inline-form button {
    min-height: 42px;
  }
  .about-hero,
  .about-grid,
  .about-stages,
  .about-io,
  .about-doc-grid,
  .about-storage-grid,
  .about-flow,
  .about-roles,
  .saved-docs-grid { grid-template-columns: 1fr; }
  .about-stages article::after { display: none; }
  .generated-documents-head,
  .generated-document-row {
    display: grid;
    grid-template-columns: 1fr;
  }
  .document-summary,
  .document-actions {
    min-width: 0;
    justify-content: flex-start;
    flex-wrap: wrap;
  }
  .home-stats,
  .home-ops-stats,
  .processes-stats,
  .ia-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .home-pipeline-panel > div:first-child,
  .home-panel-head,
  .processes-queue-head,
  .ia-table-head { flex-direction: column; }
  .process-object-layout { grid-template-columns: 1fr; }
  .fiscal-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fiscal-queue-head { flex-direction: column; }
  .fiscal-queue-tools {
    grid-template-columns: 1fr;
    width: 100%;
    min-width: 0;
    justify-content: stretch;
  }
  .fiscal-queue-tools label {
    min-width: 0;
    flex: 1;
  }
  .fiscal-obligation-card > .row-actions {
    border-left: 0;
    border-top: 1px solid var(--border);
    padding: 12px 0 0;
  }
  .contract-fulfillment-card {
    grid-template-columns: 1fr;
  }
  .contract-fulfillment-card > .row-actions {
    border-left: 0;
    border-top: 1px solid var(--border);
    padding: 12px 0 0;
  }
  .fiscal-empty-state { grid-template-columns: 1fr; }
  .fiscal-empty-state button { width: 100%; }
  .consult-head { flex-direction: column; }
  .consult-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .consult-toolbar { grid-template-columns: 1fr; }
  .consult-row { grid-template-columns: 1fr; }
  .consult-row-action {
    border-left: 0;
    border-top: 1px solid var(--border);
    padding: 12px 0 0;
  }
  .admin-console-head { flex-direction: column; }
  .admin-scope-panel { grid-template-columns: 1fr; }
  .admin-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-layout { grid-template-columns: 1fr; }
  .admin-side-tabs {
    position: static;
    display: flex;
    overflow-x: auto;
  }
  .admin-side-tabs .tab {
    flex: 0 0 180px;
  }
  .flow-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .setup-checklist { grid-template-columns: 1fr; }
  .setup-actions { min-width: 0; }
  .ai-pipeline { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .object-layout,
  .process-grid,
  .encaminhamento-grid { grid-template-columns: 1fr; }
  .gate-origin-card,
  .gate-progress,
  .gate-fields-grid,
  .process-consult-summary,
  #pasGateForm,
  .compact-deadline-form { grid-template-columns: 1fr; }
  .pas-consult-heading { flex-direction: column; }
  .compact-deadline-form button { width: 100%; }
  .thread-header,
  .conductor-panel,
  .next-action,
  .pas-checklist-summary,
  .work-item,
  .object-card,
  .obligation-review-card,
  .occurrence-card { align-items: stretch; flex-direction: column; }
  .obligation-review-card { grid-template-columns: 1fr; }
  .obligation-review-actions {
    border-left: 0;
    border-top: 1px solid var(--border);
    padding: 12px 0 0;
  }
  .obligation-review-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .obligation-edit-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .obligation-edit-form .wide { grid-column: 1 / -1; }
  .fiscal-obligation-card { grid-template-columns: 1fr; }
  .action-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .inline-fields { grid-template-columns: 1fr; }
  .inline-form { display: grid; }
  .inline-card-form { grid-template-columns: 1fr; }
  .conductor-actions { min-width: 0; }
  .fiscal-failure-form,
  .fiscal-completion-form { grid-template-columns: 1fr; }
  .matrix-row { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .guided-steps { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
  .action-cards { grid-template-columns: 1fr; }
  .flow-steps { grid-template-columns: 1fr; }
  .journey-mini { grid-template-columns: 1fr; }
  .ai-pipeline { grid-template-columns: 1fr; }
  .home-stats,
  .processes-stats,
  .ia-stats { grid-template-columns: 1fr; }
  .fiscal-stats { grid-template-columns: 1fr; }
  .consult-kpis,
  .consult-toolbar { grid-template-columns: 1fr; }
  .admin-stats { grid-template-columns: 1fr; }
  .admin-side-tabs .tab { flex-basis: 155px; }
  .form-grid { grid-template-columns: 1fr; }
  .obligation-review-grid,
  .obligation-edit-form { grid-template-columns: 1fr; }
  .source-strip, .origin-strip { grid-template-columns: 1fr; }
  .card-header { align-items: flex-start; flex-direction: column; }
}

/* SANCIA guia operacional */
.home-guide-workbench {
  gap: 12px;
}

.home-guide-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  background: #fff;
  box-shadow: var(--shadow-soft);
}

.home-guide-hero h2 {
  margin: 3px 0 0;
  color: var(--marinho);
  font-family: var(--serif);
  font-size: 26px;
  line-height: 1.05;
}

.home-guide-hero p {
  margin: 0;
  max-width: 760px;
  color: var(--text-secondary);
}

.home-primary-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.home-action-card {
  display: grid;
  gap: 5px;
  min-height: 92px;
  padding: 13px 14px;
  text-align: left;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  box-shadow: var(--shadow-soft);
}

.home-action-card:hover {
  border-color: rgba(166, 118, 63, .55);
  transform: translateY(-1px);
}

.home-action-card span {
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.home-action-card strong {
  color: var(--marinho);
  font-family: var(--serif);
  font-size: 21px;
  line-height: 1.05;
}

.home-action-card small {
  color: var(--text-secondary);
  font-weight: 700;
  line-height: 1.35;
}

.home-action-card.primary {
  background: linear-gradient(135deg, var(--marinho), #1e456c);
  border-color: rgba(255, 255, 255, .12);
}

.home-action-card.primary span,
.home-action-card.primary strong,
.home-action-card.primary small {
  color: #fff;
}

.home-action-card.warning {
  background: #fff8ea;
  border-color: rgba(166, 118, 63, .45);
}

.home-search-drawer {
  padding: 0;
  overflow: hidden;
}

.home-search-drawer summary {
  cursor: pointer;
  padding: 12px 14px;
  color: var(--marinho);
  font-weight: 700;
}

.home-search-drawer[open] summary {
  border-bottom: 1px solid var(--border);
}

.home-search-drawer .simple-filter-bar,
.home-search-drawer .compact-list {
  margin: 14px;
}

.intake-guide {
  display: grid;
  gap: 10px;
}

.intake-head,
.intake-option,
.about-reference details {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow-soft);
}

.intake-head {
  padding: 12px 14px;
  box-shadow: none;
}

.intake-head h2,
.intake-option h2 {
  margin: 2px 0 4px;
}

.intake-head p,
.intake-option p {
  max-width: 780px;
  margin: 0;
  color: var(--muted);
}

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

.intake-option {
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 14px;
}

.intake-option[hidden],
.intake-panel[hidden],
.intake-empty[hidden] {
  display: none !important;
}

.intake-empty {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  border: 1px dashed rgba(166,118,63,.28);
  border-radius: 10px;
  padding: 10px 12px;
  color: var(--text-secondary);
  background: rgba(255,255,255,.52);
}

.intake-empty strong {
  color: var(--marinho);
  font-size: 13px;
}

.intake-empty span {
  font-size: 12px;
}

.intake-option .artifact-inline-form {
  grid-template-columns: minmax(260px, .85fr) minmax(260px, 1fr) auto;
  align-items: end;
  box-shadow: none;
}

.intake-option .artifact-inline-form button {
  grid-column: auto;
  grid-row: auto;
  width: auto;
  min-width: 150px;
  min-height: 36px;
  align-self: end;
}

.intake-manual {
  margin-top: 0;
}

.about-reference {
  display: grid;
  gap: 10px;
}

.about-reference details {
  padding: 0;
  overflow: hidden;
}

.about-reference summary {
  cursor: pointer;
  padding: 16px 18px;
  font-weight: 700;
  color: var(--ink);
  list-style-position: inside;
}

.about-reference details[open] summary {
  border-bottom: 1px solid var(--border);
}

.about-reference details > p,
.about-reference details > ul,
.about-flow-lines,
.about-doc-list {
  padding: 16px 18px 18px;
}

.about-reference ul {
  margin: 0;
  display: grid;
  gap: 8px;
  color: var(--text);
}

.about-reference p {
  margin: 0;
  color: var(--muted);
}

.about-flow-lines {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.about-flow-lines article,
.about-doc-list div {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  background: var(--surface-soft);
}

.about-flow-lines strong,
.about-doc-list strong {
  display: block;
  color: var(--ink);
  margin-bottom: 5px;
}

.about-flow-lines span,
.about-doc-list span {
  display: block;
  color: var(--text);
}

.about-flow-lines p {
  margin-top: 8px;
}

.about-doc-list {
  display: grid;
  gap: 10px;
}

@media (max-width: 760px) {
  .home-guide-hero {
    align-items: stretch;
    flex-direction: column;
  }
  .home-primary-actions {
    grid-template-columns: 1fr;
  }
  .intake-options,
  .about-flow-lines {
    grid-template-columns: 1fr;
  }
}

/* Padronização de botões: bronze como acento, não como massa visual. */
button {
  min-height: 34px;
  border-radius: 10px;
  padding: 7px 12px;
  background: var(--marinho);
  box-shadow: none;
  font-size: 12px;
  font-weight: 800;
}

button:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-card);
}

button.ghost {
  background: rgba(255, 255, 255, .72);
  color: var(--marinho);
  border-color: var(--border);
}

.artifact-inline-form button,
.intake-option .artifact-inline-form button,
.consult-row-action button,
.work-item button,
.form-actions button,
.compact-deadline-form button,
.inline-card-form button,
.obligation-review-actions button {
  min-height: 38px;
  box-shadow: none;
}

.artifact-inline-form button,
.intake-option .artifact-inline-form button {
  min-height: 42px;
  border-color: rgba(166, 118, 63, .30);
}

.row-actions button,
.conductor-action-item button,
.contract-context-actions button {
  min-height: 32px;
  padding: 6px 10px;
  border-radius: 9px;
}

.home-action-card {
  min-height: 92px;
  border-radius: 10px;
  box-shadow: none;
}

.home-action-card.primary {
  border-color: rgba(166, 118, 63, .42);
  border-left: 4px solid var(--bronze);
  background: #fff;
}

.home-action-card.primary span {
  color: var(--bronze);
}

.home-action-card.primary strong {
  color: var(--marinho);
}

.home-action-card.primary small {
  color: var(--text-secondary);
}

.home-action-card.warning {
  border-color: rgba(166, 118, 63, .32);
  border-left: 4px solid rgba(166, 118, 63, .55);
  background: #fffdf8;
}

.home-guide-workbench {
  gap: 12px;
}

.home-guide-hero.work-first {
  padding: 12px 14px;
  box-shadow: none;
}

.home-guide-hero.work-first h2 {
  font-size: 22px;
}

.home-primary-actions.compact-actions {
  grid-template-columns: repeat(2, minmax(0, 240px));
  justify-content: start;
}

.home-primary-actions.compact-actions .home-action-card {
  min-height: 62px;
  padding: 10px 12px;
}

.home-primary-actions.compact-actions .home-action-card strong {
  font-family: var(--sans);
  font-size: 14px;
}

.home-primary-actions.compact-actions .home-action-card small {
  font-size: 12px;
}

.home-priority-panel {
  box-shadow: none;
}

#dashboard .home-guide-workbench {
  width: 100%;
  max-width: none;
}

#dashboard .home-primary-actions {
  display: none !important;
}

#dashboard .home-priority-panel {
  padding: 16px;
  border-radius: 10px;
}

#dashboard .home-panel-head {
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

#dashboard .simple-filter-bar {
  margin-top: 12px;
}

#dashboard .compact-list {
  margin-top: 10px;
}

#ocorrencias .processes-queue-panel,
#processos .processes-queue-panel,
#encaminhamentos .processes-queue-panel {
  display: grid;
  gap: 10px;
  border: 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
}

#ocorrencias .processes-queue-head,
#processos .processes-queue-head,
#encaminhamentos .processes-queue-head {
  min-height: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  background: #fff;
  box-shadow: none;
}

#ocorrencias .processes-queue-head h2,
#processos .processes-queue-head h2,
#encaminhamentos .processes-queue-head h2 {
  margin: 0;
  font-size: 18px;
}

#ocorrencias .processes-filter-toolbar,
#processos .processes-filter-toolbar,
#encaminhamentos .processes-filter-toolbar {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(220px, .55fr) auto;
  align-items: end;
  gap: 10px;
  margin: 0;
  border-radius: 10px;
  padding: 10px;
  background: #fff;
  box-shadow: none;
}

#ocorrencias .processes-filter-toolbar .filter-search,
#processos .processes-filter-toolbar .filter-search,
#encaminhamentos .processes-filter-toolbar .filter-search {
  min-width: 0;
}

#ocorrencias .processes-filter-toolbar > label:first-child,
#processos .processes-filter-toolbar > label:first-child,
#encaminhamentos .processes-filter-toolbar > label:first-child {
  min-width: 0;
}

.filter-drawer {
  align-self: end;
  min-width: 112px;
}

.filter-drawer summary {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-dark);
  border-radius: var(--radius-btn);
  padding: 8px 13px;
  color: var(--text);
  background: #fff;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}

.filter-drawer summary::-webkit-details-marker {
  display: none;
}

.filter-drawer[open] {
  grid-column: 1 / -1;
}

.filter-drawer[open] summary {
  margin-bottom: 8px;
  background: #faf8f4;
}

.filter-drawer > div {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 1fr)) auto;
  align-items: end;
  gap: 10px;
}

#ocorrencias .process-object-layout,
#processos .process-object-layout,
#encaminhamentos .process-object-layout {
  grid-template-columns: 1fr;
  gap: 10px;
}

#ocorrencias .worklist-column,
#processos .worklist-column,
#encaminhamentos .worklist-column {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

#ocorrencias .object-detail,
#processos .object-detail,
#encaminhamentos .object-detail {
  border: 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
}

#ocorrencias .process-shell,
#processos .process-shell,
#encaminhamentos .process-shell {
  border-radius: 10px;
  padding: 14px;
  box-shadow: none;
}

#encaminhamentos .internal-focus-head {
  align-items: start;
}

#encaminhamentos .internal-origin-strip {
  margin-top: 10px;
}

#encaminhamentos .guided-steps {
  margin-top: 12px;
}

#encaminhamentos .guided-pane .panel {
  margin: 0;
}

#ocorrencias .occurrence-focus-head {
  grid-template-columns: minmax(0, 1fr);
}

#ocorrencias .occurrence-focus-head h2 {
  font-size: 22px;
}

#ocorrencias .occurrence-next-action {
  grid-template-columns: minmax(0, 1fr);
}

#ocorrencias .occurrence-next-action .row-actions {
  justify-content: flex-start;
}

#processos .process-focus-head {
  grid-template-columns: minmax(0, 1fr);
}

#processos .process-focus-pills {
  justify-content: flex-start;
}

#processos .conductor-panel {
  grid-template-columns: minmax(0, 1fr);
}

#processos .conductor-actions {
  min-width: 0;
  grid-template-columns: repeat(auto-fit, minmax(180px, max-content));
}

#processos .conductor-action-item small {
  display: none;
}

#processos .process-stage-track {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0;
  background: #fff;
}

#processos .process-stage-track summary {
  min-height: 42px;
  display: flex;
  align-items: center;
  padding: 10px 12px;
  color: var(--marinho);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}

#processos .process-stage-track summary::-webkit-details-marker {
  display: none;
}

#processos details.process-stage-track > summary,
#processos details.pas-context-drawer > summary,
#processos details.process-action-details > summary,
.occurrence-details-compact > summary,
.occurrence-secondary-actions > summary,
.contract-related-processes > summary {
  position: relative;
  padding-right: 88px;
  cursor: pointer;
  list-style: none;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}

#processos details.process-stage-track > summary::-webkit-details-marker,
#processos details.pas-context-drawer > summary::-webkit-details-marker,
#processos details.process-action-details > summary::-webkit-details-marker,
.occurrence-details-compact > summary::-webkit-details-marker,
.occurrence-secondary-actions > summary::-webkit-details-marker,
.contract-related-processes > summary::-webkit-details-marker {
  display: none;
}

#processos details.process-stage-track > summary::after,
#processos details.pas-context-drawer > summary::after,
#processos details.process-action-details > summary::after,
.occurrence-details-compact > summary::after,
.occurrence-secondary-actions > summary::after,
.contract-related-processes > summary::after {
  content: "Abrir";
  position: absolute;
  right: 10px;
  top: 50%;
  min-width: 54px;
  transform: translateY(-50%);
  border: 1px solid var(--border-dark);
  border-radius: 999px;
  padding: 4px 9px;
  color: var(--text-secondary);
  background: #fff;
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .06em;
  text-align: center;
  text-transform: uppercase;
}

#processos details.process-stage-track[open] > summary::after,
#processos details.pas-context-drawer[open] > summary::after,
#processos details.process-action-details[open] > summary::after,
.occurrence-details-compact[open] > summary::after,
.occurrence-secondary-actions[open] > summary::after,
.contract-related-processes[open] > summary::after {
  content: "Ocultar";
  color: var(--marinho);
  border-color: var(--sel-border);
  background: var(--sel-bg);
}

#processos details.process-stage-track > summary:hover,
#processos details.pas-context-drawer > summary:hover,
#processos details.process-action-details > summary:hover,
.occurrence-details-compact > summary:hover,
.occurrence-secondary-actions > summary:hover,
.contract-related-processes > summary:hover {
  color: var(--marinho);
  background: var(--hover-bg);
}

#processos .process-stage-track .process-stepper {
  padding: 10px;
  border-top: 1px solid var(--border);
}

/* <details> da PRÓXIMA AÇÃO (aberto por default): degrau intermediário da hierarquia */
#processos details.process-action-primary {
  border: 1px solid var(--sel-border);
  border-left: 3px solid var(--bronze-light);
  border-radius: 10px;
  background: var(--sel-bg);
}
#processos details.process-action-primary > summary {
  color: var(--marinho);
  font-weight: 800;
}

#processos .list-card,
#ocorrencias .list-card {
  min-height: 86px;
  align-content: start;
}

.compact-selection-panel {
  display: grid;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  box-shadow: none;
  overflow: hidden;
}

.compact-selection-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  background: #fbfaf7;
}

.compact-selection-head strong {
  color: var(--marinho);
  font-size: 13px;
}

.compact-selection-head small,
.compact-selection-head span {
  color: var(--text-muted);
  font-size: 11px;
}

.compact-selection-body {
  display: grid;
  max-height: 190px;
  overflow: auto;
}

.compact-selection-row {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(150px, .75fr) minmax(170px, .8fr) minmax(140px, .65fr) minmax(190px, 1fr);
  gap: 8px;
  align-items: center;
  border: 0;
  border-top: 1px solid var(--border);
  min-height: 46px;
  padding: 8px 10px;
  background: #fff;
  color: var(--text);
  text-align: left;
}

.compact-selection-row:first-child {
  border-top: 0;
}

.compact-selection-row:hover {
  background: var(--hover-bg);
}

.compact-selection-row.active {
  background: var(--sel-bg);
  box-shadow: inset 3px 0 0 var(--sel-bar);
}

.compact-selection-row span {
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.35;
}

.compact-selection-row .row-title {
  color: var(--marinho);
  font-size: 13px;
  font-weight: 700;
}

.compact-selection-row .process-row-stage {
  display: grid;
  gap: 2px;
  white-space: normal;
}
.compact-selection-row .process-row-stage strong { color: var(--marinho); font-size: 12px; }
.compact-selection-row .process-row-stage small { color: var(--text-muted); font-size: 10px; line-height: 1.35; }

/* células em 1 linha com reticências — evita corte no meio da palavra */
.compact-selection-row > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.intake-choice {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px;
  min-height: 64px;
  padding: 11px 12px;
  text-align: left;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: none;
}

.intake-choice:hover {
  border-color: var(--border-dark);
  background: var(--hover-bg);
}

.intake-choice.active {
  border-color: var(--sel-border);
  background: var(--sel-bg);
  box-shadow: inset 3px 0 0 var(--sel-bar);
}

.intake-choice h2 {
  margin: 1px 0 3px;
  color: var(--marinho);
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 700;
}

.intake-choice p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.intake-choice-action {
  color: var(--marinho);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 700;
  background: #fff;
}

.intake-panel {
  background: #fff;
  box-shadow: none;
  border-radius: 10px;
  border-color: rgba(166, 118, 63, .20);
  border-left: 3px solid rgba(166, 118, 63, .46);
  width: min(720px, 100%);
  padding: 12px;
}

.intake-panel[data-intake-panel="contrato"] {
  justify-self: start;
}

.intake-panel[data-intake-panel="licitacao"] {
  justify-self: end;
}

.intake-panel .intake-option-copy p {
  max-width: 620px;
  font-size: 12px;
}

.intake-panel .artifact-inline-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 138px;
  gap: 8px 10px;
  align-items: end;
  background: transparent;
  border: 0;
  padding: 0;
  box-shadow: none;
}

.intake-panel .artifact-inline-form button {
  grid-column: 2;
  grid-row: 1;
  width: 100%;
  min-width: 0;
  min-height: 38px;
  align-self: end;
  border-color: rgba(21, 38, 61, .22);
  background: #fff;
  color: var(--marinho);
  box-shadow: none;
}

.intake-panel .compact-file {
  grid-column: 1;
  grid-row: 1;
  min-height: 38px;
  padding: 7px 9px;
  border: 1px solid rgba(21, 38, 61, .14);
  border-radius: 10px;
  background: #fff;
}

.intake-panel .compact-file input {
  min-height: 32px;
  border-color: rgba(166,118,63,.22);
  background: #fff;
  color: var(--text);
}

.intake-panel .compact-file span {
  color: var(--text-muted);
  font-size: 11px;
}

.intake-panel .import-options {
  grid-column: 1 / -1;
  padding: 7px 9px;
  border-radius: 10px;
  background: #fbfaf7;
}

.intake-panel .import-options label {
  min-width: min(100%, 260px);
}

.intake-choice.active .intake-choice-action {
  border-color: rgba(166, 118, 63, .30);
  background: #fff;
  color: var(--marinho);
}

#processos .process-shell {
  gap: 12px;
}

#processos .conductor-panel {
  padding: 16px 18px;
  border-color: var(--bronze);
  border-left: 4px solid var(--bronze);
  box-shadow: var(--shadow-card);
}
/* precedência do risco: quando há bloqueio/prescrição, a borda vira carmim (Princípio 3) */
#processos .conductor-panel.has-blocker {
  border-left-color: var(--danger);
}

#processos .conductor-actions {
  align-content: start;
}

#processos .pas-context-drawer {
  box-shadow: none;
}

#processos .pas-context-drawer > *:not(summary) {
  margin: 10px;
}

#processos .process-panels {
  margin-top: 0;
}

#processos .thread-pane.active {
  box-shadow: none;
}

/* Fiscalização: tela de trabalho, não faixa de campanha. */
#fiscal .fiscal-workbench {
  gap: 10px;
}

#fiscal .fiscal-command-panel {
  display: none;
}

#fiscal .fiscal-queue-panel {
  gap: 10px;
  border-radius: 10px;
  padding: 14px;
  background: #fff;
  box-shadow: var(--shadow-soft);
}

#fiscal .fiscal-queue-head {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  align-items: start;
  padding: 0 0 12px;
}

#fiscal .fiscal-queue-head h2 {
  margin: 2px 0 0;
  font-size: 22px;
}

#fiscal .fiscal-queue-tools {
  width: 100%;
  min-width: 0;
  margin-left: 0;
  grid-template-columns: minmax(280px, .9fr) minmax(260px, 1fr) minmax(150px, .35fr) auto;
}

#fiscal .fiscal-filter-bar {
  width: 100%;
  align-items: center;
  background: #f8f5ee;
}

#fiscal .fiscal-filter-bar .filter-reference {
  flex: 1.35 1 320px;
}

#fiscal .fiscal-filter-bar .filter-search {
  flex: 1 1 260px;
}

#fiscal .fiscal-queue-tools select,
#fiscal .fiscal-queue-tools input {
  min-height: 36px;
  font-size: 12px;
  font-weight: 750;
}

#fiscal .fiscal-obligation-list {
  gap: 8px;
}

#fiscal .fiscal-obligation-card {
  grid-template-columns: minmax(0, 1fr) 180px;
  gap: 12px;
  border-left: 2px solid rgba(166, 118, 63, .52);
  border-radius: 10px;
  padding: 12px;
  background: #fff;
  box-shadow: none;
}

#fiscal .fiscal-obligation-main {
  gap: 6px;
}

#fiscal .fiscal-obligation-main strong {
  font-family: var(--sans);
  font-size: 14px;
}

#fiscal .fiscal-obligation-main span {
  font-size: 11px;
}

#fiscal .fiscal-obligation-main p {
  max-width: 780px;
  font-size: 13px;
  line-height: 1.42;
}

#fiscal .fiscal-obligation-card > .row-actions {
  min-width: 0;
  border-left: 1px solid var(--border);
  padding-left: 12px;
}

#fiscal .fiscal-obligation-card > .row-actions button {
  min-height: 34px;
  border-radius: 9px;
  padding: 6px 10px;
}

#fiscal .fiscal-empty-state {
  box-shadow: none;
}

.record-edit-form {
  margin: 10px 0 12px;
  border: 1px solid rgba(166, 118, 63, .24);
  border-left: 3px solid rgba(166, 118, 63, .52);
  border-radius: 10px;
  padding: 12px;
  background: #fffdf8;
  box-shadow: none;
}

.record-edit-form[hidden] {
  display: none !important;
}

.record-edit-form label {
  font-size: 10px;
}

.record-edit-form input,
.record-edit-form select,
.record-edit-form textarea {
  background: #fff;
}

.record-edit-form .row-actions {
  justify-content: flex-start;
}

@media (max-width: 760px) {
  .home-primary-actions.compact-actions,
  .intake-options {
    grid-template-columns: 1fr;
  }

  .intake-choice {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .intake-panel .artifact-inline-form {
    grid-template-columns: 1fr;
  }

  .intake-panel,
  .intake-panel[data-intake-panel="contrato"],
  .intake-panel[data-intake-panel="licitacao"] {
    width: 100%;
    justify-self: stretch;
  }

  .intake-panel .artifact-inline-form button {
    grid-column: 1;
    grid-row: auto;
  }
}

@media (max-width: 980px) {
  #fiscal .fiscal-queue-tools,
  #fiscal .fiscal-obligation-card {
    grid-template-columns: 1fr;
  }

  .compact-selection-row {
    grid-template-columns: 1fr;
  }

  #fiscal .fiscal-obligation-card > .row-actions {
    border-left: 0;
    border-top: 1px solid var(--border);
    padding: 10px 0 0;
  }
}

/* ============================================================
   Polish de UX (revisão fina 2026-06-22) — gravidade, foco de
   teclado, microinterações e estados. Aditivo; dentro da paleta.
   ============================================================ */

/* Gravidade do cockpit do PAS — variante usada por badge(valor, 'danger') */
.status-badge.danger { background: var(--danger-light); color: var(--danger); }

/* Toast: sucesso (neutro + acento verde) por padrão; erro em carmim */
#toast { color: var(--text); border-left: 3px solid var(--success); }
#toast.toast-error { border-left-color: var(--danger); color: var(--danger); }

/* Foco de teclado visível global (WCAG 2.4.7), em bronze */
button:focus-visible, a:focus-visible, summary:focus-visible,
.filter-chip:focus-visible, .consult-row:focus-visible, .compact-selection-row:focus-visible,
.intake-choice:focus-visible, .scope-card:focus-visible, .list-card:focus-visible,
.tab:focus-visible, [tabindex]:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--focus-ring);
}
.sidebar button:focus-visible, nav button:focus-visible, .sidebar-about-button:focus-visible {
  box-shadow: 0 0 0 3px rgba(200, 155, 102, 0.45);
}

/* Botões: lift de hover com easing + feedback tátil de clique */
button { transition: background .15s ease, border-color .15s ease, box-shadow .15s ease, color .15s ease, transform .15s ease; }
button:active:not(:disabled) { transform: translateY(0); box-shadow: var(--shadow-soft); transition-duration: .06s; }

/* Worklists e chips: easing na varredura (não altera seleção nem FILTER_CHIPS) */
.list-card { transition: background .15s ease, border-color .15s ease, box-shadow .15s ease; }
.compact-selection-row { transition: background .14s ease, box-shadow .14s ease; }
button.filter-chip { transition: background .13s ease, color .13s ease, border-color .13s ease; }

/* Estado "carregando" em ações longas (botões de IA) */
@keyframes sancia-spin { to { transform: rotate(360deg); } }
button.is-busy { pointer-events: none; opacity: .85; }
button.is-busy::before {
  content: ""; display: inline-block; width: 14px; height: 14px; margin-right: 6px;
  border-radius: 50%; border: 2px solid currentColor; border-top-color: transparent;
  animation: sancia-spin .7s linear infinite; vertical-align: -2px;
}

/* Opt-out de movimento (WCAG 2.3.3) — cor/sombra/borda permanecem */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important; animation-iteration-count: 1 !important;
    transition-duration: .001ms !important; scroll-behavior: auto !important;
  }
  button:hover, nav button:hover, nav button.active,
  .consult-row:hover, .home-action-card:hover, .sidebar-about-button:hover { transform: none !important; }
}

/* ============ Worklist do Início — "o que precisa de você" ============ */
.home-worklist-panel { order: -1; }
.worklist-groups { display: flex; flex-direction: column; gap: 18px; }
.worklist-group {
  border: 1px solid var(--border);
  border-left: 3px solid var(--marinho-mid);
  border-radius: var(--radius-card);
  background: #fff;
  padding: 12px 14px 8px;
}
.worklist-group.tone-danger { border-left-color: var(--danger); }
.worklist-group.tone-warning { border-left-color: var(--bronze); }
.worklist-group.tone-info { border-left-color: var(--marinho-mid); }
.wl-group-head {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 8px;
}
.wl-group-head strong { font-size: .92rem; color: var(--marinho); letter-spacing: .01em; }
.wl-count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 20px; height: 20px; padding: 0 6px;
  border-radius: var(--radius-pill);
  background: var(--bronze-subtle); color: var(--bronze);
  font-size: .72rem; font-weight: 700;
}
.tone-danger .wl-count { background: var(--danger-light); color: var(--danger); }
.worklist-item {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  width: 100%; text-align: left;
  background: transparent; color: var(--text);
  border: none; border-top: 1px solid var(--border);
  border-radius: 0; box-shadow: none;
  padding: 10px 4px; margin: 0;
}
.worklist-group .worklist-item:first-of-type { border-top: none; }
.worklist-item:hover { background: #faf8f4; box-shadow: none; }
.worklist-item:focus-visible { outline: 2px solid var(--bronze); outline-offset: -2px; }
.worklist-item .wl-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.worklist-item .wl-main strong { font-size: .9rem; color: var(--marinho); }
.worklist-item .wl-meta {
  font-size: .78rem; color: var(--text-muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 46ch;
}
.worklist-item .wl-cta {
  flex-shrink: 0; font-size: .78rem; font-weight: 600; color: var(--bronze);
  white-space: nowrap;
}
.worklist-item.urgente .wl-main strong::before {
  content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 6px;
  border-radius: 50%; background: var(--danger); vertical-align: middle;
}
.wl-more { display: block; padding: 6px 4px 2px; font-size: .74rem; color: var(--text-muted); }
.worklist-empty { align-items: flex-start; gap: 6px; }
.worklist-empty .mini-button { margin-top: 6px; }

/* ============ Bloqueios/alertas acionáveis do PAS (conductor) ============ */
.pas-gate-list { margin: 10px 0 0; border: 1px solid var(--border); border-radius: var(--radius-card); background: #fff; }
.pas-gate-list > summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px;
  padding: 10px 14px; font-size: 12px; color: var(--text-secondary);
}
.pas-gate-list > summary::-webkit-details-marker { display: none; }
.pas-gate-list > summary::after { content: "\25B8"; margin-left: auto; color: var(--text-muted); font-size: 11px; }
.pas-gate-list[open] > summary::after { content: "\25BE"; }
.pas-gate-list > summary:hover { background: var(--surface-soft, #fbfaf7); }
.pas-gate-list .gate-count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: var(--radius-pill);
  font-size: 11px; font-weight: 700;
}
.pas-gate-list.is-blocker .gate-count { background: var(--danger-light); color: var(--danger); }
.pas-gate-list.is-alert .gate-count { background: var(--warning-light); color: var(--warning); }
.pas-gate-list.is-residual .gate-count { background: var(--surface-soft, #f7f6f2); color: var(--text-muted); }

/* Etapa em modo consulta (fase passada/futura ou processo encerrado): sem ações vivas */
.thread-pane.pane-readonly .row-actions,
.thread-pane.pane-readonly button[type="submit"],
.thread-pane.pane-readonly .ia-term,
.thread-pane.pane-readonly .ai-draft-status { display: none; }
.thread-pane.pane-readonly .inline-card-form { opacity: .85; }
.stage-hint { margin: 0 0 8px; font-size: 12px; line-height: 1.4; color: var(--text-muted); }
.thread-pane.pane-readonly input:disabled,
.thread-pane.pane-readonly textarea:disabled,
.thread-pane.pane-readonly select:disabled {
  background: var(--surface-soft, #fbfaf7);
  color: var(--text-secondary);
  cursor: default;
  -webkit-text-fill-color: var(--text-secondary);
  opacity: 1;
}
.pas-gate-list ul { list-style: none; margin: 0; padding: 0 8px 8px; display: flex; flex-direction: column; gap: 2px; }
.pas-gate-link {
  width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 10px;
  background: transparent; color: var(--text); border: 0; box-shadow: none;
  cursor: pointer; text-align: left; padding: 7px 6px; border-radius: var(--radius-btn); font: inherit; margin: 0;
}
.pas-gate-link:hover { background: rgba(255,255,255,.6); box-shadow: none; }
.pas-gate-link:focus-visible { outline: 2px solid var(--bronze); outline-offset: -2px; }
.pas-gate-link > span:last-child { flex-shrink: 0; color: var(--bronze); font-weight: 700; }

/* ============ Modo focado: colapsa a consulta ao abrir um detalhe ============ */
.focus-back-bar {
  display: none;
  align-items: center;
  gap: 8px;
  width: 100%;
  margin-bottom: 14px;
  padding: 9px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: #fff;
  font-size: 13px;
  color: var(--text-muted);
  cursor: pointer;
  text-align: left;
  box-shadow: none;
}
.focus-back-bar:hover { background: #faf8f4; box-shadow: none; }
.focus-back-bar .focus-back-arrow { font-size: 18px; line-height: 1; color: var(--bronze); }
.focus-back-bar .focus-back-sep { opacity: .5; }
.focus-back-bar strong { color: var(--marinho); font-weight: 600; }

.view.detail-focused .focus-back-bar { display: flex; }
/* Grupo A (processos, ocorrencias, encaminhamentos) — id-qualified p/ vencer #processos .worklist-column */
.view.detail-focused .processes-queue-head,
.view.detail-focused .filter-bar { display: none; }
#processos.detail-focused .worklist-column,
#ocorrencias.detail-focused .worklist-column,
#encaminhamentos.detail-focused .worklist-column { display: none; }
/* Grupo B (contratos, licitacoes): esconde a caixa de consulta inteira */
.view.detail-focused .contract-consult { display: none; }

@media (max-width: 920px) {
  .exec-header {
    position: relative;
    top: auto;
    z-index: 1;
  }
}

@media (max-width: 760px) {
  input,
  textarea,
  select {
    font-size: 16px;
  }

  .filter-bar,
  .filter-chip-row,
  .chip-row {
    min-width: 0;
  }

  .filter-chip-row {
    flex-wrap: nowrap;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scrollbar-width: thin;
  }

  .filter-chip {
    min-height: 42px;
    flex: 0 0 auto;
  }

  .compact-selection-body {
    max-height: none;
    overflow: visible;
  }

  .compact-selection-row {
    min-height: 56px;
    padding: 11px 12px;
  }

  .compact-selection-row span {
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .row-actions button,
  .conductor-action-item button,
  .contract-context-actions button,
  .focus-back-bar,
  .document-download-link {
    min-height: 44px;
  }

  #processos .process-stage-track .process-stepper-rail {
    flex-wrap: nowrap;
    overflow-x: auto;
    scroll-snap-type: x proximity;
  }

  #processos .process-stage-track .process-rail-cell {
    flex: 0 0 auto;
    scroll-snap-align: start;
  }

  .pas-gate-overlay {
    padding: 0;
  }

  .pas-gate-dialog {
    width: 100%;
    max-height: 100vh;
    max-height: 100dvh;
    height: 100vh;
    height: 100dvh;
    border: 0;
    border-radius: 0;
  }

  .gate-progress,
  .gate-origin-card,
  .gate-fields-grid,
  .decision-result-block {
    grid-template-columns: 1fr;
  }

  .decision-result-head,
  .decision-result-confirm {
    grid-column: 1;
  }
}

@media (max-width: 520px) {
  .sidebar {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "brand logout"
      "nav nav";
  }

  .brand {
    grid-area: brand;
    min-width: 0;
  }

  .sidebar nav {
    grid-area: nav;
    width: 100%;
  }

  #logoutBtn {
    grid-area: logout;
  }

  .tenant-card {
    display: none;
  }
}
