/* ==========================================================================
   Square Ibis — driver app (phone-first) and the camera scanner
   ========================================================================== */

body[data-layout="driver"] .aurora { opacity: .55; }

.drv {
  position: relative;
  z-index: 1;
  max-width: 560px;
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* ---------- top bar ---------- */

.drv-top {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: calc(8px + env(safe-area-inset-top)) 12px 8px;
  background: color-mix(in srgb, var(--bg) 70%, transparent);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  border-bottom: 1px solid var(--border);
}
.drv-brand { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.drv-brand .logo { width: 36px; height: 36px; border-radius: 12px; }
.drv-brand .logo svg { width: 25px; height: 25px; }
.drv-brand-text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.drv-brand-text b { font-size: 15px; font-weight: 700; letter-spacing: -.01em; white-space: nowrap; }
.drv-brand-text em { font-family: var(--serif); font-style: italic; font-weight: 400; font-size: 1.1em; background: var(--grad-3); -webkit-background-clip: text; background-clip: text; color: transparent; }
:root[lang="ar"] .drv-brand-text em { font-family: var(--font-ar); font-style: normal; font-weight: 700; }
.drv-brand-text small { font-size: 11.5px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.drv-net { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: 99px; font-size: 11.5px; font-weight: 600; white-space: nowrap; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); }
.drv-net i { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px color-mix(in srgb, var(--green) 20%, transparent); }
.drv-net.off { color: var(--amber); border-color: color-mix(in srgb, var(--amber) 35%, transparent); background: color-mix(in srgb, var(--amber) 9%, transparent); }
.drv-net.off i { background: var(--amber); box-shadow: 0 0 0 3px color-mix(in srgb, var(--amber) 22%, transparent); }
.drv-net.sync { color: var(--cyan); }
.drv-net.sync i { background: var(--cyan); animation: dotPulse 1.2s ease-in-out infinite; }

.drv-icon { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 13px; color: var(--text-2); flex: none; transition: background .18s, color .18s, transform .18s; }
.drv-icon:hover, .drv-icon:active { background: var(--surface-2); color: var(--text); }
.drv-icon:active { transform: scale(.92); }
.drv-icon svg { width: 20px; height: 20px; }
.drv-icon.is-spinning svg { animation: spin .8s linear infinite; }

/* ---------- main & pull to refresh ---------- */

.drv-main { flex: 1; padding: 12px 12px calc(96px + env(safe-area-inset-bottom)); transform: translateY(var(--pull, 0px)); transition: transform .25s var(--ease-out); }
.drv-main.is-pulling::before { content: "↻"; position: absolute; top: -34px; left: 50%; transform: translateX(-50%); font-size: 20px; color: var(--accent); }

/* ---------- bottom tab bar ---------- */

.drv-tabs {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  z-index: 40;
  width: 100%;
  max-width: 560px;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  align-items: end;
  padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--panel-solid) 90%, transparent);
  backdrop-filter: blur(20px) saturate(150%);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  border-top: 1px solid var(--border-strong);
}
.drv-tab { position: relative; overflow: hidden; display: flex; flex-direction: column; align-items: center; gap: 3px; min-height: 54px; padding: 6px 2px; border-radius: 14px; color: var(--text-3); font-size: 11px; font-weight: 600; transition: color .2s; }
.drv-tab-icon { position: relative; display: grid; place-items: center; width: 44px; height: 30px; border-radius: 12px; transition: background .25s; }
.drv-tab-icon svg { width: 21px; height: 21px; }
.drv-tab.is-active { color: var(--text); }
.drv-tab.is-active .drv-tab-icon { background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); }
.drv-tab.center .drv-tab-icon { width: 58px; height: 58px; margin-top: -26px; border-radius: 20px; background: var(--grad); color: #fff; box-shadow: 0 12px 26px -10px rgba(var(--a0-rgb), .95), inset 0 1px 0 rgba(255, 255, 255, .3); }
.drv-tab.center .drv-tab-icon svg { width: 26px; height: 26px; }
.drv-tab.center:active .drv-tab-icon { transform: scale(.94); }
.drv-badge { position: absolute; top: -4px; inset-inline-end: -2px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; display: grid; place-items: center; font-family: var(--mono); font-size: 10px; font-weight: 700; background: var(--rose); color: #fff; box-shadow: 0 0 0 2px var(--panel-solid); }

/* ---------- today ---------- */

.drv-summary { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1fr) minmax(0, 1.35fr); gap: 8px; margin-bottom: 12px; }
.drv-summary > * { display: flex; flex-direction: column; gap: 2px; padding: 11px 12px; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); text-align: start; box-shadow: inset 0 1px 0 var(--highlight); }
.drv-summary b { font-family: var(--mono); font-size: clamp(14px, 4.6vw, 19px); font-weight: 600; letter-spacing: -.03em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.drv-summary span { font-size: 11.5px; color: var(--text-3); }
.drv-summary button:first-child, .drv-summary > :last-child { background: linear-gradient(160deg, rgba(var(--a1-rgb), .1), var(--surface) 60%); }

.drv-filters { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 0 -12px 10px; padding: 0 12px; }
.drv-filters::-webkit-scrollbar { display: none; }
.drv-filter { flex: none; display: inline-flex; align-items: center; gap: 7px; height: 40px; padding: 0 14px; border-radius: 99px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); font-size: 13.5px; font-weight: 600; white-space: nowrap; }
.drv-filter b { font-family: var(--mono); font-size: 11.5px; color: var(--text-3); }
.drv-filter[aria-selected="true"] { color: #fff; background: var(--grad); border-color: transparent; box-shadow: 0 8px 20px -10px rgba(var(--a0-rgb), .9); }
.drv-filter[aria-selected="true"] b { color: rgba(255, 255, 255, .85); }

.drv-search-wrap { position: relative; margin-bottom: 12px; }
.drv-search-wrap > svg { position: absolute; inset-inline-start: 14px; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; color: var(--text-3); pointer-events: none; }
.drv-search { width: 100%; height: 46px; padding: 0 14px; padding-inline-start: 40px; border-radius: 14px; border: 1px solid var(--border-strong); background: color-mix(in srgb, var(--bg-2) 72%, transparent); font-size: 15px; outline: none; }
.drv-search:focus { border-color: color-mix(in srgb, var(--accent) 65%, transparent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 15%, transparent); }

.drv-list { display: flex; flex-direction: column; gap: 10px; }
.drv-group { display: flex; flex-direction: column; gap: 8px; }
.drv-group + .drv-group { margin-top: 6px; }
.drv-group-head { position: sticky; top: calc(62px + env(safe-area-inset-top)); z-index: 5; display: flex; align-items: center; gap: 7px; padding: 6px 4px; font-size: 12.5px; font-weight: 700; color: var(--text-2); background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.drv-group-head svg { width: 15px; height: 15px; color: var(--accent); }
.drv-group-head span { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.drv-group-head b { font-family: var(--mono); font-size: 11.5px; padding: 1px 8px; border-radius: 99px; background: var(--surface-3); }
.drv-title { display: flex; align-items: center; gap: 10px; font-size: 18px; font-weight: 700; margin: 4px 2px 2px; }
.drv-title b { font-family: var(--mono); font-size: 12px; padding: 2px 9px; border-radius: 99px; background: var(--surface-3); }

.drv-card {
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 14px;
  border-radius: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm), inset 0 1px 0 var(--highlight);
  animation: fieldIn .4s var(--ease-out) both;
}
.drv-card.is-pending { border-color: color-mix(in srgb, var(--amber) 45%, transparent); }
.drv-card.is-hub { background: linear-gradient(160deg, color-mix(in srgb, var(--blue) 8%, transparent), var(--surface) 60%); }
.drv-card-top { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; }
.drv-who { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.drv-who b { font-size: 16.5px; font-weight: 700; letter-spacing: -.01em; overflow-wrap: anywhere; }
.drv-who .mono { font-size: 13.5px; color: var(--text-2); }
.drv-cod { display: flex; flex-direction: column; align-items: flex-end; text-align: end; flex: none; }
.drv-cod b { font-family: var(--mono); font-size: 20px; font-weight: 600; letter-spacing: -.02em; white-space: nowrap; }
.drv-cod span { font-size: 11px; color: var(--text-3); }
.drv-addr, .drv-prod, .drv-note { display: flex; align-items: flex-start; gap: 8px; font-size: 13.5px; color: var(--text-2); }
.drv-addr { cursor: pointer; }
.drv-addr svg, .drv-prod svg, .drv-note svg { width: 15px; height: 15px; flex: none; margin-top: 2px; color: var(--text-3); }
.drv-prod { align-items: center; }
.drv-prod > span:not(.drv-trk) { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drv-trk { margin-inline-start: auto; font-size: 11.5px; color: var(--text-3); }
.drv-note { padding: 8px 10px; border-radius: 12px; background: color-mix(in srgb, var(--amber) 8%, transparent); color: var(--text); }
.drv-note svg { color: var(--amber); }
.drv-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.drv-hub-note { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 9px 11px; border-radius: 12px; background: color-mix(in srgb, var(--blue) 10%, transparent); font-size: 13px; font-weight: 600; color: var(--text); }
.drv-hub-note svg { width: 16px; height: 16px; color: var(--blue); }
.drv-hub-note b { font-weight: 600; color: var(--text-2); }

.drv-acts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.drv-acts.compact { margin-bottom: 4px; }
.drv-act { display: flex; align-items: center; justify-content: center; gap: 7px; height: 46px; border-radius: 13px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text); font-size: 13.5px; font-weight: 600; text-decoration: none; transition: background .18s, transform .18s; }
.drv-act:hover { text-decoration: none; background: var(--surface-3); }
.drv-act:active { transform: scale(.96); }
.drv-act svg { width: 18px; height: 18px; color: var(--accent); }
.drv-act.wa svg { color: #25d366; }
.drv-main-acts { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 8px; }
.drv-main-acts.one { grid-template-columns: minmax(0, 1fr); }
.drv-big { height: 54px; border-radius: 16px; font-size: 15.5px; font-weight: 700; }
.drv-big svg { width: 19px; height: 19px; }
.drv-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12.5px; color: var(--text-3); }

.drv-done { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); cursor: pointer; animation: fieldIn .35s var(--ease-out) both; }
.drv-done-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.drv-done-main b { font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.drv-done-main span { font-size: 12px; color: var(--text-3); font-family: var(--mono); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.drv-done-side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.drv-done-side b { font-size: 13px; }
.drv-done-side small { font-size: 11.5px; color: var(--text-3); }

.drv-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 64px 20px; text-align: center; color: var(--text-3); font-size: 14.5px; }
.drv-empty > svg { width: 34px; height: 34px; color: var(--text-2); }

/* ---------- bottom sheet ---------- */

.drv-sheet-backdrop { position: fixed; inset: 0; z-index: 80; background: rgba(4, 5, 10, .5); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); animation: fadeIn .25s var(--ease) both; }
.drv-sheet-backdrop.is-out { animation: fadeOut .22s var(--ease) forwards; }
.drv-sheet {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 81;
  width: 100%;
  max-width: 560px;
  max-height: 92dvh;
  display: flex;
  flex-direction: column;
  translate: -50% 0;
  border-radius: 26px 26px 0 0;
  background: color-mix(in srgb, var(--panel-solid) 97%, transparent);
  border-top: 1px solid var(--border-strong);
  box-shadow: 0 -30px 80px -30px rgba(0, 0, 0, .7);
  animation: sheetUp .38s var(--ease-out); /* no fill-mode: lets the drag gesture set transform */
  transition: transform .2s var(--ease-out);
}
.drv-sheet.is-out { animation: sheetDown .25s var(--ease) forwards; }
@keyframes sheetUp { from { transform: translateY(100%); } to { transform: none; } }
@keyframes sheetDown { to { transform: translateY(100%); } }
.drv-grab { display: flex; justify-content: center; padding: 9px 0 2px; touch-action: none; }
.drv-grab span { width: 44px; height: 5px; border-radius: 99px; background: var(--border-strong); }
.drv-sheet-head { display: flex; align-items: flex-start; gap: 8px; padding: 6px 12px 8px 18px; padding-inline: 18px 12px; touch-action: none; }
.drv-sheet-head h2 { font-size: 19px; font-weight: 700; letter-spacing: -.01em; }
.drv-sheet-head p { font-size: 12.5px; color: var(--text-3); margin-top: 2px; font-family: var(--mono); }
.drv-sheet-body { flex: 1; min-height: 0; overflow-y: auto; padding: 4px 18px 14px; display: flex; flex-direction: column; gap: 14px; }
.drv-sheet-body > .drv-card { animation: none; box-shadow: none; }
.drv-sheet-foot { padding: 10px 18px calc(14px + env(safe-area-inset-bottom)); border-top: 1px solid var(--border); }
.drv-confirm { width: 100%; }

.drv-collect { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 16px; border-radius: 18px; background: linear-gradient(160deg, color-mix(in srgb, var(--green) 12%, transparent), var(--surface) 70%); border: 1px solid color-mix(in srgb, var(--green) 25%, transparent); }
.drv-collect span { font-size: 12.5px; color: var(--text-2); }
.drv-collect b { font-family: var(--mono); font-size: 34px; font-weight: 600; letter-spacing: -.03em; }
.drv-amount { height: 54px !important; font-size: 22px !important; font-family: var(--mono); font-weight: 600; }
.drv-diff { font-size: 12.5px; color: var(--amber); min-height: 0; }
.drv-diff:empty { display: none; }
.drv-gps { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-3); }
.drv-gps svg { width: 15px; height: 15px; }
.drv-gps.ok { color: var(--green); }
.drv-label { font-size: 13px; font-weight: 600; color: var(--text-2); margin: 0 0 -6px; }
.drv-reasons { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.drv-reason { min-height: 50px; padding: 8px 12px; border-radius: 14px; border: 1px solid var(--border-strong); background: var(--surface); font-size: 13.5px; font-weight: 600; color: var(--text); text-align: start; line-height: 1.25; transition: background .18s, border-color .18s, transform .18s; }
.drv-reason:active { transform: scale(.97); }
.drv-reason[aria-pressed="true"] { border-color: transparent; background: linear-gradient(135deg, #f59e0b, #f97316); color: #fff; box-shadow: 0 8px 20px -10px rgba(245, 158, 11, .9); }
.drv-hint { font-size: 13px; padding: 9px 11px; border-radius: 12px; background: var(--surface-2); color: var(--text-2); }
.drv-hint:empty { display: none; }
.drv-hint.bad { background: color-mix(in srgb, var(--rose) 10%, transparent); color: var(--rose); font-weight: 600; }

/* ---------- cash ---------- */

.drv-cash, .drv-me { display: flex; flex-direction: column; gap: 12px; }
.drv-hero { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 26px 18px; border-radius: 24px; text-align: center; background: linear-gradient(150deg, rgba(var(--a1-rgb), .22), rgba(var(--a2-rgb), .12) 70%, var(--surface)); border: 1px solid var(--border-strong); box-shadow: var(--shadow-sm), inset 0 1px 0 var(--highlight); }
.drv-hero span { font-size: 13px; color: var(--text-2); font-weight: 600; }
.drv-hero b { font-family: var(--mono); font-size: 40px; font-weight: 600; letter-spacing: -.035em; line-height: 1.1; }
.drv-hero small { font-size: 12.5px; color: var(--text-3); }
.drv-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.drv-stats > div { display: flex; flex-direction: column; gap: 2px; padding: 12px; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); }
.drv-stats b { font-family: var(--mono); font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.drv-stats span { font-size: 11.5px; color: var(--text-3); }
.drv-block { display: flex; flex-direction: column; gap: 2px; padding: 14px; border-radius: 20px; background: var(--surface); border: 1px solid var(--border); }
.drv-block h3 { font-size: 13px; font-weight: 700; color: var(--text-2); margin-bottom: 6px; }
.drv-line { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px dashed var(--border); }
.drv-line:last-child { border-bottom: 0; }
.drv-line > div:first-child { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.drv-line > div:first-child b { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.drv-line > div:first-child span { font-size: 12px; color: var(--text-3); font-family: var(--mono); }
.drv-line-end { display: flex; flex-direction: column; align-items: flex-end; }
.drv-line-end small { font-family: var(--mono); font-size: 11.5px; }

/* ---------- me ---------- */

.drv-profile { display: flex; align-items: center; gap: 14px; padding: 18px; border-radius: 22px; background: var(--surface); border: 1px solid var(--border); }
.drv-profile > div { display: flex; flex-direction: column; min-width: 0; }
.drv-profile b { font-size: 17px; }
.drv-profile span, .drv-profile small { font-size: 13px; color: var(--text-3); }
.drv-menu { display: flex; flex-direction: column; border-radius: 20px; overflow: hidden; background: var(--surface); border: 1px solid var(--border); }
.drv-menu-item { display: flex; align-items: center; gap: 14px; min-height: 56px; padding: 0 16px; font-size: 15px; font-weight: 500; text-align: start; color: var(--text); border-bottom: 1px solid var(--border); }
.drv-menu-item:last-child { border-bottom: 0; }
.drv-menu-item:active { background: var(--surface-2); }
.drv-menu-item > svg:first-child { width: 20px; height: 20px; color: var(--accent); }
.drv-menu-item span { flex: 1; }
.drv-menu-item .chev { width: 16px; height: 16px; color: var(--text-3); }
.drv-menu-item.danger, .drv-menu-item.danger > svg:first-child { color: var(--rose); }
.drv-version { text-align: center; font-size: 11.5px; color: var(--text-3); font-family: var(--mono); }

@media (min-width: 600px) {
  .drv { border-inline: 1px solid var(--border); background: color-mix(in srgb, var(--bg) 40%, transparent); }
}

/* ==========================================================================
   Camera scanner (shared by the driver app and the scan station)
   ========================================================================== */

body.scanner-open { overflow: hidden; }
.scanner { position: fixed; inset: 0; z-index: 150; background: #000; color: #fff; display: flex; flex-direction: column; animation: fadeIn .2s var(--ease) both; }
.scanner.is-out { animation: fadeOut .2s var(--ease) forwards; }
.scn-stage { position: absolute; inset: 0; overflow: hidden; }
.scn-video { width: 100%; height: 100%; object-fit: cover; display: block; background: #000; }
.scanner.no-camera .scn-video { visibility: hidden; }
.scn-shade { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; }
.scn-frame { position: relative; width: min(78vw, 360px); height: min(48vw, 220px); border-radius: 20px; box-shadow: 0 0 0 100vmax rgba(0, 0, 0, .52); transition: box-shadow .3s; }
.scn-corner { position: absolute; width: 34px; height: 34px; border: 4px solid #fff; transition: border-color .2s; }
.scn-corner.tl { top: -2px; left: -2px; border-right: 0; border-bottom: 0; border-radius: 20px 0 0 0; }
.scn-corner.tr { top: -2px; right: -2px; border-left: 0; border-bottom: 0; border-radius: 0 20px 0 0; }
.scn-corner.bl { bottom: -2px; left: -2px; border-right: 0; border-top: 0; border-radius: 0 0 0 20px; }
.scn-corner.br { bottom: -2px; right: -2px; border-left: 0; border-top: 0; border-radius: 0 0 20px 0; }
.scn-laser { position: absolute; left: 8%; right: 8%; top: 50%; height: 2px; border-radius: 2px; background: linear-gradient(90deg, transparent, var(--accent-2), var(--accent-1), transparent); box-shadow: 0 0 16px #22d3ee; animation: laser 2.2s ease-in-out infinite; }
@keyframes laser { 0%, 100% { transform: translateY(-80px); opacity: .6; } 50% { transform: translateY(80px); opacity: 1; } }
.scanner.no-camera .scn-laser { display: none; }
.scanner.v-ok .scn-corner { border-color: #34d399; }
.scanner.v-warn .scn-corner { border-color: #fbbf24; }
.scanner.v-err .scn-corner { border-color: #fb7185; }
.scanner.v-ok .scn-frame { box-shadow: 0 0 0 100vmax rgba(5, 60, 40, .55), 0 0 60px 6px rgba(52, 211, 153, .6); }
.scanner.v-err .scn-frame { box-shadow: 0 0 0 100vmax rgba(70, 5, 20, .55), 0 0 60px 6px rgba(251, 113, 133, .6); }
.scanner.v-warn .scn-frame { box-shadow: 0 0 0 100vmax rgba(70, 50, 5, .55), 0 0 60px 6px rgba(251, 191, 36, .6); }

.scn-top { position: relative; z-index: 2; display: flex; align-items: center; gap: 10px; padding: calc(10px + env(safe-area-inset-top)) 12px 10px; background: linear-gradient(rgba(0, 0, 0, .6), transparent); }
.scn-title { flex: 1; text-align: center; font-weight: 700; font-size: 16px; }
.scn-icon { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 15px; color: #fff; background: rgba(255, 255, 255, .12); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.scn-icon svg { width: 22px; height: 22px; }
.scn-icon.is-on { background: #fbbf24; color: #000; }
.scn-bottom { position: relative; z-index: 2; margin-top: auto; display: flex; flex-direction: column; gap: 10px; padding: 16px 14px calc(16px + env(safe-area-inset-bottom)); background: linear-gradient(transparent, rgba(0, 0, 0, .75) 30%); }
.scn-status { text-align: center; font-size: 13.5px; color: rgba(255, 255, 255, .85); }
.scn-status.warn { color: #fbbf24; }
.scn-last { display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; padding: 9px 12px; border-radius: 14px; background: rgba(255, 255, 255, .1); font-size: 13.5px; animation: popIn .35s var(--spring) both; }
.scn-last b { font-size: 15px; letter-spacing: .03em; }
.scn-dot { width: 10px; height: 10px; border-radius: 50%; }
.scn-dot.ok { background: #34d399; box-shadow: 0 0 12px #34d399; }
.scn-dot.warn { background: #fbbf24; box-shadow: 0 0 12px #fbbf24; }
.scn-dot.err { background: #fb7185; box-shadow: 0 0 12px #fb7185; }
.scn-manual { display: flex; gap: 8px; }
.scn-input { flex: 1; height: 50px !important; font-family: var(--mono); font-size: 16px !important; letter-spacing: .04em; text-transform: uppercase; background: rgba(255, 255, 255, .1) !important; border-color: rgba(255, 255, 255, .25) !important; color: #fff !important; }
.scn-input::placeholder { color: rgba(255, 255, 255, .55); text-transform: none; letter-spacing: 0; }
.scn-manual .btn { height: 50px; width: 56px; border-radius: 14px; }

/* ---------- proof of delivery (photo, signature, delivery code) ---------- */

.drv-pod { display: flex; flex-direction: column; gap: 14px; padding: 14px; border-radius: 18px; background: var(--surface); border: 1px solid var(--border); }
.drv-opt { margin-inline-start: 6px; font-size: 11px; font-weight: 500; color: var(--text-3); }
.drv-photo { display: flex; align-items: center; gap: 12px; min-height: 56px; }
.drv-photo-take {
  display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 64px; padding: 12px;
  border: 1.5px dashed var(--border-strong); border-radius: 16px; background: var(--surface-2); color: var(--text);
  font: inherit; font-size: 15px; font-weight: 600; cursor: pointer; transition: border-color .2s, background .2s;
}
.drv-photo-take svg { width: 22px; height: 22px; color: var(--accent-2); }
.drv-photo-take:active { background: var(--surface-3, var(--surface-2)); border-color: var(--accent-2); }
.drv-photo-thumb { width: 96px; height: 96px; flex: none; object-fit: cover; border-radius: 14px; border: 1px solid var(--border-strong); background: var(--surface-2); }
.drv-photo-acts { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }

.drv-sig-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.drv-sig { position: relative; border-radius: 16px; border: 1px solid var(--border-strong); background: var(--surface-2); overflow: hidden; }
.drv-sig-canvas { display: block; width: 100%; aspect-ratio: 5 / 2; touch-action: none; cursor: crosshair; color: var(--text); position: relative; z-index: 1; }
.drv-sig-line {
  position: absolute; inset-inline: 16px; inset-block-end: 22px; padding-block-start: 4px; border-block-start: 1px dashed var(--border-strong);
  font-size: 11px; color: var(--text-3); pointer-events: none;
}

.drv-otp-field .field-label svg { width: 14px; height: 14px; }
.drv-otp { font-family: var(--mono); font-size: 28px; font-weight: 600; letter-spacing: .5em; text-align: center; height: 60px; padding-inline-start: .5em; direction: ltr; }
.drv-otp-field.has-error .drv-otp { border-color: var(--rose); }
.drv-otp-field.has-error .field-hint { color: var(--rose); font-weight: 600; }

.drv-pod-missing { margin: 0; font-size: 13px; font-weight: 600; color: var(--amber); }
.drv-pod-missing:empty { display: none; }

/* ---------- WhatsApp quick messages (parcel sheet) ---------- */

.drv-wa-quick { display: flex; flex-direction: column; gap: 8px; }
.drv-wa-quick .drv-label { display: flex; align-items: center; gap: 6px; margin: 0; }
.drv-wa-quick .drv-label svg { width: 15px; height: 15px; color: #25d366; }
.drv-wa-row { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); font-size: 14px; }
.drv-wa-lang {
  display: inline-grid; place-items: center; min-width: 52px; height: 36px; padding-inline: 10px; border-radius: 12px;
  background: color-mix(in srgb, #25d366 14%, transparent); border: 1px solid color-mix(in srgb, #25d366 30%, transparent);
  color: var(--text); font-size: 13px; font-weight: 600; text-decoration: none;
}
.drv-wa-lang:active { transform: scale(.97); }

@media (max-width: 380px) {
  .drv-photo-thumb { width: 80px; height: 80px; }
  .drv-otp { font-size: 24px; letter-spacing: .4em; }
}

/* ---------- v2.3: cash ceiling, attempt checks, my work ---------- */

.drv-alert { display: flex; align-items: center; gap: 10px; width: 100%; margin-bottom: 12px; padding: 11px 13px; border-radius: 16px; text-align: start; font: inherit; color: var(--text); border: 1px solid var(--border); background: var(--surface); cursor: pointer; }
.drv-cash .drv-alert { margin-bottom: 0; }
.drv-alert > svg { width: 18px; height: 18px; flex: none; }
.drv-alert .grow { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.drv-alert b { font-size: 13.5px; }
.drv-alert span { font-size: 12.5px; color: var(--text-2); }
.drv-alert.warn { background: color-mix(in srgb, var(--amber) 9%, var(--surface)); border-color: color-mix(in srgb, var(--amber) 30%, transparent); }
.drv-alert.warn > svg:first-child { color: var(--amber); }
.drv-alert.bad { background: color-mix(in srgb, var(--rose) 10%, var(--surface)); border-color: color-mix(in srgb, var(--rose) 32%, transparent); }
.drv-alert.bad > svg:first-child, .drv-alert.bad b { color: var(--rose); }
.drv-hint.warn { background: color-mix(in srgb, var(--amber) 11%, transparent); color: var(--text); }
.drv-hint svg { width: 14px; height: 14px; vertical-align: -2px; }
.drv-meter { width: min(100%, 280px); display: flex; flex-direction: column; align-items: center; gap: 5px; margin-top: 8px; }
.drv-meter-track { width: 100%; height: 7px; border-radius: 99px; background: var(--surface-3, var(--surface-2)); overflow: hidden; }
.drv-meter-track i { display: block; height: 100%; border-radius: inherit; background: var(--green); transition: width .5s var(--ease-out); }
.drv-meter.warn .drv-meter-track i { background: var(--amber); }
.drv-meter.bad .drv-meter-track i { background: var(--rose); }
.drv-earn { gap: 10px; }
.drv-earn h3 { margin-bottom: 0; }
.drv-earn-tabs { margin: 0; padding: 0; }
.drv-earn-tabs .drv-filter { height: 34px; font-size: 13px; }
.drv-earn-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.drv-earn-stats > div { background: var(--surface-2); }
.drv-earn-stats .is-earn { grid-column: 1 / -1; background: linear-gradient(160deg, rgba(var(--a1-rgb), .14), var(--surface-2) 70%); }
.drv-earn-stats .is-earn b { font-size: 19px; }
.drv-empty.sm { padding: 24px; }
.drv-days { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; }
.drv-day { display: grid; grid-template-columns: 96px minmax(0, 1fr) 32px; align-items: center; gap: 8px; font-size: 12px; color: var(--text-3); }
.drv-day b { text-align: end; color: var(--text); font-size: 12.5px; }
.drv-day-bar { display: flex; height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.drv-day-bar i { display: block; height: 100%; }
.drv-day-bar i.ok { background: var(--green); }
.drv-day-bar i.ko { background: color-mix(in srgb, var(--rose) 70%, transparent); }
