:root {
  color-scheme: light;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --page-bg: #eef2f7;
  --surface: #ffffff;
  --border: #d1d5db;
  --primary: #17355A;
  --muted: #475569;
  --accent: #cc0d0d;
  --accent-soft: #fee2e2;
  --text: #1f2937;
}

*, *::before, *::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  overflow-x: hidden;
}

body {
  background: var(--page-bg);
  color: var(--text);
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 1.5rem 1.5rem 0;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.brand-mark img {
  display: block;
  height: 140px;
  width: auto;
  max-width: 240px;
  object-fit: contain;
}

.brand-mark--dashboard {
  position: static;
}

.brand-mark--dashboard img {
  height: 140px;
}

@font-face {
  font-family: 'Rimini';
  src: url('./fonts/Rimini-PersonalUse.otf') format('opentype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'League Spartan';
  src: url('./fonts/LeagueSpartan-Bold.otf') format('opentype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

h1 {
  font-family: 'League Spartan', sans-serif;
}

h2 {
  font-family: 'League Spartan', sans-serif;
}

button,
input,
textarea {
  font: inherit;
}

button {
  font-family: 'League Spartan', sans-serif;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  line-height: 1;
}

.page-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 2rem 3rem;
}

.track-card,
.admin-card {
  width: min(100%, 760px);
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
}

.track-header {
  text-align: center;
  margin-top: 4rem;
  margin-bottom: 1.5rem;
}

.track-header h1 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3rem);
  color: var(--primary);
  font-weight: 800;
  font-family: 'League Spartan', sans-serif;
}

.track-input-group {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.75rem;
  align-items: center;
  width: 100%;
  margin-bottom: 1.2rem;
}

.track-input-group input {
  width: 100%;
  min-height: 56px;
  border-radius: 12px;
  border: 1px solid var(--border);
  padding: 0 1rem;
  font-size: 1rem;
  color: var(--text);
  background: #ffffff;
}

.verification-input {
  max-width: 240px;
  min-width: 180px;
}

.track-input-group input:focus {
  border-color: var(--primary);
  outline: none;
  box-shadow: 0 0 0 4px rgba(23, 53, 90, 0.08);
}


.track-input-group button {
  min-width: 140px;
  height: 56px;
  border-radius: 16px;
  border: none;
  background: var(--accent);
  color: #ffffff;
  font-weight: 700;
  font-family: 'League Spartan', sans-serif;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  line-height: 1;
  padding: 0 1.3rem;
  transform: none;
}

.track-input-group button.loading {
  cursor: not-allowed;
}

.track-input-group button.loading .button-spinner {
  display: inline-block;
  width: 1em;
  height: 1em;
  border: 2px solid rgba(255, 255, 255, 0.45);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spinner 0.8s linear infinite;
}

@keyframes spinner {
  to { transform: rotate(360deg); }
}

.results-container {
  display: grid;
  gap: 1rem;
  margin-bottom: 1rem;
}

.order-result-card {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 1.25rem;
}

.order-result-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.order-result-header h2 {
  margin: 0;
  font-size: 1rem;
  color: var(--primary);
  font-weight: 700;
}

.order-result-header .order-id {
  font-size: 0.95rem;
  color: var(--muted);
  font-style: italic;
}

.order-result-body {
  display: grid;
  gap: 1rem;
}

.status-card {
  margin: 0 auto 1rem;
  max-width: 760px;
  font-size: 0.95rem;
}

.message.error {
  color: #b91c1c;
}

.message.success {
  color: #166534;
}

.status-card {
  border: 1px solid var(--border);
  border-radius: 0;
  background: #f8fafc;
  padding: 1.75rem;
  width: 100%;
  margin-top: 1.5rem;
}

.status-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.status-step {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 0;
  padding: 1rem;
  text-align: center;
  display: grid;
  gap: 0.5rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.25s ease, border-color 0.2s ease;
}

.status-step.hidden {
  opacity: 0;
  visibility: hidden;
  height: 0;
  padding: 0;
  margin: 0;
  overflow: hidden;
}

.status-step.completed {
  opacity: 1;
  border-color: #d1d5db;
  background: #ffffff;
}

.status-step.pulse {
  animation: pulse-card 1.2s infinite ease-in-out;
  border-width: 2px;
  border-color: var(--pulse-border, var(--border));
}

.status-step.pulse.processing {
  --pulse-border: #d97706;
}

.status-step.pulse.out-for-delivery {
  --pulse-border: #f59e0b;
}

.status-step.pulse.delivered {
  --pulse-border: #16a34a;
}

@keyframes pulse-card {
  0%, 100% {
    transform: translateY(0);
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.08);
  }
  50% {
    transform: translateY(-1px);
    box-shadow: 0 16px 35px rgba(15, 23, 42, 0.18);
  }
}

