/* YallaGooo — web portal for managers, captains and the platform admin (extends admin.css) */

/* ---------- auth pages ---------- */
.auth-page { min-height: 100vh; display: grid; grid-template-columns: minmax(320px, 44%) 1fr; background: var(--bg); }
.auth-side { position: relative; overflow: hidden; background: linear-gradient(160deg, var(--red-600), var(--red-900)); color: #fff; padding: 40px 44px; display: flex; flex-direction: column; gap: 14px; }
.auth-side h2 { font-size: 30px; margin-top: 30px; }
.auth-side p { opacity: .85; max-width: 420px; }
.auth-logo { height: 42px; }
.auth-art { margin-top: auto; max-width: 420px; align-self: center; filter: drop-shadow(0 20px 40px rgba(0, 0, 0, .25)); animation: floaty 6s ease-in-out infinite; }
.auth-side i { position: absolute; border-radius: 50%; background: rgba(255, 255, 255, .07); }
.auth-side .b1 { width: 380px; height: 380px; top: -120px; left: -120px; }
.auth-side .b2 { width: 240px; height: 240px; bottom: -80px; right: -60px; }
@keyframes floaty { 50% { transform: translateY(-12px); } }
.auth-main { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 32px 18px; }
.auth-mobile-logo { display: none; height: 40px; margin-bottom: 18px; }
.auth-card { width: 100%; max-width: 440px; background: var(--card); border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow); padding: 30px 28px; display: grid; gap: 14px; }
.auth-card.wide { max-width: 780px; }
.auth-card h1 { font-size: 24px; margin: 0; }
.auth-card > p.muted { margin: -8px 0 4px; }
.auth-switch { text-align: center; margin: 4px 0 0; color: var(--muted); }
.back-link { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 14px; }
.form-sep { font-weight: 700; color: var(--red-700); border-top: 1px dashed var(--line); padding-top: 12px; margin-top: 4px; }
.role-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.role-choice { display: grid; gap: 8px; padding: 22px; border: 2px solid var(--line); border-radius: 18px; color: var(--ink); transition: border-color .2s, transform .2s, box-shadow .2s; }
.role-choice:hover { border-color: var(--red-300); transform: translateY(-3px); box-shadow: var(--shadow); }
.role-choice .ic { width: 58px; height: 58px; border-radius: 16px; display: grid; place-items: center; background: var(--red-50); color: var(--red-600); }
.role-choice b { font-size: 18px; }
.role-choice small { color: var(--muted); line-height: 1.7; }
.policies-check { display: flex; gap: 10px; align-items: flex-start; background: var(--red-50); border-radius: 12px; padding: 12px 14px; font-size: 14px; }
.policies-check input { margin-top: 5px; accent-color: var(--red-600); width: 18px; height: 18px; }
.note { background: #FFF8EC; border: 1px solid #F6E2BE; color: #7A5414; border-radius: 12px; padding: 10px 14px; font-size: 14px; }
.btn.lg { padding: 13px 22px; font-size: 16px; }

/* documents */
.doc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.doc-pick { position: relative; display: grid; gap: 6px; align-content: start; border: 1.5px dashed var(--red-200); border-radius: 14px; padding: 12px; background: #FFFBFB; }
.doc-pick b { font-size: 14px; }
.doc-pick input[type=file] { font-size: 13px; padding: 6px; }
.doc-pick img { width: 100%; max-height: 120px; object-fit: cover; border-radius: 10px; }
.doc-ic { width: 38px; height: 38px; border-radius: 10px; background: var(--red-50); color: var(--red-600); display: grid; place-items: center; }
.f.mini span { font-size: 12.5px; }
.doc-status { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.doc-status span { padding: 4px 12px; border-radius: 999px; font-size: 13px; background: #F1ECEE; color: var(--muted); }
.doc-status .ok { background: #E6F6EE; color: var(--ok); }
.doc-status .bad { background: var(--red-100); color: var(--red-700); }
.docs-view { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.doc-card { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: #fff; display: grid; }
.doc-card .doc-img { aspect-ratio: 4 / 3; background: #F6F0F2; display: grid; place-items: center; color: var(--muted); overflow: hidden; }
.doc-card .doc-img img { width: 100%; height: 100%; object-fit: cover; }
.doc-card > div:last-child { padding: 10px 12px; display: grid; gap: 4px; font-size: 14px; }

/* ---------- pills & avatars ---------- */
.pill { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.pill.amber { background: #FFF4E0; color: #9A6212; }
.pill.blue { background: #E7F0FB; color: var(--info); }
.pill.red { background: var(--red-100); color: var(--red-700); }
.pill.green { background: #E3F5EC; color: var(--ok); }
.pill.grey { background: #F0EBED; color: var(--muted); }
.count { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: var(--red-500); color: #fff; font-size: 12px; margin-inline-start: 4px; }
.count.blue { background: var(--info); }
.avatar { width: 40px; height: 40px; flex: none; border-radius: 50%; display: inline-grid; place-items: center; background: var(--grad); color: #fff; font-weight: 800; object-fit: cover; }
.avatar.sm { width: 26px; height: 26px; font-size: 12px; }
.avatar.lg { width: 84px; height: 84px; font-size: 32px; }
.avatar.img { background: #eee; }
.avatar-wrap { position: relative; display: inline-flex; }
.presence { position: absolute; bottom: 0; left: 0; width: 13px; height: 13px; border-radius: 50%; border: 2px solid #fff; }
.presence.free { background: var(--ok); }
.presence.busy { background: var(--info); }
.dot { display: inline-block; width: 11px; height: 11px; border-radius: 50%; flex: none; vertical-align: middle; }
.dot.from { background: var(--ok); box-shadow: 0 0 0 3px #DDF3E8; }
.dot.to { background: var(--red-500); box-shadow: 0 0 0 3px var(--red-100); }

/* ---------- sidebar extras ---------- */
.side-user { display: flex; align-items: center; gap: 10px; margin: 0 14px 10px; padding: 10px 12px; border-radius: 14px; background: rgba(255, 255, 255, .06); }
.side-user b { display: block; color: #fff; font-size: 14.5px; line-height: 1.3; }
.side-user small { color: #B9A5AC; }
.side-foot { display: flex; justify-content: space-between; align-items: center; }
.link-btn.light { color: #D9C8CD; display: inline-flex; align-items: center; gap: 6px; }
.topbar .bell { position: relative; color: var(--ink-2); display: inline-flex; }
.topbar .bell b { position: absolute; top: -6px; left: -8px; background: var(--red-500); color: #fff; border-radius: 999px; font-size: 11px; min-width: 18px; height: 18px; display: grid; place-items: center; padding: 0 4px; }
.live-dot { width: 10px; height: 10px; border-radius: 50%; background: #CBBFC3; transition: background .3s; }
.live-dot.on { background: var(--ok); box-shadow: 0 0 0 4px #DDF3E8; animation: pulse 2s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 7px rgba(46, 158, 106, .08); } }
[hidden] { display: none !important; }
.flash.warn { background: #FFF6E5; color: #8A5A10; border: 1px solid #F6E2BE; }
.flash { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* ---------- toolbar / search / pager ---------- */
.tabs { flex-wrap: wrap; }
.tabs a { display: inline-flex; align-items: center; }
.search { display: flex; gap: 8px; margin: 0; }
.search input { min-width: 240px; }
.pager { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 18px 0; }
.empty { padding: 40px 16px; }

/* ---------- order cards ---------- */
.order-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.order-list { display: grid; gap: 12px; }
.order-card { display: grid; gap: 10px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; color: var(--ink); box-shadow: var(--shadow); transition: transform .18s, border-color .18s; }
.order-card:hover { transform: translateY(-2px); border-color: var(--red-200); }
.oc-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.oc-head .code { font-size: 15px; letter-spacing: .3px; }
.oc-time { margin-inline-start: auto; }
.oc-manager { display: flex; align-items: center; gap: 6px; color: var(--red-700); font-weight: 700; font-size: 14px; }
.route { display: grid; gap: 6px; position: relative; }
.route > div { display: flex; align-items: flex-start; gap: 10px; font-size: 14.5px; }
.route .dot { margin-top: 7px; }
.oc-details { margin: 0; color: var(--ink-2); font-size: 14px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.oc-money { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13.5px; color: var(--muted); border-top: 1px dashed var(--line); padding-top: 8px; }
.oc-money b { color: var(--ink); }
.oc-captain, .oc-pending { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.oc-pending { color: var(--info); font-weight: 600; }
.order-with-action { display: grid; gap: 8px; }
.order-with-action form { margin: 0; }
.fab { position: fixed; bottom: 22px; left: 22px; z-index: 30; display: inline-flex; align-items: center; gap: 8px; padding: 14px 20px; border-radius: 999px; background: var(--grad); color: #fff; font-weight: 700; box-shadow: 0 10px 26px rgba(204, 53, 80, .4); }

/* ---------- order form ---------- */
.order-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 18px; align-items: start; }
.map-panel { position: sticky; top: 80px; display: grid; gap: 10px; }
.map { width: 100%; height: 340px; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); background: #EDE6E8; z-index: 0; }
.map.tall { height: 440px; }
.map.full { height: calc(100vh - 190px); min-height: 420px; }
.map-modes { display: flex; gap: 8px; flex-wrap: wrap; }
.map-modes label { cursor: pointer; }
.map-modes input { position: absolute; opacity: 0; }
.map-modes span { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; border: 1.5px solid var(--line); font-weight: 600; font-size: 14px; }
.map-modes input:checked + span { border-color: var(--red-400); background: var(--red-50); color: var(--red-700); }
.map-help { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.pick-state { display: flex; gap: 10px; flex-wrap: wrap; font-size: 13px; }
.pick-state span { padding: 3px 10px; border-radius: 999px; background: #F3EEF0; color: var(--muted); }
.pick-state span.set { background: #E3F5EC; color: var(--ok); }
.map-pin { width: 30px; height: 30px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 13px; border: 3px solid #fff; box-shadow: 0 4px 10px rgba(0, 0, 0, .3); }
.map-pin span { transform: rotate(45deg); }
.map-pin.from { background: var(--ok); }
.map-pin.to { background: var(--red-500); }
.cap-marker { width: 38px; height: 38px; border-radius: 50%; border: 3px solid #fff; background: var(--ok); color: #fff; display: grid; place-items: center; font-weight: 800; box-shadow: 0 4px 12px rgba(0, 0, 0, .3); overflow: hidden; }
.cap-marker img { width: 100%; height: 100%; object-fit: cover; }
.cap-marker.busy { background: var(--info); border-color: #CFE0F5; }
.cap-marker.stale { filter: grayscale(1); opacity: .7; }
.cap-marker.me { background: var(--red-500); }
.leaflet-container { font-family: inherit; }
.leaflet-popup-content { margin: 10px 14px; font-size: 14px; line-height: 1.6; text-align: right; }

/* ---------- order details ---------- */
.od-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.od-head .code { font-size: 22px; }
.od-head .pill { font-size: 14px; padding: 5px 12px; }
.od-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-inline-start: auto; }
.od-actions form { margin: 0; }
.info-list { display: grid; gap: 0; margin: 0; }
.info-list > div { display: flex; justify-content: space-between; gap: 14px; padding: 9px 0; border-bottom: 1px dashed var(--line); }
.info-list > div:last-child { border-bottom: 0; }
.info-list dt { color: var(--muted); }
.info-list dd { margin: 0; font-weight: 600; text-align: left; }
.person { display: flex; align-items: center; gap: 12px; }
.person > div { flex: 1; display: grid; }
.person-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.approval-box { border: 2px solid #CFE0F5; background: #F4F8FD; border-radius: var(--radius); padding: 16px; display: grid; gap: 12px; }
.approval-box .row-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.loc-request { border: 2px solid #F6D58E; background: #FFF8E8; border-radius: var(--radius); padding: 16px; display: grid; gap: 12px; margin-bottom: 14px; }
.loc-request > div:first-child { display: grid; gap: 4px; }
.loc-request > div:first-child span { color: var(--muted); font-size: 14px; }
.loc-request .row-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.loc-request.ok { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 10px 14px; border-color: #BFE6CF; background: #EEFAF3; color: #17784a; font-weight: 700; }
.countdown { font-weight: 800; color: var(--info); }
.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.timeline li { position: relative; padding: 0 22px 14px 0; }
.timeline li::before { content: ""; position: absolute; right: 4px; top: 8px; width: 10px; height: 10px; border-radius: 50%; background: var(--red-400); }
.timeline li::after { content: ""; position: absolute; right: 8px; top: 20px; bottom: 0; width: 2px; background: var(--line); }
.timeline li:last-child::after { display: none; }
.timeline b { display: block; font-size: 14.5px; }
.timeline small { color: var(--muted); }
.steps { display: flex; gap: 6px; margin: 4px 0 2px; }
.steps span { flex: 1; text-align: center; font-size: 12.5px; padding-top: 10px; border-top: 4px solid var(--line); color: var(--muted); }
.steps span.done { border-color: var(--red-400); color: var(--red-700); font-weight: 700; }
.rating-picker { display: flex; gap: 8px; flex-wrap: wrap; }
.rating-picker label { cursor: pointer; }
.rating-picker input { position: absolute; opacity: 0; }
.rating-picker span { display: inline-block; padding: 8px 16px; border-radius: 12px; border: 1.5px solid var(--line); font-weight: 700; }
.rating-picker input:checked + span { border-color: var(--red-400); background: var(--red-50); color: var(--red-700); }
.rating-item { display: grid; gap: 2px; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.rating-item:last-child { border-bottom: 0; }
.big-actions { display: grid; gap: 10px; }
.big-actions .btn { justify-content: center; padding: 15px; font-size: 17px; }

/* ---------- captains ---------- */
.captain-list { display: grid; gap: 10px; }
.captain-row { display: flex; align-items: center; gap: 14px; padding: 12px 16px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink); transition: border-color .18s, transform .18s; }
.captain-row:hover { border-color: var(--red-200); transform: translateY(-1px); }
.cr-main { flex: 1; display: grid; gap: 3px; min-width: 0; }
.cr-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.profile-head { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.profile-head > div { flex: 1; min-width: 200px; display: grid; gap: 4px; }
.profile-head h2 { font-size: 22px; margin: 0; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13.5px; color: var(--muted); }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 50%; vertical-align: middle; margin-inline-end: 4px; }
.map-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; }
.map-side { display: grid; gap: 8px; align-content: start; max-height: calc(100vh - 190px); overflow-y: auto; }
.map-side button { all: unset; cursor: pointer; display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); }
.map-side button:hover { border-color: var(--red-200); }

/* ---------- captain online bar ---------- */
.online-bar { display: flex; align-items: center; gap: 14px; padding: 14px 18px; border-radius: var(--radius); background: #F1ECEE; border: 1px solid var(--line); margin-bottom: 18px; }
.online-bar.on { background: linear-gradient(135deg, #E9F7F0, #F4FBF7); border-color: #BFE5D1; }
.online-bar > div { flex: 1; display: grid; gap: 2px; }
.online-bar small { color: var(--muted); }
.online-bar form { margin: 0; }
.ob-ic { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: #fff; color: var(--muted); }
.online-bar.on .ob-ic { color: var(--ok); }
.loc-state:empty { display: none; }

/* ---------- pending ---------- */
.pending-box { max-width: 620px; margin: 30px auto; text-align: center; display: grid; gap: 14px; justify-items: center; padding: 34px 26px; }
.pending-ic { width: 96px; height: 96px; border-radius: 50%; display: grid; place-items: center; background: #E7F0FB; color: var(--info); }
.pending-ic.rej { background: var(--red-100); color: var(--red-600); }

/* ---------- notifications ---------- */
.notif-list { display: grid; gap: 8px; }
.notif { display: flex; gap: 12px; padding: 14px 16px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); color: var(--ink); }
.notif.unread { border-color: var(--red-200); background: #FFF8F9; }
.notif .n-ic { width: 40px; height: 40px; flex: none; border-radius: 12px; background: var(--red-50); color: var(--red-600); display: grid; place-items: center; }
.notif > div { flex: 1; display: grid; gap: 2px; }
.notif form { margin: 0; }

/* ---------- reports ---------- */
.report-form { display: flex; gap: 10px; align-items: end; flex-wrap: wrap; margin: 0; }
.report-form .f { margin: 0; }
.bars { display: grid; gap: 8px; }
.bar { display: grid; grid-template-columns: 140px 1fr 60px; gap: 10px; align-items: center; font-size: 14px; }
.bar i { display: block; height: 10px; border-radius: 99px; background: var(--grad); }
.bar > span:nth-child(2) { background: #F3ECEE; border-radius: 99px; overflow: hidden; }

/* ---------- toasts ---------- */
.toasts { position: fixed; top: 74px; left: 18px; z-index: 2000; display: grid; gap: 10px; width: min(360px, calc(100vw - 36px)); }
.toast { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; background: #fff; border-radius: 14px; border: 1px solid var(--line); border-inline-start: 4px solid var(--red-500); box-shadow: 0 12px 30px rgba(46, 33, 39, .18); animation: toastIn .35s ease; cursor: pointer; }
.toast b { display: block; }
.toast small { color: var(--ink-2); }
.toast.out { animation: toastOut .3s ease forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateX(-30px); } }
@keyframes toastOut { to { opacity: 0; transform: translateX(-30px); } }
.reload-hint { position: fixed; bottom: 20px; right: 50%; transform: translateX(50%); z-index: 40; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
    .order-layout, .map-layout { grid-template-columns: 1fr; }
    .map-panel { position: static; }
    .map-side { max-height: none; }
}
@media (max-width: 900px) {
    .auth-page { grid-template-columns: 1fr; }
    .auth-side { display: none; }
    .auth-mobile-logo { display: block; }
    .search input { min-width: 0; width: 100%; }
    .search { flex: 1; }
    .order-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
    .role-choices, .doc-grid { grid-template-columns: 1fr; }
    .auth-card { padding: 22px 18px; }
    .online-bar { flex-wrap: wrap; }
    .online-bar form, .online-bar form .btn { width: 100%; justify-content: center; }
    .map.tall { height: 340px; }
    .bar { grid-template-columns: 100px 1fr 44px; }
    .fab { left: 14px; bottom: 14px; }
    .info-list dd { text-align: left; }
}

/* ---------- captain day dashboard ---------- */
.day-hero { background: linear-gradient(135deg, var(--red-500), var(--red-700)); color: #fff; border: 0; }
.day-hero h2 { color: #fff; margin: 0; font-size: 22px; }
.day-hero small, .day-hero .muted { color: rgba(255, 255, 255, .8); }
.day-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.day-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.day-stats > div { background: rgba(255, 255, 255, .12); border-radius: 14px; padding: 14px; display: grid; gap: 2px; }
.day-stats b { font-size: 24px; font-weight: 800; }
.day-stats .cash { background: rgba(255, 255, 255, .22); }
.doc-status .warn { background: #FFF4E0; color: #9A6212; }
@media (max-width: 760px) { .day-stats { grid-template-columns: 1fr 1fr; } .day-stats b { font-size: 20px; } }

/* ---------- captain day line ---------- */
.day-nav { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.dayline { display: grid; gap: 10px; padding: 6px 0 4px; }
.dl-row { display: grid; grid-template-columns: 70px 1fr; align-items: center; gap: 10px; }
.dl-label { font-size: 13px; color: var(--muted); font-weight: 700; }
.dl-track { position: relative; height: 26px; background: #F5EEF0; border-radius: 8px; overflow: hidden; }
.dl-online { position: absolute; top: 5px; bottom: 5px; background: var(--ok); border-radius: 6px; opacity: .85; }
.dl-online.open { background: linear-gradient(to left, var(--ok), #7FD1A8); }
.dl-trip { position: absolute; top: 3px; bottom: 3px; background: var(--red-300); border-radius: 6px; min-width: 6px; overflow: hidden; box-shadow: 0 0 0 1.5px #fff; }
.dl-trip:hover { filter: brightness(.92); }
.dl-trip .dl-go { position: absolute; left: 0; top: 0; bottom: 0; background: var(--red-600); }
.dl-trip.cancelled, .dl-trip.requeued { background: #C9BCC0; }
.dl-trip.cancelled .dl-go, .dl-trip.requeued .dl-go { background: #A99BA0; }
.dl-trip.active { animation: pulse 2s infinite; }
.dl-hours { position: relative; height: 18px; margin-right: 80px; font-size: 11.5px; color: var(--muted); }
.dl-hours span { position: absolute; transform: translateX(50%); top: 0; }
.dl-now { position: absolute; top: -66px; height: 84px; width: 2px; background: var(--red-600); }
.day-steps { list-style: none; margin: 0; padding: 0; }
.day-steps li { display: grid; grid-template-columns: 74px 34px 1fr; gap: 10px; align-items: start; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.day-steps li:last-child { border-bottom: 0; }
.day-steps time { font-weight: 800; color: var(--ink-2); font-size: 14px; padding-top: 6px; }
.day-steps .ds-ic { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: #F1ECEE; color: var(--muted); }
.day-steps li.green .ds-ic { background: #E3F5EC; color: var(--ok); }
.day-steps li.red .ds-ic { background: var(--red-100); color: var(--red-600); }
.day-steps li.amber .ds-ic { background: #FFF4E0; color: #9A6212; }
.day-steps li.blue .ds-ic { background: #E7F0FB; color: var(--info); }
.day-steps li > div { display: grid; gap: 2px; }
@media (max-width: 560px) {
    .dl-row { grid-template-columns: 1fr; gap: 4px; }
    .dl-hours { margin-right: 0; }
    .dl-now { display: none; }
    .day-steps li { grid-template-columns: 62px 30px 1fr; gap: 8px; }
}

/* ---------- captain: available orders map ---------- */
.fee-pin { position: relative; display: inline-flex; align-items: baseline; gap: 2px; padding: 5px 9px; border-radius: 12px; background: var(--ok); color: #fff; font-weight: 800; box-shadow: 0 4px 12px rgba(0, 0, 0, .3); border: 2px solid #fff; white-space: nowrap; }
.fee-pin b { font-size: 15px; }
.fee-pin small { font-size: 10px; opacity: .9; }
.fee-pin::after { content: ""; position: absolute; bottom: -8px; left: 50%; transform: translateX(-50%); border: 7px solid transparent; border-top-color: var(--ok); border-bottom: 0; }
.av-pop { display: grid; gap: 6px; font-family: inherit; }
.av-head { display: flex; justify-content: space-between; gap: 8px; color: var(--muted); }
.av-head b { color: var(--ink); font-size: 15px; }
.av-manager { color: var(--red-700); font-weight: 800; }
.av-route { display: grid; gap: 4px; }
.av-route > div { display: flex; gap: 8px; align-items: flex-start; }
.av-route .dot { margin-top: 6px; }
.av-details { margin: 0; color: var(--ink-2); }
.av-money { display: flex; gap: 12px; border-top: 1px dashed var(--line); padding-top: 6px; }
.av-actions { display: flex; gap: 6px; }
.av-actions .btn.primary { color: #fff; }

/* captain day: tiles + footer */
.day-tiles .kpi.road .kpi-icon { background: var(--red-500); color: #fff; }
.day-foot { margin: -4px 0 16px; }

/* ---------- order card: whole card opens the order, quick actions on top ---------- */
.order-card { position: relative; }
.order-card .oc-link { color: var(--ink); font-weight: 800; }
.order-card .oc-link::after { content: ""; position: absolute; inset: 0; z-index: 1; border-radius: inherit; }
.order-card .oc-act, .order-card .oc-dist { position: relative; z-index: 2; }
.oc-act { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 700; border: 1px solid var(--line); background: var(--card); color: var(--ink-2); white-space: nowrap; }
.oc-act:hover { border-color: var(--red-300); }
.oc-act.call { margin-inline-start: auto; color: var(--red-600); border-color: var(--red-200); background: var(--red-50); }
.oc-act.nav { margin-inline-start: auto; width: 30px; height: 30px; padding: 0; justify-content: center; color: var(--ok); border-color: #BFE5D1; }
.oc-act.nav.to { color: var(--red-600); border-color: var(--red-200); }
.oc-act.phone { color: #9A6212; border-color: #F6E2BE; background: #FFF8EC; }
.oc-act.wa { color: #128C4A; border-color: #BFE8CF; width: 30px; height: 30px; padding: 0; justify-content: center; }
.route > div { align-items: center; }
.route .dot { margin-top: 0; }
.oc-customer { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 14px; font-weight: 700; padding: 6px 10px; border-radius: 12px; background: var(--red-50); }
.oc-customer .oc-act.phone { margin-inline-start: auto; }
.oc-dist { font-size: 12.5px; font-weight: 800; color: var(--info); background: #E7F0FB; border-radius: 999px; padding: 2px 9px; }
[data-theme="dark"] .oc-act.phone { background: #33280F; color: #F2C877; border-color: #54431C; }
[data-theme="dark"] .oc-act.nav { border-color: #22503E; }
[data-theme="dark"] .oc-dist { background: #172A40; color: #8FBDF2; }

/* ---------- big view switch (map / list, on the way / my trips) ---------- */
.view-switch { display: inline-flex; gap: 6px; padding: 5px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); }
.view-switch a { display: inline-flex; align-items: center; gap: 8px; padding: 12px 24px; border-radius: 12px; font-size: 16.5px; font-weight: 800; color: var(--ink-2); }
.view-switch a.active { background: var(--grad); color: #fff; box-shadow: 0 6px 16px rgba(227, 76, 97, .3); }
.view-switch a .count { background: rgba(255, 255, 255, .25); }
.view-switch a:not(.active) .count { background: var(--red-500); }
@media (max-width: 560px) { .view-switch { display: flex; width: 100%; } .view-switch a { flex: 1; justify-content: center; padding: 12px 10px; font-size: 15.5px; } }

/* ---------- new order: customer lookup ---------- */
.customer-box { display: grid; gap: 10px; margin: 4px 0 12px; padding: 12px 14px; border-radius: 14px; border: 1.5px dashed var(--red-200); background: var(--red-50); }
.cb-profile { display: grid; gap: 3px; }
.cb-profile .btn { justify-self: start; margin-top: 4px; }
.cb-orders { display: grid; gap: 6px; }
.cb-order { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 13.5px; padding: 6px 0; border-top: 1px dashed var(--line); }
.cb-new { color: var(--muted); font-size: 14px; }
.save-customer { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; }
.save-customer input { margin-top: 4px; accent-color: var(--red-600); width: 18px; height: 18px; }
.cb-profile .pill { justify-self: start; }

/* ---------- login: «ride lane» — scooter, then car, riding right → left and back ---------- */
.auth-art-wrap { margin-top: auto; align-self: center; display: grid; justify-items: center; width: min(460px, 100%); }
.auth-art-wrap .auth-art { margin-top: 0; }
.ride-lane { position: relative; width: 100%; height: 74px; margin-bottom: -6px; overflow: hidden; }
.ride-road { position: absolute; left: 4%; right: 4%; bottom: 12px; height: 3px; border-radius: 3px;
    background: repeating-linear-gradient(to left, rgba(255, 255, 255, .55) 0 18px, transparent 18px 32px); animation: ride-road 1.2s linear infinite; }
.ride { position: absolute; bottom: 14px; left: 0; display: grid; justify-items: center; opacity: 0; will-change: transform; }
.ride svg { display: block; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .25)); }
.ride-flip { display: block; transform-origin: center; }
.ride .wheel { animation: ride-wheel .6s linear infinite; }
.ride-pulse { width: 46px; height: 10px; margin-top: -4px; border-radius: 50%; background: rgba(255, 255, 255, .35); animation: ride-pulse 1.2s ease-out infinite; }
/* one 20 s cycle: scooter goes and comes back (0–50 %), then the car (50–100 %) */
.ride-bike { animation: ride-bike 20s linear infinite; }
.ride-car { animation: ride-car 20s linear infinite; }
.ride-bike .ride-flip { animation: ride-flip-bike 20s steps(1) infinite; }
.ride-car .ride-flip { animation: ride-flip-car 20s steps(1) infinite; }
@keyframes ride-bike {
    0% { transform: translateX(var(--lane-end)); opacity: 0; }
    2% { opacity: 1; }
    23% { transform: translateX(-10px); opacity: 1; }      /* reached the left side */
    27% { transform: translateX(-10px); opacity: 1; }      /* short stop — the "delivery" */
    48% { transform: translateX(var(--lane-end)); opacity: 1; }
    50%, 100% { transform: translateX(var(--lane-end)); opacity: 0; }
}
@keyframes ride-car {
    0%, 50% { transform: translateX(var(--lane-end)); opacity: 0; }
    52% { opacity: 1; }
    73% { transform: translateX(-10px); opacity: 1; }
    77% { transform: translateX(-10px); opacity: 1; }
    98% { transform: translateX(var(--lane-end)); opacity: 1; }
    100% { transform: translateX(var(--lane-end)); opacity: 0; }
}
/* drawn facing left; flipped while riding back to the right */
@keyframes ride-flip-bike { 0% { transform: scaleX(1); } 25% { transform: scaleX(-1); } 50% { transform: scaleX(1); } }
@keyframes ride-flip-car { 0% { transform: scaleX(1); } 75% { transform: scaleX(-1); } }
@keyframes ride-wheel { to { transform: rotate(-360deg); } }
@keyframes ride-road { to { background-position-x: -32px; } }
@keyframes ride-pulse { 0% { transform: scale(.6); opacity: .9; } 100% { transform: scale(1.5); opacity: 0; } }
.ride-lane { container-type: inline-size; }
.ride { --lane-end: calc(100cqw - 92px); }
/* pickup / drop-off pins pulsing at both ends of the road */
.ride-pin { position: absolute; bottom: 10px; width: 12px; height: 12px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 0 rgba(255, 255, 255, .7); animation: ride-pin 1.6s ease-out infinite; }
.ride-pin-a { right: 3%; }
.ride-pin-b { left: 3%; animation-delay: .8s; }
@keyframes ride-pin { 0% { box-shadow: 0 0 0 0 rgba(255, 255, 255, .7); } 100% { box-shadow: 0 0 0 16px rgba(255, 255, 255, 0); } }
/* phones: the side panel is hidden, show the lane under the logo on a red strip */
.auth-mobile-ride { display: none; width: 100%; max-width: 440px; margin: 0 auto 14px; border-radius: 18px; background: linear-gradient(135deg, var(--red-500), var(--red-700)); }
@media (max-width: 900px) { .auth-mobile-ride { display: block; } }
@media (prefers-reduced-motion: reduce) { .ride, .ride-flip, .ride .wheel, .ride-road, .ride-pulse, .ride-pin { animation: none; } .ride-bike { opacity: 1; transform: translateX(40%); } }
.auth-mobile-logo { height: auto; }
.auth-mobile-logo img { display: block; height: 40px; width: auto; margin: 0 auto; }

/* ---------- login / register: "get the app" under the card ---------- */
.auth-apps { width: 100%; max-width: 440px; margin: 22px auto 0; display: grid; justify-items: center; gap: 10px; }
.auth-card.wide ~ .auth-apps { max-width: 780px; }
.auth-apps-title { margin: 0; font-weight: 800; color: var(--ink-2); display: flex; align-items: center; gap: 10px; }
.auth-apps-title::before, .auth-apps-title::after { content: ""; width: 48px; height: 1px; background: var(--line); }
.auth-apps .qr-card { box-shadow: var(--shadow); }
.qr-btn { white-space: nowrap; }
.auth-mobile-apps { display: none; width: 100%; max-width: 440px; margin: 18px auto 0; text-align: center; }
.auth-mobile-apps .app-buttons { display: flex; margin-top: 8px; }
.auth-mobile-apps .app-buttons a { font-size: 14px; }
@media (max-width: 900px) { .auth-apps { display: none; } .auth-mobile-apps { display: block; } }
/* short desktop screens: smaller QR cards so the card + codes fit */
@media (max-height: 860px) and (min-width: 901px) {
    .auth-apps .qr-card { width: 150px; padding: 10px; gap: 4px; }
    .auth-apps .qr-card img { width: 100px; height: 100px; }
    .auth-apps .qr-card small { min-height: 0; font-size: 12px; }
    .auth-apps .qr-btn { font-size: 12.5px; padding: 6px 10px; }
    .auth-main { justify-content: flex-start; padding-top: 70px; }
}

/* ---------- stores ---------- */
.store-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.store-card { display: grid; gap: 8px; padding: 14px 16px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); color: var(--ink); transition: transform .18s, border-color .18s; }
.store-card:hover { transform: translateY(-2px); border-color: var(--red-200); }
.sc-head { display: flex; align-items: center; gap: 10px; }
.sc-head > div { flex: 1; display: grid; }
.sc-ic { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--red-50); color: var(--red-600); flex: none; }
.sc-ic.big { width: 72px; height: 72px; border-radius: 20px; }
.sc-row { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ink-2); }
.sc-row svg { color: var(--red-400); flex: none; }
.sc-foot { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--muted); border-top: 1px dashed var(--line); padding-top: 8px; }
.phone-list { display: grid; gap: 8px; margin-bottom: 8px; }
.phone-row { display: flex; gap: 6px; align-items: center; }
.store-phones { display: grid; gap: 8px; }
.store-phone { display: flex; align-items: center; gap: 8px; }
.store-phone b { flex: 1; font-size: 16px; }
.store-pick { display: grid; gap: 8px; margin-bottom: 12px; padding: 12px; border-radius: 14px; background: var(--red-50); border: 1.5px dashed var(--red-200); }
.store-pick select { font-weight: 700; }
.store-pick-info { font-size: 13px; color: var(--ink-2); display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ---------- Delivery areas (governorate chips + the manager's areas) ---------- */
.city-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 16px; }
.city-chip { padding: 8px 14px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--card, #fff); font-weight: 800; font-size: 14px; color: inherit; text-decoration: none; display: inline-flex; gap: 6px; align-items: center; }
.city-chip small { background: var(--red-50); color: var(--red-600); border-radius: 999px; padding: 0 7px; font-size: 12px; }
.city-chip.active { background: var(--red-500); border-color: var(--red-500); color: #fff; }
.city-chip.active small { background: rgba(255,255,255,.25); color: #fff; }
.areas-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.area-add { display: flex; gap: 8px; margin: 10px 0 14px; }
.area-add input { flex: 1; min-width: 0; }
.area-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 8px; }
.area-row { display: flex; gap: 6px; align-items: center; padding: 6px; border: 1px solid var(--line); border-radius: 14px; }
.area-rename { display: flex; gap: 6px; flex: 1; min-width: 0; }
.area-rename input { flex: 1; min-width: 0; border: 0; background: transparent; font: inherit; font-weight: 700; padding: 6px 8px; border-radius: 10px; }
.area-rename input:focus { background: var(--bg-soft, #f7f3f4); outline: none; }
.addr-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.addr-grid .span2 { grid-column: 1 / -1; }
@media (max-width: 640px) { .addr-grid { grid-template-columns: 1fr; } .area-add { flex-direction: column; } }
/* Portal dialogs: the form body gets side padding (the header has its own). */
dialog.modal > form.form { padding-bottom: 20px; }
dialog.modal > form.form > :not(.modal-head) { margin-inline: 22px; }
.hidden-item { opacity: .5; }
.city-add { display: inline-flex; gap: 6px; }
.city-add input { width: 140px; padding: 6px 10px; border-radius: 999px; }
.city-edit { justify-content: flex-start; }
.city-edit .city-name { font-size: 20px; font-weight: 900; border: 0; background: transparent; font-family: inherit; padding: 4px 8px; border-radius: 10px; min-width: 0; flex: 1; max-width: 320px; }
.city-edit .city-name:focus { background: var(--bg-soft, #f7f3f4); outline: none; }
.city-del { margin-top: -6px; }
.area-rename .chk { white-space: nowrap; font-size: 13px; }

/* ---------- Captain: «مناطقي» (on / off per area) ---------- */
.ca-city summary { display: flex; align-items: center; gap: 10px; cursor: pointer; list-style: none; font-size: 17px; }
.ca-city summary::-webkit-details-marker { display: none; }
.ca-city summary .ca-all { margin-inline-start: auto; display: flex; gap: 6px; }
.ca-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; margin-top: 14px; }
.ca-switch { justify-content: space-between; padding: 10px 12px; border: 1px solid var(--line); border-radius: 14px; font-weight: 700; }
@media (max-width: 640px) { .ca-city summary { flex-wrap: wrap; } .ca-city summary .ca-all { margin-inline-start: 0; } }

/* Login side panel: text a bit lower, bigger illustration (no empty gap between them). */
.auth-side h2 { margin-top: clamp(30px, 10vh, 120px); }
.auth-art-wrap { width: min(620px, 100%); }
.auth-art-wrap .auth-art { width: 100%; max-width: 100%; max-height: 62vh; object-fit: contain; }

/* ---------- login / register: form in the middle, "get the app" strip at the bottom ---------- */
.auth-main { min-height: 100vh; justify-content: flex-start; padding: 32px 18px 22px; }
.auth-body { margin-top: auto; width: 100%; display: flex; flex-direction: column; align-items: center; }
.auth-apps {
    margin: auto auto 0; padding: 12px 14px; width: 100%; max-width: 440px;
    display: flex; align-items: center; gap: 12px; justify-items: initial;
    background: var(--card); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow);
}
.auth-body + .auth-apps { margin-top: auto; }
.auth-main > .auth-body { margin-bottom: 26px; }
.aa-text { flex: 1; display: grid; gap: 2px; }
.aa-text b { font-size: 15px; }
.aa-text small { color: var(--muted); font-size: 12.5px; }
.aa-qr {
    position: relative; display: grid; justify-items: center; gap: 4px; padding: 6px 6px 4px; border-radius: 14px;
    background: #fff; border: 1px solid var(--line); line-height: 0;
    transition: transform .25s ease, box-shadow .25s ease; transform-origin: bottom center;
}
.aa-qr img { width: 76px; height: 76px; display: block; border-radius: 6px; }
.aa-qr:hover, .aa-qr:focus-visible { transform: scale(2); z-index: 5; box-shadow: 0 18px 40px rgba(94, 26, 44, .3); }
.aa-logo.android { color: #3DDC84; }
.aa-logo.ios { color: #111; }
@media (max-width: 900px) { .auth-apps { display: none; } }
@media (max-height: 860px) and (min-width: 901px) { .auth-main { padding-top: 32px; } }
/* The red panel never grows past the screen (the picture shrinks instead), so the form stays centred and the strip visible. */
@media (min-width: 901px) {
    .auth-side { position: sticky; top: 0; height: 100vh; }
    .auth-art-wrap .auth-art { max-height: calc(100vh - 440px); min-height: 220px; }
}
@media (max-width: 900px) { .auth-body { margin-top: 0; } .auth-mobile-apps { margin-top: auto; padding-top: 18px; } }

/* New order: «لمن يُرسل الطلب؟» */
.assign-modes { display: grid; gap: 8px; margin-bottom: 8px; }
.assign-modes .chk { align-items: flex-start; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 14px; cursor: pointer; }
.assign-modes .chk:has(input:checked) { border-color: var(--red-400); background: var(--red-50); }
.assign-modes .chk span { line-height: 1.6; }

/* ---------- Admin: user guide (codes + page tree + editor) ---------- */
.gd-intro { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.gd-intro h2 { margin: 0 0 4px; }
.gd-intro p { margin: 0; max-width: 820px; }
.gd-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 12px; }
.gd-head h2 { margin: 0 0 4px; }
.gd-head p { margin: 0; }
.table-wrap { overflow-x: auto; }
.gd-new-code { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 14px; margin-bottom: 12px; border-radius: 14px; background: #EEFAF3; border: 1px solid #BFE6CF; }
.gd-new-code strong { font: 800 22px/1 ui-monospace, Consolas, monospace; letter-spacing: .12em; color: #17784a; }
.gd-tree { display: grid; gap: 10px; }
.gd-node { border: 1px solid var(--line); border-radius: 16px; padding: 10px 14px; background: var(--card); }
.gd-node > summary { display: flex; align-items: center; gap: 10px; cursor: pointer; font-size: 16px; list-style: none; }
.gd-node > summary::-webkit-details-marker { display: none; }
.gd-node > summary::before { content: "◂"; color: var(--muted); transition: transform .15s; }
.gd-node[open] > summary::before { transform: rotate(-90deg); }
.gd-sub { margin: 8px 0 0; background: var(--bg-soft, #FCF8F9); }
.gd-count { margin-inline-start: auto; padding: 0 8px; border-radius: 999px; background: var(--red-50); color: var(--red-600); font-size: 12px; font-weight: 800; }
.gd-actions { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 4px; }
.gd-pages { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; }
.gd-pages li { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 6px 10px; border: 1px solid var(--line); border-radius: 12px; }
.gd-pages li > a { flex: 1; min-width: 200px; color: var(--ink); }
.gd-pages li .gd-actions { margin: 0; }
.gd-pages li.off { opacity: .6; }
.gd-duration { display: flex; gap: 6px; }
.gd-duration input { width: 100px; }
.gd-scope { display: grid; gap: 8px; }
.gd-scope-part { padding: 10px 12px; border: 1px solid var(--line); border-radius: 14px; }
.gd-scope-part.guarded { background: #FFF8E8; border-style: dashed; }
.gd-scope-kids { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 6px; padding-inline-start: 24px; }
.gd-steps { display: flex; flex-wrap: wrap; gap: 6px; }
.gd-audience { display: flex; gap: 18px; flex-wrap: wrap; }
.guide-editor { display: grid; gap: 6px; }
.guide-edit-bar { display: flex; flex-wrap: wrap; gap: 4px; padding: 6px; border: 1px solid var(--line); border-radius: 12px 12px 0 0; background: var(--bg-soft, #FCF8F9); }
.guide-edit-bar button { min-width: 34px; height: 32px; border: 1px solid var(--line); border-radius: 8px; background: #fff; cursor: pointer; font: inherit; font-size: 13px; }
.guide-edit-bar button:hover { border-color: var(--red-300); color: var(--red-600); }
.guide-area { min-height: 360px; max-height: 70vh; overflow-y: auto; padding: 14px 16px; border: 1.5px solid var(--line); border-top: 0; border-radius: 0 0 12px 12px; background: #fff; line-height: 1.9; }
.guide-area:focus { outline: none; border-color: var(--red-300); }
.guide-area img { max-width: 100%; height: auto; border-radius: 12px; border: 1px solid var(--line); }
.guide-area figure { margin: 10px 0; text-align: center; }
.guide-area figure.phone img { width: min(100%, 340px); }
.guide-area blockquote, .guide-area .note { margin: 10px 0; padding: 8px 12px; border-radius: 10px; background: var(--red-50); border-inline-start: 4px solid var(--red-500); }
.guide-area .tip { margin: 10px 0; padding: 8px 12px; border-radius: 10px; background: #EEFAF3; border-inline-start: 4px solid #1F9D60; }
.guide-source { min-height: 360px; font: 13px/1.6 ui-monospace, Consolas, monospace; padding: 10px; border: 1.5px solid var(--line); border-radius: 0 0 12px 12px; }
[data-theme="dark"] .guide-area, [data-theme="dark"] .gd-node, [data-theme="dark"] .guide-edit-bar button { background: var(--card); color: var(--ink); }
