@import url("https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=JetBrains+Mono:wght@500&display=swap");

:root {
  --background: 20 14.3% 4.1%;
  --foreground: 60 9.1% 97.8%;
  --card: 24 9.8% 10%;
  --card-foreground: 60 9.1% 97.8%;
  --primary: 20.5 90.2% 48.2%;
  --primary-foreground: 60 9.1% 97.8%;
  --secondary: 12 6.5% 15.1%;
  --secondary-foreground: 60 9.1% 97.8%;
  --muted: 12 6.5% 15.1%;
  --muted-foreground: 24 5.4% 63.9%;
  --accent: 12 6.5% 15.1%;
  --accent-foreground: 60 9.1% 97.8%;
  --border: 12 6.5% 15.1%;
  --input: 12 6.5% 15.1%;
  --ring: 20.5 90.2% 48.2%;
  --radius: 0.65rem;
}

* {
  box-sizing: border-box;
  border-color: hsl(var(--border));
}

body {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  color: hsl(var(--foreground));
  background: radial-gradient(circle at top, #141414 0%, #0d0d0d 55%, #090909 100%);
  min-height: 100vh;
}

body.ml-theme {
  --primary: 45 100% 50%;
  --primary-foreground: 33 20% 10%;
  --ring: 45 100% 50%;
}

.topbar {
  background: #0e0e0e;
  border-bottom: 1px solid #191919;
  padding: 14px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  letter-spacing: 0.4px;
}

.brand .dot {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #1a1a1a;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.brand .dot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.nav {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  align-items: center;
  color: hsl(var(--muted-foreground));
  font-weight: 500;
}

.nav a {
  color: inherit;
  text-decoration: none;
}

.nav a.active {
  color: hsl(var(--primary));
}

.global-alert {
  flex: 1;
  min-width: 220px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid #b13a2b;
  background: rgba(177, 58, 43, 0.18);
  color: #f2c3bd;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  text-align: center;
}

.global-alert.is-hidden {
  display: none;
}

.shell {
  max-width: 1180px;
  margin: 0 auto;
  padding: 28px;
}

.headline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

.headline h1 {
  margin: 0;
  font-size: clamp(26px, 3vw, 36px);
}

.title-with-logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.title-with-logo img {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #f9f7ef;
  padding: 4px;
  border: 1px solid #2a2a2a;
}

.headline p {
  margin: 6px 0 0;
  color: hsl(var(--muted-foreground));
}

.cta {
  background: transparent;
  border: 1px solid hsl(var(--border));
  color: hsl(var(--foreground));
  padding: 10px 16px;
  border-radius: 10px;
  font-weight: 600;
}

.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}

.panel {
  background: #151515;
  border: 1px solid #2a2a2a;
  border-radius: 18px;
  padding: 18px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
}

.panel-results {
  background: #151515;
}

.panel h2 {
  margin: 0 0 12px;
  font-size: 16px;
  color: hsl(var(--primary));
  display: flex;
  align-items: center;
  gap: 8px;
}

.search {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 12px;
}

.shopee-actions {
  flex-wrap: nowrap;
  align-items: center;
}

.shopee-actions .cta {
  white-space: nowrap;
}