.step-marker {
  display: none;
}

.step-label {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--primary);
}

.step-time {
  color: var(--muted);
  font-size: 0.88rem;
}

.status-summary {
  display: grid;
  gap: 0.35rem;
  margin-bottom: 1rem;
}

.summary-label {
  font-size: 0.9rem;
  color: var(--muted);
}

.summary-value {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--primary);
}

.summary-value.status-processing,
.summary-value.status-out-for-delivery {
  color: #d97706;
}

.summary-value.status-delivered {
  color: #16a34a;
}


.remarks-block {
  margin-top: 1rem;
}

.remarks-block label {
  display: block;
  margin-bottom: 0.6rem;
  font-weight: 700;
  color: var(--primary);
}

.remarks-text {
  min-height: 88px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: #ffffff;
  padding: 1rem;
  color: var(--text);
  white-space: pre-wrap;
}

.escalation-panel {
  border-top: 1px solid var(--border);
  margin-top: 1.75rem;
  padding-top: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
  width: 100%;
  text-align: center;
}

.escalation-panel span {
  color: var(--muted);
  font-weight: 600;
}

.escalation-panel button,
#escalationSubmit,
#adminEscalationSubmit {
  height: 56px;
  border-radius: 16px;
  border: none;
  background: var(--accent);
  color: #ffffff;
  padding: 0 1.3rem;
  font-weight: 700;
  font-family: 'League Spartan', sans-serif;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  line-height: 1;
  transform: none;
}

.escalation-panel button:hover {
  background: #a60b0b;
}


.modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.3);
  display: grid;
  place-items: center;
  padding: 1.5rem;
  z-index: 20;
}

.modal-card {
  width: min(580px, 100%);
  background: #ffffff;
  border-radius: 24px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  padding: 2rem;
  position: relative;
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 38px;
  height: 38px;
  border: none;
  border-radius: 50%;
  background: #e2e8f0;
  color: var(--primary);
  font-size: 1.3rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.clickable-row {
  cursor: pointer;
}

.clickable-row:hover {
  background: rgba(15, 23, 42, 0.05);
}

.modal-detail {
  margin-bottom: 0.9rem;
}

.modal-multiline {
  margin-top: 0.35rem;
  white-space: pre-wrap;
}

.modal-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  flex-wrap: wrap;
  margin-top: 1rem;
}

.modal-actions button {
  flex: 1 1 0;
  min-width: 0;
}

.message.error,
.message.success {
  text-align: center;
  display: block;
  width: 100%;
  margin-top: 0.75rem;
}

.action-button {
  min-width: 140px;
  height: 48px;
  border: none;
  border-radius: 18px;
  background: var(--accent);
  color: #ffffff;
  font-family: 'League Spartan', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  line-height: 1;
  padding: 0 1.3rem;
}

.action-button:hover {
  background: #a60b0b;
}

.secondary-button {
  min-width: 140px;
  height: 48px;
  border: 1px solid var(--border);
  background: #ffffff;
  color: var(--primary);
  font-family: 'League Spartan', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  line-height: 1;
  padding: 0 1.3rem;
}

.secondary-button:hover {
  background: #f8fafc;
}

.modal-card h2 {
  margin-top: 0;
  font-size: 1.65rem;
  color: var(--primary);
  font-family: 'League Spartan', sans-serif;
}

.form-group {
  display: grid;
  gap: 0.55rem;
  margin-bottom: 1rem;
}

.form-group label {
  font-weight: 700;
  color: var(--primary);
}

.form-group input,
.form-group textarea {
  width: 100%;
  border-radius: 16px;
  border: 1px solid #cbd5e1;
  padding: 0.95rem 1rem;
  font-size: 1rem;
  color: var(--text);
}

.form-group textarea {
  resize: vertical;
  min-height: 120px;
}

#escalationSubmit {
  width: 100%;
  height: 56px;
  border: none;
  border-radius: 16px;
  background: var(--accent);
  color: #ffffff;
  padding: 0 1.3rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  line-height: normal;
}

#escalationSubmit:hover {
  background: #a60b0b;
}

.hidden {
  display: none !important;
}

