:root {
  color-scheme: light;
  --navy: #102a43;
  --blue: #1769e0;
  --blue2: #e9f2ff;
  --ink: #172b3a;
  --muted: #647789;
  --line: #dae3eb;
  --bg: #f4f7fa;
  --card: #fff;
  --green: #16845b;
  --greenbg: #e7f7f0;
  --orange: #b45d0a;
  --orangebg: #fff1df;
  --red: #c03737;
  --redbg: #ffebeb;
  --grey: #798894;
  --greybg: #e8edf1;
  --shadow: 0 10px 35px rgba(17, 42, 67, 0.08);
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-size: 16px;
}
button,
input,
select {
  font: inherit;
}
button {
  cursor: pointer;
}
button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}
.loading {
  min-height: 100vh;
  display: grid;
  place-items: center;
  color: var(--navy);
  font-weight: 800;
}
.login-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  background: #fff;
}
.login-brand {
  background: linear-gradient(145deg, #0b2136, #163f65);
  color: #fff;
  padding: clamp(2rem, 7vw, 7rem);
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  overflow: hidden;
}
.login-brand:after {
  content: "";
  position: absolute;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  border: 90px solid rgba(255, 255, 255, 0.045);
  inset: auto -120px -160px auto;
}
.brand-mark {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: #fff;
  color: var(--navy);
  font-size: 1.5rem;
  font-weight: 900;
}
.login-brand h1 {
  font-size: clamp(2.2rem, 5vw, 4.6rem);
  line-height: 1.05;
  max-width: 700px;
  margin: 2rem 0 1rem;
}
.login-brand p {
  color: #c7d8e8;
  font-size: 1.12rem;
  max-width: 580px;
}
.login-side {
  padding: 2rem;
  display: grid;
  place-items: center;
  position: relative;
}
.login-box {
  width: min(420px, 100%);
}
.login-box h2 {
  font-size: 2rem;
  margin: 0.5rem 0;
}
.login-box > p {
  color: var(--muted);
  margin: 0 0 2rem;
}
.lang-toggle {
  position: absolute;
  inset: 1.5rem 1.5rem auto auto;
  display: flex;
  background: var(--bg);
  padding: 4px;
  border-radius: 12px;
}
.lang-toggle button {
  border: 0;
  background: transparent;
  padding: 0.5rem 0.75rem;
  border-radius: 9px;
  color: var(--muted);
}
.lang-toggle button.active {
  background: #fff;
  color: var(--navy);
  box-shadow: 0 2px 8px #0001;
}
label {
  display: block;
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 0.45rem;
}
.field {
  margin-bottom: 1.1rem;
}
.input,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
  padding: 0.78rem 0.9rem;
  color: var(--ink);
  outline: none;
}
.input:focus,
select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px #1769e018;
}
.btn {
  border: 0;
  border-radius: 11px;
  padding: 0.75rem 1rem;
  font-weight: 750;
  background: var(--blue);
  color: #fff;
  transition:
    0.15s transform,
    0.15s opacity;
}
.btn:hover {
  transform: translateY(-1px);
}
.btn.block {
  width: 100%;
}
.btn.secondary {
  background: var(--blue2);
  color: var(--blue);
}
.btn.danger {
  background: var(--redbg);
  color: var(--red);
}
.btn.ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--line);
}
.btn.small {
  padding: 0.48rem 0.72rem;
  font-size: 0.86rem;
}
.form-error {
  min-height: 1.5rem;
  color: var(--red);
  font-size: 0.9rem;
}
.shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px 1fr;
}
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  background: var(--navy);
  padding: 1.4rem;
  color: #fff;
  display: flex;
  flex-direction: column;
}
.side-brand {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  font-weight: 850;
  margin-bottom: 2rem;
}
.side-brand .brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  font-size: 1rem;
}
.nav {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.nav button {
  border: 0;
  background: transparent;
  color: #b9cad8;
  border-radius: 10px;
  padding: 0.74rem 0.8rem;
  text-align: start;
  font-weight: 650;
}
.nav button:hover,
.nav button.active {
  background: #ffffff13;
  color: #fff;
}
.side-user {
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid #ffffff1a;
}
.side-user strong,
.side-user span {
  display: block;
}
.side-user span {
  font-size: 0.82rem;
  color: #aebfcd;
  margin-top: 0.2rem;
}
.main {
  min-width: 0;
}
.topbar {
  height: 74px;
  padding: 0 clamp(1rem, 3vw, 2.5rem);
  background: #fff;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 5;
}
.topbar h1 {
  font-size: 1.25rem;
  margin: 0;
}
.topbar .lang-toggle { position: static; }
.request-state { font-size: 1.2rem !important; }
.request-submit { margin-top: 1rem; }
.driver-search { max-width: 360px; }
.mobile-menu {
  display: none;
}
.content {
  padding: clamp(1rem, 3vw, 2.5rem);
  max-width: 1600px;
  margin: auto;
}
.page-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.page-head h2 {
  font-size: 1.75rem;
  margin: 0 0 0.25rem;
}
.page-head p {
  margin: 0;
  color: var(--muted);
}
.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.stat,
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
}
.stat {
  padding: 1.25rem;
}
.stat span {
  display: block;
  color: var(--muted);
  font-size: 0.9rem;
}
.stat strong {
  display: block;
  font-size: 2rem;
  margin-top: 0.35rem;
}
.card {
  padding: 1.2rem;
  margin-bottom: 1.25rem;
}
.card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}
.card-head h3 {
  margin: 0;
  font-size: 1.05rem;
}
.stack {
  display: flex;
  gap: 0.7rem;
  align-items: center;
  flex-wrap: wrap;
}
.grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}
.note {
  padding: 0.85rem 1rem;
  background: var(--blue2);
  color: #154d8f;
  border-radius: 11px;
  font-size: 0.92rem;
}
.empty {
  text-align: center;
  padding: 2.5rem;
  color: var(--muted);
}
.schedule-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
}
.schedule {
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
  min-width: 800px;
  background: #fff;
  table-layout: fixed;
}
.schedule th,
.schedule td {
  border-inline-end: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 0.65rem;
  vertical-align: top;
}
.schedule tr:last-child td {
  border-bottom: 0;
}
.schedule th:last-child,
.schedule td:last-child {
  border-inline-end: 0;
}
.schedule thead th {
  background: #f7f9fb;
  color: var(--muted);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.schedule .day {
  width: 145px;
  background: #f7f9fb;
}
.day strong,
.day span {
  display: block;
}
.day span {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 0.25rem;
}
.slot {
  min-height: 76px;
  border-radius: 10px;
  padding: 0.65rem;
  font-size: 0.88rem;
}
.slot.assigned {
  background: var(--blue2);
  border: 1px solid #cfe1fc;
}
.slot.mine {
  background: var(--greenbg);
  border-color: #b8e8d4;
  box-shadow: inset 3px 0 var(--green);
}
.slot.available {
  display: grid;
  place-items: center;
  border: 1px dashed #aac3d8;
  color: var(--blue);
  background: #fbfdff;
}
.slot.unavailable {
  display: grid;
  place-items: center;
  background: var(--greybg);
  color: var(--grey);
}
.slot.clickable {
  cursor: pointer;
}
.slot strong,
.slot span {
  display: block;
}
.slot span {
  margin-top: 0.3rem;
  color: var(--muted);
  font-size: 0.8rem;
}
.slot input {
  margin-inline-end: 0.4rem;
}
.legend {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 0.9rem;
  color: var(--muted);
  font-size: 0.85rem;
}
.dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 3px;
  margin-inline-end: 0.35rem;
}
.dot.assigned {
  background: var(--blue);
}
.dot.available {
  background: #b7d7fa;
}
.dot.unavailable {
  background: var(--grey);
}
.dot.mine {
  background: var(--green);
}
.table-wrap {
  overflow: auto;
}
.data-table {
  width: 100%;
  border-collapse: collapse;
}
.data-table th,
.data-table td {
  text-align: start;
  padding: 0.8rem;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.data-table th {
  font-size: 0.8rem;
  color: var(--muted);
  text-transform: uppercase;
}
.data-table tr:last-child td {
  border: 0;
}
.badge {
  display: inline-block;
  border-radius: 999px;
  padding: 0.3rem 0.6rem;
  font-size: 0.78rem;
  font-weight: 800;
}
.badge.approved,
.badge.active {
  color: var(--green);
  background: var(--greenbg);
}
.badge.pending {
  color: var(--orange);
  background: var(--orangebg);
}
.badge.rejected,
.badge.inactive {
  color: var(--red);
  background: var(--redbg);
}
.toggle {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}
.switch {
  width: 50px;
  height: 28px;
  border-radius: 999px;
  background: var(--grey);
  border: 0;
  padding: 3px;
}
.switch:after {
  content: "";
  display: block;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  transition: 0.2s;
}
.switch.on {
  background: var(--green);
}
.switch.on:after {
  transform: translateX(22px);
}
[dir="rtl"] .switch.on:after {
  transform: translateX(-22px);
}
.capacity-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.65rem;
}
.capacity-grid label {
  text-align: center;
}
.capacity-grid input {
  text-align: center;
}
dialog {
  border: 0;
  border-radius: 18px;
  padding: 0;
  width: min(520px, calc(100% - 2rem));
  box-shadow: 0 25px 80px #0018;
}
dialog::backdrop {
  background: #102a4388;
  backdrop-filter: blur(2px);
}
.modal-pad {
  padding: 1.4rem;
}
.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.2rem;
}
.modal-head h3 {
  margin: 0;
}
.close {
  border: 0;
  background: var(--greybg);
  border-radius: 9px;
  width: 34px;
  height: 34px;
}
.toast {
  position: fixed;
  inset: auto 1.5rem 1.5rem auto;
  z-index: 30;
  background: var(--navy);
  color: #fff;
  padding: 0.85rem 1rem;
  border-radius: 11px;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: 0.2s;
}
.toast.show {
  opacity: 1;
  transform: none;
}
.toast.error {
  background: var(--red);
}
[dir="rtl"] body {
  font-family: Tahoma, "Segoe UI", sans-serif;
}
[dir="rtl"] .lang-toggle {
  inset: 1.5rem auto auto 1.5rem;
}
[dir="rtl"] .toast {
  inset: auto auto 1.5rem 1.5rem;
}
@media (max-width: 900px) {
  .login-page {
    grid-template-columns: 1fr;
  }
  .login-brand {
    display: none;
  }
  .login-side {
    min-height: 100vh;
  }
  .shell {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 270px;
    z-index: 20;
    transform: translateX(-100%);
    transition: 0.2s;
  }
  .sidebar.open {
    transform: none;
  }
  [dir="rtl"] .sidebar {
    inset: 0 0 0 auto;
    transform: translateX(100%);
  }
  [dir="rtl"] .sidebar.open {
    transform: none;
  }
  .mobile-menu {
    display: block;
    border: 0;
    background: var(--greybg);
    border-radius: 9px;
    padding: 0.5rem;
  }
  .stats {
    grid-template-columns: 1fr 1fr;
  }
  .grid2 {
    grid-template-columns: 1fr;
  }
  .capacity-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}
@media (max-width: 560px) {
  .stats {
    grid-template-columns: 1fr;
  }
  .topbar {
    height: 64px;
    gap: 0.4rem;
    padding-inline: 0.75rem;
  }
  .topbar h1 {
    display: none;
  }
  .topbar > .stack:last-child {
    gap: 0.35rem;
  }
  .topbar .lang-toggle button {
    padding: 0.38rem 0.48rem;
  }
  .topbar #logout {
    padding: 0.45rem 0.55rem;
    font-size: 0.75rem;
  }
  .content {
    padding: 1rem;
  }
  .page-head {
    align-items: start;
    flex-direction: column;
  }
  .card {
    padding: 1rem;
    border-radius: 14px;
  }
  .capacity-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .login-side {
    padding: 1.25rem;
  }
  .lang-toggle {
    inset: 1rem 1rem auto auto;
  }
}
