/* IceBlue Driver v61 — Material Design 3 (Material You) */
/* Palette: Blue primary · Green success · White surface */

:root {
  --md-primary: #1565C0;
  --md-primary-container: #D6E3FF;
  --md-on-primary: #FFFFFF;
  --md-on-primary-container: #0D47A1;
  --md-success: #2E7D32;
  --md-success-container: #E8F5E9;
  --md-on-success: #FFFFFF;
  --md-surface: #FFFFFF;
  --md-surface-dim: #F5F7FA;
  --md-surface-container: #EEF2F7;
  --md-on-surface: #1A1C1E;
  --md-on-surface-variant: #5C6370;
  --md-outline: #C5CCD6;
  --md-outline-variant: #E2E8F0;
  --md-error: #C62828;
  --md-error-container: #FFEBEE;
  --md-shadow: 0 1px 2px rgba(21, 101, 192, 0.06), 0 4px 16px rgba(21, 101, 192, 0.08);
  --md-shadow-lg: 0 8px 28px rgba(21, 101, 192, 0.14);
  --md-radius-sm: 12px;
  --md-radius: 16px;
  --md-radius-lg: 24px;
  --md-radius-full: 999px;
  --md-btn-h: 48px;
  --md-space: 16px;
  --md-space-sm: 8px;
  --md-space-lg: 24px;
  --safe-b: env(safe-area-inset-bottom, 0px);

  /* legacy aliases used in app.js-driven markup */
  --navy: var(--md-primary);
  --navy2: #0D47A1;
  --sky: var(--md-primary-container);
  --bg: var(--md-surface-dim);
  --card: var(--md-surface);
  --text: var(--md-on-surface);
  --muted: var(--md-on-surface-variant);
  --green: var(--md-success);
  --blue: var(--md-primary);
  --orange: #E65100;
  --red: var(--md-error);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: "Inter", "Roboto", system-ui, -apple-system, sans-serif;
  background: var(--md-surface-dim);
  color: var(--md-on-surface);
  font-size: 15px;
  line-height: 1.45;
  font-weight: 500;
  -webkit-font-smoothing: antialiased;
}

#app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100dvh;
  background: var(--md-surface-dim);
  position: relative;
  padding-bottom: calc(80px + var(--safe-b));
}

/* ——— Header ——— */
.top-header {
  background: var(--md-primary);
  border-radius: 0 0 var(--md-radius-lg) var(--md-radius-lg);
  padding: 12px 16px 14px;
  padding-top: calc(10px + env(safe-area-inset-top, 0px));
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--md-on-primary);
  box-shadow: var(--md-shadow);
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-logo {
  width: 40px; height: 40px; border-radius: 12px;
  object-fit: cover; flex-shrink: 0;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.brand-text { min-width: 0; }
.brand-main {
  font-size: 18px; font-weight: 700; letter-spacing: -0.01em;
  color: #fff; line-height: 1.15;
}
.brand-sub {
  font-size: 12px; font-weight: 500; color: rgba(255,255,255,0.82); margin-top: 2px;
}
.header-right { display: flex; align-items: center; gap: 8px; }
.ver-badge {
  font-size: 11px; font-weight: 600; color: rgba(255,255,255,0.85);
  background: rgba(255,255,255,0.14); padding: 5px 10px; border-radius: var(--md-radius-full);
}
.live-pill {
  font-size: 11px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase;
  padding: 6px 12px; border-radius: var(--md-radius-full);
  background: rgba(255,255,255,0.16); color: #fff; white-space: nowrap;
  border: 1px solid rgba(255,255,255,0.2);
}
.live-pill.live {
  background: var(--md-success); color: #fff; border-color: transparent;
  animation: live-pulse 1.8s ease-in-out infinite;
}
.live-pill.done { background: rgba(255,255,255,0.22); color: #fff; }
.live-pill.off { opacity: 0.9; }
@keyframes live-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(46, 125, 50, 0.4); }
  50% { box-shadow: 0 0 0 6px rgba(46, 125, 50, 0); }
}

/* ——— Layout ——— */
.main { padding: 12px 16px 28px; }
.screen[hidden] { display: none !important; }
.section-label {
  font-size: 12px; font-weight: 700; color: var(--md-on-surface-variant);
  text-transform: uppercase; letter-spacing: 0.06em;
  margin: 4px 0 10px;
}

/* ——— Summary cards (equal size) ——— */
.stats-row, .dash-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}
.dash-grid.three { grid-template-columns: 1fr 1fr 1fr; }
.stat-card {
  background: var(--md-surface);
  border-radius: var(--md-radius);
  padding: 16px 14px;
  text-align: left;
  box-shadow: var(--md-shadow);
  border: 1px solid var(--md-outline-variant);
  min-height: 96px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.stat-card.cash { border-color: transparent; background: var(--md-success-container); }
.stat-card.credit-stat { border-color: transparent; background: var(--md-error-container); }
.stat-card .lbl {
  font-size: 12px; color: var(--md-on-surface-variant);
  margin-bottom: 8px; font-weight: 600; letter-spacing: 0.01em;
}
.stat-card .val {
  font-size: 32px; font-weight: 700; line-height: 1.05;
  color: var(--md-primary); letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.stat-card .val.g { color: var(--md-success); }
.stat-card .val.r,
.credit-stat .val { color: var(--md-error) !important; }
.stat-card .val.sm { font-size: 18px; font-weight: 700; padding-top: 4px; line-height: 1.25; }

/* ——— Buttons (MD3 filled / tonal / outlined) ——— */
.mega-btn, .md-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: var(--md-btn-h);
  height: auto;
  border: none;
  border-radius: var(--md-radius-full);
  padding: 12px 20px;
  margin-bottom: 10px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  letter-spacing: 0.01em;
  font-family: inherit;
  transition: transform 0.12s ease, box-shadow 0.12s ease, opacity 0.12s ease;
}
.mega-btn.primary, .md-btn.primary {
  background: var(--md-primary); color: var(--md-on-primary);
  box-shadow: 0 2px 8px rgba(21, 101, 192, 0.28);
}
.mega-btn.deliver, .md-btn.success {
  background: var(--md-success); color: var(--md-on-success);
  box-shadow: 0 2px 8px rgba(46, 125, 50, 0.25);
  font-size: 16px;
}
.mega-btn.soft, .md-btn.tonal {
  background: var(--md-primary-container);
  color: var(--md-on-primary-container);
  border: none;
}
.mega-btn.danger, .md-btn.danger {
  background: var(--md-error-container);
  color: var(--md-error);
  border: 1px solid transparent;
}
.mega-btn:active, .md-btn:active { transform: scale(0.98); }
.mega-btn:disabled, .md-btn:disabled { opacity: 0.45; pointer-events: none; }

.action-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 4px 0 12px;
}
.action-grid .mega-btn { margin-bottom: 0; min-height: 48px; font-size: 14px; }