@media (max-width: 780px) {
  .status-row,
  .track-input-group,
  .dashboard-actions,
  .login-row,
  .panel-row,
  .escalation-row {
    grid-template-columns: 1fr;
  }

  .site-header {
    padding: 0.75rem 1rem 1rem;
  }

  .page-shell {
    padding: 1rem 1rem 1.5rem;
  }

  .track-card,
  .admin-card,
  .dashboard-panel,
  .escalation-card,
  .panel {
    width: 100%;
    padding: 1rem;
  }

  .track-header h1,
  .dashboard-header h1 {
    font-size: clamp(1.8rem, 6vw, 2.4rem);
  }

  .track-input-group,
  .login-row,
  .panel-row,
  .dashboard-actions,
  .dashboard-metrics,
  .escalation-row {
    gap: 0.75rem;
  }

  .track-input-group button,
  .logout-button,
  .escalation-actions button,
  #escalationSubmit,
  #adminEscalationSubmit {
    width: 100%;
  }

  .panel-row__button-group button {
    width: auto;
  }

  .dashboard-panel {
    display: flex;
    flex-direction: column;
  }

  .dashboard-header {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
  }

  .dashboard-header h1 {
    order: 1;
    margin-bottom: 0;
  }

  .dashboard-right {
    order: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    width: 100%;
    padding: 0.9rem 1rem;
    position: sticky;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(239, 242, 247, 0.97);
    border-top: 1px solid #e2e8f0;
    z-index: 20;
  }

  .dashboard-right .brand-mark {
    margin: 0;
  }

  .dashboard-right .logout-button {
    flex: 0 0 auto;
    max-width: 160px;
    width: auto;
    padding: 0 1rem;
  }

  .dashboard-metrics {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
  }

  .metric-card {
    min-height: auto;
    text-align: left;
    justify-items: start;
    padding: 1rem;
  }

  .metric-card .metric-value {
    font-size: 1.55rem;
  }

  .panel--order .data-table,
  .panel--sku .data-table,
  .panel--packing .data-table {
    table-layout: fixed;
    width: 100%;
  }

  .panel--order .data-table th:nth-child(1),
  .panel--order .data-table td:nth-child(1) {
    width: 20%;
  }

  .panel--order .data-table th:nth-child(2),
  .panel--order .data-table td:nth-child(2) {
    width: 21%;
  }

  .panel--order .data-table th:nth-child(3),
  .panel--order .data-table td:nth-child(3) {
    width: 39%;
  }

  .panel--order .data-table th:nth-child(4),
  .panel--order .data-table td:nth-child(4) {
    width: 20%;
  }

  .panel--sku .data-table th:nth-child(1),
  .panel--sku .data-table td:nth-child(1) {
    width: 18%;
  }

  .panel--sku .data-table th:nth-child(2),
  .panel--sku .data-table td:nth-child(2) {
    width: 42%;
  }

  .panel--sku .data-table th:nth-child(3),
  .panel--sku .data-table td:nth-child(3) {
    width: 15%;
  }

  .panel--sku .data-table th:nth-child(4),
  .panel--sku .data-table td:nth-child(4) {
    width: 25%;
  }

  .data-table th,
  .data-table td,
  .panel--packing .data-table th,
  .panel--packing .data-table td {
    white-space: normal;
    word-break: break-word;
  }

  #packingTable th,
  #packingTable td {
    padding: 0.6rem 0.45rem;
    font-size: 0.82rem;
  }

  #packingTable th:nth-child(1),
  #packingTable td:nth-child(1) {
    width: 14%;
  }

  #packingTable th:nth-child(2),
  #packingTable td:nth-child(2) {
    width: 14%;
  }

  #packingTable th:nth-child(3),
  #packingTable td:nth-child(3) {
    width: 12%;
  }

  #packingTable th:nth-child(4),
  #packingTable td:nth-child(4) {
    width: 18%;
  }

  #packingTable th:nth-child(5),
  #packingTable td:nth-child(5) {
    width: 32%;
  }

  #packingTable th:nth-child(6),
  #packingTable td:nth-child(6) {
    width: 10%;
  }

  .data-table th,
  .data-table td {
    padding: 0.7rem 0.5rem;
    font-size: 0.9rem;
  }

  .table-shell {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .panel--packing .table-shell {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .table-shell table {
    min-width: 760px;
  }

  .brand-mark img {
    height: 90px;
  }
}

.admin-page {
  background: var(--page-bg);
  min-height: 100vh;
  padding: 2rem 2rem 3rem;
}

/* Make admin pages use the same centered shell as the public pages
   so content is vertically and horizontally centered like amex-track */
.admin-page .page-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 2rem 3rem;
}

.admin-card {
  width: 100%;
  max-width: none;
  margin: 0;
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
}

.dashboard-panel {
  width: 100%;
  max-width: 100%;
  display: grid;
  gap: 2rem;
  padding-top: 3rem;
}

