.app-main {
  min-height: 60vh;
}

.auth-form {
  display: grid;
  gap: 1rem;
  padding: 1.4rem;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.auth-form label {
  display: grid;
  gap: 0.4rem;
  font-weight: 600;
  font-size: 0.92rem;
}

.auth-form input,
.auth-form select,
.auth-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.75rem 0.9rem;
  font: inherit;
  background: #fff;
}

.alert {
  padding: 0.85rem 1rem;
  border-radius: 12px;
  background: rgba(42, 155, 155, 0.12);
  border: 1px solid rgba(42, 155, 155, 0.28);
  margin-bottom: 1rem;
}

.alert--error {
  background: rgba(241, 90, 41, 0.12);
  border-color: rgba(241, 90, 41, 0.35);
}

.alert--ok {
  background: rgba(42, 155, 155, 0.14);
}

.content-grid {
  display: grid;
  gap: 1.2rem;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.content-card {
  padding: 1.2rem;
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.content-card--reply {
  margin-top: 0.8rem;
}

.video-frame {
  position: relative;
  padding-top: 56.25%;
  margin-top: 0.8rem;
  border-radius: 12px;
  overflow: hidden;
  background: #0f1a24;
}

.video-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.helpdesk-layout {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
}

.ticket-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.7rem;
}

.ticket-list a {
  display: grid;
  gap: 0.2rem;
  padding: 0.9rem 1rem;
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid var(--line);
  border-radius: 14px;
}

.ticket-list span,
.ticket-list small,
.muted {
  color: var(--muted);
  font-weight: 500;
}

.nav a.is-active,
.nav__mod-link.is-active,
.nav__mod.is-active > .nav__mod-btn {
  color: var(--orange);
  font-weight: 700;
}

/* Menu horizontal por módulo */
.nav--modules {
  gap: 0.35rem;
}

.nav__mod {
  position: relative;
}

.nav__mod-btn,
.nav__mod-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: 0;
  background: transparent;
  font: inherit;
  font-weight: 600;
  color: var(--ink-soft);
  cursor: pointer;
  padding: 0.45rem 0.7rem;
  border-radius: 10px;
  transition: color 0.2s ease, background 0.2s ease;
}

.nav__mod-btn:hover,
.nav__mod-link:hover,
.nav__mod.is-open > .nav__mod-btn {
  color: var(--orange);
  background: rgba(241, 90, 41, 0.08);
}

.nav__mod-panel {
  display: none;
  position: absolute;
  top: calc(100% + 0.35rem);
  left: 0;
  min-width: 200px;
  padding: 0.45rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 12px 28px rgba(15, 26, 36, 0.12);
  z-index: 50;
}

.nav__mod.is-open > .nav__mod-panel,
.nav__mod:hover > .nav__mod-panel {
  display: grid;
  gap: 0.15rem;
}

.nav__mod-panel a {
  padding: 0.55rem 0.7rem;
  border-radius: 10px;
  font-weight: 600;
  color: var(--ink-soft);
}

.nav__mod-panel a:hover,
.nav__mod-panel a.is-active {
  background: rgba(42, 155, 155, 0.1);
  color: var(--teal);
}

/* Barra de módulos Protheus */
.module-bar {
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.55);
}

.module-bar__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 0.25rem;
  padding: 0.35rem 0 0.55rem;
}

.module-bar__group {
  position: relative;
}

.module-bar__btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--ink-soft);
  cursor: pointer;
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  transition: background 0.2s ease, color 0.2s ease;
}

.module-bar__group.is-active > .module-bar__btn,
.module-bar__group.is-open > .module-bar__btn,
.module-bar__btn:hover {
  background: rgba(42, 155, 155, 0.14);
  color: var(--teal);
}

.module-bar__panel {
  display: none;
  position: absolute;
  top: calc(100% + 0.25rem);
  left: 0;
  min-width: 210px;
  padding: 0.4rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 12px 28px rgba(15, 26, 36, 0.12);
  z-index: 45;
}

