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

:root {
  --primary: #0d6efd;
  --primary-dark: #0a58ca;
  --success: #198754;
  --warning: #ffc107;
  --danger: #dc3545;
  --gray: #6c757d;
  --light: #f8f9fa;
  --dark: #212529;
  --border: #dee2e6;
}

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  color: var(--dark);
  background: var(--light);
  line-height: 1.6;
}

/* Navbar */
.navbar {
  background: #fff;
  border-bottom: 2px solid var(--primary);
  padding: 0.75rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.navbar .brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--primary);
  font-weight: 700;
  font-size: 1.25rem;
}
.navbar .brand svg { flex-shrink: 0; }
.navbar nav { display: flex; gap: 1.5rem; }
.navbar nav a {
  text-decoration: none;
  color: var(--gray);
  font-weight: 500;
  padding: 0.25rem 0;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
}
.navbar nav a:hover,
.navbar nav a.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

/* Layout */
.container { max-width: 960px; margin: 0 auto; padding: 2rem 1rem; }
.container-full { width: 100%; padding: 1.5rem 1.5rem; }
.hero {
  text-align: center;
  padding: 3rem 1rem;
  background: linear-gradient(135deg, var(--primary), #4dabf7);
  color: #fff;
  border-radius: 12px;
  margin-bottom: 2rem;
}
.hero h1 { font-size: 2rem; margin-bottom: 0.5rem; }
.hero p { opacity: 0.9; font-size: 1.1rem; }

/* Cards */
.card {
  background: #fff;
  border-radius: 10px;
  padding: 1.5rem;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  border: 1px solid var(--border);
}
.card h2 { font-size: 1.25rem; margin-bottom: 1rem; color: var(--primary); }

/* Forms */
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-weight: 600; margin-bottom: 0.3rem; font-size: 0.9rem; }
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.95rem;
  font-family: inherit;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(13,110,253,0.15);
}
.file-upload {
  border: 2px dashed var(--border);
  border-radius: 8px;
  padding: 2rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s;
  position: relative;
}
.file-upload:hover { border-color: var(--primary); }
.file-upload input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}
.file-upload .icon { font-size: 2rem; margin-bottom: 0.5rem; }
.file-upload p { color: var(--gray); font-size: 0.9rem; }
.file-upload .file-name { color: var(--success); font-weight: 600; margin-top: 0.5rem; }

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.6rem 1.5rem;
  border: none;
  border-radius: 6px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-sm { padding: 0.35rem 0.75rem; font-size: 0.85rem; }

