/* ==========================================================================
   ASLAN CLEANING SYSTEM - STYLESHEET (GLASSMORPHISM & MODERN DARK UI)
   ========================================================================== */

:root {
  --bg-dark: #0f172a;
  --bg-card: rgba(30, 41, 59, 0.7);
  --bg-card-hover: rgba(30, 41, 59, 0.9);
  --border-glass: rgba(255, 255, 255, 0.1);
  --border-gold: rgba(217, 119, 6, 0.4);
  
  --color-primary: #3b82f6;
  --color-primary-light: #60a5fa;
  --color-accent: #f59e0b;
  --color-gold: #fbbf24;
  --color-success: #10b981;
  --color-warning: #f97316;
  --color-danger: #ef4444;
  --color-purple: #8b5cf6;
  
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
  
  --shadow-lg: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 20px rgba(59, 130, 246, 0.15);
  --font-family: 'Cairo', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

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

body.bg-dark {
  background-color: var(--bg-dark);
  background-image: 
    radial-gradient(at 0% 0%, rgba(59, 130, 246, 0.15) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(217, 119, 6, 0.1) 0px, transparent 50%);
  background-attachment: fixed;
  color: var(--text-main);
  font-family: var(--font-family);
  min-height: 100vh;
  line-height: 1.6;
}

/* THEME DIRECTION */
.theme-rtl { dir: rtl; text-align: right; }
.theme-ltr { dir: ltr; text-align: left; }

/* HEADER & NAV */
.app-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-glass);
  padding: 0.75rem 1.5rem;
}

.header-container {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-logo-img {
  height: 42px;
  width: 42px;
  object-fit: cover;
  border-radius: 50%;
  border: 2px solid var(--color-gold);
  box-shadow: 0 0 10px rgba(217, 119, 6, 0.4);
}

.brand-titles h1 {
  font-size: 1.25rem;
  font-weight: 800;
  background: linear-gradient(135deg, #fff 0%, #fbbf24 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.user-profile-widget {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: rgba(255, 255, 255, 0.05);
  padding: 0.4rem 0.8rem;
  border-radius: 30px;
  border: 1px solid var(--border-glass);
}

.user-avatar-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}

.user-info-text {
  display: flex;
  flex-direction: column;
}

.user-name {
  font-size: 0.85rem;
  font-weight: 700;
}

.user-role-badge {
  font-size: 0.65rem;
}

/* MAIN LAYOUT */
.main-content {
  max-width: 1400px;
  margin: 0 auto;
  padding: 1.5rem;
}

/* GLASS CARDS */
.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-lg);
  transition: all 0.3s ease;
}

.glass-card:hover {
  border-color: rgba(255, 255, 255, 0.2);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-glass);
}

.card-header h3 {
  font-size: 1.15rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* ROLE VIEWS CONTROLLER */
.role-view {
  display: none;
}

.role-view.active {
  display: block;
  animation: fadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* LOGIN SCREEN */
.login-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 80vh;
}

.login-card {
  width: 100%;
  max-width: 440px;
  text-align: center;
}

.login-logo-img {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 3px solid var(--color-gold);
  margin-bottom: 1rem;
  box-shadow: 0 0 20px rgba(217, 119, 6, 0.5);
}

.login-header h2 {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 0.4rem;
}

.sub-text {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.login-form {
  margin-top: 1.5rem;
  text-align: right;
}

.quick-btns {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 0.5rem;
}

/* FORM ELEMENTS */
.form-group {
  margin-bottom: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.form-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}

input[type="text"],
input[type="password"],
input[type="tel"],
input[type="number"],
input[type="date"],
select,
textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  color: #fff;
  font-family: inherit;
  font-size: 0.95rem;
  transition: all 0.2s ease;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
  background: rgba(15, 23, 42, 0.9);
}

.input-with-btn {
  display: flex;
  gap: 0.5rem;
}

.form-row {
  display: flex;
  gap: 1rem;
}

.form-row > * {
  flex: 1;
}

.flex-2 { flex: 2; }
.flex-3 { flex: 3; }

/* BUTTONS */
button, .btn {
  cursor: pointer;
  border: none;
  font-family: inherit;
  font-weight: 700;
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.btn-primary {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  color: #fff;
  padding: 0.75rem 1.25rem;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
  transform: translateY(-1px);
}

.btn-accent {
  background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
  color: #fff;
  padding: 0.5rem 1rem;
}

.btn-danger {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.4);
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.4);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border-glass);
  color: var(--text-main);
  padding: 0.5rem 1rem;
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.3);
}

