/* ═══════════════════════════════════════════ RESET & BASE */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
  overflow: hidden;
}

:root {
  /* Dark mode palette — matches Flutter AppTheme.darkTheme exactly:
     scaffold #000000, surface #1A1A1A, onSurface #E8E8E8, primary #FFD700.
     --dark3 is a slightly elevated surface used for hover / active tab fills,
     kept close enough to surface that it reads as a one-step elevation. */
  --dark: #000000;
  --dark2: #1A1A1A;
  --dark3: #242424;
  --yellow: #FFD700;
  --yellow2: #FFC200;
  --white: #E8E8E8;
  --gray: #9CA3AF;
  --light: #EEF2FF;
  --green: #22C55E;
  --red: #EF4444;
  --orange: #F97316;
  --radius: 14px;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.18);
}

body {
  font-family: 'Cairo', sans-serif;
  background: var(--dark);
  color: var(--white);
  direction: rtl;
}

/* ═══════════════════════════════════════════ PAGES */
.page {
  display: none;
  width: 100%;
}

.page.active {
  display: flex;
}

#page-login {
  width: 100vw;
  height: 100vh;
}

#page-app {
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}

/* ═══════════════════════════════════════════ LOGIN */
.login-bg {
  width: 100vw;
  height: 100vh;
  background: linear-gradient(135deg, #1A1A1A 0%, #0D0D0D 50%, #000000 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.login-bg::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 70% 30%, rgba(255, 215, 0, 0.08) 0%, transparent 60%);
}

.login-card {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 215, 0, 0.2);
  border-radius: 20px;
  padding: 32px 28px;
  width: 100%;
  max-width: 340px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
  position: relative;
  z-index: 1;
  animation: fadeUp 0.5s ease;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.login-logo {
  width: 80px;
  height: 80px;
  border-radius: 20px;
  background: var(--yellow);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  box-shadow: 0 8px 24px rgba(255, 215, 0, 0.4);
}

.login-logo .logo-icon {
  font-size: 40px;
  color: var(--dark);
}

.login-title {
  text-align: center;
  font-size: 32px;
  font-weight: 800;
  color: var(--yellow);
}

.login-sub {
  text-align: center;
  color: var(--gray);
  margin-bottom: 32px;
  font-size: 14px;
}

.field-group {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 215, 0, 0.15);
  border-radius: var(--radius);
  padding: 0 16px;
  margin-bottom: 16px;
  transition: border-color 0.2s;
}

.field-group:focus-within {
  border-color: var(--yellow);
}

.field-icon {
  color: var(--yellow);
  font-size: 20px;
}

.field-group input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--white);
  font-family: 'Cairo', sans-serif;
  font-size: 15px;
  padding: 14px 0;
}

.field-group input::placeholder {
  color: var(--gray);
}

.btn-login {
  width: 100%;
  padding: 14px;
  background: var(--yellow);
  color: var(--dark);
  border: none;
  border-radius: var(--radius);
  font-family: 'Cairo', sans-serif;
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 8px;
  transition: background 0.2s, transform 0.1s, box-shadow 0.2s;
  box-shadow: 0 4px 16px rgba(255, 215, 0, 0.35);
}

.btn-login:hover {
  background: var(--yellow2);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(255, 215, 0, 0.5);
}

.btn-login:active {
  transform: translateY(0);
}

.login-hint {
  text-align: center;
  color: var(--gray);
  font-size: 12px;
  margin-top: 16px;
}

/* APP SHELL */
/* SIDEBAR */
.sidebar {
  width: 240px;
  min-height: 100vh;
  background: var(--dark2);
  border-left: 1px solid rgba(255, 215, 0, 0.1);
  display: flex;
  flex-direction: column;
  position: fixed;
  right: 0;
  top: 0;
  bottom: 0;
  z-index: 100;
  transition: transform 0.3s ease;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 24px 20px;
  font-size: 22px;
  font-weight: 800;
  color: var(--yellow);
  border-bottom: 1px solid rgba(255, 215, 0, 0.1);
}

.sidebar-logo .material-icons-round {
  font-size: 28px;
  color: var(--yellow);
}

.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 10px;
  color: var(--gray);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s;
}

.nav-item:hover {
  background: rgba(255, 215, 0, 0.07);
  color: var(--white);
}

.nav-item.active {
  background: var(--yellow);
  color: var(--dark);
}