/* ——— Day flow card ——— */
.day-flow, .day-card {
  background: var(--md-surface);
  border: 1px solid var(--md-outline-variant);
  border-radius: var(--md-radius);
  padding: 16px;
  margin: 0 0 16px;
  box-shadow: var(--md-shadow);
}
.day-flow-title, .day-card-title {
  font-size: 12px; font-weight: 700; color: var(--md-on-surface-variant);
  text-transform: uppercase; letter-spacing: .05em; margin-bottom: 12px;
}
.day-flow-steps {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 12px;
}
.day-step {
  font-size: 12px; font-weight: 600; color: var(--md-on-surface-variant);
  background: var(--md-surface-container); padding: 6px 12px; border-radius: var(--md-radius-full);
}
.day-step.on { background: var(--md-primary); color: #fff; }
.day-step.done { background: var(--md-success-container); color: var(--md-success); }
.day-step-arrow { color: var(--md-outline); font-weight: 600; font-size: 12px; }
.day-flow-hint {
  margin: 0 0 14px; font-size: 13px; font-weight: 500;
  color: var(--md-on-surface); line-height: 1.4;
}
.live-home-hint {
  margin: 0 0 12px; padding: 12px 14px; border-radius: var(--md-radius);
  background: var(--md-success-container); color: var(--md-success);
  font-size: 13px; font-weight: 600; border: none;
}

/* ——— New orders alert ——— */
.new-orders-card {
  display: flex; align-items: center; gap: 14px; width: 100%;
  margin: 0 0 16px; padding: 16px; border: none; border-radius: var(--md-radius);
  background: var(--md-primary); color: #fff; text-align: left; cursor: pointer;
  box-shadow: var(--md-shadow-lg);
}
.new-orders-card[hidden] { display: none !important; }
.new-orders-num {
  font-size: 36px; font-weight: 700; line-height: 1; min-width: 44px; text-align: center;
}
.new-orders-text { display: flex; flex-direction: column; gap: 2px; }
.new-orders-text strong { font-size: 16px; font-weight: 700; }
.new-orders-text span { font-size: 13px; font-weight: 500; opacity: 0.9; }

/* ——— Banner ——— */
.banner {
  margin: 12px 16px 0; padding: 12px 14px; border-radius: var(--md-radius);
  font-weight: 600; font-size: 14px;
  background: var(--md-primary-container); color: var(--md-on-primary-container);
  position: sticky; top: 0; z-index: 40;
  box-shadow: var(--md-shadow);
}
.banner.ok { background: var(--md-success-container); color: var(--md-success); }
.banner.err { background: var(--md-error-container); color: var(--md-error); }

.del-error {
  margin: 12px 0 8px; padding: 14px 16px; border-radius: var(--md-radius);
  background: var(--md-error-container); color: var(--md-error);
  font-weight: 600; font-size: 14px; line-height: 1.4;
}
.field-warn {
  outline: 2px solid var(--md-error) !important;
  outline-offset: 2px;
  border-radius: var(--md-radius-sm);
}

/* ——— Bottom navigation (MD3) ——— */
.bottom-nav {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: 0; width: 100%; max-width: 480px;
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: var(--md-surface);
  border-top: 1px solid var(--md-outline-variant);
  padding: 8px 4px calc(10px + var(--safe-b));
  z-index: 50;
  box-shadow: 0 -4px 20px rgba(26, 28, 30, 0.06);
}
.nav-item {
  position: relative;
  border: none; background: transparent; padding: 6px 2px;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 600; color: var(--md-on-surface-variant); cursor: pointer;
  font-family: inherit;
}
.nav-item.active { color: var(--md-primary); }
.nav-item.active .nav-icon-wrap {
  background: var(--md-primary-container);
}
.nav-icon-wrap {
  width: 56px; height: 32px; border-radius: var(--md-radius-full);
  display: grid; place-items: center;
  transition: background 0.15s ease;
}
.nav-svg {
  width: 22px; height: 22px; fill: currentColor; opacity: 0.95;
}
.nav-badge {
  position: absolute; top: 0; right: 8px; min-width: 18px; height: 18px;
  padding: 0 5px; border-radius: var(--md-radius-full);
  background: var(--md-error); color: #fff;
  font-size: 11px; font-weight: 700; line-height: 18px; text-align: center;
  box-shadow: 0 0 0 2px var(--md-surface);
}

/* ——— Forms & inputs ——— */
.big-label {
  display: block; font-size: 12px; font-weight: 600;
  color: var(--md-on-surface-variant); margin: 14px 0 6px;
}
.big-input, .form-panel input, .form-panel select, .form-panel textarea {
  width: 100%; min-height: 52px; padding: 14px 16px;
  border: 1px solid var(--md-outline); border-radius: var(--md-radius-sm);
  font-size: 16px; font-weight: 500; background: var(--md-surface); color: var(--md-on-surface);
  font-family: inherit;
}
.big-input:focus, .form-panel input:focus, .form-panel select:focus {
  outline: 2px solid var(--md-primary); outline-offset: 0; border-color: var(--md-primary);
}
.search-bar { margin-bottom: 14px; }

/* ——— Pick / customer cards ——— */
.pick-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; max-height: 40vh; overflow-y: auto; }
.pick-card, .cust-card {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  width: 100%; text-align: left;
  border: 1px solid var(--md-outline-variant); background: var(--md-surface);
  border-radius: var(--md-radius); padding: 14px 16px; cursor: pointer; font: inherit;
  box-shadow: var(--md-shadow);
}
.pick-card strong, .cust-card strong {
  display: block; font-size: 16px; font-weight: 700; color: var(--md-on-surface);
}
.pick-card span, .order-date {
  display: block; font-size: 12px; color: var(--md-on-surface-variant);
  margin-top: 4px; font-weight: 500;
}
.due { font-size: 15px; font-weight: 700; color: var(--md-success); }
.due.red { color: var(--md-error); }

.picked-box {
  background: var(--md-success-container); border: none;
  border-radius: var(--md-radius); padding: 16px; margin-bottom: 14px;
}
.picked-name { font-size: 18px; font-weight: 700; color: var(--md-on-surface); }
.picked-meta { font-size: 13px; color: var(--md-on-surface-variant); margin-top: 4px; font-weight: 500; }
.linkish {
  border: none; background: none; color: var(--md-primary);
  font-weight: 600; padding: 8px 0 0; cursor: pointer; font-family: inherit; font-size: 14px;
}

