/*
 * BarukERP — Kanban Clean isolation layer
 *
 * Esta folha é carregada depois do visual Branco + Taupe e existe para garantir que
 * o Kanban V2 tenha um único contrato de layout. Regras globais do shell/tema
 * não podem alterar grid, tipografia compacta ou pills dos cards.
 *
 * R64: a camada de isolamento protege somente o estado compacto. Quando um
 * atendimento entra em Modo Foco, a geometria pertence exclusivamente ao
 * contrato visual definido em baruk-kanban-clean.css.
 */

html[data-baruk-visual="taupe-2026"] body .erp-main .baruk-kanban {
  width: 100% !important;
  min-width: 0 !important;
  font-family: inherit !important;
  font-synthesis: none !important;
}

html[data-baruk-visual="taupe-2026"] body .erp-main .baruk-kanban *,
html[data-baruk-visual="taupe-2026"] body .erp-main .baruk-kanban *::before,
html[data-baruk-visual="taupe-2026"] body .erp-main .baruk-kanban *::after {
  box-sizing: border-box !important;
}

html[data-baruk-visual="taupe-2026"] body .erp-main .baruk-kanban__board {
  display: flex !important;
  align-items: flex-start !important;
  gap: 8px !important;
  width: 100% !important;
  min-width: 0 !important;
  padding: 0 2px 4px !important;
  overflow-x: auto !important;
  overflow-y: visible !important;
  scrollbar-width: none !important;
}

html[data-baruk-visual="taupe-2026"] body .erp-main .baruk-kanban__board::-webkit-scrollbar {
  height: 0 !important;
}

html[data-baruk-visual="taupe-2026"] body .erp-main .baruk-kanban__top-scroll {
  display: block !important;
  width: 100% !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
}

html[data-baruk-visual="taupe-2026"] body .erp-main .baruk-kanban__top-scroll:not(.is-scrollable) {
  visibility: hidden !important;
  height: 0 !important;
}

html[data-baruk-visual="taupe-2026"] body .erp-main .baruk-kanban__top-scroll-track {
  display: block !important;
  height: 1px !important;
}

html[data-baruk-visual="taupe-2026"] body .erp-main .baruk-kanban__card[hidden] {
  display: none !important;
}

html[data-baruk-visual="taupe-2026"] body .erp-main .baruk-kanban__column {
  display: block !important;
  flex: 0 0 176px !important;
  width: 176px !important;
  min-width: 176px !important;
  max-width: 176px !important;
  min-height: 210px !important;
  overflow: hidden !important;
}

html[data-baruk-visual="taupe-2026"] body .erp-main .baruk-kanban.has-focus .baruk-kanban__column {
  overflow: visible !important;
}

html[data-baruk-visual="taupe-2026"] body .erp-main .baruk-kanban__column.is-active {
  flex-basis: clamp(620px, 52vw, 700px) !important;
  width: clamp(620px, 52vw, 700px) !important;
  min-width: clamp(620px, 52vw, 700px) !important;
  max-width: clamp(620px, 52vw, 700px) !important;
}

html[data-baruk-visual="taupe-2026"] body .erp-main .baruk-kanban__column-head {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  width: 100% !important;
  min-width: 0 !important;
  min-height: 45px !important;
  padding: 11px 12px 9px !important;
  border-width: 0 !important;
  background: transparent !important;
  text-align: left !important;
}