.nav-item.active .material-icons-round {
  color: var(--dark);
}

.nav-item .material-icons-round {
  font-size: 20px;
}

.sidebar-bottom {
  padding: 12px;
  border-top: 1px solid rgba(255, 215, 0, 0.1);
}

.logout-btn {
  color: var(--red) !important;
}

.logout-btn:hover {
  background: rgba(239, 68, 68, 0.1) !important;
}

/* MAIN */
.main-area {
  margin-right: 240px;
  height: 100vh;
  overflow-y: auto;
  background: var(--dark);
  display: flex;
  flex-direction: column;
  flex: 1;
}

/* TOPBAR */
.topbar {
  height: 64px;
  background: var(--dark2);
  border-bottom: 1px solid rgba(255, 215, 0, 0.1);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--yellow);
  cursor: pointer;
}

.menu-toggle .material-icons-round {
  font-size: 26px;
}

.topbar-title {
  flex: 1;
  font-size: 18px;
  font-weight: 700;
  color: var(--white);
}

.topbar-admin {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--yellow);
  font-weight: 600;
}

/* ═══════════════════════════════════════════ SECTIONS */
.section {
  display: none;
  padding: 28px 28px 40px;
  flex: 1;
}

.section.active {
  display: block;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}

.section-header h2 {
  font-size: 22px;
  font-weight: 700;
}

.badge-date {
  background: rgba(255, 215, 0, 0.12);
  color: var(--yellow);
  padding: 4px 14px;
  border-radius: 20px;
  font-size: 13px;
}

/* ═══════════════════════════════════════════ STAT CARDS */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 4px;
}

.stat-card {
  background: var(--dark2);
  border: 1px solid rgba(255, 215, 0, 0.1);
  border-radius: var(--radius);
  padding: 24px 20px;
  display: flex;
  align-items: center;
  gap: 20px;
  transition: transform 0.2s, box-shadow 0.2s;
  animation: fadeUp 0.4s ease both;
}

.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.stat-icon {
  width: 54px;
  height: 54px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stat-icon .material-icons-round {
  font-size: 26px;
}

.bg-blue {
  background: rgba(0, 102, 204, 0.25);
  color: #60A5FA;
}

.bg-yellow {
  background: rgba(255, 215, 0, 0.2);
  color: var(--yellow);
}

.bg-green {
  background: rgba(34, 197, 94, 0.2);
  color: var(--green);
}

.bg-orange {
  background: rgba(249, 115, 22, 0.2);
  color: var(--orange);
}

.stat-num {
  font-size: 32px;
  font-weight: 800;
  line-height: 1;
}

.stat-label {
  font-size: 13px;
  color: var(--gray);
  margin-top: 4px;
}

/* ═══════════════════════════════════════════ CARD */
.card {
  background: var(--dark2);
  border: 1px solid rgba(255, 215, 0, 0.08);
  border-radius: var(--radius);
  overflow: hidden;
}

.card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 16px 20px;
  font-weight: 700;
  font-size: 15px;
  border-bottom: 1px solid rgba(255, 215, 0, 0.08);
  color: var(--yellow);
}

.mt-24 {
  margin-top: 24px;
}

/* ═══════════════════════════════════════════ ACTIVITY */
.activity-list {
  padding: 8px 0;
}

.activity-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  font-size: 14px;
}

.activity-item:last-child {
  border-bottom: none;
}

.act-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.act-time {
  color: var(--gray);
  font-size: 12px;
  margin-right: auto;
}

/* ═══════════════════════════════════════════ DRIVER GRID */
.header-tabs {
  display: flex;
  gap: 8px;
}

.tab-btn {
  padding: 7px 18px;
  border-radius: 20px;
  border: 1px solid rgba(255, 215, 0, 0.3);
  background: transparent;
  color: var(--gray);
  font-family: 'Cairo', sans-serif;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.tab-btn.active {
  background: var(--yellow);
  color: var(--dark);
  border-color: var(--yellow);
}

.tab-btn:hover:not(.active) {
  color: var(--white);
  border-color: var(--yellow);
}

.drivers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}

.driver-card {
  background: var(--dark2);
  border: 1px solid rgba(255, 215, 0, 0.1);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
  animation: fadeUp 0.35s ease both;
}

.driver-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
}