.step-title {
  font-size: 13px; font-weight: 700; margin: 20px 0 10px;
  color: var(--md-primary); letter-spacing: 0.02em;
}
.stepper {
  display: grid; grid-template-columns: 64px 1fr 64px; gap: 10px; align-items: center;
  margin-bottom: 8px;
}
.step-btn {
  height: 56px; border: none; border-radius: var(--md-radius);
  background: var(--md-primary); color: #fff;
  font-size: 26px; font-weight: 600; cursor: pointer;
}
.step-val {
  text-align: center; font-size: 36px; font-weight: 700; color: var(--md-primary);
  background: var(--md-surface); border: 1px solid var(--md-outline-variant);
  border-radius: var(--md-radius); padding: 10px;
  font-variant-numeric: tabular-nums;
}

.pay-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 8px;
}
.pay-btn {
  border: 1px solid var(--md-outline); background: var(--md-surface);
  border-radius: var(--md-radius-full); min-height: 48px;
  padding: 12px 8px; font-size: 14px; font-weight: 600; cursor: pointer;
  color: var(--md-on-surface); font-family: inherit;
}
.pay-btn.active {
  background: var(--md-primary); border-color: var(--md-primary); color: #fff;
}

.sub-head {
  display: flex; align-items: center; gap: 12px; margin-bottom: 16px;
}
.sub-head h2 { margin: 0; font-size: 20px; font-weight: 700; flex: 1; color: var(--md-on-surface); }
.back {
  width: 40px; height: 40px; border-radius: var(--md-radius-full); border: none;
  background: var(--md-surface-container); color: var(--md-primary);
  font-size: 18px; font-weight: 600; cursor: pointer;
}

.detail-block, .m3-card {
  background: var(--md-surface);
  border: 1px solid var(--md-outline-variant);
  border-radius: var(--md-radius);
  padding: 16px;
  margin-bottom: 12px;
  font-size: 15px; line-height: 1.5;
  box-shadow: var(--md-shadow);
}
.meta-line { color: var(--md-on-surface-variant); margin-top: 6px; font-weight: 500; font-size: 14px; }
.map-link { display: inline-block; margin: 10px 0; color: var(--md-primary); font-weight: 600; }
.no-pin { color: var(--md-on-surface-variant); font-weight: 500; }
.r { color: var(--md-error); }
.g { color: var(--md-success); }
.empty {
  text-align: center; padding: 32px 16px; color: var(--md-on-surface-variant); font-weight: 500;
}

.form-panel {
  background: var(--md-surface); border-radius: var(--md-radius);
  padding: 16px; border: 1px solid var(--md-outline-variant);
  box-shadow: var(--md-shadow);
}
.form-panel label {
  display: block; font-size: 12px; font-weight: 600;
  color: var(--md-on-surface-variant); margin: 12px 0 6px;
}
.screen-form {
  display: flex; flex-direction: column;
  min-height: calc(100dvh - 120px);
}
.form-scroll {
  flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding-bottom: 24px;
}
.form-bottom-spacer { height: 100px; }
.form-save-bar {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(72px + var(--safe-b));
  width: 100%; max-width: 480px; z-index: 5000;
  background: var(--md-surface);
  border-top: 1px solid var(--md-outline-variant);
  box-shadow: 0 -6px 20px rgba(26, 28, 30, 0.08);
  padding: 12px 16px calc(12px + var(--safe-b));
}
.form-save-bar .mega-btn { margin-bottom: 0; }

/* ——— Map ——— */
.map-block {
  position: relative; z-index: 0; isolation: isolate;
  margin: 10px 0; border-radius: var(--md-radius); overflow: hidden;
  border: 1px solid var(--md-outline-variant); background: var(--md-surface-container);
}
.loc-map {
  height: 220px; min-height: 220px; max-height: 220px; width: 100%;
  position: relative; z-index: 0; overflow: hidden !important;
  background: var(--md-surface-container);
}
.loc-map .leaflet-container {
  width: 100% !important; height: 220px !important; max-height: 220px !important;
  z-index: 0 !important; font: inherit;
}
.loc-map .leaflet-pane,
.loc-map .leaflet-map-pane,
.loc-map .leaflet-tile-pane,
.loc-map .leaflet-overlay-pane,
.loc-map .leaflet-shadow-pane,
.loc-map .leaflet-marker-pane,
.loc-map .leaflet-tooltip-pane,
.loc-map .leaflet-popup-pane { z-index: auto !important; }
.loc-map .leaflet-control-container { z-index: 2 !important; }
.loc-map .leaflet-top,
.loc-map .leaflet-bottom { z-index: 2 !important; }
.loc-gps-btn {
  width: 100%; border: none; border-radius: var(--md-radius-full);
  min-height: var(--md-btn-h); padding: 12px 16px;
  background: var(--md-primary); color: #fff; font-weight: 600; font-size: 15px;
  cursor: pointer; margin: 8px 0; font-family: inherit;
}
.loc-preview-box {
  position: relative; z-index: 1; margin: 10px 0 14px;
  background: var(--md-primary-container); border: none;
  border-radius: var(--md-radius); padding: 14px;
}
.loc-preview-label {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.04em; color: var(--md-on-surface-variant); margin-bottom: 6px;
}
.loc-preview {
  font-size: 14px; font-weight: 500; color: var(--md-on-primary-container);
  line-height: 1.45; white-space: pre-wrap; word-break: break-word;
}
.loc-coords {
  margin-top: 8px; font-size: 12px; font-weight: 500;
  color: var(--md-on-surface-variant); font-variant-numeric: tabular-nums;
}
.loc-results {
  position: relative; z-index: 10; background: var(--md-surface);
  border: 1px solid var(--md-outline-variant); border-radius: var(--md-radius);
  margin: 6px 0; max-height: 160px; overflow-y: auto;
}
.loc-results button {
  display: block; width: 100%; text-align: left; border: none;
  border-bottom: 1px solid var(--md-outline-variant);
  background: #fff; padding: 12px; font-size: 13px; font-weight: 500; cursor: pointer;
  white-space: normal; word-break: break-word; line-height: 1.35; font-family: inherit;
}

