/* DispatchGo shared design system — used by login, driver app, and admin dashboard */

:root{
  /* Neutral & Base */
  --bg:#f8fafc;
  --card:#ffffff;
  --border:#e2e8f0;
  --border-subtle:#f1f5f9;
  --text:#1e293b;
  --muted:#64748b;
  --muted-2:#94a3b8;

  /* Brand / Primary */
  --navy:#0f2540;
  --navy-2:#1e3a5f;
  --navy-dark:#091728;
  --teal:#0f766e;
  --teal-dark:#0b5c56;
  --teal-light:#f0fdfa;
  --teal-border:#99f6e4;
  --accent:#f59e0b;
  --accent-light:#fef3c7;

  /* Semantic Statuses */
  --success:#16a34a;
  --success-dark:#15803d;
  --success-light:#dcfce7;
  --success-border:#bbf7d0;

  --warning:#d97706;
  --warning-dark:#b45309;
  --warning-light:#fef3c7;
  --warning-border:#fde68a;

  --danger:#dc2626;
  --danger-dark:#b91c1c;
  --danger-light:#fee2e2;
  --danger-border:#fecaca;

  --info:#2563eb;
  --info-dark:#1d4ed8;
  --info-light:#eff6ff;
  --info-border:#bfdbfe;

  /* Geometry & Elevation */
  --radius-xs:4px;
  --radius-sm:8px;
  --radius-md:12px;
  --radius-lg:16px;
  --radius-pill:999px;

  --shadow-sm:0 1px 2px rgba(15,37,64,.04);
  --shadow:0 1px 3px rgba(15,37,64,.05), 0 6px 16px rgba(15,37,64,.06);
  --shadow-md:0 4px 14px rgba(15,37,64,.08);
  --shadow-lg:0 12px 32px -4px rgba(15,37,64,.12);
  --shadow-modal:0 25px 60px -15px rgba(15,37,64,.25);
}

*{box-sizing:border-box;}

body{
  margin:0;
  font-family:'Inter',sans-serif;
  background:var(--bg);
  color:var(--text);
  -webkit-font-smoothing:antialiased;
}