/* Table */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th, td { padding: 0.65rem 0.75rem; text-align: left; border-bottom: 1px solid var(--border); }
th { background: var(--light); font-weight: 600; color: var(--gray); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.5px; }
tr:hover td { background: #f0f6ff; }
tr.row-delivered td { background: #d1fae5; color: #065f46; }
tr.row-delivered td:first-child { border-left: 4px solid #10b981; }
tr.row-dispatched td { background: #ede9fe; color: #4c1d95; }
tr.row-dispatched td:first-child { border-left: 4px solid #8b5cf6; }
tr.row-not-confirmed td { background: #fee2e2; color: #7f1d1d; }
tr.row-not-confirmed td:first-child { border-left: 4px solid #ef4444; }
tr.row-not-confirmed:hover td { background: #fecaca; }

/* Badges */
.badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
}
.badge-queued         { background: #fff3cd; color: #856404; }
.badge-processing     { background: #cfe2ff; color: #084298; }
.badge-ready          { background: #d1e7dd; color: #0f5132; }
.badge-dispatched     { background: #ede9fe; color: #5b21b6; }
.badge-delivered      { background: #198754; color: #fff; }
.badge-not-confirmed  { background: #fee2e2; color: #b91c1c; }

/* Status Tracker */
.status-tracker {
  display: flex;
  justify-content: space-between;
  margin: 2rem 0;
  position: relative;
}
.status-tracker::before {
  content: '';
  position: absolute;
  top: 20px;
  left: 10%;
  right: 10%;
  height: 3px;
  background: var(--border);
}
.status-tracker .step {
  text-align: center;
  position: relative;
  z-index: 1;
  flex: 1;
}
.status-tracker .step .dot {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--border);
  margin: 0 auto 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--gray);
}
.status-tracker .step.active .dot {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}
.status-tracker .step.done .dot {
  border-color: var(--success);
  background: var(--success);
  color: #fff;
}
.status-tracker .step span { font-size: 0.8rem; color: var(--gray); }
.status-tracker .step.active span,
.status-tracker .step.done span { color: var(--dark); font-weight: 600; }

/* Status result card */
.status-result { display: none; margin-top: 1.5rem; }
.status-result.show { display: block; }

/* Toast */
.toast {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  background: var(--success);
  color: #fff;
  padding: 0.75rem 1.25rem;
  border-radius: 8px;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s;
  z-index: 200;
}
.toast.show { transform: translateY(0); opacity: 1; }

/* Features grid */
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 1.25rem; margin-top: 2rem; }
.feature-card {
  background: #fff;
  border-radius: 10px;
  padding: 1.5rem;
  text-align: center;
  border: 1px solid var(--border);
  transition: transform 0.2s, box-shadow 0.2s;
}
.feature-card:hover { transform: translateY(-3px); box-shadow: 0 4px 12px rgba(0,0,0,0.1); }
.feature-card .icon { font-size: 2.5rem; margin-bottom: 0.75rem; }
.feature-card h3 { font-size: 1rem; margin-bottom: 0.4rem; }
.feature-card p { font-size: 0.85rem; color: var(--gray); }
.feature-card .btn { margin-top: 0.75rem; }

/* Footer */
footer {
  text-align: center;
  padding: 1.5rem;
  color: var(--gray);
  font-size: 0.85rem;
  border-top: 1px solid var(--border);
  margin-top: 3rem;
}

/* Empty state */
.empty { text-align: center; padding: 3rem 1rem; color: var(--gray); }
.empty .icon { font-size: 3rem; margin-bottom: 0.5rem; }

/* Modal */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.6); z-index: 300;
  display: flex; align-items: center; justify-content: center; padding: 1rem;
}
.modal-content {
  background: #fff; border-radius: 10px; width: 100%; max-width: 700px;
  max-height: 90vh; overflow: auto; box-shadow: 0 8px 30px rgba(0,0,0,0.25);
}
.modal-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 1rem 1.25rem; border-bottom: 1px solid var(--border);
}
.modal-header h3 { margin: 0; font-size: 1.1rem; color: var(--primary); }
.modal-close {
  background: none; border: none; font-size: 1.5rem; cursor: pointer;
  color: var(--gray); line-height: 1;
}
.modal-close:hover { color: var(--danger); }
.modal-body { padding: 1.25rem; }
.view-rx { color: var(--primary); font-weight: 600; text-decoration: underline; cursor: pointer; }

/* Loading */
.loading-overlay {
  position: fixed; inset: 0; background: rgba(255,255,255,0.85); z-index: 400;
  display: flex; align-items: center; justify-content: center;
}
.loading-box { text-align: center; }
.spinner {
  width: 36px; height: 36px; border: 4px solid var(--border);
  border-top-color: var(--primary); border-radius: 50%;
  animation: spin 0.7s linear infinite; margin: 0 auto 0.75rem;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* OTP */
.otp-status { font-size: 0.85rem; margin-top: 0.4rem; font-weight: 600; }
.otp-success { color: var(--success); }
.otp-error { color: var(--danger); }
.otp-hint { font-size: 0.85rem; color: var(--warning); margin-top: 0.75rem; }
button:disabled { opacity: 0.5; cursor: not-allowed; }

/* Responsive */
@media (max-width: 600px) {
  .navbar { padding: 0.75rem 1rem; flex-wrap: wrap; gap: 0.5rem; }
  .navbar nav { gap: 1rem; }
  .hero h1 { font-size: 1.5rem; }
  .status-tracker { flex-direction: column; gap: 1rem; }
  .status-tracker::before { display: none; }
}