.login-panel,
.dashboard-panel {
  display: grid;
  gap: 1.5rem;
}

.login-panel h1 {
  margin: 0;
  font-size: clamp(2rem, 3vw, 2.8rem);
  color: var(--primary);
}

.login-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  max-width: 420px;
  margin: 0 auto 1.2rem;
}

.verification-input {
  flex: 1 1 220px;
  min-width: 180px;
  border-radius: 16px;
}

login-row button {
  border-radius: 16px;
  padding: 0 1.3rem;
  height: 56px;
}

.login-row input {
  min-height: 56px;
  border-radius: 16px;
  border: 1px solid var(--border);
  padding: 0 1rem;
  font-size: 1rem;
  color: var(--text);
}

.panel-row button,
.login-row button,
.escalation-actions button,
#escalationSubmit,
#adminEscalationSubmit {
  min-width: 120px;
  height: 56px;
  border-radius: 16px;
  border: none;
  background: var(--accent);
  color: #ffffff;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  line-height: 1;
  padding: 0 1.3rem;
}

.dashboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  text-align: left;
}

.dashboard-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.dashboard-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.logout-button {
  min-width: 120px;
  height: 56px;
  border-radius: 16px;
  border: none;
  background: var(--accent);
  color: #ffffff;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 1.3rem;
}

.dashboard-header h1 {
  margin: 0;
  font-size: clamp(2.2rem, 3vw, 3rem);
  color: var(--primary);
  font-weight: 800;
}

.dashboard-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
  margin-top: 1rem;
  align-items: stretch;
}

.metric-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 1.1rem 1rem;
  display: grid;
  gap: 0.65rem;
  text-align: center;
  justify-items: center;
  min-height: 120px;
}

.metric-card .metric-title {
  font-size: 0.9rem;
}

.metric-card .metric-value {
  font-size: 1.8rem;
}

.metric-title {
  color: var(--primary);
  font-size: 0.95rem;
  font-weight: 700;
}

.metric-value {
  color: var(--primary);
  font-size: 2.25rem;
  font-weight: 800;
}

.metric-alert {
  color: #dc2626;
}

.metric-card--wide {
  grid-column: span 2;
}

.dashboard-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 1.75rem;
}

.panel {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 1.25rem;
  display: grid;
  gap: 1rem;
}

.panel--packing {
  grid-column: 1 / -1;
}

.panel-header label {
  font-weight: 700;
  color: var(--primary);
}

.panel-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.75rem;
}

.panel-row input {
  min-height: 48px;
  border-radius: 12px;
  border: 1px solid var(--border);
  padding: 0 0.95rem;
  width: 100%;
}

.panel-row__button-group {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: flex-end;
  width: 100%;
}

.panel-row__button-group button {
  flex: 1 1 48%;
  min-width: 0;
}

.panel-row button,
.login-row button,
.logout-button,
.escalation-actions button,
#escalationSubmit,
#adminEscalationSubmit {
  min-width: 120px;
  height: 48px;
  border-radius: 18px;
  border: none;
  background: var(--accent);
  color: #ffffff;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  line-height: 1;
  padding: 0 1.3rem;
}

.table-shell {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.panel--packing .table-shell {
  overflow-x: auto;
}

/* Pagination styles */
.pagination {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.22rem;
  border: 1px solid var(--border);
  padding: 0.14rem 0.18rem;
  border-radius: 999px;
  background: #ffffff;
  margin: 0.45rem auto 0; /* vertical spacing centered between last row and table footer */
}
.pagination-btn {
  background: transparent;
  border: none;
  padding: 0.14rem 0.22rem;
  min-width: 16px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.6rem;
  line-height: 1;
  color: var(--muted);
  cursor: pointer;
  border-radius: 3px;
}
.pagination-btn:hover:not(:disabled) {
  background: rgba(23,53,90,0.04);
}
.pagination-btn:disabled {
  opacity: 0.45;
  cursor: default;
}
.pagination-btn.active {
  position: relative;
  color: var(--primary);
}
.pagination-btn.active::after {
  content: '';
  position: absolute;
  left: 22%;
  right: 22%;
  bottom: -3px;
  height: 1.5px;
  background: var(--primary);
  border-radius: 2px;
}
.pagination .ellipsis {
  pointer-events: none;
  opacity: 0.7;
  padding: 0 0.2rem;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

#skuTable {
  table-layout: fixed;
}

#skuTable th:nth-child(1),
#skuTable td:nth-child(1) {
  width: 15%;
}

#skuTable th:nth-child(2),
#skuTable td:nth-child(2) {
  width: 55%;
}

