:root {
  --bg: #f4f6f8;
  --card: #ffffff;
  --primary: #0d6efd;
  --success: #198754;
  --warning: #ffc107;
  --danger: #dc3545;
  --text: #212529;
  --muted: #6c757d;
  --radius: 14px;
  --dubai-blue: #0b3c5d;
  --dubai-gold: #d4af37;
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont;
  background: var(--bg);
  color: var(--text);
}

.container {
    width:100%;
  max-width: 100%;
  margin: auto;
  padding: 14px;
  box-sizing: border-box;
}

@media (max-width: 768px) {
  .container {
    padding: 10px;
  }
}

.container.wide {
  max-width: 85% !important;
}

.container-wide {
  width: 100%;
  max-width: 1400px;
  min-height: 100vh;
  margin: auto;
  padding: 16px;
}


.card {
  /* background: var(--card);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.06); */
  border-radius: 16px;
  padding: 18px;
  background: #ffffff;
  box-shadow: 0 6px 18px rgba(0,0,0,0.06);
  width: 100%;
  box-sizing: border-box;
}

/* Mobile card adjustments */
@media (max-width: 768px) {
  .card {
    padding: 14px;
    border-radius: 12px;
  }
  .card-consignment-details .edit-consignment-pencil {
    margin-right: 2px;
  }
}

h1, h2, h3 { margin: 0 0 10px; }
small { color: var(--muted); }

input, select {
  width: 100%;
  padding: 14px;
  font-size: 16px;
  border-radius: 10px;
  border: 1px solid #ddd;
  margin-bottom: 10px;
}

button {
  width: 100%;
  padding: 14px;
  border-radius: 12px;
  border: none;
  font-size: 16px;
  font-weight: 600;
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  pointer-events: none;
}