.driver-card-header {
  background: linear-gradient(135deg, var(--dark3), var(--dark2));
  padding: 18px 18px 12px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.driver-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--yellow);
  color: var(--dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 800;
  flex-shrink: 0;
  border: 2px solid rgba(255, 215, 0, 0.4);
}

.driver-name {
  font-size: 16px;
  font-weight: 700;
}

.driver-phone {
  font-size: 13px;
  color: var(--gray);
  margin-top: 2px;
}

.driver-status {
  margin-right: auto;
}

.status-badge {
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
}

.status-pending {
  background: rgba(249, 115, 22, 0.2);
  color: var(--orange);
}

.status-approved {
  background: rgba(34, 197, 94, 0.2);
  color: var(--green);
}

.status-rejected {
  background: rgba(239, 68, 68, 0.2);
  color: var(--red);
}

.driver-card-body {
  padding: 14px 18px;
}

.driver-info-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--gray);
  margin-bottom: 8px;
}

.driver-info-row .material-icons-round {
  font-size: 16px;
  color: var(--yellow);
}

.driver-license {
  margin: 10px 0;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(255, 215, 0, 0.12);
  height: 100px;
  background: var(--dark3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray);
  font-size: 13px;
  gap: 6px;
  cursor: pointer;
}

.driver-license img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.driver-license img:hover {
  transform: scale(1.04);
  opacity: 0.92;
}

/* ═══════════════════════════════════════════ PHONE INPUT (+964 prefix) */
.phone-input-row {
  display: flex;
  align-items: stretch;
  gap: 8px;
  direction: ltr; /* keep digits + prefix left-to-right even in RTL */
}

.phone-prefix {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  background: rgba(255, 215, 0, 0.08);
  border: 1px solid rgba(255, 215, 0, 0.25);
  border-radius: 10px;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.5px;
  color: var(--white);
  user-select: none;
  white-space: nowrap;
}

.phone-input-row input {
  flex: 1;
  min-width: 0;
}

.phone-hint {
  margin-top: 6px;
  font-size: 12px;
  color: var(--gray);
}

body.light-mode .phone-prefix {
  background: rgba(0, 26, 77, 0.05);
  border-color: rgba(0, 26, 77, 0.15);
  color: #001A4D;
}

body.light-mode .phone-hint {
  color: #445577;
}

/* ═══════════════════════════════════════════ IMAGE LIGHTBOX */
.image-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0s linear 0.2s;
}

.image-modal.active {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.2s ease, visibility 0s linear 0s;
}

.image-modal img {
  max-width: 90vw;
  max-height: 90vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
  transform: scale(0.96);
  transition: transform 0.2s ease;
}

.image-modal.active img {
  transform: scale(1);
}

.image-modal-close {
  position: fixed;
  top: 20px;
  right: 20px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, transform 0.15s ease;
  z-index: 1;
}

.image-modal-close:hover {
  background: rgba(255, 255, 255, 0.22);
  transform: scale(1.05);
}

.image-modal-close .material-icons-round {
  font-size: 26px;
}