.btn-block { width: 100%; }
.btn-lg { padding: 0.9rem 1.5rem; font-size: 1.05rem; }
.btn-sm { padding: 0.4rem 0.8rem; font-size: 0.8rem; border-radius: var(--radius-sm); }

.icon-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  color: var(--text-main);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.icon-btn:hover {
  background: rgba(255, 255, 255, 0.15);
}

/* BADGES */
.badge {
  padding: 0.25rem 0.6rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.badge-primary { background: rgba(59, 130, 246, 0.2); color: #60a5fa; border: 1px solid rgba(59, 130, 246, 0.4); }
.badge-accent { background: rgba(245, 158, 11, 0.2); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.4); }
.badge-success { background: rgba(16, 185, 129, 0.2); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.4); }
.badge-warning { background: rgba(249, 115, 22, 0.2); color: #fb923c; border: 1px solid rgba(249, 115, 22, 0.4); }
.badge-danger { background: rgba(239, 68, 68, 0.2); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.4); }
.badge-purple { background: rgba(139, 92, 246, 0.2); color: #c084fc; border: 1px solid rgba(139, 92, 246, 0.4); }
.badge-info { background: rgba(14, 165, 233, 0.2); color: #38bdf8; border: 1px solid rgba(14, 165, 233, 0.4); }

/* GRID LAYOUTS */
.view-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 1.5rem;
}

@media (max-width: 1024px) {
  .view-grid {
    grid-template-columns: 1fr;
  }
}

.margin-top { margin-top: 1.5rem; }
.margin-bottom { margin-bottom: 1.5rem; }

/* CALL CENTER ITEMS & PRICING */
.carpet-item-row {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  background: rgba(15, 23, 42, 0.4);
  padding: 0.75rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-glass);
  margin-bottom: 0.5rem;
}

.item-calc {
  font-weight: 700;
  color: var(--color-gold);
  min-width: 70px;
}

.btn-remove-item {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
}

.order-pricing-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
  background: rgba(0, 0, 0, 0.3);
  padding: 1rem;
  border-radius: var(--radius-md);
}

.summary-item {
  display: flex;
  flex-direction: column;
  font-size: 0.85rem;
}

.summary-item.total-item strong {
  font-size: 1.25rem;
}

/* LEAFLET MAP CONTAINERS */
.leaflet-map-container {
  height: 250px;
  width: 100%;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-glass);
}

.leaflet-map-container-lg {
  height: 500px;
  width: 100%;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-glass);
}

/* DRIVER TABS & STATUS */
.driver-profile-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.driver-info {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.driver-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--color-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  color: #fff;
}

.driver-status-toggle {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.btn-group {
  display: flex;
  background: rgba(0, 0, 0, 0.3);
  padding: 0.25rem;
  border-radius: var(--radius-md);
}

.btn-status {
  padding: 0.4rem 0.8rem;
  font-size: 0.8rem;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-muted);
}

