/* Base Responsive Setup */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background: #f3f4f6;
  margin: 0;
  padding: 16px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Responsive Container */
.page-container {
  max-width: 1400px;
  margin: 0 auto;
}

/* Header */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.header-title h1 {
  margin: 0 0 8px 0;
  font-size: 24px;
  color: #111827;
}

.back-link {
  color: #6b7280;
  text-decoration: none;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 20px;
  color: #374151;
}

.notification {
  position: relative;
}

.badge {
  position: absolute;
  top: -8px;
  right: -8px;
  background: #ef4444;
  color: white;
  font-size: 12px;
  padding: 2px 6px;
  border-radius: 12px;
}

/* Order Info Card */
.order-info-card {
  background: white;
  border-radius: 12px;
  padding: 24px;
  display: flex;
  justify-content: space-between;
  margin-bottom: 24px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.info-item label {
  display: block;
  color: #6b7280;
  font-size: 14px;
  margin-bottom: 8px;
}

.info-item span {
  font-size: 16px;
  color: #111827;
  font-weight: 500;
}

/* Table Controls */
.table-controls {
  background: white;
  border-radius: 12px;
  padding: 16px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.entries-select {
  padding: 8px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  font-size: 14px;
  color: #374151;
}

.right-controls {
  display: flex;
  align-items: center;
  gap: 16px;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  color: #6b7280;
}

.search-box input {
  border: none;
  outline: none;
  font-size: 14px;
  width: 200px;
}

.export-buttons {
  display: flex;
  gap: 8px;
}

.btn-print,
.btn-excel,
.btn-pdf {
  padding: 8px 16px;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  color: white;
  cursor: pointer;
}

.btn-print {
  background: #0066ff;
}
.btn-excel {
  background: #059669;
}
.btn-pdf {
  background: #dc2626;
}

/* Table */
.table-container {
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  margin-bottom: 24px;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th {
  background: #f9fafb;
  padding: 12px 16px;
  text-align: left;
  font-weight: 500;
  color: #374151;
  font-size: 14px;
  border-bottom: 1px solid #e5e7eb;
}

.data-table td {
  padding: 12px 16px;
  font-size: 14px;
  color: #374151;
  border-bottom: 1px solid #e5e7eb;
}

/* Stack Displays */
.size-stack,
.color-stack,
.qty-stack {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.color-badge {
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
}

.color-badge.white {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
}
.color-badge.red {
  background: #fee2e2;
  color: #991b1b;
}
.color-badge.green {
  background: #d1fae5;
  color: #065f46;
}

/* Summary Section */
.summary-section {
  background: white;
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.summary-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

.summary-card {
  text-align: center;
}

.summary-card label {
  display: block;
  color: #6b7280;
  font-size: 14px;
  margin-bottom: 8px;
}

.summary-card span {
  font-size: 18px;
  font-weight: 500;
  color: #111827;
}

.summary-card .highlight {
  color: #0066ff;
}

.status-badge {
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 13px;
}

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

/* Action Buttons */
.action-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.btn-back,
.btn-cancel,
.btn-purchase {
  padding: 12px 24px;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.btn-back {
  background: #f3f4f6;
  color: #374151;
}

.btn-cancel {
  background: #ef4444;
  color: white;
}

.btn-purchase {
  background: #0066ff;
  color: white;
}

/* Hover Effects */
.btn-back:hover,
.btn-cancel:hover,
.btn-purchase:hover,
.btn-print:hover,
.btn-excel:hover,
.btn-pdf:hover {
  opacity: 0.9;
}

.data-table tbody tr:hover {
  background: #f9fafb;
}

/* Responsive Design */
@media screen and (max-width: 1200px) {
  .summary-cards {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }

  .table-container {
    overflow-x: auto;
  }

  .data-table {
    min-width: 1200px;
  }
}

@media screen and (max-width: 992px) {
  body {
    padding: 12px;
  }

  .page-header {
    flex-direction: column;
    gap: 16px;
    align-items: flex-start;
  }

  .order-info-card {
    flex-direction: column;
    gap: 16px;
  }

  .table-controls {
    flex-direction: column;
    gap: 16px;
  }

  .right-controls {
    flex-direction: column;
    width: 100%;
  }

  .search-box {
    width: 100%;
  }

  .search-box input {
    width: 100%;
  }

  .export-buttons {
    width: 100%;
    justify-content: space-between;
  }

  .btn-print,
  .btn-excel,
  .btn-pdf {
    flex: 1;
    text-align: center;
    justify-content: center;
  }
}

@media screen and (max-width: 768px) {
  .header-title h1 {
    font-size: 20px;
  }

  .summary-cards {
    grid-template-columns: 1fr;
  }

  .action-buttons {
    flex-direction: column;
    gap: 12px;
  }

  .btn-back,
  .btn-cancel,
  .btn-purchase {
    width: 100%;
    justify-content: center;
  }

  .entries-select {
    width: 100%;
  }
}

@media screen and (max-width: 576px) {
  body {
    padding: 8px;
  }

  .page-header,
  .order-info-card,
  .table-controls,
  .summary-section {
    padding: 12px;
  }

  .header-title h1 {
    font-size: 18px;
  }

  .badge {
    font-size: 10px;
    padding: 1px 4px;
  }

  .info-item span {
    font-size: 14px;
  }

  .btn-print,
  .btn-excel,
  .btn-pdf {
    padding: 8px;
    font-size: 12px;
  }
}

/* Touch-friendly adjustments */
@media (hover: none) {
  /* Increase touch targets */
  .btn-back,
  .btn-cancel,
  .btn-purchase,
  .btn-print,
  .btn-excel,
  .btn-pdf {
    min-height: 44px;
  }

  .entries-select,
  .search-box input {
    min-height: 44px;
  }

  /* Improve touch scrolling */
  .table-container {
    -webkit-overflow-scrolling: touch;
  }

  /* Remove hover effects */
  .btn-back:hover,
  .btn-cancel:hover,
  .btn-purchase:hover,
  .btn-print:hover,
  .btn-excel:hover,
  .btn-pdf:hover,
  .data-table tbody tr:hover {
    opacity: 1;
  }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  body {
    background: #1f2937;
  }

  .page-header,
  .order-info-card,
  .table-controls,
  .table-container,
  .summary-section {
    background: #374151;
  }

  .header-title h1,
  .info-item span,
  .data-table td {
    color: #f9fafb;
  }

  .back-link,
  .info-item label,
  .entries-select,
  .search-box input {
    color: #d1d5db;
  }

  .data-table th {
    background: #4b5563;
    color: #f9fafb;
  }

  .btn-back {
    background: #4b5563;
    color: #f9fafb;
  }
}

/* Print styles */
@media print {
  body {
    background: white;
    padding: 0;
  }

  .header-actions,
  .table-controls,
  .action-buttons {
    display: none;
  }

  .page-header,
  .order-info-card,
  .table-container,
  .summary-section {
    box-shadow: none;
    margin-bottom: 16px;
  }

  .data-table {
    border: 1px solid #e5e7eb;
  }
}