.module-bar__group.is-open > .module-bar__panel,
.module-bar__group:hover > .module-bar__panel {
  display: grid;
  gap: 0.12rem;
}

.module-bar__panel a {
  padding: 0.5rem 0.65rem;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink-soft);
}

.module-bar__panel a:hover,
.module-bar__panel a.is-active {
  background: rgba(241, 90, 41, 0.1);
  color: var(--orange);
}

/* Menu vertical Protheus, exibido junto da barra horizontal. */
.app-shell--protheus {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  align-items: start;
  transition: grid-template-columns 0.22s ease;
}

.app-shell--protheus.is-sidebar-collapsed {
  grid-template-columns: 44px minmax(0, 1fr);
}

.app-shell--protheus > .app-main {
  min-width: 0;
}

.module-sidebar {
  position: sticky;
  top: 126px;
  height: calc(100vh - 126px);
  overflow-x: hidden;
  overflow-y: auto;
  padding: 1.1rem 0.8rem 1.5rem;
  background: rgba(255, 255, 255, 0.72);
  border-right: 1px solid var(--line);
  transition: padding 0.22s ease, opacity 0.22s ease;
}

.app-shell--protheus.is-sidebar-collapsed .module-sidebar {
  padding: 0.7rem 0.2rem;
  opacity: 0;
  pointer-events: none;
}

.module-sidebar__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0 0.25rem 0.9rem 0.65rem;
  border-bottom: 1px solid var(--line);
}

.module-sidebar__titles {
  display: grid;
  gap: 0.1rem;
  min-width: 0;
}

.module-sidebar__titles span {
  color: var(--teal);
  font-family: var(--font-display);
  font-weight: 800;
}

.module-sidebar__titles small {
  color: var(--muted);
  font-size: 0.75rem;
}

.module-sidebar__collapse,
.module-sidebar__expand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink-soft);
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.module-sidebar__collapse:hover,
.module-sidebar__expand:hover {
  color: var(--teal);
  background: rgba(42, 155, 155, 0.1);
}

.module-sidebar__expand {
  position: sticky;
  top: 140px;
  margin: 0.85rem 0.35rem;
  z-index: 5;
}

.module-sidebar__expand[hidden] {
  display: none;
}

.module-sidebar__nav {
  display: grid;
  gap: 0.35rem;
  padding-top: 0.85rem;
}

.module-sidebar__group {
  display: grid;
  gap: 0.15rem;
}

.module-sidebar__mod {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  width: 100%;
  border: 0;
  background: transparent;
  padding: 0.55rem 0.65rem;
  border-radius: 10px;
  color: var(--ink-soft);
  font: inherit;
  font-size: 0.84rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  text-align: left;
  transition: color 0.2s ease, background 0.2s ease;
}

.module-sidebar__mod:hover,
.module-sidebar__mod.is-active {
  color: var(--teal);
  background: rgba(42, 155, 155, 0.1);
}

.module-sidebar__chev {
  font-size: 0.75rem;
  transition: transform 0.2s ease;
}

.module-sidebar__group.is-open .module-sidebar__chev {
  transform: rotate(180deg);
}

.module-sidebar__items {
  display: none;
  gap: 0.12rem;
  padding: 0.1rem 0 0.35rem 0.35rem;
}

.module-sidebar__group.is-open > .module-sidebar__items {
  display: grid;
}

.module-sidebar__items a {
  padding: 0.48rem 0.65rem;
  border-radius: 9px;
  color: var(--ink-soft);
  font-size: 0.86rem;
  font-weight: 600;
  transition: color 0.2s ease, background 0.2s ease;
}

.module-sidebar__items a:hover {
  color: var(--teal);
  background: rgba(42, 155, 155, 0.09);
}

.module-sidebar__items a.is-active {
  color: var(--orange);
  background: rgba(241, 90, 41, 0.11);
  font-weight: 800;
}