.date-with-loader {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.progress-bar {
  position: relative;
  width: 120px;
  height: 12px;
  border-radius: 999px;
  background: #151515;
  border: 1px solid #262626;
  overflow: hidden;
}

.progress-fill {
  position: absolute;
  inset: 0;
  width: 0%;
  background: linear-gradient(90deg, hsl(var(--primary)), #f2c94c);
  transition: width 0.2s ease;
}

.progress-text {
  position: relative;
  z-index: 1;
  font-size: 9px;
  font-weight: 700;
  color: #0d0d0d;
  text-align: center;
  line-height: 12px;
}

.progress-bar.is-idle {
  opacity: 0.6;
}
.search input {
  flex: 1;
  min-width: 220px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid #262626;
  background: #141414;
  color: hsl(var(--foreground));
}

.search select {
  flex: 1;
  min-width: 220px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid #262626;
  background: #141414;
  color: hsl(var(--foreground));
}

.search select[multiple] {
  min-height: 120px;
}

.filter-block {
  flex: 1 1 260px;
  background: #111111;
  border: 1px solid #262626;
  border-radius: 12px;
  padding: 10px 12px;
  display: grid;
  gap: 8px;
  min-width: 240px;
}

.filter-title {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: hsl(var(--muted-foreground));
}

.filter-group {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.filter-group label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  justify-content: flex-start;
  color: hsl(var(--foreground));
}

.filter-group input[type="checkbox"] {
  accent-color: hsl(var(--primary));
  width: 16px;
  height: 16px;
}

.search button {
  padding: 12px 18px;
  border-radius: 12px;
  border: none;
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  font-weight: 600;
  cursor: pointer;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

th,
td {
  text-align: left;
  padding: 12px 10px;
  border-bottom: 1px solid hsl(var(--border));
}

th {
  text-transform: uppercase;
  letter-spacing: 1px;
  color: hsl(var(--muted-foreground));
  font-size: 11px;
}

tbody tr:hover {
  background: #1a1a1a;
}

.status {
  margin-top: 12px;
  background: #1a1a1a;
  color: hsl(var(--foreground));
  border-radius: 12px;
  padding: 12px 16px;
  font-size: 13px;
  border: 1px solid #2a2a2a;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 12px;
  border: 1px solid #1f1f1f;
  background: #101010;
  position: relative;
  padding-bottom: 8px;
  scrollbar-color: #3a3a3a #121212;
  scrollbar-width: thin;
}

.table-wrap table {
  min-width: 900px;
  width: 100%;
}

.table-wrap::-webkit-scrollbar {
  height: 10px;
}

.table-wrap::-webkit-scrollbar-track {
  background: #121212;
  border-radius: 999px;
}

.table-wrap::-webkit-scrollbar-thumb {
  background: #3a3a3a;
  border-radius: 999px;
}

.table-wrap::-webkit-scrollbar-thumb:hover {
  background: #4a4a4a;
}

.cards {
  display: none;
  gap: 12px;
}

.card {
  background: #1a1a1a;
  border: 1px solid #2a2a2a;
  border-radius: 14px;
  padding: 14px;
  display: grid;
  gap: 8px;
}

.card-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: hsl(var(--foreground));
}

.card-row span {
  color: hsl(var(--muted-foreground));
  text-transform: uppercase;
  letter-spacing: 0.4px;
  font-size: 11px;
}

.card-row strong {
  font-weight: 600;
}

.card.empty {
  color: hsl(var(--muted-foreground));
  text-align: center;
}

.pagination {
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.pagination button {
  padding: 10px 16px;
  border-radius: 10px;
  border: 1px solid #262626;
  background: #141414;
  color: hsl(var(--foreground));
  font-weight: 600;
  cursor: pointer;
}

.pagination button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.empty {
  text-align: center;
  color: hsl(var(--muted-foreground));
  padding: 18px 0;
}

.shipment-list {
  display: grid;
  gap: 12px;
}

.shipment-item {
  background: #1a1a1a;
  border: 1px solid #2a2a2a;
  border-radius: 14px;
  padding: 14px;
  display: grid;
  gap: 10px;
}

.shipment-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.shipment-title {
  font-weight: 600;
}

.shipment-sub {
  color: hsl(var(--muted-foreground));
  font-size: 12px;
}

.shipment-date {
  font-size: 12px;
  color: hsl(var(--primary));
  white-space: nowrap;
}

.shipment-items {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 6px;
}

.shipment-items li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-bottom: 1px dashed #262626;
  padding-bottom: 6px;
}

.shipment-items li:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.shipment-items span {
  flex: 1;
}

.shipment-items strong {
  font-weight: 600;
}

.shipment-items em {
  font-style: normal;
  color: hsl(var(--muted-foreground));
  font-size: 12px;
}

.store-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

@keyframes store-spin {
  to {
    transform: rotate(360deg);
  }
}

.store-card {
  background: #1a1a1a;
  border: 1px solid #2a2a2a;
  border-radius: 14px;
  padding: 14px;
  display: grid;
  gap: 12px;
}

.store-card-head {
  padding: 0;
  text-align: left;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: hsl(var(--foreground));
}

.store-card.is-loading {
  opacity: 0.7;
}

.store-refresh {
  background: transparent;
  border: 1px solid #262626;
  color: hsl(var(--foreground));
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.store-refresh svg {
  width: 18px;
  height: 18px;
}

.store-refresh:hover {
  border-color: hsl(var(--primary));
  color: hsl(var(--primary));
}

.store-card.is-open .store-card-head {
  color: hsl(var(--foreground));
}

.store-title {
  display: grid;
  gap: 2px;
}

.store-name {
  font-weight: 600;
}

.store-count {
  color: hsl(var(--primary));
  font-size: 12px;
}

.store-count.subtle {
  color: hsl(var(--muted-foreground));
}

.store-count.warn {
  color: #f2c94c;
}

.store-updated {
  color: hsl(var(--muted-foreground));
  font-size: 11px;
}

.code-bipado,
.shipment-title.is-bipado {
  color: #f2c94c;
}


.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 8px;
}

.legend-pending {
  background: #b13a2b;
}

.legend-bipados {
  background: #f2c94c;
}

.legend-collected {
  background: #1d8f4f;
}

.legend-stores {
  background: #3a3a3a;
}
.store-codes {
  color: hsl(var(--muted-foreground));
  font-size: 13px;
  word-break: break-word;
}

.store-card.is-open .store-codes {
  display: none;
}

.store-card {
  cursor: pointer;
}

.store-details-panel {
  margin-top: 14px;
  display: grid;
  gap: 12px;
  background: #1a1a1a;
  border: 1px solid #2a2a2a;
  border-radius: 14px;
  padding: 16px;
}

.store-details-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.store-details-list {
  display: grid;
  gap: 12px;
}

.refresh-timer {
  margin-top: 8px;
  color: hsl(var(--muted-foreground));
  font-size: 12px;
  text-align: center;
}

.lojas-layout {
  display: grid;
  grid-template-columns: minmax(220px, 320px) minmax(0, 1fr);
  gap: 16px;
  width: 100%;
}

.lojas-main {
  display: grid;
  gap: 16px;
}

.pie-panel {
  min-height: 320px;
  height: fit-content;
  align-self: start;
}

.pie-wrap {
  display: grid;
  gap: 16px;
  align-items: center;
  justify-items: center;
}

.pie {
  --pct: 0;
  --good: #1d8f4f;
  --warn: #f2c94c;
  --bad: #b13a2b;
  --pct-pending: 0;
  --pct-bipado: 0;
  --pct-collected: 0;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: conic-gradient(
    var(--bad) 0 calc(var(--pct-pending) * 1%),
    var(--warn) calc(var(--pct-pending) * 1%)
      calc((var(--pct-pending) + var(--pct-bipado)) * 1%),
    var(--good)
      calc((var(--pct-pending) + var(--pct-bipado)) * 1%)
      100%
  );
  display: grid;
  place-items: center;
  border: 1px solid #1f1f1f;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
}

.pie.is-complete {
  --bad: #1d8f4f;
  --warn: #1d8f4f;
}

.pie-center {
  width: 70%;
  height: 70%;
  border-radius: 50%;
  background: #0f0f0f;
  border: 1px solid #1f1f1f;
  display: grid;
  place-items: center;
  text-align: center;
  gap: 4px;
}

.pie-value {
  font-size: 28px;
  font-weight: 700;
}

.pie-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: hsl(var(--muted-foreground));
}

.pie-meta {
  width: 100%;
  display: grid;
  gap: 8px;
}

.pie-last {
  margin-top: 8px;
  font-size: 12px;
  color: hsl(var(--muted-foreground));
}

.pie-alert {
  width: 100%;
  margin-top: 6px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid #2a2a2a;
  background: #141414;
  color: hsl(var(--muted-foreground));
  font-size: 12px;
  text-align: center;
}

.pie-alert.is-alert {
  border-color: #b13a2b;
  background: rgba(177, 58, 43, 0.18);
  color: #f2c3bd;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  cursor: pointer;
}

.pie-alert.is-alert:hover {
  border-color: #f07b6e;
  color: #f7d6d2;
}

.shipment-title.is-overdue {
  color: #b13a2b;
}

.pie-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: hsl(var(--muted-foreground));
  font-size: 13px;
}

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