.driver-card-actions {
  padding: 12px 18px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.btn-action {
  flex: 1;
  min-width: 70px;
  padding: 8px 10px;
  border: none;
  border-radius: 8px;
  font-family: 'Cairo', sans-serif;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: all 0.2s;
}

.btn-approve {
  background: rgba(34, 197, 94, 0.15);
  color: var(--green);
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.btn-approve:hover {
  background: var(--green);
  color: #fff;
}

.btn-reject {
  background: rgba(249, 115, 22, 0.15);
  color: var(--orange);
  border: 1px solid rgba(249, 115, 22, 0.3);
}

.btn-reject:hover {
  background: var(--orange);
  color: #fff;
}

.btn-remove {
  background: rgba(239, 68, 68, 0.12);
  color: var(--red);
  border: 1px solid rgba(239, 68, 68, 0.25);
}

.btn-remove:hover {
  background: var(--red);
  color: #fff;
}

.btn-edit {
  background: rgba(255, 215, 0, 0.1);
  color: var(--yellow);
  border: 1px solid rgba(255, 215, 0, 0.25);
}

.btn-edit:hover {
  background: var(--yellow);
  color: var(--dark);
}

.btn-action .material-icons-round {
  font-size: 15px;
}

/* ═══════════════════════════════════════════ TABLE */
.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th {
  text-align: right;
  padding: 14px 20px;
  background: rgba(255, 215, 0, 0.07);
  color: var(--yellow);
  font-size: 13px;
  font-weight: 700;
  border-bottom: 1px solid rgba(255, 215, 0, 0.1);
}

.data-table td {
  padding: 14px 20px;
  font-size: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.data-table tr:last-child td {
  border-bottom: none;
}

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

/* ═══════════════════════════════════════════ MODAL */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  align-items: center;
  justify-content: center;
}

.modal-overlay.open {
  display: flex;
}

.modal-box {
  background: var(--dark2);
  border: 1px solid rgba(255, 215, 0, 0.2);
  border-radius: 20px;
  width: 100%;
  max-width: 460px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  animation: fadeUp 0.3s ease;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid rgba(255, 215, 0, 0.1);
}

.modal-header h3 {
  font-size: 17px;
  font-weight: 700;
}

.modal-close {
  background: none;
  border: none;
  color: var(--gray);
  cursor: pointer;
  display: flex;
  align-items: center;
  transition: color 0.2s;
}

.modal-close:hover {
  color: var(--red);
}

.modal-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-row label {
  font-size: 13px;
  color: var(--gray);
  font-weight: 600;
}

.form-row input,
.form-row select {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 215, 0, 0.15);
  border-radius: 10px;
  padding: 11px 14px;
  color: var(--white);
  font-family: 'Cairo', sans-serif;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}

.form-row input:focus,
.form-row select:focus {
  border-color: var(--yellow);
}

.form-row select option {
  background: var(--dark2);
}

.modal-footer {
  display: flex;
  gap: 10px;
  padding: 16px 24px;
  border-top: 1px solid rgba(255, 215, 0, 0.1);
  justify-content: flex-end;
}

.btn-cancel {
  padding: 10px 20px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--white);
  font-family: 'Cairo', sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-cancel:hover {
  background: rgba(255, 255, 255, 0.12);
}

.btn-save {
  padding: 10px 22px;
  border-radius: 10px;
  background: var(--yellow);
  border: none;
  color: var(--dark);
  font-family: 'Cairo', sans-serif;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: background 0.2s;
}

.btn-save:hover {
  background: var(--yellow2);
}

/* ═══════════════════════════════════════════ TOAST */
.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--dark3);
  color: var(--white);
  padding: 12px 28px;
  border-radius: 30px;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.4);
  z-index: 999;
  pointer-events: none;
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s;
  border: 1px solid rgba(255, 215, 0, 0.2);
  white-space: nowrap;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
}

/* ═══════════════════════════════════════════ EMPTY STATE */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  color: var(--gray);
  gap: 12px;
  grid-column: 1 / -1;
}

.empty-state .material-icons-round {
  font-size: 48px;
  opacity: 0.4;
}

.empty-state p {
  font-size: 15px;
}

/* ═══════════════════════════════════════════ RESPONSIVE */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(100%);
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 200;
    box-shadow: -8px 0 32px rgba(0, 0, 0, 0.5);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .main-area {
    margin-right: 0;
    height: 100vh;
    overflow-y: auto;
  }

  .menu-toggle {
    display: flex;
  }

  .stats-grid {
    grid-template-columns: 1fr 1fr;
  }

  .section {
    padding: 16px 16px 32px;
  }

  .profile-grid {
    grid-template-columns: 1fr;
  }
}

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

  .drivers-grid {
    grid-template-columns: 1fr;
  }

  .section-header {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ═══════════════════════════════════════════ PASSENGER COUNT */
.passenger-count-wrapper {
  display: flex;
  flex-direction: column;
  gap: 20px;
  align-items: flex-start;
}

.privacy-note {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 215, 0, 0.07);
  border: 1px solid rgba(255, 215, 0, 0.15);
  border-radius: 10px;
  padding: 12px 18px;
  color: var(--gray);
  font-size: 13px;
}

.privacy-note .material-icons-round {
  color: var(--yellow);
  font-size: 18px;
}

/* Forgot password link */
.forgot-link {
  display: block;
  text-align: center;
  margin-top: 12px;
  color: var(--yellow);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  opacity: 0.8;
  transition: opacity 0.2s;
}

.forgot-link:hover {
  opacity: 1;
  text-decoration: underline;
}

/* Password setting row — stacks vertically */
.pw-setting-row {
  flex-direction: column !important;
  align-items: stretch !important;
  gap: 12px !important;
}