.module-section {
  margin-top: 1.6rem;
}

.module-section__head {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
  padding-bottom: 0.45rem;
  border-bottom: 1px solid var(--line);
}

.module-section__head h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.05rem;
}

.module-section__head span {
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 500;
}

.module-section .pillars {
  margin-top: 0;
}

@media (max-width: 860px) {
  .nav--modules .nav__mod {
    width: 100%;
  }

  .nav__mod-btn,
  .nav__mod-link {
    width: 100%;
    justify-content: space-between;
  }

  .nav__mod-panel {
    position: static;
    display: none;
    box-shadow: none;
    border: 0;
    background: transparent;
    padding: 0 0 0.4rem 0.6rem;
    min-width: 0;
  }

  .nav__mod.is-open > .nav__mod-panel {
    display: grid;
  }

  .nav__mod:hover > .nav__mod-panel {
    display: none;
  }

  .nav__mod.is-open:hover > .nav__mod-panel {
    display: grid;
  }

  .module-bar__inner {
    flex-direction: column;
    align-items: stretch;
  }

  .module-bar__panel {
    position: static;
    display: none;
    box-shadow: none;
    border: 0;
    background: transparent;
    padding: 0 0 0.35rem 0.75rem;
  }

  .module-bar__group.is-open > .module-bar__panel {
    display: grid;
  }

  .module-bar__group:hover > .module-bar__panel {
    display: none;
  }

  .module-bar__group.is-open:hover > .module-bar__panel {
    display: grid;
  }
}

@media (max-width: 1120px) {
  .app-shell--protheus {
    display: block;
  }

  .module-sidebar,
  .module-sidebar__expand {
    display: none !important;
  }
}

.hosting-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-bottom: 1.2rem;
}

.hosting-dl {
  display: grid;
  gap: 0.65rem;
  margin: 0.8rem 0 0;
}

.hosting-dl > div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid var(--line);
  padding-bottom: 0.45rem;
}

.hosting-dl dt {
  color: var(--muted);
  font-weight: 600;
}

.hosting-dl dd {
  margin: 0;
  font-weight: 700;
  text-align: right;
}

.hosting-table-wrap {
  overflow-x: auto;
  margin-top: 0.8rem;
}

.hosting-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.hosting-table th,
.hosting-table td {
  text-align: left;
  padding: 0.55rem 0.4rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.hosting-table code {
  font-size: 0.78rem;
  word-break: break-word;
}

.hosting-table tr.is-portal-db {
  background: rgba(42, 155, 155, 0.1);
}

.badge-portal {
  display: inline-block;
  margin-left: 0.4rem;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  background: rgba(241, 90, 41, 0.15);
  color: var(--orange);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
}

@media (max-width: 800px) {
  .helpdesk-layout {
    grid-template-columns: 1fr;
  }
}

/* Cadastros: lista (browse) → ficha */
.cad-pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  margin: 0.85rem 0 0.25rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
}
.cad-pager__info {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
}
.cad-pager__nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.cad-pager__btn.is-disabled {
  opacity: 0.45;
  pointer-events: none;
  cursor: default;
}
.cad-pager__size {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.88rem;
}
.cad-pager__size select {
  min-width: 4.5rem;
}

.cad-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.85rem;
  margin: 0 0 1.1rem;
  padding: 0.85rem 1rem;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
  border-radius: 14px;
}

.cad-toolbar__search {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.6rem;
  flex: 1;
}

.cad-toolbar__search label {
  display: grid;
  gap: 0.3rem;
  min-width: min(100%, 280px);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--muted);
}

.cad-toolbar__search input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.65rem 0.8rem;
  font: inherit;
  background: #fff;
}