.btn-primary { background: var(--primary); color:#fff; }
.btn-secondary { background: #6c757d; color: #fff; }
.btn-success { background: var(--success); color:#fff; }
.btn-warning { background: var(--warning); }
.btn-danger  { 
  background: linear-gradient(135deg, #dc3545, #c82333);
  color: #fff;
  border: none;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(220, 53, 69, 0.25);
}

.btn-danger:hover {
  background: linear-gradient(135deg, #c82333, #bd2130);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(220, 53, 69, 0.35);
}

.btn-danger:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(220, 53, 69, 0.3);
}

.status {
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
}

.status-open { background:#e7f1ff; color:#0d6efd; }
.status-transit { background:#fff3cd; color:#856404; }
.status-received { background:#d1e7dd; color:#0f5132; }

.counter {
  font-size: 22px;
  font-weight: 700;
}

.feedback-ok   { color: var(--success); font-weight: 600; }
.feedback-warn { color: var(--warning); font-weight: 600; }
.feedback-err  { color: var(--danger); font-weight: 600; }


/* ADMIN LAYOUT */
.admin-layout {
  display: flex;
  min-height: 100vh;
  align-items: flex-start;
  /* gap: 16px;  */
}

.admin-layout .main {
  display: flex;
  flex-direction: column;
}

.sidebar {
    display: flex;
  flex-direction: column;
  width: 240px;
  background: #0f172a;
  color: #e5e7eb;
  padding: 20px;
  border-radius: 16px;
  margin-top: 0;
  margin-bottom: 0;
  align-self: flex-start;
}

.sidebar h3 {
  margin-top: 0;
  margin-bottom: 17px;
  font-size: 18px;
}

.sidebar a {
  display: block;
  padding: 10px 14px;
  color: #cbd5f5;
  text-decoration: none;
  border-radius: 8px;
  margin-bottom: 6px;
}

.sidebar > div[style*="margin-top:auto"] {
  margin-top: auto;
  padding-top: 10px;
  margin-bottom: 0;
}

.sidebar a:hover{
     background: rgba(255,255,255,0.08);
}
.sidebar a.active {
  /* background: #1f2937; */
  /* color: #fff; */
    background: #2563eb;
  color: #fff;
  font-weight: 600;
}

.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  padding-left: 16px;
  margin-top: 4px;
  position: relative;
}

.topbar {
  background: #fff;
  padding: 14px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-radius: 14px;
  box-shadow: 0 2px 8px rgba(0,0,0,.05);
  margin-top: 17px;
  margin-bottom: 17px;
}

.topbar .btn-danger {
  padding: 10px 18px;
  font-size: 14px;
  border-radius: 8px;
  cursor: pointer;
}

.admin-content > * {
  margin-bottom: 18px;
}

/* Summary cards */
.admin-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
}

.content {
    flex:1;
  padding: 18px;
}

/* SUMMARY CARDS */
.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px,1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.summary-card {
  background: linear-gradient(135deg, #ffffff, #f8fafc);
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.06);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  display: flex;
  align-items: center;
  gap: 16px;
  border-left: 4px solid transparent;
}

.summary-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 22px rgba(0,0,0,0.08);
}

.summary-card.stat-open {
  border-left-color: var(--primary);
}

.summary-card.stat-transit {
  border-left-color: #f59e0b;
}

.summary-card.stat-verified {
  border-left-color: #10b981;
}

.summary-card.stat-completed {
  border-left-color: var(--success);
}

.summary-card.stat-total {
  border-left-color: #6366f1;
}

.summary-card.stat-payment {
  border-left-color: #ec4899;
}

.stat-icon {
  font-size: 28px;
  opacity: 0.8;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.stat-icon i {
  font-size: inherit;
}

.stat-content {
  flex: 1;
}

.summary-card h3 {
  font-size: 10px;
  color: #64748b;
  margin-bottom: 3px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.summary-card strong {
  font-size: 20px;
  color: #0f172a;
  display: block;
  margin-bottom: 2px;
  font-weight: 700;
  line-height: 1.1;
}

.summary-card small {
  font-size: 10px;
  color: var(--muted);
  display: block;
}

/* TABLE */
table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
}

th, td {
  padding: 10px;
  border-bottom: 1px solid #eee;
  text-align: left;
}

/* Admin table styling */
.admin-table {
  width: 100%;
  border-collapse: collapse;
}

.admin-table thead {
  background: #f8fafc;
}

.admin-table th {
  padding: 12px 14px;
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 2px solid #e2e8f0;
  white-space: nowrap;
}

.admin-table td {
  padding: 14px;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
}

.admin-table tbody tr {
  transition: background-color 0.2s ease;
}

.admin-table tbody tr:hover {
  background-color: #f8fafc;
}

.admin-table tbody tr:last-child td {
  border-bottom: none;
}

/* Status badges */
.status-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.status-open {
  background: #dbeafe;
  color: #1e40af;
}

.status-in-transit {
  background: #fef3c7;
  color: #92400e;
}

.status-verified {
  background: #d1fae5;
  color: #065f46;
}

.status-completed {
  background: #dcfce7;
  color: #166534;
}

.status-received {
  background: #e0e7ff;
  color: #3730a3;
}

/* Role badges for users */
.status-admin {
  background: #fce7f3;
  color: #9f1239;
}

.status-dubai {
  background: #dbeafe;
  color: #1e40af;
}

.status-dar {
  background: #d1fae5;
  color: #065f46;
}

.status-shop {
  background: #fef3c7;
  color: #92400e;
}

/* Progress bar */
.progress-bar {
  position: relative;
  width: 100%;
  height: 24px;
  background: #f1f5f9;
  border-radius: 12px;
  overflow: hidden;
  min-width: 80px;
}

.progress-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  border-radius: 12px;
  transition: width 0.3s ease;
}

.progress-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 11px;
  font-weight: 600;
  color: #0f172a;
  z-index: 1;
  white-space: nowrap;
}

/* Quick stats */
.quick-stat {
  padding: 16px;
  background: #f8fafc;
  border-radius: 10px;
  border-left: 3px solid var(--primary);
}

.quick-stat-label {
  font-size: 12px;
  color: #64748b;
  margin-bottom: 6px;
  font-weight: 500;
}

.quick-stat-value {
  font-size: 24px;
  font-weight: 700;
  color: #0f172a;
}

/* Table container for scrolling */
.table-container {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Button link style */
.btn-link {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
  font-size: 13px;
  transition: color 0.2s ease;
}

.btn-link:hover {
  color: #0b5ed7;
  text-decoration: underline;
}

/* Admin table styling */
.admin-table {
  width: 100%;
  border-collapse: collapse;
}

.admin-table thead {
  background: #f8fafc;
}

.admin-table th {
  padding: 12px 14px;
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 2px solid #e2e8f0;
  white-space: nowrap;
}

.admin-table td {
  padding: 14px;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
}

.admin-table tbody tr {
  transition: background-color 0.2s ease;
}

.admin-table tbody tr:hover {
  background-color: #f8fafc;
}

.admin-table tbody tr:last-child td {
  border-bottom: none;
}

/* Status badges */
.status-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.status-open {
  background: #dbeafe;
  color: #1e40af;
}

.status-in-transit {
  background: #fef3c7;
  color: #92400e;
}

.status-verified {
  background: #d1fae5;
  color: #065f46;
}

.status-completed {
  background: #dcfce7;
  color: #166534;
}

.status-received {
  background: #e0e7ff;
  color: #3730a3;
}

/* Role badges for users */
.status-admin {
  background: #fce7f3;
  color: #9f1239;
}

.status-dubai {
  background: #dbeafe;
  color: #1e40af;
}

.status-dar {
  background: #d1fae5;
  color: #065f46;
}

.status-shop {
  background: #fef3c7;
  color: #92400e;
}

/* Progress bar */
.progress-bar {
  position: relative;
  width: 100%;
  height: 24px;
  background: #f1f5f9;
  border-radius: 12px;
  overflow: hidden;
  min-width: 80px;
}

.progress-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  border-radius: 12px;
  transition: width 0.3s ease;
}

.progress-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 11px;
  font-weight: 600;
  color: #0f172a;
  z-index: 1;
  white-space: nowrap;
}

/* Quick stats */
.quick-stat {
  padding: 16px;
  background: #f8fafc;
  border-radius: 10px;
  border-left: 3px solid var(--primary);
}

.quick-stat-label {
  font-size: 12px;
  color: #64748b;
  margin-bottom: 6px;
  font-weight: 500;
}

.quick-stat-value {
  font-size: 24px;
  font-weight: 700;
  color: #0f172a;
}
.btn-link {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
  font-size: 13px;
  transition: color 0.2s ease;
}

.btn-link:hover {
  color: #0b5ed7;
  text-decoration: underline;
}

th {
  font-size: 13px;
  color: var(--muted);
text-transform: uppercase; 
  padding-bottom: 10px;
  border-bottom: 1px solid #e5e7eb;
}

/* thead th {
  font-size: 13px;
  text-transform: uppercase;
  color: #64748b;
  text-align: left;
  padding-bottom: 10px;
  border-bottom: 1px solid #e5e7eb;
} */

tbody td {
  padding: 12px 6px;
  border-bottom: 1px solid #f1f5f9;
  font-size: 14px;
}

tbody tr:hover {
  background: #f8fafc;
}

/* Status emphasis */
td:nth-child(2) {
  font-weight: 600;
}

/* ============================= */
/* PROCESS TRACKER (CIRCULAR)   */
/* ============================= */

.process-tracker {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 0 0 17px 0;
  width: 100%;
  max-width: 100%;
}

.process-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  position: relative;
  text-align: center;
}

.process-step:not(:last-child)::after {
  content: "";
  position: absolute;
  /* top: 26px; */
  top: 28px;
  right: -50%;
  width: 100%;
  height: 4px;
  background: #e5e7eb;
  z-index: 0;
}

.step-circle {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #e5e7eb;
  color: #6b7280;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  z-index: 1;
  position: relative;
  margin: 0 auto;
}

.step-label {
  margin-top: 8px;
  font-size: 13px;
  line-height: 1.2;
  max-width: 120px;
}

/* STATES */
.process-step.completed .step-circle {
  background: #2563eb; /* blue */
  color: #fff;
}

.process-step.completed::after {
  background: #2563eb;
}

.process-step.active .step-circle {
  background: #f59e0b; /* yellow */
  color: #fff;
}

.process-step.pending .step-circle {
  background: #d1d5db;
  color: #6b7280;
}

/* FULL-WIDTH TRACKER WRAPPER */
.tracker-wrapper {
  width: 100%;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}


/* FOR SCAN */

 /* ---------- HEADER ---------- */
        .dubai-header {
            background: linear-gradient(135deg, var(--dubai-blue), #145a86);
            color: #fff;
            padding: 16px;
            border-radius: var(--radius);
            margin-bottom: 0;
        }

        .dubai-header h1 {
            font-size: 20px;
        }

        .status-pill {
            display: inline-block;
            margin-top: 6px;
            padding: 6px 12px;
            background: rgba(255, 255, 255, 0.15);
            border-radius: 999px;
            font-size: 13px;
        }

        /* ---------- LAYOUT ---------- */
        .dashboard {
            display: grid;
            grid-template-columns: 1fr;
            gap: 16px;
            margin-top: 0;
        }

        /* Uniform spacing between cards within dashboard */
        .dashboard > div > .card + .card {
            margin-top: 13px;
        }

        /* Desktop layout */
        @media (min-width: 900px) {
            .dashboard {
                grid-template-columns: 1.2fr 0.8fr;
                align-items: start;
            }
            /* Dar verify: align Consignment & Phone Summary card bottoms */
            .dar-verify-dashboard {
                align-items: stretch;
            }
        }

        /* Mobile dashboard adjustments */
        @media (max-width: 768px) {
            .topbar {
                margin-top: 12px;
                margin-bottom: 12px;
            }
            
            .dashboard {
                gap: 12px;
                margin-top: 0;
            }

            .dashboard > div > .card + .card {
                margin-top: 12px;
            }
        }

        /* ---------- SCAN PANEL ---------- */
        .scan-panel {
            text-align: center;
        }

        .scan-button {
            width: 200px;
            height: 200px;
            border-radius: 50%;
            border: 4px solid var(--dubai-gold);
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 22px;
            font-weight: 700;
            margin: 20px auto;
            cursor: pointer;
            color: var(--dubai-blue);
            background: #fff;
        }

        @media (max-width: 768px) {
            .scan-button {
                width: 160px;
                height: 160px;
                font-size: 18px;
                margin: 15px auto;
            }

            .scan-panel {
                padding: 10px;
            }

            .counter {
                font-size: 20px;
            }
        }

        .scan-button span {
            display: block;
            font-size: 40px;
        }

        .scan-button.disabled {
            opacity: 0.5;
            pointer-events: none;
            }


        .scan-overlay {
            margin-top: 20px;
            height: 220px;
            background: #000;
            border-radius: 16px;
            position: relative;
        }

        /* Camera Box Styles */
        #cameraBox {
            position: relative;
            width: 100%;
            max-width: 100%;
            overflow: hidden;
        }

        #cameraBox #camera {
            width: 100%;
            height: 240px;
            background: #000;
            position: relative;
            overflow: hidden;
        }

        #cameraBox .btn-warning {
            position: absolute;
            top: 10px;
            right: 10px;
            z-index: 10;
            width: auto;
            padding: 8px 16px;
            font-size: 14px;
            border-radius: 8px;
            background: rgba(255, 193, 7, 0.9);
            backdrop-filter: blur(4px);
            box-shadow: 0 2px 8px rgba(0,0,0,0.3);
        }

        @media (max-width: 768px) {
            #cameraBox {
                margin-top: 10px;
                max-height: calc(100vh - 300px);
            }

            #cameraBox #camera {
                height: auto;
                min-height: 200px;
                max-height: calc(100vh - 320px);
                aspect-ratio: 4/3;
            }

            /* Ensure camera stays in viewport */
            #cameraBox {
                scroll-margin-top: 80px;
            }

            /* Scroll camera box into view when opened */
            #cameraBox[style*="block"] {
                scroll-behavior: smooth;
            }
        }

        .scan-box {
            position: absolute;
            top: 50%;
            left: 50%;
            width: 160px;
            height: 100px;
            border: 2px solid #00ff88;
            transform: translate(-50%, -50%);
        }

        /* ---------- SIDE PANEL ---------- */
        .batch-card label {
            font-size: 13px;
            color: var(--muted);
        }

        .qty-control {
            display: flex;
            gap: 8px;
        }

        .qty-control button {
            width: 48px;
        }

        /* ---------- RECENT SCANS (tabular, no borders) ---------- */
        .recent-list-wrap {
            max-height: 220px;
            overflow-y: auto;
            overflow-x: auto;
        }
        .recent-scans-table {
            width: 100%;
            border-collapse: collapse;
            border-spacing: 0;
        }
        .recent-scans-table th,
        .recent-scans-table td {
            padding: 8px 12px 8px 0;
            text-align: left;
            vertical-align: middle;
            border: none;
        }
        .recent-scans-table th:last-child,
        .recent-scans-table td:last-child {
            padding-right: 0;
        }
        .recent-scans-table thead th {
            font-size: 11px;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.5px;
            color: var(--muted, #666);
            padding-bottom: 6px;
        }
        .recent-scans-table .recent-th-action {
            width: 1%;
            padding-left: 12px;
            text-align: right;
        }
        .recent-scans-table tbody tr {
            border-bottom: 1px solid #eee;
        }
        .recent-scans-table tbody tr:last-child {
            border-bottom: none;
        }
        .recent-scans-table .recent-make {
            font-size: 13px;
            font-weight: 500;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }
        .recent-scans-table .recent-imei {
            font-family: monospace;
            font-size: 14px;
            white-space: nowrap;
        }
        .recent-scans-table .recent-delete-cell {
            width: 1%;
            padding-left: 12px;
            text-align: right;
            white-space: nowrap;
        }
        .recent-scans-table .recent-delete-btn {
            width: 22px;
            height: 22px;
            min-width: 22px;
            min-height: 22px;
            padding: 0;
            margin: 0;
            background: none;
            border: none;
            cursor: pointer;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            box-sizing: border-box;
            transition: background 0.2s;
        }
        .recent-scans-table .recent-delete-btn .recent-delete-icon {
            display: inline-block;
            width: 18px;
            height: 18px;
        }
        .recent-scans-table .recent-delete-btn .recent-delete-icon svg {
            display: block;
            width: 100%;
            height: 100%;
            fill: #c62828;
        }
        .recent-scans-table .recent-delete-btn:hover .recent-delete-icon svg {
            fill: #b71c1c;
        }
        .recent-scans-table .recent-delete-btn:hover {
            background: rgba(198, 40, 40, 0.12);
            border-radius: 4px;
        }
        .recent-scans-table .recent-delete-btn:active {
            background: rgba(198, 40, 40, 0.2);
        }
        .recent-item.ok .recent-imei {
            color: var(--success);
        }
        .recent-item.ok {
            color: inherit;
        }

        .recent-item.warn {
            color: var(--warning);
        }

        .recent-item.err {
            color: var(--danger);
        }
        .open-consignment-ref {
            color: var(--success);
        }

        /* ---------- DAR LIST: Consignment card ---------- */
        .dar-consignment-list .recent-item {
            margin-bottom: 14px;
        }
        .dar-consignment-list .recent-item:last-child {
            margin-bottom: 0;
        }
        .dar-consignment-list .dar-item-transit .dar-consignment-ref,
        .dar-consignment-list .dar-item-transit {
            color: var(--success);
        }

        /* ---------- CONSIGNMENT DETAILS CARD HEADER ---------- */
        .card-consignment-details .card-header-row {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 144px;
            margin-bottom: 12px;
        }
        .card-consignment-details .card-title {
            margin: 0;
            white-space: nowrap;
            flex: 1 1 auto;
            min-width: 0;
        }
        .card-consignment-details .edit-consignment-pencil {
            flex: 0 0 auto;
            margin-left: 72px;
            margin-right: 4px;
            background: none;
            border: none;
            cursor: pointer;
            padding: 6px 8px;
            font-size: 18px;
            line-height: 1;
            opacity: 0.85;
        }
        .card-consignment-details .edit-consignment-pencil:hover {
            opacity: 1;
        }

        /* ---------- FOOTER ---------- */
        .payment-calculation-card {
            margin-top: 13px;
            margin-bottom: 12px;
        }

        .dispatch-bar {
            margin-top: 16px;
            text-align: center;
        }

        /* ---------- PAYMENT FORM (DISPATCH-BAR) ---------- */
        /* Desktop layout (original) - preserved for large screens */
        .payment-form-container {
            display: grid;
            grid-template-columns: 1fr auto;
            gap: 20px;
            align-items: start;
        }

        .payment-form-fields {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 16px;
        }

        .payment-form-button {
            display: flex;
            align-items: flex-end;
            padding-top: 28px;
        }

        .payment-form-button .btn-success {
            padding: 14px 28px;
            white-space: nowrap;
            width: auto;
        }

        /* Mobile responsive payment form - only for small screens */
        @media (max-width: 768px) {
            .payment-form-container {
                grid-template-columns: 1fr !important;
                gap: 16px;
            }

            .payment-form-fields {
                grid-template-columns: 1fr !important;
                gap: 14px;
            }

            .payment-form-button {
                padding-top: 0 !important;
                width: 100%;
            }

            .payment-form-button .btn-success {
                width: 100% !important;
                padding: 14px 20px;
                white-space: normal;
            }

            .dispatch-bar h3 {
                font-size: 18px;
                margin-bottom: 16px;
            }

            .dispatch-bar label {
                font-size: 11px;
                margin-bottom: 5px;
            }

            .dispatch-bar input,
            .dispatch-bar select {
                padding: 10px;
                font-size: 16px; /* Prevents zoom on iOS */
            }
        }

        /* Ensure desktop layout is maintained on larger screens */
        @media (min-width: 769px) {
            .payment-form-container {
                display: grid;
                grid-template-columns: 1fr auto;
                gap: 20px;
                align-items: start;
            }

            .payment-form-fields {
                display: grid;
                grid-template-columns: repeat(2, 1fr);
                gap: 16px;
            }

            .payment-form-button {
                display: flex;
                align-items: flex-end;
                padding-top: 28px;
            }

            .payment-form-button .btn-success {
                padding: 14px 28px;
                white-space: nowrap;
                width: auto;
            }
        }

        .hidden-scan-input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

/* END FOR SCAN */

.scanner-input {
  position: fixed;
  top: -100px;      /* off-screen, NOT display:none */
  left: 0;
  width: 1px;
  height: 1px;
  opacity: 0;
}
/* TOAST/ALERT - INSIDE CONTAINER */
/* ===============================
   LOADER COMPONENT
   =============================== */
.loader-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999998;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.loader-overlay.show {
  opacity: 1;
  visibility: visible;
}

.loader-container {
  background: white;
  border-radius: 16px;
  padding: 32px 40px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  min-width: 200px;
}

.loader-spinner {
  width: 50px;
  height: 50px;
  border: 4px solid #f3f4f6;
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loader-text {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  margin: 0;
}

.loader-subtext {
  font-size: 13px;
  color: var(--muted);
  margin: 0;
}

/* Small inline loader */
.loader-inline {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid #f3f4f6;
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  vertical-align: middle;
  margin-right: 8px;
}

.toast {
  position: fixed;
  top: 14px;
  right: 14px;
  z-index: 999999;
  padding: 16px 20px;
  border-radius: 12px;
  font-weight: 600;
  color: #fff;
  opacity: 0;
  transform: translateX(20px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none;
  box-shadow: 0 8px 20px rgba(0,0,0,0.15);
  max-width: 350px;
  min-width: 280px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.toast.show {
  opacity: 1;
  transform: translateX(0);
}

.toast.success { 
  background: linear-gradient(135deg, #16a34a, #22c55e);
  border-left: 4px solid #15803d;
}

.toast.warning { 
  background: linear-gradient(135deg, #f59e0b, #fbbf24);
  border-left: 4px solid #d97706;
}

.toast.error { 
  background: linear-gradient(135deg, #dc2626, #ef4444);
  border-left: 4px solid #b91c1c;
}

/* Optional: Add close button */
.toast::after {
  content: "×";
  font-size: 22px;
  font-weight: 300;
  margin-left: 10px;
  cursor: pointer;
  pointer-events: auto;
}

.toast.hidden {
  display: none;
}

/* For mobile responsiveness */
@media (max-width: 768px) {
  .toast {
    top: 90px;
    right: 16px;
    left: auto;
    transform: translateX(20px);
    max-width: calc(100% - 32px);
    min-width: auto;
    width: auto;
  }
  
  .toast.show {
    transform: translateX(0);
  }
}


/* MODAL PHONE MAKE*/
/* MODAL PHONE MAKE*/
/* MODAL PHONE MAKE */
.modal {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal.hidden {
  display: none;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.45);
}

.modal-box {
  position: relative;
  z-index: 9001;
  background: #fff;
  padding: 24px;
  border-radius: 16px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.modal-box h3 {
  margin-bottom: 16px;
  text-align: center;
  color: var(--dubai-blue);
}

.modal-box select {
  width: 100%;
  padding: 14px;
  font-size: 16px;
  border-radius: 10px;
  border: 1px solid #ddd;
  margin-bottom: 20px;
  background-color: #f9fafb;
}

/* MODAL BUTTONS - SIDE BY SIDE */
.modal-actions {
  display: flex;
  gap: 12px;
  margin-top: 8px;
}

.modal-actions button {
  flex: 1;
  padding: 14px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.modal-actions button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.modal-actions .btn-warning {
  background: #f59e0b;
  color: white;
  border: none;
}

.modal-actions .btn-primary {
  background: var(--primary);
  color: white;
  border: none;
}

input:not(.scanner-input, .form-input),
    select:not(.form-input),
    textarea:not(.form-input) {
        pointer-events: auto !important;
    }
    
    .no-auto-focus {
        /* This class prevents elements from triggering scanner focus */
        pointer-events: auto !important; 
    }
/* Desktop: let tracker grow wider than mobile container */
@media (min-width: 992px) {
  .tracker-wrapper {
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
  }

  .process-tracker {
    width: 100%;
  }
}

/* MOBILE: BREAK TRACKER INTO 2 ROWS */
@media (max-width: 768px) {
  .process-tracker {
    flex-wrap: wrap;
    justify-content: center;
  }

  .process-step {
    flex: 0 0 33.333%;
    margin-bottom: 20px;
  }

  /* Remove long connector lines on mobile */
  .process-step:not(:last-child)::after {
    display: none;
  }
}

@media (max-width: 768px) {
  .step-label {
    font-size: 12px;
    max-width: 100px;
  }
}

/* Tablets */
@media (min-width: 768px) {
  .container {
    max-width: 90%;
  }
}

/* Laptops / desktops */
@media (min-width: 1200px) {
  .container {
    max-width: 70%;
  }
}

/* Very large screens */
@media (min-width: 1600px) {
  .container {
    max-width: 65%;
  }
}

/* Admin dashboard mobile responsiveness */
@media (max-width: 768px) {
  .admin-summary {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .summary-card {
    padding: 16px;
    gap: 12px;
  }

  .stat-icon {
    font-size: 28px;
  }

  .summary-card strong {
    font-size: 18px;
  }
  
  .summary-card h3 {
    font-size: 9px;
  }
  
  .stat-icon {
    font-size: 24px;
  }

  .table-container {
    overflow-x: scroll;
  }

  .admin-table {
    min-width: 800px;
  }

  .admin-table th,
  .admin-table td {
    padding: 10px 8px;
    font-size: 12px;
  }

  .quick-stat {
    padding: 12px;
  }

  .quick-stat-value {
    font-size: 20px;
  }

  .topbar {
    flex-direction: column;
    align-items: flex-start !important;
    gap: 12px;
  }

  .topbar > div:last-child {
    width: 100%;
    display: flex;
    gap: 8px;
  }

  .topbar .btn-primary,
  .topbar .btn-danger {
    flex: 1;
  }
}