#skuTable th:nth-child(3),
#skuTable td:nth-child(3) {
  width: 15%;
}

#skuTable th:nth-child(4),
#skuTable td:nth-child(4) {
  width: 15%;
}

#orderTable th:nth-child(1),
#orderTable td:nth-child(1) {
  width: 20%;
}

#orderTable th:nth-child(2),
#orderTable td:nth-child(2) {
  width: 20%;
}

#orderTable th:nth-child(3),
#orderTable td:nth-child(3) {
  width: 40%;
}

#orderTable th:nth-child(4),
#orderTable td:nth-child(4) {
  width: 20%;
}

#packingTable {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

#packingTable th,
#packingTable td {
  vertical-align: middle;
}

#packingTable th:nth-child(1),
#packingTable td:nth-child(1) {
  width: 10%;
}

#packingTable tbody tr.row-highlight {
  animation: rowPulse 2s ease-in-out;
}

@keyframes rowPulse {
  0%, 100% { background-color: transparent; }
  50% { background-color: rgba(255, 238, 88, 0.35); }
}

#packingTable th:nth-child(2),
#packingTable td:nth-child(2) {
  width: 10%;
}

#packingTable th:nth-child(3),
#packingTable td:nth-child(3) {
  width: 10%;
}

#packingTable th:nth-child(4),
#packingTable td:nth-child(4) {
  width: 20%;
}

#packingTable th:nth-child(5),
#packingTable td:nth-child(5) {
  width: 30%;
}

#packingTable th:nth-child(6),
#packingTable td:nth-child(6) {
  width: 20%;
}

#packingTable th,
#packingTable td {
  vertical-align: middle;
}

/* Larger touch-friendly checkboxes for packing panel */
.panel--packing .data-table td input[type="checkbox"] {
  width: 36px;
  height: 36px;
  margin-right: 0.85rem;
  cursor: pointer;
  vertical-align: middle;
}

.panel--packing .data-table td div {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.panel--packing .data-table td {
  vertical-align: middle;
}

.panel--packing .data-table td select.packaging-select {
  min-width: 170px;
  max-width: 220px;
  padding: 0.8rem 0.9rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  font-size: 0.95rem;
}

.panel--packing .data-table td button.icon-button {
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.6rem;
  line-height: 1;
}

.panel--packing .data-table td button.icon-button svg {
  width: 24px;
  height: 24px;
}

.panel--packing .data-table td.actions-cell {
  vertical-align: middle;
  white-space: normal;
}

.panel--packing .data-table td.actions-cell .actions-wrapper {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: flex-start;
}

.data-table th,
.data-table td {
  text-align: left;
  padding: 0.95rem 0.85rem;
  border-bottom: 1px solid #e2e8f0;
  font-size: 0.95rem;
}

.panel--order .data-table,
.panel--sku .data-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.panel--order .data-table thead th,
.panel--sku .data-table thead th {
  background: #ffffff;
}

.panel--order .data-table th,
.panel--order .data-table td,
.panel--sku .data-table th,
.panel--sku .data-table td {
  text-align: center;
  vertical-align: top;
  padding: 1rem 0.85rem;
}

.panel--order .data-table td,
.panel--sku .data-table td {
  white-space: pre-wrap;
}

.panel--order .data-table th,
.panel--sku .data-table th {
  font-weight: 700;
  color: var(--primary);
}

.data-table th {
  font-weight: 700;
  color: var(--primary);
}

.escalation-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 1.5rem;
  margin-top: 1.5rem;
  display: grid;
  gap: 1rem;
}

.escalation-card h2 {
  margin: 0;
  color: var(--primary);
  font-family: 'League Spartan', sans-serif;
}

.escalation-row {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 1rem;
}

.form-group--small,
.form-group--large {
  display: grid;
  gap: 0.6rem;
}

.form-group--small input,
.form-group--large textarea {
  border-radius: 12px;
  border: 1px solid var(--border);
  padding: 0.95rem;
  font-size: 1rem;
  color: var(--text);
}

.escalation-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 1rem;
  flex-wrap: wrap;
}

.escalation-actions button {
  min-width: 140px;
  height: 56px;
  border-radius: 16px;
  border: none;
  background: var(--accent);
  color: #ffffff;
  font-weight: 700;
  padding: 0 1.3rem;
  cursor: pointer;
}

@media (max-width: 1100px) {
  .dashboard-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .metric-card--wide {
    grid-column: span 2;
  }
}

@media (max-width: 820px) {
  .dashboard-actions,
  .escalation-row,
  .login-row,
  .panel-row {
    grid-template-columns: 1fr;
  }

  .dashboard-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}
