/* Vandok driver PWA — portrait-only, taps-only, base 17px, floor 15px, targets ≥56px. */

.vd-app {
  height: 100vh; height: 100dvh;      /* fixed height so the header stays put and the body scrolls */
  max-width: 440px; margin: 0 auto;
  /* fixed gradient-mesh atmosphere — the body scrolls over it, so every glass card refracts colour */
  background:
    radial-gradient(135% 95% at 92% -10%, var(--vd-glow-a), transparent 72%),
    radial-gradient(135% 100% at -20% 112%, var(--vd-glow-b), transparent 72%),
    radial-gradient(120% 90% at 45% 48%, var(--vd-glow-c), transparent 82%),
    var(--vd-field);
  display: flex; flex-direction: column; position: relative;
  overflow: hidden;
}

/* glass cards live in the shared vandok.css now (applied on every surface). Here we only add
   the header + action-bar blur bump + highlight, cohesive with the cards. */
.vd-app .vd-glass-header, .vd-app .vd-glass-foot {
  -webkit-backdrop-filter: blur(22px) saturate(1.3); backdrop-filter: blur(22px) saturate(1.3);
}
.vd-app .vd-glass-foot { box-shadow: inset 0 1px 0 var(--vd-glass-hi); }

.vd-screen { display: flex; flex-direction: column; flex: 1; min-height: 0; position: relative; z-index: 1; }

/* status strip + identity thread */
.vd-statusbar {
  height: 32px; flex: none; display: flex; align-items: center; justify-content: space-between;
  padding: 0 18px; font-size: 13px; color: var(--vd-ink-soft); font-variant-numeric: tabular-nums;
}

/* floating glass header — top padding includes the status-bar inset so the header never sits under
   the system status bar under Android edge-to-edge (Cap 8 / Android 15+) or an iOS notch. */
.vd-header { flex: none; position: relative; padding: calc(12px + env(safe-area-inset-top, 0px)) 18px 14px; z-index: 3; }
.vd-header .vd-header-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }

/* scroll body */
.vd-body {
  flex: 1; min-height: 0; position: relative; z-index: 1; overflow-y: auto;
  padding: 14px 18px 18px; display: flex; flex-direction: column; gap: 14px;
  -webkit-overflow-scrolling: touch;
}

/* sticky action bar (glass) — clears the phone's bottom nav / home indicator */
.vd-actionbar {
  flex: none; position: relative; z-index: 3;
  padding: 12px 18px calc(16px + env(safe-area-inset-bottom, 0px));
  display: flex; flex-direction: column; gap: 10px;
}
.vd-action-row { display: flex; gap: 10px; align-items: stretch; }
.vd-action-row > * { flex: 1; }
/* bottom-nav buttons: allow the label to wrap inside the box instead of overflowing it */
.vd-btn--nav {
  height: auto; min-height: 56px; padding: 6px 6px;
  font-size: 14px; line-height: 1.12; white-space: normal; text-align: center;
}

/* route-level actions, now in the body (2-col grid; the last button spans full width) */
.vd-route-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.vd-route-actions > button { width: 100%; }
.vd-route-actions > button:last-child { grid-column: 1 / -1; }

