/* Orders page filters, list, and cards extracted from index.html */

.orders-filters {
  background: var(--surface);
  padding: 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  align-items: center;
  min-height: 60px;
  position: relative;
  z-index: 50;
  box-shadow: var(--shadow-sm);
}

.orders-filters::-webkit-scrollbar {
  display: none;
}

.filter-chip {
  background: var(--border-light);
  color: var(--text-secondary);
  border: none;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  flex-shrink: 0;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 60px;
  margin: 0;
}

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

.filter-chip:active {
  transform: scale(0.95);
}

.orders-summary {
  background: var(--surface);
  padding: 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.orders-count {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

.sort-btn {
  background: none;
  border: 1px solid var(--border);
  padding: 8px 12px;
  border-radius: 8px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
}

.sort-btn:active {
  background: var(--border-light);
}


.orders-list {
  flex: 1;
  overflow-y: visible;
  padding: 16px;
  padding-bottom: 100px;
}

.order-card {
  background: var(--surface);
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 8px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: all 0.2s ease;
}

.order-card:active {
  transform: scale(0.98);
  box-shadow: var(--shadow);
}

.order-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.order-metric {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  text-align: right;
  min-width: 50px;
  gap: 0;
}

.metric-label {
  font-size: 10px;
  color: var(--text-tertiary);
  text-transform: uppercase;
  font-weight: 500;
  margin-bottom: 2px;
}

.metric-value {
  font-size: 12px;
  font-weight: 500;
  line-height: 1.2;
  border-radius: 4px;
  padding: 2px 6px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.metric-value[data-status='pending'],
.metric-value.is-pending {
  color: var(--text-tertiary);
  font-style: italic;
}

.metric-eta {
  background: rgba(59, 130, 246, 0.1);
  color: #60a5fa;
  border-color: rgba(59, 130, 246, 0.2);
}

.metric-offloading {
  background: rgba(16, 185, 129, 0.1);
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.2);
}

body.theme-light .metric-value {
  border: 1px solid rgba(148, 163, 184, 0.35);
  color: #0f172a;
}

body.theme-light .metric-eta {
  background: rgba(59, 130, 246, 0.14);
  color: #1d4ed8;
  border-color: rgba(59, 130, 246, 0.26);
}

body.theme-light .metric-offloading {
  background: rgba(16, 185, 129, 0.14);
  color: #047857;
  border-color: rgba(16, 185, 129, 0.26);
}

.metric-pfi {
  background: rgba(245, 158, 11, 0.1);
  color: #fbbf24;
  border-color: rgba(245, 158, 11, 0.2);
}

.metric-acconage {
  background: rgba(59, 130, 246, 0.1);
  color: #60a5fa;
  border-color: rgba(59, 130, 246, 0.2);
}

.metric-urgent {
  background: rgba(239, 68, 68, 0.1);
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.2);
}

.order-number {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum' 1;
}

.order-main-info {
  margin-bottom: 12px;
}

.order-supplier {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 2px;
  font-weight: 500;
}

.order-reference {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-top: 2px;
  margin-bottom: 2px;
}

.order-date {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-top: 4px;
}

.order-quick-info {
  display: flex;
  gap: 12px;
  padding: 8px 0;
  border-top: 1px solid var(--border-light);
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 8px;
}

.quick-detail {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  gap: 2px;
}

.quick-label {
  font-size: 10px;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 500;
}

.quick-value {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum' 1;
}

.quick-value.highlight {
  color: var(--primary);
  font-size: 14px;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.status-ordered {
  background: #fef3c7;
  color: #d97706;
}

.status-shipped {
  background: #dbeafe;
  color: #1d4ed8;
}

.status-pending {
  background: #fef3c7;
  color: #d97706;
}

.status-processing {
  background: #e0e7ff;
  color: #6366f1;
}

.status-delivered {
  background: #d1fae5;
  color: #059669;
}

.status-validate {
  background: #e0e7ff;
  color: #6366f1;
}

.status-livraison {
  background: #dbeafe;
  color: #1d4ed8;
}

.status-urgent {
  background: #fee2e2;
  color: #dc2626;
}

.ordered-stage .order-details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding-top: 12px;
  border-top: none;
}

.ordered-stage:not(.expanded) .order-details {
  display: none;
}

.ordered-stage.expanded .order-details {
  display: grid;
}

.order-details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border-light);
  font-size: 13px;
  color: var(--text-secondary);
}

.detail-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.detail-label {
  font-size: 11px;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 500;
}

.detail-value {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  word-wrap: break-word;
  line-height: 1.4;
}

.detail-value.highlight {
  color: var(--primary);
  font-weight: 600;
}

.order-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  margin-top: 4px;
}

.expand-btn {
  background: none;
  border: none;
  color: var(--text-tertiary);
  cursor: pointer;
  padding: 2px;
  border-radius: 3px;
  transition: all 0.2s ease;
}

.expand-btn:active {
  background: var(--border-light);
}

.expand-btn svg {
  width: 14px;
  height: 14px;
}

.order-card:not(.expanded) .order-details {
  display: none;
}

.order-card.expanded .order-details {
  display: grid;
}