.cad-toolbar__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.cad-toolbar__mode {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.cad-toolbar__mode strong {
  font-family: var(--font-display);
  font-size: 1rem;
}

.cad-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.cad-badge--new {
  background: rgba(42, 155, 155, 0.14);
  color: var(--teal);
}

.cad-badge--edit {
  background: rgba(241, 90, 41, 0.14);
  color: var(--orange);
}

.cad-browse {
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
}

.cad-table-wrap {
  margin-top: 0;
}

.cad-table thead th {
  position: sticky;
  top: 0;
  background: rgba(248, 250, 251, 0.98);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.cad-row {
  cursor: pointer;
  transition: background 0.15s ease;
}

.cad-row:hover,
.cad-row:focus {
  background: rgba(42, 155, 155, 0.08);
  outline: none;
}

.cad-row.is-active {
  background: rgba(241, 90, 41, 0.1);
}

.cad-row__go a {
  font-weight: 700;
  color: var(--teal);
  white-space: nowrap;
}

.cad-ficha {
  max-width: 920px;
}

.cad-ficha__form {
  gap: 0;
  padding: 0;
  overflow: hidden;
}

.cad-ficha__head {
  padding: 1rem 1.15rem;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(42, 155, 155, 0.08), transparent);
}

.cad-ficha__head h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.05rem;
}

.cad-ficha__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem 1rem;
  padding: 1.15rem;
}

.cad-ficha__grid label {
  display: grid;
  gap: 0.35rem;
  font-weight: 600;
  font-size: 0.9rem;
}

.cad-ficha__grid label.cad-span-2 {
  grid-column: 1 / -1;
}

.cad-ficha__grid input,
.cad-ficha__grid select,
.cad-ficha__grid textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.7rem 0.85rem;
  font: inherit;
  background: #fff;
}

.cad-ficha__grid input[readonly] {
  background: rgba(15, 26, 36, 0.04);
  color: var(--muted);
}

.cad-ficha__foot {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  padding: 0.95rem 1.15rem 1.15rem;
  border-top: 1px solid var(--line);
  background: rgba(248, 250, 251, 0.7);
}

@media (max-width: 720px) {
  .cad-ficha__grid {
    grid-template-columns: 1fr;
  }

  .cad-toolbar {
    align-items: stretch;
  }

  .cad-toolbar__actions {
    width: 100%;
  }

  .cad-toolbar__actions .btn {
    flex: 1;
    justify-content: center;
  }
}

/* Compras — cadeia / kanban / mapa */
.container--wide {
  width: min(100% - 1.5rem, 1400px);
}

.compras-next {
  display: inline-flex;
}

.compras-children {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.45rem;
}

.compras-children a {
  display: block;
  padding: 0.65rem 0.85rem;
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid var(--line);
  border-radius: 10px;
  font-weight: 600;
}

.compras-pipeline {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 0.6rem;
  margin-top: 1rem;
}

.compras-pipeline__step {
  flex: 1 1 160px;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid var(--line);
  border-radius: 14px;
}

.compras-pipeline__num {
  display: inline-flex;
  width: 1.6rem;
  height: 1.6rem;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(42, 155, 155, 0.15);
  color: var(--teal);
  font-size: 0.8rem;
  font-weight: 800;
}

.compras-pipeline__step h3 {
  margin: 0.55rem 0 0.35rem;
  font-size: 1rem;
}

.compras-pipeline__step p {
  margin: 0 0 0.7rem;
  color: var(--muted);
  font-size: 0.88rem;
}

.compras-pipeline__arrow {
  align-self: center;
  color: var(--muted);
  font-weight: 800;
}

.compras-views {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  margin: 0.85rem 0 1.1rem;
}

.compras-views__tabs {
  display: inline-flex;
  padding: 0.2rem;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--line);
  border-radius: 999px;
  gap: 0.15rem;
}

.compras-views__tab {
  padding: 0.4rem 0.95rem;
  border-radius: 999px;
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--muted);
  text-decoration: none;
}

.compras-views__tab:hover {
  color: var(--ink);
}

.compras-views__tab.is-active {
  background: var(--teal);
  color: #fff;
}

.compras-views__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.compras-kanban {
  display: grid;
  grid-template-columns: repeat(5, minmax(220px, 1fr));
  gap: 0.85rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
}