/* ——— Modals ——— */
.modal {
  position: fixed; inset: 0; background: rgba(26, 28, 30, 0.4); z-index: 100;
  display: grid; place-items: center; padding: 20px;
  backdrop-filter: blur(2px);
}
.modal[hidden] { display: none !important; }
.modal-box {
  width: min(400px, 100%); background: var(--md-surface);
  border-radius: var(--md-radius-lg); padding: 20px;
  box-shadow: var(--md-shadow-lg);
}
.modal-box h3 { margin: 0 0 12px; font-size: 18px; font-weight: 700; color: var(--md-on-surface); }
.modal-foot { display: flex; gap: 10px; justify-content: flex-end; margin-top: 16px; }
.invoice-box { max-height: 90dvh; overflow-y: auto; }
.invoice-body {
  background: var(--md-surface-dim); border: 1px solid var(--md-outline-variant);
  border-radius: var(--md-radius); padding: 14px 16px; font-size: 14px; line-height: 1.55;
  font-weight: 500; color: var(--md-on-surface); white-space: pre-wrap; word-break: break-word;
}
.invoice-body .inv-line {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 8px 0; border-bottom: 1px solid var(--md-outline-variant);
}
.invoice-body .inv-line:last-child { border-bottom: none; }
.invoice-body .inv-title { font-weight: 700; color: var(--md-primary); margin-bottom: 10px; font-size: 15px; }
.invoice-body .inv-foot { margin-top: 12px; font-size: 12px; color: var(--md-on-surface-variant); font-weight: 500; }
.invoice-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.invoice-actions a, .invoice-actions button { text-align: center; width: 100%; }
.invoice-delete-zone {
  margin-top: 8px; padding-top: 12px;
  border-top: 1px dashed var(--md-outline-variant);
}
.invoice-delete-hint {
  margin: 0 0 8px; font-size: 12px; font-weight: 600;
  color: var(--md-on-surface-variant); line-height: 1.4; text-align: center;
}
.btn-danger-inv {
  border: 1px solid #fecaca; border-radius: var(--md-radius-full);
  min-height: 44px; padding: 10px 18px; font-weight: 700; font-size: 14px;
  cursor: pointer; font-family: inherit; width: 100%;
  background: #fef2f2; color: #b91c1c;
}
.btn-danger-inv:disabled { opacity: 0.6; }
.btn-danger-inv:active { transform: scale(0.99); }
.hist-sale-actions { display: flex; flex-direction: column; gap: 6px; flex-shrink: 0; }
.btn-danger-sm {
  border: 1px solid #fecaca; background: #fef2f2; color: #b91c1c;
  font-weight: 700; font-size: 12px; border-radius: 999px;
  min-height: 32px; padding: 4px 12px; cursor: pointer; font-family: inherit;
}
.btn-ghost, .btn-ok {
  border: none; border-radius: var(--md-radius-full);
  min-height: 44px; padding: 10px 18px; font-weight: 600; font-size: 14px;
  cursor: pointer; font-family: inherit;
}
.btn-ghost { background: var(--md-surface-container); color: var(--md-on-surface); }
.btn-ok { background: var(--md-primary); color: #fff; }

.exp-list { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.exp-row {
  padding: 10px 12px; border-radius: var(--md-radius);
  border: 1px solid var(--md-outline-variant); background: var(--md-surface);
  font-size: 13px; font-weight: 600;
}
.exp-row .meta { font-size: 12px; color: var(--md-on-surface-variant); margin-top: 2px; font-weight: 500; }
.exp-row .exp-st {
  display: inline-block; margin-left: 6px; font-size: 11px; font-weight: 800;
  padding: 2px 8px; border-radius: 999px;
}
.exp-row.exp-pending { border-color: #fcd34d; background: #fffbeb; }
.exp-row.exp-pending .exp-st { background: #fef3c7; color: #92400e; }
.exp-row.exp-ok .exp-st { background: #d1fae5; color: #065f46; }
.exp-row.exp-no { opacity: 0.7; }
.exp-row.exp-no .exp-st { background: #fee2e2; color: #991b1b; }

/* Simple compound pick: search + tap */
.compound-pick-list {
  margin-top: 8px;
  max-height: 220px;
  overflow-y: auto;
  border: 1px solid var(--md-outline-variant);
  border-radius: var(--md-radius);
  background: var(--md-surface);
}
.compound-pick-row {
  display: block;
  width: 100%;
  text-align: left;
  border: none;
  border-bottom: 1px solid var(--md-outline-variant);
  background: transparent;
  padding: 12px 14px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  color: var(--md-on-surface);
}
.compound-pick-row:last-child { border-bottom: none; }
.compound-pick-row:active { background: var(--md-surface-container); }
.compound-pick-row.on {
  background: var(--md-primary-container, #e0f2fe);
  color: var(--md-primary, #0369a1);
}
.compound-pick-empty {
  padding: 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--md-on-surface-variant);
}

/* Add customer: short form, extra sections fold */
.add-more-details {
  margin: 12px 0;
  border: 1px solid var(--md-outline-variant);
  border-radius: var(--md-radius);
  padding: 0 12px 10px;
  background: var(--md-surface);
}
.add-more-details > summary {
  font-weight: 700;
  font-size: 14px;
  padding: 12px 0;
  cursor: pointer;
  list-style: none;
  color: var(--md-primary, #0369a1);
}
.add-more-details > summary::-webkit-details-marker { display: none; }
.add-more-details[open] > summary { border-bottom: 1px solid var(--md-outline-variant); margin-bottom: 10px; }

/* ——— Route ——— */
.route-card {
  display: flex; gap: 12px; background: var(--md-surface);
  border: 1px solid var(--md-outline-variant); border-radius: var(--md-radius);
  padding: 14px 16px; margin-bottom: 10px; box-shadow: var(--md-shadow);
}
.route-card.done { opacity: 0.65; background: var(--md-success-container); border-color: transparent; }
.route-no {
  width: 36px; height: 36px; border-radius: var(--md-radius-full);
  background: var(--md-primary); color: #fff;
  font-weight: 700; font-size: 15px; display: grid; place-items: center; flex-shrink: 0;
}
.route-body { flex: 1; min-width: 0; }
.route-body strong { font-size: 15px; font-weight: 700; }
.route-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.badge-done { font-size: 12px; font-weight: 700; color: var(--md-success); padding: 10px 0; }

/* ——— Action chips / contact ——— */
.btn-call, .btn-wa, .btn-map, .btn-go {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 40px; padding: 8px 14px; border-radius: var(--md-radius-full);
  font-weight: 600; font-size: 13px; text-decoration: none; border: none;
  cursor: pointer; letter-spacing: 0.01em; font-family: inherit;
}
.btn-call { background: var(--md-primary); color: #fff; }
.btn-wa { background: var(--md-success); color: #fff; }
.btn-map { background: var(--md-surface-container); color: var(--md-primary); }
.btn-go { background: var(--md-success); color: #fff; }
.btn-call.sm, .btn-wa.sm, .btn-map.sm, .btn-go.sm {
  min-height: 36px; padding: 6px 12px; min-width: 44px; font-size: 12px;
}
.contact-row {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 14px 0 8px;
}
.contact-row .btn-call, .contact-row .btn-wa {
  min-height: 44px; padding: 10px; font-size: 14px;
}
.profile-actions {
  display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin: 14px 0 4px;
}
.profile-actions a, .profile-actions button {
  min-height: 44px; border-radius: var(--md-radius-full); font-weight: 600; font-size: 12px;
}

/* ——— IB ref pill ——— */
.ib-ref {
  display: inline-block; margin-left: 6px; padding: 2px 10px; border-radius: var(--md-radius-full);
  background: var(--md-primary-container); color: var(--md-on-primary-container);
  font-size: 11px; font-weight: 700; letter-spacing: 0.02em; vertical-align: middle;
}
.ib-ref.big { display: inline-block; margin: 8px 0; margin-left: 0; padding: 6px 12px; font-size: 13px; }

/* ——— Proof / calc / history ——— */
.proof-block {
  background: var(--md-surface); border: 1.5px dashed var(--md-outline);
  border-radius: var(--md-radius); padding: 14px; margin-bottom: 10px;
}
.proof-label { display: block; font-size: 14px; font-weight: 600; color: var(--md-on-surface); cursor: pointer; }
.proof-label input[type="file"] { display: block; width: 100%; margin-top: 8px; font-size: 13px; }
.proof-preview {
  display: block; width: 100%; max-height: 160px; object-fit: cover;
  border-radius: var(--md-radius-sm); margin-top: 10px; border: 1px solid var(--md-outline-variant);
}

.calc-hint { margin: 4px 0 12px; font-size: 13px; font-weight: 500; color: var(--md-on-surface-variant); }
.calc-box {
  background: var(--md-primary-container); border: none; border-radius: var(--md-radius);
  padding: 14px 16px; margin: 10px 0 14px;
}
.calc-line {
  display: flex; justify-content: space-between; gap: 10px;
  font-size: 14px; font-weight: 600; padding: 8px 0;
  border-bottom: 1px solid rgba(21, 101, 192, 0.12);
}
.calc-line:last-child { border-bottom: 0; }
.calc-line strong { color: var(--md-on-primary-container); }
.calc-line.muted { color: var(--md-on-surface-variant); font-weight: 500; }
.calc-line.muted strong { color: var(--md-error); }

.memory-banner {
  margin: 10px 0 0; padding: 12px 14px; border-radius: var(--md-radius);
  background: var(--md-primary-container); color: var(--md-on-primary-container);
  font-size: 13px; font-weight: 600; line-height: 1.35; border: none;
}
.credit-outline {
  margin: 10px 0 0; padding: 12px 14px; border-radius: var(--md-radius);
  background: var(--md-error-container); color: var(--md-error);
  font-size: 13px; font-weight: 600; line-height: 1.4; border: none;
}
.credit-outline strong { display: block; font-size: 16px; margin-top: 2px; }

.filter-row { display: flex; gap: 8px; margin: 0 0 12px; flex-wrap: wrap; }
.filter-chip {
  border: 1px solid var(--md-outline); background: var(--md-surface);
  color: var(--md-on-surface); font-weight: 600; font-size: 13px;
  padding: 8px 14px; border-radius: var(--md-radius-full); cursor: pointer;
  font-family: inherit; min-height: 36px;
}
.filter-chip.active {
  background: var(--md-primary); color: #fff; border-color: var(--md-primary);
}

.contact-verify {
  margin: 10px 0; padding: 14px; border-radius: var(--md-radius);
  background: var(--md-success-container); font-weight: 600; font-size: 14px; border: none;
}
.contact-verify-actions { display: flex; gap: 8px; margin-top: 10px; }
.add-step-contacts {
  margin: 0 0 16px;
  padding: 16px;
  border-radius: var(--md-radius-lg);
  background: linear-gradient(160deg, #E3F2FD 0%, #F0F9FF 100%);
  border: 2px solid #90CAF9;
}
.add-step-badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: #1565C0;
  background: #fff;
  border: 1px solid #90CAF9;
  border-radius: 999px;
  padding: 4px 10px;
  margin-bottom: 8px;
}
.add-step-badge.soft {
  color: #64748b;
  border-color: #e2e8f0;
  background: #f8fafc;
}
.add-step-lead {
  margin: 0 0 12px;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.35;
  color: #0D47A1;
}
.contacts-mega {
  width: 100%;
  min-height: 56px;
  font-size: 18px !important;
}
#btn-skip-contact {
  display: block;
  width: 100%;
  text-align: center;
  font-size: 14px;
  font-weight: 700;
}

.contact-fix-sheet {
  position: fixed; inset: 0; z-index: 120;
  display: flex; align-items: flex-end; justify-content: center;
}
.contact-fix-sheet[hidden] { display: none !important; }
.contact-fix-backdrop {
  position: absolute; inset: 0; background: rgba(15, 23, 42, 0.45);
}
.contact-fix-panel {
  position: relative; width: 100%; max-width: 480px;
  background: #fff; border-radius: 20px 20px 0 0;
  padding: 20px 18px calc(20px + env(safe-area-inset-bottom, 0px));
  box-shadow: 0 -8px 32px rgba(15,23,42,.2);
}
.contact-fix-actions {
  display: grid; gap: 8px; margin-top: 16px;
}
.num-pad {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 10px 0 14px;
}
.num-pad button {
  font-size: 20px; font-weight: 600; min-height: 48px; padding: 12px 0;
  border-radius: var(--md-radius); border: 1px solid var(--md-outline-variant);
  background: var(--md-surface); color: var(--md-on-surface); cursor: pointer; font-family: inherit;
}
.num-pad button:active { background: var(--md-primary-container); }
.num-pad button.pad-muted { color: var(--md-on-surface-variant); font-size: 16px; }

.browser-install-tip {
  margin: 8px 16px 0; padding: 12px 14px; border-radius: var(--md-radius);
  background: var(--md-primary-container); color: var(--md-on-primary-container);
  font-size: 13px; font-weight: 600; line-height: 1.35;
}

.day-end-grid { display: flex; flex-direction: column; gap: 4px; }
.day-end-row {
  display: flex; justify-content: space-between; gap: 12px; font-size: 14px;
  padding: 8px 0; border-bottom: 1px solid var(--md-outline-variant);
}
.day-end-row strong { color: var(--md-primary); }
.day-end-stop {
  padding: 8px 0; border-bottom: 1px solid var(--md-outline-variant);
  font-size: 13px; color: var(--md-on-surface-variant);
}
.day-end-stop strong { display: block; color: var(--md-on-surface); font-size: 14px; margin-bottom: 2px; }
.history-panel { margin-top: 16px; }
.history-card {
  display: block; width: 100%; text-align: left; margin: 0 0 10px;
  padding: 14px 16px; border-radius: var(--md-radius);
  border: 1px solid var(--md-outline-variant); background: var(--md-surface);
  font: inherit; cursor: pointer; box-shadow: var(--md-shadow);
}
.history-card strong { display: block; color: var(--md-on-surface); font-size: 15px; margin-bottom: 4px; }
.history-card span { display: block; font-size: 12px; color: var(--md-on-surface-variant); line-height: 1.4; }

/* ——— Orders ——— */
.order-req-card {
  background: var(--md-surface); border: 1px solid var(--md-outline-variant);
  border-radius: var(--md-radius); padding: 14px 16px; margin: 0 0 10px;
  box-shadow: var(--md-shadow);
}
.order-req-card.open { border-color: transparent; background: #FFF8E1; }
.order-req-card strong { display: block; font-size: 16px; color: var(--md-on-surface); font-weight: 700; }
.order-req-card .meta {
  font-size: 13px; color: var(--md-on-surface-variant); font-weight: 500; margin: 4px 0; line-height: 1.35;
}
.order-req-card .req-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.order-req-card .req-actions .btn-go,
.order-req-card .req-actions a,
.order-req-card .req-actions button {
  font-size: 13px; font-weight: 600; padding: 8px 14px; border-radius: var(--md-radius-full);
  border: none; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center;
  min-height: 36px; font-family: inherit;
}
.order-req-card .btn-accept { background: var(--md-success); color: #fff; }
.order-req-card .btn-done { background: var(--md-primary); color: #fff; }
.share-order-hint {
  font-size: 13px; color: var(--md-on-surface-variant); font-weight: 500;
  margin: 0 0 12px; line-height: 1.4;
}

/* Credit desk — separate interface */
.credit-preview-box {
  margin: 0 0 12px;
  padding: 12px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: var(--md-radius, 12px);
}
.credit-diag-box {
  margin: 0 0 12px;
  padding: 12px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: var(--md-radius, 12px);
}
.credit-diag-list {
  margin: 0;
  padding-left: 18px;
  font-size: 13px;
  font-weight: 600;
  color: #78350f;
  line-height: 1.45;
}
.credit-diag-list li { margin: 4px 0; }
.credit-diag-list li.ok { color: #166534; }
.credit-diag-list li.warn { color: #b45309; }
.credit-diag-list li.bad { color: #b91c1c; }
.credit-list { margin-top: 8px; }
.credit-card {
  background: var(--md-surface, #fff);
  border: 1px solid var(--md-outline-variant, #e2e8f0);
  border-radius: var(--md-radius, 12px);
  padding: 12px;
  margin-bottom: 10px;
}
.credit-card.has-due { border-color: #fca5a5; background: #fff7f7; }
.credit-card .due-n {
  font-size: 20px; font-weight: 800; color: #b91c1c;
  font-variant-numeric: tabular-nums;
}
.credit-card .meta {
  font-size: 13px; color: var(--md-on-surface-variant, #64748b);
  font-weight: 500; margin: 4px 0 8px; line-height: 1.35;
}
.credit-card .actions {
  display: flex; flex-wrap: wrap; gap: 8px;
}
.credit-card .actions button,
.credit-card .actions a {
  font-size: 13px; font-weight: 600; padding: 8px 12px;
  border-radius: 999px; border: none; cursor: pointer;
  text-decoration: none; font-family: inherit; min-height: 36px;
  display: inline-flex; align-items: center;
  background: var(--md-primary, #0284c7); color: #fff;
}
.credit-card .actions .btn-soft {
  background: var(--md-surface-container, #e2e8f0); color: #0f172a;
}

/* Day route plan box */
.route-plan-box {
  margin: 0 0 14px;
  padding: 12px;
  background: var(--md-primary-container, #e0f2fe);
  border: 1px solid var(--md-outline-variant, #bae6fd);
  border-radius: var(--md-radius, 12px);
}
.route-plan-box .mega-btn { margin-top: 8px; width: 100%; }
.route-card.leftover { opacity: 0.72; border-style: dashed; }
.route-card.done { opacity: 0.55; }

/* Add customer — first sale + dispenser rental */
.add-first-sale {
  margin: 12px 0 8px;
  padding: 12px;
  background: var(--md-primary-container, #e0f2fe);
  border-radius: var(--md-radius, 12px);
  border: 1px solid var(--md-outline-variant, #bae6fd);
}
.add-first-sale[hidden] { display: none !important; }
.add-first-sale .step-title { margin-top: 4px; }
.add-first-sale .stepper { margin-bottom: 10px; }
.add-dispenser-box {
  margin: 8px 0 12px;
  padding: 12px;
  background: var(--md-surface, #fff);
  border: 1px solid var(--md-outline-variant, #e2e8f0);
  border-radius: var(--md-radius, 12px);
}
.check-row {
  display: flex !important;
  flex-direction: row !important;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 15px;
  margin-bottom: 8px;
  cursor: pointer;
}
.check-row input[type="checkbox"] {
  width: 22px;
  height: 22px;
  accent-color: var(--md-primary, #0284c7);
  flex-shrink: 0;
}

/* ——— Customer list / profile work UI ——— */
.cust-card-wrap {
  display: flex; gap: 8px; align-items: stretch; margin-bottom: 10px;
}
.cust-card-wrap .cust-card { flex: 1; margin: 0; align-items: flex-start; }
.cust-card-wrap.has-credit .cust-card { border-color: transparent; background: var(--md-error-container); }
.cust-card-wrap.has-bottles .cust-card { border-color: var(--md-primary-container); }
.cust-quick {
  display: flex; flex-direction: column; gap: 6px; justify-content: center;
}
.cust-work-stats {
  display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; margin: 0 0 14px;
}
.cust-stat {
  background: var(--md-surface); border: 1px solid var(--md-outline-variant);
  border-radius: var(--md-radius); padding: 12px 8px; text-align: center;
  box-shadow: var(--md-shadow); min-height: 72px;
  display: flex; flex-direction: column; justify-content: center;
}
.cust-stat.bottles { background: var(--md-primary-container); border-color: transparent; }
.cust-stat.credit { background: var(--md-error-container); border-color: transparent; }
.cust-stat-n {
  display: block; font-size: 20px; font-weight: 700; color: var(--md-primary); line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.cust-stat.credit .cust-stat-n { color: var(--md-error); }
.cust-stat-l {
  display: block; font-size: 11px; font-weight: 600;
  color: var(--md-on-surface-variant); margin-top: 4px;
}
.cust-work-hint {
  margin: 0 0 12px; font-size: 12px; font-weight: 500;
  color: var(--md-on-surface-variant); line-height: 1.35;
}
.work-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.work-chip {
  display: inline-block; font-size: 11px; font-weight: 600; padding: 4px 10px;
  border-radius: var(--md-radius-full); background: var(--md-surface-container);
  color: var(--md-on-surface-variant); border: none;
}
.work-chip.bottles { background: var(--md-primary-container); color: var(--md-on-primary-container); }
.work-chip.bottles.hot { background: var(--md-primary); color: #fff; }
.work-chip.credit { background: var(--md-error-container); color: var(--md-error); }
.work-chip.ok { background: var(--md-success-container); color: var(--md-success); }
.work-chip.muted { background: var(--md-surface-container); color: var(--md-on-surface-variant); }
.cust-side-nums { text-align: right; flex-shrink: 0; min-width: 52px; }
.side-bottles {
  font-size: 24px; font-weight: 700; color: var(--md-primary); line-height: 1; margin-bottom: 4px;
  font-variant-numeric: tabular-nums;
}
.cust-card-main { min-width: 0; flex: 1; }

/* Profile work panel */
.work-panel, .profile-hero {
  background: var(--md-surface); border: 1px solid var(--md-outline-variant);
  border-radius: var(--md-radius); padding: 16px; margin-bottom: 12px;
  box-shadow: var(--md-shadow);
}
.work-panel-title {
  font-size: 12px; font-weight: 700; color: var(--md-on-surface-variant);
  margin-bottom: 12px; text-transform: uppercase; letter-spacing: .05em;
}
.work-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.work-grid.three { grid-template-columns: 1fr 1fr 1fr; }
.work-tile {
  border-radius: var(--md-radius); padding: 14px 12px;
  border: none; background: var(--md-surface-container); text-align: center;
  min-height: 88px; display: flex; flex-direction: column; justify-content: center;
}
.work-tile.bottles { background: var(--md-primary-container); }
.work-tile.credit { background: var(--md-error-container); }
.work-tile.ok { background: var(--md-success-container); }
.work-tile-n {
  font-size: 26px; font-weight: 700; color: var(--md-primary); line-height: 1;
  font-variant-numeric: tabular-nums;
}
.work-tile.credit .work-tile-n { color: var(--md-error); }
.work-tile.ok .work-tile-n { color: var(--md-success); font-size: 22px; }
.work-tile-l { font-size: 11px; font-weight: 600; margin-top: 6px; color: var(--md-on-surface); }
.work-tile-h { font-size: 11px; font-weight: 500; color: var(--md-on-surface-variant); margin-top: 4px; line-height: 1.3; }
.work-meta-row {
  display: flex; flex-direction: column; gap: 4px; margin-top: 14px;
  font-size: 13px; font-weight: 500; color: var(--md-on-surface-variant);
}
.work-meta-row strong { color: var(--md-on-surface); }
.cust-history { display: flex; flex-direction: column; gap: 4px; }
.hist-row {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 12px 0; border-bottom: 1px solid var(--md-outline-variant);
}
.hist-row strong { display: block; font-size: 14px; color: var(--md-on-surface); font-weight: 600; }
.hist-row span { display: block; font-size: 12px; color: var(--md-on-surface-variant); font-weight: 500; margin-top: 2px; }
.inv-credit-banner {
  background: var(--md-error-container); color: var(--md-error);
  font-weight: 600; font-size: 13px; padding: 12px 14px; border-radius: var(--md-radius); margin: 0 0 10px;
}
.btn-wa.pulse-wa { animation: wa-pulse 1.2s ease-in-out infinite; }
@keyframes wa-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(46, 125, 50, 0.35); }
  50% { box-shadow: 0 0 0 8px rgba(46, 125, 50, 0); }
}

/* Secondary links row on home */
.home-links {
  display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 4px; justify-content: center;
}
.home-links button, .home-links .link-chip {
  border: none; background: transparent; color: var(--md-primary);
  font-size: 13px; font-weight: 600; padding: 8px 12px; cursor: pointer;
  font-family: inherit; border-radius: var(--md-radius-full);
}
.home-links button:hover, .home-links .link-chip:hover {
  background: var(--md-primary-container);
}
.sign-out-link {
  display: block; width: 100%; margin-top: 16px; text-align: center;
  border: none; background: none; color: var(--md-on-surface-variant);
  font-size: 13px; font-weight: 600; padding: 12px; cursor: pointer; font-family: inherit;
}

/* ——— Cash / pay today (v64) ——— */
.stat-card.tappable {
  cursor: pointer; text-align: left; font: inherit; width: 100%;
  appearance: none; -webkit-appearance: none;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.stat-card.tappable:active { transform: scale(0.98); }
.stat-sub {
  margin-top: 6px; font-size: 12px; font-weight: 600;
  color: var(--md-on-surface-variant);
}
.stat-card.cash .stat-sub { color: var(--md-success); }

.cash-today-chip {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  width: 100%; margin: 10px 0 4px; padding: 12px 14px;
  border: none; border-radius: var(--md-radius);
  background: var(--md-success-container); color: var(--md-success);
  font: inherit; font-weight: 600; font-size: 14px; cursor: pointer; text-align: left;
  box-shadow: var(--md-shadow);
}
.cash-today-chip[hidden] { display: none !important; }
.cash-today-chip-main { flex: 1; }
.cash-today-chip-go { font-size: 12px; font-weight: 700; opacity: 0.9; white-space: nowrap; }
.cash-today-chip:active { transform: scale(0.99); }

.pay-sheet {
  position: fixed; inset: 0; z-index: 200; display: flex; flex-direction: column; justify-content: flex-end;
}
.pay-sheet[hidden] { display: none !important; }
.pay-sheet-backdrop {
  position: absolute; inset: 0; background: rgba(26, 28, 30, 0.45);
}
.pay-sheet-panel {
  position: relative; z-index: 1;
  max-height: min(78dvh, 640px);
  background: var(--md-surface);
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -8px 32px rgba(0,0,0,0.18);
  display: flex; flex-direction: column;
  padding: 8px 0 calc(12px + var(--safe-b));
  max-width: 480px; width: 100%; margin: 0 auto;
  animation: sheet-up 0.22s ease-out;
}
@keyframes sheet-up {
  from { transform: translateY(24px); opacity: 0.6; }
  to { transform: translateY(0); opacity: 1; }
}
.pay-sheet-handle {
  width: 40px; height: 4px; border-radius: 999px;
  background: var(--md-outline); margin: 4px auto 10px;
}
.pay-sheet-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 12px; padding: 0 16px 10px;
}
.pay-sheet-head h3 {
  margin: 0; font-size: 18px; font-weight: 700; color: var(--md-on-surface);
}
.pay-sheet-sub {
  margin: 4px 0 0; font-size: 13px; font-weight: 600; color: var(--md-success);
}
.pay-sheet-close {
  width: 40px; height: 40px; border: none; border-radius: 999px;
  background: var(--md-surface-container); color: var(--md-on-surface);
  font-size: 22px; font-weight: 600; cursor: pointer; line-height: 1;
  flex-shrink: 0;
}
.pay-sheet-tabs {
  display: flex; gap: 6px; padding: 0 16px 12px; overflow-x: auto;
}
.pay-sheet-tab {
  border: 1px solid var(--md-outline); background: var(--md-surface);
  color: var(--md-on-surface); font-weight: 600; font-size: 13px;
  padding: 8px 14px; border-radius: 999px; cursor: pointer; font-family: inherit;
  white-space: nowrap;
}
.pay-sheet-tab.active {
  background: var(--md-primary); color: #fff; border-color: var(--md-primary);
}
.pay-sheet-list {
  flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding: 0 16px 8px;
}
.pay-sheet-row {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 12px;
  padding: 12px 0; border-bottom: 1px solid var(--md-outline-variant);
}
.pay-sheet-row strong {
  display: block; font-size: 15px; font-weight: 700; color: var(--md-on-surface);
}
.pay-sheet-row span {
  display: block; font-size: 12px; font-weight: 500;
  color: var(--md-on-surface-variant); margin-top: 3px;
}
.pay-sheet-amt {
  text-align: right; font-size: 16px; font-weight: 700; color: var(--md-success);
  white-space: nowrap; font-variant-numeric: tabular-nums;
}
.pay-sheet-empty {
  text-align: center; padding: 28px 12px; color: var(--md-on-surface-variant);
  font-weight: 600; font-size: 14px;
}

/* ——— Work bar: always on main interface while working (v66) ——— */
.work-bar {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0;
  background: var(--md-surface);
  border-bottom: 1px solid var(--md-outline-variant);
  box-shadow: 0 2px 10px rgba(21, 101, 192, 0.08);
  position: sticky;
  top: 0;
  z-index: 45;
  max-width: 480px;
  margin: 0 auto;
}
.work-bar-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: 56px;
  padding: 8px 2px;
  border: none;
  border-right: 1px solid var(--md-outline-variant);
  background: transparent;
  font: inherit;
  cursor: pointer;
  color: var(--md-on-surface);
  -webkit-tap-highlight-color: transparent;
}
.work-bar-item:last-child { border-right: none; }
.work-bar-item.muted { cursor: default; }
.work-bar-item:not(.muted):active { background: var(--md-primary-container); }
.work-bar-item.cash .work-bar-n { color: var(--md-success); }
.work-bar-item.credit .work-bar-n { color: var(--md-error); }
.work-bar-item.credit:not(.muted):active { background: var(--md-error-container); }
.credit-today-chip {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  width: 100%; margin: 10px 0 4px; padding: 12px 14px;
  border: none; border-radius: var(--md-radius);
  background: var(--md-error-container); color: var(--md-error);
  font: inherit; font-weight: 600; font-size: 14px; cursor: pointer; text-align: left;
  box-shadow: var(--md-shadow);
}
.credit-today-chip[hidden] { display: none !important; }
.credit-today-chip:active { transform: scale(0.99); }

.price-chip-row {
  display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 10px;
}
.price-chip-row .filter-chip { min-height: 36px; }
.coupon-tick-list {
  max-height: 220px; overflow-y: auto; margin: 0 0 8px;
  border: 1px solid var(--md-outline-variant); border-radius: var(--md-radius);
  background: var(--md-surface);
}
.coupon-tick-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-bottom: 1px solid var(--md-outline-variant);
  font-weight: 600; font-size: 14px; cursor: pointer;
}
.coupon-tick-row:last-child { border-bottom: none; }
.coupon-tick-row input { width: 18px; height: 18px; }
.coupon-tick-row.checked { background: var(--md-success-container); }
.coupon-tick-empty { padding: 14px; color: var(--md-on-surface-variant); font-weight: 600; font-size: 13px; }
.coupon-pack-details {
  border-top: 1px solid var(--md-outline-variant);
  padding-top: 10px;
}
.coupon-pack-details summary { list-style: none; }
.coupon-pack-details summary::-webkit-details-marker { display: none; }
.coupon-marked-chips {
  display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 4px;
}
.coupon-chip-on {
  border: none;
  background: var(--md-success-container, #d1fae5);
  color: #065f46;
  font-weight: 700;
  font-size: 13px;
  padding: 8px 12px;
  border-radius: 999px;
  cursor: pointer;
  min-height: 36px;
}
.coupon-chip-on:active { transform: scale(0.98); }
#del-coupon-mark-btn:not([hidden]) { margin: 8px 0; }
#del-coupon-match-hint { color: #047857; font-weight: 700; }

/* Sales history — full stop details for salesman */
.history-day { margin-bottom: 10px; }
.history-day-toggle.active {
  border-color: var(--md-primary);
  background: var(--md-primary-container);
}
.history-day-body {
  background: var(--md-surface);
  border: 1px solid var(--md-outline-variant);
  border-top: none;
  border-radius: 0 0 var(--md-radius) var(--md-radius);
  padding: 4px 12px 10px;
  margin-top: -4px;
}
.hist-sale-row {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 10px;
  padding: 12px 0; border-bottom: 1px solid var(--md-outline-variant);
}
.hist-sale-row:last-child { border-bottom: none; }
.hist-sale-main { min-width: 0; flex: 1; }
.hist-sale-main strong {
  display: block; font-size: 14px; font-weight: 700; color: var(--md-on-surface);
}
.hist-sale-main span {
  display: block; font-size: 12px; font-weight: 500;
  color: var(--md-on-surface-variant); margin-top: 3px; line-height: 1.35;
}
.hist-sale-amt { color: var(--md-primary) !important; font-weight: 700 !important; }
.hist-sale-receipt { flex-shrink: 0; margin-top: 2px; }
.work-bar-n {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.1;
  color: var(--md-primary);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}
.work-bar-l {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--md-on-surface-variant);
  text-align: center;
  line-height: 1.15;
}
@media (max-width: 360px) {
  .work-bar-n { font-size: 14px; }
  .work-bar-l { font-size: 8px; }
  .work-bar-item { min-height: 52px; padding: 6px 1px; }
}

/* Small ? help tips — tap to read */
.help-tip {
  display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px; margin-left: 4px; border-radius: 50%;
  background: #E2E8F0; color: #475569; font-size: 12px; font-weight: 800;
  cursor: pointer; vertical-align: middle; position: relative; user-select: none;
  border: none; padding: 0; line-height: 1;
}
.help-tip:hover::after, .help-tip:focus::after, .help-tip.is-open::after {
  content: attr(data-tip);
  position: absolute; left: 50%; bottom: calc(100% + 8px); transform: translateX(-50%);
  width: min(260px, 78vw); padding: 10px 12px; background: #0f172a; color: #fff;
  font-size: 13px; font-weight: 600; line-height: 1.35; border-radius: 10px; z-index: 80;
  white-space: normal; text-align: left; box-shadow: 0 8px 24px rgba(15,23,42,.3);
  text-transform: none; letter-spacing: 0;
}
.help-tip:hover::before, .help-tip:focus::before, .help-tip.is-open::before {
  content: ""; position: absolute; left: 50%; bottom: calc(100% + 2px);
  transform: translateX(-50%); border: 6px solid transparent; border-top-color: #0f172a; z-index: 81;
}
.step-title .help-tip, .big-label .help-tip, .af-body label .help-tip, .ph-sub .help-tip {
  margin-left: 6px;
}