/* ---- persistent bottom nav bar (hub screens only) ---- */
.vd-navbar {
  flex: none; position: relative; z-index: 4;
  display: flex; align-items: stretch;
  background: var(--vd-surface);
  border-top: 1px solid var(--vd-hairline);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.vd-nav-item {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; padding: 9px 4px 8px; min-height: 58px;
  background: none; border: none; cursor: pointer; font: inherit;
  color: var(--vd-ink-soft); -webkit-tap-highlight-color: transparent;
  transition: color var(--vd-dur-press);
}
.vd-nav-item:active { transform: scale(.96); }
.vd-nav-item.active { color: var(--vd-identity); }
.vd-nav-ico { position: relative; display: flex; }
.vd-nav-ico svg { width: 24px; height: 24px; }
.vd-nav-label { font-size: 12px; font-weight: 600; letter-spacing: .01em; }
.vd-nav-item.active .vd-nav-label { font-weight: 700; }
.vd-nav-badge {
  position: absolute; top: -6px; right: -10px; min-width: 18px; height: 18px;
  padding: 0 5px; border-radius: 9px; background: var(--vd-attention); color: #101826;
  font-size: 11px; font-weight: 700; line-height: 18px; text-align: center;
}
.vd-nav-chevron { color: var(--vd-ink-soft); font-size: 22px; line-height: 1; }

/* tappable "how to inventory" rows — each launches its method */
.vd-method-row {
  display: flex; align-items: flex-start; gap: 12px; width: 100%;
  padding: 12px 10px; background: transparent; border: none; border-radius: 12px;
  cursor: pointer; font: inherit; color: var(--vd-ink); text-align: left;
  transition: background var(--vd-dur-press), transform var(--vd-dur-press);
  -webkit-tap-highlight-color: transparent;
}
.vd-method-row + .vd-method-row { margin-top: 2px; }
.vd-method-row:active { background: var(--vd-glass-card-2); transform: scale(.99); }
.vd-method-row .vd-nav-chevron { align-self: center; }
.vd-method-num {
  flex: 0 0 auto; width: 26px; height: 26px; border-radius: 50%; margin-top: 1px;
  display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 700;
  background: transparent; color: var(--vd-ink-soft); border: 1.5px solid var(--vd-edge);
}
.vd-method-num.primary { background: var(--vd-action); color: var(--vd-action-ink); border: none; }

/* igienizare status chip */
.vd-san-chip { display: inline-flex; align-items: center; font-size: 13px; font-weight: 600; padding: 5px 10px; border-radius: var(--vd-radius, 12px); line-height: 1.2; }
.vd-san-ok   { color: var(--vd-ok); background: rgba(47,181,116,.16); }
.vd-san-warn { color: var(--vd-attention); background: rgba(180,116,27,.18); }
.vd-san-fail { color: var(--vd-fail); background: rgba(229,72,77,.18); }

/* rows */
.vd-row { display: flex; align-items: center; gap: 12px; }
.vd-row + .vd-row { margin-top: 10px; }
.vd-between { display: flex; justify-content: space-between; align-items: baseline; }

/* stop list rows */
.vd-stop { display: flex; flex-direction: column; gap: 2px; padding: 12px 0; cursor: pointer; }
.vd-stop-seq { font-variant-numeric: tabular-nums; font-weight: 700; }
.vd-divider { border-top: 1px solid var(--vd-hairline); }

/* Each stop is its own card. Clear press feedback so the driver knows they tapped THAT company. */
.vd-stop-card { cursor: pointer; transition: transform var(--vd-dur-press), background var(--vd-dur-press), box-shadow var(--vd-dur-press); }
.vd-app .vd-stop-card:active { transform: scale(.985); background: var(--vd-glass-card-2); box-shadow: 0 0 0 2px var(--vd-glass-edge) inset; }
.vd-stop-tag {
  flex: none; font-size: 13px; font-weight: 700; letter-spacing: .04em; padding: 4px 10px;
  border-radius: var(--vd-radius); border: 1px solid var(--vd-edge); color: var(--vd-ink-soft);
}
.vd-stop-tag[data-st="ok"]   { border-color: var(--vd-ok); color: var(--vd-ok); }
.vd-stop-tag[data-st="fail"] { border-color: var(--vd-fail); color: var(--vd-fail); }
.vd-stop-tag[data-st="todo"] { border-color: var(--vd-edge); color: var(--vd-ink); }

/* login */
.vd-login { max-width: 440px; margin: 0 auto; padding: 48px 24px; display: flex; flex-direction: column; gap: 18px; min-height: 100dvh; justify-content: center; }
.vd-pin-dots { display: flex; gap: 12px; justify-content: center; }
.vd-pin-dot { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--vd-edge); }
.vd-pin-dot.on { background: var(--vd-ink); border-color: var(--vd-ink); }

/* toggle — needs a clearly visible track in both states (off must not vanish on dark) */
.vd-toggle { width: 56px; height: 32px; border-radius: 16px; background: transparent; border: 2px solid var(--vd-edge); position: relative; cursor: pointer; flex: none; transition: background var(--vd-dur-press), border-color var(--vd-dur-press); }
.vd-toggle.on { background: var(--vd-action); border-color: var(--vd-action); }
.vd-toggle::after { content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: var(--vd-ink-soft); transition: transform var(--vd-dur-press), background var(--vd-dur-press); }
.vd-toggle.on::after { transform: translateX(24px); background: var(--vd-action-ink); }

/* settings rows — label (+desc) on the left, a control (toggle / value / chevron) on the right,
   stacked on the glass card with hairline dividers. Replaces flat stacked ghost buttons. */
