:root {
  --navy: #12233d;
  --navy-2: #193152;
  --primary: #2864dc;
  --primary-soft: #eaf1ff;
  --surface: #ffffff;
  --canvas: #f3f6fa;
  --border: #dce3ed;
  --text: #17253b;
  --muted: #60708a;
  --radius: .75rem;
  --shadow: 0 10px 30px rgba(25, 45, 78, .07);
}

html, body { min-height: 100%; }

body {
  background: var(--canvas);
  color: var(--text);
  font-family: "Public Sans", "Segoe UI", sans-serif;
  font-size: .9rem;
}

.app-navbar {
  min-height: 58px;
  background: linear-gradient(105deg, #162b49, #0e1b30);
  box-shadow: 0 3px 14px rgba(5, 15, 30, .22);
}

.navbar-brand { font-size: .98rem; letter-spacing: -.01em; }
.navbar-brand small { color: #98acd0; font-weight: 600; margin-left: .25rem; }

.brand-mark {
  align-items: center;
  background: rgba(104, 150, 238, .18);
  border: 1px solid rgba(170, 198, 249, .2);
  border-radius: .55rem;
  display: inline-flex;
  height: 34px;
  justify-content: center;
  width: 34px;
}

.btn-import-nav {
  background: #fff;
  border-color: #fff;
  color: #183258;
  font-weight: 700;
}
.btn-import-nav:hover { background: #eaf1ff; border-color: #eaf1ff; color: #112848; }
.nav-workflow-link { align-items: center; color: #c9d6eb; font-weight: 600; text-decoration: none; }
.nav-workflow-link:hover { color: #fff; }
.notification-button {
  align-items: center;
  border-radius: 50%;
  color: #c9d6eb;
  display: inline-flex;
  height: 34px;
  justify-content: center;
  position: relative;
  text-decoration: none;
  width: 34px;
}
.notification-button:hover { background: rgba(255,255,255,.1); color: #fff; }
.notification-button span {
  align-items: center;
  background: #e64b5d;
  border: 2px solid #12233d;
  border-radius: 1rem;
  color: #fff;
  display: flex;
  font-size: .56rem;
  font-weight: 800;
  height: 17px;
  justify-content: center;
  min-width: 17px;
  padding: 0 3px;
  position: absolute;
  right: -2px;
  top: -2px;
}

.btn { border-radius: .5rem; font-weight: 600; }
.btn-primary { background: var(--primary); border-color: var(--primary); }
.form-control, .form-select { border-color: #cdd7e5; border-radius: .5rem; }
.form-control:focus, .form-select:focus {
  border-color: #6995ea;
  box-shadow: 0 0 0 .2rem rgba(40, 100, 220, .13);
}

.messages-wrap { position: relative; z-index: 10; }

.page-hero {
  background: linear-gradient(120deg, #fff 0%, #f0f5ff 100%);
  border: 1px solid #dbe6f8;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1rem 1.2rem;
}

.hero-kicker, .panel-eyebrow {
  color: #58719a;
  display: block;
  font-size: .69rem;
  font-weight: 800;
  letter-spacing: .09em;
  margin-bottom: .2rem;
  text-transform: uppercase;
}

.import-status {
  align-items: center;
  background: rgba(255,255,255,.8);
  border: 1px solid #d8e2f0;
  border-radius: .65rem;
  display: flex;
  gap: .65rem;
  max-width: 440px;
  padding: .6rem .8rem;
}
.import-status > i { font-size: 1.2rem; }
.import-status > div { min-width: 0; }
.import-status strong, .import-status small { display: block; }
.import-status small { color: var(--muted); font-size: .7rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.kpi-card {
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: .7rem;
  box-shadow: 0 5px 18px rgba(25, 45, 78, .04);
  display: flex;
  gap: .8rem;
  min-height: 78px;
  padding: .8rem 1rem;
}
.kpi-card strong { display: block; font-size: 1.35rem; line-height: 1.15; }
.kpi-card small { color: var(--muted); font-weight: 600; }
.kpi-icon {
  align-items: center;
  border-radius: .65rem;
  display: inline-flex;
  flex: 0 0 42px;
  font-size: 1.1rem;
  height: 42px;
  justify-content: center;
}
.kpi-blue { background: #e7efff; color: #2c63ce; }
.kpi-teal { background: #e2f6f1; color: #14816c; }
.kpi-purple { background: #f0e9ff; color: #7046bd; }
.kpi-orange { background: #fff0df; color: #b86b16; }

.explorer-grid {
  display: grid;
  gap: .9rem;
  grid-template-columns: minmax(290px, 31%) minmax(0, 1fr);
  min-height: calc(100vh - 310px);
}

.tree-panel, .content-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  min-width: 0;
}

.tree-panel {
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 205px);
  min-height: 540px;
  position: sticky;
  top: .75rem;
}

.panel-heading {
  align-items: center;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  padding: .85rem 1rem;
}
.btn-ghost { border: 0; color: var(--muted); }
.btn-ghost:hover { background: var(--primary-soft); color: var(--primary); }

.tree-search { padding: .7rem .8rem .45rem; position: relative; }
.tree-search i {
  color: #8390a4;
  left: 1.5rem;
  position: absolute;
  top: 1.15rem;
}
.tree-search input { background: #f8fafc; padding-left: 2rem; }
.tree-search-loading {
  color: var(--primary);
  position: absolute;
  right: 1.35rem;
  top: 1.13rem;
}
.tree-legend {
  align-items: center;
  color: #75839a;
  display: flex;
  font-size: .62rem;
  gap: .25rem;
  overflow: hidden;
  padding: .25rem .85rem .55rem;
  white-space: nowrap;
}
.tree-legend b {
  background: #edf2fa;
  border-radius: 50%;
  display: inline-block;
  line-height: 18px;
  text-align: center;
  width: 18px;
}
.tree-legend i { font-size: .55rem; }
.tree-panel > :not(.tree-scroll) { flex-shrink: 0; }
.tree-scroll { border-top: 1px solid #edf0f5; flex: 1; min-height: 0; overflow: auto; padding: .35rem 0 .7rem; }
.tree-list { list-style: none; margin: 0; padding: 0; }
.tree-no-results {
  align-items: center;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  gap: .25rem;
  padding: 2.5rem 1rem;
  text-align: center;
}
.tree-no-results i { color: #8596b0; font-size: 1.25rem; }
.tree-no-results strong { font-size: .75rem; }
.tree-no-results small { font-size: .65rem; }
.tree-list-nested { border-left: 1px dashed #cdd7e5; margin-left: 1.25rem; }
.tree-item {
  align-items: center;
  background: transparent;
  border: 0;
  color: var(--text);
  display: flex;
  gap: .42rem;
  min-height: 42px;
  padding: .35rem .65rem;
  text-align: left;
  transition: background .15s ease;
  width: 100%;
}
.tree-item:hover, .tree-leaf:focus { background: #eef4ff; color: #174fae; }
.tree-parent[aria-expanded="true"] { background: #f5f8fd; }
.tree-chevron { color: #8592a4; font-size: .68rem; transition: transform .18s ease; }
.tree-parent[aria-expanded="true"] > .tree-chevron { transform: rotate(90deg); }
.tree-level-icon {
  align-items: center;
  border-radius: .35rem;
  display: inline-flex;
  flex: 0 0 25px;
  height: 25px;
  justify-content: center;
}
.level-uo { background: #e7efff; color: #2d62c5; }
.level-programa { background: #eee9fb; color: #6c49ac; }
.level-acao { background: #e5f5f2; color: #16806d; }
.level-subacao { background: #fff0df; color: #ae681c; margin-left: 1.12rem; }
.tree-copy { flex: 1; min-width: 0; }
.tree-copy > span, .tree-copy small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tree-copy > span { font-size: .77rem; }
.tree-copy small { color: #7b889b; font-size: .65rem; margin-top: .08rem; }
.tree-copy small.tree-match {
  color: #9b641e;
  font-weight: 700;
}
.tree-match i { color: #c58025; }
.tree-meta {
  align-items: flex-end;
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  gap: .16rem;
}
.tree-level-label {
  font-size: .56rem;
  font-weight: 800;
  letter-spacing: .035em;
  line-height: 1;
  text-transform: uppercase;
}
.level-label-uo { color: #2d62c5; }
.level-label-programa { color: #6c49ac; }
.level-label-acao { color: #16806d; }
.level-label-subacao { color: #9a5a16; }
.tree-count {
  background: #edf1f6;
  border-radius: 2rem;
  color: #68778d;
  flex: 0 0 auto;
  font-size: .62rem;
  font-weight: 700;
  line-height: 1.25;
  padding: .12rem .4rem;
  white-space: nowrap;
}
.tree-new-button { font-size: .67rem; padding: .25rem .45rem; }
.tree-new-button span { margin-left: .18rem; }

.content-panel { overflow: hidden; }
.search-toolbar { background: #f9fbfd; border-bottom: 1px solid var(--border); padding: .7rem .8rem; }
.search-input { position: relative; }
.search-input i {
  color: #7c899d;
  left: .85rem;
  position: absolute;
  top: .72rem;
}
.search-input input { padding-left: 2.25rem; }
.workspace { min-height: 480px; }
.workspace-empty, .empty-database {
  align-items: center;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 450px;
  padding: 2rem;
  text-align: center;
}
.workspace-empty p { max-width: 460px; }
.tree-search-summary { min-height: 410px; }
.empty-illustration {
  align-items: center;
  background: linear-gradient(135deg, #edf3ff, #e5ecf7);
  border-radius: 1.2rem;
  color: #5373a8;
  display: inline-flex;
  font-size: 2rem;
  height: 72px;
  justify-content: center;
  margin-bottom: 1rem;
  transform: rotate(-3deg);
  width: 72px;
}
.empty-tip {
  background: #fff8e7;
  border: 1px solid #f5e2ac;
  border-radius: .5rem;
  color: #7b6229;
  font-size: .72rem;
  padding: .45rem .7rem;
}
.empty-tip i { color: #d99b16; }
.empty-database {
  background: #fff;
  border: 1px dashed #bfcadd;
  border-radius: var(--radius);
  min-height: 320px;
}
.empty-database > i { color: #6c88b5; font-size: 2.3rem; margin-bottom: .7rem; }

.workspace-heading {
  align-items: flex-start;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  padding: 1rem 1.15rem;
}
.results-table-wrap { max-height: calc(100vh - 345px); min-height: 380px; }
.results-table-wrap thead th {
  background: #f0f4fa;
  border-bottom: 1px solid #d9e0eb;
  color: #51617a;
  font-size: .68rem;
  letter-spacing: .04em;
  padding: .65rem .75rem;
  position: sticky;
  text-transform: uppercase;
  top: 0;
  white-space: nowrap;
  z-index: 2;
}
.results-table-wrap tbody td { font-size: .75rem; padding: .55rem .75rem; }
.results-table-wrap td small { color: var(--muted); display: block; font-size: .64rem; }
.result-product { font-weight: 600; max-width: 250px; }
.code-path { color: #315d9d; display: block; font-family: Consolas, monospace; font-size: .68rem; font-weight: 700; }
.unit-badge { background: #eef2f7; color: #52627b; font-weight: 600; }
.status-dot { background: #9aa4b2; border-radius: 50%; display: inline-block; height: 7px; margin-right: .25rem; width: 7px; }
.status-dot.active { background: #27a27b; box-shadow: 0 0 0 3px #e0f5ee; }
.no-results { align-items: center; color: var(--muted); display: flex; flex-direction: column; gap: .35rem; padding: 3.5rem; }
.no-results i { font-size: 1.7rem; }
.results-pagination { border-top: 1px solid var(--border); display: flex; justify-content: flex-end; padding: .7rem 1rem; }

.detail-breadcrumb {
  align-items: center;
  background: #f7f9fc;
  border-bottom: 1px solid var(--border);
  color: #748198;
  display: flex;
  font-size: .68rem;
  gap: .35rem;
  overflow: hidden;
  padding: .5rem 1.15rem;
  white-space: nowrap;
}
.detail-search-match {
  align-items: center;
  background: #fff7e4;
  border-bottom: 1px solid #efdba7;
  color: #73591f;
  display: flex;
  gap: .65rem;
  padding: .65rem 1.15rem;
}
.detail-search-match > i { font-size: 1rem; }
.detail-search-match strong, .detail-search-match span { display: block; }
.detail-search-match strong { font-size: .72rem; }
.detail-search-match span { font-size: .66rem; margin-top: .1rem; }
.detail-breadcrumb .current { color: var(--primary); font-weight: 700; }
.detail-heading { background: #fff; }
.record-count { background: #eaf1ff; border-radius: 1rem; color: #285fbf; font-size: .7rem; font-weight: 700; padding: .3rem .65rem; }
.product-card {
  border: 1px solid var(--border);
  border-radius: .7rem;
  margin: 1rem;
  overflow: hidden;
}
.product-card-main { align-items: flex-start; display: flex; gap: .85rem; padding: 1rem; }
.product-symbol {
  align-items: center;
  background: #eaf1ff;
  border-radius: .65rem;
  color: #376bc8;
  display: inline-flex;
  flex: 0 0 42px;
  font-size: 1.1rem;
  height: 42px;
  justify-content: center;
}
.product-meta { color: var(--muted); display: flex; flex-wrap: wrap; font-size: .73rem; gap: .5rem 1.2rem; }
.product-meta i { color: #7291c5; margin-right: .25rem; }
.meta-grid {
  background: #f7f9fc;
  border-bottom: 1px solid var(--border);
  border-top: 1px solid var(--border);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}
.meta-grid > div { border-right: 1px solid var(--border); padding: .65rem 1rem; }
.meta-grid > div:last-child { border-right: 0; }
.meta-grid small, .meta-grid strong { display: block; }
.meta-grid small { color: var(--muted); font-size: .65rem; text-transform: uppercase; }
.meta-grid strong { font-size: 1rem; }
.detail-accordion .accordion-button { font-size: .76rem; font-weight: 700; padding: .7rem 1rem; }
.detail-accordion .accordion-button:not(.collapsed) { background: #edf3ff; color: #275aaf; box-shadow: none; }
.detail-accordion .accordion-body { color: #3e4d64; font-size: .75rem; }
.detail-accordion h5 { color: #586b87; font-size: .68rem; font-weight: 800; text-transform: uppercase; }
.detail-list { display: grid; gap: .4rem 1rem; grid-template-columns: 110px 1fr; margin: 0; }
.detail-list dt { color: #60708a; }
.detail-list dd { margin: 0; overflow-wrap: anywhere; }

.import-page { margin: 0 auto; max-width: 1080px; }
.import-card, .info-card { border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.import-icon {
  align-items: center;
  background: #e7f4ee;
  border-radius: .7rem;
  color: #258260;
  display: inline-flex;
  flex: 0 0 48px;
  font-size: 1.35rem;
  height: 48px;
  justify-content: center;
}
.upload-zone { background: #f8fafc; border: 1px dashed #aebdd2; border-radius: .7rem; padding: 1.2rem; }
.selected-file { background: #e8f5ef; border-radius: .45rem; color: #247052; font-size: .78rem; margin-top: .75rem; padding: .55rem .7rem; }
.global-loading {
  background: var(--navy);
  border-radius: 50%;
  bottom: 1rem;
  box-shadow: 0 5px 16px rgba(0,0,0,.25);
  color: #fff;
  height: 38px;
  padding: .6rem;
  position: fixed;
  right: 1rem;
  width: 38px;
  z-index: 1080;
}

/* Fluxo de propostas */
.proposal-page, .workflow-page, .request-detail-page, .notifications-page {
  margin: 0 auto;
  max-width: 1440px;
}
.proposal-topbar, .request-detail-top {
  align-items: flex-end;
  display: flex;
  justify-content: space-between;
  margin-bottom: 1rem;
}
.back-link { color: #5d6e88; font-size: .75rem; font-weight: 700; text-decoration: none; }
.back-link:hover { color: var(--primary); }
.draft-progress { min-width: 220px; text-align: right; }
.draft-progress > span { color: var(--muted); display: block; font-size: .68rem; margin-bottom: .35rem; }
.draft-progress .progress { height: 6px; }
.proposal-editor-meta { align-items: flex-end; display: flex; flex-direction: column; gap: .55rem; }
.proposal-editor { align-items: center; color: #52657f; display: flex; gap: .5rem; text-align: right; }
.proposal-editor > i { color: #315fae; font-size: 1.35rem; }
.proposal-editor small, .proposal-editor strong { display: block; line-height: 1.2; }
.proposal-editor small { font-size: .62rem; }
.proposal-editor strong { color: #243c5c; font-size: .78rem; }
.proposal-shell {
  align-items: start;
  display: grid;
  gap: 1rem;
  grid-template-columns: 235px minmax(0, 1fr);
}
.proposal-steps {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  position: sticky;
  top: 1rem;
}
.proposal-step-link {
  align-items: center;
  background: #fff;
  border: 0;
  border-bottom: 1px solid #edf0f5;
  color: #64748b;
  display: flex;
  gap: .65rem;
  padding: .8rem;
  text-align: left;
  width: 100%;
}
.proposal-step-link:last-child { border-bottom: 0; }
.proposal-step-link > span {
  align-items: center;
  background: #edf1f6;
  border-radius: 50%;
  display: inline-flex;
  flex: 0 0 29px;
  font-size: .72rem;
  font-weight: 800;
  height: 29px;
  justify-content: center;
}
.proposal-step-link b, .proposal-step-link small { display: block; }
.proposal-step-link b { color: #33445e; font-size: .75rem; }
.proposal-step-link small { font-size: .62rem; margin-top: .1rem; }
.proposal-step-link.active { background: #edf3ff; }
.proposal-step-link.active > span { background: var(--primary); color: #fff; }
.proposal-step-link.active b { color: #2356b2; }
.proposal-step-link.has-error > span { background: #dc3545; color: #fff; }
.proposal-form {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  min-width: 0;
  overflow: hidden;
}
.proposal-step { display: none; }
.proposal-step.active { display: block; }
.step-heading {
  align-items: center;
  background: linear-gradient(110deg, #f9fbff, #eef4ff);
  border-bottom: 1px solid var(--border);
  display: flex;
  gap: .8rem;
  padding: 1rem 1.25rem;
}
.step-heading > div > span { color: #6d7f9a; font-size: .65rem; font-weight: 700; text-transform: uppercase; }
.step-heading h2 { font-size: 1.05rem; margin: .1rem 0 0; }
.step-icon {
  align-items: center;
  background: #dfeaff;
  border-radius: .6rem;
  color: #3264c0;
  display: inline-flex;
  flex: 0 0 40px;
  font-size: 1.05rem;
  height: 40px;
  justify-content: center;
}
.step-body { min-height: 510px; padding: 1.25rem; }
.field-block { margin-bottom: 1.25rem; }
.section-label {
  border-bottom: 1px solid #e4e9f1;
  color: #3b5275;
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: .05em;
  margin-bottom: .8rem;
  padding-bottom: .4rem;
  text-transform: uppercase;
}
.required-label::after { color: #dc3545; content: " *"; }
.form-label { color: #3d4e68; font-size: .76rem; font-weight: 700; }
.form-text { color: #74839a; font-size: .67rem; }
.field-help {
  align-items: center;
  background: #e8eef8;
  border: 0;
  border-radius: 50%;
  color: #365b91;
  display: inline-flex;
  font-size: .62rem;
  font-weight: 800;
  height: 1.1rem;
  justify-content: center;
  line-height: 1;
  margin-left: .35rem;
  padding: 0;
  vertical-align: .05rem;
  width: 1.1rem;
}
.field-help:hover { background: #d8e4f5; color: #224b84; }
.field-help:focus-visible { outline: 2px solid #315fae; outline-offset: 2px; }
.search-label { align-items: center; display: flex; margin-bottom: .4rem; position: relative; }
.search-label > i { color: #697b94; left: .65rem; pointer-events: none; position: absolute; z-index: 1; }
.search-label .form-control { padding-left: 2rem; }
.proposal-type-options > div {
  display: grid;
  gap: .6rem;
  grid-template-columns: repeat(3, 1fr);
}
.proposal-type-options label {
  align-items: center;
  border: 1px solid #ced8e7;
  border-radius: .6rem;
  cursor: pointer;
  display: flex;
  font-size: .76rem;
  font-weight: 700;
  gap: .5rem;
  min-height: 48px;
  padding: .65rem .8rem;
}
.proposal-type-options label:has(input:checked) { background: #edf3ff; border-color: #6090e5; color: #2458b3; }
.choice-grid > div, .choice-grid > ul {
  display: grid;
  gap: .5rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  list-style: none;
  margin: 0;
  padding: 0;
}
.choice-grid.compact > div, .choice-grid.compact > ul { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.choice-grid label {
  align-items: flex-start;
  background: #f8fafc;
  border: 1px solid #e0e6ef;
  border-radius: .45rem;
  cursor: pointer;
  display: flex;
  font-size: .7rem;
  gap: .4rem;
  height: 100%;
  padding: .48rem .55rem;
}
.choice-grid label:has(input:checked) { background: #edf4ff; border-color: #8caee8; }
.choice-grid input { margin-top: .15rem; }
.public-target-summary {
  align-items: center;
  color: #61718a;
  display: flex;
  font-size: .68rem;
  justify-content: space-between;
  margin: -.2rem 0 .65rem;
}
.public-target-summary span:first-child {
  background: #edf3ff;
  border-radius: 2rem;
  color: #315fae;
  font-weight: 800;
  padding: .28rem .55rem;
}
.public-target-summary span:first-child.limit-reached { background: #fff1dc; color: #8a5014; }
.public-target-list { display: grid; gap: .6rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.public-target-option {
  background: #f8fafc;
  border: 1px solid #dfe6ef;
  border-radius: .55rem;
  min-width: 0;
  padding: .65rem;
}
.public-target-option.selected { background: #f0f5ff; border-color: #8caee8; }
.public-target-check { align-items: flex-start; cursor: pointer; display: flex; font-size: .72rem; font-weight: 700; gap: .5rem; }
.public-target-check span { overflow-wrap: anywhere; }
.public-target-check input:disabled + span { color: #8b96a7; }
.public-target-quantity { margin: .65rem 0 0 1.5rem; }
.public-target-quantity label { color: #56677f; display: block; font-size: .65rem; font-weight: 700; margin-bottom: .25rem; }
.priority-classification {
  background: #f7f9fc;
  border: 1px solid #dfe6ef;
  border-radius: .55rem;
  padding: .65rem .75rem;
}
.priority-classification .form-check { align-items: flex-start; display: flex; gap: .55rem; margin: 0; padding-left: 0; }
.priority-classification .form-check-input { flex: 0 0 auto; margin: .15rem 0 0; }
.priority-classification b, .priority-classification small { display: block; }
.priority-classification b { color: #344a69; font-size: .72rem; }
.priority-classification small { color: #697991; font-size: .65rem; margin-top: .1rem; }
.annual-grid {
  background: #f7f9fc;
  border: 1px solid #dce3ed;
  border-radius: .6rem;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  overflow: hidden;
}
.annual-grid > div { border-right: 1px solid #dce3ed; padding: .7rem; }
.annual-grid > div:last-child { border-right: 0; }
.annual-grid label { color: #67768c; display: block; font-size: .65rem; font-weight: 800; margin-bottom: .3rem; text-transform: uppercase; }
.alignment-grid { display: grid; gap: .8rem; grid-template-columns: repeat(2, 1fr); }
.alignment-grid > div { border: 1px solid #e0e6ef; border-radius: .55rem; padding: .7rem; }
.alignment-grid > div > label { color: #435775; display: block; font-size: .7rem; font-weight: 800; margin-bottom: .5rem; }
.alignment-grid .form-select { min-height: 8.5rem; width: 100%; }
.territory-scope-options > div {
  display: grid;
  gap: .6rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: .8rem;
}
.territory-scope-options label {
  align-items: center;
  background: #fff;
  border: 1px solid #d8e1ed;
  border-radius: .55rem;
  color: #435775;
  cursor: pointer;
  display: flex;
  font-size: .72rem;
  font-weight: 700;
  gap: .5rem;
  min-height: 44px;
  padding: .55rem .7rem;
}
.territory-scope-options label:has(input:checked) { background: #edf4ff; border-color: #78a0df; color: #2859a8; }
.territory-scope-options input { margin: 0; }
.territory-scope-message {
  background: #f1f6fd;
  border: 1px solid #d5e2f3;
  border-radius: .55rem;
  color: #3f5f89;
  font-size: .7rem;
  font-weight: 700;
  margin-bottom: .8rem;
  padding: .65rem .75rem;
}
.territory-scope-message[hidden], .territory-selector[hidden] { display: none; }
.territory-selector {
  align-items: start;
  display: grid;
  gap: 1rem;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, .85fr);
}
.territory-municipalities, .territory-regions {
  background: #f8fafc;
  border: 1px solid #dfe6ef;
  border-radius: .6rem;
  min-width: 0;
  padding: .8rem;
}
.territory-municipalities, .territory-regions { margin: 0; }
.territory-municipalities legend, .territory-regions legend {
  float: none;
  margin-bottom: .45rem;
  width: auto;
}
.territory-select-all {
  align-items: center;
  background: #eaf1ff;
  border: 1px solid #cbdcf5;
  border-radius: .45rem;
  color: #2e5d9f;
  cursor: pointer;
  display: flex;
  font-size: .68rem;
  font-weight: 800;
  gap: .45rem;
  margin-bottom: .45rem;
  padding: .45rem .55rem;
}
.territory-select-all input { margin: 0; }
#id_municipios {
  background: #fff;
  border: 1px solid #cdd7e5;
  border-radius: .5rem;
  height: 17rem;
  overflow-y: auto;
  padding: .32rem;
}
#id_municipios > div { min-width: 0; }
#id_municipios label {
  align-items: center;
  border-radius: .32rem;
  cursor: pointer;
  display: flex;
  font-size: .72rem;
  gap: .48rem;
  min-height: 30px;
  overflow-wrap: anywhere;
  padding: .3rem .42rem;
}
#id_municipios label:hover { background: #f1f5fa; }
#id_municipios label:has(input:checked) {
  background: #e5efff;
  color: #2459ad;
  font-weight: 700;
}
#id_municipios label:has(input:focus-visible) {
  outline: 2px solid #315fae;
  outline-offset: -2px;
}
.territory-municipality-input { flex: 0 0 auto; margin: 0; }
#id_regioes_desenvolvimento {
  display: grid;
  gap: .38rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
#id_regioes_desenvolvimento > div { min-width: 0; }
#id_regioes_desenvolvimento label {
  align-items: center;
  background: #fff;
  border: 1px solid #dce4ef;
  border-radius: .45rem;
  cursor: pointer;
  display: flex;
  font-size: .67rem;
  gap: .4rem;
  min-height: 38px;
  overflow-wrap: anywhere;
  padding: .42rem .48rem;
}
#id_regioes_desenvolvimento label:hover { border-color: #aebed3; }
#id_regioes_desenvolvimento label:has(input:focus-visible) {
  box-shadow: 0 0 0 .2rem rgba(49, 95, 174, .18);
  outline: 2px solid #315fae;
  outline-offset: 1px;
}
#id_regioes_desenvolvimento label.is-linked {
  background: #edf4ff;
  border-color: #8caee8;
  color: #2859a8;
}
#id_regioes_desenvolvimento label.is-filtered {
  background: #e8f6f1;
  border-color: #72b9a6;
  color: #176d5b;
}
#id_regioes_desenvolvimento label.is-linked.is-filtered {
  background: linear-gradient(135deg, #edf4ff 0 50%, #e8f6f1 50% 100%);
  border-color: #649f9a;
  color: #245c68;
}
.territory-region-input { flex: 0 0 auto; margin: 0; }
.territory-region-status {
  flex: 0 0 auto;
  font-size: .56rem;
  font-weight: 800;
  margin-inline-start: auto;
  overflow-wrap: normal;
  text-align: end;
  text-transform: uppercase;
  word-break: keep-all;
}
.territory-filter-status {
  color: #405b82;
  font-size: .65rem;
  font-weight: 800;
  margin-top: .45rem;
}
.risk-heading, .risk-catalog-row {
  align-items: center;
  display: grid;
  gap: .65rem;
  grid-template-columns: minmax(0, 1fr) minmax(125px, .25fr) minmax(125px, .25fr) 32px;
}
.risk-heading { color: #526781; font-size: .64rem; font-weight: 800; padding: 0 .5rem .35rem; text-transform: uppercase; }
.risk-catalog { border: 1px solid #dce4ef; border-radius: .6rem; max-height: 23rem; overflow: auto; padding: .35rem; }
.risk-catalog-row { border-radius: .45rem; padding: .45rem; }
.risk-catalog-row + .risk-catalog-row { border-top: 1px solid #e8edf4; }
.risk-catalog-row.selected { background: #edf4ff; }
.risk-name { align-items: flex-start; cursor: pointer; display: flex; font-size: .72rem; font-weight: 700; gap: .5rem; }
.risk-name .form-check-input { flex: 0 0 auto; margin-top: .1rem; }
.risk-assessment { font-size: .72rem; min-width: 0; }
.custom-risk-row { display: grid; grid-template-columns: 30px minmax(0, 1fr) minmax(125px, .25fr) minmax(125px, .25fr) 32px; }
.risk-summary-table { border: 1px solid #dfe6ef; border-radius: .6rem; overflow: hidden; }
.risk-summary-table > div { display: grid; gap: .8rem; grid-template-columns: minmax(0, 1fr) 130px 130px; padding: .65rem .75rem; }
.risk-summary-table > div + div { border-top: 1px solid #e7ecf3; }
.risk-summary-table .risk-summary-head { background: #f3f6fa; color: #526781; font-size: .65rem; font-weight: 800; text-transform: uppercase; }
.risk-summary-table strong, .risk-summary-table span { font-size: .73rem; }
.risk-summary-table > p { color: #728198; font-size: .72rem; margin: 0; padding: .75rem; }
.territory-legend {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem .7rem;
  margin-top: .6rem;
}
.territory-legend span {
  align-items: center;
  color: #5f7088;
  display: inline-flex;
  font-size: .61rem;
  gap: .3rem;
}
.territory-key { border-radius: 50%; display: inline-block; height: 8px; width: 8px; }
.territory-key.linked { background: #5e8edb; }
.territory-key.filtered { background: #3a9b81; }
.repeater-list { display: flex; flex-direction: column; gap: .45rem; }
.repeater-row { align-items: center; display: flex; gap: .5rem; }
.repeater-row.custom-risk-row { display: grid; }
.repeater-number {
  align-items: center;
  background: #eaf1ff;
  border-radius: 50%;
  color: #315fb1;
  display: inline-flex;
  flex: 0 0 26px;
  font-size: .68rem;
  font-weight: 800;
  height: 26px;
  justify-content: center;
}
.macro-stage-row { align-items: flex-end; background: #f8fafc; border: 1px solid #dfe6ef; border-radius: .6rem; padding: .65rem; }
.macro-stage-fields { display: grid; flex: 1; gap: .6rem; grid-template-columns: minmax(0, 2fr) repeat(2, minmax(135px, .75fr)); min-width: 0; }
.macro-stage-fields label { margin: 0; min-width: 0; }
.macro-stage-fields label > span { color: #60718a; display: block; font-size: .62rem; font-weight: 800; margin-bottom: .25rem; text-transform: uppercase; }
.macro-stage-fields label > span .field-help { margin-left: .3rem; text-transform: none; vertical-align: middle; }
.macro-stage-row .repeater-number { margin-bottom: .35rem; }
.macro-stage-row .remove-repeater { margin-bottom: .05rem; }
.proposal-footer {
  align-items: center;
  background: #f8fafc;
  border-top: 1px solid var(--border);
  display: flex;
  min-height: 67px;
  padding: .75rem 1.25rem;
}
.review-alert, .submission-note {
  align-items: center;
  background: #edf4ff;
  border: 1px solid #cdddf8;
  border-radius: .6rem;
  color: #385b94;
  display: flex;
  gap: .7rem;
  padding: .8rem;
}
.review-alert i { font-size: 1.1rem; }
.review-alert b, .review-alert span { display: block; }
.review-alert span { font-size: .7rem; margin-top: .1rem; }
.review-grid {
  display: grid;
  gap: .7rem;
  grid-template-columns: repeat(2, 1fr);
  margin: 1rem 0;
}
.review-grid > div { background: #f8fafc; border: 1px solid #e1e7ef; border-radius: .55rem; padding: .7rem; }
.review-grid .wide { grid-column: 1 / -1; }
.review-grid small, .review-grid strong { display: block; }
.review-grid small { color: #75839a; font-size: .64rem; margin-bottom: .2rem; text-transform: uppercase; }
.submission-note { background: #fff8e7; border-color: #f1dfa7; color: #735c25; font-size: .72rem; }

.workflow-kpis { display: grid; gap: .75rem; grid-template-columns: repeat(3, 1fr); margin-bottom: .8rem; }
.workflow-kpis > a {
  align-items: center;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: .65rem;
  color: inherit;
  display: flex;
  gap: .65rem;
  padding: .75rem;
  text-decoration: none;
}
.workflow-kpis strong, .workflow-kpis small { display: block; }
.workflow-kpis strong { font-size: 1.2rem; }
.workflow-kpis small { color: var(--muted); font-size: .68rem; }
.workflow-kpi-detail { color: #5a6980; display: flex; font-size: .61rem; font-weight: 700; gap: .45rem; margin-top: .1rem; }
.workflow-kpi-icon { align-items: center; border-radius: .5rem; display: flex; height: 36px; justify-content: center; width: 36px; }
.workflow-kpi-icon.blue { background: #e7efff; color: #2c63ce; }
.workflow-kpi-icon.purple { background: #f0e9ff; color: #7046bd; }
.workflow-kpi-icon.orange { background: #fff0df; color: #b86b16; }
.workflow-kpi-icon.green { background: #e2f6f1; color: #14816c; }
.workflow-table-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.workflow-filters { background: #f8fafc; border-bottom: 1px solid var(--border); display: grid; gap: .5rem; grid-template-columns: minmax(240px, 1fr) repeat(4, minmax(135px, auto)) auto auto; padding: .75rem; }
.workflow-table thead th { background: #eef3fa; color: #53637a; font-size: .67rem; letter-spacing: .04em; padding: .65rem .8rem; text-transform: uppercase; }
.workflow-table td { font-size: .75rem; padding: .7rem .8rem; }
.workflow-table td > a:first-child { display: block; font-weight: 800; text-decoration: none; }
.workflow-table td small { color: var(--muted); display: block; font-size: .65rem; margin-top: .12rem; }
.workflow-table .request-package { min-width: 10rem; max-width: 15rem; overflow-wrap: anywhere; }
.workflow-table .request-package strong { font-weight: 600; }
.workflow-table .package-tone-0 { --bs-table-bg: #f0f5fc; --package-hover: #e6eef9; }
.workflow-table .package-tone-1 { --bs-table-bg: #f0f8f3; --package-hover: #e5f2eb; }
.workflow-table .package-tone-2 { --bs-table-bg: #f7f2fb; --package-hover: #eee6f6; }
.workflow-table .package-tone-3 { --bs-table-bg: #fff7ed; --package-hover: #fbefdf; }
.workflow-table .package-tone-4 { --bs-table-bg: #eef8fa; --package-hover: #e1f1f5; }
.workflow-table .package-tone-5 { --bs-table-bg: #f8f5ef; --package-hover: #efeadf; }
.workflow-table tr[data-package-id]:is(:hover, :focus-within) > td { background-color: var(--package-hover); }
.request-type { background: #edf1f6; border-radius: 2rem; color: #52637d; display: inline-block; font-size: .63rem; font-weight: 700; padding: .24rem .5rem; }
.workflow-owner { border-radius: 2rem; display: inline-block; font-size: .63rem; font-weight: 800; padding: .26rem .55rem; white-space: nowrap; }
.owner-uo { background: #fff0dd; color: #8a5014; }
.owner-seges { background: #e7efff; color: #2859b3; }
.owner-seges_gerencia { background: #e7efff; color: #2859b3; }
.owner-sepo { background: #efe8ff; color: #6540a8; }
.owner-concluida { background: #ddf5eb; color: #146b50; }
.request-status { border-radius: 2rem; display: inline-block; font-size: .63rem; font-weight: 800; padding: .26rem .55rem; white-space: nowrap; }
.status-rascunho { background: #edf1f6; color: #59677a; }
.status-enviada { background: #e7efff; color: #2859b3; }
.status-em_analise { background: #efe8ff; color: #6844ad; }
.status-devolvida { background: #fff0dd; color: #9a5914; }
.status-aprovada { background: #ddf5eb; color: #157354; }
.status-rejeitada, .status-cancelada { background: #fde5e8; color: #a92f3d; }

.request-detail-grid { align-items: start; display: grid; gap: .85rem; grid-template-columns: minmax(0, 1fr) 330px; }
.request-detail-grid > * { min-width: 0; }
.workflow-progress { background: #fff; border: 1px solid var(--border); border-radius: .7rem; box-shadow: 0 5px 18px rgba(25,45,78,.04); margin-bottom: .85rem; padding: .85rem 1rem; }
.workflow-progress-summary { align-items: center; display: flex; gap: .65rem; margin-bottom: .85rem; }
.workflow-progress-summary > i { align-items: center; background: #e8f1ff; border-radius: .5rem; color: #315fae; display: flex; flex: 0 0 34px; height: 34px; justify-content: center; }
.workflow-progress-summary small, .workflow-progress-summary strong { display: block; }
.workflow-progress-summary small { color: #718098; font-size: .62rem; font-weight: 800; text-transform: uppercase; }
.workflow-progress-summary strong { color: #293a52; font-size: .76rem; margin-top: .1rem; }
.workflow-progress ol { display: grid; grid-template-columns: repeat(6, 1fr); list-style: none; margin: 0; padding: 0; }
.workflow-progress li { align-items: center; display: flex; gap: .5rem; min-width: 0; position: relative; }
.workflow-progress li::after { background: #dfe5ed; content: ""; height: 2px; left: calc(50% + 26px); position: absolute; right: calc(-50% + 26px); top: 15px; }
.workflow-progress li:last-child::after { display: none; }
.workflow-progress li > span { align-items: center; background: #edf1f6; border-radius: 50%; color: #718098; display: flex; flex: 0 0 30px; font-size: .65rem; font-weight: 800; height: 30px; justify-content: center; position: relative; z-index: 1; }
.workflow-progress li strong, .workflow-progress li small { display: block; }
.workflow-progress li strong { color: #66758a; font-size: .69rem; }
.workflow-progress li small { color: #8894a5; font-size: .58rem; margin-top: .1rem; }
.workflow-progress li.done > span { background: #dff3ea; color: #157354; }
.workflow-progress li.done::after { background: #80bfa9; }
.workflow-progress li.active > span { background: #315fae; box-shadow: 0 4px 12px rgba(49,95,174,.24); color: #fff; }
.workflow-progress li.active strong { color: #274f91; }
.workflow-progress li.rejected > span { background: #fde5e8; color: #a92f3d; }
.workflow-progress li.rejected strong { color: #982d3a; }
.request-card { background: #fff; border: 1px solid var(--border); border-radius: .7rem; box-shadow: 0 5px 18px rgba(25,45,78,.04); margin-bottom: .85rem; overflow: hidden; }
.request-card-heading { align-items: center; background: #f8fafc; border-bottom: 1px solid var(--border); color: #49617f; display: flex; gap: .45rem; padding: .7rem .85rem; }
.request-card-heading h2 { font-size: .78rem; font-weight: 800; margin: 0; }
.request-card-body { padding: .9rem; }
.request-data-grid { display: grid; gap: .75rem; grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 0; }
.request-data-grid > div { min-width: 0; }
.request-data-grid .wide { grid-column: 1 / -1; }
.request-data-grid dt, .prose-data h3, .subsection-title { color: #718098; font-size: .64rem; font-weight: 800; margin-bottom: .18rem; text-transform: uppercase; }
.request-data-grid dd { font-size: .75rem; margin: 0; overflow-wrap: anywhere; }
.prose-data p { color: #3e4c62; font-size: .76rem; }
.tag-list { display: flex; flex-wrap: wrap; gap: .35rem; }
.tag-list span { background: #edf3ff; border-radius: 2rem; color: #315a9f; font-size: .68rem; padding: .28rem .55rem; }
.delivered-product { align-items: center; display: flex; gap: .7rem; margin-bottom: .8rem; }
.delivered-product > span { align-items: center; background: #e8f1ff; border-radius: .6rem; color: #3666ba; display: flex; height: 40px; justify-content: center; width: 40px; }
.delivered-product small, .delivered-product strong, .delivered-product p { display: block; margin: 0; }
.delivered-product small { color: var(--muted); font-size: .63rem; text-transform: uppercase; }
.request-change-summary { background: var(--primary-soft); border: 1px solid #c7d8f5; border-radius: var(--radius); color: #1b457d; margin-bottom: 1rem; padding: 1rem; }
.request-change-summary h2 { color: #173f75; font-size: 1rem; font-weight: 700; margin: 0 0 .4rem; }
.request-change-summary p { font-size: .875rem; margin: 0; }
.request-change-summary ul { display: flex; flex-wrap: wrap; gap: .5rem 1.2rem; list-style: none; margin: .65rem 0; padding: 0; }
.request-change-summary a { color: #174e9c; font-size: .875rem; text-underline-offset: .2em; }
.request-change-summary .comparison-source { margin-top: .65rem; }
.compared-value { display: inline-block; max-width: 100%; overflow-wrap: anywhere; scroll-margin-top: 6rem; }
.compared-value:target { outline: 2px solid var(--primary); outline-offset: 3px; }
.change-value { align-items: baseline; background: #fff6df; border: 0; border-radius: .25rem; color: inherit; cursor: help; display: inline-flex; gap: .4rem; font: inherit; max-width: 100%; padding: .2rem .35rem; text-align: start; }
.change-value > span:first-child { min-width: 0; overflow-wrap: anywhere; }
.change-value > .bi { color: #78520b; flex-shrink: 0; font-size: .8em; }
.change-value:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; }
.change-tooltip .tooltip-inner { max-width: min(28rem, calc(100vw - 2rem)); overflow-wrap: anywhere; text-align: start; white-space: pre-wrap; }
.field-previous-value, .delivered-product .field-previous-value { color: #526179; display: block; font-size: .875rem; font-weight: 400; margin-top: .3rem; text-transform: none; }
.delivered-product > div { min-width: 0; }
.comparison-table { border: 1px solid var(--border); border-radius: .5rem; overflow: hidden; }
.comparison-table > div { display: grid; grid-template-columns: 90px repeat(4, 1fr); }
.comparison-table > div > * { border-right: 1px solid var(--border); font-size: .68rem; padding: .48rem; }
.comparison-table > div > *:last-child { border-right: 0; }
.comparison-table > div:not(:last-child) { border-bottom: 1px solid var(--border); }
.comparison-head { background: #eef3fa; text-align: center; }
.macro-list, .risk-list { list-style: none; margin: 0; padding: 0; }
.macro-list li, .risk-list li { align-items: center; border-bottom: 1px solid #edf0f4; display: flex; font-size: .72rem; gap: .5rem; padding: .45rem 0; }
.macro-list li span { align-items: center; background: #eaf1ff; border-radius: 50%; color: #315fb1; display: flex; flex: 0 0 24px; height: 24px; justify-content: center; }
.macro-list li > div { min-width: 0; }
.macro-list li b, .macro-list li small { display: block; overflow-wrap: anywhere; }
.macro-list li b { color: #34465f; font-size: .72rem; }
.macro-list li small { color: #748198; font-size: .62rem; margin-top: .1rem; }
.risk-list i { color: #c17a20; }
.empty-list { color: var(--muted); font-style: italic; }
.responsible-card { display: grid; gap: .45rem; grid-template-columns: 40px 1fr; }
.avatar { align-items: center; background: #dfeaff; border-radius: 50%; color: #315fae; display: flex; font-weight: 800; height: 40px; justify-content: center; width: 40px; }
.responsible-card strong, .responsible-card small { display: block; }
.responsible-card small { color: var(--muted); font-size: .65rem; }
.responsible-card > a, .responsible-card > span:not(.avatar) { color: #4e6280; font-size: .68rem; grid-column: 1 / -1; text-decoration: none; }
.responsible-card i { margin-right: .4rem; }
.decision-actions { display: grid; gap: .4rem; grid-template-columns: 1fr; margin-top: .7rem; }
.decision-context { background: #f1edff; border-radius: .45rem; color: #5c4591; font-size: .68rem; margin: 0 0 .7rem; padding: .55rem .65rem; }
.decision-actions button { justify-content: center; }
.timeline { padding-left: 1.2rem; }
.timeline-item { display: grid; gap: .6rem; grid-template-columns: 10px 1fr; padding-bottom: .8rem; position: relative; }
.timeline-item::before { background: #dbe3ee; content: ""; height: 100%; left: 4px; position: absolute; top: 8px; width: 1px; }
.timeline-item:last-child::before { display: none; }
.timeline-item > span { background: #5080d4; border: 2px solid #e8effb; border-radius: 50%; height: 9px; margin-top: .25rem; width: 9px; z-index: 1; }
.timeline-item strong, .timeline-item time { display: block; }
.timeline-item strong { font-size: .7rem; }
.timeline-item time { color: var(--muted); font-size: .6rem; }
.timeline-stage { color: #536c91; display: block; font-size: .6rem; font-weight: 700; margin-top: .12rem; }
.timeline-item p { background: #f7f9fc; border-radius: .35rem; font-size: .65rem; margin: .3rem 0 0; padding: .4rem; }

.notification-list { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.notification-item { align-items: flex-start; border-bottom: 1px solid var(--border); color: inherit; display: flex; gap: .8rem; padding: .85rem 1rem; text-decoration: none; }
.notification-item:last-child { border-bottom: 0; }
.notification-item:hover { background: #f7faff; }
.notification-item.unread { background: #edf4ff; }
.notification-icon { align-items: center; border-radius: .55rem; display: flex; flex: 0 0 38px; height: 38px; justify-content: center; }
.notification-icon.seges { background: #e7efff; color: #2d61c1; }
.notification-icon.sepo { background: #efe8ff; color: #6844ad; }
.notification-icon.uo { background: #e2f6f1; color: #177b69; }
.notification-item time { color: var(--muted); font-size: .63rem; white-space: nowrap; }
.notification-item p { color: #4e5e76; font-size: .72rem; margin: .2rem 0; }
.notification-item small { color: var(--muted); font-size: .63rem; }
.htmx-indicator { display: none; }
.htmx-request.htmx-indicator, .htmx-request .htmx-indicator { display: inline-block; }

@media (max-width: 991.98px) {
  .explorer-grid { grid-template-columns: 1fr; }
  .tree-panel { max-height: 430px; min-height: 380px; position: static; }
  .workspace { min-height: 400px; }
  .results-table-wrap { max-height: none; }
  .proposal-shell { grid-template-columns: 1fr; }
  .proposal-steps { display: flex; overflow-x: auto; position: static; }
  .proposal-step-link { border-bottom: 0; border-right: 1px solid #edf0f5; flex: 0 0 auto; width: auto; }
  .proposal-step-link div { display: none; }
  .request-detail-grid { grid-template-columns: 1fr; }
  .territory-selector { grid-template-columns: 1fr; }
  .workflow-progress ol { gap: .7rem; grid-template-columns: repeat(2, 1fr); }
  .workflow-progress li::after { display: none; }
  .workflow-filters { grid-template-columns: repeat(2, 1fr); }
  .workflow-filters .search-input { grid-column: 1 / -1; }
}

@media (max-width: 575.98px) {
  body { font-size: .84rem; }
  .page-hero { padding: .85rem; }
  .kpi-card { gap: .55rem; padding: .65rem; }
  .kpi-icon { flex-basis: 34px; height: 34px; }
  .kpi-card strong { font-size: 1.1rem; }
  .tree-legend { display: none; }
  .tree-panel { min-height: 360px; }
  .meta-grid { grid-template-columns: repeat(2, 1fr); }
  .meta-grid > div:nth-child(2) { border-right: 0; }
  .meta-grid > div:nth-child(-n+2) { border-bottom: 1px solid var(--border); }
  .detail-list { grid-template-columns: 1fr; }
  .detail-list dt { margin-top: .35rem; }
  .proposal-topbar, .request-detail-top { align-items: flex-start; flex-direction: column; }
  .proposal-editor-meta { align-items: flex-start; }
  .proposal-editor { text-align: left; }
  .draft-progress { min-width: 100%; }
  .proposal-type-options > div, .choice-grid > div, .choice-grid > ul,
  .choice-grid.compact > div, .choice-grid.compact > ul,
  .alignment-grid, .public-target-list, .workflow-kpis { grid-template-columns: 1fr; }
  .territory-scope-options > div { grid-template-columns: 1fr; }
  #id_regioes_desenvolvimento { grid-template-columns: 1fr; }
  .risk-heading { display: none; }
  .risk-catalog-row, .custom-risk-row { grid-template-columns: 30px minmax(0, 1fr); }
  .risk-catalog-row .risk-name { grid-column: 1 / -1; }
  .risk-catalog-row .risk-assessment { grid-column: 1 / -1; }
  .custom-risk-row > input, .custom-risk-row > .risk-assessment { grid-column: 2; }
  .custom-risk-row > button { grid-column: 1; grid-row: 2; }
  .risk-summary-table > div { grid-template-columns: 1fr 1fr; }
  .risk-summary-table > div > :first-child { grid-column: 1 / -1; }
  .annual-grid { grid-template-columns: repeat(2, 1fr); }
  .annual-grid > div:nth-child(2) { border-right: 0; }
  .annual-grid > div:nth-child(-n+2) { border-bottom: 1px solid var(--border); }
  .proposal-footer { align-items: stretch; flex-direction: column; gap: .6rem; }
  .proposal-footer > div { margin-left: 0 !important; }
  .proposal-footer .btn { flex: 1; }
  .workflow-kpis { grid-template-columns: repeat(2, 1fr); }
  .workflow-kpis > a:last-child { grid-column: 1 / -1; }
  .workflow-filters { grid-template-columns: 1fr; }
  .workflow-filters .search-input { grid-column: auto; }
  .request-data-grid { grid-template-columns: 1fr; }
  .request-data-grid .wide { grid-column: auto; }
  .comparison-table { overflow-x: auto; }
  .comparison-table > div { min-width: 560px; }
  .workflow-progress ol { grid-template-columns: 1fr; }
  .macro-stage-row { align-items: flex-start; }
  .macro-stage-fields { grid-template-columns: 1fr; }
  .macro-stage-row .repeater-number, .macro-stage-row .remove-repeater { margin-bottom: 0; margin-top: 1.35rem; }
}

.conference-table { table-layout: fixed; min-width: 600px; }
.conference-table th, .conference-table td { overflow-wrap: anywhere; }
@media print {
  .app-navbar, .app-footer { display: none !important; }
  .conference-page { max-width: none; padding: 0 !important; }
  .conference-page .table-responsive { overflow: visible; }
  .conference-table { min-width: 0; font-size: 10pt; }
  .conference-table tr { break-inside: avoid; }
}
