:root {
  --primary: #FF7F11;
  --bg: #E2E8CE;
  --secondary: #ACBFA4;
  --dark: #262626;
}

* { box-sizing: border-box; }
body { background-color: var(--bg); font-family: system-ui, -apple-system, sans-serif; }

/* Buttons */
.btn-primary {
  background-color: var(--primary);
  color: white;
  padding: 0.5rem 1.25rem;
  border-radius: 0.375rem;
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: opacity 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
.btn-primary:hover { opacity: 0.88; }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-secondary {
  background-color: transparent;
  color: var(--dark);
  padding: 0.5rem 1.25rem;
  border-radius: 0.375rem;
  font-weight: 500;
  border: 1.5px solid #d1d5db;
  cursor: pointer;
  transition: background 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
.btn-secondary:hover { background-color: #f3f4f6; }

.btn-danger {
  background-color: #ef4444;
  color: white;
  padding: 0.375rem 0.875rem;
  border-radius: 0.375rem;
  font-weight: 500;
  border: none;
  cursor: pointer;
  font-size: 0.875rem;
}
.btn-danger:hover { background-color: #dc2626; }

/* Sidebar active link */
.sidebar-active {
  border-left: 3px solid var(--primary) !important;
  background-color: rgba(255, 127, 17, 0.12) !important;
  color: var(--primary) !important;
}

/* Form inputs */
.form-input {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1.5px solid #d1d5db;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  outline: none;
  transition: border-color 0.15s;
  background: white;
}
.form-input:focus { border-color: var(--primary); }

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: #374151;
  margin-bottom: 0.25rem;
}

/* Cards */
.card {
  background: white;
  border-radius: 0.75rem;
  padding: 1.5rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

/* Status badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.65rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: capitalize;
}
.badge-delivered  { background: #dcfce7; color: #166534; }
.badge-failed     { background: #fee2e2; color: #991b1b; }
.badge-processing { background: #fef9c3; color: #854d0e; }
.badge-pending    { background: #f3f4f6; color: #374151; }

/* Spinner */
.spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2.5px solid rgba(255,255,255,0.4);
  border-radius: 50%;
  border-top-color: white;
  animation: spin 0.7s linear infinite;
}
.spinner-dark {
  border-color: rgba(0,0,0,0.15);
  border-top-color: var(--primary);
}

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

/* Error message */
.error-msg {
  color: #dc2626;
  font-size: 0.8rem;
  margin-top: 0.25rem;
}

/* Alert */
.alert {
  padding: 0.75rem 1rem;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  margin-bottom: 1rem;
}
.alert-error   { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.alert-success { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }

/* Upload drop zone */
.drop-zone {
  border: 2px dashed var(--secondary);
  border-radius: 0.75rem;
  padding: 3rem 2rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.drop-zone:hover, .drop-zone.drag-over {
  border-color: var(--primary);
  background: rgba(255, 127, 17, 0.04);
}

/* Table */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}
.data-table th {
  text-align: left;
  padding: 0.75rem 1rem;
  font-weight: 600;
  color: #6b7280;
  border-bottom: 1.5px solid #e5e7eb;
  white-space: nowrap;
}
.data-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #f3f4f6;
  color: #374151;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: #f9fafb; }

/* Stat card */
.stat-card {
  background: white;
  border-radius: 0.75rem;
  padding: 1.25rem 1.5rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.07);
}
.stat-value { font-size: 1.875rem; font-weight: 700; color: var(--dark); }
.stat-label { font-size: 0.8rem; color: #6b7280; margin-top: 0.2rem; }

/* Toast */
.toast {
  position: fixed;
  top: 1.25rem;
  right: 1.25rem;
  z-index: 9999;
  padding: 0.875rem 1.25rem;
  border-radius: 0.5rem;
  color: white;
  font-weight: 500;
  font-size: 0.9rem;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  animation: slideIn 0.2s ease;
}
.toast-success { background: #22c55e; }
.toast-error   { background: #ef4444; }
@keyframes slideIn { from { transform: translateX(120%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* Loading overlay */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255,255,255,0.7);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 100;
  gap: 1rem;
}
.loading-overlay .spinner { width: 40px; height: 40px; border-width: 4px; border-top-color: var(--primary); border-color: #e5e7eb; border-top-color: var(--primary); }

/* Pagination */
.page-btn {
  padding: 0.375rem 0.75rem;
  border: 1.5px solid #d1d5db;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  cursor: pointer;
  background: white;
}
.page-btn:hover { background: #f9fafb; }
.page-btn.active { background: var(--primary); color: white; border-color: var(--primary); }
.page-btn:disabled { opacity: 0.4; cursor: not-allowed; }