/* Profile logout button */
.btn-logout-profile {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 20px;
  border-radius: 8px;
  flex-shrink: 0;
  background: rgba(239, 68, 68, 0.12);
  color: var(--red);
  border: 1px solid rgba(239, 68, 68, 0.3);
  font-family: 'Cairo', sans-serif;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-logout-profile:hover {
  background: var(--red);
  color: #fff;
}

.btn-logout-profile .material-icons-round {
  font-size: 16px;
}


/* ═══════════════════════════════════════════ PROFILE PAGE */
.profile-grid {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 24px;
  align-items: start;
}

.profile-card {
  height: fit-content;
}

.profile-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 32px 20px;
  gap: 8px;
}

.profile-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--yellow);
  color: var(--dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  font-weight: 800;
  margin-bottom: 8px;
  box-shadow: 0 4px 20px rgba(255, 215, 0, 0.35);
}

.profile-name {
  font-size: 20px;
  font-weight: 800;
}

.profile-username {
  color: var(--gray);
  font-size: 14px;
}

.profile-role-badge {
  background: rgba(255, 215, 0, 0.15);
  color: var(--yellow);
  border: 1px solid rgba(255, 215, 0, 0.3);
  padding: 4px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  margin-top: 4px;
}

.settings-list {
  padding: 8px 0;
}

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  gap: 12px;
}

.setting-row:last-child {
  border-bottom: none;
}

.setting-info {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1;
  min-width: 0;
}

.setting-icon {
  color: var(--yellow);
  font-size: 22px;
  flex-shrink: 0;
}

.setting-label {
  font-size: 15px;
  font-weight: 700;
}

.setting-sub {
  font-size: 12px;
  color: var(--gray);
  margin-top: 2px;
}

/* Toggle Switch */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 26px;
  flex-shrink: 0;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 26px;
  transition: 0.3s;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.toggle-slider::before {
  content: '';
  position: absolute;
  height: 18px;
  width: 18px;
  right: 4px;
  top: 3px;
  background: var(--gray);
  border-radius: 50%;
  transition: 0.3s;
}

.toggle-switch input:checked+.toggle-slider {
  background: rgba(255, 215, 0, 0.2);
  border-color: var(--yellow);
}

.toggle-switch input:checked+.toggle-slider::before {
  background: var(--yellow);
  transform: translateX(-24px);
}