.store-grid.hide-others .store-card:not(.is-open) {
  display: none;
}

.store-details {
  display: grid;
  gap: 12px;
}


.bg-gradient-card {
  background: linear-gradient(
    to bottom right,
    hsl(var(--card)),
    hsl(var(--card) / 0.5)
  );
}

.totem-toast-gigante {
  position: fixed !important;
  top: 50% !important;
  left: 50% !important;
  transform: translate(-50%, -50%) !important;
  width: 90vw !important;
  max-width: 800px !important;
  padding: 50px !important;
  border-radius: 30px !important;
  box-shadow: 0 0 100px rgba(0, 0, 0, 0.9) !important;
  z-index: 99999 !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
  text-align: center !important;
}

.totem-toast-gigante [data-radix-toast-title] {
  font-size: 5rem !important;
  font-weight: 900 !important;
  line-height: 1 !important;
  margin-bottom: 24px !important;
  text-transform: uppercase !important;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.totem-toast-gigante [data-radix-toast-description] {
  font-size: 3rem !important;
  line-height: 1.2 !important;
  font-weight: 600 !important;
}

.totem-toast-gigante [data-radix-toast-close] {
  display: none !important;
}

@media (max-width: 760px) {
  .topbar {
    padding: 12px 16px;
  }

  .shell {
    padding: 20px 16px 32px;
  }

  .headline {
    flex-direction: column;
    align-items: flex-start;
  }

  .panel {
    padding: 14px;
  }

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

  .shopee-actions {
    flex-wrap: wrap;
  }

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

  .pagination button {
    width: 100%;
  }

  th,
  td {
    padding: 10px 8px;
  }

  .table-wrap {
    display: none;
  }

  .cards {
    display: grid;
  }

}

@media (max-width: 520px) {
  .topbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .nav {
    width: 100%;
  }
}