.compras-kanban__col {
  min-width: 220px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(255, 255, 255, 0.55));
  border: 1px solid var(--line);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  max-height: 72vh;
  box-shadow: 0 8px 24px rgba(20, 40, 50, 0.04);
}

.compras-kanban__col--sol { border-top: 3px solid var(--teal); }
.compras-kanban__col--cot { border-top: 3px solid #2a6f97; }
.compras-kanban__col--ped { border-top: 3px solid #6b4f9a; }
.compras-kanban__col--rec { border-top: 3px solid #b06a1a; }
.compras-kanban__col--nfe { border-top: 3px solid var(--orange); }

/* Faturamento — mesmas classes compras-kanban, cores por etapa */
.faturamento-kanban__col--orc { border-top: 3px solid var(--teal); }
.faturamento-kanban__col--pv { border-top: 3px solid #2a6f97; }
.faturamento-kanban__col--rem { border-top: 3px solid #6b4f9a; }
.faturamento-kanban__col--fat { border-top: 3px solid #b06a1a; }
.faturamento-kanban__col--nfs { border-top: 3px solid var(--orange); }

.compras-kanban__card.tipo-orc { border-left-color: var(--teal); }
.compras-kanban__card.tipo-pv { border-left-color: #2a6f97; }
.compras-kanban__card.tipo-rem { border-left-color: #6b4f9a; }
.compras-kanban__card.tipo-fat { border-left-color: #b06a1a; }
.compras-kanban__card.tipo-nfs { border-left-color: var(--orange); }

.faturamento-pipeline__step--orc .compras-pipeline__num { background: rgba(42, 155, 155, 0.15); }
.faturamento-pipeline__step--pv .compras-pipeline__num { background: rgba(42, 111, 151, 0.15); color: #2a6f97; }
.faturamento-pipeline__step--rem .compras-pipeline__num { background: rgba(107, 79, 154, 0.15); color: #6b4f9a; }
.faturamento-pipeline__step--fat .compras-pipeline__num { background: rgba(176, 106, 26, 0.15); color: #b06a1a; }
.faturamento-pipeline__step--nfs .compras-pipeline__num { background: rgba(230, 126, 34, 0.15); color: var(--orange); }

.compras-kanban__col > header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.8rem 0.9rem 0.7rem;
  border-bottom: 1px solid var(--line);
}

.compras-kanban__col > header h3 {
  margin: 0;
  font-size: 0.92rem;
}

.compras-kanban__col > header small {
  display: block;
  margin-top: 0.2rem;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 600;
}

.compras-kanban__count {
  min-width: 1.7rem;
  height: 1.7rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.06);
  color: var(--ink);
  font-weight: 800;
  font-size: 0.78rem;
}

.compras-kanban__list {
  display: grid;
  gap: 0.55rem;
  padding: 0.7rem;
  overflow-y: auto;
}

.compras-kanban__empty {
  margin: 0.4rem 0;
  color: var(--muted);
  font-size: 0.82rem;
  text-align: center;
}

.compras-kanban__card {
  display: grid;
  gap: 0.25rem;
  padding: 0.75rem 0.8rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  border-left: 3px solid var(--teal);
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.compras-kanban__card.tipo-cot { border-left-color: #2a6f97; }
.compras-kanban__card.tipo-ped { border-left-color: #6b4f9a; }
.compras-kanban__card.tipo-rec { border-left-color: #b06a1a; }
.compras-kanban__card.tipo-nfe { border-left-color: var(--orange); }

.compras-kanban__card:hover {
  box-shadow: 0 6px 16px rgba(20, 40, 50, 0.08);
  transform: translateY(-1px);
}

.compras-kanban__card.is-focus {
  border-color: var(--orange);
  box-shadow: 0 0 0 2px rgba(241, 90, 41, 0.18);
}

.compras-kanban__card-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem 0.5rem;
}

.compras-kanban__title {
  font-weight: 800;
  color: var(--ink);
}

.compras-kanban__card small {
  color: var(--muted);
  font-size: 0.75rem;
}

.proc-doc-sub {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.75rem;
  font-weight: 400;
  line-height: 1.35;
}

.compras-kanban__card .proc-doc-sub {
  margin-top: 0.15rem;
}

.compras-kanban__card-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.75rem;
  margin-top: 0.35rem;
  padding-top: 0.35rem;
  border-top: 1px dashed rgba(0, 0, 0, 0.08);
}

.compras-kanban__map,
.compras-kanban__next {
  font-size: 0.78rem;
  font-weight: 700;
}

.compras-kanban__map {
  color: #6b4f9a;
}

.compras-kanban__next {
  color: var(--teal);
}

.compras-map {
  overflow-x: auto;
  padding: 0.5rem 0 1rem;
}

.compras-map__roots,
.compras-map__node > ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.compras-map__roots {
  display: grid;
  gap: 1.35rem;
}

.compras-map__node > ul {
  margin: 0.55rem 0 0 1.2rem;
  padding-left: 0.9rem;
  border-left: 2px solid rgba(42, 155, 155, 0.35);
  display: grid;
  gap: 0.55rem;
}

.compras-map__card {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.7rem;
  padding: 0.65rem 0.85rem;
  background: linear-gradient(180deg, #fff, rgba(255, 255, 255, 0.9));
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 4px 14px rgba(20, 40, 50, 0.04);
}

.compras-map__node.is-focus > .compras-map__card {
  border-color: var(--orange);
  box-shadow: 0 0 0 2px rgba(241, 90, 41, 0.18);
}

.compras-map__tipo {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--teal);
}

.compras-map__doc {
  font-weight: 800;
  color: var(--ink);
}

.compras-map__meta {
  color: var(--muted);
  font-size: 0.78rem;
}

.compras-map__links {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-left: auto;
}

.compras-map__card.tipo-cot .compras-map__tipo { color: #2a6f97; }
.compras-map__card.tipo-ped .compras-map__tipo { color: #6b4f9a; }
.compras-map__card.tipo-rec .compras-map__tipo { color: #b06a1a; }
.compras-map__card.tipo-nfe .compras-map__tipo { color: var(--orange); }

.compras-map__board,
.compras-map__add {
  font-size: 0.78rem;
  font-weight: 700;
}

.compras-map__board {
  color: #6b4f9a;
}

.compras-map__add {
  color: var(--teal);
}

.compras-map-filter {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem 0.75rem;
  margin: 0 0 0.85rem;
  padding: 0.75rem 0.9rem;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.compras-map-filter label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--muted);
}

.compras-map-filter select {
  min-width: min(100%, 280px);
  padding: 0.45rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  font: inherit;
}

.compras-map-filter input[type="search"] {
  min-width: 9rem;
  padding: 0.45rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  font: inherit;
}

.compras-map-filter__or {
  opacity: 0.7;
  font-size: 0.82rem;
}

.compras-map-filter__hint {
  margin: 0 0 0.85rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.compras-elo {
  margin: 0 0 1.15rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(180deg, #fff, rgba(255, 255, 255, 0.92));
}

.compras-elo__title {
  margin: 0 0 0.55rem;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.compras-elo__path {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.45rem;
}

.compras-elo__step {
  display: inline-flex;
  flex-direction: column;
  gap: 0.1rem;
  padding: 0.45rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  min-width: 6.5rem;
}

.compras-elo__step a {
  font-weight: 700;
  text-decoration: none;
}

.compras-elo__tipo {
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.compras-elo__step.tipo-cot .compras-elo__tipo { color: #2a6f97; }
.compras-elo__step.tipo-ped .compras-elo__tipo { color: #6b4f9a; }
.compras-elo__step.tipo-rec .compras-elo__tipo { color: #b06a1a; }
.compras-elo__step.tipo-nfe .compras-elo__tipo { color: var(--orange); }

.compras-elo__sep {
  font-weight: 700;
  opacity: 0.45;
}

.compras-elo__note {
  margin: 0.65rem 0 0;
  font-size: 0.88rem;
  color: var(--muted);
}

.doc-status {
  display: inline-block;
  padding: 0.12rem 0.5rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1.3;
  white-space: nowrap;
}

.doc-status--aberto,
.doc-status--aberta {
  background: rgba(42, 155, 155, 0.15);
  color: #1a6b6b;
}

.doc-status--em_cotacao,
.doc-status--em_analise {
  background: rgba(42, 111, 151, 0.15);
  color: #1d4f6e;
}

.doc-status--parcial {
  background: rgba(176, 106, 26, 0.16);
  color: #8a4b0f;
}

.doc-status--aguardando {
  background: rgba(107, 79, 154, 0.14);
  color: #5a3d8a;
}

.doc-status--encerrado,
.doc-status--encerrado_residuo {
  background: rgba(70, 70, 70, 0.14);
  color: #333;
}

.doc-status--prenota {
  background: rgba(176, 106, 26, 0.14);
  color: #8a4b0f;
}

.doc-status--classificada {
  background: rgba(46, 160, 110, 0.16);
  color: #146c43;
}

.doc-status--prereq,
.doc-status--solicitacao {
  background: rgba(42, 111, 151, 0.15);
  color: #1d4f6e;
}

.doc-status--baixada {
  background: rgba(70, 70, 70, 0.14);
  color: #333;
}

.compras-map__card .doc-status {
  margin-top: 0.25rem;
}

.proc-status .doc-status {
  font-style: normal;
  vertical-align: middle;
}

/* Mapa de cotação — comparativo SC × fornecedores */
.cotmap-wrap {
  overflow-x: auto;
  margin-top: 0.5rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.cotmap {
  width: max-content;
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.84rem;
}

.cotmap th,
.cotmap td {
  padding: 0.55rem 0.65rem;
  border-bottom: 1px solid var(--line);
  border-right: 1px solid rgba(0, 0, 0, 0.06);
  vertical-align: middle;
  white-space: nowrap;
}

.cotmap thead th {
  background: #f4f7f8;
  font-weight: 700;
  position: sticky;
  top: 0;
  z-index: 2;
}

.cotmap th.sub {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
  background: #eef3f4;
}

.cotmap .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.cotmap__sticky {
  position: sticky;
  left: 0;
  z-index: 3;
  background: #fff;
}

.cotmap thead .cotmap__sticky {
  background: #f4f7f8;
  z-index: 4;
}

.cotmap__sc {
  min-width: 7.5rem;
  font-weight: 700;
}

.cotmap-sc-nec {
  margin-top: 0.35rem;
  padding: 0.3rem 0.4rem;
  border-radius: 8px;
  background: rgba(42, 155, 155, 0.1);
  border: 1px solid rgba(42, 155, 155, 0.25);
  line-height: 1.2;
}

.cotmap-sc-nec__lbl {
  display: block;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--teal);
}

.cotmap-sc-nec strong {
  font-size: 0.92rem;
  color: var(--ink);
}

.cotmap__forn {
  text-align: center;
  border-left: 2px solid var(--line);
  min-width: 14rem;
}

.cotmap__forn-head {
  display: grid;
  gap: 0.15rem;
  justify-items: center;
  line-height: 1.25;
}

.cotmap__forn-head small {
  color: var(--muted);
  font-weight: 500;
  max-width: 16rem;
  white-space: normal;
  text-align: center;
}

.cotmap__forn-head a {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--teal);
}

.cotmap td.is-winner,
.cotmap th.is-winner {
  background: rgba(46, 160, 110, 0.12);
}

.cotmap th.cotmap__forn.is-winner {
  background: rgba(46, 160, 110, 0.22);
  border-left-color: #2ea06e;
  color: #146c43;
}

.cotmap td.is-best {
  background: rgba(46, 160, 110, 0.28);
  box-shadow: inset 0 0 0 1px rgba(46, 160, 110, 0.45);
}

.cotmap tfoot td {
  background: #f8fafb;
  font-weight: 600;
}

.cotmap tfoot td.is-winner {
  background: rgba(46, 160, 110, 0.2);
}

.cotmap-badge {
  display: inline-block;
  margin-left: 0.35rem;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  background: #2ea06e;
  color: #fff;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.cotmap-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  font-size: 0.85rem;
}

.cotmap-legend__win {
  color: #146c43;
  font-weight: 700;
}

.cotmap-legend__cell {
  color: #1a7a4c;
  font-weight: 600;
}

.cotmap-muted {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 500;
}

.cotmap-input {
  width: 5.6rem;
  max-width: 100%;
  padding: 0.28rem 0.35rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-size: 0.82rem;
  background: #fff;
}

.cotmap-input:focus {
  outline: 2px solid rgba(46, 160, 110, 0.35);
  border-color: #2ea06e;
}

.cotmap-input--total {
  background: #f3f7f5;
  font-weight: 700;
  border-style: dashed;
}

.cotmap-total td {
  background: #eef2f4 !important;
  border-top: 2px solid var(--ink);
}

.cotmap-winner-row td {
  border-top: 1px solid var(--line);
}

.alert--ok {
  background: rgba(46, 160, 110, 0.12);
  border: 1px solid rgba(46, 160, 110, 0.35);
  color: #146c43;
  padding: 0.75rem 1rem;
  border-radius: 10px;
}

.cotmap-log__table-wrap {
  overflow-x: auto;
}

.cotmap-log__table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
}

.cotmap-log__table th,
.cotmap-log__table td {
  padding: 0.55rem 0.65rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.cotmap-log__table th {
  background: #f4f7f8;
  font-weight: 700;
}

.cotmap-log__table tr.is-open {
  background: rgba(42, 155, 155, 0.08);
}

.cotmap-log__table .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.cotmap-log__acao {
  display: inline-block;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.cotmap-log__acao--salvar {
  background: rgba(42, 155, 155, 0.15);
  color: #1a6b6b;
}

.cotmap-log__acao--add_coluna {
  background: rgba(107, 79, 154, 0.12);
  color: #5a3d8a;
}

.cotmap-legend__late {
  color: #9a3412;
  font-weight: 700;
}

.cotmap td.is-late,
.cotmap th.is-late,
.cotmap th.cotmap__forn.is-late {
  background: rgba(234, 88, 12, 0.12);
}

.cotmap th.cotmap__forn.is-late {
  border-left-color: #ea580c;
}

.cotmap-badge--late {
  background: #ea580c;
}

.cotmap-late-hint {
  margin-top: 0.2rem;
  font-size: 0.68rem;
  font-weight: 700;
  color: #9a3412;
}

.cotmap-input--date {
  width: 8.2rem;
  text-align: left;
}

.cotmap-economia {
  display: grid;
  gap: 0.15rem;
  border-left: 4px solid #2ea06e;
  background: linear-gradient(90deg, rgba(46, 160, 110, 0.12), rgba(255, 255, 255, 0.9));
}

.cotmap-economia__label {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #146c43;
}

.cotmap-economia__valor {
  font-size: 1.75rem;
  font-weight: 800;
  color: #146c43;
  font-variant-numeric: tabular-nums;
}

.cotmap-eco-pos {
  color: #146c43 !important;
  font-weight: 800;
}

.cotmap-eco-row {
  background: rgba(46, 160, 110, 0.08);
}

.cotmap-log__detail {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

@media (max-width: 900px) {
  .compras-pipeline__arrow {
    display: none;
  }

  .compras-kanban {
    grid-template-columns: repeat(5, minmax(240px, 1fr));
  }

  .compras-views {
    flex-direction: column;
    align-items: stretch;
  }
}