/* Lang Toggle */
.lang-toggle {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.lang-btn {
  padding: 6px 14px;
  border-radius: 8px;
  border: 1px solid rgba(255, 215, 0, 0.2);
  background: transparent;
  color: var(--gray);
  font-family: 'Cairo', sans-serif;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.lang-btn.active {
  background: var(--yellow);
  color: var(--dark);
  border-color: var(--yellow);
}

.lang-btn:hover:not(.active) {
  color: var(--white);
  border-color: var(--yellow);
}

/* Password fields */
.pw-fields {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.profile-input {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 215, 0, 0.15);
  border-radius: 10px;
  padding: 11px 14px;
  color: var(--white);
  font-family: 'Cairo', sans-serif;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
  width: 100%;
}

.profile-input:focus {
  border-color: var(--yellow);
}

/* Light mode overrides */
body.light-mode {
  background: #F0F4FF;
  color: #001A4D;
}

body.light-mode .sidebar {
  background: #FFFFFF;
  border-color: rgba(0, 26, 77, 0.1);
}

body.light-mode .main-area {
  background: #F0F4FF;
}

body.light-mode .topbar {
  background: #FFFFFF;
  border-color: rgba(0, 26, 77, 0.1);
}

body.light-mode .stat-card,
body.light-mode .card {
  background: #FFFFFF;
  border-color: rgba(0, 26, 77, 0.1);
}

body.light-mode .nav-item:not(.active) {
  color: #445577;
}

body.light-mode .nav-item:hover:not(.active) {
  background: rgba(0, 26, 77, 0.06);
  color: #001A4D;
}

body.light-mode .data-table td {
  color: #001A4D;
}

body.light-mode .activity-item {
  color: #001A4D;
}

body.light-mode .topbar-title {
  color: #001A4D;
}

body.light-mode .driver-card {
  background: #FFFFFF;
}

body.light-mode .driver-card-header {
  background: linear-gradient(135deg, #E8EEFF, #FFFFFF);
}

body.light-mode .driver-name {
  color: #001A4D;
}

body.light-mode .profile-input {
  background: rgba(0, 26, 77, 0.05);
  color: #001A4D;
}

body.light-mode .setting-label {
  color: #001A4D;
}

body.light-mode .sidebar-logo {
  color: #001A4D;
}

/* ───── LOGIN SCREEN — light mode overrides
   Dark mode (defaults above) uses a near-black radial gradient + glassy
   card. In light mode we mirror the dashboard's #F0F4FF canvas and a
   white card so the login page no longer flashes/lives in dark while the
   rest of the panel is light. */
body.light-mode .login-bg {
  background: linear-gradient(135deg, #F0F4FF 0%, #E6ECFF 50%, #F0F4FF 100%);
}

body.light-mode .login-bg::before {
  background: radial-gradient(ellipse at 70% 30%, rgba(255, 215, 0, 0.18) 0%, transparent 60%);
}

body.light-mode .login-card {
  background: #FFFFFF;
  border-color: rgba(0, 26, 77, 0.12);
  box-shadow: 0 20px 60px rgba(0, 26, 77, 0.15);
}

body.light-mode .login-sub {
  color: #445577;
}

body.light-mode .field-group {
  background: rgba(0, 26, 77, 0.04);
  border-color: rgba(0, 26, 77, 0.12);
}

body.light-mode .field-group input {
  color: #001A4D;
}

body.light-mode .field-group input::placeholder {
  color: #6B7A99;
}

/* Change Password button */
.btn-change-pw {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  border-radius: 8px;
  flex-shrink: 0;
  background: rgba(255, 215, 0, 0.1);
  color: var(--yellow);
  border: 1px solid rgba(255, 215, 0, 0.3);
  font-family: 'Cairo', sans-serif;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-change-pw:hover {
  background: var(--yellow);
  color: var(--dark);
}

.btn-change-pw .material-icons-round {
  font-size: 16px;
}

/* Compact modal for change password */
.modal-box-sm {
  max-width: 380px;
}

/* ═══════════════════════════════════════════ PAGINATION (TRIPS) */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 20px;
  padding: 12px 0 4px;
}

.page-btn {
  padding: 8px 20px;
  border-radius: 10px;
  background: rgba(255, 215, 0, 0.1);
  color: var(--yellow);
  border: 1px solid rgba(255, 215, 0, 0.3);
  font-family: 'Cairo', sans-serif;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s, opacity 0.2s;
}

.page-btn:hover:not(:disabled) {
  background: rgba(255, 215, 0, 0.18);
}

.page-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.page-info {
  font-size: 13px;
  font-weight: 600;
  color: var(--white);
  min-width: 110px;
  text-align: center;
}

body.light-mode .page-info {
  color: #001A4D;
}

/* ═══════════════════════════════════════════ LIGHT MODE — MODALS
   Modals use var(--dark2) for the panel and var(--white) for input text,
   which is correct in dark mode. In light mode we need a light panel and
   dark text so users can actually read the contents. Scope is limited to
   modal selectors so non-modal UI stays untouched. Dark mode unchanged. */
body.light-mode .modal-box {
  background: #FFFFFF;
  border-color: rgba(0, 26, 77, 0.15);
  box-shadow: 0 20px 60px rgba(0, 26, 77, 0.18);
}

body.light-mode .modal-header {
  border-bottom-color: rgba(0, 26, 77, 0.1);
}

body.light-mode .modal-header h3 {
  color: #001A4D;
}

body.light-mode .modal-close {
  color: #445577;
}

body.light-mode .modal-body {
  color: #001A4D;
}

body.light-mode .form-row label {
  color: #445577;
}

body.light-mode .form-row input,
body.light-mode .form-row select {
  background: rgba(0, 26, 77, 0.05);
  border-color: rgba(0, 26, 77, 0.15);
  color: #001A4D;
}

body.light-mode .form-row input::placeholder {
  color: #6B7A99;
}

body.light-mode .form-row select option {
  background: #FFFFFF;
  color: #001A4D;
}

body.light-mode .modal-footer {
  border-top-color: rgba(0, 26, 77, 0.1);
}

body.light-mode .btn-cancel {
  background: rgba(0, 26, 77, 0.05);
  border-color: rgba(0, 26, 77, 0.15);
  color: #001A4D;
}

body.light-mode .btn-cancel:hover {
  background: rgba(0, 26, 77, 0.1);
}