﻿*{ box-sizing:border-box; }
html,body{
  min-height:100%;
  margin:0;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial;
  background: var(--bg);
  color: #fff;
  touch-action: manipulation;
  overflow-x: hidden;
  overflow-y: auto;
}

#app{
  min-height:100vh;
  min-height:100dvh;
  width:100%;
  position:relative;
}

#map{
  position: relative;
  width: 100%;
  height: auto;
  min-height: 260px;
  border-radius: 20px;
  transition: height .22s ease, border-radius .22s ease;
  will-change: height;
}

/* Leaflet */
.leaflet-control-attribution{ display:none; }
.leaflet-marker-icon{ border-radius: 999px !important; }

/* ===== Topbar ===== */
.topbar{
  position:absolute;
  top:calc(env(safe-area-inset-top) + 12px); left:12px; right:12px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  z-index:1200;
}

.brand{
  background: var(--gold);
  border: 1px solid var(--sheetBorder);
  border-radius: 14px;
  padding: 10px 12px;
  display:flex;
  align-items:center;
  gap:10px;
  color: var(--text);
  box-shadow: 0 8px 24px rgba(0,0,0,.14);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.pill{
  background: rgba(11,15,25,.55);
  color: rgba(255,255,255,.90);
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 13px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.pill.on{ border-color: rgba(46,204,113,.65); }

/* ===== Bottom Sheet ===== */
.panel{
  position:relative;
  left:auto;
  right:auto;
  bottom:auto;
  margin-top: -34px;
  width: 100%;
  z-index:1100;
  background: var(--sheet);
  border: 1px solid var(--sheetBorder);
  border-top-left-radius: var(--r22);
  border-top-right-radius: var(--r22);
  box-shadow: 0 12px 34px rgba(2,6,23,.14);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);

  padding: 12px 14px 16px;
  color: var(--text);
}

.panel.panelAnimating{
  overflow: hidden;
  will-change: height;
}

.panel::before{
  content:"";
  display:block;
  width: 46px;
  height: 5px;
  border-radius: 999px;
  background: rgba(11,15,25,.18);
  margin: 2px auto 10px;
}

.panel h3{
  margin:0 0 8px 0;
  font-size: 16px;
  font-weight: 950;
}

.small{
  font-size: 12px;
  color: var(--muted);
}

.hr{
  height:1px;
  background: rgba(11,15,25,.10);
  margin: 10px 0;
}

.row{ display:flex; gap:10px; }
.row > *{ flex:1; }

/* ===== Inputs / Buttons ===== */
.input, select{
  width:100%;
  height: var(--tap);
  background: var(--gray);
  border: 1px solid rgba(11,15,25,.12);
  border-radius: var(--r14);
  padding: 0 12px;
  outline:none;
  color: var(--text);
}
.input::placeholder{ color: rgba(11,15,25,.55); }

.btn{
  width:100%;
  height: var(--tap);
  border:0;
  border-radius: var(--r14);
  padding: 0 12px;
  font-weight: 950;
  cursor:pointer;
}
.btn:disabled{ opacity:.55; cursor:not-allowed; }

.btn-primary{ background: var(--gold); color:#111; }
.btn-ghost{ background: var(--gold); border: 1px solid rgba(11,15,25,.16); color: var(--black); }
.btn-danger{ background: var(--danger); color:#fff; }
.btn-warn{ background: var(--warn); color:#1b1600; }

.status{
  padding: 10px 12px;
  border-radius: var(--r14);
  border: 1px solid rgba(11,15,25,.12);
  background: rgba(11,15,25,.05);
  font-size: 13px;
  color: var(--text);
}

/* ===== Compact Nav Buttons ===== */
.navBtn{
  height: 40px;
  border-radius: 999px;
  border: 1px solid rgba(11,15,25,.14);
  background: rgba(11,15,25,.04);
  color: var(--text);
  font-weight: 950;
  cursor:pointer;
  padding: 0 14px;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  white-space:nowrap;
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-25%);
}
.navBtn:active{ transform: translateY(1px); }

/* ===== Actions ===== */
.actionRow{
  display:flex;
  gap:10px;
  margin-top: 10px;
}
.actionRow .btn{
  height: 48px;
  border-radius: 16px;
}
.actionRow .btn-danger{ flex: 1.2; }
.actionRow .btn-primary{ flex: .8; }

/* ===== Ride Card ===== */
.ride-card{
  width: 100%;
  margin: 10px 0;
  border-radius: var(--r18);
  padding: 15px 5px;
  color: var(--text);
  position: relative;
}
.ride-card::before{
  content:"";
  position:absolute;
  left:5px; right:5px; top:0;
  height:4px;
  border-radius:999px;
  background: var(--gold);
}
.ride-card.hidden{ display:none; }

.ride-card-header{
  display:flex;
  align-items:center;
  gap:12px;
}
.avatar{
  width:54px;
  height:54px;
  border-radius: 16px;
  object-fit: cover;
  background: rgba(255,255,255,.08);
  flex: 0 0 auto;
}
.ride-card-info{ flex:1; min-width:0; }
.ride-card-title{ font-size: 16px; font-weight: 950; }
.ride-card-sub{
  font-size: 13px;
  opacity:.84;
  margin-top:2px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.ride-card-sub{ color: rgba(11,15,25,.72); }

/* ===== Offer ===== */
.codeFare{
  font-size: 28px;
  font-weight: 1000;
  margin: 0 0 10px 0;
  text-align:center;
  color:#fff;
}
.offerPrice{ font-size: 30px; font-weight: 1000; color: var(--text); }
.offerMeta{ margin-top:6px; font-size: 14px; font-weight: 950; opacity:.9; display:flex; gap:8px; color: var(--text); }
.offerFrom, .offerTo{ margin-top: 8px; font-size: 13px; opacity:.9; color: var(--text); }

/* Pending list */
.pendingCard{
  border-radius: 16px;
  background: rgba(11,15,25,.06);
  border: 1px solid rgba(11,15,25,.10);
  padding: 12px;
  margin-top: 10px;
}
.btnAcceptPending{
  height: 46px;
  border-radius: 14px;
  border: 0;
  background: var(--gold);
  font-weight: 950;
  cursor:pointer;
}

/* ===== Modal ===== */
.modal{
  position:fixed;
  inset:0;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:16px;
  background: rgba(0,0,0,.55);
  z-index:3000;
}
.modalCard, .modal-card{
  width: min(520px, 92vw);
  background: #111;
  color: #fff;
  border-radius: 18px;
  padding: 16px;
  border: 1px solid rgba(255,255,255,.10);
  box-shadow: 0 20px 80px rgba(0,0,0,.55);
}
.modalHeader{
  display:flex;
  justify-content:space-between;
  align-items:center;
}
.modalTitle{ font-weight: 950; }
.modalClose{
  background:transparent;
  border:0;
  color:#fff;
  font-size:18px;
  cursor:pointer;
  opacity:.85;
}
.modalBody{ margin-top:12px; display:flex; flex-direction:column; gap:10px; }
.modalErr{ color:#ff6b6b; font-size: 12px; min-height: 16px; }
.field span{ display:block; font-size:12px; opacity:.7; margin-bottom:6px; }
.field input{
  width:100%;
  height: var(--tap);
  border-radius: var(--r14);
  border: 1px solid rgba(255,255,255,.12);
  background:#0b0b0b;
  color:#fff;
  outline:none;
  padding: 0 12px;
}

/* ===== Drawer ===== */
.drawerOverlay{
  position:fixed;
  inset:0;
  background: rgba(0,0,0,.55);
  z-index:2000;
}
.sideDrawer{
  position:fixed;
  top:0; left:0;
  height:100vh;
  width:320px;
  max-width:85vw;
  background:#0f1116;
  color:#fff;
  z-index:2100;
  transform: translateX(-105%);
  transition: transform .22s ease;
  box-shadow: 10px 0 30px rgba(0,0,0,.35);
  padding:14px;
}
.sideDrawer.open{ transform: translateX(0); }
.sideDrawer[aria-hidden="false"]{ transform: translateX(0); }
body.drawer-open{ overflow:hidden; }

.topbar .brand{ cursor:pointer; user-select:none; -webkit-user-select:none; touch-action: manipulation; }

/* drawer header */
.drawerHeader{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  margin-bottom: 12px;
}
.drawerProfile{ display:flex; align-items:center; gap:10px; min-width:0; }
.drvAvatar{ width: 42px; height: 42px; border-radius: 14px; object-fit: cover; background: rgba(255,255,255,.08); }
.drvName{ font-weight: 1000; font-size: 14px; line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.drvRole{ font-size: 12px; opacity: .75; margin-top: 3px; }
.drawerClose{
  width: 40px;
  height: 40px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.06);
  color: #fff;
  cursor: pointer;
}

.drawerSection{ margin-top: 12px; }
.drawerTitle{ font-size: 14px; opacity: 1; margin-bottom: 8px; font-weight: bold; }
.activeVehicleCard{
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.06);
  border-radius: 14px;
  padding: 12px;
}
.vehMain{ font-weight: 1000; font-size: 13px; }
.vehSub{ margin-top: 6px; font-size: 12px; opacity: .75; }

.drawerMenu{
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.drawerMenuItem, .drawerItem{
  width: 100%;
  text-align: left;
  padding: 12px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.06);
  color: #fff;
  font-weight: 900;
  cursor: pointer;

  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
}
.drawerMenuItem .chev{ opacity: .8; font-size: 18px; line-height: 1; }

.vehiclesPanel{
  position: absolute;
  inset: 0;
  background: #0f1116;
  padding: 14px;
  overflow-y: auto;
}
.vehiclesPanelHeader{
  display:flex;
  align-items:center;
  gap: 10px;
  margin-bottom: 10px;
}
.btnBack{
  width: 40px;
  height: 40px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.06);
  color: #000;
  cursor:pointer;
}
.vehiclesPanelTitle{ font-weight: 1000; }

.vehiclesList{
  margin-top: 10px;
  display:flex;
  flex-direction: column;
  gap: 10px;
  max-height: calc(100vh - 220px);
  overflow:auto;
  padding-right: 4px;
}
.vehicleItem{
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.06);
  border-radius: 14px;
  padding: 12px;
  cursor: pointer;
}
.vehicleItem.active{
  border-color: rgba(249,213,21,.75);
  background: rgba(249,213,21,.10);
}
.vehicleTop{ display:flex; justify-content:space-between; gap:10px; }
.vehicleName{ font-weight: 1000; font-size: 13px; }
.vehicleStatus{ font-size: 12px; opacity: .8; }
.vehicleMeta{ margin-top: 6px; font-size: 12px; opacity: .75; }

.btnPrimaryFull{
  width: 100%;
  margin-top: 12px;
  padding: 12px;
  border-radius: 14px;
  border: none;
  font-weight: 1000;
  background: var(--gold, #F9D515);
  color: #111;
  cursor: pointer;
}
.smallHint{ margin-top: 10px; font-size: 12px; opacity: 0; display: none }

#rideInfo{ display:none !important; }

/* ===== Online/Offline pill ===== */
#connPill{
  cursor:pointer;
  font-weight:1000;
  text-transform: uppercase;
  letter-spacing: .6px;
}
.pill.status-off{
  background: rgba(255,77,77,.18);
  border-color: rgba(255,77,77,.40);
}
.pill.status-on{
  background: rgba(46,204,113,.18);
  border-color: rgba(46,204,113,.45);
}

.topPills{ display:flex; gap:10px; align-items:center; }
#clockPill{
  background: rgba(11,15,25,.35);
  border-color: rgba(255,255,255,.12);
  font-weight: 950;
}

/* Responsive desktop */
@media (min-width: 1024px){
  .panel{
    left: 50%;
    transform: translateX(-50%);
    width: min(720px, calc(100% - 24px));
    border-radius: var(--r22);
    border-bottom: 1px solid var(--sheetBorder);
    bottom: auto;
    margin-top: -24px;
  }
}

/* ===== Driver UI refresh (client-like) ===== */
html, body{
  font-family: var(--app-font);
}

body, button, p, label, span, h1, h2, h3, h4, h5, h6, input, textarea, select{
  font-family: var(--app-font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.topbar{
  top: 12px;
  left: 12px;
  right: 12px;
  display: block;
}

.brand#topBrand{
  width: 100%;
  background: var(--gold);
  border: none !important;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,.14);
}

.topLeft{
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.topAvatar{
  width: 42px;
  height: 42px;
  border-radius: 16px;
  object-fit: cover;
  background: rgba(255,255,255,.25);
  border: 1px solid rgba(11,15,25,.10);
}

.topHello{
  display: flex;
  flex-direction: column;
  line-height: 1.05;
  min-width: 0;
}

.topHi{
  font-weight: 1000;
  font-size: 14px;
  color: #111;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topSub{
  font-size: 12px;
  margin-top: 3px;
  color: rgba(17,17,17,.78);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topRight{
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

#topBrand .logo{
  width: 76px;
  height: auto;
  display: block;
}

#connPill{
  cursor: pointer;
  font-weight: 1000;
  text-transform: uppercase;
  letter-spacing: .5px;
  background: rgba(11,15,25,.50);
  border-color: rgba(255,255,255,.16);
  min-width: 78px;
  text-align: center;
}

.pill.status-off{
  background: rgba(255,77,77,.20);
  border-color: rgba(255,77,77,.42);
  color: #fff;
}

.pill.status-on{
  background: rgba(46,204,113,.22);
  border-color: rgba(46,204,113,.52);
  color: #fff;
}

body.drawer-open{
  overflow: hidden;
}

.drawerOverlay{
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(11,15,25,.38);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity .22s ease;
}

.sideDrawer{
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  top: auto;
  width: 100%;
  max-width: 100vw;
  height: auto;
  min-height: 56vh;
  max-height: 88vh;
  z-index: 2100;
  background: var(--sheet);
  color: var(--text);
  transform: translateY(105%);
  transition: transform .22s ease;
  box-shadow: var(--shadowUp);
  border-radius: 22px 22px 0 0;
  padding: 10px 14px 16px;
  overflow-y: scroll;
  padding-bottom: 100px;
}

.sideDrawer.dragging{
  transition: none;
}

.sideDrawer.open,
.sideDrawer[aria-hidden="false"]{
  transform: translateY(0);
}

.drawerHandle{
  width: 44px;
  height: 5px;
  border-radius: 999px;
  background: rgba(2,6,23,.18);
  margin: 4px auto 10px;
  touch-action: none;
}

.drawerHeader{
  border-bottom: 1px solid rgba(11,15,25,.10);
  margin-bottom: 10px;
}

.drvAvatar{
  border-radius: 16px;
  background: rgba(2,6,23,.06);
  border: 1px solid rgba(2,6,23,.08);
}

.drvName{
  color: rgba(11,15,25,.92);
}

.drvRole{
  color: rgba(11,15,25,.62);
}

.drawerClose{
  border: 1px solid rgba(11,15,25,.12);
  background: rgba(255,255,255,.80);
  color: rgba(11,15,25,.85);
}

.drawerTitle{
  color: rgba(11,15,25,.78);
}

.statusCard,
.activeVehicleCard{
  background: rgba(11,15,25,.04);
  border: 1px solid rgba(11,15,25,.10);
  color: rgba(11,15,25,.88);
}

.drvRoleRow .statusBadge{
  border: 1px solid rgba(11,15,25,.12);
  background: rgba(11,15,25,.06);
  color: rgba(11,15,25,.86);
}

.drvRoleRow .statusBadge--ok{
  background: rgba(46,204,113,.16);
  border-color: rgba(46,204,113,.35);
  color: #155737;
}

.drvRoleRow .statusBadge--bad{
  background: rgba(255,77,77,.14);
  border-color: rgba(255,77,77,.30);
  color: #8a1e1e;
}

.drawerMenuItem,
.drawerItem{
  border: 1px solid rgba(11,15,25,.10);
  background: rgba(255,255,255,.82);
  color: rgba(11,15,25,.90);
}

.vehiclesPanel{
  background: var(--sheet);
  color: var(--text);
}