html[data-baruk-visual="taupe-2026"] body .erp-main .baruk-kanban__column-head span {
  display: block !important;
  min-width: 0 !important;
  overflow: hidden !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  line-height: 1.25 !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

html[data-baruk-visual="taupe-2026"] body .erp-main .baruk-kanban__column-description {
  display: none !important;
}

html[data-baruk-visual="taupe-2026"] body .erp-main .baruk-kanban__column.is-active .baruk-kanban__column-description {
  display: block !important;
}

html[data-baruk-visual="taupe-2026"] body .erp-main .baruk-kanban__cards {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  gap: 8px !important;
  width: 100% !important;
  min-width: 0 !important;
  padding: 0 7px 8px !important;
}

html[data-baruk-visual="taupe-2026"] body .erp-main .baruk-kanban__card:not(.is-expanded) {
  display: block !important;
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  overflow: hidden !important;
}

html[data-baruk-visual="taupe-2026"] body .erp-main .baruk-kanban__card:not(.is-expanded) > .baruk-kanban__card-head {
  display: grid !important;
  grid-template-columns: 34px minmax(0, 1fr) auto !important;
  grid-template-areas: none !important;
  align-items: center !important;
  gap: 9px !important;
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  min-height: 58px !important;
  padding: 9px 10px !important;
  border-width: 0 !important;
  background: #ffffff !important;
  text-align: left !important;
  transform: none !important;
}

html[data-baruk-visual="taupe-2026"] body .erp-main .baruk-kanban__card:not(.is-expanded) .baruk-kanban__origin {
  display: grid !important;
  place-items: center !important;
  flex: none !important;
  width: 32px !important;
  height: 32px !important;
  min-width: 32px !important;
  font-size: 14px !important;
  font-weight: 700 !important;
  line-height: 1 !important;
}

html[data-baruk-visual="taupe-2026"] body .erp-main .baruk-kanban__card:not(.is-expanded) .baruk-kanban__identity {
  display: block !important;
  min-width: 0 !important;
  max-width: 100% !important;
  overflow: hidden !important;
}

html[data-baruk-visual="taupe-2026"] body .erp-main .baruk-kanban__card:not(.is-expanded) .baruk-kanban__identity strong,
html[data-baruk-visual="taupe-2026"] body .erp-main .baruk-kanban__card:not(.is-expanded) .baruk-kanban__identity small {
  display: block !important;
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

html[data-baruk-visual="taupe-2026"] body .erp-main .baruk-kanban__card:not(.is-expanded) .baruk-kanban__identity strong {
  font-size: 13px !important;
  font-weight: 700 !important;
  line-height: 1.25 !important;
}

html[data-baruk-visual="taupe-2026"] body .erp-main .baruk-kanban__card:not(.is-expanded) .baruk-kanban__identity small {
  margin-top: 3px !important;
  font-size: 11px !important;
  line-height: 1.2 !important;
}

html[data-baruk-visual="taupe-2026"] body .erp-main .baruk-kanban__card:not(.is-expanded) .baruk-kanban__compact {
  display: flex !important;
  align-items: center !important;
  gap: 7px !important;
  min-width: 0 !important;
  max-width: 100% !important;
  overflow: hidden !important;
}

html[data-baruk-visual="taupe-2026"] body .erp-main .baruk-kanban__card:not(.is-expanded) .baruk-kanban__status {
  display: inline-flex !important;
  flex: 0 1 auto !important;
  align-items: center !important;
  max-width: 170px !important;
  min-width: 0 !important;
  min-height: 24px !important;
  padding: 4px 8px !important;
  overflow: hidden !important;
  font-size: 10px !important;
  font-weight: 700 !important;
  line-height: 1.2 !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

/* Contrato visual da coluna compacta. */
html[data-baruk-visual="taupe-2026"] body .erp-main .baruk-kanban__column:not(.is-active) .baruk-kanban__card:not(.is-expanded) > .baruk-kanban__card-head {
  grid-template-columns: 30px minmax(0, 1fr) !important;
  grid-template-areas:
    "origin identity"
    "origin compact" !important;
  column-gap: 7px !important;
  row-gap: 4px !important;
  min-height: 64px !important;
  padding: 8px !important;
}

html[data-baruk-visual="taupe-2026"] body .erp-main .baruk-kanban__column:not(.is-active) .baruk-kanban__card:not(.is-expanded) .baruk-kanban__origin {
  grid-area: origin !important;
  align-self: center !important;
  width: 28px !important;
  height: 28px !important;
  min-width: 28px !important;
  font-size: 12px !important;
}

html[data-baruk-visual="taupe-2026"] body .erp-main .baruk-kanban__column:not(.is-active) .baruk-kanban__card:not(.is-expanded) .baruk-kanban__identity {
  grid-area: identity !important;
}

html[data-baruk-visual="taupe-2026"] body .erp-main .baruk-kanban__column:not(.is-active) .baruk-kanban__card:not(.is-expanded) .baruk-kanban__identity strong {
  font-size: 12px !important;
  line-height: 1.25 !important;
  white-space: nowrap !important;
}

html[data-baruk-visual="taupe-2026"] body .erp-main .baruk-kanban__column:not(.is-active) .baruk-kanban__card:not(.is-expanded) .baruk-kanban__identity small {
  display: none !important;
}

html[data-baruk-visual="taupe-2026"] body .erp-main .baruk-kanban__column:not(.is-active) .baruk-kanban__card:not(.is-expanded) .baruk-kanban__compact {
  grid-area: compact !important;
  justify-content: flex-start !important;
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  gap: 4px !important;
}

html[data-baruk-visual="taupe-2026"] body .erp-main .baruk-kanban__column:not(.is-active) .baruk-kanban__card:not(.is-expanded) .baruk-kanban__status {
  flex: 0 1 auto !important;
  max-width: calc(100% - 13px) !important;
  min-width: 0 !important;
  min-height: 20px !important;
  padding: 3px 6px !important;
  font-size: 9px !important;
  line-height: 1.15 !important;
  white-space: nowrap !important;
}

html[data-baruk-visual="taupe-2026"] body .erp-main .baruk-kanban__column:not(.is-active) .baruk-kanban__card:not(.is-expanded) .baruk-kanban__compact i {
  flex: 0 0 7px !important;
  width: 7px !important;
  height: 7px !important;
}

html[data-baruk-visual="taupe-2026"] body .erp-main .baruk-kanban__search-control {
  border: 1px solid rgba(122, 140, 151, 0.28) !important;
  border-radius: 15px !important;
  background: rgba(255, 255, 255, 0.94) !important;
  box-shadow: 0 6px 18px rgba(29, 45, 58, 0.055) !important;
}

html[data-baruk-visual="taupe-2026"] body .erp-main .baruk-kanban__search-control:focus-within {
  border-color: rgba(137, 125, 118, 0.5) !important;
  box-shadow: 0 0 0 3px rgba(137, 125, 118, 0.08), 0 8px 22px rgba(29, 45, 58, 0.07) !important;
}

html[data-baruk-visual="taupe-2026"] body .erp-main .baruk-kanban__search-control input {
  border: 0 !important;
  outline: 0 !important;
  box-shadow: none !important;
  background: transparent !important;
  text-align: center !important;
}

/* A camada global pode estilizar buttons; os controles do Kanban mantêm dimensões próprias. */
html[data-baruk-visual="taupe-2026"] body .erp-main .baruk-kanban button {
  font-family: inherit !important;
  letter-spacing: normal !important;
  text-transform: none !important;
}

@media (max-width: 900px) {
  html[data-baruk-visual="taupe-2026"] body .erp-main .baruk-kanban__column {
    flex-basis: 148px !important;
    width: 148px !important;
    min-width: 148px !important;
    max-width: 148px !important;
  }

  html[data-baruk-visual="taupe-2026"] body .erp-main .baruk-kanban__column.is-active {
    flex-basis: min(560px, calc(100vw - 48px)) !important;
    width: min(560px, calc(100vw - 48px)) !important;
    min-width: min(560px, calc(100vw - 48px)) !important;
    max-width: min(560px, calc(100vw - 48px)) !important;
  }
}

@media (max-width: 560px) {
  html[data-baruk-visual="taupe-2026"] body .erp-main .baruk-kanban__column.is-active {
    flex-basis: calc(100vw - 34px) !important;
    width: calc(100vw - 34px) !important;
    min-width: calc(100vw - 34px) !important;
    max-width: calc(100vw - 34px) !important;
  }
}