.vd-set-row { display: flex; align-items: center; gap: 14px; padding: 15px 0; border-top: 1px solid var(--vd-glass-edge); }
.vd-set-row:first-child { border-top: none; }
.vd-set-main { flex: 1; min-width: 0; }
.vd-set-label { font-size: 16px; font-weight: 600; color: var(--vd-ink); }
.vd-set-desc { font-size: 14px; color: var(--vd-ink-soft); margin-top: 3px; line-height: 1.45; }
.vd-set-val { flex: none; font-size: 15px; font-weight: 600; color: var(--vd-ink-soft); font-variant-numeric: tabular-nums; }
.vd-set-chev { flex: none; font-size: 22px; line-height: 1; color: var(--vd-ink-soft); margin-left: 2px; }
.vd-set-row--nav { cursor: pointer; margin: 0 -8px; padding-left: 8px; padding-right: 8px; border-radius: 10px; transition: background var(--vd-dur-press); }
.vd-set-row--nav:active { background: var(--vd-glass-card-2); }
.vd-set-row--danger .vd-set-label { color: #C0342B; }

/* stat tiles (next-stop card) */
.vd-tiles { display: flex; gap: 10px; margin-top: 12px; }
.vd-tile { flex: 1; }
.vd-tile .n { font-size: 28px; font-weight: 500; font-variant-numeric: tabular-nums; letter-spacing: -.03em; }
.vd-tile .l { font-size: 15px; color: var(--vd-invert-soft); }

/* progress bar (day) */
.vd-progress { height: 8px; border-radius: 4px; background: var(--vd-hairline); overflow: hidden; }
.vd-progress > i { display: block; height: 100%; background: var(--vd-action); transition: width var(--vd-dur-bar) var(--vd-ease); }

/* checkbox row (loadout serials) */
.vd-check { width: 28px; height: 28px; border-radius: 4px; border: 2px solid var(--vd-edge); flex: none; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.vd-check.on { background: var(--vd-action); border-color: var(--vd-action); color: var(--vd-action-ink); }

/* radio (fail reasons) */
.vd-radio-row { display: flex; align-items: center; gap: 12px; padding: 14px 0; cursor: pointer; min-height: 56px; }
.vd-radio { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--vd-edge); flex: none; }
.vd-radio.on { border-color: var(--vd-action); box-shadow: inset 0 0 0 5px var(--vd-action); }

/* signature pad */
.vd-sig { border: 2px dashed var(--vd-edge); border-radius: var(--vd-radius-card); height: 168px; position: relative; touch-action: none; background: var(--vd-surface); }
.vd-sig canvas { width: 100%; height: 100%; display: block; }
.vd-sig .ph { position: absolute; left: 12px; bottom: 10px; color: var(--vd-ink-soft); font-size: 15px; pointer-events: none; }
.vd-sig .clr { position: absolute; right: 12px; bottom: 10px; color: var(--vd-ink-soft); text-decoration: underline; text-underline-offset: 4px; font-size: 15px; background: none; border: none; cursor: pointer; }

/* two-option condition selector */
.vd-choice { display: flex; gap: 0; border: 1px solid var(--vd-edge); border-radius: var(--vd-radius); overflow: hidden; }
.vd-choice button { flex: 1; min-height: 56px; border: none; background: transparent; color: var(--vd-ink); font-size: 17px; font-weight: 600; cursor: pointer; }
.vd-choice button[aria-pressed="true"] { background: var(--vd-invert-bg); color: var(--vd-invert-ink); }
.vd-choice button.danger[aria-pressed="true"] { background: var(--vd-fail); color: #fff; }

/* full-screen migration notice (D13) */
.vd-migrate { min-height: 100dvh; background: #0D3B66; color: #fff; padding: 40px 24px; display: flex; flex-direction: column; gap: 20px; }
.vd-migrate .card { background: #fff; color: var(--vd-ink); border-radius: 4px; padding: 16px; }

/* pull-to-refresh — the app icon in a navy disc, dropping in and spinning while it refreshes */
.vd-ptr {
  position: fixed; top: 6px; left: 50%; margin-left: -24px; width: 48px; height: 48px;
  border-radius: 50%; overflow: hidden; background: #0D3B66; box-shadow: 0 4px 16px rgba(0,0,0,.28);
  transform: translateY(-70px); opacity: 0; z-index: 300;
  transition: transform .16s ease, opacity .16s ease;
}
.vd-ptr img { width: 100%; height: 100%; display: block; }
.vd-ptr.show { opacity: 1; }
.vd-ptr.spin { transform: translateY(16px); }
.vd-ptr.spin img { animation: vd-spin .8s linear infinite; }
@keyframes vd-spin { to { transform: rotate(360deg); } }

/* Order-change notification banner — attention colour, top of screen, one word + shape + colour */
.vd-notif-bar {
  position: fixed; left: 0; right: 0; top: 0; z-index: 210;
  display: flex; align-items: center; gap: 12px;
  padding: calc(12px + env(safe-area-inset-top, 0px)) 16px 12px;
  background: var(--vd-attention); color: #101826;
  box-shadow: 0 4px 20px rgba(0,0,0,.25);
}
.vd-notif-bar button {
  flex: none; height: 44px; padding: 0 16px; border: none; border-radius: var(--vd-radius);
  background: #101826; color: #fff; font-weight: 700; font-size: 15px; cursor: pointer;
}

/* "Actualizare disponibilă" banner — fixed, above everything, unmissable but dismissible by acting */
.vd-update-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 200;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 18px calc(14px + env(safe-area-inset-bottom, 0px));
  background: var(--vd-invert-bg); color: var(--vd-invert-ink);
  font-size: 16px; font-weight: 600; box-shadow: 0 -4px 20px rgba(0,0,0,.25);
}
.vd-update-bar button {
  flex: none; height: 44px; padding: 0 18px; border: none; border-radius: var(--vd-radius);
  background: var(--vd-action); color: var(--vd-action-ink); font-weight: 700; font-size: 16px; cursor: pointer;
}

/* press-and-hold for irreversible actions (day close): 800ms */
.vd-hold { position: relative; overflow: hidden; }
.vd-hold > .fill { position: absolute; inset: 0; background: rgba(255,255,255,.22); width: 0; }
.vd-hold.holding > .fill { width: 100%; transition: width 800ms linear; }
