:root {
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --bg: #f8fafc;
  --card-bg: #ffffff;
  --text: #0f172a;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --radius: 12px;
  --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --glass: rgba(255, 255, 255, 0.7);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.5;
  padding: 2rem;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
}

h1 {
  font-size: 2.5rem;
  font-weight: 800;
  margin-bottom: 2rem;
  letter-spacing: -0.025em;
  color: var(--text);
}

.day-section {
  margin-bottom: 3rem;
}

.day-header {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 2rem;
  padding: 1.5rem;
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.filters-bar {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-bottom: 2.5rem;
  padding: 1.5rem;
  background: var(--card-bg);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.filter-label {
  font-weight: 600;
  color: var(--text-muted);
  min-width: 120px;
}

.btn-group {
  display: flex;
  gap: 0.5rem;
}

.main-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.page-title {
  margin-bottom: 0;
  flex: 1;
  min-width: 250px;
}

.header-badge {
  background: white;
  color: var(--primary);
  border: 1px solid var(--primary);
  padding: 0.5rem 1rem;
  border-radius: 8px;
}

.badge-content {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

@media (max-width: 640px) {
  .main-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .badge-content {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
  }

  .badge-text {
    font-size: 0.75rem;
  }
}

.date-filter-row {
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
}

.quick-dates {
  display: flex;
  gap: 0.5rem;
}

.scroll-container {
  overflow-x: auto;
  padding-bottom: 0.5rem;
  width: 100%;
  -webkit-overflow-scrolling: touch;
}

.scroll-container .btn-group {
  display: inline-flex;
  min-width: max-content;
}

.filter-btn {
  padding: 0.5rem 1.25rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: white;
  color: var(--text);
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s;
  font-size: 0.875rem;
  white-space: nowrap;
}

.filter-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.filter-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

.date-select {
  padding: 0.5rem 1rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: white;
  font-family: inherit;
  font-size: 0.875rem;
  color: var(--text);
  min-width: 200px;
}

.cooking-center-group {
  margin-bottom: 2rem;
}

.cooking-center-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.orders-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

.order-card {
  background: white;
  border-radius: 8px;
  box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s;
  height: fit-content;
}

.order-card:hover {
  transform: translateY(-4px);
}

.order-header {
  padding: 1rem;
  background-color: var(--store-color, var(--primary));
  color: white;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  min-height: 80px;
}

.header-left {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.order-id {
  font-size: 1.25rem;
  font-weight: 800;
  line-height: 1;
}

.store-name {
  font-size: 0.875rem;
  font-weight: 600;
  opacity: 0.95;
}

.order-time {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1;
}

.order-body {
  padding: 1rem;
  background: white;
}

.order-items {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.order-item {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.item-qty {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text);
  min-width: 1.5rem;
}

.item-details {
  flex: 1;
}

.item-name {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.125rem;
}

.item-extra {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.badge {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--bg);
  border: 1px solid var(--border);
}

.status-badge {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.2);
  padding: 0.125rem 0.375rem;
  border-radius: 4px;
  width: fit-content;
}

.status-action-btn {
  margin-top: 1.5rem;
  width: 100%;
  padding: 0.75rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: #f8fafc;
  color: var(--text);
  font-weight: 600;
  font-size: 0.8125rem;
  cursor: pointer;
  transition: all 0.2s;
}

.status-action-btn:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

.status-in_delivery .order-header {
  background-color: #10b981;
  /* Green for delivery */
}

@keyframes highlight-new {
  0% {
    background-color: rgba(37, 99, 235, 0.4);
    transform: scale(1.03);
  }

  2%,
  6%,
  10%,
  14%,
  18% {
    transform: scale(1.03) translateX(-3px);
  }

  4%,
  8%,
  12%,
  16%,
  20% {
    transform: scale(1.03) translateX(3px);
  }

  25% {
    background-color: rgba(37, 99, 235, 0.3);
    transform: scale(1.02);
  }

  100% {
    background-color: transparent;
    transform: scale(1);
  }
}

.order-card.new-order {
  animation: highlight-new 10s cubic-bezier(0.4, 0, 0.2, 1);
  border: 2px solid var(--store-color, var(--primary));
}