/* ── Reset ───────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { color-scheme: light only !important; }
@media (prefers-color-scheme: dark) { :root { color-scheme: light !important; background:#fff; color:#000; } }

/* ── Variables ───────────────────────────────────────────── */
:root {
  --blue:    #0056B3;
  --blue2:   #003d82;
  --lblue:   #E8F0FE;
  --white:   #ffffff;
  --bg:      #F2F5FB;
  --surface: #ffffff;
  --border:  #DDE3F0;
  --text:    #0d1b2a;
  --muted:   #5a6880;
  --green:   #10B981;
  --red:     #EF4444;
  --yellow:  #F59E0B;
  --orange:  #F97316;
  --r:       6px;
  --r2:      12px;
  --shadow:  0 2px 10px rgba(0,86,179,.08);
}

/* ── Base ────────────────────────────────────────────────── */
body {
  font-family: 'Noto Sans Arabic', 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
  min-height: 100vh;
}
body.ltr { direction: ltr; text-align: left; font-family: 'Inter', 'Segoe UI', sans-serif; }
a { color: var(--blue); text-decoration: none; }

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 20px; border-radius: var(--r); font-size: 14px; font-weight: 600;
  font-family: inherit; cursor: pointer; border: none; text-decoration: none;
  transition: opacity .15s, transform .1s; white-space: nowrap;
}
.btn:active { opacity: .85; transform: scale(.98); }
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue2); }
.btn-outline  { background: transparent; border: 1.5px solid var(--blue); color: var(--blue); }
.btn-outline:hover { background: var(--lblue); }
.btn-green  { background: var(--green); color: #fff; }
.btn-red    { background: var(--red);   color: #fff; }
.btn-yellow { background: var(--yellow);color: #fff; }
.btn-gray   { background: #F1F5F9; color: var(--muted); }
.btn-block  { width: 100%; }
.btn-sm     { padding: 6px 14px; font-size: 12px; }
.btn-lg     { padding: 14px 28px; font-size: 16px; }

/* ── Badges ──────────────────────────────────────────────── */
.badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 700; }
.badge-green  { background: #D1FAE5; color: #047857; }
.badge-red    { background: #FEE2E2; color: #B91C1C; }
.badge-yellow { background: #FEF3C7; color: #92400E; }
.badge-blue   { background: #DBEAFE; color: #1D4ED8; }
.badge-gray   { background: #F1F5F9; color: #475569; }
.badge-orange { background: #FFEDD5; color: #C2410C; }

/* ── Forms ───────────────────────────────────────────────── */
.form-group { margin-bottom: 14px; }
.form-label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 5px; }
.form-control {
  width: 100%; padding: 11px 14px; border: 1.5px solid var(--border);
  border-radius: var(--r); font-size: 14px; font-family: inherit;
  color: var(--text); background: #fff; transition: border-color .15s;
}
.form-control:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(0,86,179,.1); }
textarea.form-control { resize: vertical; min-height: 80px; }
select.form-control {
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%235a6880' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: left 12px center; padding-left: 32px;
}
body.ltr select.form-control { background-position: right 12px center; padding-left: 14px; padding-right: 32px; }

/* ── Alerts ──────────────────────────────────────────────── */
.alert { padding: 12px 16px; border-radius: var(--r); font-size: 14px; margin-bottom: 14px; }
.alert-success { background: #D1FAE5; color: #047857; border: 1px solid #6EE7B7; }
.alert-danger  { background: #FEE2E2; color: #B91C1C; border: 1px solid #FCA5A5; }
.alert-info    { background: #DBEAFE; color: #1D4ED8; border: 1px solid #93C5FD; }

/* ── Card ────────────────────────────────────────────────── */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r2); padding: 16px; box-shadow: var(--shadow);
}
.card-title { font-size: 15px; font-weight: 700; margin-bottom: 12px; color: var(--blue); }
.divider { border: none; border-top: 1px solid var(--border); margin: 12px 0; }

/* ── ═══════════════════════════════════════════════════════ */
/* ── CUSTOMER / DRIVER MOBILE LAYOUT ─────────────────────── */
/* ── ═══════════════════════════════════════════════════════ */
.mob-header {
  background: #fff; border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 90;
}
.mob-header-inner {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; max-width: 480px; margin: 0 auto;
}
.mob-header-title { font-size: 16px; font-weight: 700; color: var(--blue); }
.mob-header-sub   { font-size: 11px; color: var(--muted); display: block; margin-top: 1px; }
.icon-btn {
  background: none; border: none; cursor: pointer; color: var(--text);
  padding: 7px; border-radius: 50%; position: relative; display: flex;
  align-items: center; justify-content: center;
}
.icon-btn:hover { background: var(--lblue); }
.notif-dot {
  position: absolute; top: 4px; right: 4px; width: 8px; height: 8px;
  border-radius: 50%; background: var(--red); border: 1.5px solid #fff;
}

.mob-wrap  { max-width: 480px; margin: 0 auto; padding-bottom: 80px; }
.mob-body  { padding: 14px 16px; }

.mob-nav {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 480px; background: #fff;
  border-top: 1px solid var(--border);
  display: flex; justify-content: space-around;
  padding: 6px 0 env(safe-area-inset-bottom); z-index: 90;
}
.mob-nav a {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  color: var(--muted); text-decoration: none; font-size: 10px;
  font-weight: 600; padding: 4px 10px; transition: color .15s;
}
.mob-nav a.active { color: var(--blue); }
.mob-nav a svg { width: 20px; height: 20px; }

/* ── Tanker card ─────────────────────────────────────────── */
.t-card {
  background: #fff; border: 1px solid var(--border);
  border-radius: var(--r2); padding: 16px; margin-bottom: 10px;
  transition: box-shadow .15s;
}
.t-card:hover { box-shadow: 0 4px 16px rgba(0,86,179,.12); }
.t-name  { font-size: 15px; font-weight: 700; margin: 6px 0 2px; }
.t-price { font-size: 22px; font-weight: 700; color: var(--blue); }
.t-size-badge {
  font-size: 11px; font-weight: 700; padding: 3px 10px;
  border-radius: 20px; background: var(--lblue); color: var(--blue);
}
.t-avail { font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 20px; }
.t-avail.on  { background: #D1FAE5; color: #047857; }
.t-avail.off { background: #FEE2E2; color: #B91C1C; }

/* ── Order card ──────────────────────────────────────────── */
.o-card {
  background: #fff; border: 1px solid var(--border);
  border-radius: var(--r2); padding: 14px; margin-bottom: 10px;
}
.o-card.highlight { border-color: var(--blue); background: var(--lblue); }
.o-num  { font-size: 11px; font-weight: 700; color: var(--muted); }
.o-customer { font-size: 15px; font-weight: 700; margin: 4px 0 2px; }
.o-location { font-size: 12px; color: var(--muted); }
.o-price { font-size: 20px; font-weight: 700; color: var(--blue); }

/* ── Toggle availability ─────────────────────────────────── */
.toggle-bar {
  display: flex; background: #F1F5F9; border-radius: 20px;
  padding: 3px; max-width: 200px; margin-bottom: 16px;
}
.toggle-btn {
  flex: 1; padding: 8px 10px; border: none; border-radius: 17px;
  font-size: 13px; font-weight: 600; cursor: pointer;
  background: transparent; font-family: inherit; color: var(--muted);
  transition: background .15s, color .15s;
}
.toggle-btn.av  { background: var(--green); color: #fff; }
.toggle-btn.bsy { background: var(--red); color: #fff; }

/* ── Stats grid (driver) ─────────────────────────────────── */
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.stat-box  { background: #fff; border: 1px solid var(--border); border-radius: var(--r2); padding: 14px; }
.stat-lbl  { font-size: 11px; font-weight: 600; color: var(--muted); margin-bottom: 4px; }
.stat-val  { font-size: 22px; font-weight: 700; }
.stat-sub  { font-size: 11px; color: var(--muted); margin-top: 2px; }

/* ── ═══════════════════════════════════════════════════════ */
/* ── ADMIN LAYOUT ────────────────────────────────────────── */
/* ── ═══════════════════════════════════════════════════════ */
.a-wrap { display: flex; min-height: 100vh; direction: rtl; }

.a-side {
  width: 240px; background: var(--blue2); color: #fff;
  position: fixed; top: 0; right: 0; height: 100%;
  overflow-y: auto; display: flex; flex-direction: column; z-index: 90;
}
.a-brand {
  padding: 18px 16px; border-bottom: 1px solid rgba(255,255,255,.1);
  display: flex; align-items: center; gap: 10px;
}
.a-brand-name { font-size: 14px; font-weight: 700; line-height: 1.2; }
.a-brand-sub  { font-size: 10px; opacity: .5; }

.a-nav a {
  display: flex; align-items: center; gap: 10px; padding: 11px 16px;
  font-size: 13px; font-weight: 500; color: rgba(255,255,255,.75);
  text-decoration: none; border-right: 3px solid transparent; transition: .15s;
}
.a-nav a:hover, .a-nav a.active {
  background: rgba(255,255,255,.1); color: #fff; border-right-color: #fff;
}
.a-nav a svg { width: 16px; height: 16px; flex-shrink: 0; }
.a-nav-label {
  font-size: 10px; font-weight: 700; opacity: .4; padding: 10px 16px 4px;
  letter-spacing: .06em; text-transform: uppercase;
}
.a-nav-badge {
  margin-right: auto; background: var(--red); color: #fff;
  font-size: 10px; font-weight: 700; padding: 1px 7px; border-radius: 20px;
}
.a-logout { margin-top: auto; padding: 16px; border-top: 1px solid rgba(255,255,255,.1); }
.a-logout a { color: rgba(255,255,255,.55); font-size: 13px; text-decoration: none; }
.a-logout a:hover { color: #fff; }

.a-main  { margin-right: 240px; flex: 1; min-width: 0; }
.a-topbar {
  background: #fff; border-bottom: 1px solid var(--border);
  padding: 0 24px; height: 58px;
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 80;
}
.a-page-title { font-size: 17px; font-weight: 700; }
.a-body  { padding: 24px; }

.a-stats {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px; margin-bottom: 20px;
}
.a-stat { background: #fff; border: 1px solid var(--border); border-radius: var(--r2); padding: 16px; }
.a-stat-lbl { font-size: 11px; font-weight: 700; color: var(--muted); margin-bottom: 6px; }
.a-stat-val { font-size: 26px; font-weight: 700; }
.a-stat-sub { font-size: 11px; color: var(--green); margin-top: 4px; font-weight: 600; }

.a-card { background: #fff; border: 1px solid var(--border); border-radius: var(--r2); overflow: hidden; margin-bottom: 20px; }
.a-card-hdr {
  padding: 14px 18px; display: flex; align-items: center;
  justify-content: space-between; border-bottom: 1px solid var(--border);
}
.a-card-ttl { font-size: 14px; font-weight: 700; }

.a-table { width: 100%; border-collapse: collapse; }
.a-table th {
  padding: 10px 14px; font-size: 11px; font-weight: 700; color: var(--muted);
  text-align: right; background: #F8FAFC; border-bottom: 1px solid var(--border);
}
.a-table td {
  padding: 11px 14px; font-size: 13px; border-bottom: 1px solid #F1F5F9; text-align: right;
}
.a-table tr:last-child td { border-bottom: none; }
.a-table tr:hover td { background: #FAFBFF; }

.a-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

@media (max-width: 900px) {
  .a-side { display: none; }
  .a-main { margin-right: 0; }
  .a-grid2 { grid-template-columns: 1fr; }
}

/* ── Auth pages ──────────────────────────────────────────── */
.auth-page {
  min-height: 100vh; display: flex; align-items: center;
  justify-content: center; padding: 20px;
}
.auth-box {
  width: 100%; max-width: 400px; background: #fff;
  border: 1px solid var(--border); border-radius: var(--r2);
  padding: 32px 24px; box-shadow: var(--shadow);
}
.auth-logo {
  width: 60px; height: 60px; background: var(--lblue); border-radius: 14px;
  display: flex; align-items: center; justify-content: center; margin: 0 auto 16px;
}
.auth-title { font-size: 20px; font-weight: 700; color: var(--blue); text-align: center; margin-bottom: 4px; }
.auth-sub   { font-size: 13px; color: var(--muted); text-align: center; margin-bottom: 24px; }

/* ── Language selector ───────────────────────────────────── */
.lang-bar { display: flex; gap: 6px; margin-bottom: 20px; flex-wrap: wrap; justify-content: center; }
.lang-btn {
  padding: 5px 14px; border-radius: 20px; border: 1.5px solid var(--border);
  background: #fff; font-size: 12px; font-weight: 600; cursor: pointer;
  text-decoration: none; color: var(--muted); transition: .15s;
}
.lang-btn.active { background: var(--blue); color: #fff; border-color: var(--blue); }

/* ── Misc ────────────────────────────────────────────────── */
.section-title { font-size: 14px; font-weight: 700; color: var(--blue); margin-bottom: 12px; margin-top: 4px; }
.empty-state { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty-state-icon { font-size: 40px; margin-bottom: 10px; }
.row-between { display: flex; justify-content: space-between; align-items: center; }
.gap-6 { gap: 6px; }
.gap-8 { gap: 8px; }
.flex { display: flex; align-items: center; }
.text-muted { color: var(--muted); }
.text-blue  { color: var(--blue); }
.text-green { color: var(--green); }
.text-red   { color: var(--red); }
.fw-700 { font-weight: 700; }
.fs-12  { font-size: 12px; }
.fs-13  { font-size: 13px; }
.mt-8  { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mb-8  { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }

/* ── Fill image ──────────────────────────────────────────── */
.fill-img { width: 100%; max-height: 160px; object-fit: cover; border-radius: var(--r); margin-top: 8px; }

/* ── Notification dot on nav ─────────────────────────────── */
.nav-notif { position: relative; }
.nav-notif-dot {
  position: absolute; top: 0; right: 0; width: 7px; height: 7px;
  background: var(--red); border-radius: 50%; border: 1.5px solid #fff;
}
