: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;
  --text:#171b20;
  --text-secondary:#3d444c;
  --text-muted:#79828d;
  --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:12px;
  --radius-card:18px;
  --radius-pill:999px;
  --shadow-card:0 4px 8px rgba(0,0,0,0.04), 0 24px 60px rgba(21,38,61,0.12);
  --shadow-soft:0 2px 10px rgba(21,38,61,0.06);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 13px;
  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; }

button {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 9px 14px;
  color: white;
  background: linear-gradient(135deg, var(--marinho), var(--marinho-mid));
  box-shadow: var(--shadow-soft);
  cursor: pointer;
  font-weight: 700;
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease, background .22s ease;
}

button:hover { transform: translateY(-2px); box-shadow: var(--shadow-card); }
button:disabled { opacity: .58; cursor: not-allowed; transform: none; box-shadow: none; }
button.ghost { background: transparent; color: var(--text); border-color: var(--border-dark); box-shadow: none; }
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: 12px;
  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: 14px;
  padding: 11px 12px;
  background: rgba(255,255,255,.032);
}

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

.tenant-card strong {
  color: #fff;
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 850;
  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: 14px;
  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: 850;
  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: 0 6px 16px rgba(0,0,0,.10);
}

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: 14px;
  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: 900;
  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,
.sidebar-about-button.active {
  color: #fff;
  border-color: rgba(200,155,102,.48);
  background: rgba(200,155,102,.10);
  transform: translateY(-1px);
}

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

.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: 900;
}

.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: 900;
  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: 18px;
  padding: 20px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.98), rgba(250,248,243,.96)),
    #fff;
  box-shadow: 0 24px 80px rgba(9, 30, 54, .26);
  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: 12px;
  padding: 11px;
  background: #fbfaf7;
}

.context-help-block span {
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 900;
  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; }

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

section > header h1 { display: none; }
h1, h2, h3 { color: var(--marinho); }
h2 { font-size: 16px; margin: 0 0 14px; font-weight: 800; }

.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 { transform: translateY(-2px); box-shadow: 0 5px 12px rgba(0,0,0,.05), 0 28px 70px rgba(21,38,61,.14); }
.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: 14px;
  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: 900;
}
.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: 16px;
  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: 12px;
  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: 900;
  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: 16px;
  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: 12px;
  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;
}

.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: 12px;
  padding: 10px;
  background: #fff;
}

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

.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: 12px;
  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: 900;
  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: 12px;
  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: 900;
}

.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: 16px;
  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: 14px;
  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: 16px;
  padding: 18px;
  color: #f8f4ea;
  background:
    linear-gradient(135deg, rgba(166,118,63,.13), transparent 42%),
    linear-gradient(180deg, #142235, #0b1624);
  box-shadow: 0 12px 28px rgba(12,24,40,.15);
}

.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: 12px;
  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: 900;
  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: 16px;
  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: 14px;
  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: 12px;
  padding: 14px;
  background: rgba(255,255,255,.64);
}

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

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

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

.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: 14px;
  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: 0 8px 18px rgba(12,24,40,.12);
}

.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: 0 8px 16px rgba(0,0,0,.16);
  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: 12px;
  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: 900;
  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: 900;
}

.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: 16px;
  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: 850;
  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: 12px;
  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: 12px;
  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: 850;
  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: 900;
  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: 100%;
  min-height: 36px;
  border-radius: 10px;
}
.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: 14px;
  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: 16px;
  padding: 16px;
  background: #fff;
  box-shadow: 0 18px 50px rgba(0,0,0,.18);
}
.ai-upload-form h2 {
  margin-bottom: 0;
  font-size: 18px;
}
.file-drop {
  border: 1.5px dashed var(--border-dark);
  border-radius: 14px;
  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: 12px;
  padding: 10px 12px;
  background: #fbfaf7;
}
.import-options summary {
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 900;
  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: 900;
}
.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: 14px;
  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: 14px;
  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: 16px;
  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: 0 12px 30px rgba(9,30,54,.10);
}

.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: 900;
  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: 12px;
  padding: 9px 11px;
  background: rgba(34,120,91,.06);
}

.document-storage-hint strong {
  color: var(--success);
  font-size: 11px;
  font-weight: 900;
  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: 12px;
  padding: 11px 12px;
  background: #fff;
}

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

.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-version-group {
  display: grid;
  gap: 6px;
}

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

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

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

.current-stage-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  border: 1px solid rgba(34,120,91,.20);
  border-left: 4px solid var(--success);
  border-radius: 16px;
  padding: 14px 15px;
  background: linear-gradient(135deg, rgba(34,120,91,.075), rgba(255,255,255,.94));
}

.current-stage-panel.has-blocker {
  border-color: rgba(161,42,51,.24);
  border-left-color: var(--danger);
  background: linear-gradient(135deg, rgba(161,42,51,.07), rgba(255,255,255,.94));
}

.current-stage-panel strong {
  display: block;
  margin: 3px 0 5px;
  color: var(--marinho);
  font-family: var(--serif);
  font-size: 24px;
  line-height: 1.05;
}

.current-stage-panel p {
  margin: 0;
  color: var(--text-secondary);
  line-height: 1.4;
}

.current-stage-status {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
  min-width: 260px;
}

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

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

.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: 14px;
  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: 12px;
  padding: 10px;
  background: #fff;
}

.saved-docs-grid span {
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 900;
  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: 14px;
  box-shadow: var(--shadow-soft);
  padding: 14px;
}

.list-card.active,
.list-card:hover {
  border-color: rgba(166,118,63,.45);
  background: #fffdf8;
}

.list-card strong { color: var(--marinho); }
.list-card span,
.list-card small { color: var(--text-muted); }

