/* Rastreio de pedidos — Kanban */

.pcp-page {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - var(--mp-topbar-h, 64px));
  padding-bottom: 16px;
}

.pcp-subtitle {
  margin: 2px 0 0;
  font-size: .82rem;
  color: var(--mp-text-muted, #64748b);
  font-weight: 500;
}

.pcp-section {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.pcp-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 14px;
}

.pcp-scan-wrap,
.pcp-search-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--mp-surface, #fff);
  border: 1px solid var(--mp-border, #e2e8f0);
  border-radius: 10px;
  padding: 0 12px;
  min-height: 42px;
}

.pcp-setor {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 12rem;
}

.pcp-setor > span {
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--mp-text-muted, #64748b);
}

.pcp-setor strong {
  min-height: 42px;
  display: flex;
  align-items: center;
  padding: 0 12px;
  border: 1px solid var(--mp-brand, #E63946);
  border-radius: 10px;
  background: var(--mp-surface, #fff);
  color: var(--mp-text, #0f172a);
  font-size: .92rem;
}

.pcp-setor-hint {
  margin: 0;
  min-height: 42px;
  display: flex;
  align-items: center;
  padding: 8px 12px;
  border: 1px dashed var(--mp-border-strong, #cbd5e1);
  border-radius: 10px;
  background: var(--mp-surface, #fff);
  color: var(--mp-text-2, #334155);
  font-size: .82rem;
  font-weight: 600;
  max-width: 16rem;
}

.pcp-setor-hint[hidden] {
  display: none;
}

.pcp-destino-txt {
  margin: 0 0 14px;
  color: var(--mp-text-2, #334155);
}

.pcp-destino-dialog {
  width: min(420px, 100%);
}

.pcp-destino-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}

.pcp-destino-grid button {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 84px;
  border: 1px solid var(--mp-border, #e2e8f0);
  background: var(--mp-surface, #fff);
  border-radius: 12px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  color: var(--mp-text, #0f172a);
}

.pcp-destino-grid button i {
  color: var(--mp-brand, #E63946);
  font-size: 1.15rem;
}

.pcp-destino-grid button:hover {
  border-color: var(--mp-brand, #E63946);
  background: var(--mp-brand-soft, rgba(230, 57, 70, .1));
}

.pcp-col.is-mine {
  border-color: var(--mp-brand, #E63946);
}

.pcp-scan-wrap {
  flex: 1 1 280px;
  border-color: var(--mp-brand, #E63946);
}

.pcp-search-wrap {
  flex: 0 1 220px;
}

.pcp-scan-wrap i,
.pcp-search-wrap i {
  color: var(--mp-text-muted, #64748b);
}

.pcp-scan-wrap input,
.pcp-search-wrap input {
  border: 0;
  outline: none;
  width: 100%;
  min-width: 0;
  background: transparent;
  font: inherit;
  color: var(--mp-text, #0f172a);
}

.pcp-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--mp-border, #e2e8f0);
  background: var(--mp-surface, #fff);
  color: var(--mp-text, #0f172a);
  border-radius: 10px;
  padding: 9px 14px;
  font-weight: 700;
  cursor: pointer;
}

.pcp-btn-primary {
  background: var(--mp-brand, #E63946);
  border-color: var(--mp-brand, #E63946);
  color: #fff;
}

.pcp-btn-primary:disabled {
  opacity: .55;
  cursor: not-allowed;
}

.pcp-kpis {
  display: flex;
  gap: 8px;
  margin-left: auto;
  flex-wrap: wrap;
}

.pcp-kpi {
  background: var(--mp-surface, #fff);
  border: 1px solid var(--mp-border, #e2e8f0);
  border-radius: 10px;
  padding: 6px 12px;
  font-size: .78rem;
  color: var(--mp-text-muted, #64748b);
}

.pcp-kpi strong {
  display: block;
  color: var(--mp-text, #0f172a);
  font-size: 1rem;
}

.pcp-kpi.is-warn strong {
  color: var(--mp-status-warning, #D97706);
}

.pcp-flash {
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 10px;
  font-weight: 600;
}

.pcp-flash.is-ok {
  background: var(--mp-status-success-bg, #ECFDF5);
  color: var(--mp-status-success, #059669);
}

.pcp-flash.is-err {
  background: var(--mp-status-danger-bg, #FEF2F2);
  color: var(--mp-status-danger, #DC2626);
}

.pcp-board {
  display: grid;
  grid-template-columns: repeat(5, minmax(200px, 1fr));
  gap: 14px;
  align-items: stretch;
  overflow-x: auto;
  padding-bottom: 8px;
}

.pcp-col {
  background: var(--mp-surface, #fff);
  border: 1px solid var(--mp-border, #e2e8f0);
  border-radius: 16px;
  min-height: 360px;
  max-height: calc(100vh - 230px);
  display: flex;
  flex-direction: column;
}

.pcp-col__head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 14px 10px;
  font-weight: 800;
  font-size: .95rem;
}

.pcp-col__head i {
  color: var(--mp-text-muted, #64748b);
  width: 1.1em;
  text-align: center;
}

.pcp-col__head span:first-of-type {
  flex: 1;
}

.pcp-col__count {
  background: var(--mp-surface-2, #F8FAFC);
  border-radius: 999px;
  min-width: 26px;
  height: 24px;
  padding: 0 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: .75rem;
  font-weight: 800;
  color: var(--mp-text-muted, #64748b);
}

.pcp-col.is-mine .pcp-col__count,
.pcp-col__count.is-hot {
  background: var(--mp-brand, #E63946);
  color: #fff;
}

.pcp-col__list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 0 12px 12px;
  flex: 1;
  overflow-y: auto;
}

.pcp-card {
  background: var(--mp-surface, #fff);
  border: 1px solid var(--mp-border, #e2e8f0);
  border-radius: 14px;
  padding: 12px;
  text-align: left;
  width: 100%;
  color: inherit;
  font: inherit;
  cursor: pointer;
  position: relative;
}

.pcp-card:hover {
  border-color: var(--mp-brand, #E63946);
}

.pcp-card.is-parado {
  border-color: var(--mp-status-warning, #D97706);
  background: var(--mp-status-warning-bg, #FFFBEB);
}

.pcp-card__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.pcp-card__num {
  font-weight: 800;
  font-size: 1.08rem;
}

.pcp-card__menu {
  border: 0;
  background: transparent;
  color: var(--mp-text-muted, #64748b);
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 6px;
}

.pcp-card__menu:hover,
.pcp-card__menu[aria-expanded="true"] {
  color: var(--mp-brand, #E63946);
  background: var(--mp-brand-soft, rgba(230, 57, 70, .1));
}

.pcp-card__pac {
  color: var(--mp-text-2, #334155);
  font-size: .86rem;
  margin-top: 4px;
}

.pcp-card__qr {
  width: 56px;
  height: 56px;
  object-fit: contain;
  background: #fff;
  border-radius: 6px;
  margin-top: 10px;
}

.pcp-card__meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  font-size: .72rem;
  color: var(--mp-text-muted, #64748b);
}

.pcp-card__meta i {
  margin-right: 4px;
}

.pcp-card__actions {
  display: flex;
  gap: 6px;
  margin-top: 10px;
}

.pcp-card__actions .pcp-btn {
  flex: 1;
  justify-content: center;
  padding: 7px 8px;
  font-size: .78rem;
}

.pcp-empty {
  color: var(--mp-text-muted, #64748b);
  font-size: .84rem;
  padding: 36px 12px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  flex: 1;
  justify-content: center;
}

.pcp-empty i {
  font-size: 1.4rem;
  color: var(--mp-text-faint, #94A3B8);
}

.pcp-empty small {
  font-size: .78rem;
  color: var(--mp-text-faint, #94A3B8);
}

.pcp-more {
  border: 0;
  background: transparent;
  color: var(--mp-brand, #E63946);
  font-weight: 800;
  cursor: pointer;
  padding: 6px;
  font-size: .82rem;
}

.pcp-pop {
  position: fixed;
  z-index: 85;
  min-width: 200px;
  background: var(--mp-surface, #fff);
  border: 1px solid var(--mp-border, #e2e8f0);
  border-radius: 12px;
  box-shadow: var(--mp-shadow-md, 0 8px 24px rgba(15, 23, 42, .08));
  padding: 6px;
}

.pcp-pop[hidden] {
  display: none !important;
}

.pcp-pop button {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  padding: 8px 10px;
  border-radius: 8px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  color: var(--mp-text, #0f172a);
}

.pcp-pop button:hover {
  background: var(--mp-surface-2, #F8FAFC);
}

.pcp-arquivo {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pcp-arq-row {
  display: grid;
  grid-template-columns: 7rem 1fr 8rem 9rem;
  gap: 10px;
  align-items: center;
  background: var(--mp-surface, #fff);
  border: 1px solid var(--mp-border, #e2e8f0);
  border-radius: 12px;
  padding: 10px 14px;
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: inherit;
}

.pcp-modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, .45);
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.pcp-modal[hidden],
.pcp-cam[hidden] {
  display: none !important;
}

.pcp-modal__dialog {
  background: var(--mp-surface, #fff);
  border-radius: 16px;
  width: min(760px, 100%);
  max-height: 90vh;
  overflow: auto;
}

.pcp-modal__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid var(--mp-border, #e2e8f0);
}

.pcp-modal__head h2 {
  margin: 0;
  font-size: 1.1rem;
}

.pcp-modal__close {
  border: 0;
  background: transparent;
  cursor: pointer;
  font-size: 1.1rem;
  color: var(--mp-text-muted, #64748b);
}

.pcp-modal__body {
  padding: 16px;
}

.pcp-modal__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pcp-modal__qr {
  display: block;
  margin: 0 auto 12px;
  width: 180px;
  height: 180px;
}

.pcp-jump {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 16px;
}

.pcp-jump a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--mp-border, #e2e8f0);
  color: var(--mp-text-2, #334155);
  text-decoration: none;
  font-size: .78rem;
  font-weight: 700;
}

.pcp-jump a:hover {
  border-color: var(--mp-brand, #E63946);
  color: var(--mp-brand, #E63946);
}

.pcp-hero {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 14px;
  align-items: center;
  margin: 0 0 16px;
}

.pcp-hero img {
  width: 88px;
  height: 88px;
  object-fit: contain;
  background: #fff;
  border: 1px solid var(--mp-border, #e2e8f0);
  border-radius: 12px;
}

.pcp-hero p {
  margin: 4px 0 0;
  color: var(--mp-text-muted, #64748b);
  font-size: .84rem;
}

.pcp-h3 {
  margin: 0 0 8px;
  font-size: .95rem;
  scroll-margin-top: 12px;
}

.pcp-dl {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 16px;
  margin: 0 0 18px;
}

.pcp-dl div span {
  display: block;
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--mp-text-muted, #64748b);
}

.pcp-dl div strong {
  font-size: .92rem;
  font-weight: 600;
}

.pcp-totais {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 0 0 18px;
}

.pcp-totais div {
  background: var(--mp-surface-2, #F8FAFC);
  border: 1px solid var(--mp-border, #e2e8f0);
  border-radius: 12px;
  padding: 10px 12px;
}

.pcp-totais div span {
  display: block;
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--mp-text-muted, #64748b);
}

.pcp-totais div strong {
  font-size: 1rem;
}

.pcp-totais .is-main {
  background: var(--mp-brand-soft, rgba(230, 57, 70, .1));
  border-color: var(--mp-brand, #E63946);
}

.pcp-totais .is-main strong {
  color: var(--mp-brand, #E63946);
}

.pcp-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .82rem;
  margin: 0 0 18px;
}

.pcp-table th {
  text-align: left;
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--mp-text-muted, #64748b);
  border-bottom: 1px solid var(--mp-border, #e2e8f0);
  padding: 6px 8px;
}

.pcp-table td {
  border-bottom: 1px solid var(--mp-border, #e2e8f0);
  padding: 7px 8px;
  vertical-align: top;
}

.pcp-table .num {
  text-align: right;
  white-space: nowrap;
}

.pcp-hist {
  list-style: none;
  margin: 14px 0 0;
  padding: 0;
  border-top: 1px solid var(--mp-border, #e2e8f0);
}

.pcp-hist li {
  padding: 8px 0;
  font-size: .84rem;
  border-bottom: 1px solid var(--mp-border, #e2e8f0);
}

.pcp-cam {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, .7);
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.pcp-cam__box {
  background: #fff;
  border-radius: 16px;
  padding: 16px;
  width: min(420px, 100%);
  text-align: center;
}

#pcpCamReader {
  min-height: 240px;
}

@media (max-width: 1100px) {
  .pcp-board {
    grid-template-columns: repeat(5, minmax(200px, 1fr));
  }
}

@media (max-width: 720px) {
  .pcp-kpis { margin-left: 0; width: 100%; }
  .pcp-arq-row { grid-template-columns: 1fr 1fr; }
  .pcp-dl,
  .pcp-totais,
  .pcp-hero { grid-template-columns: 1fr; }
}