.btn-status.active-online { background: rgba(16, 185, 129, 0.2); color: #34d399; }
.btn-status.active-offline { background: rgba(239, 68, 68, 0.2); color: #f87171; }
.btn-status.active-busy { background: rgba(245, 158, 11, 0.2); color: #fbbf24; }

.driver-tabs {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  overflow-x: auto;
}

.driver-tab-btn {
  padding: 0.75rem 1.25rem;
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-size: 0.9rem;
  white-space: nowrap;
}

.driver-tab-btn.active {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary-light);
  box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

.driver-tab-content {
  display: none;
}

.driver-tab-content.active {
  display: block;
}

.orders-grid-driver {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.25rem;
}

.driver-order-card {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  position: relative;
}

.distance-badge {
  position: absolute;
  top: 1rem;
  left: 1rem;
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
}

.action-buttons-group {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
}

.btn-action-icon {
  flex: 1;
  padding: 0.5rem;
  font-size: 0.8rem;
  border-radius: var(--radius-sm);
  text-decoration: none;
  text-align: center;
  color: #fff;
}

.btn-call { background: #2563eb; }
.btn-whatsapp { background: #059669; }
.btn-nav { background: #d97706; }

/* METRICS GRID */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.25rem;
}

.metric-card {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.metric-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.bg-primary-light { background: rgba(59, 130, 246, 0.2); color: #60a5fa; }
.bg-warning-light { background: rgba(245, 158, 11, 0.2); color: #fbbf24; }
.bg-info-light { background: rgba(14, 165, 233, 0.2); color: #38bdf8; }
.bg-success-light { background: rgba(16, 185, 129, 0.2); color: #34d399; }
.bg-accent-light { background: rgba(217, 119, 6, 0.2); color: #f59e0b; }

.metric-title {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.metric-data h3 {
  font-size: 1.4rem;
  font-weight: 800;
}

/* DATA TABLES */
.table-responsive {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: right;
}

.data-table th, .data-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-glass);
}

.data-table th {
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 700;
}

.data-table tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

/* UTILS */
.text-gold { color: var(--color-gold); }
.text-primary { color: var(--color-primary-light); }
.hidden { display: none !important; }
.alert { padding: 0.75rem 1rem; border-radius: var(--radius-md); font-size: 0.85rem; }
.alert-danger { background: rgba(239, 68, 68, 0.2); border: 1px solid rgba(239, 68, 68, 0.4); color: #f87171; }

/* TOAST NOTIFICATION CONTAINER & LUXURY GLASS CARDS */
.toast-container {
  position: fixed;
  top: 25px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
  width: 92%;
  max-width: 460px;
}

.toast-card {
  pointer-events: auto;
  background: rgba(18, 18, 30, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(251, 191, 36, 0.4);
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.7), 0 0 20px rgba(251, 191, 36, 0.2);
  border-radius: 14px;
  padding: 1rem 1.2rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  color: #ffffff;
  animation: toastSlideDown 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
  transition: all 0.3s ease;
}

.toast-card.toast-success {
  border-right: 6px solid #25D366;
  box-shadow: 0 10px 30px rgba(0,0,0,0.6), 0 0 18px rgba(37, 211, 102, 0.3);
}

.toast-card.toast-error {
  border-right: 6px solid #ef4444;
  box-shadow: 0 10px 30px rgba(0,0,0,0.6), 0 0 18px rgba(239, 68, 68, 0.3);
}

.toast-card.toast-warning {
  border-right: 6px solid #fbbf24;
  box-shadow: 0 10px 30px rgba(0,0,0,0.6), 0 0 18px rgba(251, 191, 36, 0.3);
}

.toast-icon {
  font-size: 1.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  flex-shrink: 0;
}

.toast-success .toast-icon {
  background: rgba(37, 211, 102, 0.18);
  color: #25D366;
}

.toast-error .toast-icon {
  background: rgba(239, 68, 68, 0.18);
  color: #ef4444;
}

.toast-warning .toast-icon {
  background: rgba(251, 191, 36, 0.18);
  color: #fbbf24;
}

.toast-content {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.toast-title {
  font-weight: 800;
  font-size: 0.98rem;
  color: #fbbf24;
  margin-bottom: 2px;
}

.toast-message {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.95);
  line-height: 1.4;
  font-weight: 600;
}

.toast-close {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.5);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 4px;
  transition: color 0.2s;
}

.toast-close:hover {
  color: #ffffff;
}

@keyframes toastSlideDown {
  from {
    opacity: 0;
    transform: translateY(-35px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes toastFadeOut {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateY(-25px) scale(0.9);
  }
}

/* MODALS & OVERLAYS */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 2000;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 1rem;
}

.modal-card {
  width: 100%;
  max-width: 650px;
  max-height: 90vh;
  overflow-y: auto;
  animation: modalPop 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalPop {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-glass);
  padding-bottom: 0.75rem;
}

/* PRIORITY ALERT CHIPS & PULSE */
.priority-chip {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.5rem 0.75rem;
  border-radius: 10px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}
.priority-chip strong {
  font-size: 0.95rem;
  font-weight: 800;
  margin-right: auto;
}
.priority-chip-overdue {
  background: rgba(239, 68, 68, 0.15);
  border: 1.5px solid rgba(239, 68, 68, 0.5);
  color: #fca5a5;
}
.priority-chip-overdue:hover {
  background: rgba(239, 68, 68, 0.25);
  transform: translateY(-1px);
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.3);
}
.priority-chip-vip {
  background: rgba(245, 158, 11, 0.15);
  border: 1.5px solid rgba(245, 158, 11, 0.5);
  color: #fde68a;
}
.priority-chip-vip:hover {
  background: rgba(245, 158, 11, 0.25);
  transform: translateY(-1px);
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.3);
}

.pulse-indicator {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
}
.pulse-red {
  background: #ef4444;
  box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
  animation: pulseRed 1.6s infinite;
}
@keyframes pulseRed {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(239, 68, 68, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

/* OVERDUE & VIP CARD STYLES */
.order-card.card-overdue {
  border: 1.5px solid #ef4444 !important;
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.12), rgba(15, 23, 42, 0.95)) !important;
  box-shadow: 0 0 15px rgba(239, 68, 68, 0.25) !important;
  position: relative;
}

.order-card.card-vip {
  border: 1.5px solid #f59e0b !important;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.12), rgba(15, 23, 42, 0.95)) !important;
  box-shadow: 0 0 15px rgba(245, 158, 11, 0.25) !important;
}

.order-card.card-overdue.card-vip {
  border: 1.5px solid #f97316 !important;
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.15), rgba(245, 158, 11, 0.15)) !important;
  box-shadow: 0 0 18px rgba(249, 115, 22, 0.35) !important;
}

.badge-overdue {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
  border: 1px solid #ef4444;
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.badge-vip {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.3), rgba(217, 119, 6, 0.3));
  color: #fcd34d;
  border: 1px solid #f59e0b;
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.overdue-alert-banner {
  background: rgba(239, 68, 68, 0.18);
  border-right: 3px solid #ef4444;
  padding: 0.4rem 0.6rem;
  border-radius: 6px;
  font-size: 0.78rem;
  color: #fca5a5;
  margin-top: 0.45rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
}

.vip-badge-banner {
  background: rgba(245, 158, 11, 0.18);
  border-right: 3px solid #f59e0b;
  padding: 0.35rem 0.6rem;
  border-radius: 6px;
  font-size: 0.78rem;
  color: #fde68a;
  margin-top: 0.45rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* User Management Specific Styles */
.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1rem;
  color: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.user-avatar.admin {
  background: linear-gradient(135deg, #8b5cf6, #d946ef);
}

.user-avatar.callcenter {
  background: linear-gradient(135deg, #0284c7, #38bdf8);
}

.user-avatar.driver {
  background: linear-gradient(135deg, #059669, #10b981);
}

.role-badge-admin {
  background: rgba(139, 92, 246, 0.2);
  color: #c084fc;
  border: 1px solid rgba(139, 92, 246, 0.4);
  padding: 0.25rem 0.6rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.role-badge-callcenter {
  background: rgba(2, 132, 199, 0.2);
  color: #38bdf8;
  border: 1px solid rgba(2, 132, 199, 0.4);
  padding: 0.25rem 0.6rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.role-badge-driver {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.4);
  padding: 0.25rem 0.6rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.password-box {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  font-family: monospace;
  font-size: 0.85rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.password-toggle-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px 4px;
  transition: color 0.2s;
}

.password-toggle-btn:hover {
  color: var(--color-gold);
}

.user-status-pill {
  padding: 0.25rem 0.6rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
  transition: all 0.2s;
}

.user-status-pill.active {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.user-status-pill.inactive {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.4);
}

.user-status-pill:hover {
  transform: scale(1.05);
}

/* ==========================================================================
   MODERN SIDEBAR & ENTERPRISE NAVIGATION
   ========================================================================== */

.sidebar-toggle-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-glass);
  color: #fff;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 1.1rem;
  margin-left: 0.75rem;
}

.sidebar-toggle-btn:hover {
  background: rgba(251, 191, 36, 0.2);
  color: var(--color-gold);
  border-color: var(--color-gold);
}

.app-layout-wrapper {
  display: flex;
  min-height: calc(100vh - 65px);
  position: relative;
  width: 100%;
}

.app-sidebar {
  width: 280px;
  flex-shrink: 0;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-left: 1px solid var(--border-glass);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 65px;
  height: calc(100vh - 65px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 850;
  overflow: hidden;
}

.app-sidebar.collapsed {
  width: 78px;
}

.sidebar-content-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

/* User Profile card inside sidebar */
.sidebar-user-card {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.8), rgba(15, 23, 42, 0.8));
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  transition: all 0.2s;
}

.app-sidebar.collapsed .sidebar-user-card {
  padding: 0.4rem;
  justify-content: center;
}

.app-sidebar.collapsed .sidebar-user-info,
.app-sidebar.collapsed .side-nav-text,
.app-sidebar.collapsed .side-nav-group-title,
.app-sidebar.collapsed .side-badge,
.app-sidebar.collapsed .side-footer-btn span {
  display: none !important;
}

.side-nav-group {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.side-nav-group-title {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 0.35rem 0.6rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.side-nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 0.85rem;
  border-radius: 10px;
  color: var(--text-main);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.92rem;
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  width: 100%;
  text-align: right;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.side-nav-link i.nav-icon {
  width: 24px;
  font-size: 1.15rem;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  color: var(--text-muted);
  transition: color 0.2s, transform 0.2s;
  flex-shrink: 0;
}

.side-nav-link:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.1);
}

.side-nav-link:hover i.nav-icon {
  color: var(--color-gold);
  transform: scale(1.15);
}

.side-nav-link.active {
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.18), rgba(217, 119, 6, 0.12));
  border-color: rgba(251, 191, 36, 0.4);
  color: #fde68a;
  box-shadow: 0 4px 15px rgba(217, 119, 6, 0.15);
}

.side-nav-link.active i.nav-icon {
  color: var(--color-gold);
}

.side-badge {
  margin-right: auto;
  padding: 0.2rem 0.55rem;
  border-radius: 12px;
  font-size: 0.72rem;
  font-weight: 800;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.app-sidebar.collapsed .side-nav-link {
  justify-content: center;
  padding: 0.75rem;
}

.sidebar-footer {
  padding: 0.75rem;
  border-top: 1px solid var(--border-glass);
  background: rgba(10, 15, 30, 0.7);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.side-footer-btn {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  width: 100%;
}

.side-footer-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
}

.main-content-container {
  flex: 1;
  min-width: 0;
  padding: 1.5rem;
  max-width: 1400px;
}

/* Modern Compact Admin Sub-Navbar */
.admin-sub-navbar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid var(--border-glass);
  padding: 0.45rem;
  border-radius: 12px;
  overflow-x: auto;
}

.nav-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 1.1rem;
  border-radius: 8px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.nav-pill-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}

.nav-pill-btn.active {
  background: var(--color-primary);
  color: #fff;
  box-shadow: 0 2px 10px rgba(59, 130, 246, 0.3);
}

/* Sidebar Mobile Drawer Header (Desktop Hidden) */
.sidebar-mobile-header {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1rem;
  background: rgba(10, 15, 30, 0.95);
  border-bottom: 1px solid var(--border-glass);
  flex-shrink: 0;
}

.sidebar-mobile-title {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 800;
  font-size: 1rem;
  color: #fff;
}

.sidebar-mobile-close-btn {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.sidebar-mobile-close-btn:hover {
  background: rgba(239, 68, 68, 0.25);
  color: #ef4444;
  border-color: #ef4444;
}

.sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 2400;
  transition: opacity 0.3s ease;
}

.sidebar-backdrop.hidden {
  display: none !important;
}

/* ==========================================================================
   MOBILE RESPONSIVENESS & OFF-CANVAS SIDEBAR DRAWER (max-width: 991px)
   ========================================================================== */
@media (max-width: 991px) {
  html, body {
    overflow-x: hidden !important;
    position: relative;
    width: 100%;
  }

  .app-layout-wrapper {
    display: block !important;
    width: 100% !important;
    overflow-x: hidden !important;
    min-height: calc(100vh - 60px);
  }

  /* OFF-CANVAS MOBILE DRAWER - Bulletproof RTL sliding */
  .app-sidebar {
    position: fixed !important;
    top: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    left: auto !important;
    height: 100vh !important;
    height: 100dvh !important;
    width: 310px !important;
    max-width: 86vw !important;
    z-index: 2500 !important;
    background: rgba(13, 19, 36, 0.98) !important;
    backdrop-filter: blur(25px) !important;
    -webkit-backdrop-filter: blur(25px) !important;
    border-left: 1px solid rgba(212, 175, 55, 0.35) !important;
    box-shadow: none !important;
    /* Slide off-screen cleanly using transform without horizontal scroll bleeding */
    transform: translateX(105%) !important;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s ease !important;
    visibility: hidden !important;
    pointer-events: none !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
  }

  /* Drawer Opened State */
  .app-sidebar.mobile-open {
    transform: translateX(0) !important;
    visibility: visible !important;
    pointer-events: auto !important;
    box-shadow: -10px 0 35px rgba(0, 0, 0, 0.85) !important;
  }

  /* Show mobile header with close X button */
  .sidebar-mobile-header {
    display: flex !important;
  }

  /* Ensure labels are visible in mobile drawer even if collapsed was toggled */
  .app-sidebar.collapsed {
    width: 310px !important;
    max-width: 86vw !important;
  }

  .app-sidebar.collapsed .sidebar-user-card {
    padding: 0.75rem !important;
    justify-content: flex-start !important;
  }

  .app-sidebar.collapsed .sidebar-user-info,
  .app-sidebar.collapsed .side-nav-text,
  .app-sidebar.collapsed .side-nav-group-title,
  .app-sidebar.collapsed .side-badge,
  .app-sidebar.collapsed .side-footer-btn span {
    display: initial !important;
  }

  .app-sidebar.collapsed .side-nav-link {
    justify-content: flex-start !important;
    padding: 0.7rem 0.85rem !important;
  }

  /* MAIN CONTENT ON MOBILE */
  .main-content-container {
    padding: 0.75rem 0.5rem !important;
    width: 100% !important;
    max-width: 100vw !important;
    box-sizing: border-box !important;
    overflow-x: hidden !important;
  }

  /* HEADER ADAPTATION */
  .app-header {
    padding: 0.5rem 0.75rem !important;
  }

  .brand-logo {
    gap: 0.45rem !important;
  }

  .brand-logo-img {
    height: 34px !important;
    width: 34px !important;
  }

  .brand-titles h1 {
    font-size: 1.05rem !important;
  }

  .brand-subtitle {
    display: none !important;
  }

  .sidebar-toggle-btn {
    width: 36px !important;
    height: 36px !important;
    margin-left: 0.35rem !important;
    font-size: 1.05rem !important;
  }

  .user-profile-widget {
    padding: 0.25rem 0.5rem !important;
  }

  .user-info-text {
    display: none !important;
  }

  /* Admin sub-navbar horizontal swiping capsules */
  .admin-sub-navbar {
    padding: 0.35rem !important;
    gap: 0.35rem !important;
    white-space: nowrap !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }

  .nav-pill-btn {
    padding: 0.45rem 0.85rem !important;
    font-size: 0.82rem !important;
  }

  /* Forms and Inputs */
  .form-row {
    flex-direction: column !important;
    gap: 0.75rem !important;
  }

  .form-group.flex-2,
  .form-group.flex-3 {
    width: 100% !important;
    flex: 1 1 100% !important;
  }

  .input-with-btn {
    flex-wrap: wrap;
  }

  .input-with-btn input {
    flex: 1 1 200px;
  }

  /* Filter bars */
  .filter-bar {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0.65rem !important;
  }

  .filter-bar input,
  .filter-bar select {
    width: 100% !important;
    min-width: 0 !important;
  }

  /* Modal cards fill mobile screen neatly */
  .modal-overlay {
    padding: 0.5rem !important;
  }

  .modal-card {
    max-height: 94vh !important;
    border-radius: 12px !important;
    padding: 1rem !important;
  }

  /* Cards grid adapts to single column on mobile */
  .orders-cards-list {
    grid-template-columns: 1fr !important;
  }

  /* Order pricing summary */
  .order-pricing-summary {
    grid-template-columns: 1fr 1fr !important;
    gap: 0.65rem !important;
    padding: 0.75rem !important;
  }
}

@media (max-width: 540px) {
  .city-radio-group {
    grid-template-columns: 1fr !important;
    gap: 0.65rem !important;
  }

  .city-radio-card {
    padding: 0.75rem 0.9rem !important;
  }

  .order-pricing-summary {
    grid-template-columns: 1fr !important;
  }
}

/* ==========================================================================
   CITY SELECTOR RADIO CARDS (عمان / الزرقاء)
   ========================================================================== */
.city-selector-wrapper {
  background: rgba(30, 41, 59, 0.55);
  border: 1px solid rgba(212, 175, 55, 0.25);
  border-radius: 12px;
  padding: 1rem 1.2rem;
  margin-bottom: 1.25rem;
  backdrop-filter: blur(8px);
}

.city-selector-label {
  display: block;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--color-gold);
  margin-bottom: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.city-radio-group {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}

.city-radio-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0.9rem 1.2rem;
  background: rgba(15, 23, 42, 0.75);
  border: 2px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.25s ease;
  user-select: none;
}

.city-radio-card:hover {
  border-color: rgba(212, 175, 55, 0.5);
  background: rgba(30, 41, 59, 0.85);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.city-radio-card.active,
.city-radio-card:has(input[type="radio"]:checked) {
  border-color: var(--color-gold);
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.18), rgba(30, 41, 59, 0.95));
  box-shadow: 0 4px 20px rgba(212, 175, 55, 0.2);
}

.city-radio-card input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.city-radio-indicator {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.city-radio-card:has(input[type="radio"]:checked) .city-radio-indicator,
.city-radio-card.active .city-radio-indicator {
  border-color: var(--color-gold);
}

.city-radio-card:has(input[type="radio"]:checked) .city-radio-indicator::after,
.city-radio-card.active .city-radio-indicator::after {
  content: '';
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--color-gold);
}

.city-icon {
  font-size: 1.5rem;
  color: var(--color-gold);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: rgba(212, 175, 55, 0.12);
  border-radius: 10px;
  border: 1px solid rgba(212, 175, 55, 0.25);
}

.city-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.city-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: #fff;
}

.city-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
}