.empty-state {
  display: grid;
  gap: 5px;
  border: 1px dashed var(--border-dark);
  border-radius: 14px;
  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;
}

.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: 18px;
  padding: 18px;
  background:
    linear-gradient(135deg, rgba(255,248,237,.96), rgba(255,255,255,.94)),
    #fffaf1;
  box-shadow: 0 18px 42px rgba(9, 30, 54, .10);
}

.conductor-panel.has-blocker {
  border-color: rgba(161,42,51,.28);
  background:
    linear-gradient(135deg, rgba(255,241,242,.96), rgba(255,255,255,.94)),
    #fff6f6;
}

.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: 12px;
  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: 14px;
  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: 14px;
  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: 14px;
  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: 14px;
}

.process-stepper {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
  gap: 8px;
}

.process-step {
  position: relative;
  min-height: 92px;
  display: grid;
  align-content: start;
  justify-items: start;
  gap: 6px;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px;
  color: var(--text-secondary);
  text-align: left;
  background: #fff;
  box-shadow: var(--shadow-soft);
}

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

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

.process-step small {
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.35;
}

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

.process-step.done span {
  color: #fff;
  background: var(--success);
}

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

.process-step.current strong,
.process-step.current small {
  color: #fff;
}

.process-step.current span {
  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), var(--shadow-soft);
}

.process-step.active:not(.current)::before {
  content: '';
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 8px;
  height: 2px;
  border-radius: 999px;
  background: rgba(166,118,63,.62);
}

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

.process-step.done.active:not(.current) span {
  color: #fff;
  background: var(--success);
}

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

.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: 14px;
  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: 14px;
  padding: 10px 12px;
  color: #684d00;
  background: var(--warning-light);
  font-weight: 700;
}

.stage-note {
  border: 1px solid rgba(37,99,235,.16);
  border-radius: 14px;
  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: 12px;
  padding: 10px 12px;
  background: #fff;
}

.source-strip span,
.origin-strip span {
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 900;
  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;
}

.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: 16px;
  padding: 18px;
  color: #f8f4ea;
  background:
    linear-gradient(135deg, rgba(166,118,63,.13), transparent 42%),
    linear-gradient(180deg, #142235, #0b1624);
  box-shadow: 0 12px 28px rgba(12,24,40,.15);
}

.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: 12px;
  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: 900;
  letter-spacing: .07em;
  text-transform: uppercase;
}

.fiscal-queue-panel {
  display: grid;
  gap: 12px;
  border: 1px solid var(--border);
  border-radius: 16px;
  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: 900;
  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: 12px;
  padding: 14px;
  background:
    linear-gradient(90deg, rgba(166,118,63,.055), transparent 42%),
    #fff;
  box-shadow: var(--shadow-soft);
}

.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: 14px;
  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: 14px;
  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: 12px;
  padding: 10px;
  background: #fbfaf7;
}

.obligation-review-grid span {
  color: var(--text-muted);
  font-size: 9.5px;
  font-weight: 900;
  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: 900;
}

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

.contract-related-processes {
  border: 1px solid var(--border);
  border-radius: 14px;
  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: 900;
  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: 14px;
  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: 14px;
  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: 12px;
  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: 12px;
  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;
}

.check-grid {
  border: 1px solid var(--border);
  border-radius: 12px;
  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: 900;
  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: 900;
}

.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: 14px;
  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: 14px;
  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: 14px;
  padding: 14px;
  background: #fbfaf7;
  color: var(--text-secondary);
  line-height: 1.6;
}

.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-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: 14px;
  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: 900;
  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: 14px; 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; }
.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: 14px;
  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: 14px 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,
.tab.active {
  color: var(--marinho);
  border-bottom-color: var(--bronze);
  background: rgba(166,118,63,.07);
  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: 14px;
  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: 12px;
}

.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: 14px;
  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: rgba(166,118,63,.38);
  box-shadow: 0 16px 38px rgba(13,44,53,.13);
}

.scope-card.platform.active {
  box-shadow: 0 18px 42px rgba(9,23,34,.22);
}

.scope-card .scope-kicker {
  color: var(--bronze);
  font-size: 10px;
  font-weight: 900;
  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: 850;
}

.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: 12px;
  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: 14px;
  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: 850;
}

.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,
.admin-side-tabs .tab.active {
  border-color: rgba(166,118,63,.26);
  background: var(--bronze-subtle);
  color: var(--marinho);
}

.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: 14px;
  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: 14px;
}

.admin-table table {
  margin: 0;
}

.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: 900;
  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: 14px;
  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: 18px;
  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: 16px;
  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: 16px;
  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: 12px;
  color: var(--bronze);
  background: var(--bronze-subtle);
  font-size: 12px;
  font-weight: 900;
}

.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: 14px;
  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: 900;
}

.about-stages strong {
  color: var(--marinho);
  font-weight: 900;
  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: 16px;
  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(4, minmax(0, 1fr));
  gap: 10px;
}

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

.about-doc-grid article > strong {
  color: var(--marinho);
  font-weight: 900;
  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: 900;
  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(3, minmax(0, 1fr));
  gap: 10px;
}

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

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

.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: 14px;
  padding: 14px;
  background: #fbfaf7;
}

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

.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: 14px;
  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: 0 12px 30px rgba(12,24,40,.18);
  }
  .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: 18px 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;
  }
  .current-stage-panel {
    grid-template-columns: 1fr;
  }
  .current-stage-status {
    min-width: 0;
    justify-content: flex-start;
  }
  .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,
  #pasGateForm,
  .compact-deadline-form { grid-template-columns: 1fr; }
  .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; }
}
