:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f3f5fb;
  color: #101427;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(91, 91, 245, 0.12), transparent 28rem),
    linear-gradient(180deg, #fbfbff 0%, #f3f4fb 100%);
}

button,
input,
select {
  font: inherit;
}

h1,
h2,
h3,
p {
  margin: 0;
}

.dispatch-shell {
  width: min(1280px, 100%);
  margin: 0 auto;
  padding: 18px 24px 34px;
}

.dispatch-topbar,
.ops-hero,
.priority-card,
.logistic-card,
.dispatch-panel {
  border: 1px solid #e1e5f0;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 14px 30px rgba(23, 31, 56, 0.07);
}

.dispatch-topbar {
  min-height: 66px;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 10px 16px;
  margin-bottom: 16px;
}

.brand-line {
  min-width: 250px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-line img {
  width: 44px;
  height: 44px;
  border-radius: 9px;
  object-fit: cover;
}

.brand-line span,
.eyebrow {
  color: #5d6478;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.brand-line h1 {
  margin-top: 2px;
  font-size: 24px;
}

.dispatch-nav {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
}

.dispatch-nav a,
.dispatch-nav strong {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  border-radius: 8px;
  padding: 0 12px;
  color: #566176;
  text-decoration: none;
  font-weight: 500;
}

.dispatch-nav strong {
  background: #f0efff;
  color: #5b5bf5;
  font-weight: 600;
}

.refresh-button {
  min-height: 38px;
  border: 1px solid #dce1ea;
  border-radius: 8px;
  padding: 0 16px;
  background: #fff;
  color: #101427;
  font-weight: 950;
  cursor: pointer;
}

.ops-hero {
  min-height: 150px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  padding: 24px 28px;
  background: linear-gradient(135deg, #5b5bf5 0%, #6b4ff7 52%, #2fc9b5 100%);
  color: #fff;
}

.ops-hero .eyebrow,
.ops-hero span {
  color: rgba(255, 255, 255, 0.78);
}

.ops-hero h2 {
  margin: 4px 0 8px;
  font-size: clamp(30px, 4vw, 48px);
}

.hero-total {
  min-width: 190px;
  padding: 16px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.16);
}

.hero-total span,
.hero-total strong {
  display: block;
  color: #fff;
}

.hero-total strong {
  margin-top: 4px;
  font-size: 48px;
  line-height: 1;
}

.priority-grid,
.logistics-grid {
  display: grid;
  gap: 14px;
  margin-top: 16px;
}

.priority-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.logistics-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.priority-card,
.logistic-card {
  min-height: 128px;
  padding: 18px;
}

.priority-card span,
.priority-card small,
.logistic-card span {
  display: block;
  color: #5b6479;
  font-weight: 900;
}

.priority-card strong {
  display: block;
  margin: 8px 0 4px;
  font-size: 40px;
  line-height: 1;
}

.priority-card.danger strong {
  color: #f04438;
}

.priority-card.today strong,
.logistic-card.flex strong {
  color: #08b86f;
}

.priority-card.next strong,
.logistic-card.places strong {
  color: #5b5bf5;
}

.logistic-card.correios strong {
  color: #f2a900;
}

.logistic-card header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.logistic-card strong {
  font-size: 38px;
}

.breakdown {
  display: grid;
  gap: 6px;
  margin-top: 12px;
}

.breakdown p {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 0;
  border-top: 1px solid #edf0f6;
}

.breakdown strong {
  font-size: 14px;
  color: #20283b !important;
}

.dispatch-panel {
  margin-top: 16px;
  overflow: hidden;
}

.panel-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  padding: 18px;
  border-bottom: 1px solid #e5e9f1;
}

.panel-header h2 {
  margin-top: 4px;
}

.filters {
  display: flex;
  align-items: end;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.filters label span {
  display: block;
  margin-bottom: 5px;
  color: #5b6479;
  font-size: 12px;
  font-weight: 900;
}

.filters input,
.filters select {
  height: 40px;
  border: 1px solid #dce1ea;
  border-radius: 8px;
  padding: 0 12px;
  background: #f9fafc;
}

.filters input {
  min-width: 260px;
}

.dispatch-table-wrap {
  overflow: auto;
}

table {
  width: 100%;
  min-width: 1080px;
  border-collapse: collapse;
  font-size: 13px;
}

th,
td {
  padding: 10px 12px;
  border-bottom: 1px solid #d6dce6;
  text-align: left;
  vertical-align: middle;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #fff;
  color: #5b6479;
  font-weight: 950;
}

tr:nth-child(even) td {
  background: #f6f8fb;
}

.product-cell {
  max-width: 340px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.product-photo,
.empty-photo {
  width: 44px;
  height: 44px;
  display: inline-block;
  border-radius: 8px;
  object-fit: cover;
  background: #eef2f6;
}

.status-pill,
.logistic-pill {
  min-width: 86px;
  display: inline-flex;
  justify-content: center;
  border-radius: 999px;
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 950;
}

.status-pill.ATRASADO {
  background: #fff1ef;
  color: #d92d20;
}

.status-pill.HOJE {
  background: rgba(8, 217, 124, 0.13);
  color: #04764a;
}

.status-pill.PROXIMO_DIA,
.status-pill.ABERTO {
  background: #eef2f6;
  color: #536078;
}

.logistic-pill.FLEX {
  background: rgba(8, 217, 124, 0.13);
  color: #04764a;
}

.logistic-pill.PLACES {
  background: #ecebff;
  color: #5b5bf5;
}

.logistic-pill.CORREIOS {
  background: #fff7df;
  color: #9a6a00;
}

@media (max-width: 980px) {
  .dispatch-topbar,
  .ops-hero,
  .panel-header {
    align-items: stretch;
    flex-direction: column;
  }

  .priority-grid,
  .logistics-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .dispatch-shell {
    padding: 14px;
  }

  .priority-grid,
  .logistics-grid {
    grid-template-columns: 1fr;
  }

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

  .filters input {
    min-width: 0;
  }
}