/* Buttons */
.btn{
  font-family:inherit;font-size:13.5px;font-weight:600;
  border-radius:var(--radius-sm);padding:10px 16px;
  border:1px solid transparent;cursor:pointer;
  transition:opacity .15s, background .15s;
  text-align:center;white-space:nowrap;
}
.btn:hover{opacity:.9;}
.btn:disabled{opacity:.6;cursor:not-allowed;}
.btn-primary{background:var(--teal);color:#fff;}
.btn-outline{background:#fff;border-color:var(--border);color:var(--navy);}
.btn-danger-outline{background:#fff;border-color:var(--danger-border);color:var(--danger);}
.btn-sm{padding:7px 12px;font-size:12.5px;}
.btn-block{width:100%;}

/* Badges */
.badge{
  display:inline-flex;align-items:center;gap:5px;
  padding:4px 10px;border-radius:var(--radius-pill);
  font-size:11px;font-weight:700;letter-spacing:.2px;
  white-space:nowrap;box-sizing:border-box;
}

/* Generic Semantic Badges */
.badge.b-success{background:var(--success-light);color:var(--success-dark);border:1px solid var(--success-border);}
.badge.b-warning{background:var(--warning-light);color:var(--warning-dark);border:1px solid var(--warning-border);}
.badge.b-danger{background:var(--danger-light);color:var(--danger-dark);border:1px solid var(--danger-border);}
.badge.b-info{background:var(--info-light);color:var(--info-dark);border:1px solid var(--info-border);}
.badge.b-neutral{background:#f1f5f9;color:var(--muted);border:1px solid var(--border);}
.badge.b-teal{background:var(--teal-light);color:var(--teal-dark);border:1px solid var(--teal-border);}

/* Backward-compatible Status Badges */
.badge.b-available{background:var(--teal-light);color:var(--teal-dark);border:1px solid var(--teal-border);}
.badge.b-assigned{background:var(--warning-light);color:var(--warning-dark);border:1px solid var(--warning-border);}
.badge.b-pending{background:var(--warning-light);color:var(--warning-dark);border:1px solid var(--warning-border);}
.badge.b-ongoing{background:var(--info-light);color:var(--info-dark);border:1px solid var(--info-border);}
.badge.b-completed{background:var(--success-light);color:var(--success-dark);border:1px solid var(--success-border);}
.badge.b-na{background:#f1f5f9;color:var(--muted);border:1px solid var(--border);}
.badge.b-rejected{background:var(--danger-light);color:var(--danger-dark);border:1px solid var(--danger-border);}
.badge.b-status-active{background:var(--success-light);color:var(--success-dark);border:1px solid var(--success-border);}
.badge.b-status-suspended{background:var(--danger-light);color:var(--danger-dark);border:1px solid var(--danger-border);}
.badge.b-role-admin{background:var(--info-light);color:var(--info-dark);border:1px solid var(--info-border);}
.badge.b-role-driver{background:var(--teal-light);color:var(--teal-dark);border:1px solid var(--teal-border);}
.badge.b-fleet{background:#f1f5f9;color:#334155;border:1px solid #cbd5e1;font-weight:600;font-size:11px;padding:3px 8px;border-radius:6px;}

/* Cards & panels */
.card, .panel{
  background:var(--card);
  border:1px solid var(--border);
  border-radius:var(--radius-lg);
  box-shadow:var(--shadow);
  overflow:hidden;
}

/* Form fields */
.field{margin-bottom:14px;}
.field label{display:block;font-size:12px;font-weight:600;color:var(--muted);margin-bottom:6px;}
.field input, .field select, .field textarea{
  width:100%;padding:11px 12px;border:1px solid var(--border);border-radius:var(--radius-sm);
  font-family:inherit;font-size:13.5px;color:var(--text);background:#fafbfc;
}
.field input:focus, .field select:focus, .field textarea:focus{outline:2px solid var(--teal-light);border-color:var(--teal);background:#fff;}
.field-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px;}
.field-hint{font-size:11.5px;color:var(--muted-2);margin-top:5px;}

/* Checkboxes */
.checkbox-group label {
  display: inline-flex !important;
  align-items: center;
  gap: 6px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 0 !important;
  cursor: pointer;
  white-space: nowrap;
}
.checkbox-group input[type="checkbox"] {
  width: auto !important;
  padding: 0 !important;
  margin: 0 !important;
  cursor: pointer;
}

/* Alerts */
.alert{
  border-radius:var(--radius-sm);
  padding:10px 14px;
  font-size:12.5px;
  font-weight:500;
  margin-bottom:16px;
  display:none;
}
.alert.show{display:block;}
.alert-error{background:#fde8e8;color:#b91c1c;border:1px solid #f6bcbc;}
.alert-success{background:var(--teal-light);color:var(--teal-dark);border:1px solid #b7e6e1;}

/* Avatar */
.avatar{
  border-radius:50%;background:var(--teal);color:#fff;
  display:flex;align-items:center;justify-content:center;font-weight:700;flex-shrink:0;
}

/* Segmented control */
.segmented{display:inline-flex;background:#eef1f5;border-radius:999px;padding:4px;}
.segmented button{
  border:none;background:transparent;padding:8px 18px;
  font-family:inherit;font-size:12.5px;font-weight:600;color:var(--muted);
  border-radius:999px;cursor:pointer;
}
.segmented button.active{background:#fff;color:var(--navy);box-shadow:0 1px 3px rgba(15,37,64,.12);}

/* Tables */
table{width:100%;border-collapse:collapse;}
thead th{
  position:relative;
  text-align:left;font-size:11px;font-weight:700;color:var(--muted);
  text-transform:uppercase;letter-spacing:.3px;
  padding:12px 20px;background:#fbfcfd;border-bottom:1px solid var(--border);
  user-select:none;
}
.th-resizer{
  position:absolute;top:0;right:0;width:8px;cursor:col-resize;
  user-select:none;height:100%;z-index:10;
}
.th-resizer::after{
  content:'';position:absolute;top:20%;bottom:20%;right:2px;width:2px;
  border-radius:1px;background:transparent;transition:background 0.15s ease;
}
.th-resizer:hover::after,
.th-resizer.resizing::after{
  background:var(--teal, #0d9488);
}
.th-resizer.resizing{
  background:rgba(13, 148, 136, 0.08);
}
tbody td{
  padding:14px 20px;font-size:13.5px;color:var(--text);
  border-bottom:1px solid var(--border);
}
tbody tr:last-child td{border-bottom:none;}
tbody tr:hover{background:#fafbfd;}
.cell-name{font-weight:600;color:var(--navy);}
.cell-sub{font-size:11.5px;color:var(--muted-2);margin-top:2px;}

/* Pagination */
.pagination-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  background: #fff;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 13px;
}
.pagination-info {
  color: var(--muted);
  font-size: 12.5px;
}
.pagination-info strong {
  color: var(--navy);
  font-weight: 600;
}
.pagination-controls {
  display: flex;
  align-items: center;
  gap: 4px;
}
.page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  height: 30px;
  padding: 0 8px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--navy);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
  font-family: inherit;
}
.page-btn:hover:not(:disabled) {
  background: #f1f5f9;
  border-color: #cbd5e1;
}
.page-btn.active {
  background: var(--teal, #0d9488);
  border-color: var(--teal, #0d9488);
  color: #fff;
}
.page-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.page-size-select {
  height: 30px;
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 12px;
  background: #fff;
  color: var(--navy);
  outline: none;
  cursor: pointer;
  margin-right: 6px;
  font-family: inherit;
}

/* Modal */
.modal-overlay{
  position:fixed;inset:0;background:rgba(15,37,64,.45);
  backdrop-filter:blur(4px);-webkit-backdrop-filter:blur(4px);
  display:none;align-items:center;justify-content:center;z-index:50;padding:16px;
}
.modal-overlay.active{display:flex;}
.modal{
  background:#fff;border-radius:var(--radius-lg);width:480px;max-width:100%;
  box-shadow:0 20px 60px rgba(15,37,64,.25);overflow:hidden;
  max-height:90vh;display:flex;flex-direction:column;
}
.modal-head{
  padding:18px 22px;border-bottom:1px solid var(--border);
  display:flex;justify-content:space-between;align-items:center;flex-shrink:0;
}
.modal-head h3{margin:0;font-size:15.5px;font-weight:700;color:var(--navy);}
.modal-close{border:none;background:none;font-size:18px;color:var(--muted-2);cursor:pointer;}
.modal-body{padding:20px 22px;overflow-y:auto;}
.modal-foot{padding:16px 22px;border-top:1px solid var(--border);display:flex;justify-content:flex-end;gap:10px;flex-shrink:0;flex-wrap:wrap;}
.detail-row{display:flex;justify-content:space-between;padding:9px 0;border-bottom:1px solid var(--border);font-size:13px;gap:12px;}
.detail-row:last-child{border-bottom:none;}
.detail-row .k{color:var(--muted);flex-shrink:0;}
.detail-row .v{font-weight:600;color:var(--navy);text-align:right;word-break:break-word;}

/* Loading spinner */
.spinner{
  width:16px;height:16px;border-radius:50%;
  border:2px solid rgba(255,255,255,.4);border-top-color:#fff;
  display:inline-block;animation:spin .7s linear infinite;vertical-align:-3px;
}
@keyframes spin{to{transform:rotate(360deg);}}

/* ==========================================================================
   Universal UI Controls & Utilities
   ========================================================================== */

/* Universal Search Field */
.search {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 7px 14px 7px 32px;
  font-size: 12.5px;
  color: var(--navy);
  width: 230px;
  font-family: inherit;
  outline: none;
  transition: all 0.2s ease;
  box-sizing: border-box;
}
.search:focus {
  background: #fff;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}

/* Universal Filter Pill */
.filter-pill {
  height: 34px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  font-size: 12.5px;
  background: #fff;
  color: var(--navy);
  font-family: inherit;
  outline: none;
  transition: all 0.2s ease;
  box-sizing: border-box;
}
.filter-pill:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}

/* Monospaced aligned phone number */
.cell-phone {
  display: inline-block;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 12.5px;
  font-weight: 500;
  color: #334155;
  letter-spacing: 0.3px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* Standard KPI & Stats Card (Style 2 - Minimalist Border & Clean Typography) */
.stat-card, .kpi-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
  box-sizing: border-box;
}
.stat-card:hover, .kpi-card:hover {
  border-color: #cbd5e1;
  box-shadow: var(--shadow-md);
}
.stat-card .lbl, .kpi-card .lbl {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 8px;
}
.stat-card .val, .kpi-card .val {
  font-size: 24px;
  font-weight: 800;
  color: var(--navy);
  line-height: 1.2;
}
.stat-card .sub, .kpi-card .sub {
  font-size: 11.5px;
  color: var(--muted-2);
  margin-top: 4px;
}



